@iobroker/adapter-react-v5 7.2.4 → 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 +6 -6
  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 +2 -2
  20. package/{Components → build/Components}/FileBrowser.js +229 -236
  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 +4 -4
  56. package/{Components → build/Components}/ObjectBrowser.js +1152 -1116
  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 +2 -2
  65. package/{Components → build/Components}/Schedule.js +242 -257
  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 -58
  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 -48
  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 -2560
  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 -8947
  322. package/src/Components/Router.tsx +0 -90
  323. package/src/Components/SaveCloseButtons.tsx +0 -117
  324. package/src/Components/Schedule.tsx +0 -1998
  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,69 +1,33 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
26
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
27
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
28
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
29
- };
30
- var __importDefault = (this && this.__importDefault) || function (mod) {
31
- return (mod && mod.__esModule) ? mod : { "default": mod };
32
- };
33
- var _a, _ObjectBrowserClass_NON_EXPERT_NAMESPACES;
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.ObjectBrowserClass = exports.ITEM_IMAGES = void 0;
36
- exports.getSelectIdIconFromObjects = getSelectIdIconFromObjects;
37
1
  /**
38
2
  * Copyright 2020-2024, Denis Haev <dogafox@gmail.com>
39
3
  *
40
4
  * MIT License
41
5
  *
42
6
  */
43
- const react_1 = __importStar(require("react"));
44
- const react_inlinesvg_1 = __importDefault(require("react-inlinesvg"));
45
- const material_1 = require("@mui/material");
7
+ import React, { Component, createRef } from 'react';
8
+ import SVG from 'react-inlinesvg';
9
+ import { Badge, Box, Button, Checkbox, CircularProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Fab, FormControl, FormControlLabel, Grid2, IconButton, Input, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Menu, MenuItem, Paper, Select, Snackbar, Switch, TextField, Tooltip, } from '@mui/material';
46
10
  // Icons
47
- const icons_material_1 = require("@mui/icons-material");
48
- const IconExpert_1 = __importDefault(require("../icons/IconExpert"));
49
- const IconAdapter_1 = __importDefault(require("../icons/IconAdapter"));
50
- const IconChannel_1 = __importDefault(require("../icons/IconChannel"));
51
- const IconCopy_1 = __importDefault(require("../icons/IconCopy"));
52
- const IconDevice_1 = __importDefault(require("../icons/IconDevice"));
53
- const IconDocument_1 = __importDefault(require("../icons/IconDocument"));
54
- const IconDocumentReadOnly_1 = __importDefault(require("../icons/IconDocumentReadOnly"));
55
- const IconInstance_1 = __importDefault(require("../icons/IconInstance"));
56
- const IconState_1 = __importDefault(require("../icons/IconState"));
57
- const IconClosed_1 = __importDefault(require("../icons/IconClosed"));
58
- const IconOpen_1 = __importDefault(require("../icons/IconOpen"));
59
- const IconClearFilter_1 = __importDefault(require("../icons/IconClearFilter"));
60
- const Connection_1 = __importDefault(require("../Connection"));
61
- const Icon_1 = __importDefault(require("./Icon"));
62
- const withWidth_1 = __importDefault(require("./withWidth"));
63
- const Utils_1 = __importDefault(require("./Utils")); // @iobroker/adapter-react-v5/Components/Utils
64
- const TabContainer_1 = __importDefault(require("./TabContainer"));
65
- const TabContent_1 = __importDefault(require("./TabContent"));
66
- const TabHeader_1 = __importDefault(require("./TabHeader"));
11
+ import { Add as AddIcon, ArrowRight as ArrowRightIcon, BedroomParent, BorderColor, Build as BuildIcon, CalendarToday as IconSchedule, Check as IconCheck, Close as IconClose, Code as IconScript, Construction, CreateNewFolder as IconFolder, Delete as IconDelete, Description as IconMeta, Edit as IconEdit, Error as IconError, FindInPage, FormatItalic as IconValueEdit, Info as IconInfo, Link as IconLink, ListAlt as IconEnum, LooksOne as LooksOneIcon, PersonOutlined as IconUser, Publish as PublishIcon, Refresh as RefreshIcon, Router as IconHost, Settings as IconConfig, SettingsApplications as IconSystem, DataObject as IconData, ShowChart as IconChart, SupervisedUserCircle as IconGroup, TextFields as TextFieldsIcon, ViewColumn as IconColumns, Wifi as IconConnection, WifiOff as IconDisconnected, } from '@mui/icons-material';
12
+ import { IconExpert } from '../icons/IconExpert';
13
+ import { IconAdapter } from '../icons/IconAdapter';
14
+ import { IconChannel } from '../icons/IconChannel';
15
+ import { IconCopy } from '../icons/IconCopy';
16
+ import { IconDevice } from '../icons/IconDevice';
17
+ import { IconDocument } from '../icons/IconDocument';
18
+ import { IconDocumentReadOnly } from '../icons/IconDocumentReadOnly';
19
+ import { IconInstance } from '../icons/IconInstance';
20
+ import { IconState } from '../icons/IconState';
21
+ import { IconClosed } from '../icons/IconClosed';
22
+ import { IconOpen } from '../icons/IconOpen';
23
+ import { IconClearFilter } from '../icons/IconClearFilter';
24
+ import { Connection } from '../Connection';
25
+ import { Icon } from './Icon';
26
+ import { withWidth } from './withWidth';
27
+ import { Utils } from './Utils'; // @iobroker/adapter-react-v5/Components/Utils
28
+ import { TabContainer } from './TabContainer';
29
+ import { TabContent } from './TabContent';
30
+ import { TabHeader } from './TabHeader';
67
31
  const ICON_SIZE = 24;
68
32
  const ROW_HEIGHT = 32;
69
33
  const ITEM_LEVEL = 16;
@@ -183,7 +147,7 @@ const styles = {
183
147
  width: '100%',
184
148
  '&:hover': {
185
149
  background: `${theme.palette.mode === 'dark' ? theme.palette.primary.dark : theme.palette.primary.light} !important`,
186
- color: Utils_1.default.invertColor(theme.palette.primary.main, true),
150
+ color: Utils.invertColor(theme.palette.primary.main, true),
187
151
  },
188
152
  whiteSpace: 'nowrap',
189
153
  flexWrap: 'nowrap',
@@ -549,7 +513,7 @@ const styles = {
549
513
  },
550
514
  itemSelected: (theme) => ({
551
515
  background: `${theme.palette.primary.main} !important`,
552
- color: `${Utils_1.default.invertColor(theme.palette.primary.main, true)} !important`,
516
+ color: `${Utils.invertColor(theme.palette.primary.main, true)} !important`,
553
517
  }),
554
518
  header: {
555
519
  width: '100%',
@@ -749,10 +713,10 @@ const styles = {
749
713
  },
750
714
  };
751
715
  function ButtonIcon(props) {
752
- return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 436 436", style: props === null || props === void 0 ? void 0 : props.style, width: "24", height: "24", className: "admin-button" },
753
- react_1.default.createElement("g", { fill: "currentColor" },
754
- react_1.default.createElement("path", { d: "m195.23077,24.30769c-36,3 -67,12 -96,26c-49,24 -82,61 -93,104l-3,11l-1,50c0,46 0,49 2,59l5,20c21,58 84,103 165,116c16,3 53,4 70,2c60,-6 111,-28 147,-64c21,-21 36,-49 40,-74a866,866 0 0 0 1,-104c-3,-18 -6,-28 -13,-43c-26,-52 -87,-90 -162,-101c-16,-2 -48,-3 -63,-2l1,0zm60,23c36,5 70,18 95,35c31,20 51,47 59,77c2,7 2,11 2,25c1,15 0,18 -2,26c-19,69 -104,117 -200,114c-47,-2 -90,-15 -124,-38c-31,-20 -51,-47 -59,-77c-3,-11 -4,-32 -2,-43c8,-42 41,-78 91,-101a260,260 0 0 1 140,-19l0,1zm-221,222c21,26 57,49 95,62c81,27 174,14 239,-32c14,-10 31,-27 41,-41c2,-2 2,-2 2,7c-1,23 -16,50 -38,72c-78,74 -233,74 -311,-1a121,121 0 0 1 -39,-76l0,-6l3,4l8,11z" }),
755
- react_1.default.createElement("path", { d: "m201.23077,47.30769c-40,3 -79,19 -104,44c-55,55 -38,133 37,171c52,26 122,24 172,-5c30,-17 51,-42 58,-71c3,-11 3,-34 0,-45c-6,-23 -21,-44 -40,-60l-27,-16a184,184 0 0 0 -96,-18zm30,21c56,5 100,35 112,75c4,11 4,30 0,41c-8,25 -26,45 -54,59a166,166 0 0 1 -160,-8a98,98 0 0 1 -41,-53c-5,-18 -2,-39 8,-57c23,-39 79,-62 135,-57z" }))));
716
+ return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 436 436", style: props?.style, width: "24", height: "24", className: "admin-button" },
717
+ React.createElement("g", { fill: "currentColor" },
718
+ React.createElement("path", { d: "m195.23077,24.30769c-36,3 -67,12 -96,26c-49,24 -82,61 -93,104l-3,11l-1,50c0,46 0,49 2,59l5,20c21,58 84,103 165,116c16,3 53,4 70,2c60,-6 111,-28 147,-64c21,-21 36,-49 40,-74a866,866 0 0 0 1,-104c-3,-18 -6,-28 -13,-43c-26,-52 -87,-90 -162,-101c-16,-2 -48,-3 -63,-2l1,0zm60,23c36,5 70,18 95,35c31,20 51,47 59,77c2,7 2,11 2,25c1,15 0,18 -2,26c-19,69 -104,117 -200,114c-47,-2 -90,-15 -124,-38c-31,-20 -51,-47 -59,-77c-3,-11 -4,-32 -2,-43c8,-42 41,-78 91,-101a260,260 0 0 1 140,-19l0,1zm-221,222c21,26 57,49 95,62c81,27 174,14 239,-32c14,-10 31,-27 41,-41c2,-2 2,-2 2,7c-1,23 -16,50 -38,72c-78,74 -233,74 -311,-1a121,121 0 0 1 -39,-76l0,-6l3,4l8,11z" }),
719
+ React.createElement("path", { d: "m201.23077,47.30769c-40,3 -79,19 -104,44c-55,55 -38,133 37,171c52,26 122,24 172,-5c30,-17 51,-42 58,-71c3,-11 3,-34 0,-45c-6,-23 -21,-44 -40,-60l-27,-16a184,184 0 0 0 -96,-18zm30,21c56,5 100,35 112,75c4,11 4,30 0,41c-8,25 -26,45 -54,59a166,166 0 0 1 -160,-8a98,98 0 0 1 -41,-53c-5,-18 -2,-39 8,-57c23,-39 79,-62 135,-57z" }))));
756
720
  }
757
721
  /**
758
722
  * Function that walks through all keys of an object or array and applies a function to each key.
@@ -879,7 +843,7 @@ function getName(name, lang) {
879
843
  }
880
844
  return name ? name.toString() : '';
881
845
  }
882
- function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
846
+ export function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
883
847
  // `admin` has prefix '.' and `web` has '../..'
884
848
  imagePrefix = imagePrefix || '.'; // http://localhost:8081';
885
849
  let src = '';
@@ -905,7 +869,7 @@ function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
905
869
  }
906
870
  }
907
871
  else if (aIcon.startsWith('data:image/svg')) {
908
- src = (react_1.default.createElement(react_inlinesvg_1.default, { className: "iconOwn", src: aIcon, width: 28, height: 28 }));
872
+ src = (React.createElement(SVG, { className: "iconOwn", src: aIcon, width: 28, height: 28 }));
909
873
  }
910
874
  else {
911
875
  src = aIcon;
@@ -957,7 +921,7 @@ function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
957
921
  }
958
922
  else if (cIcon.startsWith('data:image/svg')) {
959
923
  // if base 64 image
960
- src = (react_1.default.createElement(react_inlinesvg_1.default, { className: "iconOwn", src: cIcon, width: 28, height: 28 }));
924
+ src = (React.createElement(SVG, { className: "iconOwn", src: cIcon, width: 28, height: 28 }));
961
925
  }
962
926
  else {
963
927
  src = cIcon;
@@ -968,7 +932,6 @@ function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
968
932
  return src || null;
969
933
  }
970
934
  function applyFilter(item, filters, lang, objects, context, counter, customFilter, selectedTypes, _depth) {
971
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
972
935
  _depth = _depth || 0;
973
936
  let filteredOut = false;
974
937
  if (!context) {
@@ -989,15 +952,15 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
989
952
  context.role = filters.role.toLowerCase();
990
953
  }
991
954
  if (filters.room) {
992
- context.room = ((_c = (_b = objects[filters.room]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.members) || [];
955
+ context.room = objects[filters.room]?.common?.members || [];
993
956
  }
994
957
  if (filters.func) {
995
- context.func = ((_e = (_d = objects[filters.func]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.members) || [];
958
+ context.func = objects[filters.func]?.common?.members || [];
996
959
  }
997
960
  }
998
961
  const data = item.data;
999
962
  if (data && data.id) {
1000
- const common = (_f = data.obj) === null || _f === void 0 ? void 0 : _f.common;
963
+ const common = data.obj?.common;
1001
964
  if (customFilter) {
1002
965
  if (customFilter.type) {
1003
966
  if (typeof customFilter.type === 'string') {
@@ -1011,8 +974,8 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1011
974
  }
1012
975
  }
1013
976
  }
1014
- if (!filteredOut && ((_g = customFilter.common) === null || _g === void 0 ? void 0 : _g.type)) {
1015
- if (!(common === null || common === void 0 ? void 0 : common.type)) {
977
+ if (!filteredOut && customFilter.common?.type) {
978
+ if (!common?.type) {
1016
979
  filteredOut = true;
1017
980
  }
1018
981
  else if (typeof customFilter.common.type === 'string') {
@@ -1026,8 +989,8 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1026
989
  }
1027
990
  }
1028
991
  }
1029
- if (!filteredOut && ((_h = customFilter.common) === null || _h === void 0 ? void 0 : _h.role)) {
1030
- if (!(common === null || common === void 0 ? void 0 : common.role)) {
992
+ if (!filteredOut && customFilter.common?.role) {
993
+ if (!common?.role) {
1031
994
  filteredOut = true;
1032
995
  }
1033
996
  else if (typeof customFilter.common.role === 'string') {
@@ -1041,12 +1004,12 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1041
1004
  }
1042
1005
  }
1043
1006
  }
1044
- if (!filteredOut && ((_j = customFilter.common) === null || _j === void 0 ? void 0 : _j.custom) === '_' && (common === null || common === void 0 ? void 0 : common.custom)) {
1007
+ if (!filteredOut && customFilter.common?.custom === '_' && common?.custom) {
1045
1008
  filteredOut = true;
1046
1009
  }
1047
- else if (!filteredOut && ((_k = customFilter.common) === null || _k === void 0 ? void 0 : _k.custom) && ((_l = customFilter.common) === null || _l === void 0 ? void 0 : _l.custom) !== '_') {
1010
+ else if (!filteredOut && customFilter.common?.custom && customFilter.common?.custom !== '_') {
1048
1011
  const filterOfCustom = customFilter.common.custom;
1049
- if (!(common === null || common === void 0 ? void 0 : common.custom)) {
1012
+ if (!common?.custom) {
1050
1013
  filteredOut = true;
1051
1014
  }
1052
1015
  else if (filterOfCustom === '_dataSources') {
@@ -1077,7 +1040,7 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1077
1040
  data.id.startsWith('enum.') ||
1078
1041
  data.id.startsWith('_design/') ||
1079
1042
  data.id.endsWith('.admin') ||
1080
- !!(common === null || common === void 0 ? void 0 : common.expert);
1043
+ !!common?.expert;
1081
1044
  }
1082
1045
  if (!filteredOut && context.id) {
1083
1046
  if (data.fID === undefined) {
@@ -1153,14 +1116,13 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1153
1116
  return data.visible || data.hasVisibleChildren;
1154
1117
  }
1155
1118
  function getVisibleItems(item, type, objects, _result) {
1156
- var _b;
1157
1119
  _result = _result || [];
1158
1120
  const data = item.data;
1159
1121
  if (data.sumVisibility) {
1160
1122
  if (data.id && objects[data.id] && (!type || objects[data.id].type === type)) {
1161
1123
  _result.push(data.id);
1162
1124
  }
1163
- (_b = item.children) === null || _b === void 0 ? void 0 : _b.forEach(_item => getVisibleItems(_item, type, objects, _result));
1125
+ item.children?.forEach(_item => getVisibleItems(_item, type, objects, _result));
1164
1126
  }
1165
1127
  return _result;
1166
1128
  }
@@ -1168,34 +1130,34 @@ function getSystemIcon(objects, id, level, themeType, lang, imagePrefix) {
1168
1130
  let icon;
1169
1131
  // system or design has special icons
1170
1132
  if (id === 'alias' || id === 'alias.0') {
1171
- icon = (react_1.default.createElement(icons_material_1.Link, { className: "iconOwn", style: { color: COLOR_NAME_ALIAS(themeType) } }));
1133
+ icon = (React.createElement(IconLink, { className: "iconOwn", style: { color: COLOR_NAME_ALIAS(themeType) } }));
1172
1134
  }
1173
1135
  else if (id === '0_userdata' || id === '0_userdata.0') {
1174
- icon = (react_1.default.createElement(icons_material_1.DataObject, { className: "iconOwn", style: { color: COLOR_NAME_USERDATA(themeType) } }));
1136
+ icon = (React.createElement(IconData, { className: "iconOwn", style: { color: COLOR_NAME_USERDATA(themeType) } }));
1175
1137
  }
1176
1138
  else if (id.startsWith('_design/') || id === 'system') {
1177
- icon = (react_1.default.createElement(icons_material_1.SettingsApplications, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM(themeType) } }));
1139
+ icon = (React.createElement(IconSystem, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM(themeType) } }));
1178
1140
  }
1179
1141
  else if (id === 'system.adapter') {
1180
- icon = (react_1.default.createElement(icons_material_1.SettingsApplications, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM_ADAPTER(themeType) } }));
1142
+ icon = (React.createElement(IconSystem, { className: "iconOwn", style: { color: COLOR_NAME_SYSTEM_ADAPTER(themeType) } }));
1181
1143
  }
1182
1144
  else if (id === 'system.group') {
1183
- icon = react_1.default.createElement(icons_material_1.SupervisedUserCircle, { className: "iconOwn" });
1145
+ icon = React.createElement(IconGroup, { className: "iconOwn" });
1184
1146
  }
1185
1147
  else if (id === 'system.user') {
1186
- icon = react_1.default.createElement(icons_material_1.PersonOutlined, { className: "iconOwn" });
1148
+ icon = React.createElement(IconUser, { className: "iconOwn" });
1187
1149
  }
1188
1150
  else if (id === 'system.host') {
1189
- icon = react_1.default.createElement(icons_material_1.Router, { className: "iconOwn" });
1151
+ icon = React.createElement(IconHost, { className: "iconOwn" });
1190
1152
  }
1191
1153
  else if (id.endsWith('.connection') || id.endsWith('.connected')) {
1192
- icon = react_1.default.createElement(icons_material_1.Wifi, { className: "iconOwn" });
1154
+ icon = React.createElement(IconConnection, { className: "iconOwn" });
1193
1155
  }
1194
1156
  else if (id.endsWith('.info')) {
1195
- icon = react_1.default.createElement(icons_material_1.Info, { className: "iconOwn" });
1157
+ icon = React.createElement(IconInfo, { className: "iconOwn" });
1196
1158
  }
1197
1159
  else if (objects[id] && objects[id].type === 'meta') {
1198
- icon = react_1.default.createElement(icons_material_1.Description, { className: "iconOwn" });
1160
+ icon = React.createElement(IconMeta, { className: "iconOwn" });
1199
1161
  }
1200
1162
  else if (level < 2) {
1201
1163
  // detect "cloud.0"
@@ -1206,21 +1168,19 @@ function getSystemIcon(objects, id, level, themeType, lang, imagePrefix) {
1206
1168
  return icon || null;
1207
1169
  }
1208
1170
  function getObjectTooltip(data, lang) {
1209
- var _b, _c;
1210
- if ((_c = (_b = data === null || data === void 0 ? void 0 : data.obj) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.desc) {
1171
+ if (data?.obj?.common?.desc) {
1211
1172
  return getName(data.obj.common.desc, lang) || null;
1212
1173
  }
1213
1174
  return null;
1214
1175
  }
1215
1176
  function getIdFieldTooltip(data, lang) {
1216
1177
  const tooltip = getObjectTooltip(data, lang);
1217
- if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.startsWith('http')) {
1218
- return (react_1.default.createElement(material_1.Box, { component: "a", sx: styles.cellIdTooltipLink, href: tooltip, target: "_blank", rel: "noreferrer" }, tooltip));
1178
+ if (tooltip?.startsWith('http')) {
1179
+ return (React.createElement(Box, { component: "a", sx: styles.cellIdTooltipLink, href: tooltip, target: "_blank", rel: "noreferrer" }, tooltip));
1219
1180
  }
1220
- return react_1.default.createElement("span", { style: styles.cellIdTooltip }, tooltip || data.id || '');
1181
+ return React.createElement("span", { style: styles.cellIdTooltip }, tooltip || data.id || '');
1221
1182
  }
1222
1183
  function buildTree(objects, options) {
1223
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
1224
1184
  const imagePrefix = options.imagePrefix || '.';
1225
1185
  let ids = Object.keys(objects);
1226
1186
  ids.sort((a, b) => {
@@ -1288,12 +1248,12 @@ function buildTree(objects, options) {
1288
1248
  else if (obj.type === 'enum') {
1289
1249
  info.enums.push(id);
1290
1250
  }
1291
- else if (obj.type === 'instance' && common && (common.supportCustoms || ((_b = common.adminUI) === null || _b === void 0 ? void 0 : _b.custom))) {
1251
+ else if (obj.type === 'instance' && common && (common.supportCustoms || common.adminUI?.custom)) {
1292
1252
  info.hasSomeCustoms = true;
1293
1253
  info.customs.push(id.substring('system.adapter.'.length));
1294
1254
  }
1295
1255
  // Build a map of aliases
1296
- if (id.startsWith('alias.') && ((_c = obj.common.alias) === null || _c === void 0 ? void 0 : _c.id)) {
1256
+ if (id.startsWith('alias.') && obj.common.alias?.id) {
1297
1257
  if (typeof obj.common.alias.id === 'string') {
1298
1258
  const usedId = obj.common.alias.id;
1299
1259
  if (!info.aliasesMap[usedId]) {
@@ -1364,24 +1324,24 @@ function buildTree(objects, options) {
1364
1324
  const _cRoot = {
1365
1325
  data: {
1366
1326
  name: parts[parts.length - 1],
1367
- title: getName((_d = obj === null || obj === void 0 ? void 0 : obj.common) === null || _d === void 0 ? void 0 : _d.name, options.lang),
1327
+ title: getName(obj?.common?.name, options.lang),
1368
1328
  obj,
1369
1329
  parent: cRoot,
1370
1330
  icon: getSelectIdIconFromObjects(objects, id, options.lang, imagePrefix) ||
1371
1331
  getSystemIcon(objects, id, 0, options.themeType, options.lang, imagePrefix),
1372
1332
  id,
1373
- hasCustoms: !!(((_e = obj.common) === null || _e === void 0 ? void 0 : _e.custom) && Object.keys(obj.common.custom).length),
1333
+ hasCustoms: !!(obj.common?.custom && Object.keys(obj.common.custom).length),
1374
1334
  level: parts.length - 1,
1375
1335
  generated: false,
1376
1336
  button: obj.type === 'state' &&
1377
- !!((_f = obj.common) === null || _f === void 0 ? void 0 : _f.role) &&
1337
+ !!obj.common?.role &&
1378
1338
  typeof obj.common.role === 'string' &&
1379
1339
  obj.common.role.startsWith('button') &&
1380
- ((_g = obj.common) === null || _g === void 0 ? void 0 : _g.write) !== false,
1340
+ obj.common?.write !== false,
1381
1341
  switch: obj.type === 'state' &&
1382
- ((_h = obj.common) === null || _h === void 0 ? void 0 : _h.type) === 'boolean' &&
1383
- ((_j = obj.common) === null || _j === void 0 ? void 0 : _j.write) !== false &&
1384
- ((_k = obj.common) === null || _k === void 0 ? void 0 : _k.read) !== false,
1342
+ obj.common?.type === 'boolean' &&
1343
+ obj.common?.write !== false &&
1344
+ obj.common?.read !== false,
1385
1345
  },
1386
1346
  };
1387
1347
  cRoot.children = cRoot.children || [];
@@ -1422,9 +1382,8 @@ function buildTree(objects, options) {
1422
1382
  } while (repeat);
1423
1383
  }
1424
1384
  info.roomEnums.sort((a, b) => {
1425
- var _b, _c, _d, _e;
1426
- const aName = getName((_c = (_b = objects[a]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name, options.lang) || a.split('.').pop();
1427
- const bName = getName((_e = (_d = objects[b]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.name, options.lang) || b.split('.').pop();
1385
+ const aName = getName(objects[a]?.common?.name, options.lang) || a.split('.').pop();
1386
+ const bName = getName(objects[b]?.common?.name, options.lang) || b.split('.').pop();
1428
1387
  if (aName > bName) {
1429
1388
  return 1;
1430
1389
  }
@@ -1434,9 +1393,8 @@ function buildTree(objects, options) {
1434
1393
  return 0;
1435
1394
  });
1436
1395
  info.funcEnums.sort((a, b) => {
1437
- var _b, _c, _d, _e;
1438
- const aName = getName((_c = (_b = objects[a]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name, options.lang) || a.split('.').pop();
1439
- const bName = getName((_e = (_d = objects[b]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.name, options.lang) || b.split('.').pop();
1396
+ const aName = getName(objects[a]?.common?.name, options.lang) || a.split('.').pop();
1397
+ const bName = getName(objects[b]?.common?.name, options.lang) || b.split('.').pop();
1440
1398
  if (aName > bName) {
1441
1399
  return 1;
1442
1400
  }
@@ -1481,18 +1439,17 @@ function findNode(root, id, _parts, _path, _level) {
1481
1439
  return null;
1482
1440
  }
1483
1441
  function findRoomsForObject(info, id, lang, rooms) {
1484
- var _b, _c;
1485
1442
  if (!id) {
1486
1443
  return { rooms: [], per: false };
1487
1444
  }
1488
1445
  rooms = rooms || [];
1489
1446
  for (const room of info.roomEnums) {
1490
- const common = (_b = info.objects[room]) === null || _b === void 0 ? void 0 : _b.common;
1447
+ const common = info.objects[room]?.common;
1491
1448
  if (!common) {
1492
1449
  continue;
1493
1450
  }
1494
1451
  const name = getName(common.name, lang);
1495
- if (((_c = common.members) === null || _c === void 0 ? void 0 : _c.includes(id)) && !rooms.includes(name)) {
1452
+ if (common.members?.includes(id) && !rooms.includes(name)) {
1496
1453
  rooms.push(name);
1497
1454
  }
1498
1455
  }
@@ -1508,14 +1465,13 @@ function findRoomsForObject(info, id, lang, rooms) {
1508
1465
  return { rooms, per: !ownEnums }; // per is if the enums are from parent
1509
1466
  }
1510
1467
  function findEnumsForObjectAsIds(info, id, enumName, funcs) {
1511
- var _b, _c;
1512
1468
  if (!id) {
1513
1469
  return [];
1514
1470
  }
1515
1471
  funcs = funcs || [];
1516
1472
  for (let i = 0; i < info[enumName].length; i++) {
1517
- const common = (_b = info.objects[info[enumName][i]]) === null || _b === void 0 ? void 0 : _b.common;
1518
- if (((_c = common === null || common === void 0 ? void 0 : common.members) === null || _c === void 0 ? void 0 : _c.includes(id)) && !funcs.includes(info[enumName][i])) {
1473
+ const common = info.objects[info[enumName][i]]?.common;
1474
+ if (common?.members?.includes(id) && !funcs.includes(info[enumName][i])) {
1519
1475
  funcs.push(info[enumName][i]);
1520
1476
  }
1521
1477
  }
@@ -1523,18 +1479,17 @@ function findEnumsForObjectAsIds(info, id, enumName, funcs) {
1523
1479
  return funcs;
1524
1480
  }
1525
1481
  function findFunctionsForObject(info, id, lang, funcs) {
1526
- var _b, _c;
1527
1482
  if (!id) {
1528
1483
  return { funcs: [], pef: false };
1529
1484
  }
1530
1485
  funcs = funcs || [];
1531
1486
  for (let i = 0; i < info.funcEnums.length; i++) {
1532
- const common = (_b = info.objects[info.funcEnums[i]]) === null || _b === void 0 ? void 0 : _b.common;
1487
+ const common = info.objects[info.funcEnums[i]]?.common;
1533
1488
  if (!common) {
1534
1489
  continue;
1535
1490
  }
1536
1491
  const name = getName(common.name, lang);
1537
- if (((_c = common.members) === null || _c === void 0 ? void 0 : _c.includes(id)) && !funcs.includes(name)) {
1492
+ if (common.members?.includes(id) && !funcs.includes(name)) {
1538
1493
  funcs.push(name);
1539
1494
  }
1540
1495
  }
@@ -1570,12 +1525,12 @@ function quality2text(q) {
1570
1525
  */
1571
1526
  function formatValue(options) {
1572
1527
  const { dateFormat, state, isFloatComma, texts, obj } = options;
1573
- const states = Utils_1.default.getStates(obj);
1528
+ const states = Utils.getStates(obj);
1574
1529
  const isCommon = obj.common;
1575
1530
  let fileViewer;
1576
1531
  let v =
1577
1532
  // @ts-expect-error deprecated from js-controller 6
1578
- (isCommon === null || isCommon === void 0 ? void 0 : isCommon.type) === 'file'
1533
+ isCommon?.type === 'file'
1579
1534
  ? '[file]'
1580
1535
  : !state || state.val === null
1581
1536
  ? '(null)'
@@ -1583,9 +1538,9 @@ function formatValue(options) {
1583
1538
  ? '[undef]'
1584
1539
  : state.val;
1585
1540
  const type = typeof v;
1586
- if ((isCommon === null || isCommon === void 0 ? void 0 : isCommon.role) && typeof isCommon.role === 'string' && isCommon.role.match(/^value\.time|^date/)) {
1541
+ if (isCommon?.role && typeof isCommon.role === 'string' && isCommon.role.match(/^value\.time|^date/)) {
1587
1542
  if (v && typeof v === 'string') {
1588
- if (Utils_1.default.isStringInteger(v)) {
1543
+ if (Utils.isStringInteger(v)) {
1589
1544
  // we assume a unix ts
1590
1545
  v = new Date(parseInt(v, 10)).toString();
1591
1546
  }
@@ -1593,11 +1548,11 @@ function formatValue(options) {
1593
1548
  // check if parsable by new date
1594
1549
  try {
1595
1550
  const parsedDate = new Date(v);
1596
- if (Utils_1.default.isValidDate(parsedDate)) {
1551
+ if (Utils.isValidDate(parsedDate)) {
1597
1552
  v = parsedDate.toString();
1598
1553
  }
1599
1554
  }
1600
- catch (_b) {
1555
+ catch {
1601
1556
  // ignore
1602
1557
  }
1603
1558
  }
@@ -1605,7 +1560,7 @@ function formatValue(options) {
1605
1560
  else {
1606
1561
  if (v > 946681200 && v < 946681200000) {
1607
1562
  // '2000-01-01T00:00:00' => 946681200000
1608
- v *= 1000; // maybe the time is in seconds (UNIX time)
1563
+ v *= 1_000; // maybe the time is in seconds (UNIX time)
1609
1564
  }
1610
1565
  // "null" and undefined could not be here. See `let v = (isCommon && isCommon.type === 'file') ....` above
1611
1566
  v = v ? new Date(v).toString() : v;
@@ -1614,7 +1569,7 @@ function formatValue(options) {
1614
1569
  else {
1615
1570
  if (type === 'number') {
1616
1571
  if (!Number.isInteger(v)) {
1617
- v = Math.round(v * 100000000) / 100000000; // remove 4.00000000000000001
1572
+ v = Math.round(v * 100_000_000) / 100_000_000; // remove 4.00000000000000001
1618
1573
  if (isFloatComma) {
1619
1574
  v = v.toString().replace('.', ',');
1620
1575
  }
@@ -1642,7 +1597,7 @@ function formatValue(options) {
1642
1597
  valText.v = v;
1643
1598
  }
1644
1599
  }
1645
- if (isCommon === null || isCommon === void 0 ? void 0 : isCommon.unit) {
1600
+ if (isCommon?.unit) {
1646
1601
  valText.u = isCommon.unit;
1647
1602
  }
1648
1603
  let valFull;
@@ -1653,10 +1608,10 @@ function formatValue(options) {
1653
1608
  valFull.push({ t: texts.ack, v: state.ack.toString() });
1654
1609
  }
1655
1610
  if (state.ts) {
1656
- valFull.push({ t: texts.ts, v: state.ts ? Utils_1.default.formatDate(new Date(state.ts), dateFormat) : '' });
1611
+ valFull.push({ t: texts.ts, v: state.ts ? Utils.formatDate(new Date(state.ts), dateFormat) : '' });
1657
1612
  }
1658
1613
  if (state.lc) {
1659
- valFull.push({ t: texts.lc, v: state.lc ? Utils_1.default.formatDate(new Date(state.lc), dateFormat) : '' });
1614
+ valFull.push({ t: texts.lc, v: state.lc ? Utils.formatDate(new Date(state.lc), dateFormat) : '' });
1660
1615
  }
1661
1616
  if (state.from) {
1662
1617
  let from = state.from.toString();
@@ -1675,7 +1630,7 @@ function formatValue(options) {
1675
1630
  if (state.c) {
1676
1631
  valFull.push({ t: texts.c, v: state.c });
1677
1632
  }
1678
- valFull.push({ t: texts.quality, v: Utils_1.default.quality2text(state.q || 0).join(', '), nbr: true });
1633
+ valFull.push({ t: texts.quality, v: Utils.quality2text(state.q || 0).join(', '), nbr: true });
1679
1634
  }
1680
1635
  }
1681
1636
  return {
@@ -1689,7 +1644,7 @@ function formatValue(options) {
1689
1644
  */
1690
1645
  function getValueStyle(options) {
1691
1646
  const { state /* , isExpertMode, isButton */ } = options;
1692
- const color = (state === null || state === void 0 ? void 0 : state.ack) ? (state.q ? '#ffa500' : '') : '#ff2222c9';
1647
+ const color = state?.ack ? (state.q ? '#ffa500' : '') : '#ff2222c9';
1693
1648
  // do not show the color of the button in non-expert mode
1694
1649
  // if (!isExpertMode && isButton) {
1695
1650
  // color = '';
@@ -1729,22 +1684,22 @@ function prepareSparkData(values, from) {
1729
1684
  }
1730
1685
  return v;
1731
1686
  }
1732
- exports.ITEM_IMAGES = {
1733
- state: (react_1.default.createElement(IconState_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1734
- channel: (react_1.default.createElement(IconChannel_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1735
- device: (react_1.default.createElement(IconDevice_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1736
- adapter: (react_1.default.createElement(IconAdapter_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1737
- meta: (react_1.default.createElement(icons_material_1.Description, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1738
- instance: (react_1.default.createElement(IconInstance_1.default, { className: "itemIcon", style: { color: '#7da7ff', verticalAlign: 'middle' } })),
1739
- enum: (react_1.default.createElement(icons_material_1.ListAlt, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1740
- chart: (react_1.default.createElement(icons_material_1.ShowChart, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1741
- config: (react_1.default.createElement(icons_material_1.Settings, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1742
- group: (react_1.default.createElement(icons_material_1.SupervisedUserCircle, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1743
- user: (react_1.default.createElement(icons_material_1.PersonOutlined, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1744
- host: (react_1.default.createElement(icons_material_1.Router, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1745
- schedule: (react_1.default.createElement(icons_material_1.CalendarToday, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1746
- script: (react_1.default.createElement(icons_material_1.Code, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1747
- folder: (react_1.default.createElement(IconClosed_1.default, { className: "itemIcon itemIconFolder", style: { verticalAlign: 'middle' } })),
1687
+ export const ITEM_IMAGES = {
1688
+ state: (React.createElement(IconState, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1689
+ channel: (React.createElement(IconChannel, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1690
+ device: (React.createElement(IconDevice, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1691
+ adapter: (React.createElement(IconAdapter, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1692
+ meta: (React.createElement(IconMeta, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1693
+ instance: (React.createElement(IconInstance, { className: "itemIcon", style: { color: '#7da7ff', verticalAlign: 'middle' } })),
1694
+ enum: (React.createElement(IconEnum, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1695
+ chart: (React.createElement(IconChart, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1696
+ config: (React.createElement(IconConfig, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1697
+ group: (React.createElement(IconGroup, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1698
+ user: (React.createElement(IconUser, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1699
+ host: (React.createElement(IconHost, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1700
+ schedule: (React.createElement(IconSchedule, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1701
+ script: (React.createElement(IconScript, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1702
+ folder: (React.createElement(IconClosed, { className: "itemIcon itemIconFolder", style: { verticalAlign: 'middle' } })),
1748
1703
  };
1749
1704
  const SCREEN_WIDTHS = {
1750
1705
  // extra-small: 0px
@@ -1836,445 +1791,73 @@ const DEFAULT_FILTER = {
1836
1791
  custom: '',
1837
1792
  expertMode: false,
1838
1793
  };
1839
- class ObjectBrowserClass extends react_1.Component {
1794
+ export class ObjectBrowserClass extends Component {
1795
+ // do not define the type as null to save the performance, so we must check it every time
1796
+ info = {
1797
+ funcEnums: [],
1798
+ roomEnums: [],
1799
+ roles: [],
1800
+ ids: [],
1801
+ types: [],
1802
+ objects: {},
1803
+ customs: [],
1804
+ enums: [],
1805
+ hasSomeCustoms: false,
1806
+ aliasesMap: {},
1807
+ };
1808
+ localStorage = window._localStorage || window.localStorage;
1809
+ lastAppliedFilter = null;
1810
+ tableRef;
1811
+ filterRefs;
1812
+ pausedSubscribes = false;
1813
+ selectFirst;
1814
+ root = null;
1815
+ states = {};
1816
+ subscribes = [];
1817
+ unsubscribeTimer = null;
1818
+ statesUpdateTimer = null;
1819
+ objectsUpdateTimer = null;
1820
+ filterTimer = null;
1821
+ visibleCols;
1822
+ texts;
1823
+ possibleCols;
1824
+ imagePrefix;
1825
+ adapterColumns = [];
1826
+ styleTheme = '';
1827
+ edit = {
1828
+ id: '',
1829
+ val: '',
1830
+ q: 0,
1831
+ ack: false,
1832
+ };
1833
+ levelPadding;
1834
+ customWidth = false;
1835
+ resizeTimeout = null;
1836
+ resizerNextName = null;
1837
+ resizerActiveName = null;
1838
+ resizerCurrentWidths = {};
1839
+ resizeLeft = false;
1840
+ resizerOldWidth = 0;
1841
+ resizerMin = 0;
1842
+ resizerNextMin = 0;
1843
+ resizerOldWidthNext = 0;
1844
+ resizerPosition = 0;
1845
+ resizerActiveDiv = null;
1846
+ resizerNextDiv = null;
1847
+ storedWidths = null;
1848
+ systemConfig;
1849
+ objects;
1850
+ defaultHistory = '';
1851
+ columnsVisibility = {};
1852
+ changedIds = null;
1853
+ contextMenu = null;
1854
+ recordStates = [];
1855
+ styles = {};
1856
+ customColumnDialog = null;
1857
+ /** Namespaces which are allowed to be edited by non-expert users */
1858
+ static #NON_EXPERT_NAMESPACES = ['0_userdata.0.', 'alias.0.'];
1840
1859
  constructor(props) {
1841
1860
  super(props);
1842
- // do not define the type as null to save the performance, so we must check it every time
1843
- this.info = {
1844
- funcEnums: [],
1845
- roomEnums: [],
1846
- roles: [],
1847
- ids: [],
1848
- types: [],
1849
- objects: {},
1850
- customs: [],
1851
- enums: [],
1852
- hasSomeCustoms: false,
1853
- aliasesMap: {},
1854
- };
1855
- this.localStorage = window._localStorage || window.localStorage;
1856
- this.lastAppliedFilter = null;
1857
- this.pausedSubscribes = false;
1858
- this.root = null;
1859
- this.states = {};
1860
- this.subscribes = [];
1861
- this.unsubscribeTimer = null;
1862
- this.statesUpdateTimer = null;
1863
- this.objectsUpdateTimer = null;
1864
- this.filterTimer = null;
1865
- this.adapterColumns = [];
1866
- this.styleTheme = '';
1867
- this.edit = {
1868
- id: '',
1869
- val: '',
1870
- q: 0,
1871
- ack: false,
1872
- };
1873
- this.customWidth = false;
1874
- this.resizeTimeout = null;
1875
- this.resizerNextName = null;
1876
- this.resizerActiveName = null;
1877
- this.resizerCurrentWidths = {};
1878
- this.resizeLeft = false;
1879
- this.resizerOldWidth = 0;
1880
- this.resizerMin = 0;
1881
- this.resizerNextMin = 0;
1882
- this.resizerOldWidthNext = 0;
1883
- this.resizerPosition = 0;
1884
- this.resizerActiveDiv = null;
1885
- this.resizerNextDiv = null;
1886
- this.storedWidths = null;
1887
- this.defaultHistory = '';
1888
- this.columnsVisibility = {};
1889
- this.changedIds = null;
1890
- this.contextMenu = null;
1891
- this.recordStates = [];
1892
- this.styles = {};
1893
- this.customColumnDialog = null;
1894
- /**
1895
- * Context menu handler.
1896
- */
1897
- this.onContextMenu = (e) => {
1898
- // console.log(`CONTEXT MENU: ${this.contextMenu ? Date.now() - this.contextMenu.ts : 'false'}`);
1899
- if (this.contextMenu && Date.now() - this.contextMenu.ts < 2000) {
1900
- e.preventDefault();
1901
- this.setState({
1902
- showContextMenu: {
1903
- item: this.contextMenu.item,
1904
- position: { left: e.clientX + 2, top: e.clientY - 6 },
1905
- },
1906
- });
1907
- }
1908
- else if (this.state.showContextMenu) {
1909
- e.preventDefault();
1910
- this.setState({ showContextMenu: null });
1911
- }
1912
- this.contextMenu = null;
1913
- };
1914
- /**
1915
- * Called when a state changes.
1916
- */
1917
- this.onStateChange = (id, state) => {
1918
- console.log(`> stateChange ${id}`);
1919
- if (this.states[id]) {
1920
- const item = this.findItem(id);
1921
- if (item === null || item === void 0 ? void 0 : item.data.state) {
1922
- item.data.state = undefined;
1923
- }
1924
- }
1925
- if (state) {
1926
- this.states[id] = state;
1927
- }
1928
- else {
1929
- delete this.states[id];
1930
- }
1931
- if (!this.pausedSubscribes) {
1932
- if (!this.statesUpdateTimer) {
1933
- this.statesUpdateTimer = setTimeout(() => {
1934
- this.statesUpdateTimer = null;
1935
- this.forceUpdate();
1936
- }, 300);
1937
- }
1938
- }
1939
- else if (this.statesUpdateTimer) {
1940
- clearTimeout(this.statesUpdateTimer);
1941
- this.statesUpdateTimer = null;
1942
- }
1943
- };
1944
- this.onObjectChangeFromWorker = (events) => {
1945
- if (Array.isArray(events)) {
1946
- let newState = null;
1947
- events.forEach(event => {
1948
- const { newInnerState, filtered } = this.processOnObjectChangeElement(event.id, event.obj);
1949
- if (filtered) {
1950
- return;
1951
- }
1952
- if (newInnerState && newState) {
1953
- Object.assign(newState, newInnerState);
1954
- }
1955
- else {
1956
- newState = newInnerState;
1957
- }
1958
- });
1959
- if (newState) {
1960
- this.setState(newState);
1961
- }
1962
- this.afterObjectUpdated();
1963
- }
1964
- };
1965
- this.onObjectChange = (id, obj) => {
1966
- const { newInnerState, filtered } = this.processOnObjectChangeElement(id, obj);
1967
- if (filtered) {
1968
- return;
1969
- }
1970
- if (newInnerState) {
1971
- this.setState(newInnerState);
1972
- }
1973
- this.afterObjectUpdated();
1974
- };
1975
- this.getEnumsForId = (id) => {
1976
- const result = [];
1977
- this.info.enums.forEach(_id => {
1978
- var _b, _c, _d;
1979
- if ((_d = (_c = (_b = this.objects[_id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.includes(id)) {
1980
- const enumItem = {
1981
- _id: this.objects[_id]._id,
1982
- common: JSON.parse(JSON.stringify(this.objects[_id].common)),
1983
- native: this.objects[_id].native,
1984
- type: 'enum',
1985
- };
1986
- if (enumItem.common) {
1987
- delete enumItem.common.members;
1988
- delete enumItem.common.custom;
1989
- // @ts-expect-error deprecated attribute
1990
- delete enumItem.common.mobile;
1991
- }
1992
- result.push(enumItem);
1993
- }
1994
- });
1995
- return result.length ? result : undefined;
1996
- };
1997
- this._createAllEnums = async (enums, objId) => {
1998
- var _b, _c;
1999
- for (let e = 0; e < enums.length; e++) {
2000
- const item = enums[e];
2001
- let id;
2002
- let newObj;
2003
- // some admin version delivered enums as string
2004
- if (typeof item === 'object') {
2005
- newObj = item;
2006
- id = newObj._id;
2007
- }
2008
- else {
2009
- id = item;
2010
- }
2011
- let oldObj = this.objects[id];
2012
- // if enum does not exist
2013
- if (!oldObj) {
2014
- // create a new one
2015
- oldObj =
2016
- newObj ||
2017
- {
2018
- _id: id,
2019
- common: {
2020
- name: id.split('.').pop(),
2021
- members: [],
2022
- },
2023
- native: {},
2024
- type: 'enum',
2025
- };
2026
- oldObj.common = oldObj.common || {};
2027
- oldObj.common.members = [objId];
2028
- oldObj.type = 'enum';
2029
- await this.props.socket.setObject(id, oldObj);
2030
- }
2031
- else if (!((_c = (_b = oldObj.common) === null || _b === void 0 ? void 0 : _b.members) === null || _c === void 0 ? void 0 : _c.includes(objId))) {
2032
- oldObj.common = oldObj.common || {};
2033
- oldObj.type = 'enum';
2034
- oldObj.common.members = oldObj.common.members || [];
2035
- // add the missing object
2036
- oldObj.common.members.push(objId);
2037
- oldObj.common.members.sort();
2038
- await this.props.socket.setObject(id, oldObj);
2039
- }
2040
- }
2041
- };
2042
- this.toolTipObjectCreating = () => {
2043
- var _b, _c;
2044
- const { t } = this.props;
2045
- let value = [
2046
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2047
- react_1.default.createElement("div", { key: 2 }, t('ra_Folder → State')),
2048
- react_1.default.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
2049
- react_1.default.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
2050
- react_1.default.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
2051
- react_1.default.createElement("div", { key: 6 }, t('ra_Channel → State')),
2052
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2053
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2054
- react_1.default.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
2055
- ];
2056
- if (this.state.selected.length || this.state.selectedNonObject) {
2057
- const id = this.state.selected[0] || this.state.selectedNonObject;
2058
- if (id.split('.').length < 2 || (this.objects[id] && ((_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.type) === 'state')) {
2059
- // show default tooltip
2060
- }
2061
- else if (this.state.filter.expertMode) {
2062
- switch ((_c = this.objects[id]) === null || _c === void 0 ? void 0 : _c.type) {
2063
- case 'device':
2064
- value = [
2065
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2066
- react_1.default.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
2067
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2068
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2069
- react_1.default.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
2070
- ];
2071
- break;
2072
- case 'folder':
2073
- value = [
2074
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2075
- react_1.default.createElement("div", { key: 2 }, t('ra_Folder → State')),
2076
- react_1.default.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
2077
- react_1.default.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
2078
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2079
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2080
- react_1.default.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
2081
- ];
2082
- break;
2083
- case 'channel':
2084
- value = [
2085
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2086
- react_1.default.createElement("div", { key: 1 }, t('ra_Channel → State')),
2087
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2088
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2089
- react_1.default.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
2090
- ];
2091
- break;
2092
- default:
2093
- break;
2094
- }
2095
- }
2096
- else if (id.startsWith('alias.0') || id.startsWith('0_userdata')) {
2097
- value = [
2098
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2099
- react_1.default.createElement("div", { key: 2 }, t('ra_Folder → State')),
2100
- react_1.default.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
2101
- react_1.default.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
2102
- react_1.default.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
2103
- react_1.default.createElement("div", { key: 6 }, t('ra_Channel → State')),
2104
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2105
- react_1.default.createElement("div", { key: 7 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2106
- react_1.default.createElement("div", { key: 8 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
2107
- ];
2108
- }
2109
- }
2110
- return value.length ? value : t('ra_Add new child object to selected parent');
2111
- };
2112
- this.renderTooltipAccessControl = (acl) => {
2113
- // acl ={object,state,owner,ownerGroup}
2114
- if (!acl) {
2115
- return null;
2116
- }
2117
- const check = [
2118
- {
2119
- value: '0x400',
2120
- valueNum: 0x400,
2121
- title: 'read',
2122
- group: 'Owner',
2123
- },
2124
- {
2125
- value: '0x200',
2126
- valueNum: 0x200,
2127
- title: 'write',
2128
- group: 'Owner',
2129
- },
2130
- {
2131
- value: '0x40',
2132
- valueNum: 0x40,
2133
- title: 'read',
2134
- group: 'Group',
2135
- },
2136
- {
2137
- value: '0x20',
2138
- valueNum: 0x20,
2139
- title: 'write',
2140
- group: 'Group',
2141
- },
2142
- {
2143
- value: '0x4',
2144
- valueNum: 0x4,
2145
- title: 'read',
2146
- group: 'Everyone',
2147
- },
2148
- {
2149
- value: '0x2',
2150
- valueNum: 0x2,
2151
- title: 'write',
2152
- group: 'Everyone',
2153
- },
2154
- ];
2155
- const arrayTooltipText = [];
2156
- const funcRenderStateObject = (value) => {
2157
- const rights = acl[value];
2158
- check.forEach((el, i) => {
2159
- if (rights & el.valueNum) {
2160
- arrayTooltipText.push(react_1.default.createElement("span", { key: value + i },
2161
- this.texts[`acl${el.group}_${el.title}_${value}`],
2162
- ",",
2163
- react_1.default.createElement("span", { style: value === 'object' ? styles.rightsObject : styles.rightsState }, el.value)));
2164
- }
2165
- });
2166
- };
2167
- arrayTooltipText.push(react_1.default.createElement("span", { key: "group" }, `${this.texts.ownerGroup}: ${(acl.ownerGroup || '').replace('system.group.', '')}`));
2168
- arrayTooltipText.push(react_1.default.createElement("span", { key: "owner" }, `${this.texts.ownerUser}: ${(acl.owner || '').replace('system.user.', '')}`));
2169
- funcRenderStateObject('object');
2170
- if (acl.state) {
2171
- funcRenderStateObject('state');
2172
- }
2173
- return arrayTooltipText.length ? (react_1.default.createElement("span", { style: styles.tooltipAccessControl }, arrayTooltipText.map(el => el))) : null;
2174
- };
2175
- this.resizerMouseMove = (e) => {
2176
- if (this.resizerActiveDiv) {
2177
- let width;
2178
- let widthNext;
2179
- if (this.resizeLeft) {
2180
- width = this.resizerOldWidth - e.clientX + this.resizerPosition;
2181
- widthNext = this.resizerOldWidthNext + e.clientX - this.resizerPosition;
2182
- }
2183
- else {
2184
- width = this.resizerOldWidth + e.clientX - this.resizerPosition;
2185
- widthNext = this.resizerOldWidthNext - e.clientX + this.resizerPosition;
2186
- }
2187
- if (this.resizerActiveName &&
2188
- this.resizerNextName &&
2189
- (!this.resizerMin || width > this.resizerMin) &&
2190
- (!this.resizerNextMin || widthNext > this.resizerNextMin)) {
2191
- this.resizerCurrentWidths[this.resizerActiveName] = width;
2192
- this.resizerCurrentWidths[this.resizerNextName] = widthNext;
2193
- this.resizerActiveDiv.style.width = `${width}px`;
2194
- if (this.resizerNextDiv) {
2195
- this.resizerNextDiv.style.width = `${widthNext}px`;
2196
- }
2197
- this.columnsVisibility[this.resizerActiveName] = width;
2198
- this.columnsVisibility[this.resizerNextName] = widthNext;
2199
- if (this.resizerNextName === 'nameHeader') {
2200
- this.columnsVisibility.name = widthNext - this.state.scrollBarWidth;
2201
- this.resizerCurrentWidths.name = widthNext - this.state.scrollBarWidth;
2202
- }
2203
- else if (this.resizerActiveName === 'nameHeader') {
2204
- this.columnsVisibility.name = width - this.state.scrollBarWidth;
2205
- this.resizerCurrentWidths.name = width - this.state.scrollBarWidth;
2206
- }
2207
- this.customWidth = true;
2208
- if (this.resizeTimeout) {
2209
- clearTimeout(this.resizeTimeout);
2210
- }
2211
- this.resizeTimeout = setTimeout(() => {
2212
- this.resizeTimeout = null;
2213
- this.forceUpdate();
2214
- }, 200);
2215
- }
2216
- }
2217
- };
2218
- this.resizerMouseUp = () => {
2219
- this.localStorage.setItem(`${this.props.dialogName || 'App'}.table`, JSON.stringify(this.resizerCurrentWidths));
2220
- this.resizerActiveName = null;
2221
- this.resizerNextName = null;
2222
- this.resizerActiveDiv = null;
2223
- this.resizerNextDiv = null;
2224
- window.removeEventListener('mousemove', this.resizerMouseMove);
2225
- window.removeEventListener('mouseup', this.resizerMouseUp);
2226
- };
2227
- this.resizerMouseDown = (e) => {
2228
- this.storedWidths =
2229
- this.storedWidths ||
2230
- JSON.parse(JSON.stringify(SCREEN_WIDTHS[this.props.width || 'lg']));
2231
- this.resizerCurrentWidths = this.resizerCurrentWidths || {};
2232
- this.resizerActiveDiv = e.target.parentNode;
2233
- this.resizerActiveName = this.resizerActiveDiv.dataset.name || null;
2234
- if (this.resizerActiveName) {
2235
- let i = 0;
2236
- if (e.target.dataset.left === 'true') {
2237
- this.resizeLeft = true;
2238
- this.resizerNextDiv = this.resizerActiveDiv.previousElementSibling;
2239
- let handle = this.resizerNextDiv.querySelector('.iob-ob-resize-handler');
2240
- while (this.resizerNextDiv && !handle && i < 10) {
2241
- this.resizerNextDiv = this.resizerNextDiv.previousElementSibling;
2242
- handle = this.resizerNextDiv.querySelector('.iob-ob-resize-handler');
2243
- i++;
2244
- }
2245
- if ((handle === null || handle === void 0 ? void 0 : handle.dataset.left) !== 'true') {
2246
- this.resizerNextDiv = this.resizerNextDiv.nextElementSibling;
2247
- }
2248
- }
2249
- else {
2250
- this.resizeLeft = false;
2251
- this.resizerNextDiv = this.resizerActiveDiv.nextElementSibling;
2252
- /* while (this.resizerNextDiv && !this.resizerNextDiv.querySelector('.iob-ob-resize-handler') && i < 10) {
2253
- this.resizerNextDiv = this.resizerNextDiv.nextElementSibling;
2254
- i++;
2255
- } */
2256
- }
2257
- this.resizerNextName = this.resizerNextDiv.dataset.name || null;
2258
- this.resizerMin = parseInt(this.resizerActiveDiv.dataset.min, 10) || 0;
2259
- this.resizerNextMin = parseInt(this.resizerNextDiv.dataset.min, 10) || 0;
2260
- this.resizerPosition = e.clientX;
2261
- this.resizerCurrentWidths[this.resizerActiveName] = this.resizerActiveDiv.offsetWidth;
2262
- this.resizerOldWidth = this.resizerCurrentWidths[this.resizerActiveName];
2263
- if (this.resizerNextName) {
2264
- this.resizerCurrentWidths[this.resizerNextName] = this.resizerNextDiv.offsetWidth;
2265
- this.resizerOldWidthNext = this.resizerCurrentWidths[this.resizerNextName];
2266
- }
2267
- window.addEventListener('mousemove', this.resizerMouseMove);
2268
- window.addEventListener('mouseup', this.resizerMouseUp);
2269
- }
2270
- };
2271
- this.resizerReset = () => {
2272
- this.customWidth = false;
2273
- SCREEN_WIDTHS[this.props.width || 'lg'] = JSON.parse(JSON.stringify(this.storedWidths));
2274
- this.calculateColumnsVisibility();
2275
- this.localStorage.removeItem(`${this.props.dialogName || 'App'}.table`);
2276
- this.forceUpdate();
2277
- };
2278
1861
  const lastSelectedItemStr = this.localStorage.getItem(`${props.dialogName || 'App'}.objectSelected`) || '';
2279
1862
  this.selectFirst = '';
2280
1863
  if (lastSelectedItemStr.startsWith('[')) {
@@ -2282,7 +1865,7 @@ class ObjectBrowserClass extends react_1.Component {
2282
1865
  const lastSelectedItems = JSON.parse(lastSelectedItemStr);
2283
1866
  this.selectFirst = lastSelectedItems[0] || '';
2284
1867
  }
2285
- catch (_b) {
1868
+ catch {
2286
1869
  // ignore
2287
1870
  }
2288
1871
  }
@@ -2294,7 +1877,7 @@ class ObjectBrowserClass extends react_1.Component {
2294
1877
  try {
2295
1878
  expanded = JSON.parse(expandedStr);
2296
1879
  }
2297
- catch (_c) {
1880
+ catch {
2298
1881
  expanded = [];
2299
1882
  }
2300
1883
  let filter;
@@ -2305,24 +1888,24 @@ class ObjectBrowserClass extends react_1.Component {
2305
1888
  try {
2306
1889
  filter = JSON.parse(filterStr);
2307
1890
  }
2308
- catch (_d) {
2309
- filter = Object.assign({}, DEFAULT_FILTER);
1891
+ catch {
1892
+ filter = { ...DEFAULT_FILTER };
2310
1893
  }
2311
1894
  }
2312
1895
  else if (props.defaultFilters && typeof props.defaultFilters === 'object') {
2313
- filter = Object.assign({}, props.defaultFilters);
1896
+ filter = { ...props.defaultFilters };
2314
1897
  }
2315
1898
  else {
2316
- filter = Object.assign({}, DEFAULT_FILTER);
1899
+ filter = { ...DEFAULT_FILTER };
2317
1900
  }
2318
1901
  filter.expertMode =
2319
1902
  props.expertMode !== undefined
2320
1903
  ? props.expertMode
2321
1904
  : (window._sessionStorage || window.sessionStorage).getItem('App.expertMode') ===
2322
1905
  'true';
2323
- this.tableRef = (0, react_1.createRef)();
1906
+ this.tableRef = createRef();
2324
1907
  this.filterRefs = {};
2325
- Object.keys(DEFAULT_FILTER).forEach(name => (this.filterRefs[name] = (0, react_1.createRef)()));
1908
+ Object.keys(DEFAULT_FILTER).forEach(name => (this.filterRefs[name] = createRef()));
2326
1909
  this.visibleCols = props.columns || SCREEN_WIDTHS[props.width || 'lg'].fields;
2327
1910
  // remove type column if only one type must be selected
2328
1911
  if (props.types && props.types.length === 1) {
@@ -2354,14 +1937,14 @@ class ObjectBrowserClass extends react_1.Component {
2354
1937
  try {
2355
1938
  columns = columnsStr ? JSON.parse(columnsStr) : null;
2356
1939
  }
2357
- catch (_e) {
1940
+ catch {
2358
1941
  columns = null;
2359
1942
  }
2360
1943
  let columnsWidths = null; // this.localStorage.getItem(`${props.dialogName || 'App'}.columnsWidths`);
2361
1944
  try {
2362
1945
  columnsWidths = columnsWidths ? JSON.parse(columnsWidths) : {};
2363
1946
  }
2364
- catch (_f) {
1947
+ catch {
2365
1948
  columnsWidths = {};
2366
1949
  }
2367
1950
  this.imagePrefix = props.imagePrefix || '.';
@@ -2382,7 +1965,7 @@ class ObjectBrowserClass extends react_1.Component {
2382
1965
  ? JSON.parse(this.localStorage.getItem(`${props.dialogName || 'App'}.objectStatesView`) || '') || false
2383
1966
  : false;
2384
1967
  }
2385
- catch (_g) {
1968
+ catch {
2386
1969
  // ignore
2387
1970
  }
2388
1971
  this.state = {
@@ -2502,7 +2085,7 @@ class ObjectBrowserClass extends react_1.Component {
2502
2085
  });
2503
2086
  this.customWidth = true;
2504
2087
  }
2505
- catch (_h) {
2088
+ catch {
2506
2089
  // ignore
2507
2090
  }
2508
2091
  }
@@ -2517,7 +2100,7 @@ class ObjectBrowserClass extends react_1.Component {
2517
2100
  const objects = (this.props.objectsWorker
2518
2101
  ? await this.props.objectsWorker.getObjects(update)
2519
2102
  : await props.socket.getObjects(update, true)) || {};
2520
- if (props.types && Connection_1.default.isWeb()) {
2103
+ if (props.types && Connection.isWeb()) {
2521
2104
  for (let i = 0; i < props.types.length; i++) {
2522
2105
  // admin has ALL objects
2523
2106
  // web has only state, channel, device, enum, and system.config
@@ -2533,7 +2116,7 @@ class ObjectBrowserClass extends react_1.Component {
2533
2116
  }
2534
2117
  this.systemConfig =
2535
2118
  this.systemConfig ||
2536
- (objects === null || objects === void 0 ? void 0 : objects['system.config']) ||
2119
+ objects?.['system.config'] ||
2537
2120
  (await props.socket.getObject('system.config'));
2538
2121
  this.systemConfig.common = this.systemConfig.common || {};
2539
2122
  this.systemConfig.common.defaultNewAcl = this.systemConfig.common.defaultNewAcl || {
@@ -2634,7 +2217,7 @@ class ObjectBrowserClass extends react_1.Component {
2634
2217
  if (node &&
2635
2218
  !applyFilter(node, this.state.filter, this.props.lang, this.objects, undefined, undefined, props.customFilter, props.types)) {
2636
2219
  // reset filter
2637
- this.setState({ filter: Object.assign({}, DEFAULT_FILTER), columnsForAdmin }, () => {
2220
+ this.setState({ filter: { ...DEFAULT_FILTER }, columnsForAdmin }, () => {
2638
2221
  this.setState({ loaded: true, updating: false }, () => this.expandAllSelected(() => this.onAfterSelect()));
2639
2222
  });
2640
2223
  }
@@ -2652,7 +2235,7 @@ class ObjectBrowserClass extends react_1.Component {
2652
2235
  static isNonExpertId(
2653
2236
  /** id to test */
2654
2237
  id) {
2655
- return !!__classPrivateFieldGet(_a, _a, "f", _ObjectBrowserClass_NON_EXPERT_NAMESPACES).find(saveNamespace => id.startsWith(saveNamespace));
2238
+ return !!ObjectBrowserClass.#NON_EXPERT_NAMESPACES.find(saveNamespace => id.startsWith(saveNamespace));
2656
2239
  }
2657
2240
  expandAllSelected(cb) {
2658
2241
  const expanded = [...this.state.expanded];
@@ -2681,15 +2264,14 @@ class ObjectBrowserClass extends react_1.Component {
2681
2264
  * @param isDouble is double click
2682
2265
  */
2683
2266
  onAfterSelect(isDouble) {
2684
- var _b;
2685
- if (((_b = this.state.selected) === null || _b === void 0 ? void 0 : _b.length) && this.state.selected[0]) {
2267
+ if (this.state.selected?.length && this.state.selected[0]) {
2686
2268
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, this.state.selected[0]);
2687
2269
  // remove a task to select the pre-selected item if now we want to see another object
2688
2270
  if (this.selectFirst && this.selectFirst !== this.state.selected[0]) {
2689
2271
  this.selectFirst = '';
2690
2272
  }
2691
2273
  if (this.state.selected.length === 1 && this.objects[this.state.selected[0]]) {
2692
- const name = Utils_1.default.getObjectName(this.objects, this.state.selected[0], null, {
2274
+ const name = Utils.getObjectName(this.objects, this.state.selected[0], null, {
2693
2275
  language: this.props.lang,
2694
2276
  });
2695
2277
  if (this.props.onSelect) {
@@ -2712,7 +2294,7 @@ class ObjectBrowserClass extends react_1.Component {
2712
2294
  let changed = false;
2713
2295
  if (props.expertMode !== undefined && props.expertMode !== state.filter.expertMode) {
2714
2296
  changed = true;
2715
- newState.filter = Object.assign({}, state.filter);
2297
+ newState.filter = { ...state.filter };
2716
2298
  newState.filter.expertMode = props.expertMode;
2717
2299
  }
2718
2300
  return changed ? newState : null;
@@ -2760,7 +2342,6 @@ class ObjectBrowserClass extends react_1.Component {
2760
2342
  * Show the deletion dialog for a given object
2761
2343
  */
2762
2344
  showDeleteDialog(options) {
2763
- var _b, _c;
2764
2345
  const { id, obj, item } = options;
2765
2346
  // calculate the number of children
2766
2347
  const keys = Object.keys(this.objects);
@@ -2776,9 +2357,29 @@ class ObjectBrowserClass extends react_1.Component {
2776
2357
  }
2777
2358
  }
2778
2359
  if (this.props.onObjectDelete) {
2779
- this.props.onObjectDelete(id, !!((_b = item.children) === null || _b === void 0 ? void 0 : _b.length), !((_c = obj.common) === null || _c === void 0 ? void 0 : _c.dontDelete), count + 1);
2360
+ this.props.onObjectDelete(id, !!item.children?.length, !obj.common?.dontDelete, count + 1);
2780
2361
  }
2781
2362
  }
2363
+ /**
2364
+ * Context menu handler.
2365
+ */
2366
+ onContextMenu = (e) => {
2367
+ // console.log(`CONTEXT MENU: ${this.contextMenu ? Date.now() - this.contextMenu.ts : 'false'}`);
2368
+ if (this.contextMenu && Date.now() - this.contextMenu.ts < 2000) {
2369
+ e.preventDefault();
2370
+ this.setState({
2371
+ showContextMenu: {
2372
+ item: this.contextMenu.item,
2373
+ position: { left: e.clientX + 2, top: e.clientY - 6 },
2374
+ },
2375
+ });
2376
+ }
2377
+ else if (this.state.showContextMenu) {
2378
+ e.preventDefault();
2379
+ this.setState({ showContextMenu: null });
2380
+ }
2381
+ this.contextMenu = null;
2382
+ };
2782
2383
  /**
2783
2384
  * Called when component is mounted.
2784
2385
  */
@@ -2797,12 +2398,12 @@ class ObjectBrowserClass extends react_1.Component {
2797
2398
  * Renders the error dialog.
2798
2399
  */
2799
2400
  renderErrorDialog() {
2800
- return this.state.error ? (react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "sm", fullWidth: true, onClose: () => this.setState({ error: '' }), "aria-labelledby": "error-dialog-title", "aria-describedby": "error-dialog-description" },
2801
- react_1.default.createElement(material_1.DialogTitle, { id: "alert-dialog-title" }, this.props.t('ra_Error')),
2802
- react_1.default.createElement(material_1.DialogContent, null,
2803
- react_1.default.createElement(material_1.DialogContentText, { id: "alert-dialog-description" }, this.state.error)),
2804
- react_1.default.createElement(material_1.DialogActions, null,
2805
- react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.setState({ error: '' }), color: "primary", autoFocus: true, startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.t('ra_Ok'))))) : null;
2401
+ return this.state.error ? (React.createElement(Dialog, { open: !0, maxWidth: "sm", fullWidth: true, onClose: () => this.setState({ error: '' }), "aria-labelledby": "error-dialog-title", "aria-describedby": "error-dialog-description" },
2402
+ React.createElement(DialogTitle, { id: "alert-dialog-title" }, this.props.t('ra_Error')),
2403
+ React.createElement(DialogContent, null,
2404
+ React.createElement(DialogContentText, { id: "alert-dialog-description" }, this.state.error)),
2405
+ React.createElement(DialogActions, null,
2406
+ React.createElement(Button, { variant: "contained", onClick: () => this.setState({ error: '' }), color: "primary", autoFocus: true, startIcon: React.createElement(IconCheck, null) }, this.props.t('ra_Ok'))))) : null;
2806
2407
  }
2807
2408
  /**
2808
2409
  * Show the error dialog.
@@ -2878,30 +2479,27 @@ class ObjectBrowserClass extends react_1.Component {
2878
2479
  }
2879
2480
  return cols
2880
2481
  .filter(id => (isLast && (id === 'val' || id === 'buttons')) || (!isLast && id !== 'val' && id !== 'buttons'))
2881
- .map(id => {
2882
- var _b;
2883
- return (react_1.default.createElement(material_1.ListItemButton, { onClick: () => {
2884
- if (!this.state.columnsAuto && id !== 'id') {
2885
- const columns = [...(this.state.columns || [])];
2886
- const pos = columns.indexOf(id);
2887
- if (pos === -1) {
2888
- columns.push(id);
2889
- columns.sort();
2890
- }
2891
- else {
2892
- columns.splice(pos, 1);
2893
- }
2894
- this.localStorage.setItem(`${this.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
2895
- this.calculateColumnsVisibility(null, columns);
2896
- this.setState({ columns });
2482
+ .map(id => (React.createElement(ListItemButton, { onClick: () => {
2483
+ if (!this.state.columnsAuto && id !== 'id') {
2484
+ const columns = [...(this.state.columns || [])];
2485
+ const pos = columns.indexOf(id);
2486
+ if (pos === -1) {
2487
+ columns.push(id);
2488
+ columns.sort();
2897
2489
  }
2898
- }, key: id },
2899
- react_1.default.createElement(material_1.Checkbox, { edge: "start", disabled: id === 'id' || this.state.columnsAuto, checked: id === 'id' ||
2900
- !!(this.state.columnsAuto
2901
- ? this.visibleCols.includes(id)
2902
- : (_b = this.state.columns) === null || _b === void 0 ? void 0 : _b.includes(id)), disableRipple: true }),
2903
- react_1.default.createElement(material_1.ListItemText, { primary: this.texts[`filter_${id}`] || this.props.t(`ra_${id}`) })));
2904
- });
2490
+ else {
2491
+ columns.splice(pos, 1);
2492
+ }
2493
+ this.localStorage.setItem(`${this.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
2494
+ this.calculateColumnsVisibility(null, columns);
2495
+ this.setState({ columns });
2496
+ }
2497
+ }, key: id },
2498
+ React.createElement(Checkbox, { edge: "start", disabled: id === 'id' || this.state.columnsAuto, checked: id === 'id' ||
2499
+ !!(this.state.columnsAuto
2500
+ ? this.visibleCols.includes(id)
2501
+ : this.state.columns?.includes(id)), disableRipple: true }),
2502
+ React.createElement(ListItemText, { primary: this.texts[`filter_${id}`] || this.props.t(`ra_${id}`) }))));
2905
2503
  }
2906
2504
  /**
2907
2505
  * Renders the columns' selector.
@@ -2910,20 +2508,20 @@ class ObjectBrowserClass extends react_1.Component {
2910
2508
  if (!this.state.columnsSelectorShow) {
2911
2509
  return null;
2912
2510
  }
2913
- return (react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsSelectorShow: false }), open: !0, sx: {
2914
- '& .MuiPaper-root': Utils_1.default.getStyle(this.props.theme, styles.dialogColumns, styles[`transparent_${this.state.columnsDialogTransparent}`]),
2511
+ return (React.createElement(Dialog, { onClose: () => this.setState({ columnsSelectorShow: false }), open: !0, sx: {
2512
+ '& .MuiPaper-root': Utils.getStyle(this.props.theme, styles.dialogColumns, styles[`transparent_${this.state.columnsDialogTransparent}`]),
2915
2513
  } },
2916
- react_1.default.createElement(material_1.DialogTitle, { sx: styles.fontSizeTitle }, this.props.t('ra_Configure')),
2917
- react_1.default.createElement(material_1.DialogContent, { sx: styles.fontSizeTitle },
2918
- react_1.default.createElement(material_1.FormControlLabel, { style: styles.switchColumnAuto, control: react_1.default.createElement(material_1.Switch, { checked: this.state.foldersFirst, onChange: () => {
2514
+ React.createElement(DialogTitle, { sx: styles.fontSizeTitle }, this.props.t('ra_Configure')),
2515
+ React.createElement(DialogContent, { sx: styles.fontSizeTitle },
2516
+ React.createElement(FormControlLabel, { style: styles.switchColumnAuto, control: React.createElement(Switch, { checked: this.state.foldersFirst, onChange: () => {
2919
2517
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.foldersFirst`, this.state.foldersFirst ? 'false' : 'true');
2920
2518
  this.setState({ foldersFirst: !this.state.foldersFirst });
2921
2519
  } }), label: this.props.t('ra_Folders always first') }),
2922
- react_1.default.createElement(material_1.FormControlLabel, { style: styles.switchColumnAuto, control: react_1.default.createElement(material_1.Switch, { checked: this.state.linesEnabled, onChange: () => {
2520
+ React.createElement(FormControlLabel, { style: styles.switchColumnAuto, control: React.createElement(Switch, { checked: this.state.linesEnabled, onChange: () => {
2923
2521
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.lines`, this.state.linesEnabled ? 'false' : 'true');
2924
2522
  this.setState({ linesEnabled: !this.state.linesEnabled });
2925
2523
  } }), label: this.props.t('ra_Show lines between rows') }),
2926
- react_1.default.createElement(material_1.FormControlLabel, { style: styles.switchColumnAuto, control: react_1.default.createElement(material_1.Switch, { checked: this.state.columnsAuto, onChange: () => {
2524
+ React.createElement(FormControlLabel, { style: styles.switchColumnAuto, control: React.createElement(Switch, { checked: this.state.columnsAuto, onChange: () => {
2927
2525
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.columnsAuto`, this.state.columnsAuto ? 'false' : 'true');
2928
2526
  if (!this.state.columnsAuto) {
2929
2527
  this.calculateColumnsVisibility(true);
@@ -2938,39 +2536,36 @@ class ObjectBrowserClass extends react_1.Component {
2938
2536
  this.setState({ columnsAuto: false });
2939
2537
  }
2940
2538
  } }), label: this.props.t('ra_Auto (no custom columns)') }),
2941
- react_1.default.createElement(material_1.List, null,
2539
+ React.createElement(List, null,
2942
2540
  this._renderDefinedList(false),
2943
2541
  this.state.columnsForAdmin &&
2944
2542
  Object.keys(this.state.columnsForAdmin)
2945
2543
  .sort()
2946
2544
  .map(adapter => this.state.columnsForAdmin &&
2947
- this.state.columnsForAdmin[adapter].map(column => {
2948
- var _b;
2949
- return (react_1.default.createElement(material_1.ListItemButton, { onClick: () => {
2950
- if (!this.state.columnsAuto) {
2951
- const columns = [...(this.state.columns || [])];
2952
- const id = `_${adapter}_${column.path}`;
2953
- const pos = columns.indexOf(id);
2954
- if (pos === -1) {
2955
- columns.push(id);
2956
- columns.sort();
2957
- }
2958
- else {
2959
- columns.splice(pos, 1);
2960
- }
2961
- this.calculateColumnsVisibility(null, columns);
2962
- this.localStorage.setItem(`${this.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
2963
- this.setState({ columns });
2545
+ this.state.columnsForAdmin[adapter].map(column => (React.createElement(ListItemButton, { onClick: () => {
2546
+ if (!this.state.columnsAuto) {
2547
+ const columns = [...(this.state.columns || [])];
2548
+ const id = `_${adapter}_${column.path}`;
2549
+ const pos = columns.indexOf(id);
2550
+ if (pos === -1) {
2551
+ columns.push(id);
2552
+ columns.sort();
2553
+ }
2554
+ else {
2555
+ columns.splice(pos, 1);
2964
2556
  }
2965
- }, key: `${adapter}_${column.name}` },
2966
- react_1.default.createElement(material_1.ListItemIcon, null,
2967
- react_1.default.createElement(material_1.Checkbox, { disabled: this.state.columnsAuto, edge: "start", checked: !this.state.columnsAuto &&
2968
- ((_b = this.state.columns) === null || _b === void 0 ? void 0 : _b.includes(`_${adapter}_${column.path}`)), disableRipple: true })),
2969
- react_1.default.createElement(material_1.ListItemText, { primary: `${column.name} (${adapter})` })));
2970
- })),
2557
+ this.calculateColumnsVisibility(null, columns);
2558
+ this.localStorage.setItem(`${this.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
2559
+ this.setState({ columns });
2560
+ }
2561
+ }, key: `${adapter}_${column.name}` },
2562
+ React.createElement(ListItemIcon, null,
2563
+ React.createElement(Checkbox, { disabled: this.state.columnsAuto, edge: "start", checked: !this.state.columnsAuto &&
2564
+ this.state.columns?.includes(`_${adapter}_${column.path}`), disableRipple: true })),
2565
+ React.createElement(ListItemText, { primary: `${column.name} (${adapter})` }))))),
2971
2566
  this._renderDefinedList(true))),
2972
- react_1.default.createElement(material_1.DialogActions, null,
2973
- react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.setState({ columnsSelectorShow: false }), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.texts.close))));
2567
+ React.createElement(DialogActions, null,
2568
+ React.createElement(Button, { variant: "contained", onClick: () => this.setState({ columnsSelectorShow: false }), color: "primary", startIcon: React.createElement(IconClose, null) }, this.texts.close))));
2974
2569
  }
2975
2570
  async getAdditionalColumns() {
2976
2571
  try {
@@ -3022,6 +2617,36 @@ class ObjectBrowserClass extends react_1.Component {
3022
2617
  }
3023
2618
  return null;
3024
2619
  }
2620
+ /**
2621
+ * Called when a state changes.
2622
+ */
2623
+ onStateChange = (id, state) => {
2624
+ console.log(`> stateChange ${id}`);
2625
+ if (this.states[id]) {
2626
+ const item = this.findItem(id);
2627
+ if (item?.data.state) {
2628
+ item.data.state = undefined;
2629
+ }
2630
+ }
2631
+ if (state) {
2632
+ this.states[id] = state;
2633
+ }
2634
+ else {
2635
+ delete this.states[id];
2636
+ }
2637
+ if (!this.pausedSubscribes) {
2638
+ if (!this.statesUpdateTimer) {
2639
+ this.statesUpdateTimer = setTimeout(() => {
2640
+ this.statesUpdateTimer = null;
2641
+ this.forceUpdate();
2642
+ }, 300);
2643
+ }
2644
+ }
2645
+ else if (this.statesUpdateTimer) {
2646
+ clearTimeout(this.statesUpdateTimer);
2647
+ this.statesUpdateTimer = null;
2648
+ }
2649
+ };
3025
2650
  parseObjectForAdmins(columnsForAdmin, obj) {
3026
2651
  if (obj.common && obj.common.adminColumns && obj.common.name) {
3027
2652
  const columns = obj.common.adminColumns;
@@ -3085,6 +2710,37 @@ class ObjectBrowserClass extends react_1.Component {
3085
2710
  }
3086
2711
  return columnsForAdmin;
3087
2712
  }
2713
+ onObjectChangeFromWorker = (events) => {
2714
+ if (Array.isArray(events)) {
2715
+ let newState = null;
2716
+ events.forEach(event => {
2717
+ const { newInnerState, filtered } = this.processOnObjectChangeElement(event.id, event.obj);
2718
+ if (filtered) {
2719
+ return;
2720
+ }
2721
+ if (newInnerState && newState) {
2722
+ Object.assign(newState, newInnerState);
2723
+ }
2724
+ else {
2725
+ newState = newInnerState;
2726
+ }
2727
+ });
2728
+ if (newState) {
2729
+ this.setState(newState);
2730
+ }
2731
+ this.afterObjectUpdated();
2732
+ }
2733
+ };
2734
+ onObjectChange = (id, obj) => {
2735
+ const { newInnerState, filtered } = this.processOnObjectChangeElement(id, obj);
2736
+ if (filtered) {
2737
+ return;
2738
+ }
2739
+ if (newInnerState) {
2740
+ this.setState(newInnerState);
2741
+ }
2742
+ this.afterObjectUpdated();
2743
+ };
3088
2744
  afterObjectUpdated() {
3089
2745
  if (!this.objectsUpdateTimer && this.objects) {
3090
2746
  this.objectsUpdateTimer = setTimeout(() => {
@@ -3108,8 +2764,7 @@ class ObjectBrowserClass extends react_1.Component {
3108
2764
  // This function is called when the user changes the alias of an object.
3109
2765
  // It updates the aliasMap and returns true if the aliasMap has changed.
3110
2766
  updateAliases(aliasId) {
3111
- var _b, _c, _d;
3112
- if (!this.objects || !((_b = this.info) === null || _b === void 0 ? void 0 : _b.aliasesMap) || !(aliasId === null || aliasId === void 0 ? void 0 : aliasId.startsWith('alias.'))) {
2767
+ if (!this.objects || !this.info?.aliasesMap || !aliasId?.startsWith('alias.')) {
3113
2768
  return;
3114
2769
  }
3115
2770
  // Rebuild aliases map
@@ -3117,7 +2772,7 @@ class ObjectBrowserClass extends react_1.Component {
3117
2772
  this.info.aliasesMap = {};
3118
2773
  for (const id of aliasesIds) {
3119
2774
  const obj = this.objects[id];
3120
- if ((_d = (_c = obj === null || obj === void 0 ? void 0 : obj.common) === null || _c === void 0 ? void 0 : _c.alias) === null || _d === void 0 ? void 0 : _d.id) {
2775
+ if (obj?.common?.alias?.id) {
3121
2776
  if (typeof obj.common.alias.id === 'string') {
3122
2777
  const usedId = obj.common.alias.id;
3123
2778
  if (!this.info.aliasesMap[usedId]) {
@@ -3159,7 +2814,7 @@ class ObjectBrowserClass extends react_1.Component {
3159
2814
  */
3160
2815
  processOnObjectChangeElement(id, obj) {
3161
2816
  console.log(`> objectChange ${id}`);
3162
- const type = obj === null || obj === void 0 ? void 0 : obj.type;
2817
+ const type = obj?.type;
3163
2818
  // If the object is filtered out, we don't need to update the React state
3164
2819
  if (obj &&
3165
2820
  typeof this.props.filterFunc === 'function' &&
@@ -3172,7 +2827,7 @@ class ObjectBrowserClass extends react_1.Component {
3172
2827
  return { newInnerState: null, filtered: true };
3173
2828
  }
3174
2829
  let newInnerState = null;
3175
- if (id.startsWith('system.adapter.') && (obj === null || obj === void 0 ? void 0 : obj.type) === 'adapter') {
2830
+ if (id.startsWith('system.adapter.') && obj?.type === 'adapter') {
3176
2831
  const columnsForAdmin = JSON.parse(JSON.stringify(this.state.columnsForAdmin));
3177
2832
  this.parseObjectForAdmins(columnsForAdmin, obj);
3178
2833
  if (JSON.stringify(this.state.columnsForAdmin) !== JSON.stringify(columnsForAdmin)) {
@@ -3226,7 +2881,7 @@ class ObjectBrowserClass extends react_1.Component {
3226
2881
  }
3227
2882
  onFilter(name, value) {
3228
2883
  this.filterTimer = null;
3229
- const filter = Object.assign({}, this.state.filter);
2884
+ const filter = { ...this.state.filter };
3230
2885
  Object.keys(this.filterRefs).forEach(_name => {
3231
2886
  if (this.filterRefs[_name] && this.filterRefs[_name].current) {
3232
2887
  const filterRef = this.filterRefs[_name].current;
@@ -3250,7 +2905,7 @@ class ObjectBrowserClass extends react_1.Component {
3250
2905
  }
3251
2906
  }
3252
2907
  clearFilter() {
3253
- const filter = Object.assign({}, this.state.filter);
2908
+ const filter = { ...this.state.filter };
3254
2909
  Object.keys(this.filterRefs).forEach(name => {
3255
2910
  if (this.filterRefs[name] && this.filterRefs[name].current) {
3256
2911
  const filterRef = this.filterRefs[name].current;
@@ -3274,40 +2929,37 @@ class ObjectBrowserClass extends react_1.Component {
3274
2929
  return !someNotEmpty;
3275
2930
  }
3276
2931
  getFilterInput(filterName) {
3277
- var _b, _c, _d;
3278
- return (react_1.default.createElement(material_1.FormControl, { sx: this.styles.filterInput, key: `${filterName}_${this.state.filterKey}`,
2932
+ return (React.createElement(FormControl, { sx: this.styles.filterInput, key: `${filterName}_${this.state.filterKey}`,
3279
2933
  // style={{ marginTop: 0, marginBottom: 0 }}
3280
2934
  margin: "dense" },
3281
- react_1.default.createElement(material_1.Input, { ref: this.filterRefs[filterName], classes: { underline: 'no-underline' }, id: filterName, placeholder: this.texts[`filter_${filterName}`], defaultValue: this.state.filter[filterName] || '', onChange: () => {
2935
+ React.createElement(Input, { ref: this.filterRefs[filterName], classes: { underline: 'no-underline' }, id: filterName, placeholder: this.texts[`filter_${filterName}`], defaultValue: this.state.filter[filterName] || '', onChange: () => {
3282
2936
  if (this.filterTimer) {
3283
2937
  clearTimeout(this.filterTimer);
3284
2938
  }
3285
2939
  this.filterTimer = setTimeout(() => this.onFilter(), 400);
3286
2940
  }, autoComplete: "off" }),
3287
- ((_d = (_c = (_b = this.filterRefs[filterName]) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.firstChild) === null || _d === void 0 ? void 0 : _d.value) ? (react_1.default.createElement("div", { style: {
2941
+ this.filterRefs[filterName]?.current?.firstChild?.value ? (React.createElement("div", { style: {
3288
2942
  position: 'absolute',
3289
2943
  right: 0,
3290
2944
  } },
3291
- react_1.default.createElement(material_1.IconButton, { size: "small", onClick: () => {
3292
- var _b;
3293
- ((_b = this.filterRefs[filterName].current) === null || _b === void 0 ? void 0 : _b.firstChild).value = '';
2945
+ React.createElement(IconButton, { size: "small", onClick: () => {
2946
+ (this.filterRefs[filterName].current?.firstChild).value = '';
3294
2947
  this.onFilter(filterName, '');
3295
2948
  } },
3296
- react_1.default.createElement(icons_material_1.Close, null)))) : null));
2949
+ React.createElement(IconClose, null)))) : null));
3297
2950
  }
3298
2951
  getFilterSelect(name, values) {
3299
- var _b, _c, _d;
3300
- const hasIcons = !!(values === null || values === void 0 ? void 0 : values.find(item => item.icon));
3301
- return (react_1.default.createElement("div", { style: { position: 'relative' } },
3302
- react_1.default.createElement(material_1.Select, { variant: "standard", key: `${name}_${this.state.filterKey}`, ref: this.filterRefs[name], sx: styles.headerCellInput, className: "no-underline", onChange: () => {
2952
+ const hasIcons = !!values?.find(item => item.icon);
2953
+ return (React.createElement("div", { style: { position: 'relative' } },
2954
+ React.createElement(Select, { variant: "standard", key: `${name}_${this.state.filterKey}`, ref: this.filterRefs[name], sx: styles.headerCellInput, className: "no-underline", onChange: () => {
3303
2955
  if (this.filterTimer) {
3304
2956
  clearTimeout(this.filterTimer);
3305
2957
  }
3306
2958
  this.filterTimer = setTimeout(() => this.onFilter(), 400);
3307
2959
  }, defaultValue: this.state.filter[name] || '', inputProps: { name, id: name }, displayEmpty: true },
3308
- react_1.default.createElement(material_1.MenuItem, { key: "empty", value: "" },
3309
- react_1.default.createElement("span", { style: styles.selectNone }, this.texts[`filter_${name}`])), values === null || values === void 0 ? void 0 :
3310
- values.map(item => {
2960
+ React.createElement(MenuItem, { key: "empty", value: "" },
2961
+ React.createElement("span", { style: styles.selectNone }, this.texts[`filter_${name}`])),
2962
+ values?.map(item => {
3311
2963
  let id;
3312
2964
  let _name;
3313
2965
  let icon;
@@ -3320,51 +2972,44 @@ class ObjectBrowserClass extends react_1.Component {
3320
2972
  id = item;
3321
2973
  _name = item;
3322
2974
  }
3323
- return (react_1.default.createElement(material_1.MenuItem, { sx: styles.headerCellSelectItem, key: id, value: id },
3324
- icon || (hasIcons ? react_1.default.createElement("div", { className: "itemIcon" }) : null),
2975
+ return (React.createElement(MenuItem, { sx: styles.headerCellSelectItem, key: id, value: id },
2976
+ icon || (hasIcons ? React.createElement("div", { className: "itemIcon" }) : null),
3325
2977
  _name));
3326
2978
  })),
3327
- ((_d = (_c = (_b = this.filterRefs[name]) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.childNodes[1]) === null || _d === void 0 ? void 0 : _d.value) ? (react_1.default.createElement(material_1.Box, { component: "div", sx: styles.selectClearButton },
3328
- react_1.default.createElement(material_1.IconButton, { size: "small", onClick: () => {
3329
- var _b;
3330
- const newFilter = Object.assign({}, this.state.filter);
2979
+ this.filterRefs[name]?.current?.childNodes[1]?.value ? (React.createElement(Box, { component: "div", sx: styles.selectClearButton },
2980
+ React.createElement(IconButton, { size: "small", onClick: () => {
2981
+ const newFilter = { ...this.state.filter };
3331
2982
  newFilter[name] = '';
3332
- ((_b = this.filterRefs[name].current) === null || _b === void 0 ? void 0 : _b.childNodes[1]).value = '';
2983
+ (this.filterRefs[name].current?.childNodes[1]).value = '';
3333
2984
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectFilter`, JSON.stringify(newFilter));
3334
2985
  this.setState({ filter: newFilter, filterKey: this.state.filterKey + 1 }, () => this.props.onFilterChanged && this.props.onFilterChanged(newFilter));
3335
2986
  } },
3336
- react_1.default.createElement(icons_material_1.Close, null)))) : null));
2987
+ React.createElement(IconClose, null)))) : null));
3337
2988
  }
3338
2989
  getFilterSelectRole() {
3339
2990
  return this.getFilterSelect('role', this.info.roles);
3340
2991
  }
3341
2992
  getFilterSelectRoom() {
3342
- const rooms = this.info.roomEnums.map(id => {
3343
- var _b, _c, _d, _e;
3344
- return ({
3345
- name: getName((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name, this.props.lang) || id.split('.').pop(),
3346
- value: id,
3347
- icon: (react_1.default.createElement(Icon_1.default, { src: ((_e = (_d = this.objects[id]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.icon) || '', style: styles.selectIcon })),
3348
- });
3349
- });
2993
+ const rooms = this.info.roomEnums.map(id => ({
2994
+ name: getName(this.objects[id]?.common?.name, this.props.lang) || id.split('.').pop(),
2995
+ value: id,
2996
+ icon: (React.createElement(Icon, { src: this.objects[id]?.common?.icon || '', style: styles.selectIcon })),
2997
+ }));
3350
2998
  return this.getFilterSelect('room', rooms);
3351
2999
  }
3352
3000
  getFilterSelectFunction() {
3353
- const func = this.info.funcEnums.map(id => {
3354
- var _b, _c, _d, _e;
3355
- return ({
3356
- name: getName((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name, this.props.lang) || id.split('.').pop(),
3357
- value: id,
3358
- icon: (react_1.default.createElement(Icon_1.default, { src: ((_e = (_d = this.objects[id]) === null || _d === void 0 ? void 0 : _d.common) === null || _e === void 0 ? void 0 : _e.icon) || '', style: styles.selectIcon })),
3359
- });
3360
- });
3001
+ const func = this.info.funcEnums.map(id => ({
3002
+ name: getName(this.objects[id]?.common?.name, this.props.lang) || id.split('.').pop(),
3003
+ value: id,
3004
+ icon: (React.createElement(Icon, { src: this.objects[id]?.common?.icon || '', style: styles.selectIcon })),
3005
+ }));
3361
3006
  return this.getFilterSelect('func', func);
3362
3007
  }
3363
3008
  getFilterSelectType() {
3364
3009
  const types = this.info.types.map(type => ({
3365
3010
  name: type,
3366
3011
  value: type,
3367
- icon: exports.ITEM_IMAGES[type] || null,
3012
+ icon: ITEM_IMAGES[type] || null,
3368
3013
  }));
3369
3014
  return this.getFilterSelect('type', types);
3370
3015
  }
@@ -3373,17 +3018,16 @@ class ObjectBrowserClass extends react_1.Component {
3373
3018
  const customs = this.info.customs.map(id => ({
3374
3019
  name: id === '_' ? this.texts.filterCustomsWithout : id,
3375
3020
  value: id,
3376
- icon: id === '_' ? null : (react_1.default.createElement(Icon_1.default, { src: getSelectIdIconFromObjects(this.objects, id, this.props.lang, this.imagePrefix) || '', style: styles.selectIcon })),
3021
+ icon: id === '_' ? null : (React.createElement(Icon, { src: getSelectIdIconFromObjects(this.objects, id, this.props.lang, this.imagePrefix) || '', style: styles.selectIcon })),
3377
3022
  }));
3378
3023
  return this.getFilterSelect('custom', customs);
3379
3024
  }
3380
3025
  return null;
3381
3026
  }
3382
3027
  onExpandAll(root, expanded) {
3383
- var _b;
3384
3028
  const _root = root || this.root;
3385
3029
  expanded = expanded || [];
3386
- (_b = _root === null || _root === void 0 ? void 0 : _root.children) === null || _b === void 0 ? void 0 : _b.forEach((item) => {
3030
+ _root?.children?.forEach((item) => {
3387
3031
  if (item.data.sumVisibility) {
3388
3032
  expanded.push(item.data.id);
3389
3033
  this.onExpandAll(item, expanded);
@@ -3401,10 +3045,9 @@ class ObjectBrowserClass extends react_1.Component {
3401
3045
  this.setState({ expanded: [], depth: 0, selected: [] }, () => this.onAfterSelect());
3402
3046
  }
3403
3047
  expandDepth(root, depth, expanded) {
3404
- var _b;
3405
3048
  root = root || this.root;
3406
3049
  if (depth > 0) {
3407
- (_b = root.children) === null || _b === void 0 ? void 0 : _b.forEach(item => {
3050
+ root.children?.forEach(item => {
3408
3051
  if (item.data.sumVisibility) {
3409
3052
  if (!binarySearch(expanded, item.data.id)) {
3410
3053
  expanded.push(item.data.id);
@@ -3439,11 +3082,76 @@ class ObjectBrowserClass extends react_1.Component {
3439
3082
  onCollapseVisible() {
3440
3083
  if (this.state.depth > 0) {
3441
3084
  const depth = this.state.depth - 1;
3442
- const expanded = _a.collapseDepth(depth, this.state.expanded);
3085
+ const expanded = ObjectBrowserClass.collapseDepth(depth, this.state.expanded);
3443
3086
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectExpanded`, JSON.stringify(expanded));
3444
3087
  this.setState({ depth, expanded });
3445
3088
  }
3446
3089
  }
3090
+ getEnumsForId = (id) => {
3091
+ const result = [];
3092
+ this.info.enums.forEach(_id => {
3093
+ if (this.objects[_id]?.common?.members?.includes(id)) {
3094
+ const enumItem = {
3095
+ _id: this.objects[_id]._id,
3096
+ common: JSON.parse(JSON.stringify(this.objects[_id].common)),
3097
+ native: this.objects[_id].native,
3098
+ type: 'enum',
3099
+ };
3100
+ if (enumItem.common) {
3101
+ delete enumItem.common.members;
3102
+ delete enumItem.common.custom;
3103
+ // @ts-expect-error deprecated attribute
3104
+ delete enumItem.common.mobile;
3105
+ }
3106
+ result.push(enumItem);
3107
+ }
3108
+ });
3109
+ return result.length ? result : undefined;
3110
+ };
3111
+ _createAllEnums = async (enums, objId) => {
3112
+ for (let e = 0; e < enums.length; e++) {
3113
+ const item = enums[e];
3114
+ let id;
3115
+ let newObj;
3116
+ // some admin version delivered enums as string
3117
+ if (typeof item === 'object') {
3118
+ newObj = item;
3119
+ id = newObj._id;
3120
+ }
3121
+ else {
3122
+ id = item;
3123
+ }
3124
+ let oldObj = this.objects[id];
3125
+ // if enum does not exist
3126
+ if (!oldObj) {
3127
+ // create a new one
3128
+ oldObj =
3129
+ newObj ||
3130
+ {
3131
+ _id: id,
3132
+ common: {
3133
+ name: id.split('.').pop(),
3134
+ members: [],
3135
+ },
3136
+ native: {},
3137
+ type: 'enum',
3138
+ };
3139
+ oldObj.common = oldObj.common || {};
3140
+ oldObj.common.members = [objId];
3141
+ oldObj.type = 'enum';
3142
+ await this.props.socket.setObject(id, oldObj);
3143
+ }
3144
+ else if (!oldObj.common?.members?.includes(objId)) {
3145
+ oldObj.common = oldObj.common || {};
3146
+ oldObj.type = 'enum';
3147
+ oldObj.common.members = oldObj.common.members || [];
3148
+ // add the missing object
3149
+ oldObj.common.members.push(objId);
3150
+ oldObj.common.members.sort();
3151
+ await this.props.socket.setObject(id, oldObj);
3152
+ }
3153
+ }
3154
+ };
3447
3155
  async loadObjects(objs) {
3448
3156
  if (objs) {
3449
3157
  for (const id in objs) {
@@ -3534,7 +3242,6 @@ class ObjectBrowserClass extends react_1.Component {
3534
3242
  async _exportObjects(
3535
3243
  /** Options to filter/reduce the output */
3536
3244
  options) {
3537
- var _b;
3538
3245
  if (options.isAll) {
3539
3246
  generateFile('allObjects.json', this.objects, options);
3540
3247
  return;
@@ -3549,7 +3256,7 @@ class ObjectBrowserClass extends react_1.Component {
3549
3256
  for (const key of ids) {
3550
3257
  result[key] = JSON.parse(JSON.stringify(this.objects[key]));
3551
3258
  // read states values
3552
- if (((_b = result[key]) === null || _b === void 0 ? void 0 : _b.type) === 'state' && !options.noStatesByExportImport) {
3259
+ if (result[key]?.type === 'state' && !options.noStatesByExportImport) {
3553
3260
  const state = await this.props.socket.getState(key);
3554
3261
  if (state) {
3555
3262
  result[key].val = state.val;
@@ -3570,55 +3277,53 @@ class ObjectBrowserClass extends react_1.Component {
3570
3277
  if (this.state.showExportDialog === false) {
3571
3278
  return null;
3572
3279
  }
3573
- return (react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "lg" },
3574
- react_1.default.createElement(material_1.DialogTitle, null, this.props.t('ra_Select type of export')),
3575
- react_1.default.createElement(material_1.DialogContent, null,
3576
- react_1.default.createElement(material_1.DialogContentText, null, this.state.filter.expertMode || this.state.showAllExportOptions ? (react_1.default.createElement(react_1.default.Fragment, null,
3280
+ return (React.createElement(Dialog, { open: !0, maxWidth: "lg" },
3281
+ React.createElement(DialogTitle, null, this.props.t('ra_Select type of export')),
3282
+ React.createElement(DialogContent, null,
3283
+ React.createElement(DialogContentText, null, this.state.filter.expertMode || this.state.showAllExportOptions ? (React.createElement(React.Fragment, null,
3577
3284
  this.props.t('ra_You can export all objects or just the selected branch.'),
3578
- react_1.default.createElement("br", null),
3285
+ React.createElement("br", null),
3579
3286
  this.props.t('ra_Selected %s object(s)', this.state.showExportDialog),
3580
- react_1.default.createElement("br", null),
3581
- react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.noStatesByExportImport, onChange: e => this.setState({ noStatesByExportImport: e.target.checked }) }), label: this.props.t('ra_Do not export values of states') }),
3582
- react_1.default.createElement("br", null),
3287
+ React.createElement("br", null),
3288
+ React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: this.state.noStatesByExportImport, onChange: e => this.setState({ noStatesByExportImport: e.target.checked }) }), label: this.props.t('ra_Do not export values of states') }),
3289
+ React.createElement("br", null),
3583
3290
  this.props.t('These options can reduce the size of the export file:'),
3584
- react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.beautifyJsonExport, onChange: e => this.setState({ beautifyJsonExport: e.target.checked }) }), label: this.props.t('Beautify JSON output') }),
3585
- react_1.default.createElement("br", null),
3586
- react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.excludeSystemRepositoriesFromExport, onChange: e => this.setState({ excludeSystemRepositoriesFromExport: e.target.checked }) }), label: this.props.t('Exclude system repositories from export JSON') }),
3587
- react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: this.state.excludeTranslations, onChange: e => this.setState({ excludeTranslations: e.target.checked }) }), label: this.props.t('Exclude translations (except english) from export JSON') }))) : null)),
3588
- react_1.default.createElement(material_1.DialogActions, null,
3589
- this.state.filter.expertMode || this.state.showAllExportOptions ? (react_1.default.createElement(material_1.Button, { color: "grey", variant: "outlined", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }, () => this._exportObjects({
3291
+ React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: this.state.beautifyJsonExport, onChange: e => this.setState({ beautifyJsonExport: e.target.checked }) }), label: this.props.t('Beautify JSON output') }),
3292
+ React.createElement("br", null),
3293
+ React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: this.state.excludeSystemRepositoriesFromExport, onChange: e => this.setState({ excludeSystemRepositoriesFromExport: e.target.checked }) }), label: this.props.t('Exclude system repositories from export JSON') }),
3294
+ React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: this.state.excludeTranslations, onChange: e => this.setState({ excludeTranslations: e.target.checked }) }), label: this.props.t('Exclude translations (except english) from export JSON') }))) : null)),
3295
+ React.createElement(DialogActions, null,
3296
+ this.state.filter.expertMode || this.state.showAllExportOptions ? (React.createElement(Button, { color: "grey", variant: "outlined", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }, () => this._exportObjects({
3590
3297
  isAll: true,
3591
3298
  noStatesByExportImport: this.state.noStatesByExportImport,
3592
3299
  beautify: this.state.beautifyJsonExport,
3593
3300
  excludeSystemRepositories: this.state.excludeSystemRepositoriesFromExport,
3594
3301
  excludeTranslations: this.state.excludeTranslations,
3595
3302
  })) },
3596
- react_1.default.createElement("span", { style: { marginRight: 8 } }, this.props.t('ra_All objects')),
3303
+ React.createElement("span", { style: { marginRight: 8 } }, this.props.t('ra_All objects')),
3597
3304
  "(",
3598
3305
  Object.keys(this.objects).length,
3599
- ")")) : (react_1.default.createElement(material_1.Button, { color: "grey", variant: "outlined", startIcon: react_1.default.createElement(IconExpert_1.default, null), onClick: () => this.setState({ showAllExportOptions: true }) }, this.props.t('ra_Advanced options'))),
3600
- react_1.default.createElement(material_1.Button, { color: "primary", variant: "contained", autoFocus: true, onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }, () => this._exportObjects({
3306
+ ")")) : (React.createElement(Button, { color: "grey", variant: "outlined", startIcon: React.createElement(IconExpert, null), onClick: () => this.setState({ showAllExportOptions: true }) }, this.props.t('ra_Advanced options'))),
3307
+ React.createElement(Button, { color: "primary", variant: "contained", autoFocus: true, onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }, () => this._exportObjects({
3601
3308
  isAll: false,
3602
3309
  noStatesByExportImport: this.state.noStatesByExportImport,
3603
3310
  beautify: this.state.beautifyJsonExport,
3604
3311
  excludeSystemRepositories: this.state.excludeSystemRepositoriesFromExport,
3605
3312
  excludeTranslations: this.state.excludeTranslations,
3606
3313
  })) },
3607
- react_1.default.createElement("span", { style: { marginRight: 8 } }, this.props.t('ra_Only selected')),
3314
+ React.createElement("span", { style: { marginRight: 8 } }, this.props.t('ra_Only selected')),
3608
3315
  "(",
3609
3316
  this.state.showExportDialog,
3610
3317
  ")"),
3611
- react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.t('ra_Cancel')))));
3318
+ React.createElement(Button, { color: "grey", variant: "contained", onClick: () => this.setState({ showExportDialog: false, showAllExportOptions: false }), startIcon: React.createElement(IconClose, null) }, this.props.t('ra_Cancel')))));
3612
3319
  }
3613
3320
  handleJsonUpload(evt) {
3614
- var _b;
3615
3321
  const target = evt.target;
3616
- const f = ((_b = target.files) === null || _b === void 0 ? void 0 : _b.length) && target.files[0];
3322
+ const f = target.files?.length && target.files[0];
3617
3323
  if (f) {
3618
3324
  const r = new FileReader();
3619
3325
  r.onload = async (e) => {
3620
- var _b;
3621
- const contents = (_b = e.target) === null || _b === void 0 ? void 0 : _b.result;
3326
+ const contents = e.target?.result;
3622
3327
  try {
3623
3328
  const json = JSON.parse(contents);
3624
3329
  const len = Object.keys(json).length;
@@ -3690,6 +3395,75 @@ class ObjectBrowserClass extends react_1.Component {
3690
3395
  window.alert(this.props.t('ra_Failed to open JSON File'));
3691
3396
  }
3692
3397
  }
3398
+ toolTipObjectCreating = () => {
3399
+ const { t } = this.props;
3400
+ let value = [
3401
+ React.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
3402
+ React.createElement("div", { key: 2 }, t('ra_Folder → State')),
3403
+ React.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
3404
+ React.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
3405
+ React.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
3406
+ React.createElement("div", { key: 6 }, t('ra_Channel → State')),
3407
+ React.createElement("div", { key: 7, style: { height: 10 } }),
3408
+ React.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
3409
+ React.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
3410
+ ];
3411
+ if (this.state.selected.length || this.state.selectedNonObject) {
3412
+ const id = this.state.selected[0] || this.state.selectedNonObject;
3413
+ if (id.split('.').length < 2 || (this.objects[id] && this.objects[id]?.type === 'state')) {
3414
+ // show default tooltip
3415
+ }
3416
+ else if (this.state.filter.expertMode) {
3417
+ switch (this.objects[id]?.type) {
3418
+ case 'device':
3419
+ value = [
3420
+ React.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
3421
+ React.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
3422
+ React.createElement("div", { key: 7, style: { height: 10 } }),
3423
+ React.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
3424
+ React.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
3425
+ ];
3426
+ break;
3427
+ case 'folder':
3428
+ value = [
3429
+ React.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
3430
+ React.createElement("div", { key: 2 }, t('ra_Folder → State')),
3431
+ React.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
3432
+ React.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
3433
+ React.createElement("div", { key: 7, style: { height: 10 } }),
3434
+ React.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
3435
+ React.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
3436
+ ];
3437
+ break;
3438
+ case 'channel':
3439
+ value = [
3440
+ React.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
3441
+ React.createElement("div", { key: 1 }, t('ra_Channel → State')),
3442
+ React.createElement("div", { key: 7, style: { height: 10 } }),
3443
+ React.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
3444
+ React.createElement("div", { key: 9 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
3445
+ ];
3446
+ break;
3447
+ default:
3448
+ break;
3449
+ }
3450
+ }
3451
+ else if (id.startsWith('alias.0') || id.startsWith('0_userdata')) {
3452
+ value = [
3453
+ React.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
3454
+ React.createElement("div", { key: 2 }, t('ra_Folder → State')),
3455
+ React.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
3456
+ React.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
3457
+ React.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
3458
+ React.createElement("div", { key: 6 }, t('ra_Channel → State')),
3459
+ React.createElement("div", { key: 7, style: { height: 10 } }),
3460
+ React.createElement("div", { key: 7 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
3461
+ React.createElement("div", { key: 8 }, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").')),
3462
+ ];
3463
+ }
3464
+ }
3465
+ return value.length ? value : t('ra_Add new child object to selected parent');
3466
+ };
3693
3467
  /**
3694
3468
  * Renders the toolbar.
3695
3469
  */
@@ -3707,36 +3481,36 @@ class ObjectBrowserClass extends react_1.Component {
3707
3481
  allowObjectCreation = true;
3708
3482
  }
3709
3483
  }
3710
- return (react_1.default.createElement("div", { style: {
3484
+ return (React.createElement("div", { style: {
3711
3485
  display: 'flex',
3712
3486
  width: '100%',
3713
3487
  alignItems: 'center',
3714
3488
  overflowX: 'auto',
3715
3489
  } },
3716
- react_1.default.createElement("div", { style: {
3490
+ React.createElement("div", { style: {
3717
3491
  display: 'flex',
3718
3492
  width: '100%',
3719
3493
  alignItems: 'center',
3720
3494
  } },
3721
- react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Refresh tree'), slotProps: { popper: { sx: styles.tooltip } } },
3722
- react_1.default.createElement("div", null,
3723
- react_1.default.createElement(material_1.IconButton, { onClick: () => this.refreshComponent(), disabled: this.state.updating, size: "large" },
3724
- react_1.default.createElement(icons_material_1.Refresh, null)))),
3725
- this.props.showExpertButton && !this.props.expertMode && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_expertMode'), slotProps: { popper: { sx: styles.tooltip } } },
3726
- react_1.default.createElement(material_1.IconButton, { key: "expertMode", color: this.state.filter.expertMode ? 'secondary' : 'default', onClick: () => this.onFilter('expertMode', !this.state.filter.expertMode), size: "large" },
3727
- react_1.default.createElement(IconExpert_1.default, null)))),
3728
- !this.props.disableColumnSelector && this.props.width !== 'xs' && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Configure'), slotProps: { popper: { sx: styles.tooltip } } },
3729
- react_1.default.createElement(material_1.IconButton, { key: "columnSelector", color: this.state.columnsAuto ? 'primary' : 'default', onClick: () => this.setState({ columnsSelectorShow: true }), size: "large" },
3730
- react_1.default.createElement(icons_material_1.ViewColumn, null)))),
3731
- this.props.width !== 'xs' && this.state.expandAllVisible && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Expand all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
3732
- react_1.default.createElement(material_1.IconButton, { key: "expandAll", onClick: () => this.onExpandAll(), size: "large" },
3733
- react_1.default.createElement(IconOpen_1.default, null)))),
3734
- react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Collapse all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
3735
- react_1.default.createElement(material_1.IconButton, { key: "collapseAll", onClick: () => this.onCollapseAll(), size: "large" },
3736
- react_1.default.createElement(IconClosed_1.default, null))),
3737
- this.props.width !== 'xs' && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Expand one step node'), slotProps: { popper: { sx: styles.tooltip } } },
3738
- react_1.default.createElement(material_1.IconButton, { key: "expandVisible", color: "primary", onClick: () => this.onExpandVisible(), size: "large" },
3739
- react_1.default.createElement(material_1.Badge, { badgeContent: this.state.depth, color: "secondary", sx: (theme) => ({
3495
+ React.createElement(Tooltip, { title: this.props.t('ra_Refresh tree'), slotProps: { popper: { sx: styles.tooltip } } },
3496
+ React.createElement("div", null,
3497
+ React.createElement(IconButton, { onClick: () => this.refreshComponent(), disabled: this.state.updating, size: "large" },
3498
+ React.createElement(RefreshIcon, null)))),
3499
+ this.props.showExpertButton && !this.props.expertMode && (React.createElement(Tooltip, { title: this.props.t('ra_expertMode'), slotProps: { popper: { sx: styles.tooltip } } },
3500
+ React.createElement(IconButton, { key: "expertMode", color: this.state.filter.expertMode ? 'secondary' : 'default', onClick: () => this.onFilter('expertMode', !this.state.filter.expertMode), size: "large" },
3501
+ React.createElement(IconExpert, null)))),
3502
+ !this.props.disableColumnSelector && this.props.width !== 'xs' && (React.createElement(Tooltip, { title: this.props.t('ra_Configure'), slotProps: { popper: { sx: styles.tooltip } } },
3503
+ React.createElement(IconButton, { key: "columnSelector", color: this.state.columnsAuto ? 'primary' : 'default', onClick: () => this.setState({ columnsSelectorShow: true }), size: "large" },
3504
+ React.createElement(IconColumns, null)))),
3505
+ this.props.width !== 'xs' && this.state.expandAllVisible && (React.createElement(Tooltip, { title: this.props.t('ra_Expand all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
3506
+ React.createElement(IconButton, { key: "expandAll", onClick: () => this.onExpandAll(), size: "large" },
3507
+ React.createElement(IconOpen, null)))),
3508
+ React.createElement(Tooltip, { title: this.props.t('ra_Collapse all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
3509
+ React.createElement(IconButton, { key: "collapseAll", onClick: () => this.onCollapseAll(), size: "large" },
3510
+ React.createElement(IconClosed, null))),
3511
+ this.props.width !== 'xs' && (React.createElement(Tooltip, { title: this.props.t('ra_Expand one step node'), slotProps: { popper: { sx: styles.tooltip } } },
3512
+ React.createElement(IconButton, { key: "expandVisible", color: "primary", onClick: () => this.onExpandVisible(), size: "large" },
3513
+ React.createElement(Badge, { badgeContent: this.state.depth, color: "secondary", sx: (theme) => ({
3740
3514
  badge: {
3741
3515
  right: 3,
3742
3516
  top: 3,
@@ -3744,10 +3518,10 @@ class ObjectBrowserClass extends react_1.Component {
3744
3518
  padding: '0 4px',
3745
3519
  },
3746
3520
  }) },
3747
- react_1.default.createElement(IconOpen_1.default, null))))),
3748
- this.props.width !== 'xs' && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Collapse one step node'), slotProps: { popper: { sx: styles.tooltip } } },
3749
- react_1.default.createElement(material_1.IconButton, { key: "collapseVisible", color: "primary", onClick: () => this.onCollapseVisible(), size: "large" },
3750
- react_1.default.createElement(material_1.Badge, { sx: (theme) => ({
3521
+ React.createElement(IconOpen, null))))),
3522
+ this.props.width !== 'xs' && (React.createElement(Tooltip, { title: this.props.t('ra_Collapse one step node'), slotProps: { popper: { sx: styles.tooltip } } },
3523
+ React.createElement(IconButton, { key: "collapseVisible", color: "primary", onClick: () => this.onCollapseVisible(), size: "large" },
3524
+ React.createElement(Badge, { sx: (theme) => ({
3751
3525
  badge: {
3752
3526
  right: 3,
3753
3527
  top: 3,
@@ -3755,26 +3529,26 @@ class ObjectBrowserClass extends react_1.Component {
3755
3529
  padding: '0 4px',
3756
3530
  },
3757
3531
  }), badgeContent: this.state.depth, color: "secondary" },
3758
- react_1.default.createElement(IconClosed_1.default, null))))),
3759
- this.props.objectStatesView && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Toggle the states view'), slotProps: { popper: { sx: styles.tooltip } } },
3760
- react_1.default.createElement(material_1.IconButton, { onClick: () => this.onStatesViewVisible(), size: "large" },
3761
- react_1.default.createElement(icons_material_1.LooksOne, { color: this.state.statesView ? 'primary' : 'inherit' })))),
3762
- react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Show/Hide object descriptions'), slotProps: { popper: { sx: styles.tooltip } } },
3763
- react_1.default.createElement(material_1.IconButton, { onClick: () => {
3532
+ React.createElement(IconClosed, null))))),
3533
+ this.props.objectStatesView && (React.createElement(Tooltip, { title: this.props.t('ra_Toggle the states view'), slotProps: { popper: { sx: styles.tooltip } } },
3534
+ React.createElement(IconButton, { onClick: () => this.onStatesViewVisible(), size: "large" },
3535
+ React.createElement(LooksOneIcon, { color: this.state.statesView ? 'primary' : 'inherit' })))),
3536
+ React.createElement(Tooltip, { title: this.props.t('ra_Show/Hide object descriptions'), slotProps: { popper: { sx: styles.tooltip } } },
3537
+ React.createElement(IconButton, { onClick: () => {
3764
3538
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.desc`, this.state.showDescription ? 'false' : 'true');
3765
3539
  this.setState({ showDescription: !this.state.showDescription });
3766
3540
  }, size: "large" },
3767
- react_1.default.createElement(icons_material_1.TextFields, { color: this.state.showDescription ? 'primary' : 'inherit' }))),
3768
- this.props.objectAddBoolean ? (react_1.default.createElement(material_1.Tooltip, { title: this.toolTipObjectCreating(), slotProps: { popper: { sx: styles.tooltip } } },
3769
- react_1.default.createElement("div", null,
3770
- react_1.default.createElement(material_1.IconButton, { disabled: !allowObjectCreation, onClick: () => this.setState({
3541
+ React.createElement(TextFieldsIcon, { color: this.state.showDescription ? 'primary' : 'inherit' }))),
3542
+ this.props.objectAddBoolean ? (React.createElement(Tooltip, { title: this.toolTipObjectCreating(), slotProps: { popper: { sx: styles.tooltip } } },
3543
+ React.createElement("div", null,
3544
+ React.createElement(IconButton, { disabled: !allowObjectCreation, onClick: () => this.setState({
3771
3545
  modalNewObj: {
3772
3546
  id: this.state.selected[0] || this.state.selectedNonObject,
3773
3547
  },
3774
3548
  }), size: "large" },
3775
- react_1.default.createElement(icons_material_1.Add, null))))) : null,
3776
- this.props.objectImportExport && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Add objects tree from JSON file'), slotProps: { popper: { sx: styles.tooltip } } },
3777
- react_1.default.createElement(material_1.IconButton, { onClick: () => {
3549
+ React.createElement(AddIcon, null))))) : null,
3550
+ this.props.objectImportExport && (React.createElement(Tooltip, { title: this.props.t('ra_Add objects tree from JSON file'), slotProps: { popper: { sx: styles.tooltip } } },
3551
+ React.createElement(IconButton, { onClick: () => {
3778
3552
  const input = document.createElement('input');
3779
3553
  input.setAttribute('type', 'file');
3780
3554
  input.setAttribute('id', 'files');
@@ -3782,22 +3556,21 @@ class ObjectBrowserClass extends react_1.Component {
3782
3556
  input.addEventListener('change', (e) => this.handleJsonUpload(e), false);
3783
3557
  input.click();
3784
3558
  }, size: "large" },
3785
- react_1.default.createElement(icons_material_1.Publish, null)))),
3559
+ React.createElement(PublishIcon, null)))),
3786
3560
  this.props.objectImportExport &&
3787
- (!!this.state.selected.length || this.state.selectedNonObject) && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Save objects tree as JSON file'), slotProps: { popper: { sx: styles.tooltip } } },
3788
- react_1.default.createElement(material_1.IconButton, { onClick: () => this.setState({ showExportDialog: this._getSelectedIdsForExport().length }), size: "large" },
3789
- react_1.default.createElement(icons_material_1.Publish, { style: { transform: 'rotate(180deg)' } }))))),
3790
- !!this.props.objectBrowserEditObject && this.props.width !== 'xs' && (react_1.default.createElement("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, `${this.props.t('ra_Objects')}: ${Object.keys(this.info.objects).length}, ${this.props.t('ra_States')}: ${Object.keys(this.info.objects).filter(el => this.info.objects[el].type === 'state').length}`)),
3791
- this.props.objectEditBoolean && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Edit custom config'), slotProps: { popper: { sx: styles.tooltip } } },
3792
- react_1.default.createElement(material_1.IconButton, { onClick: () => {
3793
- var _b;
3561
+ (!!this.state.selected.length || this.state.selectedNonObject) && (React.createElement(Tooltip, { title: this.props.t('ra_Save objects tree as JSON file'), slotProps: { popper: { sx: styles.tooltip } } },
3562
+ React.createElement(IconButton, { onClick: () => this.setState({ showExportDialog: this._getSelectedIdsForExport().length }), size: "large" },
3563
+ React.createElement(PublishIcon, { style: { transform: 'rotate(180deg)' } }))))),
3564
+ !!this.props.objectBrowserEditObject && this.props.width !== 'xs' && (React.createElement("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, `${this.props.t('ra_Objects')}: ${Object.keys(this.info.objects).length}, ${this.props.t('ra_States')}: ${Object.keys(this.info.objects).filter(el => this.info.objects[el].type === 'state').length}`)),
3565
+ this.props.objectEditBoolean && (React.createElement(Tooltip, { title: this.props.t('ra_Edit custom config'), slotProps: { popper: { sx: styles.tooltip } } },
3566
+ React.createElement(IconButton, { onClick: () => {
3794
3567
  // get all visible states
3795
3568
  const ids = this.root ? getVisibleItems(this.root, 'state', this.objects) : [];
3796
3569
  if (ids.length) {
3797
3570
  this.pauseSubscribe(true);
3798
3571
  if (ids.length === 1) {
3799
3572
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, this.state.selected[0]);
3800
- (_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate(null, 'custom', this.state.selected[0]);
3573
+ this.props.router?.doNavigate(null, 'custom', this.state.selected[0]);
3801
3574
  }
3802
3575
  this.setState({ customDialog: ids, customDialogAll: true });
3803
3576
  }
@@ -3805,7 +3578,7 @@ class ObjectBrowserClass extends react_1.Component {
3805
3578
  this.setState({ toast: this.props.t('ra_please select object') });
3806
3579
  }
3807
3580
  }, size: "large" },
3808
- react_1.default.createElement(icons_material_1.Build, null))))));
3581
+ React.createElement(BuildIcon, null))))));
3809
3582
  }
3810
3583
  toggleExpanded(id) {
3811
3584
  const expanded = JSON.parse(JSON.stringify(this.state.expanded));
@@ -3823,7 +3596,7 @@ class ObjectBrowserClass extends react_1.Component {
3823
3596
  onCopy(e, text) {
3824
3597
  e.stopPropagation();
3825
3598
  e.preventDefault();
3826
- Utils_1.default.copyToClipboard(text);
3599
+ Utils.copyToClipboard(text);
3827
3600
  if (text.length < 50) {
3828
3601
  this.setState({ toast: this.props.t('ra_Copied %s', text) });
3829
3602
  }
@@ -3831,14 +3604,82 @@ class ObjectBrowserClass extends react_1.Component {
3831
3604
  this.setState({ toast: this.props.t('ra_Copied') });
3832
3605
  }
3833
3606
  }
3607
+ renderTooltipAccessControl = (acl) => {
3608
+ // acl ={object,state,owner,ownerGroup}
3609
+ if (!acl) {
3610
+ return null;
3611
+ }
3612
+ const check = [
3613
+ {
3614
+ value: '0x400',
3615
+ valueNum: 0x400,
3616
+ title: 'read',
3617
+ group: 'Owner',
3618
+ },
3619
+ {
3620
+ value: '0x200',
3621
+ valueNum: 0x200,
3622
+ title: 'write',
3623
+ group: 'Owner',
3624
+ },
3625
+ {
3626
+ value: '0x40',
3627
+ valueNum: 0x40,
3628
+ title: 'read',
3629
+ group: 'Group',
3630
+ },
3631
+ {
3632
+ value: '0x20',
3633
+ valueNum: 0x20,
3634
+ title: 'write',
3635
+ group: 'Group',
3636
+ },
3637
+ {
3638
+ value: '0x4',
3639
+ valueNum: 0x4,
3640
+ title: 'read',
3641
+ group: 'Everyone',
3642
+ },
3643
+ {
3644
+ value: '0x2',
3645
+ valueNum: 0x2,
3646
+ title: 'write',
3647
+ group: 'Everyone',
3648
+ },
3649
+ ];
3650
+ const arrayTooltipText = [];
3651
+ const funcRenderStateObject = (value) => {
3652
+ const rights = acl[value];
3653
+ check.forEach((el, i) => {
3654
+ if (rights & el.valueNum) {
3655
+ arrayTooltipText.push(React.createElement("span", { key: value + i },
3656
+ this.texts[`acl${el.group}_${el.title}_${value}`],
3657
+ ",",
3658
+ React.createElement("span", { style: value === 'object' ? styles.rightsObject : styles.rightsState }, el.value)));
3659
+ }
3660
+ });
3661
+ };
3662
+ arrayTooltipText.push(React.createElement("span", { key: "group" }, `${this.texts.ownerGroup}: ${(acl.ownerGroup || '').replace('system.group.', '')}`));
3663
+ arrayTooltipText.push(React.createElement("span", { key: "owner" }, `${this.texts.ownerUser}: ${(acl.owner || '').replace('system.user.', '')}`));
3664
+ funcRenderStateObject('object');
3665
+ if (acl.state) {
3666
+ funcRenderStateObject('state');
3667
+ }
3668
+ return arrayTooltipText.length ? (React.createElement("span", { style: styles.tooltipAccessControl }, arrayTooltipText.map(el => el))) : null;
3669
+ };
3834
3670
  renderColumnButtons(id, item) {
3835
- var _b, _c, _d;
3836
3671
  if (!item.data.obj) {
3837
- return this.props.onObjectDelete || this.props.objectEditOfAccessControl ? (react_1.default.createElement("div", { style: styles.buttonDiv },
3838
- this.state.filter.expertMode && this.props.objectEditOfAccessControl ? (react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonsEmptyButton), styles.cellButtonMinWidth), onClick: () => this.setState({ modalEditOfAccess: true, modalEditOfAccessObjData: item.data }), size: "large" },
3839
- react_1.default.createElement("div", { style: { height: 15 } }, "---"))) : null,
3840
- this.props.onObjectDelete && item.children && item.children.length ? (react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonsButtonAlone), size: "small", "aria-label": "delete", title: this.texts.deleteObject, onClick: () => {
3841
- var _b;
3672
+ return this.props.onObjectDelete || this.props.objectEditOfAccessControl ? (React.createElement("div", { style: styles.buttonDiv },
3673
+ this.state.filter.expertMode && this.props.objectEditOfAccessControl ? (React.createElement(IconButton, { sx: {
3674
+ ...styles.cellButtonsButton,
3675
+ ...styles.cellButtonsEmptyButton,
3676
+ ...styles.cellButtonMinWidth,
3677
+ }, onClick: () => this.setState({ modalEditOfAccess: true, modalEditOfAccessObjData: item.data }), size: "large" },
3678
+ React.createElement("div", { style: { height: 15 } }, "---"))) : null,
3679
+ this.props.onObjectDelete && item.children && item.children.length ? (React.createElement(IconButton, { sx: {
3680
+ ...styles.cellButtonsButton,
3681
+ ...styles.cellButtonsButtonAlone,
3682
+ }, size: "small", "aria-label": "delete", title: this.texts.deleteObject, onClick: () => {
3842
3683
  // calculate the number of children
3843
3684
  const keys = Object.keys(this.objects);
3844
3685
  keys.sort();
@@ -3853,10 +3694,10 @@ class ObjectBrowserClass extends react_1.Component {
3853
3694
  }
3854
3695
  }
3855
3696
  if (this.props.onObjectDelete) {
3856
- this.props.onObjectDelete(id, !!((_b = item.children) === null || _b === void 0 ? void 0 : _b.length), false, count + 1);
3697
+ this.props.onObjectDelete(id, !!item.children?.length, false, count + 1);
3857
3698
  }
3858
3699
  } },
3859
- react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon }))) : null)) : null;
3700
+ React.createElement(IconDelete, { style: styles.cellButtonsButtonIcon }))) : null)) : null;
3860
3701
  }
3861
3702
  item.data.aclTooltip =
3862
3703
  item.data.aclTooltip || this.renderTooltipAccessControl(item.data.obj.acl);
@@ -3869,20 +3710,26 @@ class ObjectBrowserClass extends react_1.Component {
3869
3710
  (item.data.obj.type === 'state'
3870
3711
  ? this.systemConfig.common.defaultNewAcl.state
3871
3712
  : this.systemConfig.common.defaultNewAcl.object);
3872
- const showEdit = this.state.filter.expertMode || _a.isNonExpertId(item.data.id);
3713
+ const showEdit = this.state.filter.expertMode || ObjectBrowserClass.isNonExpertId(item.data.id);
3873
3714
  return [
3874
- this.state.filter.expertMode && this.props.objectEditOfAccessControl ? (react_1.default.createElement(material_1.Tooltip, { key: "acl", title: item.data.aclTooltip, slotProps: { popper: { sx: styles.tooltip } } },
3875
- react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign(Object.assign({}, styles.cellButtonsButton), styles.cellButtonMinWidth), { opacity: 1 }), onClick: () => this.setState({ modalEditOfAccess: true, modalEditOfAccessObjData: item.data }), size: "large" },
3876
- react_1.default.createElement("div", { style: styles.aclText }, Number.isNaN(Number(acl))
3715
+ this.state.filter.expertMode && this.props.objectEditOfAccessControl ? (React.createElement(Tooltip, { key: "acl", title: item.data.aclTooltip, slotProps: { popper: { sx: styles.tooltip } } },
3716
+ React.createElement(IconButton, { sx: {
3717
+ ...styles.cellButtonsButton,
3718
+ ...styles.cellButtonMinWidth,
3719
+ opacity: 1,
3720
+ }, onClick: () => this.setState({ modalEditOfAccess: true, modalEditOfAccessObjData: item.data }), size: "large" },
3721
+ React.createElement("div", { style: styles.aclText }, Number.isNaN(Number(acl))
3877
3722
  ? Number(aclSystemConfig).toString(16)
3878
- : Number(acl).toString(16))))) : (react_1.default.createElement("div", { key: "aclEmpty", style: styles.cellButtonMinWidth })),
3879
- showEdit ? (react_1.default.createElement(material_1.IconButton, { key: "edit", sx: Object.assign({ marginRight: '2px' }, styles.cellButtonsButton), size: "small", "aria-label": "edit", title: this.texts.editObject, onClick: () => {
3723
+ : Number(acl).toString(16))))) : (React.createElement("div", { key: "aclEmpty", style: styles.cellButtonMinWidth })),
3724
+ showEdit ? (React.createElement(IconButton, { key: "edit", sx: {
3725
+ marginRight: '2px',
3726
+ ...styles.cellButtonsButton,
3727
+ }, size: "small", "aria-label": "edit", title: this.texts.editObject, onClick: () => {
3880
3728
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, id);
3881
3729
  this.setState({ editObjectDialog: id, editObjectAlias: false });
3882
3730
  } },
3883
- react_1.default.createElement(icons_material_1.Edit, { style: styles.cellButtonsButtonIcon }))) : (react_1.default.createElement(material_1.Box, { component: "div", key: "editDisabled", sx: styles.cellButtonsButton })),
3884
- this.props.onObjectDelete && (((_b = item.children) === null || _b === void 0 ? void 0 : _b.length) || !((_c = item.data.obj.common) === null || _c === void 0 ? void 0 : _c.dontDelete)) ? (react_1.default.createElement(material_1.IconButton, { key: "delete", sx: styles.cellButtonsButton, size: "small", "aria-label": "delete", onClick: () => {
3885
- var _b, _c, _d;
3731
+ React.createElement(IconEdit, { style: styles.cellButtonsButtonIcon }))) : (React.createElement(Box, { component: "div", key: "editDisabled", sx: styles.cellButtonsButton })),
3732
+ this.props.onObjectDelete && (item.children?.length || !item.data.obj.common?.dontDelete) ? (React.createElement(IconButton, { key: "delete", sx: styles.cellButtonsButton, size: "small", "aria-label": "delete", onClick: () => {
3886
3733
  const keys = Object.keys(this.objects);
3887
3734
  keys.sort();
3888
3735
  let count = 0;
@@ -3896,28 +3743,29 @@ class ObjectBrowserClass extends react_1.Component {
3896
3743
  }
3897
3744
  }
3898
3745
  if (this.props.onObjectDelete) {
3899
- this.props.onObjectDelete(id, !!((_b = item.children) === null || _b === void 0 ? void 0 : _b.length), !((_d = (_c = item.data.obj) === null || _c === void 0 ? void 0 : _c.common) === null || _d === void 0 ? void 0 : _d.dontDelete), count);
3746
+ this.props.onObjectDelete(id, !!item.children?.length, !item.data.obj?.common?.dontDelete, count);
3900
3747
  }
3901
3748
  }, title: this.texts.deleteObject },
3902
- react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon }))) : null,
3749
+ React.createElement(IconDelete, { style: styles.cellButtonsButtonIcon }))) : null,
3903
3750
  this.props.objectCustomDialog &&
3904
3751
  this.info.hasSomeCustoms &&
3905
3752
  item.data.obj.type === 'state' &&
3906
3753
  // @ts-expect-error deprecated from js-controller 6
3907
- ((_d = item.data.obj.common) === null || _d === void 0 ? void 0 : _d.type) !== 'file' ? (react_1.default.createElement(material_1.IconButton, { sx: Object.assign(Object.assign({}, styles.cellButtonsButton), (item.data.hasCustoms
3908
- ? this.styles.cellButtonsButtonWithCustoms
3909
- : styles.cellButtonsButtonWithoutCustoms)), key: "custom", size: "small", "aria-label": "config", title: this.texts.customConfig, onClick: () => {
3910
- var _b;
3754
+ item.data.obj.common?.type !== 'file' ? (React.createElement(IconButton, { sx: {
3755
+ ...styles.cellButtonsButton,
3756
+ ...(item.data.hasCustoms
3757
+ ? this.styles.cellButtonsButtonWithCustoms
3758
+ : styles.cellButtonsButtonWithoutCustoms),
3759
+ }, key: "custom", size: "small", "aria-label": "config", title: this.texts.customConfig, onClick: () => {
3911
3760
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, id);
3912
3761
  this.pauseSubscribe(true);
3913
- (_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate(null, 'customs', id);
3762
+ this.props.router?.doNavigate(null, 'customs', id);
3914
3763
  this.setState({ customDialog: [id], customDialogAll: false });
3915
3764
  } },
3916
- react_1.default.createElement(icons_material_1.Settings, { style: styles.cellButtonsButtonIcon }))) : null,
3765
+ React.createElement(IconConfig, { style: styles.cellButtonsButtonIcon }))) : null,
3917
3766
  ];
3918
3767
  }
3919
3768
  readHistory(id) {
3920
- var _b, _c;
3921
3769
  /* interface GetHistoryOptions {
3922
3770
  instance?: string;
3923
3771
  start?: number;
@@ -3935,7 +3783,7 @@ class ObjectBrowserClass extends react_1.Component {
3935
3783
  } */
3936
3784
  if (window.sparkline &&
3937
3785
  this.defaultHistory &&
3938
- ((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.custom) &&
3786
+ this.objects[id]?.common?.custom &&
3939
3787
  this.objects[id].common.custom[this.defaultHistory]) {
3940
3788
  const now = new Date();
3941
3789
  now.setHours(now.getHours() - 24);
@@ -3969,7 +3817,6 @@ class ObjectBrowserClass extends react_1.Component {
3969
3817
  }
3970
3818
  }
3971
3819
  getTooltipInfo(id, cb) {
3972
- var _b, _c;
3973
3820
  const obj = this.objects[id];
3974
3821
  const state = this.states[id];
3975
3822
  const { valFull, fileViewer } = formatValue({
@@ -3981,45 +3828,44 @@ class ObjectBrowserClass extends react_1.Component {
3981
3828
  full: true,
3982
3829
  });
3983
3830
  const valFullRx = [];
3984
- valFull === null || valFull === void 0 ? void 0 : valFull.forEach(_item => {
3831
+ valFull?.forEach(_item => {
3985
3832
  if (_item.t === this.texts.quality && state.q) {
3986
- valFullRx.push(react_1.default.createElement("div", { style: styles.cellValueTooltipBoth, key: _item.t },
3833
+ valFullRx.push(React.createElement("div", { style: styles.cellValueTooltipBoth, key: _item.t },
3987
3834
  _item.t,
3988
3835
  ":\u00A0",
3989
3836
  _item.v));
3990
3837
  // <div style={styles.cellValueTooltipValue} key={item.t + '_v'}>{item.v}</div>,
3991
3838
  if (!_item.nbr) {
3992
- valFullRx.push(react_1.default.createElement("br", { key: `${_item.t}_br` }));
3839
+ valFullRx.push(React.createElement("br", { key: `${_item.t}_br` }));
3993
3840
  }
3994
3841
  }
3995
3842
  else {
3996
- valFullRx.push(react_1.default.createElement("div", { style: styles.cellValueTooltipTitle, key: _item.t },
3843
+ valFullRx.push(React.createElement("div", { style: styles.cellValueTooltipTitle, key: _item.t },
3997
3844
  _item.t,
3998
3845
  ":\u00A0"));
3999
- valFullRx.push(react_1.default.createElement("div", { style: styles.cellValueTooltipValue, key: `${_item.t}_v` }, _item.v));
3846
+ valFullRx.push(React.createElement("div", { style: styles.cellValueTooltipValue, key: `${_item.t}_v` }, _item.v));
4000
3847
  if (!_item.nbr) {
4001
- valFullRx.push(react_1.default.createElement("br", { key: `${_item.t}_br` }));
3848
+ valFullRx.push(React.createElement("br", { key: `${_item.t}_br` }));
4002
3849
  }
4003
3850
  }
4004
3851
  });
4005
3852
  if (fileViewer === 'image') {
4006
- valFullRx.push(react_1.default.createElement("img", { style: styles.cellValueTooltipImage, src: state.val, alt: id }));
3853
+ valFullRx.push(React.createElement("img", { style: styles.cellValueTooltipImage, src: state.val, alt: id }));
4007
3854
  }
4008
3855
  else if (this.defaultHistory &&
4009
- ((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.custom) &&
3856
+ this.objects[id]?.common?.custom &&
4010
3857
  this.objects[id].common.custom[this.defaultHistory]) {
4011
- valFullRx.push(react_1.default.createElement("svg", { key: "sparkline", className: "sparkline", "data-id": id, style: { fill: '#3d85de' }, width: "200", height: "30", strokeWidth: "3" }));
3858
+ valFullRx.push(React.createElement("svg", { key: "sparkline", className: "sparkline", "data-id": id, style: { fill: '#3d85de' }, width: "200", height: "30", strokeWidth: "3" }));
4012
3859
  }
4013
3860
  this.setState({ tooltipInfo: { el: valFullRx, id } }, () => cb && cb());
4014
3861
  }
4015
3862
  renderColumnValue(id, item, narrowStyleWithDetails) {
4016
- var _b, _c;
4017
3863
  const obj = item.data.obj;
4018
3864
  if (!obj || !this.states) {
4019
3865
  return null;
4020
3866
  }
4021
- if (((_b = obj.common) === null || _b === void 0 ? void 0 : _b.type) === 'file') {
4022
- return (react_1.default.createElement(material_1.Box, { component: "div", sx: Object.assign(Object.assign({}, styles.cellValueText), styles.cellValueFile) }, "[file]"));
3867
+ if (obj.common?.type === 'file') {
3868
+ return (React.createElement(Box, { component: "div", sx: { ...styles.cellValueText, ...styles.cellValueFile } }, "[file]"));
4023
3869
  }
4024
3870
  if (!this.states[id]) {
4025
3871
  if (obj.type === 'state') {
@@ -4050,23 +3896,23 @@ class ObjectBrowserClass extends react_1.Component {
4050
3896
  const valTextRx = [];
4051
3897
  item.data.state = { valTextRx };
4052
3898
  const copyText = valText.v || '';
4053
- valTextRx.push(react_1.default.createElement("span", { className: `newValueBrowser-${this.props.themeType || 'light'}`, key: `${valText.v.toString()}valText`, style: {
3899
+ valTextRx.push(React.createElement("span", { className: `newValueBrowser-${this.props.themeType || 'light'}`, key: `${valText.v.toString()}valText`, style: {
4054
3900
  whiteSpace: 'nowrap',
4055
3901
  display: 'inline-block',
4056
3902
  overflow: 'hidden',
4057
3903
  textOverflow: 'ellipsis',
4058
3904
  } }, valText.v.toString()));
4059
3905
  if (valText.u) {
4060
- valTextRx.push(react_1.default.createElement("span", { className: `newValueBrowser-${this.props.themeType || 'light'}`, style: styles.cellValueTextUnit, key: `${valText.v.toString()}unit` }, valText.u));
3906
+ valTextRx.push(React.createElement("span", { className: `newValueBrowser-${this.props.themeType || 'light'}`, style: styles.cellValueTextUnit, key: `${valText.v.toString()}unit` }, valText.u));
4061
3907
  }
4062
3908
  if (valText.s !== undefined) {
4063
- valTextRx.push(react_1.default.createElement("span", { style: styles.cellValueTextState, className: `newValueBrowser-${this.props.themeType || 'light'}`, key: `${valText.v.toString()}states` },
3909
+ valTextRx.push(React.createElement("span", { style: styles.cellValueTextState, className: `newValueBrowser-${this.props.themeType || 'light'}`, key: `${valText.v.toString()}states` },
4064
3910
  "(",
4065
3911
  valText.s,
4066
3912
  ")"));
4067
3913
  }
4068
3914
  if (!narrowStyleWithDetails) {
4069
- valTextRx.push(react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: this.styles.iconCopy, onClick: e => this.onCopy(e, copyText), key: "cc" }));
3915
+ valTextRx.push(React.createElement(IconCopy, { className: "copyButton", style: this.styles.iconCopy, onClick: e => this.onCopy(e, copyText), key: "cc" }));
4070
3916
  }
4071
3917
  // <IconEdit className="copyButton" style={{{ ...styles.cellButtonsValueButton, styles.cellButtonsValueButtonEdit)} key="ce" />
4072
3918
  info = item.data.state;
@@ -4076,12 +3922,12 @@ class ObjectBrowserClass extends react_1.Component {
4076
3922
  if (!this.state.filter.expertMode) {
4077
3923
  if (item.data.button) {
4078
3924
  val = [
4079
- react_1.default.createElement(ButtonIcon, { key: "button", style: Object.assign({ color: info.style.color }, styles.cellValueButton) }),
3925
+ React.createElement(ButtonIcon, { key: "button", style: { color: info.style.color, ...styles.cellValueButton } }),
4080
3926
  ];
4081
3927
  }
4082
3928
  else if (item.data.switch) {
4083
3929
  val = [
4084
- react_1.default.createElement(material_1.Switch, { key: "switch", sx: {
3930
+ React.createElement(Switch, { key: "switch", sx: {
4085
3931
  '& .MuiSwitch-thumb': { color: info.style.color },
4086
3932
  '& .MuiSwitch-track': {
4087
3933
  backgroundColor: !!this.states[id].val && this.state.selected.includes(id)
@@ -4094,16 +3940,19 @@ class ObjectBrowserClass extends react_1.Component {
4094
3940
  ];
4095
3941
  }
4096
3942
  }
4097
- return (react_1.default.createElement(material_1.Tooltip, { key: "value", title: (_c = this.state.tooltipInfo) === null || _c === void 0 ? void 0 : _c.el, slotProps: {
3943
+ return (React.createElement(Tooltip, { key: "value", title: this.state.tooltipInfo?.el, slotProps: {
4098
3944
  popper: { sx: styles.cellValueTooltipBox },
4099
3945
  tooltip: { sx: styles.cellValueTooltip },
4100
- }, onOpen: () => this.getTooltipInfo(id, () => this.readHistory(id)), onClose: () => { var _b; return ((_b = this.state.tooltipInfo) === null || _b === void 0 ? void 0 : _b.id) === id && this.setState({ tooltipInfo: null }); } },
4101
- react_1.default.createElement(material_1.Box, { component: "div", style: info.style, sx: Object.assign(Object.assign({}, styles.cellValueText), { height: narrowStyleWithDetails ? undefined : ROW_HEIGHT, '& .admin-button:active': {
3946
+ }, onOpen: () => this.getTooltipInfo(id, () => this.readHistory(id)), onClose: () => this.state.tooltipInfo?.id === id && this.setState({ tooltipInfo: null }) },
3947
+ React.createElement(Box, { component: "div", style: info.style, sx: {
3948
+ ...styles.cellValueText,
3949
+ height: narrowStyleWithDetails ? undefined : ROW_HEIGHT,
3950
+ '& .admin-button:active': {
4102
3951
  transform: 'translate(0, 2px)',
4103
- } }) }, val)));
3952
+ },
3953
+ } }, val)));
4104
3954
  }
4105
3955
  _syncEnum(id, enumIds, newArray, cb) {
4106
- var _b, _c, _d;
4107
3956
  if (!enumIds || !enumIds.length) {
4108
3957
  if (cb) {
4109
3958
  cb();
@@ -4112,8 +3961,8 @@ class ObjectBrowserClass extends react_1.Component {
4112
3961
  }
4113
3962
  const enumId = enumIds.pop() || '';
4114
3963
  const promises = [];
4115
- if ((_b = this.info.objects[enumId]) === null || _b === void 0 ? void 0 : _b.common) {
4116
- if ((_c = this.info.objects[enumId].common.members) === null || _c === void 0 ? void 0 : _c.length) {
3964
+ if (this.info.objects[enumId]?.common) {
3965
+ if (this.info.objects[enumId].common.members?.length) {
4117
3966
  const pos = this.info.objects[enumId].common.members.indexOf(id);
4118
3967
  if (pos !== -1 && !newArray.includes(enumId)) {
4119
3968
  // delete it from members
@@ -4126,7 +3975,7 @@ class ObjectBrowserClass extends react_1.Component {
4126
3975
  }
4127
3976
  }
4128
3977
  // add to it
4129
- if (newArray.includes(enumId) && !((_d = this.info.objects[enumId].common.members) === null || _d === void 0 ? void 0 : _d.includes(id))) {
3978
+ if (newArray.includes(enumId) && !this.info.objects[enumId].common.members?.includes(id)) {
4130
3979
  // add to object
4131
3980
  const obj = JSON.parse(JSON.stringify(this.info.objects[enumId]));
4132
3981
  obj.common.members = obj.common.members || [];
@@ -4160,28 +4009,25 @@ class ObjectBrowserClass extends react_1.Component {
4160
4009
  const itemEnums = this.state.enumDialogEnums;
4161
4010
  const enumsOriginal = this.state.enumDialog.enumsOriginal;
4162
4011
  const enums = (type === 'room' ? this.info.roomEnums : this.info.funcEnums)
4163
- .map(id => {
4164
- var _b, _c;
4165
- return ({
4166
- name: getName(((_c = (_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.common) === null || _c === void 0 ? void 0 : _c.name) || id.split('.').pop() || '', this.props.lang),
4167
- value: id,
4168
- icon: getSelectIdIconFromObjects(this.objects, id, this.props.lang, this.imagePrefix),
4169
- });
4170
- })
4012
+ .map(id => ({
4013
+ name: getName(this.objects[id]?.common?.name || id.split('.').pop() || '', this.props.lang),
4014
+ value: id,
4015
+ icon: getSelectIdIconFromObjects(this.objects, id, this.props.lang, this.imagePrefix),
4016
+ }))
4171
4017
  .sort((a, b) => (a.name > b.name ? 1 : -1));
4172
4018
  enums.forEach(_item => {
4173
4019
  if (_item.icon && typeof _item.icon === 'string') {
4174
- _item.icon = (react_1.default.createElement(material_1.Box, { style: styles.enumIconDiv },
4175
- react_1.default.createElement("img", { src: _item.icon, style: styles.enumIcon, alt: _item.name })));
4020
+ _item.icon = (React.createElement(Box, { style: styles.enumIconDiv },
4021
+ React.createElement("img", { src: _item.icon, style: styles.enumIcon, alt: _item.name })));
4176
4022
  }
4177
4023
  });
4178
4024
  // const hasIcons = !!enums.find(item => item.icon);
4179
- return (react_1.default.createElement(material_1.Dialog, { sx: { '& .MuiPaper-root': styles.enumDialog }, onClose: () => this.setState({ enumDialog: null }), "aria-labelledby": "enum-dialog-title", open: !0 },
4180
- react_1.default.createElement(material_1.DialogTitle, { id: "enum-dialog-title" },
4025
+ return (React.createElement(Dialog, { sx: { '& .MuiPaper-root': styles.enumDialog }, onClose: () => this.setState({ enumDialog: null }), "aria-labelledby": "enum-dialog-title", open: !0 },
4026
+ React.createElement(DialogTitle, { id: "enum-dialog-title" },
4181
4027
  type === 'func' ? this.props.t('ra_Define functions') : this.props.t('ra_Define rooms'),
4182
- react_1.default.createElement(material_1.Fab, { sx: styles.enumButton, color: "primary", disabled: enumsOriginal === JSON.stringify(itemEnums), size: "small", onClick: () => this.syncEnum(item.data.id, type, itemEnums).then(() => this.setState({ enumDialog: null, enumDialogEnums: null })) },
4183
- react_1.default.createElement(icons_material_1.Check, null))),
4184
- react_1.default.createElement(material_1.List, { sx: { '&.MuiList-root': styles.enumList } }, enums.map(_item => {
4028
+ React.createElement(Fab, { sx: styles.enumButton, color: "primary", disabled: enumsOriginal === JSON.stringify(itemEnums), size: "small", onClick: () => this.syncEnum(item.data.id, type, itemEnums).then(() => this.setState({ enumDialog: null, enumDialogEnums: null })) },
4029
+ React.createElement(IconCheck, null))),
4030
+ React.createElement(List, { sx: { '&.MuiList-root': styles.enumList } }, enums.map(_item => {
4185
4031
  let id;
4186
4032
  let name;
4187
4033
  let icon;
@@ -4195,7 +4041,7 @@ class ObjectBrowserClass extends react_1.Component {
4195
4041
  name = _item;
4196
4042
  }
4197
4043
  const labelId = `checkbox-list-label-${id}`;
4198
- return (react_1.default.createElement(material_1.ListItem, { sx: styles.headerCellSelectItem, key: id, onClick: () => {
4044
+ return (React.createElement(ListItem, { sx: styles.headerCellSelectItem, key: id, onClick: () => {
4199
4045
  const pos = itemEnums.indexOf(id);
4200
4046
  const enumDialogEnums = JSON.parse(JSON.stringify(this.state.enumDialogEnums));
4201
4047
  if (pos === -1) {
@@ -4207,9 +4053,9 @@ class ObjectBrowserClass extends react_1.Component {
4207
4053
  }
4208
4054
  this.setState({ enumDialogEnums });
4209
4055
  }, secondaryAction: icon },
4210
- react_1.default.createElement(material_1.ListItemIcon, { sx: { '&.MuiListItemIcon-root': styles.enumCheckbox } },
4211
- react_1.default.createElement(material_1.Checkbox, { edge: "start", checked: itemEnums.includes(id), tabIndex: -1, disableRipple: true, inputProps: { 'aria-labelledby': labelId } })),
4212
- react_1.default.createElement(material_1.ListItemText, { id: labelId }, name)));
4056
+ React.createElement(ListItemIcon, { sx: { '&.MuiListItemIcon-root': styles.enumCheckbox } },
4057
+ React.createElement(Checkbox, { edge: "start", checked: itemEnums.includes(id), tabIndex: -1, disableRipple: true, inputProps: { 'aria-labelledby': labelId } })),
4058
+ React.createElement(ListItemText, { id: labelId }, name)));
4213
4059
  }))));
4214
4060
  }
4215
4061
  renderEditRoleDialog() {
@@ -4218,7 +4064,7 @@ class ObjectBrowserClass extends react_1.Component {
4218
4064
  }
4219
4065
  if (this.state.roleDialog && this.props.objectBrowserEditRole) {
4220
4066
  const ObjectBrowserEditRole = this.props.objectBrowserEditRole;
4221
- return (react_1.default.createElement(ObjectBrowserEditRole, { key: "objectBrowserEditRole", id: this.state.roleDialog, socket: this.props.socket, t: this.props.t, roles: this.info.roles, onClose: (obj) => {
4067
+ return (React.createElement(ObjectBrowserEditRole, { key: "objectBrowserEditRole", id: this.state.roleDialog, socket: this.props.socket, t: this.props.t, roles: this.info.roles, onClose: (obj) => {
4222
4068
  if (obj) {
4223
4069
  this.info.objects[this.state.roleDialog] = obj;
4224
4070
  }
@@ -4228,7 +4074,6 @@ class ObjectBrowserClass extends react_1.Component {
4228
4074
  return null;
4229
4075
  }
4230
4076
  onColumnsEditCustomDialogClose(isSave) {
4231
- var _b, _c;
4232
4077
  // cannot be null
4233
4078
  const customColumnDialog = this.customColumnDialog;
4234
4079
  if (isSave) {
@@ -4241,11 +4086,10 @@ class ObjectBrowserClass extends react_1.Component {
4241
4086
  }
4242
4087
  this.customColumnDialog = null;
4243
4088
  this.props.socket
4244
- .getObject(((_c = (_b = this.state.columnsEditCustomDialog) === null || _b === void 0 ? void 0 : _b.obj) === null || _c === void 0 ? void 0 : _c._id) || '')
4089
+ .getObject(this.state.columnsEditCustomDialog?.obj?._id || '')
4245
4090
  .then(obj => {
4246
- var _b;
4247
4091
  if (obj &&
4248
- _a.setCustomValue(obj, (_b = this.state.columnsEditCustomDialog) === null || _b === void 0 ? void 0 : _b.it, value)) {
4092
+ ObjectBrowserClass.setCustomValue(obj, this.state.columnsEditCustomDialog?.it, value)) {
4249
4093
  return this.props.socket.setObject(obj._id, obj);
4250
4094
  }
4251
4095
  throw new Error(this.props.t('ra_Cannot update attribute, because not found in the object'));
@@ -4263,24 +4107,24 @@ class ObjectBrowserClass extends react_1.Component {
4263
4107
  return null;
4264
4108
  }
4265
4109
  if (!this.customColumnDialog) {
4266
- const value = _a.getCustomValue(this.state.columnsEditCustomDialog.obj, this.state.columnsEditCustomDialog.it);
4110
+ const value = ObjectBrowserClass.getCustomValue(this.state.columnsEditCustomDialog.obj, this.state.columnsEditCustomDialog.it);
4267
4111
  this.customColumnDialog = {
4268
4112
  type: (this.state.columnsEditCustomDialog.it.type || typeof value),
4269
4113
  initValue: (value === null || value === undefined ? '' : value).toString(),
4270
4114
  value: (value === null || value === undefined ? '' : value).toString(),
4271
4115
  };
4272
4116
  }
4273
- return (react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsEditCustomDialog: null }), maxWidth: "md", "aria-labelledby": "custom-dialog-title", open: !0 },
4274
- react_1.default.createElement(material_1.DialogTitle, { id: "custom-dialog-title" }, `${this.props.t('ra_Edit object field')}: ${this.state.columnsEditCustomDialog.obj._id}`),
4275
- react_1.default.createElement(material_1.DialogContent, null,
4276
- react_1.default.createElement(material_1.DialogContentText, { id: "alert-dialog-description" }, this.customColumnDialog.type === 'boolean' ? (react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), defaultChecked: this.customColumnDialog.value === 'true', onChange: e => {
4117
+ return (React.createElement(Dialog, { onClose: () => this.setState({ columnsEditCustomDialog: null }), maxWidth: "md", "aria-labelledby": "custom-dialog-title", open: !0 },
4118
+ React.createElement(DialogTitle, { id: "custom-dialog-title" }, `${this.props.t('ra_Edit object field')}: ${this.state.columnsEditCustomDialog.obj._id}`),
4119
+ React.createElement(DialogContent, null,
4120
+ React.createElement(DialogContentText, { id: "alert-dialog-description" }, this.customColumnDialog.type === 'boolean' ? (React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), defaultChecked: this.customColumnDialog.value === 'true', onChange: e => {
4277
4121
  const customColumnDialog = this.customColumnDialog;
4278
4122
  customColumnDialog.value = e.target.checked.toString();
4279
4123
  const changed = customColumnDialog.value !== customColumnDialog.initValue;
4280
4124
  if (changed === !this.state.customColumnDialogValueChanged) {
4281
4125
  this.setState({ customColumnDialogValueChanged: changed });
4282
4126
  }
4283
- } }), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})` })) : (react_1.default.createElement(material_1.TextField, { variant: "standard", defaultValue: this.customColumnDialog.value, fullWidth: true, onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})`, onChange: e => {
4127
+ } }), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})` })) : (React.createElement(TextField, { variant: "standard", defaultValue: this.customColumnDialog.value, fullWidth: true, onKeyUp: e => e.key === 'Enter' && this.onColumnsEditCustomDialogClose(true), label: `${this.state.columnsEditCustomDialog.it.name} (${this.state.columnsEditCustomDialog.it.pathText})`, onChange: e => {
4284
4128
  const customColumnDialog = this.customColumnDialog;
4285
4129
  customColumnDialog.value = e.target.value;
4286
4130
  const changed = customColumnDialog.value !== customColumnDialog.initValue;
@@ -4288,13 +4132,12 @@ class ObjectBrowserClass extends react_1.Component {
4288
4132
  this.setState({ customColumnDialogValueChanged: changed });
4289
4133
  }
4290
4134
  }, autoFocus: true })))),
4291
- react_1.default.createElement(material_1.DialogActions, null,
4292
- react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.onColumnsEditCustomDialogClose(true), disabled: !this.state.customColumnDialogValueChanged, color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.t('ra_Update')),
4293
- react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.onColumnsEditCustomDialogClose(), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.t('ra_Cancel')))));
4135
+ React.createElement(DialogActions, null,
4136
+ React.createElement(Button, { variant: "contained", onClick: () => this.onColumnsEditCustomDialogClose(true), disabled: !this.state.customColumnDialogValueChanged, color: "primary", startIcon: React.createElement(IconCheck, null) }, this.props.t('ra_Update')),
4137
+ React.createElement(Button, { color: "grey", variant: "contained", onClick: () => this.onColumnsEditCustomDialogClose(), startIcon: React.createElement(IconClose, null) }, this.props.t('ra_Cancel')))));
4294
4138
  }
4295
4139
  static getCustomValue(obj, it) {
4296
- var _b;
4297
- if (((_b = obj === null || obj === void 0 ? void 0 : obj._id) === null || _b === void 0 ? void 0 : _b.startsWith(`${it.adapter}.`)) && it.path.length > 1) {
4140
+ if (obj?._id?.startsWith(`${it.adapter}.`) && it.path.length > 1) {
4298
4141
  const p = it.path;
4299
4142
  let value;
4300
4143
  const anyObj = obj;
@@ -4341,8 +4184,7 @@ class ObjectBrowserClass extends react_1.Component {
4341
4184
  return null;
4342
4185
  }
4343
4186
  static setCustomValue(obj, it, value) {
4344
- var _b;
4345
- if (((_b = obj === null || obj === void 0 ? void 0 : obj._id) === null || _b === void 0 ? void 0 : _b.startsWith(`${it.adapter}.`)) && it.path.length > 1) {
4187
+ if (obj?._id?.startsWith(`${it.adapter}.`) && it.path.length > 1) {
4346
4188
  const p = it.path;
4347
4189
  const anyObj = obj;
4348
4190
  if (anyObj[p[0]] && typeof anyObj[p[0]] === 'object') {
@@ -4398,15 +4240,22 @@ class ObjectBrowserClass extends react_1.Component {
4398
4240
  * Renders a custom value.
4399
4241
  */
4400
4242
  renderCustomValue(obj, it, item) {
4401
- const text = _a.getCustomValue(obj, it);
4243
+ const text = ObjectBrowserClass.getCustomValue(obj, it);
4402
4244
  if (text !== null && text !== undefined) {
4403
4245
  if (it.edit && !this.props.notEditable && (!it.objTypes || it.objTypes.includes(obj.type))) {
4404
- return (react_1.default.createElement(material_1.Box, { component: "div", style: Object.assign(Object.assign(Object.assign({}, styles.columnCustom), styles.columnCustomEditable), styles[`columnCustom_${it.align}`]), onClick: () => this.setState({
4246
+ return (React.createElement(Box, { component: "div", style: {
4247
+ ...styles.columnCustom,
4248
+ ...styles.columnCustomEditable,
4249
+ ...styles[`columnCustom_${it.align}`],
4250
+ }, onClick: () => this.setState({
4405
4251
  columnsEditCustomDialog: { item, it, obj },
4406
4252
  customColumnDialogValueChanged: false,
4407
4253
  }) }, text));
4408
4254
  }
4409
- return (react_1.default.createElement(material_1.Box, { component: "div", style: Object.assign(Object.assign({}, styles.columnCustom), styles[`columnCustom_${it.align}`]) }, text));
4255
+ return (React.createElement(Box, { component: "div", style: {
4256
+ ...styles.columnCustom,
4257
+ ...styles[`columnCustom_${it.align}`],
4258
+ } }, text));
4410
4259
  }
4411
4260
  return null;
4412
4261
  }
@@ -4415,7 +4264,7 @@ class ObjectBrowserClass extends react_1.Component {
4415
4264
  // read the type of operation
4416
4265
  const aliasObj = this.objects[this.info.aliasesMap[id][_index]].common.alias.id;
4417
4266
  if (aliasObj) {
4418
- return (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
4267
+ return (React.createElement(Box, { component: "div", onClick: e => {
4419
4268
  e.stopPropagation();
4420
4269
  e.preventDefault();
4421
4270
  const aliasId = this.info.aliasesMap[id][_index];
@@ -4426,7 +4275,7 @@ class ObjectBrowserClass extends react_1.Component {
4426
4275
  this.onSelect(aliasId);
4427
4276
  setTimeout(() => this.expandAllSelected(() => this.scrollToItem(aliasId)), 100);
4428
4277
  }, sx: customStyle || this.styles.aliasAlone },
4429
- react_1.default.createElement("span", { className: "admin-browser-arrow" }, typeof aliasObj === 'string' || (aliasObj.read === id && aliasObj.write === id)
4278
+ React.createElement("span", { className: "admin-browser-arrow" }, typeof aliasObj === 'string' || (aliasObj.read === id && aliasObj.write === id)
4430
4279
  ? '↔'
4431
4280
  : aliasObj.read === id
4432
4281
  ? '→'
@@ -4439,43 +4288,42 @@ class ObjectBrowserClass extends react_1.Component {
4439
4288
  * Renders a leaf.
4440
4289
  */
4441
4290
  renderLeaf(item, isExpanded, counter) {
4442
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
4443
4291
  const id = item.data.id;
4444
4292
  counter.count++;
4445
4293
  isExpanded = isExpanded === undefined ? this.state.expanded.includes(id) : isExpanded;
4446
4294
  // icon
4447
4295
  let iconFolder;
4448
4296
  const obj = item.data.obj;
4449
- const itemType = obj === null || obj === void 0 ? void 0 : obj.type;
4297
+ const itemType = obj?.type;
4450
4298
  if (item.children ||
4451
4299
  itemType === 'folder' ||
4452
4300
  itemType === 'device' ||
4453
4301
  itemType === 'channel' ||
4454
4302
  itemType === 'meta') {
4455
- iconFolder = isExpanded ? (react_1.default.createElement(IconOpen_1.default, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) })) : (react_1.default.createElement(IconClosed_1.default, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) }));
4303
+ iconFolder = isExpanded ? (React.createElement(IconOpen, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) })) : (React.createElement(IconClosed, { style: this.styles.cellIdIconFolder, onClick: () => this.toggleExpanded(id) }));
4456
4304
  }
4457
4305
  else if (obj && obj.common && obj.common.write === false && obj.type === 'state') {
4458
- iconFolder = react_1.default.createElement(IconDocumentReadOnly_1.default, { style: this.styles.cellIdIconDocument });
4306
+ iconFolder = React.createElement(IconDocumentReadOnly, { style: this.styles.cellIdIconDocument });
4459
4307
  }
4460
4308
  else {
4461
- iconFolder = react_1.default.createElement(IconDocument_1.default, { style: this.styles.cellIdIconDocument });
4309
+ iconFolder = React.createElement(IconDocument, { style: this.styles.cellIdIconDocument });
4462
4310
  }
4463
4311
  let iconItem = null;
4464
4312
  if (item.data.icon) {
4465
4313
  if (typeof item.data.icon === 'string') {
4466
4314
  if (item.data.icon.length < 3) {
4467
- iconItem = (react_1.default.createElement("span", { className: "iconOwn", style: styles.cellIdIconOwn }, item.data.icon)); // utf-8 char
4315
+ iconItem = (React.createElement("span", { className: "iconOwn", style: styles.cellIdIconOwn }, item.data.icon)); // utf-8 char
4468
4316
  }
4469
4317
  else {
4470
- iconItem = (react_1.default.createElement(Icon_1.default, { style: styles.cellIdIconOwn, className: "iconOwn", src: item.data.icon, alt: "" }));
4318
+ iconItem = (React.createElement(Icon, { style: styles.cellIdIconOwn, className: "iconOwn", src: item.data.icon, alt: "" }));
4471
4319
  }
4472
4320
  }
4473
4321
  else {
4474
4322
  iconItem = item.data.icon;
4475
4323
  }
4476
4324
  }
4477
- const common = obj === null || obj === void 0 ? void 0 : obj.common;
4478
- const typeImg = ((obj === null || obj === void 0 ? void 0 : obj.type) && exports.ITEM_IMAGES[obj.type]) || react_1.default.createElement("div", { className: "itemIcon" });
4325
+ const common = obj?.common;
4326
+ const typeImg = (obj?.type && ITEM_IMAGES[obj.type]) || React.createElement("div", { className: "itemIcon" });
4479
4327
  const paddingLeft = this.levelPadding * (item.data.level || 0);
4480
4328
  // recalculate rooms and function names if the language changed
4481
4329
  if (item.data.lang !== this.props.lang) {
@@ -4489,11 +4337,11 @@ class ObjectBrowserClass extends react_1.Component {
4489
4337
  }
4490
4338
  const checkbox = this.props.multiSelect &&
4491
4339
  this.objects[id] &&
4492
- (!this.props.types || this.props.types.includes(this.objects[id].type)) ? (react_1.default.createElement(material_1.Checkbox, { style: styles.checkBox, checked: this.state.selected.includes(id) })) : null;
4340
+ (!this.props.types || this.props.types.includes(this.objects[id].type)) ? (React.createElement(Checkbox, { style: styles.checkBox, checked: this.state.selected.includes(id) })) : null;
4493
4341
  let valueEditable = !this.props.notEditable &&
4494
4342
  itemType === 'state' &&
4495
- (this.state.filter.expertMode || (common === null || common === void 0 ? void 0 : common.write) !== false);
4496
- if (this.props.objectBrowserViewFile && (common === null || common === void 0 ? void 0 : common.type) === 'file') {
4343
+ (this.state.filter.expertMode || common?.write !== false);
4344
+ if (this.props.objectBrowserViewFile && common?.type === 'file') {
4497
4345
  valueEditable = true;
4498
4346
  }
4499
4347
  const enumEditable = !this.props.notEditable &&
@@ -4503,7 +4351,7 @@ class ObjectBrowserClass extends react_1.Component {
4503
4351
  let newValue = '';
4504
4352
  const newValueTitle = [];
4505
4353
  if (checkVisibleObjectType) {
4506
- newValue = (_b = this.states[id]) === null || _b === void 0 ? void 0 : _b.from;
4354
+ newValue = this.states[id]?.from;
4507
4355
  if (newValue === undefined) {
4508
4356
  newValue = '&nbsp;';
4509
4357
  }
@@ -4511,7 +4359,7 @@ class ObjectBrowserClass extends react_1.Component {
4511
4359
  newValue = newValue ? newValue.replace(/^system\.adapter\.|^system\./, '') : '';
4512
4360
  newValueTitle.push(`${this.texts.stateChangedFrom} ${newValue}`);
4513
4361
  }
4514
- if (obj === null || obj === void 0 ? void 0 : obj.user) {
4362
+ if (obj?.user) {
4515
4363
  const user = obj.user.replace('system.user.', '');
4516
4364
  newValue += `/${user}`;
4517
4365
  newValueTitle.push(`${this.texts.stateChangedBy} ${user}`);
@@ -4525,16 +4373,16 @@ class ObjectBrowserClass extends react_1.Component {
4525
4373
  newValueTitle.push(`${this.texts.objectChangedBy} ${obj.user.replace(/^system\.user\./, '')}`);
4526
4374
  }
4527
4375
  if (obj.ts) {
4528
- newValueTitle.push(`${this.texts.objectChangedByUser} ${Utils_1.default.formatDate(new Date(obj.ts), this.props.dateFormat || this.systemConfig.common.dateFormat)}`);
4376
+ newValueTitle.push(`${this.texts.objectChangedByUser} ${Utils.formatDate(new Date(obj.ts), this.props.dateFormat || this.systemConfig.common.dateFormat)}`);
4529
4377
  }
4530
4378
  }
4531
4379
  let readWriteAlias = false;
4532
4380
  let alias = null;
4533
- if (id.startsWith('alias.') && ((_c = common === null || common === void 0 ? void 0 : common.alias) === null || _c === void 0 ? void 0 : _c.id)) {
4381
+ if (id.startsWith('alias.') && common?.alias?.id) {
4534
4382
  readWriteAlias = typeof common.alias.id === 'object';
4535
4383
  if (readWriteAlias) {
4536
- alias = (react_1.default.createElement("div", { style: styles.cellIdAliasReadWriteDiv },
4537
- common.alias.id.read ? (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
4384
+ alias = (React.createElement("div", { style: styles.cellIdAliasReadWriteDiv },
4385
+ common.alias.id.read ? (React.createElement(Box, { component: "div", onClick: e => {
4538
4386
  e.stopPropagation();
4539
4387
  e.preventDefault();
4540
4388
  this.onSelect(common.alias.id.read);
@@ -4542,7 +4390,7 @@ class ObjectBrowserClass extends react_1.Component {
4542
4390
  }, sx: this.styles.aliasReadWrite },
4543
4391
  "\u2190",
4544
4392
  common.alias.id.read)) : null,
4545
- common.alias.id.write ? (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
4393
+ common.alias.id.write ? (React.createElement(Box, { component: "div", onClick: e => {
4546
4394
  e.stopPropagation();
4547
4395
  e.preventDefault();
4548
4396
  this.onSelect(common.alias.id.write);
@@ -4552,7 +4400,7 @@ class ObjectBrowserClass extends react_1.Component {
4552
4400
  common.alias.id.write)) : null));
4553
4401
  }
4554
4402
  else {
4555
- alias = (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
4403
+ alias = (React.createElement(Box, { component: "div", onClick: e => {
4556
4404
  e.stopPropagation();
4557
4405
  e.preventDefault();
4558
4406
  this.onSelect(common.alias.id);
@@ -4566,7 +4414,7 @@ class ObjectBrowserClass extends react_1.Component {
4566
4414
  // Some alias points to this object. It can be more than one
4567
4415
  if (this.info.aliasesMap[id].length > 1) {
4568
4416
  // Show number of aliases and open a menu by click
4569
- alias = (react_1.default.createElement(material_1.Box, { component: "div", id: `alias_${id}`, onClick: e => {
4417
+ alias = (React.createElement(Box, { component: "div", id: `alias_${id}`, onClick: e => {
4570
4418
  e.stopPropagation();
4571
4419
  e.preventDefault();
4572
4420
  this.setState({ aliasMenu: id });
@@ -4577,11 +4425,11 @@ class ObjectBrowserClass extends react_1.Component {
4577
4425
  alias = this.renderAliasLink(id, 0);
4578
4426
  }
4579
4427
  }
4580
- let checkColor = common === null || common === void 0 ? void 0 : common.color;
4428
+ let checkColor = common?.color;
4581
4429
  let invertBackground;
4582
4430
  if (checkColor && !this.state.selected.includes(id)) {
4583
4431
  const background = this.props.themeName === 'dark' ? '#1f1f1f' : this.props.themeName === 'blue' ? '#222a2e' : '#FFFFFF';
4584
- const distance = Utils_1.default.colorDistance(checkColor, background);
4432
+ const distance = Utils.colorDistance(checkColor, background);
4585
4433
  // console.log(`Distance: ${checkColor} - ${background} = ${distance}`);
4586
4434
  if (distance < 1000) {
4587
4435
  invertBackground = this.props.themeType === 'dark' ? '#9a9a9a' : '#565656';
@@ -4611,17 +4459,16 @@ class ObjectBrowserClass extends react_1.Component {
4611
4459
  checkColor = 'inherit';
4612
4460
  }
4613
4461
  const icons = [];
4614
- if (common === null || common === void 0 ? void 0 : common.statusStates) {
4462
+ if (common?.statusStates) {
4615
4463
  const ids = {};
4616
4464
  Object.keys(common.statusStates).forEach(name => {
4617
- var _b;
4618
4465
  let _id = common.statusStates[name];
4619
4466
  if (_id.split('.').length < 3) {
4620
4467
  _id = `${id}.${_id}`;
4621
4468
  }
4622
4469
  ids[name] = _id;
4623
4470
  if (!this.states[_id]) {
4624
- if (((_b = this.objects[_id]) === null || _b === void 0 ? void 0 : _b.type) === 'state') {
4471
+ if (this.objects[_id]?.type === 'state') {
4625
4472
  if (!this.recordStates.includes(_id)) {
4626
4473
  this.recordStates.push(_id);
4627
4474
  }
@@ -4639,7 +4486,7 @@ class ObjectBrowserClass extends react_1.Component {
4639
4486
  if (common.statusStates.errorId && this.states[ids.errorId] && this.states[ids.errorId].val) {
4640
4487
  checkColor = this.props.themeType === 'dark' ? COLOR_NAME_ERROR_DARK : COLOR_NAME_ERROR_LIGHT;
4641
4488
  colorSet = true;
4642
- icons.push(react_1.default.createElement(icons_material_1.Error, { key: "error",
4489
+ icons.push(React.createElement(IconError, { key: "error",
4643
4490
  // title={this.texts.deviceError}
4644
4491
  style: this.styles.iconDeviceError }));
4645
4492
  }
@@ -4648,7 +4495,7 @@ class ObjectBrowserClass extends react_1.Component {
4648
4495
  if (this.states[ids.onlineId].val) {
4649
4496
  checkColor =
4650
4497
  this.props.themeType === 'dark' ? COLOR_NAME_CONNECTED_DARK : COLOR_NAME_CONNECTED_LIGHT;
4651
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4498
+ icons.push(React.createElement(IconConnection, { key: "conn",
4652
4499
  // title={this.texts.deviceError}
4653
4500
  style: this.styles.iconDeviceConnected }));
4654
4501
  }
@@ -4657,18 +4504,18 @@ class ObjectBrowserClass extends react_1.Component {
4657
4504
  this.props.themeType === 'dark'
4658
4505
  ? COLOR_NAME_DISCONNECTED_DARK
4659
4506
  : COLOR_NAME_DISCONNECTED_LIGHT;
4660
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4507
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4661
4508
  // title={this.texts.deviceError}
4662
4509
  style: this.styles.iconDeviceDisconnected }));
4663
4510
  }
4664
4511
  }
4665
4512
  else if (this.states[ids.onlineId].val) {
4666
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4513
+ icons.push(React.createElement(IconConnection, { key: "conn",
4667
4514
  // title={this.texts.deviceError}
4668
4515
  style: this.styles.iconDeviceConnected }));
4669
4516
  }
4670
4517
  else {
4671
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4518
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4672
4519
  // title={this.texts.deviceError}
4673
4520
  style: this.styles.iconDeviceDisconnected }));
4674
4521
  }
@@ -4680,85 +4527,102 @@ class ObjectBrowserClass extends react_1.Component {
4680
4527
  this.props.themeType === 'dark'
4681
4528
  ? COLOR_NAME_DISCONNECTED_DARK
4682
4529
  : COLOR_NAME_DISCONNECTED_LIGHT;
4683
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4530
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4684
4531
  // title={this.texts.deviceError}
4685
4532
  style: this.styles.iconDeviceDisconnected }));
4686
4533
  }
4687
4534
  else {
4688
4535
  checkColor =
4689
4536
  this.props.themeType === 'dark' ? COLOR_NAME_CONNECTED_DARK : COLOR_NAME_CONNECTED_LIGHT;
4690
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4537
+ icons.push(React.createElement(IconConnection, { key: "conn",
4691
4538
  // title={this.texts.deviceError}
4692
4539
  style: this.styles.iconDeviceConnected }));
4693
4540
  }
4694
4541
  }
4695
4542
  else if (this.states[ids.offlineId].val) {
4696
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4543
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4697
4544
  // title={this.texts.deviceError}
4698
4545
  style: this.styles.iconDeviceDisconnected }));
4699
4546
  }
4700
4547
  else {
4701
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4548
+ icons.push(React.createElement(IconConnection, { key: "conn",
4702
4549
  // title={this.texts.deviceError}
4703
4550
  style: this.styles.iconDeviceConnected }));
4704
4551
  }
4705
4552
  }
4706
4553
  }
4707
- const q = checkVisibleObjectType ? Utils_1.default.quality2text(((_d = this.states[id]) === null || _d === void 0 ? void 0 : _d.q) || 0).join(', ') : null;
4708
- let name = ((_e = item.data) === null || _e === void 0 ? void 0 : _e.title) || '';
4554
+ const q = checkVisibleObjectType ? Utils.quality2text(this.states[id]?.q || 0).join(', ') : null;
4555
+ let name = item.data?.title || '';
4709
4556
  let useDesc = false;
4710
4557
  if (this.state.showDescription) {
4711
4558
  const oTooltip = getObjectTooltip(item.data, this.props.lang);
4712
4559
  if (oTooltip) {
4713
4560
  name = [
4714
- react_1.default.createElement("div", { key: "name", style: styles.cellNameDivDiv }, name),
4715
- react_1.default.createElement("div", { key: "desc", style: styles.cellDescription }, oTooltip),
4561
+ React.createElement("div", { key: "name", style: styles.cellNameDivDiv }, name),
4562
+ React.createElement("div", { key: "desc", style: styles.cellDescription }, oTooltip),
4716
4563
  ];
4717
4564
  useDesc = !!oTooltip;
4718
4565
  }
4719
4566
  }
4720
4567
  const narrowStyleWithDetails = this.props.width === 'xs' && this.state.focused === id;
4721
- const colID = (react_1.default.createElement(material_1.Grid2, { container: true, wrap: "nowrap", direction: "row", sx: styles.cellId, style: { width: this.columnsVisibility.id, paddingLeft } },
4722
- react_1.default.createElement(material_1.Grid2, { container: true, alignItems: "center" },
4568
+ const colID = (React.createElement(Grid2, { container: true, wrap: "nowrap", direction: "row", sx: styles.cellId, style: { width: this.columnsVisibility.id, paddingLeft } },
4569
+ React.createElement(Grid2, { container: true, alignItems: "center" },
4723
4570
  checkbox,
4724
4571
  iconFolder),
4725
- react_1.default.createElement(material_1.Grid2, { style: Object.assign(Object.assign(Object.assign({}, styles.cellIdSpan), (invertBackground ? this.styles.invertedBackground : undefined)), { color: checkColor, fontWeight: bold ? 'bold' : undefined }) },
4726
- react_1.default.createElement(material_1.Tooltip, { title: getIdFieldTooltip(item.data, this.props.lang), slotProps: { popper: { sx: styles.tooltip } } },
4727
- react_1.default.createElement("div", null, item.data.name)),
4572
+ React.createElement(Grid2, { style: {
4573
+ ...styles.cellIdSpan,
4574
+ ...(invertBackground ? this.styles.invertedBackground : undefined),
4575
+ color: checkColor,
4576
+ fontWeight: bold ? 'bold' : undefined,
4577
+ } },
4578
+ React.createElement(Tooltip, { title: getIdFieldTooltip(item.data, this.props.lang), slotProps: { popper: { sx: styles.tooltip } } },
4579
+ React.createElement("div", null, item.data.name)),
4728
4580
  alias,
4729
4581
  icons),
4730
- react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.grow), (invertBackground ? this.styles.invertedBackgroundFlex : {})) }),
4731
- react_1.default.createElement(material_1.Grid2, { container: true, alignItems: "center" }, iconItem),
4732
- this.props.width !== 'xs' ? (react_1.default.createElement("div", null,
4733
- react_1.default.createElement(IconCopy_1.default, { className: narrowStyleWithDetails ? '' : 'copyButton', style: styles.cellCopyButton, onClick: e => this.onCopy(e, id) }))) : null));
4734
- let colName = (narrowStyleWithDetails && name) || this.columnsVisibility.name ? (react_1.default.createElement(material_1.Box, { component: "div", sx: Object.assign(Object.assign(Object.assign({}, styles.cellName), (useDesc ? styles.cellNameWithDesc : undefined)), { width: this.props.width !== 'xs' ? this.columnsVisibility.name : undefined, ml: narrowStyleWithDetails ? 0 : '5px' }) },
4582
+ React.createElement("div", { style: { ...styles.grow, ...(invertBackground ? this.styles.invertedBackgroundFlex : {}) } }),
4583
+ React.createElement(Grid2, { container: true, alignItems: "center" }, iconItem),
4584
+ this.props.width !== 'xs' ? (React.createElement("div", null,
4585
+ React.createElement(IconCopy, { className: narrowStyleWithDetails ? '' : 'copyButton', style: styles.cellCopyButton, onClick: e => this.onCopy(e, id) }))) : null));
4586
+ let colName = (narrowStyleWithDetails && name) || this.columnsVisibility.name ? (React.createElement(Box, { component: "div", sx: {
4587
+ ...styles.cellName,
4588
+ ...(useDesc ? styles.cellNameWithDesc : undefined),
4589
+ width: this.props.width !== 'xs' ? this.columnsVisibility.name : undefined,
4590
+ ml: narrowStyleWithDetails ? 0 : '5px',
4591
+ } },
4735
4592
  name,
4736
- !narrowStyleWithDetails && ((_f = item.data) === null || _f === void 0 ? void 0 : _f.title) ? (react_1.default.createElement(material_1.Box, { style: { color: checkColor } },
4737
- react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: styles.cellCopyButton, onClick: e => { var _b; return this.onCopy(e, (_b = item.data) === null || _b === void 0 ? void 0 : _b.title); } }))) : null)) : null;
4593
+ !narrowStyleWithDetails && item.data?.title ? (React.createElement(Box, { style: { color: checkColor } },
4594
+ React.createElement(IconCopy, { className: "copyButton", style: styles.cellCopyButton, onClick: e => this.onCopy(e, item.data?.title) }))) : null)) : null;
4738
4595
  let colMiddle;
4739
4596
  if (!this.state.statesView) {
4740
4597
  colMiddle = [
4741
- (narrowStyleWithDetails && (obj === null || obj === void 0 ? void 0 : obj.type)) || this.columnsVisibility.type
4598
+ (narrowStyleWithDetails && obj?.type) || this.columnsVisibility.type
4742
4599
  ? {
4743
- el: (react_1.default.createElement("div", { key: "type", style: Object.assign(Object.assign({}, styles.cellType), { width: this.props.width !== 'xs' ? this.columnsVisibility.type : undefined }) },
4600
+ el: (React.createElement("div", { key: "type", style: {
4601
+ ...styles.cellType,
4602
+ width: this.props.width !== 'xs' ? this.columnsVisibility.type : undefined,
4603
+ } },
4744
4604
  typeImg,
4745
- "\u00A0", obj === null || obj === void 0 ? void 0 :
4746
- obj.type)),
4605
+ "\u00A0",
4606
+ obj?.type)),
4747
4607
  type: 'filter_type',
4748
4608
  }
4749
4609
  : null,
4750
4610
  (narrowStyleWithDetails && common) || this.columnsVisibility.role
4751
4611
  ? {
4752
- el: (react_1.default.createElement("div", { key: "role", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.role : '100%', cursor: this.state.filter.expertMode &&
4612
+ el: (React.createElement("div", { key: "role", style: {
4613
+ ...styles.cellRole,
4614
+ width: this.props.width !== 'xs' ? this.columnsVisibility.role : '100%',
4615
+ cursor: this.state.filter.expertMode &&
4753
4616
  enumEditable &&
4754
4617
  this.props.objectBrowserEditRole
4755
4618
  ? 'text'
4756
- : 'default' }), onClick: !narrowStyleWithDetails &&
4619
+ : 'default',
4620
+ }, onClick: !narrowStyleWithDetails &&
4757
4621
  this.state.filter.expertMode &&
4758
4622
  enumEditable &&
4759
4623
  this.props.objectBrowserEditRole
4760
4624
  ? () => this.setState({ roleDialog: item.data.id })
4761
- : undefined }, common === null || common === void 0 ? void 0 : common.role)),
4625
+ : undefined }, common?.role)),
4762
4626
  type: 'filter_role',
4763
4627
  onClick: narrowStyleWithDetails &&
4764
4628
  this.state.filter.expertMode &&
@@ -4770,7 +4634,12 @@ class ObjectBrowserClass extends react_1.Component {
4770
4634
  : null,
4771
4635
  (narrowStyleWithDetails && common) || this.columnsVisibility.room
4772
4636
  ? {
4773
- el: (react_1.default.createElement("div", { key: "room", style: Object.assign(Object.assign(Object.assign({}, styles.cellRoom), (item.data.per ? styles.cellEnumParent : {})), { width: this.props.width !== 'xs' ? this.columnsVisibility.room : '100%', cursor: enumEditable ? 'text' : 'default' }), onClick: !narrowStyleWithDetails && enumEditable
4637
+ el: (React.createElement("div", { key: "room", style: {
4638
+ ...styles.cellRoom,
4639
+ ...(item.data.per ? styles.cellEnumParent : {}),
4640
+ width: this.props.width !== 'xs' ? this.columnsVisibility.room : '100%',
4641
+ cursor: enumEditable ? 'text' : 'default',
4642
+ }, onClick: !narrowStyleWithDetails && enumEditable
4774
4643
  ? () => {
4775
4644
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'roomEnums');
4776
4645
  this.setState({
@@ -4801,7 +4670,12 @@ class ObjectBrowserClass extends react_1.Component {
4801
4670
  : null,
4802
4671
  (narrowStyleWithDetails && common) || this.columnsVisibility.func
4803
4672
  ? {
4804
- el: (react_1.default.createElement("div", { key: "func", style: Object.assign(Object.assign(Object.assign({}, styles.cellFunc), (item.data.pef ? styles.cellEnumParent : {})), { width: this.props.width !== 'xs' ? this.columnsVisibility.func : '100%', cursor: enumEditable ? 'text' : 'default' }), onClick: !narrowStyleWithDetails && enumEditable
4673
+ el: (React.createElement("div", { key: "func", style: {
4674
+ ...styles.cellFunc,
4675
+ ...(item.data.pef ? styles.cellEnumParent : {}),
4676
+ width: this.props.width !== 'xs' ? this.columnsVisibility.func : '100%',
4677
+ cursor: enumEditable ? 'text' : 'default',
4678
+ }, onClick: !narrowStyleWithDetails && enumEditable
4805
4679
  ? () => {
4806
4680
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'funcEnums');
4807
4681
  this.setState({
@@ -4834,57 +4708,76 @@ class ObjectBrowserClass extends react_1.Component {
4834
4708
  }
4835
4709
  else {
4836
4710
  colMiddle = [
4837
- (narrowStyleWithDetails && checkVisibleObjectType && ((_g = this.states[id]) === null || _g === void 0 ? void 0 : _g.from)) ||
4711
+ (narrowStyleWithDetails && checkVisibleObjectType && this.states[id]?.from) ||
4838
4712
  this.columnsVisibility.changedFrom
4839
4713
  ? {
4840
- el: (react_1.default.createElement("div", { key: "from", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.changedFrom : undefined }), title: newValueTitle.join('\n') }, checkVisibleObjectType && ((_h = this.states[id]) === null || _h === void 0 ? void 0 : _h.from) ? newValue : null)),
4714
+ el: (React.createElement("div", { key: "from", style: {
4715
+ ...styles.cellRole,
4716
+ width: this.props.width !== 'xs' ? this.columnsVisibility.changedFrom : undefined,
4717
+ }, title: newValueTitle.join('\n') }, checkVisibleObjectType && this.states[id]?.from ? newValue : null)),
4841
4718
  type: 'from',
4842
4719
  }
4843
4720
  : null,
4844
4721
  (narrowStyleWithDetails && q) || this.columnsVisibility.qualityCode
4845
4722
  ? {
4846
- el: (react_1.default.createElement("div", { key: "q", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.qualityCode : undefined }), title: q || '' }, q)),
4723
+ el: (React.createElement("div", { key: "q", style: {
4724
+ ...styles.cellRole,
4725
+ width: this.props.width !== 'xs' ? this.columnsVisibility.qualityCode : undefined,
4726
+ }, title: q || '' }, q)),
4847
4727
  type: 'quality',
4848
4728
  }
4849
4729
  : null,
4850
- (narrowStyleWithDetails && checkVisibleObjectType && ((_j = this.states[id]) === null || _j === void 0 ? void 0 : _j.ts)) ||
4730
+ (narrowStyleWithDetails && checkVisibleObjectType && this.states[id]?.ts) ||
4851
4731
  this.columnsVisibility.timestamp
4852
4732
  ? {
4853
- el: (react_1.default.createElement("div", { key: "ts", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.timestamp : undefined }) }, checkVisibleObjectType && ((_k = this.states[id]) === null || _k === void 0 ? void 0 : _k.ts)
4854
- ? Utils_1.default.formatDate(new Date(this.states[id].ts), this.props.dateFormat || this.systemConfig.common.dateFormat)
4733
+ el: (React.createElement("div", { key: "ts", style: {
4734
+ ...styles.cellRole,
4735
+ width: this.props.width !== 'xs' ? this.columnsVisibility.timestamp : undefined,
4736
+ } }, checkVisibleObjectType && this.states[id]?.ts
4737
+ ? Utils.formatDate(new Date(this.states[id].ts), this.props.dateFormat || this.systemConfig.common.dateFormat)
4855
4738
  : null)),
4856
4739
  type: 'ts',
4857
4740
  }
4858
4741
  : null,
4859
- (narrowStyleWithDetails && checkVisibleObjectType && ((_l = this.states[id]) === null || _l === void 0 ? void 0 : _l.lc)) ||
4742
+ (narrowStyleWithDetails && checkVisibleObjectType && this.states[id]?.lc) ||
4860
4743
  this.columnsVisibility.lastChange
4861
4744
  ? {
4862
- el: (react_1.default.createElement("div", { key: "lc", style: Object.assign(Object.assign({}, styles.cellRole), { width: this.props.width !== 'xs' ? this.columnsVisibility.lastChange : undefined }) }, checkVisibleObjectType && ((_m = this.states[id]) === null || _m === void 0 ? void 0 : _m.lc)
4863
- ? Utils_1.default.formatDate(new Date(this.states[id].lc), this.props.dateFormat || this.systemConfig.common.dateFormat)
4745
+ el: (React.createElement("div", { key: "lc", style: {
4746
+ ...styles.cellRole,
4747
+ width: this.props.width !== 'xs' ? this.columnsVisibility.lastChange : undefined,
4748
+ } }, checkVisibleObjectType && this.states[id]?.lc
4749
+ ? Utils.formatDate(new Date(this.states[id].lc), this.props.dateFormat || this.systemConfig.common.dateFormat)
4864
4750
  : null)),
4865
4751
  type: 'lc',
4866
4752
  }
4867
4753
  : null,
4868
4754
  ];
4869
4755
  }
4870
- let colCustom = ((_o = this.adapterColumns) === null || _o === void 0 ? void 0 : _o.map(it => (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellAdapter), { width: this.props.width !== 'xs'
4756
+ let colCustom = this.adapterColumns?.map(it => (React.createElement("div", { style: {
4757
+ ...styles.cellAdapter,
4758
+ width: this.props.width !== 'xs'
4871
4759
  ? this.columnsVisibility[it.id]
4872
- : undefined }), key: it.id, title: `${it.adapter} => ${it.pathText}` }, obj ? this.renderCustomValue(obj, it, item) : null)))) || null;
4760
+ : undefined,
4761
+ }, key: it.id, title: `${it.adapter} => ${it.pathText}` }, obj ? this.renderCustomValue(obj, it, item) : null))) || null;
4873
4762
  const columnValue = narrowStyleWithDetails || this.columnsVisibility.val
4874
4763
  ? this.renderColumnValue(id, item, narrowStyleWithDetails)
4875
4764
  : null;
4876
- let colValue = (narrowStyleWithDetails && columnValue) || this.columnsVisibility.val ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellValue), { width: this.props.width !== 'xs' ? this.columnsVisibility.val : 'calc(100% - 100px)', cursor: valueEditable
4877
- ? (common === null || common === void 0 ? void 0 : common.type) === 'file'
4765
+ let colValue = (narrowStyleWithDetails && columnValue) || this.columnsVisibility.val ? (React.createElement("div", { style: {
4766
+ ...styles.cellValue,
4767
+ width: this.props.width !== 'xs' ? this.columnsVisibility.val : 'calc(100% - 100px)',
4768
+ cursor: valueEditable
4769
+ ? common?.type === 'file'
4878
4770
  ? 'zoom-in'
4879
4771
  : item.data.button
4880
4772
  ? 'grab'
4881
4773
  : 'text'
4882
- : 'default' }), onClick: valueEditable
4774
+ : 'default',
4775
+ }, onClick: valueEditable
4883
4776
  ? () => {
4884
4777
  if (!obj || !this.states) {
4885
4778
  // return;
4886
4779
  }
4887
- else if ((common === null || common === void 0 ? void 0 : common.type) === 'file') {
4780
+ else if (common?.type === 'file') {
4888
4781
  this.setState({ viewFileDialog: id });
4889
4782
  }
4890
4783
  else if (!this.state.filter.expertMode && item.data.button) {
@@ -4910,7 +4803,10 @@ class ObjectBrowserClass extends react_1.Component {
4910
4803
  }
4911
4804
  }
4912
4805
  : undefined }, columnValue)) : null;
4913
- let colButtons = narrowStyleWithDetails || this.columnsVisibility.buttons ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellButtons), { width: this.props.width !== 'xs' ? this.columnsVisibility.buttons : undefined }) }, this.renderColumnButtons(id, item))) : null;
4806
+ let colButtons = narrowStyleWithDetails || this.columnsVisibility.buttons ? (React.createElement("div", { style: {
4807
+ ...styles.cellButtons,
4808
+ width: this.props.width !== 'xs' ? this.columnsVisibility.buttons : undefined,
4809
+ } }, this.renderColumnButtons(id, item))) : null;
4914
4810
  let colDetails = null;
4915
4811
  if (this.props.width === 'xs' && this.state.focused === id) {
4916
4812
  colMiddle = colMiddle.filter(a => a);
@@ -4923,14 +4819,14 @@ class ObjectBrowserClass extends react_1.Component {
4923
4819
  if (!it) {
4924
4820
  return null;
4925
4821
  }
4926
- return (react_1.default.createElement("div", { key: it.type, style: styles.cellDetailsLine },
4927
- react_1.default.createElement("span", { style: styles.cellDetailsName },
4822
+ return (React.createElement("div", { key: it.type, style: styles.cellDetailsLine },
4823
+ React.createElement("span", { style: styles.cellDetailsName },
4928
4824
  this.texts[it.type],
4929
4825
  ":"),
4930
4826
  it.el,
4931
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4932
- it.onClick ? (react_1.default.createElement(icons_material_1.Edit, { style: styles.cellCopyButtonInDetails, onClick: () => {
4933
- if (it === null || it === void 0 ? void 0 : it.onClick) {
4827
+ React.createElement("div", { style: { flexGrow: 1 } }),
4828
+ it.onClick ? (React.createElement(IconEdit, { style: styles.cellCopyButtonInDetails, onClick: () => {
4829
+ if (it?.onClick) {
4934
4830
  it.onClick();
4935
4831
  }
4936
4832
  } })) : null));
@@ -4939,32 +4835,32 @@ class ObjectBrowserClass extends react_1.Component {
4939
4835
  if (!colCustom.length) {
4940
4836
  colCustom = null;
4941
4837
  }
4942
- colDetails = (react_1.default.createElement(material_1.Paper, { style: {
4838
+ colDetails = (React.createElement(Paper, { style: {
4943
4839
  width: '100%',
4944
4840
  display: 'flex',
4945
4841
  flexDirection: 'column',
4946
4842
  padding: 10,
4947
4843
  backgroundColor: this.props.theme.palette.mode === 'dark' ? '#333' : '#ccc',
4948
4844
  } },
4949
- react_1.default.createElement("div", { style: styles.cellDetailsLine },
4950
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4951
- react_1.default.createElement(IconCopy_1.default, { style: styles.cellCopyButtonInDetails, onClick: e => this.onCopy(e, id) })),
4952
- colName && (react_1.default.createElement("div", { style: styles.cellDetailsLine },
4953
- react_1.default.createElement("span", { style: styles.cellDetailsName },
4845
+ React.createElement("div", { style: styles.cellDetailsLine },
4846
+ React.createElement("div", { style: { flexGrow: 1 } }),
4847
+ React.createElement(IconCopy, { style: styles.cellCopyButtonInDetails, onClick: e => this.onCopy(e, id) })),
4848
+ colName && (React.createElement("div", { style: styles.cellDetailsLine },
4849
+ React.createElement("span", { style: styles.cellDetailsName },
4954
4850
  this.texts.name,
4955
4851
  ":"),
4956
4852
  colName,
4957
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4958
- ((_p = item.data) === null || _p === void 0 ? void 0 : _p.title) ? (react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: styles.cellCopyButtonInDetails, onClick: e => { var _b; return this.onCopy(e, (_b = item.data) === null || _b === void 0 ? void 0 : _b.title); } })) : null)),
4853
+ React.createElement("div", { style: { flexGrow: 1 } }),
4854
+ item.data?.title ? (React.createElement(IconCopy, { className: "copyButton", style: styles.cellCopyButtonInDetails, onClick: e => this.onCopy(e, item.data?.title) })) : null)),
4959
4855
  renderedMiddle,
4960
- colCustom && react_1.default.createElement("div", { style: styles.cellDetailsLine }, colCustom),
4961
- ((_q = this.objects[id]) === null || _q === void 0 ? void 0 : _q.type) === 'state' && (react_1.default.createElement("div", { style: styles.cellDetailsLine },
4962
- react_1.default.createElement("span", { style: styles.cellDetailsName },
4856
+ colCustom && React.createElement("div", { style: styles.cellDetailsLine }, colCustom),
4857
+ this.objects[id]?.type === 'state' && (React.createElement("div", { style: styles.cellDetailsLine },
4858
+ React.createElement("span", { style: styles.cellDetailsName },
4963
4859
  this.texts.value,
4964
4860
  ":"),
4965
4861
  colValue,
4966
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4967
- react_1.default.createElement(IconCopy_1.default, { className: "copyButton", style: styles.cellCopyButtonInDetails, onClick: e => {
4862
+ React.createElement("div", { style: { flexGrow: 1 } }),
4863
+ React.createElement(IconCopy, { className: "copyButton", style: styles.cellCopyButtonInDetails, onClick: e => {
4968
4864
  const { valText } = formatValue({
4969
4865
  state: this.states[id],
4970
4866
  obj: this.objects[id],
@@ -4976,14 +4872,14 @@ class ObjectBrowserClass extends react_1.Component {
4976
4872
  });
4977
4873
  this.onCopy(e, valText.v.toString());
4978
4874
  }, key: "cc" }))),
4979
- colButtons && (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.cellDetailsLine), { justifyContent: 'right' }) }, colButtons))));
4875
+ colButtons && (React.createElement("div", { style: { ...styles.cellDetailsLine, justifyContent: 'right' } }, colButtons))));
4980
4876
  colName = null;
4981
4877
  colMiddle = null;
4982
4878
  colCustom = null;
4983
4879
  colValue = null;
4984
4880
  colButtons = null;
4985
4881
  }
4986
- const row = (react_1.default.createElement(material_1.Grid2, { container: true, direction: "row", wrap: "nowrap", sx: Utils_1.default.getStyle(this.props.theme, styles.tableRow, this.state.linesEnabled && styles.tableRowLines, !this.props.dragEnabled && styles.tableRowNoDragging, alias && styles.tableRowAlias, readWriteAlias && styles.tableRowAliasReadWrite, this.state.focused === id && this.props.multiSelect && styles.tableRowFocused, !item.data.visible && styles.filteredOut, item.data.hasVisibleParent &&
4882
+ const row = (React.createElement(Grid2, { container: true, direction: "row", wrap: "nowrap", sx: Utils.getStyle(this.props.theme, styles.tableRow, this.state.linesEnabled && styles.tableRowLines, !this.props.dragEnabled && styles.tableRowNoDragging, alias && styles.tableRowAlias, readWriteAlias && styles.tableRowAliasReadWrite, this.state.focused === id && this.props.multiSelect && styles.tableRowFocused, !item.data.visible && styles.filteredOut, item.data.hasVisibleParent &&
4987
4883
  !item.data.visible &&
4988
4884
  !item.data.hasVisibleChildren &&
4989
4885
  styles.filteredParentOut, this.state.selected.includes(id) && styles.itemSelected, this.state.selectedNonObject === id && styles.itemSelected), key: id, id: id, onMouseDown: e => {
@@ -5015,8 +4911,8 @@ class ObjectBrowserClass extends react_1.Component {
5015
4911
  }
5016
4912
  } },
5017
4913
  colID,
5018
- colName, colMiddle === null || colMiddle === void 0 ? void 0 :
5019
- colMiddle.map(it => it === null || it === void 0 ? void 0 : it.el),
4914
+ colName,
4915
+ colMiddle?.map(it => it?.el),
5020
4916
  colCustom,
5021
4917
  colValue,
5022
4918
  colButtons));
@@ -5033,11 +4929,11 @@ class ObjectBrowserClass extends react_1.Component {
5033
4929
  const DragWrapper = this.props.DragWrapper;
5034
4930
  if (this.props.dragEnabled && DragWrapper) {
5035
4931
  if (root.data.sumVisibility) {
5036
- leaf = (react_1.default.createElement(DragWrapper, { key: root.data.id, item: root, style: styles.draggable }, result.row));
4932
+ leaf = (React.createElement(DragWrapper, { key: root.data.id, item: root, style: styles.draggable }, result.row));
5037
4933
  }
5038
4934
  else {
5039
4935
  // change cursor
5040
- leaf = (react_1.default.createElement("div", { key: root.data.id, style: styles.nonDraggable }, result.row));
4936
+ leaf = (React.createElement("div", { key: root.data.id, style: styles.nonDraggable }, result.row));
5041
4937
  }
5042
4938
  }
5043
4939
  else {
@@ -5255,11 +5151,106 @@ class ObjectBrowserClass extends react_1.Component {
5255
5151
  }
5256
5152
  }
5257
5153
  }
5154
+ resizerMouseMove = (e) => {
5155
+ if (this.resizerActiveDiv) {
5156
+ let width;
5157
+ let widthNext;
5158
+ if (this.resizeLeft) {
5159
+ width = this.resizerOldWidth - e.clientX + this.resizerPosition;
5160
+ widthNext = this.resizerOldWidthNext + e.clientX - this.resizerPosition;
5161
+ }
5162
+ else {
5163
+ width = this.resizerOldWidth + e.clientX - this.resizerPosition;
5164
+ widthNext = this.resizerOldWidthNext - e.clientX + this.resizerPosition;
5165
+ }
5166
+ if (this.resizerActiveName &&
5167
+ this.resizerNextName &&
5168
+ (!this.resizerMin || width > this.resizerMin) &&
5169
+ (!this.resizerNextMin || widthNext > this.resizerNextMin)) {
5170
+ this.resizerCurrentWidths[this.resizerActiveName] = width;
5171
+ this.resizerCurrentWidths[this.resizerNextName] = widthNext;
5172
+ this.resizerActiveDiv.style.width = `${width}px`;
5173
+ if (this.resizerNextDiv) {
5174
+ this.resizerNextDiv.style.width = `${widthNext}px`;
5175
+ }
5176
+ this.columnsVisibility[this.resizerActiveName] = width;
5177
+ this.columnsVisibility[this.resizerNextName] = widthNext;
5178
+ if (this.resizerNextName === 'nameHeader') {
5179
+ this.columnsVisibility.name = widthNext - this.state.scrollBarWidth;
5180
+ this.resizerCurrentWidths.name = widthNext - this.state.scrollBarWidth;
5181
+ }
5182
+ else if (this.resizerActiveName === 'nameHeader') {
5183
+ this.columnsVisibility.name = width - this.state.scrollBarWidth;
5184
+ this.resizerCurrentWidths.name = width - this.state.scrollBarWidth;
5185
+ }
5186
+ this.customWidth = true;
5187
+ if (this.resizeTimeout) {
5188
+ clearTimeout(this.resizeTimeout);
5189
+ }
5190
+ this.resizeTimeout = setTimeout(() => {
5191
+ this.resizeTimeout = null;
5192
+ this.forceUpdate();
5193
+ }, 200);
5194
+ }
5195
+ }
5196
+ };
5197
+ resizerMouseUp = () => {
5198
+ this.localStorage.setItem(`${this.props.dialogName || 'App'}.table`, JSON.stringify(this.resizerCurrentWidths));
5199
+ this.resizerActiveName = null;
5200
+ this.resizerNextName = null;
5201
+ this.resizerActiveDiv = null;
5202
+ this.resizerNextDiv = null;
5203
+ window.removeEventListener('mousemove', this.resizerMouseMove);
5204
+ window.removeEventListener('mouseup', this.resizerMouseUp);
5205
+ };
5206
+ resizerMouseDown = (e) => {
5207
+ this.storedWidths =
5208
+ this.storedWidths ||
5209
+ JSON.parse(JSON.stringify(SCREEN_WIDTHS[this.props.width || 'lg']));
5210
+ this.resizerCurrentWidths = this.resizerCurrentWidths || {};
5211
+ this.resizerActiveDiv = e.target.parentNode;
5212
+ this.resizerActiveName = this.resizerActiveDiv.dataset.name || null;
5213
+ if (this.resizerActiveName) {
5214
+ let i = 0;
5215
+ if (e.target.dataset.left === 'true') {
5216
+ this.resizeLeft = true;
5217
+ this.resizerNextDiv = this.resizerActiveDiv.previousElementSibling;
5218
+ let handle = this.resizerNextDiv.querySelector('.iob-ob-resize-handler');
5219
+ while (this.resizerNextDiv && !handle && i < 10) {
5220
+ this.resizerNextDiv = this.resizerNextDiv.previousElementSibling;
5221
+ handle = this.resizerNextDiv.querySelector('.iob-ob-resize-handler');
5222
+ i++;
5223
+ }
5224
+ if (handle?.dataset.left !== 'true') {
5225
+ this.resizerNextDiv = this.resizerNextDiv.nextElementSibling;
5226
+ }
5227
+ }
5228
+ else {
5229
+ this.resizeLeft = false;
5230
+ this.resizerNextDiv = this.resizerActiveDiv.nextElementSibling;
5231
+ /* while (this.resizerNextDiv && !this.resizerNextDiv.querySelector('.iob-ob-resize-handler') && i < 10) {
5232
+ this.resizerNextDiv = this.resizerNextDiv.nextElementSibling;
5233
+ i++;
5234
+ } */
5235
+ }
5236
+ this.resizerNextName = this.resizerNextDiv.dataset.name || null;
5237
+ this.resizerMin = parseInt(this.resizerActiveDiv.dataset.min, 10) || 0;
5238
+ this.resizerNextMin = parseInt(this.resizerNextDiv.dataset.min, 10) || 0;
5239
+ this.resizerPosition = e.clientX;
5240
+ this.resizerCurrentWidths[this.resizerActiveName] = this.resizerActiveDiv.offsetWidth;
5241
+ this.resizerOldWidth = this.resizerCurrentWidths[this.resizerActiveName];
5242
+ if (this.resizerNextName) {
5243
+ this.resizerCurrentWidths[this.resizerNextName] = this.resizerNextDiv.offsetWidth;
5244
+ this.resizerOldWidthNext = this.resizerCurrentWidths[this.resizerNextName];
5245
+ }
5246
+ window.addEventListener('mousemove', this.resizerMouseMove);
5247
+ window.addEventListener('mouseup', this.resizerMouseUp);
5248
+ }
5249
+ };
5258
5250
  /**
5259
5251
  * Handle keyboard events for navigation
5260
5252
  */
5261
5253
  navigateKeyPress(event) {
5262
- var _b, _c;
5263
5254
  const selectedId = this.state.selectedNonObject || this.state.selected[0];
5264
5255
  if (!selectedId) {
5265
5256
  return;
@@ -5267,7 +5258,7 @@ class ObjectBrowserClass extends react_1.Component {
5267
5258
  if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
5268
5259
  event.preventDefault();
5269
5260
  const ids = [];
5270
- (_b = this.tableRef.current) === null || _b === void 0 ? void 0 : _b.childNodes.forEach((node) => ids.push(node.id));
5261
+ this.tableRef.current?.childNodes.forEach((node) => ids.push(node.id));
5271
5262
  const idx = ids.indexOf(selectedId);
5272
5263
  const newIdx = event.code === 'ArrowDown' ? idx + 1 : idx - 1;
5273
5264
  const newId = ids[newIdx] || selectedId;
@@ -5278,10 +5269,10 @@ class ObjectBrowserClass extends react_1.Component {
5278
5269
  this.toggleExpanded(selectedId);
5279
5270
  }
5280
5271
  if (event.code === 'Delete' && this.root && selectedId) {
5281
- const item = _a.getItemFromRoot(this.root, selectedId);
5272
+ const item = ObjectBrowserClass.getItemFromRoot(this.root, selectedId);
5282
5273
  if (item) {
5283
5274
  const { obj } = item.data;
5284
- if (obj && !((_c = obj.common) === null || _c === void 0 ? void 0 : _c.dontDelete)) {
5275
+ if (obj && !obj.common?.dontDelete) {
5285
5276
  this.showDeleteDialog({ id: selectedId, obj, item });
5286
5277
  }
5287
5278
  }
@@ -5316,67 +5307,119 @@ class ObjectBrowserClass extends react_1.Component {
5316
5307
  }
5317
5308
  return _root || null;
5318
5309
  }
5310
+ resizerReset = () => {
5311
+ this.customWidth = false;
5312
+ SCREEN_WIDTHS[this.props.width || 'lg'] = JSON.parse(JSON.stringify(this.storedWidths));
5313
+ this.calculateColumnsVisibility();
5314
+ this.localStorage.removeItem(`${this.props.dialogName || 'App'}.table`);
5315
+ this.forceUpdate();
5316
+ };
5319
5317
  /**
5320
5318
  * Render the right handle for resizing
5321
5319
  */
5322
5320
  renderHandleRight() {
5323
- return (react_1.default.createElement(material_1.Box, { component: "div", className: "iob-ob-resize-handler", sx: Object.assign(Object.assign({}, styles.resizeHandle), styles.resizeHandleRight), onMouseDown: this.resizerMouseDown, onDoubleClick: this.resizerReset, title: this.props.t('ra_Double click to reset table layout') }));
5321
+ return (React.createElement(Box, { component: "div", className: "iob-ob-resize-handler", sx: { ...styles.resizeHandle, ...styles.resizeHandleRight }, onMouseDown: this.resizerMouseDown, onDoubleClick: this.resizerReset, title: this.props.t('ra_Double click to reset table layout') }));
5324
5322
  }
5325
5323
  renderHeader() {
5326
5324
  let filterClearInValue = null;
5327
5325
  if (!this.columnsVisibility.buttons && !this.isFilterEmpty()) {
5328
- filterClearInValue = (react_1.default.createElement(material_1.IconButton, { onClick: () => this.clearFilter(), style: styles.buttonClearFilter, title: this.props.t('ra_Clear filter'), size: "large" },
5329
- react_1.default.createElement(IconClearFilter_1.default, null),
5330
- react_1.default.createElement(icons_material_1.Close, { style: styles.buttonClearFilterIcon })));
5326
+ filterClearInValue = (React.createElement(IconButton, { onClick: () => this.clearFilter(), style: styles.buttonClearFilter, title: this.props.t('ra_Clear filter'), size: "large" },
5327
+ React.createElement(IconClearFilter, null),
5328
+ React.createElement(IconClose, { style: styles.buttonClearFilterIcon })));
5331
5329
  }
5332
5330
  if (this.props.width === 'xs') {
5333
- return (react_1.default.createElement("div", { style: styles.headerRow },
5334
- react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: '100%' }) }, this.getFilterInput('id'))));
5331
+ return (React.createElement("div", { style: styles.headerRow },
5332
+ React.createElement("div", { style: { ...styles.headerCell, width: '100%' } }, this.getFilterInput('id'))));
5335
5333
  }
5336
- return (react_1.default.createElement("div", { style: styles.headerRow },
5337
- react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.id, position: 'relative' }), "data-min": 240, "data-name": "id" },
5334
+ return (React.createElement("div", { style: styles.headerRow },
5335
+ React.createElement("div", { style: { ...styles.headerCell, width: this.columnsVisibility.id, position: 'relative' }, "data-min": 240, "data-name": "id" },
5338
5336
  this.getFilterInput('id'),
5339
5337
  this.renderHandleRight()),
5340
- this.columnsVisibility.name ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.nameHeader, position: 'relative' }), "data-min": 100, "data-name": "nameHeader" },
5338
+ this.columnsVisibility.name ? (React.createElement("div", { style: { ...styles.headerCell, width: this.columnsVisibility.nameHeader, position: 'relative' }, "data-min": 100, "data-name": "nameHeader" },
5341
5339
  this.getFilterInput('name'),
5342
5340
  this.renderHandleRight())) : null,
5343
- !this.state.statesView && (react_1.default.createElement(react_1.default.Fragment, null,
5344
- this.columnsVisibility.type ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.type, position: 'relative' }), "data-min": 100, "data-name": "type" },
5341
+ !this.state.statesView && (React.createElement(React.Fragment, null,
5342
+ this.columnsVisibility.type ? (React.createElement("div", { style: {
5343
+ ...styles.headerCell,
5344
+ width: this.columnsVisibility.type,
5345
+ position: 'relative',
5346
+ }, "data-min": 100, "data-name": "type" },
5345
5347
  this.getFilterSelectType(),
5346
5348
  this.renderHandleRight())) : null,
5347
- this.columnsVisibility.role ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.role, position: 'relative' }), "data-min": 100, "data-name": "role" },
5349
+ this.columnsVisibility.role ? (React.createElement("div", { style: {
5350
+ ...styles.headerCell,
5351
+ width: this.columnsVisibility.role,
5352
+ position: 'relative',
5353
+ }, "data-min": 100, "data-name": "role" },
5348
5354
  this.getFilterSelectRole(),
5349
5355
  this.renderHandleRight())) : null,
5350
- this.columnsVisibility.room ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.room, position: 'relative' }), "data-min": 100, "data-name": "room" },
5356
+ this.columnsVisibility.room ? (React.createElement("div", { style: {
5357
+ ...styles.headerCell,
5358
+ width: this.columnsVisibility.room,
5359
+ position: 'relative',
5360
+ }, "data-min": 100, "data-name": "room" },
5351
5361
  this.getFilterSelectRoom(),
5352
5362
  this.renderHandleRight())) : null,
5353
- this.columnsVisibility.func ? (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.func, position: 'relative' }), "data-min": 100, "data-name": "func" },
5363
+ this.columnsVisibility.func ? (React.createElement("div", { style: {
5364
+ ...styles.headerCell,
5365
+ width: this.columnsVisibility.func,
5366
+ position: 'relative',
5367
+ }, "data-min": 100, "data-name": "func" },
5354
5368
  this.getFilterSelectFunction(),
5355
5369
  this.renderHandleRight())) : null)),
5356
- this.state.statesView && (react_1.default.createElement(react_1.default.Fragment, null,
5357
- react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.changedFrom, position: 'relative' }), "data-min": 100, "data-name": "changedFrom" },
5370
+ this.state.statesView && (React.createElement(React.Fragment, null,
5371
+ React.createElement("div", { style: {
5372
+ ...styles.headerCell,
5373
+ ...styles.headerCellValue,
5374
+ width: this.columnsVisibility.changedFrom,
5375
+ position: 'relative',
5376
+ }, "data-min": 100, "data-name": "changedFrom" },
5358
5377
  this.props.t('ra_Changed from'),
5359
5378
  this.renderHandleRight()),
5360
- react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.qualityCode, position: 'relative' }), "data-min": 100, "data-name": "qualityCode" },
5379
+ React.createElement("div", { style: {
5380
+ ...styles.headerCell,
5381
+ ...styles.headerCellValue,
5382
+ width: this.columnsVisibility.qualityCode,
5383
+ position: 'relative',
5384
+ }, "data-min": 100, "data-name": "qualityCode" },
5361
5385
  this.props.t('ra_Quality code'),
5362
5386
  this.renderHandleRight()),
5363
- react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.timestamp, position: 'relative' }), "data-min": 100, "data-name": "timestamp" },
5387
+ React.createElement("div", { style: {
5388
+ ...styles.headerCell,
5389
+ ...styles.headerCellValue,
5390
+ width: this.columnsVisibility.timestamp,
5391
+ position: 'relative',
5392
+ }, "data-min": 100, "data-name": "timestamp" },
5364
5393
  this.props.t('ra_Timestamp'),
5365
5394
  this.renderHandleRight()),
5366
- react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.lastChange, position: 'relative' }), "data-min": 100, "data-name": "lastChange" },
5395
+ React.createElement("div", { style: {
5396
+ ...styles.headerCell,
5397
+ ...styles.headerCellValue,
5398
+ width: this.columnsVisibility.lastChange,
5399
+ position: 'relative',
5400
+ }, "data-min": 100, "data-name": "lastChange" },
5367
5401
  this.props.t('ra_Last change'),
5368
5402
  this.renderHandleRight()))),
5369
- this.adapterColumns.map(item => (react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility[item.id] }), title: item.adapter, key: item.id, "data-min": 100, "data-name": item.id }, item.name))),
5370
- this.columnsVisibility.val ? (react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, styles.headerCell), styles.headerCellValue), { width: this.columnsVisibility.val, position: 'relative' }), "data-min": 120, "data-name": "val" },
5403
+ this.adapterColumns.map(item => (React.createElement("div", { style: {
5404
+ ...styles.headerCell,
5405
+ ...styles.headerCellValue,
5406
+ width: this.columnsVisibility[item.id],
5407
+ }, title: item.adapter, key: item.id, "data-min": 100, "data-name": item.id }, item.name))),
5408
+ this.columnsVisibility.val ? (React.createElement("div", { style: {
5409
+ ...styles.headerCell,
5410
+ ...styles.headerCellValue,
5411
+ width: this.columnsVisibility.val,
5412
+ position: 'relative',
5413
+ }, "data-min": 120, "data-name": "val" },
5371
5414
  this.props.t('ra_Value'),
5372
5415
  filterClearInValue)) : null,
5373
- this.columnsVisibility.buttons ? (react_1.default.createElement("div", { title: this.texts.filter_custom, style: Object.assign(Object.assign({}, styles.headerCell), { width: this.columnsVisibility.buttons }) },
5416
+ this.columnsVisibility.buttons ? (React.createElement("div", { title: this.texts.filter_custom, style: { ...styles.headerCell, width: this.columnsVisibility.buttons } },
5374
5417
  ' ',
5375
5418
  this.getFilterSelectCustoms())) : null));
5376
5419
  }
5377
5420
  renderToast() {
5378
- return (react_1.default.createElement(material_1.Snackbar, { open: !!this.state.toast, autoHideDuration: 3000, onClick: () => this.setState({ toast: '' }), onClose: () => this.setState({ toast: '' }), message: this.state.toast, action: react_1.default.createElement(material_1.IconButton, { size: "small", "aria-label": "close", color: "inherit", onClick: () => this.setState({ toast: '' }) },
5379
- react_1.default.createElement(icons_material_1.Close, { fontSize: "small" })) }));
5421
+ return (React.createElement(Snackbar, { open: !!this.state.toast, autoHideDuration: 3000, onClick: () => this.setState({ toast: '' }), onClose: () => this.setState({ toast: '' }), message: this.state.toast, action: React.createElement(IconButton, { size: "small", "aria-label": "close", color: "inherit", onClick: () => this.setState({ toast: '' }) },
5422
+ React.createElement(IconClose, { fontSize: "small" })) }));
5380
5423
  }
5381
5424
  /**
5382
5425
  * Called when component is updated.
@@ -5395,7 +5438,7 @@ class ObjectBrowserClass extends react_1.Component {
5395
5438
  scrollToItem(id) {
5396
5439
  this.selectFirst = '';
5397
5440
  const node = window.document.getElementById(id);
5398
- node === null || node === void 0 ? void 0 : node.scrollIntoView({
5441
+ node?.scrollIntoView({
5399
5442
  behavior: 'auto',
5400
5443
  block: 'center',
5401
5444
  inline: 'center',
@@ -5404,10 +5447,9 @@ class ObjectBrowserClass extends react_1.Component {
5404
5447
  renderCustomDialog() {
5405
5448
  if (this.state.customDialog && this.props.objectCustomDialog) {
5406
5449
  const ObjectCustomDialog = this.props.objectCustomDialog;
5407
- return (react_1.default.createElement(ObjectCustomDialog, { reportChangedIds: (changedIds) => (this.changedIds = [...changedIds]), objectIDs: this.state.customDialog, allVisibleObjects: !!this.state.customDialogAll, expertMode: this.state.filter.expertMode, isFloatComma: this.props.isFloatComma === undefined
5450
+ return (React.createElement(ObjectCustomDialog, { reportChangedIds: (changedIds) => (this.changedIds = [...changedIds]), objectIDs: this.state.customDialog, allVisibleObjects: !!this.state.customDialogAll, expertMode: this.state.filter.expertMode, isFloatComma: this.props.isFloatComma === undefined
5408
5451
  ? this.systemConfig.common.isFloatComma
5409
5452
  : this.props.isFloatComma, t: this.props.t, lang: this.props.lang, socket: this.props.socket, themeName: this.props.themeName, themeType: this.props.themeType, theme: this.props.theme, objects: this.objects, customsInstances: this.info.customs, onClose: () => {
5410
- var _b;
5411
5453
  this.pauseSubscribe(false);
5412
5454
  this.setState({ customDialog: null });
5413
5455
  if (this.changedIds) {
@@ -5415,7 +5457,7 @@ class ObjectBrowserClass extends react_1.Component {
5415
5457
  // update all changed IDs
5416
5458
  this.forceUpdate();
5417
5459
  }
5418
- (_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate('tab-objects');
5460
+ this.props.router?.doNavigate('tab-objects');
5419
5461
  }, systemConfig: this.systemConfig }));
5420
5462
  }
5421
5463
  return null;
@@ -5435,18 +5477,17 @@ class ObjectBrowserClass extends react_1.Component {
5435
5477
  return null;
5436
5478
  }
5437
5479
  const ObjectBrowserEditObject = this.props.objectBrowserEditObject;
5438
- return (react_1.default.createElement(ObjectBrowserEditObject, { key: this.state.editObjectDialog, obj: this.objects[this.state.editObjectDialog], roleArray: this.info.roles, objects: this.objects, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
5480
+ return (React.createElement(ObjectBrowserEditObject, { key: this.state.editObjectDialog, obj: this.objects[this.state.editObjectDialog], roleArray: this.info.roles, objects: this.objects, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
5439
5481
  ? this.systemConfig.common.isFloatComma
5440
5482
  : this.props.isFloatComma, themeType: this.props.themeType, theme: this.props.theme, socket: this.props.socket, dialogName: this.props.dialogName, aliasTab: this.state.editObjectAlias, t: this.props.t, expertMode: !!this.state.filter.expertMode, onNewObject: (obj) => this.props.socket
5441
5483
  .setObject(obj._id, obj)
5442
5484
  .then(() => this.setState({ editObjectDialog: obj._id, editObjectAlias: false }, () => this.onSelect(obj._id)))
5443
5485
  .catch(e => this.showError(`Cannot write object: ${e}`)), onClose: (obj) => {
5444
- var _b, _c;
5445
5486
  if (obj) {
5446
5487
  let updateAlias;
5447
5488
  if (this.state.editObjectDialog.startsWith('alias.')) {
5448
- if (JSON.stringify((_b = this.objects[this.state.editObjectDialog].common) === null || _b === void 0 ? void 0 : _b.alias) !==
5449
- JSON.stringify((_c = obj.common) === null || _c === void 0 ? void 0 : _c.alias)) {
5489
+ if (JSON.stringify(this.objects[this.state.editObjectDialog].common?.alias) !==
5490
+ JSON.stringify(obj.common?.alias)) {
5450
5491
  updateAlias = this.state.editObjectDialog;
5451
5492
  }
5452
5493
  }
@@ -5468,14 +5509,14 @@ class ObjectBrowserClass extends react_1.Component {
5468
5509
  return null;
5469
5510
  }
5470
5511
  const ObjectBrowserViewFile = this.props.objectBrowserViewFile;
5471
- return (react_1.default.createElement(ObjectBrowserViewFile, { key: "viewFile", obj: this.objects[this.state.viewFileDialog], socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ viewFileDialog: '' }) }));
5512
+ return (React.createElement(ObjectBrowserViewFile, { key: "viewFile", obj: this.objects[this.state.viewFileDialog], socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ viewFileDialog: '' }) }));
5472
5513
  }
5473
5514
  renderAliasEditorDialog() {
5474
5515
  if (!this.props.objectBrowserAliasEditor || !this.state.showAliasEditor) {
5475
5516
  return null;
5476
5517
  }
5477
5518
  const ObjectBrowserAliasEditor = this.props.objectBrowserAliasEditor;
5478
- return (react_1.default.createElement(ObjectBrowserAliasEditor, { key: "editAlias", obj: this.objects[this.state.showAliasEditor], objects: this.objects, socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ showAliasEditor: '' }), onRedirect: (id, timeout) => setTimeout(() => this.onSelect(id, false, () => this.expandAllSelected(() => {
5519
+ return (React.createElement(ObjectBrowserAliasEditor, { key: "editAlias", obj: this.objects[this.state.showAliasEditor], objects: this.objects, socket: this.props.socket, t: this.props.t, onClose: () => this.setState({ showAliasEditor: '' }), onRedirect: (id, timeout) => setTimeout(() => this.onSelect(id, false, () => this.expandAllSelected(() => {
5479
5520
  this.scrollToItem(id);
5480
5521
  setTimeout(() => this.setState({
5481
5522
  editObjectDialog: id,
@@ -5499,8 +5540,8 @@ class ObjectBrowserClass extends react_1.Component {
5499
5540
  if (!this.state.aliasMenu) {
5500
5541
  return null;
5501
5542
  }
5502
- return (react_1.default.createElement(material_1.Menu, { key: "aliasmenu", open: !0, anchorEl: window.document.getElementById(`alias_${this.state.aliasMenu}`), onClose: () => this.setState({ aliasMenu: '' }) }, this.info.aliasesMap[this.state.aliasMenu].map((aliasId, i) => (react_1.default.createElement(material_1.MenuItem, { key: aliasId, onClick: () => this.onSelect(aliasId) },
5503
- react_1.default.createElement(material_1.ListItemText, null, this.renderAliasLink(this.state.aliasMenu, i, {
5543
+ return (React.createElement(Menu, { key: "aliasmenu", open: !0, anchorEl: window.document.getElementById(`alias_${this.state.aliasMenu}`), onClose: () => this.setState({ aliasMenu: '' }) }, this.info.aliasesMap[this.state.aliasMenu].map((aliasId, i) => (React.createElement(MenuItem, { key: aliasId, onClick: () => this.onSelect(aliasId) },
5544
+ React.createElement(ListItemText, null, this.renderAliasLink(this.state.aliasMenu, i, {
5504
5545
  '& .admin-browser-arrow': {
5505
5546
  mr: '8px',
5506
5547
  },
@@ -5510,7 +5551,6 @@ class ObjectBrowserClass extends react_1.Component {
5510
5551
  * Renders the right mouse button context menu
5511
5552
  */
5512
5553
  renderContextMenu() {
5513
- var _b, _c, _d, _e, _f, _g, _h;
5514
5554
  if (!this.state.showContextMenu) {
5515
5555
  return null;
5516
5556
  }
@@ -5560,8 +5600,8 @@ class ObjectBrowserClass extends react_1.Component {
5560
5600
  key: '0',
5561
5601
  visibility: !!(this.props.objectBrowserEditObject &&
5562
5602
  obj &&
5563
- (this.state.filter.expertMode || _a.isNonExpertId(id))),
5564
- icon: (react_1.default.createElement(icons_material_1.Edit, { fontSize: "small", style: this.styles.contextMenuEdit })),
5603
+ (this.state.filter.expertMode || ObjectBrowserClass.isNonExpertId(id))),
5604
+ icon: (React.createElement(IconEdit, { fontSize: "small", style: this.styles.contextMenuEdit })),
5565
5605
  label: this.texts.editObject,
5566
5606
  onClick: () => this.setState({ editObjectDialog: item.data.id, showContextMenu: null, editObjectAlias: false }),
5567
5607
  },
@@ -5572,9 +5612,9 @@ class ObjectBrowserClass extends react_1.Component {
5572
5612
  obj &&
5573
5613
  obj.type === 'state' &&
5574
5614
  // @ts-expect-error deprecated from js-controller 6
5575
- ((_b = obj.common) === null || _b === void 0 ? void 0 : _b.type) !== 'file' &&
5615
+ obj.common?.type !== 'file' &&
5576
5616
  (this.state.filter.expertMode || obj.common.write !== false)),
5577
- icon: (react_1.default.createElement(icons_material_1.FormatItalic, { fontSize: "small", style: this.styles.contextMenuEditValue })),
5617
+ icon: (React.createElement(IconValueEdit, { fontSize: "small", style: this.styles.contextMenuEditValue })),
5578
5618
  label: this.props.t('ra_Edit value'),
5579
5619
  onClick: () => {
5580
5620
  this.edit = {
@@ -5588,12 +5628,12 @@ class ObjectBrowserClass extends react_1.Component {
5588
5628
  },
5589
5629
  VIEW: {
5590
5630
  visibility: !!this.props.objectBrowserViewFile &&
5591
- (obj === null || obj === void 0 ? void 0 : obj.type) === 'state' &&
5631
+ obj?.type === 'state' &&
5592
5632
  // @ts-expect-error deprecated from js-controller 6
5593
- ((_c = obj.common) === null || _c === void 0 ? void 0 : _c.type) === 'file',
5594
- icon: (react_1.default.createElement(icons_material_1.FindInPage, { fontSize: "small", style: this.styles.contextMenuView })),
5633
+ obj.common?.type === 'file',
5634
+ icon: (React.createElement(FindInPage, { fontSize: "small", style: this.styles.contextMenuView })),
5595
5635
  label: this.props.t('ra_View file'),
5596
- onClick: () => this.setState({ viewFileDialog: (obj === null || obj === void 0 ? void 0 : obj._id) || '', showContextMenu: null }),
5636
+ onClick: () => this.setState({ viewFileDialog: obj?._id || '', showContextMenu: null }),
5597
5637
  },
5598
5638
  CUSTOM: {
5599
5639
  key: '2',
@@ -5602,16 +5642,15 @@ class ObjectBrowserClass extends react_1.Component {
5602
5642
  obj &&
5603
5643
  obj.type === 'state' &&
5604
5644
  // @ts-expect-error deprecated from js-controller 6
5605
- ((_d = obj.common) === null || _d === void 0 ? void 0 : _d.type) !== 'file'),
5606
- icon: (react_1.default.createElement(icons_material_1.Settings, { fontSize: "small", style: item.data.hasCustoms
5645
+ obj.common?.type !== 'file'),
5646
+ icon: (React.createElement(IconConfig, { fontSize: "small", style: item.data.hasCustoms
5607
5647
  ? this.styles.cellButtonsButtonWithCustoms
5608
5648
  : styles.cellButtonsButtonWithoutCustoms })),
5609
5649
  style: this.styles.contextMenuCustom,
5610
5650
  label: this.texts.customConfig,
5611
5651
  onClick: () => {
5612
- var _b;
5613
5652
  this.pauseSubscribe(true);
5614
- (_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate(null, 'customs', id);
5653
+ this.props.router?.doNavigate(null, 'customs', id);
5615
5654
  this.setState({ customDialog: [id], showContextMenu: null });
5616
5655
  },
5617
5656
  },
@@ -5632,14 +5671,14 @@ class ObjectBrowserClass extends react_1.Component {
5632
5671
  ROLE: {
5633
5672
  key: '4',
5634
5673
  visibility: !!(this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole),
5635
- icon: (react_1.default.createElement(icons_material_1.BorderColor, { fontSize: "small", style: this.styles.contextMenuRole })),
5674
+ icon: (React.createElement(BorderColor, { fontSize: "small", style: this.styles.contextMenuRole })),
5636
5675
  label: this.props.t('ra_Edit role'),
5637
5676
  onClick: () => this.setState({ roleDialog: item.data.id, showContextMenu: null }),
5638
5677
  },
5639
5678
  FUNCTION: {
5640
5679
  key: '5',
5641
5680
  visibility: !!enumEditable,
5642
- icon: (react_1.default.createElement(icons_material_1.BedroomParent, { fontSize: "small", style: this.styles.contextMenuRole })),
5681
+ icon: (React.createElement(BedroomParent, { fontSize: "small", style: this.styles.contextMenuRole })),
5643
5682
  label: this.props.t('ra_Edit function'),
5644
5683
  onClick: () => {
5645
5684
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'funcEnums');
@@ -5657,7 +5696,7 @@ class ObjectBrowserClass extends react_1.Component {
5657
5696
  ROOM: {
5658
5697
  key: '6',
5659
5698
  visibility: !!enumEditable,
5660
- icon: (react_1.default.createElement(icons_material_1.Construction, { fontSize: "small", style: this.styles.contextMenuRoom })),
5699
+ icon: (React.createElement(Construction, { fontSize: "small", style: this.styles.contextMenuRoom })),
5661
5700
  label: this.props.t('ra_Edit room'),
5662
5701
  onClick: () => {
5663
5702
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'roomEnums');
@@ -5677,18 +5716,17 @@ class ObjectBrowserClass extends react_1.Component {
5677
5716
  visibility: !!(!this.props.notEditable &&
5678
5717
  this.props.objectBrowserAliasEditor &&
5679
5718
  this.props.objectBrowserEditObject &&
5680
- (obj === null || obj === void 0 ? void 0 : obj.type) === 'state' &&
5719
+ obj?.type === 'state' &&
5681
5720
  // @ts-expect-error deprecated from js-controller 6
5682
- ((_e = obj.common) === null || _e === void 0 ? void 0 : _e.type) !== 'file'),
5683
- icon: (react_1.default.createElement(icons_material_1.Link, { style: ((_f = obj === null || obj === void 0 ? void 0 : obj.common) === null || _f === void 0 ? void 0 : _f.alias)
5721
+ obj.common?.type !== 'file'),
5722
+ icon: (React.createElement(IconLink, { style: obj?.common?.alias
5684
5723
  ? this.styles.cellButtonsButtonWithCustoms
5685
5724
  : styles.cellButtonsButtonWithoutCustoms })),
5686
5725
  label: this.info.aliasesMap[item.data.id]
5687
5726
  ? this.props.t('ra_Edit alias')
5688
5727
  : this.props.t('ra_Create alias'),
5689
5728
  onClick: () => {
5690
- var _b;
5691
- if ((_b = obj === null || obj === void 0 ? void 0 : obj.common) === null || _b === void 0 ? void 0 : _b.alias) {
5729
+ if (obj?.common?.alias) {
5692
5730
  this.setState({ showContextMenu: null, editObjectDialog: item.data.id, editObjectAlias: true });
5693
5731
  }
5694
5732
  else {
@@ -5700,49 +5738,49 @@ class ObjectBrowserClass extends react_1.Component {
5700
5738
  key: '+',
5701
5739
  visibility: (item.data.id.startsWith('0_userdata.0') || item.data.id.startsWith('javascript.')) &&
5702
5740
  (createStateVisible || createChannelVisible || createDeviceVisible || createFolderVisible),
5703
- icon: (react_1.default.createElement(icons_material_1.Add, { fontSize: "small", style: this.styles.cellButtonsButtonWithCustoms })),
5741
+ icon: (React.createElement(AddIcon, { fontSize: "small", style: this.styles.cellButtonsButtonWithCustoms })),
5704
5742
  style: styles.contextMenuWithSubMenu,
5705
5743
  label: this.texts.create,
5706
5744
  subMenu: [
5707
5745
  {
5708
5746
  label: this.texts.createBooleanState,
5709
5747
  visibility: createStateVisible,
5710
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5748
+ icon: React.createElement(IconState, { fontSize: "small" }),
5711
5749
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state', 'boolean'),
5712
5750
  },
5713
5751
  {
5714
5752
  label: this.texts.createNumberState,
5715
5753
  visibility: createStateVisible,
5716
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5754
+ icon: React.createElement(IconState, { fontSize: "small" }),
5717
5755
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state', 'number'),
5718
5756
  },
5719
5757
  {
5720
5758
  label: this.texts.createStringState,
5721
5759
  visibility: createStateVisible,
5722
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5760
+ icon: React.createElement(IconState, { fontSize: "small" }),
5723
5761
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state', 'string'),
5724
5762
  },
5725
5763
  {
5726
5764
  label: this.texts.createState,
5727
5765
  visibility: createStateVisible,
5728
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5766
+ icon: React.createElement(IconState, { fontSize: "small" }),
5729
5767
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state'),
5730
5768
  },
5731
5769
  {
5732
5770
  label: this.texts.createChannel,
5733
5771
  visibility: createChannelVisible,
5734
- icon: react_1.default.createElement(IconChannel_1.default, { fontSize: "small" }),
5772
+ icon: React.createElement(IconChannel, { fontSize: "small" }),
5735
5773
  onClick: () => this.showAddDataPointDialog(item.data.id, 'channel'),
5736
5774
  },
5737
5775
  {
5738
5776
  label: this.texts.createDevice,
5739
5777
  visibility: createDeviceVisible,
5740
- icon: react_1.default.createElement(IconDevice_1.default, { fontSize: "small" }),
5778
+ icon: React.createElement(IconDevice, { fontSize: "small" }),
5741
5779
  onClick: () => this.showAddDataPointDialog(item.data.id, 'device'),
5742
5780
  },
5743
5781
  {
5744
5782
  label: this.texts.createFolder,
5745
- icon: react_1.default.createElement(icons_material_1.CreateNewFolder, { fontSize: "small" }),
5783
+ icon: React.createElement(IconFolder, { fontSize: "small" }),
5746
5784
  visibility: createFolderVisible,
5747
5785
  onClick: () => this.showAddDataPointDialog(item.data.id, 'folder'),
5748
5786
  },
@@ -5751,8 +5789,8 @@ class ObjectBrowserClass extends react_1.Component {
5751
5789
  DELETE: {
5752
5790
  key: 'Delete',
5753
5791
  visibility: !!(this.props.onObjectDelete &&
5754
- (((_g = item.children) === null || _g === void 0 ? void 0 : _g.length) || (obj && !((_h = obj.common) === null || _h === void 0 ? void 0 : _h.dontDelete)))),
5755
- icon: (react_1.default.createElement(icons_material_1.Delete, { fontSize: "small", style: this.styles.contextMenuDelete })),
5792
+ (item.children?.length || (obj && !obj.common?.dontDelete))),
5793
+ icon: (React.createElement(IconDelete, { fontSize: "small", style: this.styles.contextMenuDelete })),
5756
5794
  style: this.styles.contextMenuDelete,
5757
5795
  label: this.texts.deleteObject,
5758
5796
  onClick: () => this.setState({ showContextMenu: null }, () => this.showDeleteDialog({
@@ -5763,10 +5801,9 @@ class ObjectBrowserClass extends react_1.Component {
5763
5801
  },
5764
5802
  };
5765
5803
  Object.keys(ITEMS).forEach(key => {
5766
- var _b, _c;
5767
5804
  if (ITEMS[key].visibility) {
5768
5805
  if (ITEMS[key].subMenu) {
5769
- items.push(react_1.default.createElement(material_1.MenuItem, { key: key, href: "", onClick: (e) => this.state.showContextMenu &&
5806
+ items.push(React.createElement(MenuItem, { key: key, href: "", onClick: (e) => this.state.showContextMenu &&
5770
5807
  this.setState({
5771
5808
  showContextMenu: {
5772
5809
  item: this.state.showContextMenu.item,
@@ -5775,14 +5812,14 @@ class ObjectBrowserClass extends react_1.Component {
5775
5812
  subAnchor: e.target,
5776
5813
  },
5777
5814
  }), style: ITEMS[key].style },
5778
- react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, ITEMS[key].iconStyle), ITEMS[key].listItemIconStyle) }, ITEMS[key].icon),
5779
- react_1.default.createElement(material_1.ListItemText, null,
5815
+ React.createElement(ListItemIcon, { style: { ...ITEMS[key].iconStyle, ...ITEMS[key].listItemIconStyle } }, ITEMS[key].icon),
5816
+ React.createElement(ListItemText, null,
5780
5817
  ITEMS[key].label,
5781
5818
  "..."),
5782
- react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.contextMenuKeys), { opacity: 1 }) },
5783
- react_1.default.createElement(icons_material_1.ArrowRight, null))));
5784
- if (((_b = this.state.showContextMenu) === null || _b === void 0 ? void 0 : _b.subItem) === key) {
5785
- items.push(react_1.default.createElement(material_1.Menu, { key: "subContextMenu", open: !0, anchorEl: this.state.showContextMenu.subAnchor, onClose: () => {
5819
+ React.createElement("div", { style: { ...styles.contextMenuKeys, opacity: 1 } },
5820
+ React.createElement(ArrowRightIcon, null))));
5821
+ if (this.state.showContextMenu?.subItem === key) {
5822
+ items.push(React.createElement(Menu, { key: "subContextMenu", open: !0, anchorEl: this.state.showContextMenu.subAnchor, onClose: () => {
5786
5823
  if (this.state.showContextMenu) {
5787
5824
  this.setState({
5788
5825
  showContextMenu: {
@@ -5792,16 +5829,19 @@ class ObjectBrowserClass extends react_1.Component {
5792
5829
  });
5793
5830
  }
5794
5831
  this.contextMenu = null;
5795
- } }, (_c = ITEMS[key].subMenu) === null || _c === void 0 ? void 0 : _c.map(subItem => subItem.visibility ? (react_1.default.createElement(material_1.MenuItem, { key: subItem.label, onClick: subItem.onClick, style: subItem.style },
5796
- react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, subItem.iconStyle), (subItem.listItemIconStyle || undefined)) }, subItem.icon),
5797
- react_1.default.createElement(material_1.ListItemText, null, subItem.label))) : null)));
5832
+ } }, ITEMS[key].subMenu?.map(subItem => subItem.visibility ? (React.createElement(MenuItem, { key: subItem.label, onClick: subItem.onClick, style: subItem.style },
5833
+ React.createElement(ListItemIcon, { style: {
5834
+ ...subItem.iconStyle,
5835
+ ...(subItem.listItemIconStyle || undefined),
5836
+ } }, subItem.icon),
5837
+ React.createElement(ListItemText, null, subItem.label))) : null)));
5798
5838
  }
5799
5839
  }
5800
5840
  else {
5801
- items.push(react_1.default.createElement(material_1.MenuItem, { key: key, onClick: ITEMS[key].onClick, sx: ITEMS[key].style },
5802
- react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, ITEMS[key].iconStyle), ITEMS[key].listItemIconStyle) }, ITEMS[key].icon),
5803
- react_1.default.createElement(material_1.ListItemText, null, ITEMS[key].label),
5804
- ITEMS[key].key ? (react_1.default.createElement("div", { style: styles.contextMenuKeys }, `Alt+${ITEMS[key].key === 'Delete' ? this.props.t('ra_Del') : ITEMS[key].key}`)) : null));
5841
+ items.push(React.createElement(MenuItem, { key: key, onClick: ITEMS[key].onClick, sx: ITEMS[key].style },
5842
+ React.createElement(ListItemIcon, { style: { ...ITEMS[key].iconStyle, ...ITEMS[key].listItemIconStyle } }, ITEMS[key].icon),
5843
+ React.createElement(ListItemText, null, ITEMS[key].label),
5844
+ ITEMS[key].key ? (React.createElement("div", { style: styles.contextMenuKeys }, `Alt+${ITEMS[key].key === 'Delete' ? this.props.t('ra_Del') : ITEMS[key].key}`)) : null));
5805
5845
  }
5806
5846
  }
5807
5847
  });
@@ -5809,7 +5849,7 @@ class ObjectBrowserClass extends react_1.Component {
5809
5849
  setTimeout(() => this.setState({ showContextMenu: null }), 100);
5810
5850
  return null;
5811
5851
  }
5812
- return (react_1.default.createElement(material_1.Menu, { key: "contextMenu", open: !0, onKeyUp: e => {
5852
+ return (React.createElement(Menu, { key: "contextMenu", open: !0, onKeyUp: e => {
5813
5853
  e.preventDefault();
5814
5854
  if (e.altKey) {
5815
5855
  Object.keys(ITEMS).forEach(key => {
@@ -5824,7 +5864,6 @@ class ObjectBrowserClass extends react_1.Component {
5824
5864
  } }, items));
5825
5865
  }
5826
5866
  renderEditValueDialog() {
5827
- var _b;
5828
5867
  if (!this.state.updateOpened || !this.props.objectBrowserValue) {
5829
5868
  return null;
5830
5869
  }
@@ -5836,12 +5875,12 @@ class ObjectBrowserClass extends react_1.Component {
5836
5875
  console.error(`Something went wrong. Possibly the object ${this.edit.id} was deleted.`);
5837
5876
  return null;
5838
5877
  }
5839
- const type = ((_b = this.objects[this.edit.id].common) === null || _b === void 0 ? void 0 : _b.type)
5878
+ const type = this.objects[this.edit.id].common?.type
5840
5879
  ? this.objects[this.edit.id].common.type
5841
5880
  : typeof this.edit.val;
5842
5881
  const role = this.objects[this.edit.id].common.role;
5843
5882
  const ObjectBrowserValue = this.props.objectBrowserValue;
5844
- return (react_1.default.createElement(ObjectBrowserValue, { t: this.props.t, lang: this.props.lang, type: type, role: role || '', states: Utils_1.default.getStates(this.objects[this.edit.id]), themeType: this.props.themeType, theme: this.props.theme, expertMode: !!this.state.filter.expertMode, value: this.edit.val, socket: this.props.socket, object: this.objects[this.edit.id], defaultHistory: this.defaultHistory, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
5883
+ return (React.createElement(ObjectBrowserValue, { t: this.props.t, lang: this.props.lang, type: type, role: role || '', states: Utils.getStates(this.objects[this.edit.id]), themeType: this.props.themeType, theme: this.props.theme, expertMode: !!this.state.filter.expertMode, value: this.edit.val, socket: this.props.socket, object: this.objects[this.edit.id], defaultHistory: this.defaultHistory, dateFormat: this.props.dateFormat || this.systemConfig.common.dateFormat, isFloatComma: this.props.isFloatComma === undefined
5845
5884
  ? this.systemConfig.common.isFloatComma
5846
5885
  : this.props.isFloatComma, onClose: (res) => {
5847
5886
  this.setState({ updateOpened: false });
@@ -5860,26 +5899,26 @@ class ObjectBrowserClass extends react_1.Component {
5860
5899
  }
5861
5900
  if (this.styleTheme !== this.props.themeType) {
5862
5901
  this.styles = {
5863
- cellIdIconFolder: Utils_1.default.getStyle(this.props.theme, styles.cellIdIconFolder),
5864
- cellIdIconDocument: Utils_1.default.getStyle(this.props.theme, styles.cellIdIconDocument),
5865
- iconDeviceError: Utils_1.default.getStyle(this.props.theme, styles.iconDeviceError),
5866
- iconDeviceConnected: Utils_1.default.getStyle(this.props.theme, styles.iconDeviceConnected),
5867
- iconDeviceDisconnected: Utils_1.default.getStyle(this.props.theme, styles.iconDeviceDisconnected),
5868
- cellButtonsButtonWithCustoms: Utils_1.default.getStyle(this.props.theme, styles.cellButtonsButtonWithCustoms),
5869
- invertedBackground: Utils_1.default.getStyle(this.props.theme, styles.invertedBackground),
5870
- invertedBackgroundFlex: Utils_1.default.getStyle(this.props.theme, styles.invertedBackgroundFlex),
5871
- contextMenuEdit: Utils_1.default.getStyle(this.props.theme, styles.contextMenuEdit),
5872
- contextMenuEditValue: Utils_1.default.getStyle(this.props.theme, styles.contextMenuEditValue),
5873
- contextMenuView: Utils_1.default.getStyle(this.props.theme, styles.contextMenuView),
5874
- contextMenuCustom: Utils_1.default.getStyle(this.props.theme, styles.contextMenuCustom),
5875
- contextMenuACL: Utils_1.default.getStyle(this.props.theme, styles.contextMenuACL),
5876
- contextMenuRoom: Utils_1.default.getStyle(this.props.theme, styles.contextMenuRoom),
5877
- contextMenuRole: Utils_1.default.getStyle(this.props.theme, styles.contextMenuRole),
5878
- contextMenuDelete: Utils_1.default.getStyle(this.props.theme, styles.contextMenuDelete),
5879
- filterInput: Utils_1.default.getStyle(this.props.theme, styles.headerCellInput, styles.filterInput),
5880
- iconCopy: Utils_1.default.getStyle(this.props.theme, styles.cellButtonsValueButton, styles.cellButtonsValueButtonCopy),
5881
- aliasReadWrite: Utils_1.default.getStyle(this.props.theme, styles.cellIdAlias, styles.cellIdAliasReadWrite),
5882
- aliasAlone: Utils_1.default.getStyle(this.props.theme, styles.cellIdAlias, styles.cellIdAliasAlone),
5902
+ cellIdIconFolder: Utils.getStyle(this.props.theme, styles.cellIdIconFolder),
5903
+ cellIdIconDocument: Utils.getStyle(this.props.theme, styles.cellIdIconDocument),
5904
+ iconDeviceError: Utils.getStyle(this.props.theme, styles.iconDeviceError),
5905
+ iconDeviceConnected: Utils.getStyle(this.props.theme, styles.iconDeviceConnected),
5906
+ iconDeviceDisconnected: Utils.getStyle(this.props.theme, styles.iconDeviceDisconnected),
5907
+ cellButtonsButtonWithCustoms: Utils.getStyle(this.props.theme, styles.cellButtonsButtonWithCustoms),
5908
+ invertedBackground: Utils.getStyle(this.props.theme, styles.invertedBackground),
5909
+ invertedBackgroundFlex: Utils.getStyle(this.props.theme, styles.invertedBackgroundFlex),
5910
+ contextMenuEdit: Utils.getStyle(this.props.theme, styles.contextMenuEdit),
5911
+ contextMenuEditValue: Utils.getStyle(this.props.theme, styles.contextMenuEditValue),
5912
+ contextMenuView: Utils.getStyle(this.props.theme, styles.contextMenuView),
5913
+ contextMenuCustom: Utils.getStyle(this.props.theme, styles.contextMenuCustom),
5914
+ contextMenuACL: Utils.getStyle(this.props.theme, styles.contextMenuACL),
5915
+ contextMenuRoom: Utils.getStyle(this.props.theme, styles.contextMenuRoom),
5916
+ contextMenuRole: Utils.getStyle(this.props.theme, styles.contextMenuRole),
5917
+ contextMenuDelete: Utils.getStyle(this.props.theme, styles.contextMenuDelete),
5918
+ filterInput: Utils.getStyle(this.props.theme, styles.headerCellInput, styles.filterInput),
5919
+ iconCopy: Utils.getStyle(this.props.theme, styles.cellButtonsValueButton, styles.cellButtonsValueButtonCopy),
5920
+ aliasReadWrite: Utils.getStyle(this.props.theme, styles.cellIdAlias, styles.cellIdAliasReadWrite),
5921
+ aliasAlone: Utils.getStyle(this.props.theme, styles.cellIdAlias, styles.cellIdAliasAlone),
5883
5922
  };
5884
5923
  this.styleTheme = this.props.themeType;
5885
5924
  }
@@ -5901,11 +5940,11 @@ class ObjectBrowserClass extends react_1.Component {
5901
5940
  this.checkUnsubscribes();
5902
5941
  }, 200);
5903
5942
  if (!this.state.loaded) {
5904
- return react_1.default.createElement(material_1.CircularProgress, { key: `${this.props.dialogName}_c` });
5943
+ return React.createElement(CircularProgress, { key: `${this.props.dialogName}_c` });
5905
5944
  }
5906
5945
  const items = this.root ? this.renderItem(this.root, undefined) : null;
5907
- return (react_1.default.createElement(TabContainer_1.default, { key: this.props.dialogName },
5908
- react_1.default.createElement("style", null, `
5946
+ return (React.createElement(TabContainer, { key: this.props.dialogName },
5947
+ React.createElement("style", null, `
5909
5948
  @keyframes newValueAnimation-light {
5910
5949
  0% {
5911
5950
  color: #00f900;
@@ -5935,10 +5974,10 @@ class ObjectBrowserClass extends react_1.Component {
5935
5974
  animation: newValueAnimation-light 2s ease-in-out;
5936
5975
  }
5937
5976
  `),
5938
- react_1.default.createElement(TabHeader_1.default, null, this.getToolbar()),
5939
- react_1.default.createElement(TabContent_1.default, null,
5977
+ React.createElement(TabHeader, null, this.getToolbar()),
5978
+ React.createElement(TabContent, null,
5940
5979
  this.renderHeader(),
5941
- react_1.default.createElement("div", { style: styles.tableDiv, ref: this.tableRef, onKeyDown: event => this.navigateKeyPress(event) }, items)),
5980
+ React.createElement("div", { style: styles.tableDiv, ref: this.tableRef, onKeyDown: event => this.navigateKeyPress(event) }, items)),
5942
5981
  this.renderContextMenu(),
5943
5982
  this.renderAliasMenu(),
5944
5983
  this.renderToast(),
@@ -5960,8 +5999,5 @@ class ObjectBrowserClass extends react_1.Component {
5960
5999
  this.props.modalEditOfAccessControl(this, this.state.modalEditOfAccessObjData)));
5961
6000
  }
5962
6001
  }
5963
- exports.ObjectBrowserClass = ObjectBrowserClass;
5964
- _a = ObjectBrowserClass;
5965
- /** Namespaces which are allowed to be edited by non-expert users */
5966
- _ObjectBrowserClass_NON_EXPERT_NAMESPACES = { value: ['0_userdata.0.', 'alias.0.'] };
5967
- exports.default = (0, withWidth_1.default)()(ObjectBrowserClass);
6002
+ export const ObjectBrowser = withWidth()(ObjectBrowserClass);
6003
+ //# sourceMappingURL=ObjectBrowser.js.map