@iobroker/adapter-react-v5 7.2.3 → 7.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/README.md +3 -3
  2. package/build/AdminConnection.d.ts +1 -0
  3. package/build/AdminConnection.js +2 -0
  4. package/build/AdminConnection.js.map +1 -0
  5. package/{src/Components/404.tsx → build/Components/404.js} +14 -39
  6. package/build/Components/404.js.map +1 -0
  7. package/{Components → build/Components}/ColorPicker.d.ts +2 -2
  8. package/{Components → build/Components}/ColorPicker.js +50 -65
  9. package/build/Components/ColorPicker.js.map +1 -0
  10. package/{Components → build/Components}/ComplexCron.d.ts +2 -2
  11. package/{Components → build/Components}/ComplexCron.js +43 -71
  12. package/build/Components/ComplexCron.js.map +1 -0
  13. package/{Components → build/Components}/CopyToClipboard.d.ts +1 -2
  14. package/{src/Components/CopyToClipboard.tsx → build/Components/CopyToClipboard.js} +20 -38
  15. package/build/Components/CopyToClipboard.js.map +1 -0
  16. package/{Components → build/Components}/CustomModal.d.ts +3 -3
  17. package/build/Components/CustomModal.js +60 -0
  18. package/build/Components/CustomModal.js.map +1 -0
  19. package/{Components → build/Components}/FileBrowser.d.ts +21 -21
  20. package/{Components → build/Components}/FileBrowser.js +253 -248
  21. package/build/Components/FileBrowser.js.map +1 -0
  22. package/build/Components/FileViewer.d.ts +48 -0
  23. package/build/Components/FileViewer.js +277 -0
  24. package/build/Components/FileViewer.js.map +1 -0
  25. package/{Components → build/Components}/Icon.d.ts +1 -1
  26. package/build/Components/Icon.js +140 -0
  27. package/build/Components/Icon.js.map +1 -0
  28. package/{Components → build/Components}/IconPicker.d.ts +2 -2
  29. package/build/Components/IconPicker.js +73 -0
  30. package/build/Components/IconPicker.js.map +1 -0
  31. package/{Components → build/Components}/IconSelector.d.ts +3 -3
  32. package/{Components → build/Components}/IconSelector.js +29 -57
  33. package/build/Components/IconSelector.js.map +1 -0
  34. package/{Components → build/Components}/Image.d.ts +2 -2
  35. package/{Components → build/Components}/Image.js +16 -22
  36. package/build/Components/Image.js.map +1 -0
  37. package/{Components → build/Components}/Loader.d.ts +2 -2
  38. package/{Components → build/Components}/Loader.js +15 -40
  39. package/build/Components/Loader.js.map +1 -0
  40. package/{Components → build/Components}/Loaders/MV.d.ts +2 -2
  41. package/build/Components/Loaders/MV.js +61 -0
  42. package/build/Components/Loaders/MV.js.map +1 -0
  43. package/{Components → build/Components}/Loaders/PT.d.ts +2 -2
  44. package/{Components → build/Components}/Loaders/PT.js +10 -35
  45. package/build/Components/Loaders/PT.js.map +1 -0
  46. package/{Components → build/Components}/Loaders/Vendor.d.ts +2 -2
  47. package/build/Components/Loaders/Vendor.js +52 -0
  48. package/build/Components/Loaders/Vendor.js.map +1 -0
  49. package/{Components → build/Components}/Logo.d.ts +2 -2
  50. package/build/Components/Logo.js +108 -0
  51. package/build/Components/Logo.js.map +1 -0
  52. package/{Components → build/Components}/MDUtils.d.ts +1 -2
  53. package/{Components → build/Components}/MDUtils.js +4 -9
  54. package/build/Components/MDUtils.js.map +1 -0
  55. package/{Components → build/Components}/ObjectBrowser.d.ts +7 -4
  56. package/{Components → build/Components}/ObjectBrowser.js +1183 -1133
  57. package/build/Components/ObjectBrowser.js.map +1 -0
  58. package/{Components → build/Components}/Router.d.ts +1 -2
  59. package/{Components → build/Components}/Router.js +6 -7
  60. package/build/Components/Router.js.map +1 -0
  61. package/{Components → build/Components}/SaveCloseButtons.d.ts +2 -2
  62. package/build/Components/SaveCloseButtons.js +65 -0
  63. package/build/Components/SaveCloseButtons.js.map +1 -0
  64. package/{Components → build/Components}/Schedule.d.ts +3 -3
  65. package/{Components → build/Components}/Schedule.js +246 -261
  66. package/build/Components/Schedule.js.map +1 -0
  67. package/{Components → build/Components}/SelectWithIcon.d.ts +2 -2
  68. package/build/Components/SelectWithIcon.js +135 -0
  69. package/build/Components/SelectWithIcon.js.map +1 -0
  70. package/build/Components/SimpleCron/cronText.js +15 -0
  71. package/build/Components/SimpleCron/cronText.js.map +1 -0
  72. package/{Components → build/Components}/SimpleCron/index.d.ts +2 -2
  73. package/{Components → build/Components}/SimpleCron/index.js +55 -56
  74. package/build/Components/SimpleCron/index.js.map +1 -0
  75. package/{Components → build/Components}/TabContainer.d.ts +2 -2
  76. package/build/Components/TabContainer.js +23 -0
  77. package/build/Components/TabContainer.js.map +1 -0
  78. package/{Components → build/Components}/TabContent.d.ts +3 -2
  79. package/build/Components/TabContent.js +20 -0
  80. package/build/Components/TabContent.js.map +1 -0
  81. package/build/Components/TabHeader.d.ts +6 -0
  82. package/build/Components/TabHeader.js +6 -0
  83. package/build/Components/TabHeader.js.map +1 -0
  84. package/{Components → build/Components}/TableResize.d.ts +2 -2
  85. package/{src/Components/TableResize.tsx → build/Components/TableResize.js} +64 -134
  86. package/build/Components/TableResize.js.map +1 -0
  87. package/{Components → build/Components}/TextWithIcon.d.ts +2 -2
  88. package/{src/Components/TextWithIcon.tsx → build/Components/TextWithIcon.js} +30 -75
  89. package/build/Components/TextWithIcon.js.map +1 -0
  90. package/{Components → build/Components}/ToggleThemeMenu.d.ts +1 -1
  91. package/build/Components/ToggleThemeMenu.js +13 -0
  92. package/build/Components/ToggleThemeMenu.js.map +1 -0
  93. package/{Components → build/Components}/TreeTable.d.ts +3 -3
  94. package/{Components → build/Components}/TreeTable.js +87 -99
  95. package/build/Components/TreeTable.js.map +1 -0
  96. package/{Components → build/Components}/UploadImage.d.ts +2 -2
  97. package/{Components → build/Components}/UploadImage.js +46 -69
  98. package/build/Components/UploadImage.js.map +1 -0
  99. package/{Components → build/Components}/Utils.d.ts +2 -2
  100. package/{Components → build/Components}/Utils.js +47 -60
  101. package/build/Components/Utils.js.map +1 -0
  102. package/build/Components/withWidth.d.ts +2 -0
  103. package/build/Components/withWidth.js +22 -0
  104. package/build/Components/withWidth.js.map +1 -0
  105. package/build/Connection.d.ts +1 -0
  106. package/build/Connection.js +2 -0
  107. package/build/Connection.js.map +1 -0
  108. package/{Dialogs → build/Dialogs}/ComplexCron.d.ts +2 -2
  109. package/build/Dialogs/ComplexCron.js +85 -0
  110. package/build/Dialogs/ComplexCron.js.map +1 -0
  111. package/{Dialogs → build/Dialogs}/Confirm.d.ts +2 -2
  112. package/build/Dialogs/Confirm.js +83 -0
  113. package/build/Dialogs/Confirm.js.map +1 -0
  114. package/{Dialogs → build/Dialogs}/Cron.d.ts +2 -2
  115. package/build/Dialogs/Cron.js +72 -0
  116. package/build/Dialogs/Cron.js.map +1 -0
  117. package/{Dialogs → build/Dialogs}/Error.d.ts +2 -2
  118. package/build/Dialogs/Error.js +27 -0
  119. package/build/Dialogs/Error.js.map +1 -0
  120. package/{Dialogs → build/Dialogs}/Message.d.ts +2 -2
  121. package/build/Dialogs/Message.js +29 -0
  122. package/build/Dialogs/Message.js.map +1 -0
  123. package/{Dialogs → build/Dialogs}/SelectFile.d.ts +2 -2
  124. package/build/Dialogs/SelectFile.js +116 -0
  125. package/build/Dialogs/SelectFile.js.map +1 -0
  126. package/{Dialogs → build/Dialogs}/SelectID.d.ts +3 -3
  127. package/{Dialogs → build/Dialogs}/SelectID.js +28 -53
  128. package/build/Dialogs/SelectID.js.map +1 -0
  129. package/{Dialogs → build/Dialogs}/SimpleCron.d.ts +2 -2
  130. package/build/Dialogs/SimpleCron.js +46 -0
  131. package/build/Dialogs/SimpleCron.js.map +1 -0
  132. package/build/Dialogs/TextInput.d.ts +2 -0
  133. package/build/Dialogs/TextInput.js +31 -0
  134. package/build/Dialogs/TextInput.js.map +1 -0
  135. package/{GenericApp.d.ts → build/GenericApp.d.ts} +2 -3
  136. package/{GenericApp.js → build/GenericApp.js} +162 -176
  137. package/build/GenericApp.js.map +1 -0
  138. package/{LegacyConnection.d.ts → build/LegacyConnection.d.ts} +69 -4
  139. package/{LegacyConnection.js → build/LegacyConnection.js} +106 -99
  140. package/build/LegacyConnection.js.map +1 -0
  141. package/{Prompt.d.ts → build/Prompt.d.ts} +1 -1
  142. package/{Prompt.js → build/Prompt.js} +3 -4
  143. package/build/Prompt.js.map +1 -0
  144. package/build/Theme.d.ts +5 -0
  145. package/{Theme.js → build/Theme.js} +37 -32
  146. package/build/Theme.js.map +1 -0
  147. package/build/assets/devices/parseNames.d.ts +0 -0
  148. package/build/assets/devices/parseNames.js +35 -0
  149. package/build/assets/devices/parseNames.js.map +1 -0
  150. package/build/assets/rooms/parseNames.d.ts +0 -0
  151. package/build/assets/rooms/parseNames.js +35 -0
  152. package/build/assets/rooms/parseNames.js.map +1 -0
  153. package/build/dictionary.d.ts +1 -0
  154. package/build/dictionary.js +25 -0
  155. package/build/dictionary.js.map +1 -0
  156. package/build/i18n/de.json +449 -0
  157. package/build/i18n/en.json +449 -0
  158. package/build/i18n/es.json +449 -0
  159. package/build/i18n/fr.json +449 -0
  160. package/build/i18n/it.json +449 -0
  161. package/build/i18n/nl.json +449 -0
  162. package/build/i18n/pl.json +449 -0
  163. package/build/i18n/pt.json +449 -0
  164. package/build/i18n/ru.json +449 -0
  165. package/build/i18n/uk.json +449 -0
  166. package/build/i18n/zh-cn.json +449 -0
  167. package/{i18n.d.ts → build/i18n.d.ts} +2 -2
  168. package/{i18n.js → build/i18n.js} +9 -11
  169. package/build/i18n.js.map +1 -0
  170. package/build/icons/IconAdapter.d.ts +3 -0
  171. package/build/icons/IconAdapter.js +6 -0
  172. package/build/icons/IconAdapter.js.map +1 -0
  173. package/build/icons/IconAlias.d.ts +3 -0
  174. package/build/icons/IconAlias.js +6 -0
  175. package/build/icons/IconAlias.js.map +1 -0
  176. package/build/icons/IconChannel.d.ts +3 -0
  177. package/build/icons/IconChannel.js +9 -0
  178. package/build/icons/IconChannel.js.map +1 -0
  179. package/build/icons/IconClearFilter.d.ts +3 -0
  180. package/build/icons/IconClearFilter.js +7 -0
  181. package/build/icons/IconClearFilter.js.map +1 -0
  182. package/build/icons/IconClosed.d.ts +3 -0
  183. package/build/icons/IconClosed.js +6 -0
  184. package/build/icons/IconClosed.js.map +1 -0
  185. package/build/icons/IconCopy.d.ts +3 -0
  186. package/build/icons/IconCopy.js +5 -0
  187. package/build/icons/IconCopy.js.map +1 -0
  188. package/build/icons/IconDevice.d.ts +3 -0
  189. package/build/icons/IconDevice.js +15 -0
  190. package/build/icons/IconDevice.js.map +1 -0
  191. package/build/icons/IconDocument.d.ts +3 -0
  192. package/build/icons/IconDocument.js +6 -0
  193. package/build/icons/IconDocument.js.map +1 -0
  194. package/build/icons/IconDocumentReadOnly.d.ts +3 -0
  195. package/build/icons/IconDocumentReadOnly.js +7 -0
  196. package/build/icons/IconDocumentReadOnly.js.map +1 -0
  197. package/build/icons/IconExpert.d.ts +3 -0
  198. package/build/icons/IconExpert.js +6 -0
  199. package/build/icons/IconExpert.js.map +1 -0
  200. package/build/icons/IconFx.d.ts +3 -0
  201. package/build/icons/IconFx.js +5 -0
  202. package/build/icons/IconFx.js.map +1 -0
  203. package/build/icons/IconInstance.d.ts +3 -0
  204. package/build/icons/IconInstance.js +6 -0
  205. package/build/icons/IconInstance.js.map +1 -0
  206. package/build/icons/IconLogout.d.ts +3 -0
  207. package/build/icons/IconLogout.js +6 -0
  208. package/build/icons/IconLogout.js.map +1 -0
  209. package/build/icons/IconNoIcon.d.ts +3 -0
  210. package/build/icons/IconNoIcon.js +5 -0
  211. package/build/icons/IconNoIcon.js.map +1 -0
  212. package/build/icons/IconOpen.d.ts +3 -0
  213. package/build/icons/IconOpen.js +6 -0
  214. package/build/icons/IconOpen.js.map +1 -0
  215. package/{icons → build/icons}/IconProps.d.ts +1 -1
  216. package/build/icons/IconProps.js +2 -0
  217. package/build/icons/IconProps.js.map +1 -0
  218. package/build/icons/IconState.d.ts +3 -0
  219. package/build/icons/IconState.js +6 -0
  220. package/build/icons/IconState.js.map +1 -0
  221. package/build/index.d.ts +67 -0
  222. package/build/index.js +67 -0
  223. package/build/index.js.map +1 -0
  224. package/{types.d.ts → build/types.d.ts} +1 -1
  225. package/package.json +84 -47
  226. package/AdminConnection.d.ts +0 -2
  227. package/AdminConnection.js +0 -4
  228. package/Components/404.js +0 -101
  229. package/Components/CopyToClipboard.js +0 -163
  230. package/Components/CustomModal.js +0 -88
  231. package/Components/FileViewer.d.ts +0 -10
  232. package/Components/FileViewer.js +0 -305
  233. package/Components/Icon.js +0 -148
  234. package/Components/IconPicker.js +0 -98
  235. package/Components/Loaders/MV.js +0 -66
  236. package/Components/Loaders/Vendor.js +0 -77
  237. package/Components/Logo.js +0 -117
  238. package/Components/SaveCloseButtons.js +0 -69
  239. package/Components/SelectWithIcon.js +0 -168
  240. package/Components/SimpleCron/cronText.js +0 -19
  241. package/Components/TabContainer.js +0 -25
  242. package/Components/TabContent.js +0 -21
  243. package/Components/TabHeader.d.ts +0 -6
  244. package/Components/TabHeader.js +0 -11
  245. package/Components/TableResize.js +0 -226
  246. package/Components/TextWithIcon.js +0 -119
  247. package/Components/ToggleThemeMenu.js +0 -18
  248. package/Components/withWidth.d.ts +0 -3
  249. package/Components/withWidth.js +0 -27
  250. package/Connection.d.ts +0 -3
  251. package/Connection.js +0 -8
  252. package/Dialogs/ComplexCron.js +0 -90
  253. package/Dialogs/Confirm.js +0 -111
  254. package/Dialogs/Cron.js +0 -100
  255. package/Dialogs/Error.js +0 -55
  256. package/Dialogs/Message.js +0 -57
  257. package/Dialogs/SelectFile.js +0 -119
  258. package/Dialogs/SimpleCron.js +0 -51
  259. package/Dialogs/TextInput.d.ts +0 -3
  260. package/Dialogs/TextInput.js +0 -35
  261. package/Theme.d.ts +0 -6
  262. package/i18n/de.json +0 -449
  263. package/i18n/en.json +0 -449
  264. package/i18n/es.json +0 -449
  265. package/i18n/fr.json +0 -449
  266. package/i18n/it.json +0 -449
  267. package/i18n/nl.json +0 -449
  268. package/i18n/pl.json +0 -449
  269. package/i18n/pt.json +0 -449
  270. package/i18n/ru.json +0 -449
  271. package/i18n/uk.json +0 -449
  272. package/i18n/zh-cn.json +0 -449
  273. package/icons/IconAdapter.d.ts +0 -4
  274. package/icons/IconAdapter.js +0 -10
  275. package/icons/IconAlias.d.ts +0 -4
  276. package/icons/IconAlias.js +0 -10
  277. package/icons/IconChannel.d.ts +0 -4
  278. package/icons/IconChannel.js +0 -13
  279. package/icons/IconClearFilter.d.ts +0 -4
  280. package/icons/IconClearFilter.js +0 -11
  281. package/icons/IconClosed.d.ts +0 -4
  282. package/icons/IconClosed.js +0 -10
  283. package/icons/IconCopy.d.ts +0 -4
  284. package/icons/IconCopy.js +0 -9
  285. package/icons/IconDevice.d.ts +0 -4
  286. package/icons/IconDevice.js +0 -19
  287. package/icons/IconDocument.d.ts +0 -4
  288. package/icons/IconDocument.js +0 -10
  289. package/icons/IconDocumentReadOnly.d.ts +0 -4
  290. package/icons/IconDocumentReadOnly.js +0 -11
  291. package/icons/IconExpert.d.ts +0 -4
  292. package/icons/IconExpert.js +0 -10
  293. package/icons/IconFx.d.ts +0 -4
  294. package/icons/IconFx.js +0 -9
  295. package/icons/IconInstance.d.ts +0 -4
  296. package/icons/IconInstance.js +0 -10
  297. package/icons/IconLogout.d.ts +0 -4
  298. package/icons/IconLogout.js +0 -10
  299. package/icons/IconNoIcon.d.ts +0 -4
  300. package/icons/IconNoIcon.js +0 -9
  301. package/icons/IconOpen.d.ts +0 -4
  302. package/icons/IconOpen.js +0 -10
  303. package/icons/IconProps.js +0 -2
  304. package/icons/IconState.d.ts +0 -4
  305. package/icons/IconState.js +0 -10
  306. package/index.d.ts +0 -128
  307. package/index.js +0 -215
  308. package/src/AdminConnection.tsx +0 -3
  309. package/src/Components/ColorPicker.tsx +0 -343
  310. package/src/Components/ComplexCron.tsx +0 -561
  311. package/src/Components/CustomModal.tsx +0 -170
  312. package/src/Components/FileBrowser.tsx +0 -2550
  313. package/src/Components/FileViewer.tsx +0 -412
  314. package/src/Components/Icon.tsx +0 -238
  315. package/src/Components/IconPicker.tsx +0 -165
  316. package/src/Components/IconSelector.tsx +0 -2220
  317. package/src/Components/Image.tsx +0 -193
  318. package/src/Components/Loader.tsx +0 -328
  319. package/src/Components/Logo.tsx +0 -176
  320. package/src/Components/MDUtils.tsx +0 -104
  321. package/src/Components/ObjectBrowser.tsx +0 -8935
  322. package/src/Components/Router.tsx +0 -90
  323. package/src/Components/SaveCloseButtons.tsx +0 -117
  324. package/src/Components/Schedule.tsx +0 -1995
  325. package/src/Components/SelectWithIcon.tsx +0 -239
  326. package/src/Components/TabContainer.tsx +0 -57
  327. package/src/Components/TabContent.tsx +0 -38
  328. package/src/Components/TabHeader.tsx +0 -20
  329. package/src/Components/ToggleThemeMenu.tsx +0 -52
  330. package/src/Components/TreeTable.tsx +0 -1002
  331. package/src/Components/UploadImage.tsx +0 -643
  332. package/src/Components/Utils.tsx +0 -1802
  333. package/src/Components/loader.css +0 -231
  334. package/src/Components/withWidth.tsx +0 -32
  335. package/src/Connection.tsx +0 -5
  336. package/src/Dialogs/ComplexCron.tsx +0 -163
  337. package/src/Dialogs/Confirm.tsx +0 -185
  338. package/src/Dialogs/Cron.tsx +0 -192
  339. package/src/Dialogs/Error.tsx +0 -67
  340. package/src/Dialogs/Message.tsx +0 -73
  341. package/src/Dialogs/SelectFile.tsx +0 -280
  342. package/src/Dialogs/SelectID.tsx +0 -310
  343. package/src/Dialogs/SimpleCron.tsx +0 -101
  344. package/src/Dialogs/TextInput.tsx +0 -99
  345. package/src/GenericApp.tsx +0 -1076
  346. package/src/LegacyConnection.tsx +0 -3720
  347. package/src/Prompt.tsx +0 -22
  348. package/src/Theme.tsx +0 -472
  349. package/src/icons/IconAdapter.tsx +0 -22
  350. package/src/icons/IconAlias.tsx +0 -22
  351. package/src/icons/IconChannel.tsx +0 -60
  352. package/src/icons/IconClearFilter.tsx +0 -24
  353. package/src/icons/IconClosed.tsx +0 -22
  354. package/src/icons/IconCopy.tsx +0 -21
  355. package/src/icons/IconDevice.tsx +0 -126
  356. package/src/icons/IconDocument.tsx +0 -22
  357. package/src/icons/IconDocumentReadOnly.tsx +0 -27
  358. package/src/icons/IconExpert.tsx +0 -26
  359. package/src/icons/IconFx.tsx +0 -38
  360. package/src/icons/IconInstance.tsx +0 -22
  361. package/src/icons/IconLogout.tsx +0 -32
  362. package/src/icons/IconNoIcon.tsx +0 -21
  363. package/src/icons/IconOpen.tsx +0 -22
  364. package/src/icons/IconProps.tsx +0 -16
  365. package/src/icons/IconState.tsx +0 -38
  366. package/src/index.css +0 -56
  367. /package/{Components → build/Components}/404.d.ts +0 -0
  368. /package/{Components → build/Components}/SimpleCron/cronText.d.ts +0 -0
  369. /package/{assets → build/assets}/devices.json +0 -0
  370. /package/{assets → build/assets}/lamp_ceiling.svg +0 -0
  371. /package/{assets → build/assets}/lamp_table.svg +0 -0
  372. /package/{assets → build/assets}/no_icon.svg +0 -0
  373. /package/{assets → build/assets}/rooms.json +0 -0
  374. /package/{index.css → build/index.css} +0 -0
  375. /package/{tasks.js → tasksExample.js} +0 -0
@@ -1,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.
@@ -871,12 +835,15 @@ function binarySearch(list, find, _start, _end) {
871
835
  return false;
872
836
  }
873
837
  function getName(name, lang) {
874
- if (name && typeof name === 'object') {
838
+ if (typeof name === 'object') {
839
+ if (!name) {
840
+ return '';
841
+ }
875
842
  return (name[lang] || name.en || '').toString();
876
843
  }
877
- return (name || '').toString();
844
+ return name ? name.toString() : '';
878
845
  }
879
- function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
846
+ export function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
880
847
  // `admin` has prefix '.' and `web` has '../..'
881
848
  imagePrefix = imagePrefix || '.'; // http://localhost:8081';
882
849
  let src = '';
@@ -902,7 +869,7 @@ function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
902
869
  }
903
870
  }
904
871
  else if (aIcon.startsWith('data:image/svg')) {
905
- 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 }));
906
873
  }
907
874
  else {
908
875
  src = aIcon;
@@ -954,7 +921,7 @@ function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
954
921
  }
955
922
  else if (cIcon.startsWith('data:image/svg')) {
956
923
  // if base 64 image
957
- 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 }));
958
925
  }
959
926
  else {
960
927
  src = cIcon;
@@ -965,7 +932,6 @@ function getSelectIdIconFromObjects(objects, id, lang, imagePrefix) {
965
932
  return src || null;
966
933
  }
967
934
  function applyFilter(item, filters, lang, objects, context, counter, customFilter, selectedTypes, _depth) {
968
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
969
935
  _depth = _depth || 0;
970
936
  let filteredOut = false;
971
937
  if (!context) {
@@ -986,15 +952,15 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
986
952
  context.role = filters.role.toLowerCase();
987
953
  }
988
954
  if (filters.room) {
989
- 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 || [];
990
956
  }
991
957
  if (filters.func) {
992
- 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 || [];
993
959
  }
994
960
  }
995
961
  const data = item.data;
996
962
  if (data && data.id) {
997
- const common = (_f = data.obj) === null || _f === void 0 ? void 0 : _f.common;
963
+ const common = data.obj?.common;
998
964
  if (customFilter) {
999
965
  if (customFilter.type) {
1000
966
  if (typeof customFilter.type === 'string') {
@@ -1008,8 +974,8 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1008
974
  }
1009
975
  }
1010
976
  }
1011
- if (!filteredOut && ((_g = customFilter.common) === null || _g === void 0 ? void 0 : _g.type)) {
1012
- if (!(common === null || common === void 0 ? void 0 : common.type)) {
977
+ if (!filteredOut && customFilter.common?.type) {
978
+ if (!common?.type) {
1013
979
  filteredOut = true;
1014
980
  }
1015
981
  else if (typeof customFilter.common.type === 'string') {
@@ -1023,8 +989,8 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1023
989
  }
1024
990
  }
1025
991
  }
1026
- if (!filteredOut && ((_h = customFilter.common) === null || _h === void 0 ? void 0 : _h.role)) {
1027
- if (!(common === null || common === void 0 ? void 0 : common.role)) {
992
+ if (!filteredOut && customFilter.common?.role) {
993
+ if (!common?.role) {
1028
994
  filteredOut = true;
1029
995
  }
1030
996
  else if (typeof customFilter.common.role === 'string') {
@@ -1038,12 +1004,12 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1038
1004
  }
1039
1005
  }
1040
1006
  }
1041
- 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) {
1042
1008
  filteredOut = true;
1043
1009
  }
1044
- 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 !== '_') {
1045
1011
  const filterOfCustom = customFilter.common.custom;
1046
- if (!(common === null || common === void 0 ? void 0 : common.custom)) {
1012
+ if (!common?.custom) {
1047
1013
  filteredOut = true;
1048
1014
  }
1049
1015
  else if (filterOfCustom === '_dataSources') {
@@ -1074,7 +1040,7 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1074
1040
  data.id.startsWith('enum.') ||
1075
1041
  data.id.startsWith('_design/') ||
1076
1042
  data.id.endsWith('.admin') ||
1077
- !!(common === null || common === void 0 ? void 0 : common.expert);
1043
+ !!common?.expert;
1078
1044
  }
1079
1045
  if (!filteredOut && context.id) {
1080
1046
  if (data.fID === undefined) {
@@ -1150,14 +1116,13 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
1150
1116
  return data.visible || data.hasVisibleChildren;
1151
1117
  }
1152
1118
  function getVisibleItems(item, type, objects, _result) {
1153
- var _b;
1154
1119
  _result = _result || [];
1155
1120
  const data = item.data;
1156
1121
  if (data.sumVisibility) {
1157
1122
  if (data.id && objects[data.id] && (!type || objects[data.id].type === type)) {
1158
1123
  _result.push(data.id);
1159
1124
  }
1160
- (_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));
1161
1126
  }
1162
1127
  return _result;
1163
1128
  }
@@ -1165,34 +1130,34 @@ function getSystemIcon(objects, id, level, themeType, lang, imagePrefix) {
1165
1130
  let icon;
1166
1131
  // system or design has special icons
1167
1132
  if (id === 'alias' || id === 'alias.0') {
1168
- 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) } }));
1169
1134
  }
1170
1135
  else if (id === '0_userdata' || id === '0_userdata.0') {
1171
- 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) } }));
1172
1137
  }
1173
1138
  else if (id.startsWith('_design/') || id === 'system') {
1174
- 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) } }));
1175
1140
  }
1176
1141
  else if (id === 'system.adapter') {
1177
- 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) } }));
1178
1143
  }
1179
1144
  else if (id === 'system.group') {
1180
- icon = react_1.default.createElement(icons_material_1.SupervisedUserCircle, { className: "iconOwn" });
1145
+ icon = React.createElement(IconGroup, { className: "iconOwn" });
1181
1146
  }
1182
1147
  else if (id === 'system.user') {
1183
- icon = react_1.default.createElement(icons_material_1.PersonOutlined, { className: "iconOwn" });
1148
+ icon = React.createElement(IconUser, { className: "iconOwn" });
1184
1149
  }
1185
1150
  else if (id === 'system.host') {
1186
- icon = react_1.default.createElement(icons_material_1.Router, { className: "iconOwn" });
1151
+ icon = React.createElement(IconHost, { className: "iconOwn" });
1187
1152
  }
1188
1153
  else if (id.endsWith('.connection') || id.endsWith('.connected')) {
1189
- icon = react_1.default.createElement(icons_material_1.Wifi, { className: "iconOwn" });
1154
+ icon = React.createElement(IconConnection, { className: "iconOwn" });
1190
1155
  }
1191
1156
  else if (id.endsWith('.info')) {
1192
- icon = react_1.default.createElement(icons_material_1.Info, { className: "iconOwn" });
1157
+ icon = React.createElement(IconInfo, { className: "iconOwn" });
1193
1158
  }
1194
1159
  else if (objects[id] && objects[id].type === 'meta') {
1195
- icon = react_1.default.createElement(icons_material_1.Description, { className: "iconOwn" });
1160
+ icon = React.createElement(IconMeta, { className: "iconOwn" });
1196
1161
  }
1197
1162
  else if (level < 2) {
1198
1163
  // detect "cloud.0"
@@ -1203,21 +1168,19 @@ function getSystemIcon(objects, id, level, themeType, lang, imagePrefix) {
1203
1168
  return icon || null;
1204
1169
  }
1205
1170
  function getObjectTooltip(data, lang) {
1206
- var _b, _c;
1207
- 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) {
1208
1172
  return getName(data.obj.common.desc, lang) || null;
1209
1173
  }
1210
1174
  return null;
1211
1175
  }
1212
1176
  function getIdFieldTooltip(data, lang) {
1213
1177
  const tooltip = getObjectTooltip(data, lang);
1214
- if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.startsWith('http')) {
1215
- 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));
1216
1180
  }
1217
- return react_1.default.createElement("span", { style: styles.cellIdTooltip }, tooltip || data.id || '');
1181
+ return React.createElement("span", { style: styles.cellIdTooltip }, tooltip || data.id || '');
1218
1182
  }
1219
1183
  function buildTree(objects, options) {
1220
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
1221
1184
  const imagePrefix = options.imagePrefix || '.';
1222
1185
  let ids = Object.keys(objects);
1223
1186
  ids.sort((a, b) => {
@@ -1285,12 +1248,12 @@ function buildTree(objects, options) {
1285
1248
  else if (obj.type === 'enum') {
1286
1249
  info.enums.push(id);
1287
1250
  }
1288
- 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)) {
1289
1252
  info.hasSomeCustoms = true;
1290
1253
  info.customs.push(id.substring('system.adapter.'.length));
1291
1254
  }
1292
1255
  // Build a map of aliases
1293
- 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) {
1294
1257
  if (typeof obj.common.alias.id === 'string') {
1295
1258
  const usedId = obj.common.alias.id;
1296
1259
  if (!info.aliasesMap[usedId]) {
@@ -1361,24 +1324,24 @@ function buildTree(objects, options) {
1361
1324
  const _cRoot = {
1362
1325
  data: {
1363
1326
  name: parts[parts.length - 1],
1364
- 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),
1365
1328
  obj,
1366
1329
  parent: cRoot,
1367
1330
  icon: getSelectIdIconFromObjects(objects, id, options.lang, imagePrefix) ||
1368
1331
  getSystemIcon(objects, id, 0, options.themeType, options.lang, imagePrefix),
1369
1332
  id,
1370
- 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),
1371
1334
  level: parts.length - 1,
1372
1335
  generated: false,
1373
1336
  button: obj.type === 'state' &&
1374
- !!((_f = obj.common) === null || _f === void 0 ? void 0 : _f.role) &&
1337
+ !!obj.common?.role &&
1375
1338
  typeof obj.common.role === 'string' &&
1376
1339
  obj.common.role.startsWith('button') &&
1377
- ((_g = obj.common) === null || _g === void 0 ? void 0 : _g.write) !== false,
1340
+ obj.common?.write !== false,
1378
1341
  switch: obj.type === 'state' &&
1379
- ((_h = obj.common) === null || _h === void 0 ? void 0 : _h.type) === 'boolean' &&
1380
- ((_j = obj.common) === null || _j === void 0 ? void 0 : _j.write) !== false &&
1381
- ((_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,
1382
1345
  },
1383
1346
  };
1384
1347
  cRoot.children = cRoot.children || [];
@@ -1419,9 +1382,8 @@ function buildTree(objects, options) {
1419
1382
  } while (repeat);
1420
1383
  }
1421
1384
  info.roomEnums.sort((a, b) => {
1422
- var _b, _c, _d, _e;
1423
- 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();
1424
- 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();
1425
1387
  if (aName > bName) {
1426
1388
  return 1;
1427
1389
  }
@@ -1431,9 +1393,8 @@ function buildTree(objects, options) {
1431
1393
  return 0;
1432
1394
  });
1433
1395
  info.funcEnums.sort((a, b) => {
1434
- var _b, _c, _d, _e;
1435
- 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();
1436
- 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();
1437
1398
  if (aName > bName) {
1438
1399
  return 1;
1439
1400
  }
@@ -1478,18 +1439,17 @@ function findNode(root, id, _parts, _path, _level) {
1478
1439
  return null;
1479
1440
  }
1480
1441
  function findRoomsForObject(info, id, lang, rooms) {
1481
- var _b, _c;
1482
1442
  if (!id) {
1483
1443
  return { rooms: [], per: false };
1484
1444
  }
1485
1445
  rooms = rooms || [];
1486
1446
  for (const room of info.roomEnums) {
1487
- const common = (_b = info.objects[room]) === null || _b === void 0 ? void 0 : _b.common;
1447
+ const common = info.objects[room]?.common;
1488
1448
  if (!common) {
1489
1449
  continue;
1490
1450
  }
1491
1451
  const name = getName(common.name, lang);
1492
- 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)) {
1493
1453
  rooms.push(name);
1494
1454
  }
1495
1455
  }
@@ -1505,14 +1465,13 @@ function findRoomsForObject(info, id, lang, rooms) {
1505
1465
  return { rooms, per: !ownEnums }; // per is if the enums are from parent
1506
1466
  }
1507
1467
  function findEnumsForObjectAsIds(info, id, enumName, funcs) {
1508
- var _b, _c;
1509
1468
  if (!id) {
1510
1469
  return [];
1511
1470
  }
1512
1471
  funcs = funcs || [];
1513
1472
  for (let i = 0; i < info[enumName].length; i++) {
1514
- const common = (_b = info.objects[info[enumName][i]]) === null || _b === void 0 ? void 0 : _b.common;
1515
- 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])) {
1516
1475
  funcs.push(info[enumName][i]);
1517
1476
  }
1518
1477
  }
@@ -1520,18 +1479,17 @@ function findEnumsForObjectAsIds(info, id, enumName, funcs) {
1520
1479
  return funcs;
1521
1480
  }
1522
1481
  function findFunctionsForObject(info, id, lang, funcs) {
1523
- var _b, _c;
1524
1482
  if (!id) {
1525
1483
  return { funcs: [], pef: false };
1526
1484
  }
1527
1485
  funcs = funcs || [];
1528
1486
  for (let i = 0; i < info.funcEnums.length; i++) {
1529
- 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;
1530
1488
  if (!common) {
1531
1489
  continue;
1532
1490
  }
1533
1491
  const name = getName(common.name, lang);
1534
- 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)) {
1535
1493
  funcs.push(name);
1536
1494
  }
1537
1495
  }
@@ -1567,12 +1525,12 @@ function quality2text(q) {
1567
1525
  */
1568
1526
  function formatValue(options) {
1569
1527
  const { dateFormat, state, isFloatComma, texts, obj } = options;
1570
- const states = Utils_1.default.getStates(obj);
1528
+ const states = Utils.getStates(obj);
1571
1529
  const isCommon = obj.common;
1572
1530
  let fileViewer;
1573
1531
  let v =
1574
1532
  // @ts-expect-error deprecated from js-controller 6
1575
- (isCommon === null || isCommon === void 0 ? void 0 : isCommon.type) === 'file'
1533
+ isCommon?.type === 'file'
1576
1534
  ? '[file]'
1577
1535
  : !state || state.val === null
1578
1536
  ? '(null)'
@@ -1580,9 +1538,9 @@ function formatValue(options) {
1580
1538
  ? '[undef]'
1581
1539
  : state.val;
1582
1540
  const type = typeof v;
1583
- 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/)) {
1584
1542
  if (v && typeof v === 'string') {
1585
- if (Utils_1.default.isStringInteger(v)) {
1543
+ if (Utils.isStringInteger(v)) {
1586
1544
  // we assume a unix ts
1587
1545
  v = new Date(parseInt(v, 10)).toString();
1588
1546
  }
@@ -1590,11 +1548,11 @@ function formatValue(options) {
1590
1548
  // check if parsable by new date
1591
1549
  try {
1592
1550
  const parsedDate = new Date(v);
1593
- if (Utils_1.default.isValidDate(parsedDate)) {
1551
+ if (Utils.isValidDate(parsedDate)) {
1594
1552
  v = parsedDate.toString();
1595
1553
  }
1596
1554
  }
1597
- catch (_b) {
1555
+ catch {
1598
1556
  // ignore
1599
1557
  }
1600
1558
  }
@@ -1602,7 +1560,7 @@ function formatValue(options) {
1602
1560
  else {
1603
1561
  if (v > 946681200 && v < 946681200000) {
1604
1562
  // '2000-01-01T00:00:00' => 946681200000
1605
- v *= 1000; // maybe the time is in seconds (UNIX time)
1563
+ v *= 1_000; // maybe the time is in seconds (UNIX time)
1606
1564
  }
1607
1565
  // "null" and undefined could not be here. See `let v = (isCommon && isCommon.type === 'file') ....` above
1608
1566
  v = v ? new Date(v).toString() : v;
@@ -1611,7 +1569,7 @@ function formatValue(options) {
1611
1569
  else {
1612
1570
  if (type === 'number') {
1613
1571
  if (!Number.isInteger(v)) {
1614
- v = Math.round(v * 100000000) / 100000000; // remove 4.00000000000000001
1572
+ v = Math.round(v * 100_000_000) / 100_000_000; // remove 4.00000000000000001
1615
1573
  if (isFloatComma) {
1616
1574
  v = v.toString().replace('.', ',');
1617
1575
  }
@@ -1639,7 +1597,7 @@ function formatValue(options) {
1639
1597
  valText.v = v;
1640
1598
  }
1641
1599
  }
1642
- if (isCommon === null || isCommon === void 0 ? void 0 : isCommon.unit) {
1600
+ if (isCommon?.unit) {
1643
1601
  valText.u = isCommon.unit;
1644
1602
  }
1645
1603
  let valFull;
@@ -1650,10 +1608,10 @@ function formatValue(options) {
1650
1608
  valFull.push({ t: texts.ack, v: state.ack.toString() });
1651
1609
  }
1652
1610
  if (state.ts) {
1653
- 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) : '' });
1654
1612
  }
1655
1613
  if (state.lc) {
1656
- 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) : '' });
1657
1615
  }
1658
1616
  if (state.from) {
1659
1617
  let from = state.from.toString();
@@ -1672,7 +1630,7 @@ function formatValue(options) {
1672
1630
  if (state.c) {
1673
1631
  valFull.push({ t: texts.c, v: state.c });
1674
1632
  }
1675
- 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 });
1676
1634
  }
1677
1635
  }
1678
1636
  return {
@@ -1686,7 +1644,7 @@ function formatValue(options) {
1686
1644
  */
1687
1645
  function getValueStyle(options) {
1688
1646
  const { state /* , isExpertMode, isButton */ } = options;
1689
- const color = (state === null || state === void 0 ? void 0 : state.ack) ? (state.q ? '#ffa500' : '') : '#ff2222c9';
1647
+ const color = state?.ack ? (state.q ? '#ffa500' : '') : '#ff2222c9';
1690
1648
  // do not show the color of the button in non-expert mode
1691
1649
  // if (!isExpertMode && isButton) {
1692
1650
  // color = '';
@@ -1726,22 +1684,22 @@ function prepareSparkData(values, from) {
1726
1684
  }
1727
1685
  return v;
1728
1686
  }
1729
- exports.ITEM_IMAGES = {
1730
- state: (react_1.default.createElement(IconState_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1731
- channel: (react_1.default.createElement(IconChannel_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1732
- device: (react_1.default.createElement(IconDevice_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1733
- adapter: (react_1.default.createElement(IconAdapter_1.default, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1734
- meta: (react_1.default.createElement(icons_material_1.Description, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1735
- instance: (react_1.default.createElement(IconInstance_1.default, { className: "itemIcon", style: { color: '#7da7ff', verticalAlign: 'middle' } })),
1736
- enum: (react_1.default.createElement(icons_material_1.ListAlt, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1737
- chart: (react_1.default.createElement(icons_material_1.ShowChart, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1738
- config: (react_1.default.createElement(icons_material_1.Settings, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1739
- group: (react_1.default.createElement(icons_material_1.SupervisedUserCircle, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1740
- user: (react_1.default.createElement(icons_material_1.PersonOutlined, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1741
- host: (react_1.default.createElement(icons_material_1.Router, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1742
- schedule: (react_1.default.createElement(icons_material_1.CalendarToday, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1743
- script: (react_1.default.createElement(icons_material_1.Code, { className: "itemIcon", style: { verticalAlign: 'middle' } })),
1744
- 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' } })),
1745
1703
  };
1746
1704
  const SCREEN_WIDTHS = {
1747
1705
  // extra-small: 0px
@@ -1833,445 +1791,73 @@ const DEFAULT_FILTER = {
1833
1791
  custom: '',
1834
1792
  expertMode: false,
1835
1793
  };
1836
- 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.'];
1837
1859
  constructor(props) {
1838
1860
  super(props);
1839
- // do not define the type as null to save the performance, so we must check it every time
1840
- this.info = {
1841
- funcEnums: [],
1842
- roomEnums: [],
1843
- roles: [],
1844
- ids: [],
1845
- types: [],
1846
- objects: {},
1847
- customs: [],
1848
- enums: [],
1849
- hasSomeCustoms: false,
1850
- aliasesMap: {},
1851
- };
1852
- this.localStorage = window._localStorage || window.localStorage;
1853
- this.lastAppliedFilter = null;
1854
- this.pausedSubscribes = false;
1855
- this.root = null;
1856
- this.states = {};
1857
- this.subscribes = [];
1858
- this.unsubscribeTimer = null;
1859
- this.statesUpdateTimer = null;
1860
- this.objectsUpdateTimer = null;
1861
- this.filterTimer = null;
1862
- this.adapterColumns = [];
1863
- this.styleTheme = '';
1864
- this.edit = {
1865
- id: '',
1866
- val: '',
1867
- q: 0,
1868
- ack: false,
1869
- };
1870
- this.customWidth = false;
1871
- this.resizeTimeout = null;
1872
- this.resizerNextName = null;
1873
- this.resizerActiveName = null;
1874
- this.resizerCurrentWidths = {};
1875
- this.resizeLeft = false;
1876
- this.resizerOldWidth = 0;
1877
- this.resizerMin = 0;
1878
- this.resizerNextMin = 0;
1879
- this.resizerOldWidthNext = 0;
1880
- this.resizerPosition = 0;
1881
- this.resizerActiveDiv = null;
1882
- this.resizerNextDiv = null;
1883
- this.storedWidths = null;
1884
- this.defaultHistory = '';
1885
- this.columnsVisibility = {};
1886
- this.changedIds = null;
1887
- this.contextMenu = null;
1888
- this.recordStates = [];
1889
- this.styles = {};
1890
- this.customColumnDialog = null;
1891
- /**
1892
- * Context menu handler.
1893
- */
1894
- this.onContextMenu = (e) => {
1895
- // console.log(`CONTEXT MENU: ${this.contextMenu ? Date.now() - this.contextMenu.ts : 'false'}`);
1896
- if (this.contextMenu && Date.now() - this.contextMenu.ts < 2000) {
1897
- e.preventDefault();
1898
- this.setState({
1899
- showContextMenu: {
1900
- item: this.contextMenu.item,
1901
- position: { left: e.clientX + 2, top: e.clientY - 6 },
1902
- },
1903
- });
1904
- }
1905
- else if (this.state.showContextMenu) {
1906
- e.preventDefault();
1907
- this.setState({ showContextMenu: null });
1908
- }
1909
- this.contextMenu = null;
1910
- };
1911
- /**
1912
- * Called when a state changes.
1913
- */
1914
- this.onStateChange = (id, state) => {
1915
- console.log(`> stateChange ${id}`);
1916
- if (this.states[id]) {
1917
- const item = this.findItem(id);
1918
- if (item === null || item === void 0 ? void 0 : item.data.state) {
1919
- item.data.state = undefined;
1920
- }
1921
- }
1922
- if (state) {
1923
- this.states[id] = state;
1924
- }
1925
- else {
1926
- delete this.states[id];
1927
- }
1928
- if (!this.pausedSubscribes) {
1929
- if (!this.statesUpdateTimer) {
1930
- this.statesUpdateTimer = setTimeout(() => {
1931
- this.statesUpdateTimer = null;
1932
- this.forceUpdate();
1933
- }, 300);
1934
- }
1935
- }
1936
- else if (this.statesUpdateTimer) {
1937
- clearTimeout(this.statesUpdateTimer);
1938
- this.statesUpdateTimer = null;
1939
- }
1940
- };
1941
- this.onObjectChangeFromWorker = (events) => {
1942
- if (Array.isArray(events)) {
1943
- let newState = null;
1944
- events.forEach(event => {
1945
- const { newInnerState, filtered } = this.processOnObjectChangeElement(event.id, event.obj);
1946
- if (filtered) {
1947
- return;
1948
- }
1949
- if (newInnerState && newState) {
1950
- Object.assign(newState, newInnerState);
1951
- }
1952
- else {
1953
- newState = newInnerState;
1954
- }
1955
- });
1956
- if (newState) {
1957
- this.setState(newState);
1958
- }
1959
- this.afterObjectUpdated();
1960
- }
1961
- };
1962
- this.onObjectChange = (id, obj) => {
1963
- const { newInnerState, filtered } = this.processOnObjectChangeElement(id, obj);
1964
- if (filtered) {
1965
- return;
1966
- }
1967
- if (newInnerState) {
1968
- this.setState(newInnerState);
1969
- }
1970
- this.afterObjectUpdated();
1971
- };
1972
- this.getEnumsForId = (id) => {
1973
- const result = [];
1974
- this.info.enums.forEach(_id => {
1975
- var _b, _c, _d;
1976
- 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)) {
1977
- const enumItem = {
1978
- _id: this.objects[_id]._id,
1979
- common: JSON.parse(JSON.stringify(this.objects[_id].common)),
1980
- native: this.objects[_id].native,
1981
- type: 'enum',
1982
- };
1983
- if (enumItem.common) {
1984
- delete enumItem.common.members;
1985
- delete enumItem.common.custom;
1986
- // @ts-expect-error deprecated attribute
1987
- delete enumItem.common.mobile;
1988
- }
1989
- result.push(enumItem);
1990
- }
1991
- });
1992
- return result.length ? result : undefined;
1993
- };
1994
- this._createAllEnums = async (enums, objId) => {
1995
- var _b, _c;
1996
- for (let e = 0; e < enums.length; e++) {
1997
- const item = enums[e];
1998
- let id;
1999
- let newObj;
2000
- // some admin version delivered enums as string
2001
- if (typeof item === 'object') {
2002
- newObj = item;
2003
- id = newObj._id;
2004
- }
2005
- else {
2006
- id = item;
2007
- }
2008
- let oldObj = this.objects[id];
2009
- // if enum does not exist
2010
- if (!oldObj) {
2011
- // create a new one
2012
- oldObj =
2013
- newObj ||
2014
- {
2015
- _id: id,
2016
- common: {
2017
- name: id.split('.').pop(),
2018
- members: [],
2019
- },
2020
- native: {},
2021
- type: 'enum',
2022
- };
2023
- oldObj.common = oldObj.common || {};
2024
- oldObj.common.members = [objId];
2025
- oldObj.type = 'enum';
2026
- await this.props.socket.setObject(id, oldObj);
2027
- }
2028
- else if (!((_c = (_b = oldObj.common) === null || _b === void 0 ? void 0 : _b.members) === null || _c === void 0 ? void 0 : _c.includes(objId))) {
2029
- oldObj.common = oldObj.common || {};
2030
- oldObj.type = 'enum';
2031
- oldObj.common.members = oldObj.common.members || [];
2032
- // add the missing object
2033
- oldObj.common.members.push(objId);
2034
- oldObj.common.members.sort();
2035
- await this.props.socket.setObject(id, oldObj);
2036
- }
2037
- }
2038
- };
2039
- this.toolTipObjectCreating = () => {
2040
- var _b, _c;
2041
- const { t } = this.props;
2042
- let value = [
2043
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2044
- react_1.default.createElement("div", { key: 2 }, t('ra_Folder → State')),
2045
- react_1.default.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
2046
- react_1.default.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
2047
- react_1.default.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
2048
- react_1.default.createElement("div", { key: 6 }, t('ra_Channel → State')),
2049
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2050
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2051
- 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").')),
2052
- ];
2053
- if (this.state.selected.length || this.state.selectedNonObject) {
2054
- const id = this.state.selected[0] || this.state.selectedNonObject;
2055
- if (id.split('.').length < 2 || (this.objects[id] && ((_b = this.objects[id]) === null || _b === void 0 ? void 0 : _b.type) === 'state')) {
2056
- // show default tooltip
2057
- }
2058
- else if (this.state.filter.expertMode) {
2059
- switch ((_c = this.objects[id]) === null || _c === void 0 ? void 0 : _c.type) {
2060
- case 'device':
2061
- value = [
2062
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2063
- react_1.default.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
2064
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2065
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2066
- 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").')),
2067
- ];
2068
- break;
2069
- case 'folder':
2070
- value = [
2071
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2072
- react_1.default.createElement("div", { key: 2 }, t('ra_Folder → State')),
2073
- react_1.default.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
2074
- react_1.default.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
2075
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2076
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2077
- 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").')),
2078
- ];
2079
- break;
2080
- case 'channel':
2081
- value = [
2082
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2083
- react_1.default.createElement("div", { key: 1 }, t('ra_Channel → State')),
2084
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2085
- react_1.default.createElement("div", { key: 8 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2086
- 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").')),
2087
- ];
2088
- break;
2089
- default:
2090
- break;
2091
- }
2092
- }
2093
- else if (id.startsWith('alias.0') || id.startsWith('0_userdata')) {
2094
- value = [
2095
- react_1.default.createElement("div", { key: 1 }, t('ra_Only following structures of objects are available:')),
2096
- react_1.default.createElement("div", { key: 2 }, t('ra_Folder → State')),
2097
- react_1.default.createElement("div", { key: 3 }, t('ra_Folder → Channel → State')),
2098
- react_1.default.createElement("div", { key: 4 }, t('ra_Folder → Device → Channel → State')),
2099
- react_1.default.createElement("div", { key: 5 }, t('ra_Device → Channel → State')),
2100
- react_1.default.createElement("div", { key: 6 }, t('ra_Channel → State')),
2101
- react_1.default.createElement("div", { key: 7, style: { height: 10 } }),
2102
- react_1.default.createElement("div", { key: 7 }, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')),
2103
- 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").')),
2104
- ];
2105
- }
2106
- }
2107
- return value.length ? value : t('ra_Add new child object to selected parent');
2108
- };
2109
- this.renderTooltipAccessControl = (acl) => {
2110
- // acl ={object,state,owner,ownerGroup}
2111
- if (!acl) {
2112
- return null;
2113
- }
2114
- const check = [
2115
- {
2116
- value: '0x400',
2117
- valueNum: 0x400,
2118
- title: 'read',
2119
- group: 'Owner',
2120
- },
2121
- {
2122
- value: '0x200',
2123
- valueNum: 0x200,
2124
- title: 'write',
2125
- group: 'Owner',
2126
- },
2127
- {
2128
- value: '0x40',
2129
- valueNum: 0x40,
2130
- title: 'read',
2131
- group: 'Group',
2132
- },
2133
- {
2134
- value: '0x20',
2135
- valueNum: 0x20,
2136
- title: 'write',
2137
- group: 'Group',
2138
- },
2139
- {
2140
- value: '0x4',
2141
- valueNum: 0x4,
2142
- title: 'read',
2143
- group: 'Everyone',
2144
- },
2145
- {
2146
- value: '0x2',
2147
- valueNum: 0x2,
2148
- title: 'write',
2149
- group: 'Everyone',
2150
- },
2151
- ];
2152
- const arrayTooltipText = [];
2153
- const funcRenderStateObject = (value) => {
2154
- const rights = acl[value];
2155
- check.forEach((el, i) => {
2156
- if (rights & el.valueNum) {
2157
- arrayTooltipText.push(react_1.default.createElement("span", { key: value + i },
2158
- this.texts[`acl${el.group}_${el.title}_${value}`],
2159
- ",",
2160
- react_1.default.createElement("span", { style: value === 'object' ? styles.rightsObject : styles.rightsState }, el.value)));
2161
- }
2162
- });
2163
- };
2164
- arrayTooltipText.push(react_1.default.createElement("span", { key: "group" }, `${this.texts.ownerGroup}: ${(acl.ownerGroup || '').replace('system.group.', '')}`));
2165
- arrayTooltipText.push(react_1.default.createElement("span", { key: "owner" }, `${this.texts.ownerUser}: ${(acl.owner || '').replace('system.user.', '')}`));
2166
- funcRenderStateObject('object');
2167
- if (acl.state) {
2168
- funcRenderStateObject('state');
2169
- }
2170
- return arrayTooltipText.length ? (react_1.default.createElement("span", { style: styles.tooltipAccessControl }, arrayTooltipText.map(el => el))) : null;
2171
- };
2172
- this.resizerMouseMove = (e) => {
2173
- if (this.resizerActiveDiv) {
2174
- let width;
2175
- let widthNext;
2176
- if (this.resizeLeft) {
2177
- width = this.resizerOldWidth - e.clientX + this.resizerPosition;
2178
- widthNext = this.resizerOldWidthNext + e.clientX - this.resizerPosition;
2179
- }
2180
- else {
2181
- width = this.resizerOldWidth + e.clientX - this.resizerPosition;
2182
- widthNext = this.resizerOldWidthNext - e.clientX + this.resizerPosition;
2183
- }
2184
- if (this.resizerActiveName &&
2185
- this.resizerNextName &&
2186
- (!this.resizerMin || width > this.resizerMin) &&
2187
- (!this.resizerNextMin || widthNext > this.resizerNextMin)) {
2188
- this.resizerCurrentWidths[this.resizerActiveName] = width;
2189
- this.resizerCurrentWidths[this.resizerNextName] = widthNext;
2190
- this.resizerActiveDiv.style.width = `${width}px`;
2191
- if (this.resizerNextDiv) {
2192
- this.resizerNextDiv.style.width = `${widthNext}px`;
2193
- }
2194
- this.columnsVisibility[this.resizerActiveName] = width;
2195
- this.columnsVisibility[this.resizerNextName] = widthNext;
2196
- if (this.resizerNextName === 'nameHeader') {
2197
- this.columnsVisibility.name = widthNext - this.state.scrollBarWidth;
2198
- this.resizerCurrentWidths.name = widthNext - this.state.scrollBarWidth;
2199
- }
2200
- else if (this.resizerActiveName === 'nameHeader') {
2201
- this.columnsVisibility.name = width - this.state.scrollBarWidth;
2202
- this.resizerCurrentWidths.name = width - this.state.scrollBarWidth;
2203
- }
2204
- this.customWidth = true;
2205
- if (this.resizeTimeout) {
2206
- clearTimeout(this.resizeTimeout);
2207
- }
2208
- this.resizeTimeout = setTimeout(() => {
2209
- this.resizeTimeout = null;
2210
- this.forceUpdate();
2211
- }, 200);
2212
- }
2213
- }
2214
- };
2215
- this.resizerMouseUp = () => {
2216
- this.localStorage.setItem(`${this.props.dialogName || 'App'}.table`, JSON.stringify(this.resizerCurrentWidths));
2217
- this.resizerActiveName = null;
2218
- this.resizerNextName = null;
2219
- this.resizerActiveDiv = null;
2220
- this.resizerNextDiv = null;
2221
- window.removeEventListener('mousemove', this.resizerMouseMove);
2222
- window.removeEventListener('mouseup', this.resizerMouseUp);
2223
- };
2224
- this.resizerMouseDown = (e) => {
2225
- this.storedWidths =
2226
- this.storedWidths ||
2227
- JSON.parse(JSON.stringify(SCREEN_WIDTHS[this.props.width || 'lg']));
2228
- this.resizerCurrentWidths = this.resizerCurrentWidths || {};
2229
- this.resizerActiveDiv = e.target.parentNode;
2230
- this.resizerActiveName = this.resizerActiveDiv.dataset.name || null;
2231
- if (this.resizerActiveName) {
2232
- let i = 0;
2233
- if (e.target.dataset.left === 'true') {
2234
- this.resizeLeft = true;
2235
- this.resizerNextDiv = this.resizerActiveDiv.previousElementSibling;
2236
- let handle = this.resizerNextDiv.querySelector('.iob-ob-resize-handler');
2237
- while (this.resizerNextDiv && !handle && i < 10) {
2238
- this.resizerNextDiv = this.resizerNextDiv.previousElementSibling;
2239
- handle = this.resizerNextDiv.querySelector('.iob-ob-resize-handler');
2240
- i++;
2241
- }
2242
- if ((handle === null || handle === void 0 ? void 0 : handle.dataset.left) !== 'true') {
2243
- this.resizerNextDiv = this.resizerNextDiv.nextElementSibling;
2244
- }
2245
- }
2246
- else {
2247
- this.resizeLeft = false;
2248
- this.resizerNextDiv = this.resizerActiveDiv.nextElementSibling;
2249
- /* while (this.resizerNextDiv && !this.resizerNextDiv.querySelector('.iob-ob-resize-handler') && i < 10) {
2250
- this.resizerNextDiv = this.resizerNextDiv.nextElementSibling;
2251
- i++;
2252
- } */
2253
- }
2254
- this.resizerNextName = this.resizerNextDiv.dataset.name || null;
2255
- this.resizerMin = parseInt(this.resizerActiveDiv.dataset.min, 10) || 0;
2256
- this.resizerNextMin = parseInt(this.resizerNextDiv.dataset.min, 10) || 0;
2257
- this.resizerPosition = e.clientX;
2258
- this.resizerCurrentWidths[this.resizerActiveName] = this.resizerActiveDiv.offsetWidth;
2259
- this.resizerOldWidth = this.resizerCurrentWidths[this.resizerActiveName];
2260
- if (this.resizerNextName) {
2261
- this.resizerCurrentWidths[this.resizerNextName] = this.resizerNextDiv.offsetWidth;
2262
- this.resizerOldWidthNext = this.resizerCurrentWidths[this.resizerNextName];
2263
- }
2264
- window.addEventListener('mousemove', this.resizerMouseMove);
2265
- window.addEventListener('mouseup', this.resizerMouseUp);
2266
- }
2267
- };
2268
- this.resizerReset = () => {
2269
- this.customWidth = false;
2270
- SCREEN_WIDTHS[this.props.width || 'lg'] = JSON.parse(JSON.stringify(this.storedWidths));
2271
- this.calculateColumnsVisibility();
2272
- this.localStorage.removeItem(`${this.props.dialogName || 'App'}.table`);
2273
- this.forceUpdate();
2274
- };
2275
1861
  const lastSelectedItemStr = this.localStorage.getItem(`${props.dialogName || 'App'}.objectSelected`) || '';
2276
1862
  this.selectFirst = '';
2277
1863
  if (lastSelectedItemStr.startsWith('[')) {
@@ -2279,7 +1865,7 @@ class ObjectBrowserClass extends react_1.Component {
2279
1865
  const lastSelectedItems = JSON.parse(lastSelectedItemStr);
2280
1866
  this.selectFirst = lastSelectedItems[0] || '';
2281
1867
  }
2282
- catch (_b) {
1868
+ catch {
2283
1869
  // ignore
2284
1870
  }
2285
1871
  }
@@ -2291,7 +1877,7 @@ class ObjectBrowserClass extends react_1.Component {
2291
1877
  try {
2292
1878
  expanded = JSON.parse(expandedStr);
2293
1879
  }
2294
- catch (_c) {
1880
+ catch {
2295
1881
  expanded = [];
2296
1882
  }
2297
1883
  let filter;
@@ -2302,24 +1888,24 @@ class ObjectBrowserClass extends react_1.Component {
2302
1888
  try {
2303
1889
  filter = JSON.parse(filterStr);
2304
1890
  }
2305
- catch (_d) {
2306
- filter = Object.assign({}, DEFAULT_FILTER);
1891
+ catch {
1892
+ filter = { ...DEFAULT_FILTER };
2307
1893
  }
2308
1894
  }
2309
1895
  else if (props.defaultFilters && typeof props.defaultFilters === 'object') {
2310
- filter = Object.assign({}, props.defaultFilters);
1896
+ filter = { ...props.defaultFilters };
2311
1897
  }
2312
1898
  else {
2313
- filter = Object.assign({}, DEFAULT_FILTER);
1899
+ filter = { ...DEFAULT_FILTER };
2314
1900
  }
2315
1901
  filter.expertMode =
2316
1902
  props.expertMode !== undefined
2317
1903
  ? props.expertMode
2318
1904
  : (window._sessionStorage || window.sessionStorage).getItem('App.expertMode') ===
2319
1905
  'true';
2320
- this.tableRef = (0, react_1.createRef)();
1906
+ this.tableRef = createRef();
2321
1907
  this.filterRefs = {};
2322
- Object.keys(DEFAULT_FILTER).forEach(name => (this.filterRefs[name] = (0, react_1.createRef)()));
1908
+ Object.keys(DEFAULT_FILTER).forEach(name => (this.filterRefs[name] = createRef()));
2323
1909
  this.visibleCols = props.columns || SCREEN_WIDTHS[props.width || 'lg'].fields;
2324
1910
  // remove type column if only one type must be selected
2325
1911
  if (props.types && props.types.length === 1) {
@@ -2351,14 +1937,14 @@ class ObjectBrowserClass extends react_1.Component {
2351
1937
  try {
2352
1938
  columns = columnsStr ? JSON.parse(columnsStr) : null;
2353
1939
  }
2354
- catch (_e) {
1940
+ catch {
2355
1941
  columns = null;
2356
1942
  }
2357
1943
  let columnsWidths = null; // this.localStorage.getItem(`${props.dialogName || 'App'}.columnsWidths`);
2358
1944
  try {
2359
1945
  columnsWidths = columnsWidths ? JSON.parse(columnsWidths) : {};
2360
1946
  }
2361
- catch (_f) {
1947
+ catch {
2362
1948
  columnsWidths = {};
2363
1949
  }
2364
1950
  this.imagePrefix = props.imagePrefix || '.';
@@ -2379,7 +1965,7 @@ class ObjectBrowserClass extends react_1.Component {
2379
1965
  ? JSON.parse(this.localStorage.getItem(`${props.dialogName || 'App'}.objectStatesView`) || '') || false
2380
1966
  : false;
2381
1967
  }
2382
- catch (_g) {
1968
+ catch {
2383
1969
  // ignore
2384
1970
  }
2385
1971
  this.state = {
@@ -2499,7 +2085,7 @@ class ObjectBrowserClass extends react_1.Component {
2499
2085
  });
2500
2086
  this.customWidth = true;
2501
2087
  }
2502
- catch (_h) {
2088
+ catch {
2503
2089
  // ignore
2504
2090
  }
2505
2091
  }
@@ -2514,7 +2100,7 @@ class ObjectBrowserClass extends react_1.Component {
2514
2100
  const objects = (this.props.objectsWorker
2515
2101
  ? await this.props.objectsWorker.getObjects(update)
2516
2102
  : await props.socket.getObjects(update, true)) || {};
2517
- if (props.types && Connection_1.default.isWeb()) {
2103
+ if (props.types && Connection.isWeb()) {
2518
2104
  for (let i = 0; i < props.types.length; i++) {
2519
2105
  // admin has ALL objects
2520
2106
  // web has only state, channel, device, enum, and system.config
@@ -2530,7 +2116,7 @@ class ObjectBrowserClass extends react_1.Component {
2530
2116
  }
2531
2117
  this.systemConfig =
2532
2118
  this.systemConfig ||
2533
- (objects === null || objects === void 0 ? void 0 : objects['system.config']) ||
2119
+ objects?.['system.config'] ||
2534
2120
  (await props.socket.getObject('system.config'));
2535
2121
  this.systemConfig.common = this.systemConfig.common || {};
2536
2122
  this.systemConfig.common.defaultNewAcl = this.systemConfig.common.defaultNewAcl || {
@@ -2631,7 +2217,7 @@ class ObjectBrowserClass extends react_1.Component {
2631
2217
  if (node &&
2632
2218
  !applyFilter(node, this.state.filter, this.props.lang, this.objects, undefined, undefined, props.customFilter, props.types)) {
2633
2219
  // reset filter
2634
- this.setState({ filter: Object.assign({}, DEFAULT_FILTER), columnsForAdmin }, () => {
2220
+ this.setState({ filter: { ...DEFAULT_FILTER }, columnsForAdmin }, () => {
2635
2221
  this.setState({ loaded: true, updating: false }, () => this.expandAllSelected(() => this.onAfterSelect()));
2636
2222
  });
2637
2223
  }
@@ -2649,7 +2235,7 @@ class ObjectBrowserClass extends react_1.Component {
2649
2235
  static isNonExpertId(
2650
2236
  /** id to test */
2651
2237
  id) {
2652
- 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));
2653
2239
  }
2654
2240
  expandAllSelected(cb) {
2655
2241
  const expanded = [...this.state.expanded];
@@ -2678,15 +2264,14 @@ class ObjectBrowserClass extends react_1.Component {
2678
2264
  * @param isDouble is double click
2679
2265
  */
2680
2266
  onAfterSelect(isDouble) {
2681
- var _b;
2682
- 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]) {
2683
2268
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, this.state.selected[0]);
2684
2269
  // remove a task to select the pre-selected item if now we want to see another object
2685
2270
  if (this.selectFirst && this.selectFirst !== this.state.selected[0]) {
2686
2271
  this.selectFirst = '';
2687
2272
  }
2688
2273
  if (this.state.selected.length === 1 && this.objects[this.state.selected[0]]) {
2689
- 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, {
2690
2275
  language: this.props.lang,
2691
2276
  });
2692
2277
  if (this.props.onSelect) {
@@ -2709,7 +2294,7 @@ class ObjectBrowserClass extends react_1.Component {
2709
2294
  let changed = false;
2710
2295
  if (props.expertMode !== undefined && props.expertMode !== state.filter.expertMode) {
2711
2296
  changed = true;
2712
- newState.filter = Object.assign({}, state.filter);
2297
+ newState.filter = { ...state.filter };
2713
2298
  newState.filter.expertMode = props.expertMode;
2714
2299
  }
2715
2300
  return changed ? newState : null;
@@ -2757,7 +2342,6 @@ class ObjectBrowserClass extends react_1.Component {
2757
2342
  * Show the deletion dialog for a given object
2758
2343
  */
2759
2344
  showDeleteDialog(options) {
2760
- var _b, _c;
2761
2345
  const { id, obj, item } = options;
2762
2346
  // calculate the number of children
2763
2347
  const keys = Object.keys(this.objects);
@@ -2773,9 +2357,29 @@ class ObjectBrowserClass extends react_1.Component {
2773
2357
  }
2774
2358
  }
2775
2359
  if (this.props.onObjectDelete) {
2776
- 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);
2777
2361
  }
2778
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
+ };
2779
2383
  /**
2780
2384
  * Called when component is mounted.
2781
2385
  */
@@ -2794,12 +2398,12 @@ class ObjectBrowserClass extends react_1.Component {
2794
2398
  * Renders the error dialog.
2795
2399
  */
2796
2400
  renderErrorDialog() {
2797
- 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" },
2798
- react_1.default.createElement(material_1.DialogTitle, { id: "alert-dialog-title" }, this.props.t('ra_Error')),
2799
- react_1.default.createElement(material_1.DialogContent, null,
2800
- react_1.default.createElement(material_1.DialogContentText, { id: "alert-dialog-description" }, this.state.error)),
2801
- react_1.default.createElement(material_1.DialogActions, null,
2802
- 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;
2803
2407
  }
2804
2408
  /**
2805
2409
  * Show the error dialog.
@@ -2875,30 +2479,27 @@ class ObjectBrowserClass extends react_1.Component {
2875
2479
  }
2876
2480
  return cols
2877
2481
  .filter(id => (isLast && (id === 'val' || id === 'buttons')) || (!isLast && id !== 'val' && id !== 'buttons'))
2878
- .map(id => {
2879
- var _b;
2880
- return (react_1.default.createElement(material_1.ListItemButton, { onClick: () => {
2881
- if (!this.state.columnsAuto && id !== 'id') {
2882
- const columns = [...(this.state.columns || [])];
2883
- const pos = columns.indexOf(id);
2884
- if (pos === -1) {
2885
- columns.push(id);
2886
- columns.sort();
2887
- }
2888
- else {
2889
- columns.splice(pos, 1);
2890
- }
2891
- this.localStorage.setItem(`${this.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
2892
- this.calculateColumnsVisibility(null, columns);
2893
- 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();
2894
2489
  }
2895
- }, key: id },
2896
- react_1.default.createElement(material_1.Checkbox, { edge: "start", disabled: id === 'id' || this.state.columnsAuto, checked: id === 'id' ||
2897
- !!(this.state.columnsAuto
2898
- ? this.visibleCols.includes(id)
2899
- : (_b = this.state.columns) === null || _b === void 0 ? void 0 : _b.includes(id)), disableRipple: true }),
2900
- react_1.default.createElement(material_1.ListItemText, { primary: this.texts[`filter_${id}`] || this.props.t(`ra_${id}`) })));
2901
- });
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}`) }))));
2902
2503
  }
2903
2504
  /**
2904
2505
  * Renders the columns' selector.
@@ -2907,20 +2508,20 @@ class ObjectBrowserClass extends react_1.Component {
2907
2508
  if (!this.state.columnsSelectorShow) {
2908
2509
  return null;
2909
2510
  }
2910
- return (react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsSelectorShow: false }), open: !0, sx: {
2911
- '& .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}`]),
2912
2513
  } },
2913
- react_1.default.createElement(material_1.DialogTitle, { sx: styles.fontSizeTitle }, this.props.t('ra_Configure')),
2914
- react_1.default.createElement(material_1.DialogContent, { sx: styles.fontSizeTitle },
2915
- 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: () => {
2916
2517
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.foldersFirst`, this.state.foldersFirst ? 'false' : 'true');
2917
2518
  this.setState({ foldersFirst: !this.state.foldersFirst });
2918
2519
  } }), label: this.props.t('ra_Folders always first') }),
2919
- 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: () => {
2920
2521
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.lines`, this.state.linesEnabled ? 'false' : 'true');
2921
2522
  this.setState({ linesEnabled: !this.state.linesEnabled });
2922
2523
  } }), label: this.props.t('ra_Show lines between rows') }),
2923
- 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: () => {
2924
2525
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.columnsAuto`, this.state.columnsAuto ? 'false' : 'true');
2925
2526
  if (!this.state.columnsAuto) {
2926
2527
  this.calculateColumnsVisibility(true);
@@ -2935,39 +2536,36 @@ class ObjectBrowserClass extends react_1.Component {
2935
2536
  this.setState({ columnsAuto: false });
2936
2537
  }
2937
2538
  } }), label: this.props.t('ra_Auto (no custom columns)') }),
2938
- react_1.default.createElement(material_1.List, null,
2539
+ React.createElement(List, null,
2939
2540
  this._renderDefinedList(false),
2940
2541
  this.state.columnsForAdmin &&
2941
2542
  Object.keys(this.state.columnsForAdmin)
2942
2543
  .sort()
2943
2544
  .map(adapter => this.state.columnsForAdmin &&
2944
- this.state.columnsForAdmin[adapter].map(column => {
2945
- var _b;
2946
- return (react_1.default.createElement(material_1.ListItemButton, { onClick: () => {
2947
- if (!this.state.columnsAuto) {
2948
- const columns = [...(this.state.columns || [])];
2949
- const id = `_${adapter}_${column.path}`;
2950
- const pos = columns.indexOf(id);
2951
- if (pos === -1) {
2952
- columns.push(id);
2953
- columns.sort();
2954
- }
2955
- else {
2956
- columns.splice(pos, 1);
2957
- }
2958
- this.calculateColumnsVisibility(null, columns);
2959
- this.localStorage.setItem(`${this.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
2960
- 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();
2961
2553
  }
2962
- }, key: `${adapter}_${column.name}` },
2963
- react_1.default.createElement(material_1.ListItemIcon, null,
2964
- react_1.default.createElement(material_1.Checkbox, { disabled: this.state.columnsAuto, edge: "start", checked: !this.state.columnsAuto &&
2965
- ((_b = this.state.columns) === null || _b === void 0 ? void 0 : _b.includes(`_${adapter}_${column.path}`)), disableRipple: true })),
2966
- react_1.default.createElement(material_1.ListItemText, { primary: `${column.name} (${adapter})` })));
2967
- })),
2554
+ else {
2555
+ columns.splice(pos, 1);
2556
+ }
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})` }))))),
2968
2566
  this._renderDefinedList(true))),
2969
- react_1.default.createElement(material_1.DialogActions, null,
2970
- 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))));
2971
2569
  }
2972
2570
  async getAdditionalColumns() {
2973
2571
  try {
@@ -3019,15 +2617,49 @@ class ObjectBrowserClass extends react_1.Component {
3019
2617
  }
3020
2618
  return null;
3021
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
+ };
3022
2650
  parseObjectForAdmins(columnsForAdmin, obj) {
3023
2651
  if (obj.common && obj.common.adminColumns && obj.common.name) {
3024
- let columns = obj.common.adminColumns;
2652
+ const columns = obj.common.adminColumns;
2653
+ let aColumns;
3025
2654
  if (columns && typeof columns !== 'object') {
3026
- columns = [columns];
2655
+ aColumns = [columns];
2656
+ }
2657
+ else if (columns) {
2658
+ aColumns = columns;
3027
2659
  }
3028
2660
  let cColumns;
3029
2661
  if (columns) {
3030
- cColumns = columns
2662
+ cColumns = aColumns
3031
2663
  .map((_item) => {
3032
2664
  if (typeof _item !== 'object') {
3033
2665
  return { path: _item, name: _item.split('.').pop() };
@@ -3063,7 +2695,7 @@ class ObjectBrowserClass extends react_1.Component {
3063
2695
  objTypes: item.objTypes,
3064
2696
  };
3065
2697
  })
3066
- .filter(item => item);
2698
+ .filter((item) => item);
3067
2699
  }
3068
2700
  else {
3069
2701
  cColumns = null;
@@ -3078,6 +2710,37 @@ class ObjectBrowserClass extends react_1.Component {
3078
2710
  }
3079
2711
  return columnsForAdmin;
3080
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
+ };
3081
2744
  afterObjectUpdated() {
3082
2745
  if (!this.objectsUpdateTimer && this.objects) {
3083
2746
  this.objectsUpdateTimer = setTimeout(() => {
@@ -3101,8 +2764,7 @@ class ObjectBrowserClass extends react_1.Component {
3101
2764
  // This function is called when the user changes the alias of an object.
3102
2765
  // It updates the aliasMap and returns true if the aliasMap has changed.
3103
2766
  updateAliases(aliasId) {
3104
- var _b, _c, _d;
3105
- 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.')) {
3106
2768
  return;
3107
2769
  }
3108
2770
  // Rebuild aliases map
@@ -3110,7 +2772,7 @@ class ObjectBrowserClass extends react_1.Component {
3110
2772
  this.info.aliasesMap = {};
3111
2773
  for (const id of aliasesIds) {
3112
2774
  const obj = this.objects[id];
3113
- 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) {
3114
2776
  if (typeof obj.common.alias.id === 'string') {
3115
2777
  const usedId = obj.common.alias.id;
3116
2778
  if (!this.info.aliasesMap[usedId]) {
@@ -3152,7 +2814,7 @@ class ObjectBrowserClass extends react_1.Component {
3152
2814
  */
3153
2815
  processOnObjectChangeElement(id, obj) {
3154
2816
  console.log(`> objectChange ${id}`);
3155
- const type = obj === null || obj === void 0 ? void 0 : obj.type;
2817
+ const type = obj?.type;
3156
2818
  // If the object is filtered out, we don't need to update the React state
3157
2819
  if (obj &&
3158
2820
  typeof this.props.filterFunc === 'function' &&
@@ -3165,7 +2827,7 @@ class ObjectBrowserClass extends react_1.Component {
3165
2827
  return { newInnerState: null, filtered: true };
3166
2828
  }
3167
2829
  let newInnerState = null;
3168
- if (id.startsWith('system.adapter.') && (obj === null || obj === void 0 ? void 0 : obj.type) === 'adapter') {
2830
+ if (id.startsWith('system.adapter.') && obj?.type === 'adapter') {
3169
2831
  const columnsForAdmin = JSON.parse(JSON.stringify(this.state.columnsForAdmin));
3170
2832
  this.parseObjectForAdmins(columnsForAdmin, obj);
3171
2833
  if (JSON.stringify(this.state.columnsForAdmin) !== JSON.stringify(columnsForAdmin)) {
@@ -3219,7 +2881,7 @@ class ObjectBrowserClass extends react_1.Component {
3219
2881
  }
3220
2882
  onFilter(name, value) {
3221
2883
  this.filterTimer = null;
3222
- const filter = Object.assign({}, this.state.filter);
2884
+ const filter = { ...this.state.filter };
3223
2885
  Object.keys(this.filterRefs).forEach(_name => {
3224
2886
  if (this.filterRefs[_name] && this.filterRefs[_name].current) {
3225
2887
  const filterRef = this.filterRefs[_name].current;
@@ -3243,7 +2905,7 @@ class ObjectBrowserClass extends react_1.Component {
3243
2905
  }
3244
2906
  }
3245
2907
  clearFilter() {
3246
- const filter = Object.assign({}, this.state.filter);
2908
+ const filter = { ...this.state.filter };
3247
2909
  Object.keys(this.filterRefs).forEach(name => {
3248
2910
  if (this.filterRefs[name] && this.filterRefs[name].current) {
3249
2911
  const filterRef = this.filterRefs[name].current;
@@ -3267,40 +2929,37 @@ class ObjectBrowserClass extends react_1.Component {
3267
2929
  return !someNotEmpty;
3268
2930
  }
3269
2931
  getFilterInput(filterName) {
3270
- var _b, _c, _d;
3271
- 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}`,
3272
2933
  // style={{ marginTop: 0, marginBottom: 0 }}
3273
2934
  margin: "dense" },
3274
- 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: () => {
3275
2936
  if (this.filterTimer) {
3276
2937
  clearTimeout(this.filterTimer);
3277
2938
  }
3278
2939
  this.filterTimer = setTimeout(() => this.onFilter(), 400);
3279
2940
  }, autoComplete: "off" }),
3280
- ((_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: {
3281
2942
  position: 'absolute',
3282
2943
  right: 0,
3283
2944
  } },
3284
- react_1.default.createElement(material_1.IconButton, { size: "small", onClick: () => {
3285
- var _b;
3286
- ((_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 = '';
3287
2947
  this.onFilter(filterName, '');
3288
2948
  } },
3289
- react_1.default.createElement(icons_material_1.Close, null)))) : null));
2949
+ React.createElement(IconClose, null)))) : null));
3290
2950
  }
3291
2951
  getFilterSelect(name, values) {
3292
- var _b, _c, _d;
3293
- const hasIcons = !!(values === null || values === void 0 ? void 0 : values.find(item => item.icon));
3294
- return (react_1.default.createElement("div", { style: { position: 'relative' } },
3295
- 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: () => {
3296
2955
  if (this.filterTimer) {
3297
2956
  clearTimeout(this.filterTimer);
3298
2957
  }
3299
2958
  this.filterTimer = setTimeout(() => this.onFilter(), 400);
3300
2959
  }, defaultValue: this.state.filter[name] || '', inputProps: { name, id: name }, displayEmpty: true },
3301
- react_1.default.createElement(material_1.MenuItem, { key: "empty", value: "" },
3302
- react_1.default.createElement("span", { style: styles.selectNone }, this.texts[`filter_${name}`])), values === null || values === void 0 ? void 0 :
3303
- 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 => {
3304
2963
  let id;
3305
2964
  let _name;
3306
2965
  let icon;
@@ -3313,51 +2972,44 @@ class ObjectBrowserClass extends react_1.Component {
3313
2972
  id = item;
3314
2973
  _name = item;
3315
2974
  }
3316
- return (react_1.default.createElement(material_1.MenuItem, { sx: styles.headerCellSelectItem, key: id, value: id },
3317
- 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),
3318
2977
  _name));
3319
2978
  })),
3320
- ((_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 },
3321
- react_1.default.createElement(material_1.IconButton, { size: "small", onClick: () => {
3322
- var _b;
3323
- 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 };
3324
2982
  newFilter[name] = '';
3325
- ((_b = this.filterRefs[name].current) === null || _b === void 0 ? void 0 : _b.childNodes[1]).value = '';
2983
+ (this.filterRefs[name].current?.childNodes[1]).value = '';
3326
2984
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectFilter`, JSON.stringify(newFilter));
3327
2985
  this.setState({ filter: newFilter, filterKey: this.state.filterKey + 1 }, () => this.props.onFilterChanged && this.props.onFilterChanged(newFilter));
3328
2986
  } },
3329
- react_1.default.createElement(icons_material_1.Close, null)))) : null));
2987
+ React.createElement(IconClose, null)))) : null));
3330
2988
  }
3331
2989
  getFilterSelectRole() {
3332
2990
  return this.getFilterSelect('role', this.info.roles);
3333
2991
  }
3334
2992
  getFilterSelectRoom() {
3335
- const rooms = this.info.roomEnums.map(id => {
3336
- var _b, _c, _d, _e;
3337
- return ({
3338
- 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(),
3339
- value: id,
3340
- 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 })),
3341
- });
3342
- });
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
+ }));
3343
2998
  return this.getFilterSelect('room', rooms);
3344
2999
  }
3345
3000
  getFilterSelectFunction() {
3346
- const func = this.info.funcEnums.map(id => {
3347
- var _b, _c, _d, _e;
3348
- return ({
3349
- 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(),
3350
- value: id,
3351
- 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 })),
3352
- });
3353
- });
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
+ }));
3354
3006
  return this.getFilterSelect('func', func);
3355
3007
  }
3356
3008
  getFilterSelectType() {
3357
3009
  const types = this.info.types.map(type => ({
3358
3010
  name: type,
3359
3011
  value: type,
3360
- icon: exports.ITEM_IMAGES[type] || null,
3012
+ icon: ITEM_IMAGES[type] || null,
3361
3013
  }));
3362
3014
  return this.getFilterSelect('type', types);
3363
3015
  }
@@ -3366,17 +3018,16 @@ class ObjectBrowserClass extends react_1.Component {
3366
3018
  const customs = this.info.customs.map(id => ({
3367
3019
  name: id === '_' ? this.texts.filterCustomsWithout : id,
3368
3020
  value: id,
3369
- 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 })),
3370
3022
  }));
3371
3023
  return this.getFilterSelect('custom', customs);
3372
3024
  }
3373
3025
  return null;
3374
3026
  }
3375
3027
  onExpandAll(root, expanded) {
3376
- var _b;
3377
3028
  const _root = root || this.root;
3378
3029
  expanded = expanded || [];
3379
- (_b = _root === null || _root === void 0 ? void 0 : _root.children) === null || _b === void 0 ? void 0 : _b.forEach((item) => {
3030
+ _root?.children?.forEach((item) => {
3380
3031
  if (item.data.sumVisibility) {
3381
3032
  expanded.push(item.data.id);
3382
3033
  this.onExpandAll(item, expanded);
@@ -3394,10 +3045,9 @@ class ObjectBrowserClass extends react_1.Component {
3394
3045
  this.setState({ expanded: [], depth: 0, selected: [] }, () => this.onAfterSelect());
3395
3046
  }
3396
3047
  expandDepth(root, depth, expanded) {
3397
- var _b;
3398
3048
  root = root || this.root;
3399
3049
  if (depth > 0) {
3400
- (_b = root.children) === null || _b === void 0 ? void 0 : _b.forEach(item => {
3050
+ root.children?.forEach(item => {
3401
3051
  if (item.data.sumVisibility) {
3402
3052
  if (!binarySearch(expanded, item.data.id)) {
3403
3053
  expanded.push(item.data.id);
@@ -3432,11 +3082,76 @@ class ObjectBrowserClass extends react_1.Component {
3432
3082
  onCollapseVisible() {
3433
3083
  if (this.state.depth > 0) {
3434
3084
  const depth = this.state.depth - 1;
3435
- const expanded = _a.collapseDepth(depth, this.state.expanded);
3085
+ const expanded = ObjectBrowserClass.collapseDepth(depth, this.state.expanded);
3436
3086
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectExpanded`, JSON.stringify(expanded));
3437
3087
  this.setState({ depth, expanded });
3438
3088
  }
3439
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
+ };
3440
3155
  async loadObjects(objs) {
3441
3156
  if (objs) {
3442
3157
  for (const id in objs) {
@@ -3527,7 +3242,6 @@ class ObjectBrowserClass extends react_1.Component {
3527
3242
  async _exportObjects(
3528
3243
  /** Options to filter/reduce the output */
3529
3244
  options) {
3530
- var _b;
3531
3245
  if (options.isAll) {
3532
3246
  generateFile('allObjects.json', this.objects, options);
3533
3247
  return;
@@ -3542,7 +3256,7 @@ class ObjectBrowserClass extends react_1.Component {
3542
3256
  for (const key of ids) {
3543
3257
  result[key] = JSON.parse(JSON.stringify(this.objects[key]));
3544
3258
  // read states values
3545
- if (((_b = result[key]) === null || _b === void 0 ? void 0 : _b.type) === 'state' && !options.noStatesByExportImport) {
3259
+ if (result[key]?.type === 'state' && !options.noStatesByExportImport) {
3546
3260
  const state = await this.props.socket.getState(key);
3547
3261
  if (state) {
3548
3262
  result[key].val = state.val;
@@ -3563,55 +3277,53 @@ class ObjectBrowserClass extends react_1.Component {
3563
3277
  if (this.state.showExportDialog === false) {
3564
3278
  return null;
3565
3279
  }
3566
- return (react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "lg" },
3567
- react_1.default.createElement(material_1.DialogTitle, null, this.props.t('ra_Select type of export')),
3568
- react_1.default.createElement(material_1.DialogContent, null,
3569
- 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,
3570
3284
  this.props.t('ra_You can export all objects or just the selected branch.'),
3571
- react_1.default.createElement("br", null),
3285
+ React.createElement("br", null),
3572
3286
  this.props.t('ra_Selected %s object(s)', this.state.showExportDialog),
3573
- react_1.default.createElement("br", null),
3574
- 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') }),
3575
- 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),
3576
3290
  this.props.t('These options can reduce the size of the export file:'),
3577
- 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') }),
3578
- react_1.default.createElement("br", null),
3579
- 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') }),
3580
- 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)),
3581
- react_1.default.createElement(material_1.DialogActions, null,
3582
- 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({
3583
3297
  isAll: true,
3584
3298
  noStatesByExportImport: this.state.noStatesByExportImport,
3585
3299
  beautify: this.state.beautifyJsonExport,
3586
3300
  excludeSystemRepositories: this.state.excludeSystemRepositoriesFromExport,
3587
3301
  excludeTranslations: this.state.excludeTranslations,
3588
3302
  })) },
3589
- 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')),
3590
3304
  "(",
3591
3305
  Object.keys(this.objects).length,
3592
- ")")) : (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'))),
3593
- 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({
3594
3308
  isAll: false,
3595
3309
  noStatesByExportImport: this.state.noStatesByExportImport,
3596
3310
  beautify: this.state.beautifyJsonExport,
3597
3311
  excludeSystemRepositories: this.state.excludeSystemRepositoriesFromExport,
3598
3312
  excludeTranslations: this.state.excludeTranslations,
3599
3313
  })) },
3600
- 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')),
3601
3315
  "(",
3602
3316
  this.state.showExportDialog,
3603
3317
  ")"),
3604
- 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')))));
3605
3319
  }
3606
3320
  handleJsonUpload(evt) {
3607
- var _b;
3608
3321
  const target = evt.target;
3609
- 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];
3610
3323
  if (f) {
3611
3324
  const r = new FileReader();
3612
3325
  r.onload = async (e) => {
3613
- var _b;
3614
- const contents = (_b = e.target) === null || _b === void 0 ? void 0 : _b.result;
3326
+ const contents = e.target?.result;
3615
3327
  try {
3616
3328
  const json = JSON.parse(contents);
3617
3329
  const len = Object.keys(json).length;
@@ -3683,6 +3395,75 @@ class ObjectBrowserClass extends react_1.Component {
3683
3395
  window.alert(this.props.t('ra_Failed to open JSON File'));
3684
3396
  }
3685
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
+ };
3686
3467
  /**
3687
3468
  * Renders the toolbar.
3688
3469
  */
@@ -3700,36 +3481,36 @@ class ObjectBrowserClass extends react_1.Component {
3700
3481
  allowObjectCreation = true;
3701
3482
  }
3702
3483
  }
3703
- return (react_1.default.createElement("div", { style: {
3484
+ return (React.createElement("div", { style: {
3704
3485
  display: 'flex',
3705
3486
  width: '100%',
3706
3487
  alignItems: 'center',
3707
3488
  overflowX: 'auto',
3708
3489
  } },
3709
- react_1.default.createElement("div", { style: {
3490
+ React.createElement("div", { style: {
3710
3491
  display: 'flex',
3711
3492
  width: '100%',
3712
3493
  alignItems: 'center',
3713
3494
  } },
3714
- react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Refresh tree'), slotProps: { popper: { sx: styles.tooltip } } },
3715
- react_1.default.createElement("div", null,
3716
- react_1.default.createElement(material_1.IconButton, { onClick: () => this.refreshComponent(), disabled: this.state.updating, size: "large" },
3717
- react_1.default.createElement(icons_material_1.Refresh, null)))),
3718
- this.props.showExpertButton && !this.props.expertMode && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_expertMode'), slotProps: { popper: { sx: styles.tooltip } } },
3719
- 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" },
3720
- react_1.default.createElement(IconExpert_1.default, null)))),
3721
- !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 } } },
3722
- react_1.default.createElement(material_1.IconButton, { key: "columnSelector", color: this.state.columnsAuto ? 'primary' : 'default', onClick: () => this.setState({ columnsSelectorShow: true }), size: "large" },
3723
- react_1.default.createElement(icons_material_1.ViewColumn, null)))),
3724
- 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 } } },
3725
- react_1.default.createElement(material_1.IconButton, { key: "expandAll", onClick: () => this.onExpandAll(), size: "large" },
3726
- react_1.default.createElement(IconOpen_1.default, null)))),
3727
- react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Collapse all nodes'), slotProps: { popper: { sx: styles.tooltip } } },
3728
- react_1.default.createElement(material_1.IconButton, { key: "collapseAll", onClick: () => this.onCollapseAll(), size: "large" },
3729
- react_1.default.createElement(IconClosed_1.default, null))),
3730
- 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 } } },
3731
- react_1.default.createElement(material_1.IconButton, { key: "expandVisible", color: "primary", onClick: () => this.onExpandVisible(), size: "large" },
3732
- 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) => ({
3733
3514
  badge: {
3734
3515
  right: 3,
3735
3516
  top: 3,
@@ -3737,10 +3518,10 @@ class ObjectBrowserClass extends react_1.Component {
3737
3518
  padding: '0 4px',
3738
3519
  },
3739
3520
  }) },
3740
- react_1.default.createElement(IconOpen_1.default, null))))),
3741
- 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 } } },
3742
- react_1.default.createElement(material_1.IconButton, { key: "collapseVisible", color: "primary", onClick: () => this.onCollapseVisible(), size: "large" },
3743
- 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) => ({
3744
3525
  badge: {
3745
3526
  right: 3,
3746
3527
  top: 3,
@@ -3748,26 +3529,26 @@ class ObjectBrowserClass extends react_1.Component {
3748
3529
  padding: '0 4px',
3749
3530
  },
3750
3531
  }), badgeContent: this.state.depth, color: "secondary" },
3751
- react_1.default.createElement(IconClosed_1.default, null))))),
3752
- this.props.objectStatesView && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Toggle the states view'), slotProps: { popper: { sx: styles.tooltip } } },
3753
- react_1.default.createElement(material_1.IconButton, { onClick: () => this.onStatesViewVisible(), size: "large" },
3754
- react_1.default.createElement(icons_material_1.LooksOne, { color: this.state.statesView ? 'primary' : 'inherit' })))),
3755
- react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Show/Hide object descriptions'), slotProps: { popper: { sx: styles.tooltip } } },
3756
- 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: () => {
3757
3538
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.desc`, this.state.showDescription ? 'false' : 'true');
3758
3539
  this.setState({ showDescription: !this.state.showDescription });
3759
3540
  }, size: "large" },
3760
- react_1.default.createElement(icons_material_1.TextFields, { color: this.state.showDescription ? 'primary' : 'inherit' }))),
3761
- this.props.objectAddBoolean ? (react_1.default.createElement(material_1.Tooltip, { title: this.toolTipObjectCreating(), slotProps: { popper: { sx: styles.tooltip } } },
3762
- react_1.default.createElement("div", null,
3763
- 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({
3764
3545
  modalNewObj: {
3765
3546
  id: this.state.selected[0] || this.state.selectedNonObject,
3766
3547
  },
3767
3548
  }), size: "large" },
3768
- react_1.default.createElement(icons_material_1.Add, null))))) : null,
3769
- 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 } } },
3770
- 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: () => {
3771
3552
  const input = document.createElement('input');
3772
3553
  input.setAttribute('type', 'file');
3773
3554
  input.setAttribute('id', 'files');
@@ -3775,22 +3556,21 @@ class ObjectBrowserClass extends react_1.Component {
3775
3556
  input.addEventListener('change', (e) => this.handleJsonUpload(e), false);
3776
3557
  input.click();
3777
3558
  }, size: "large" },
3778
- react_1.default.createElement(icons_material_1.Publish, null)))),
3559
+ React.createElement(PublishIcon, null)))),
3779
3560
  this.props.objectImportExport &&
3780
- (!!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 } } },
3781
- react_1.default.createElement(material_1.IconButton, { onClick: () => this.setState({ showExportDialog: this._getSelectedIdsForExport().length }), size: "large" },
3782
- react_1.default.createElement(icons_material_1.Publish, { style: { transform: 'rotate(180deg)' } }))))),
3783
- !!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}`)),
3784
- this.props.objectEditBoolean && (react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Edit custom config'), slotProps: { popper: { sx: styles.tooltip } } },
3785
- react_1.default.createElement(material_1.IconButton, { onClick: () => {
3786
- 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: () => {
3787
3567
  // get all visible states
3788
3568
  const ids = this.root ? getVisibleItems(this.root, 'state', this.objects) : [];
3789
3569
  if (ids.length) {
3790
3570
  this.pauseSubscribe(true);
3791
3571
  if (ids.length === 1) {
3792
3572
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, this.state.selected[0]);
3793
- (_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]);
3794
3574
  }
3795
3575
  this.setState({ customDialog: ids, customDialogAll: true });
3796
3576
  }
@@ -3798,7 +3578,7 @@ class ObjectBrowserClass extends react_1.Component {
3798
3578
  this.setState({ toast: this.props.t('ra_please select object') });
3799
3579
  }
3800
3580
  }, size: "large" },
3801
- react_1.default.createElement(icons_material_1.Build, null))))));
3581
+ React.createElement(BuildIcon, null))))));
3802
3582
  }
3803
3583
  toggleExpanded(id) {
3804
3584
  const expanded = JSON.parse(JSON.stringify(this.state.expanded));
@@ -3816,7 +3596,7 @@ class ObjectBrowserClass extends react_1.Component {
3816
3596
  onCopy(e, text) {
3817
3597
  e.stopPropagation();
3818
3598
  e.preventDefault();
3819
- Utils_1.default.copyToClipboard(text);
3599
+ Utils.copyToClipboard(text);
3820
3600
  if (text.length < 50) {
3821
3601
  this.setState({ toast: this.props.t('ra_Copied %s', text) });
3822
3602
  }
@@ -3824,14 +3604,82 @@ class ObjectBrowserClass extends react_1.Component {
3824
3604
  this.setState({ toast: this.props.t('ra_Copied') });
3825
3605
  }
3826
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
+ };
3827
3670
  renderColumnButtons(id, item) {
3828
- var _b, _c, _d;
3829
3671
  if (!item.data.obj) {
3830
- return this.props.onObjectDelete || this.props.objectEditOfAccessControl ? (react_1.default.createElement("div", { style: styles.buttonDiv },
3831
- 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" },
3832
- react_1.default.createElement("div", { style: { height: 15 } }, "---"))) : null,
3833
- 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: () => {
3834
- 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: () => {
3835
3683
  // calculate the number of children
3836
3684
  const keys = Object.keys(this.objects);
3837
3685
  keys.sort();
@@ -3846,10 +3694,10 @@ class ObjectBrowserClass extends react_1.Component {
3846
3694
  }
3847
3695
  }
3848
3696
  if (this.props.onObjectDelete) {
3849
- 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);
3850
3698
  }
3851
3699
  } },
3852
- react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon }))) : null)) : null;
3700
+ React.createElement(IconDelete, { style: styles.cellButtonsButtonIcon }))) : null)) : null;
3853
3701
  }
3854
3702
  item.data.aclTooltip =
3855
3703
  item.data.aclTooltip || this.renderTooltipAccessControl(item.data.obj.acl);
@@ -3862,20 +3710,26 @@ class ObjectBrowserClass extends react_1.Component {
3862
3710
  (item.data.obj.type === 'state'
3863
3711
  ? this.systemConfig.common.defaultNewAcl.state
3864
3712
  : this.systemConfig.common.defaultNewAcl.object);
3865
- const showEdit = this.state.filter.expertMode || _a.isNonExpertId(item.data.id);
3713
+ const showEdit = this.state.filter.expertMode || ObjectBrowserClass.isNonExpertId(item.data.id);
3866
3714
  return [
3867
- 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 } } },
3868
- 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" },
3869
- 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))
3870
3722
  ? Number(aclSystemConfig).toString(16)
3871
- : Number(acl).toString(16))))) : (react_1.default.createElement("div", { key: "aclEmpty", style: styles.cellButtonMinWidth })),
3872
- 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: () => {
3873
3728
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, id);
3874
3729
  this.setState({ editObjectDialog: id, editObjectAlias: false });
3875
3730
  } },
3876
- 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 })),
3877
- 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: () => {
3878
- 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: () => {
3879
3733
  const keys = Object.keys(this.objects);
3880
3734
  keys.sort();
3881
3735
  let count = 0;
@@ -3889,28 +3743,29 @@ class ObjectBrowserClass extends react_1.Component {
3889
3743
  }
3890
3744
  }
3891
3745
  if (this.props.onObjectDelete) {
3892
- 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);
3893
3747
  }
3894
3748
  }, title: this.texts.deleteObject },
3895
- react_1.default.createElement(icons_material_1.Delete, { style: styles.cellButtonsButtonIcon }))) : null,
3749
+ React.createElement(IconDelete, { style: styles.cellButtonsButtonIcon }))) : null,
3896
3750
  this.props.objectCustomDialog &&
3897
3751
  this.info.hasSomeCustoms &&
3898
3752
  item.data.obj.type === 'state' &&
3899
3753
  // @ts-expect-error deprecated from js-controller 6
3900
- ((_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
3901
- ? this.styles.cellButtonsButtonWithCustoms
3902
- : styles.cellButtonsButtonWithoutCustoms)), key: "custom", size: "small", "aria-label": "config", title: this.texts.customConfig, onClick: () => {
3903
- 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: () => {
3904
3760
  this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, id);
3905
3761
  this.pauseSubscribe(true);
3906
- (_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate(null, 'customs', id);
3762
+ this.props.router?.doNavigate(null, 'customs', id);
3907
3763
  this.setState({ customDialog: [id], customDialogAll: false });
3908
3764
  } },
3909
- react_1.default.createElement(icons_material_1.Settings, { style: styles.cellButtonsButtonIcon }))) : null,
3765
+ React.createElement(IconConfig, { style: styles.cellButtonsButtonIcon }))) : null,
3910
3766
  ];
3911
3767
  }
3912
3768
  readHistory(id) {
3913
- var _b, _c;
3914
3769
  /* interface GetHistoryOptions {
3915
3770
  instance?: string;
3916
3771
  start?: number;
@@ -3928,7 +3783,7 @@ class ObjectBrowserClass extends react_1.Component {
3928
3783
  } */
3929
3784
  if (window.sparkline &&
3930
3785
  this.defaultHistory &&
3931
- ((_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 &&
3932
3787
  this.objects[id].common.custom[this.defaultHistory]) {
3933
3788
  const now = new Date();
3934
3789
  now.setHours(now.getHours() - 24);
@@ -3962,7 +3817,6 @@ class ObjectBrowserClass extends react_1.Component {
3962
3817
  }
3963
3818
  }
3964
3819
  getTooltipInfo(id, cb) {
3965
- var _b, _c;
3966
3820
  const obj = this.objects[id];
3967
3821
  const state = this.states[id];
3968
3822
  const { valFull, fileViewer } = formatValue({
@@ -3974,45 +3828,44 @@ class ObjectBrowserClass extends react_1.Component {
3974
3828
  full: true,
3975
3829
  });
3976
3830
  const valFullRx = [];
3977
- valFull === null || valFull === void 0 ? void 0 : valFull.forEach(_item => {
3831
+ valFull?.forEach(_item => {
3978
3832
  if (_item.t === this.texts.quality && state.q) {
3979
- 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 },
3980
3834
  _item.t,
3981
3835
  ":\u00A0",
3982
3836
  _item.v));
3983
3837
  // <div style={styles.cellValueTooltipValue} key={item.t + '_v'}>{item.v}</div>,
3984
3838
  if (!_item.nbr) {
3985
- valFullRx.push(react_1.default.createElement("br", { key: `${_item.t}_br` }));
3839
+ valFullRx.push(React.createElement("br", { key: `${_item.t}_br` }));
3986
3840
  }
3987
3841
  }
3988
3842
  else {
3989
- 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 },
3990
3844
  _item.t,
3991
3845
  ":\u00A0"));
3992
- 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));
3993
3847
  if (!_item.nbr) {
3994
- valFullRx.push(react_1.default.createElement("br", { key: `${_item.t}_br` }));
3848
+ valFullRx.push(React.createElement("br", { key: `${_item.t}_br` }));
3995
3849
  }
3996
3850
  }
3997
3851
  });
3998
3852
  if (fileViewer === 'image') {
3999
- 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 }));
4000
3854
  }
4001
3855
  else if (this.defaultHistory &&
4002
- ((_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 &&
4003
3857
  this.objects[id].common.custom[this.defaultHistory]) {
4004
- 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" }));
4005
3859
  }
4006
3860
  this.setState({ tooltipInfo: { el: valFullRx, id } }, () => cb && cb());
4007
3861
  }
4008
3862
  renderColumnValue(id, item, narrowStyleWithDetails) {
4009
- var _b, _c;
4010
3863
  const obj = item.data.obj;
4011
3864
  if (!obj || !this.states) {
4012
3865
  return null;
4013
3866
  }
4014
- if (((_b = obj.common) === null || _b === void 0 ? void 0 : _b.type) === 'file') {
4015
- 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]"));
4016
3869
  }
4017
3870
  if (!this.states[id]) {
4018
3871
  if (obj.type === 'state') {
@@ -4043,23 +3896,23 @@ class ObjectBrowserClass extends react_1.Component {
4043
3896
  const valTextRx = [];
4044
3897
  item.data.state = { valTextRx };
4045
3898
  const copyText = valText.v || '';
4046
- 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: {
4047
3900
  whiteSpace: 'nowrap',
4048
3901
  display: 'inline-block',
4049
3902
  overflow: 'hidden',
4050
3903
  textOverflow: 'ellipsis',
4051
3904
  } }, valText.v.toString()));
4052
3905
  if (valText.u) {
4053
- 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));
4054
3907
  }
4055
3908
  if (valText.s !== undefined) {
4056
- 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` },
4057
3910
  "(",
4058
3911
  valText.s,
4059
3912
  ")"));
4060
3913
  }
4061
3914
  if (!narrowStyleWithDetails) {
4062
- 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" }));
4063
3916
  }
4064
3917
  // <IconEdit className="copyButton" style={{{ ...styles.cellButtonsValueButton, styles.cellButtonsValueButtonEdit)} key="ce" />
4065
3918
  info = item.data.state;
@@ -4069,12 +3922,12 @@ class ObjectBrowserClass extends react_1.Component {
4069
3922
  if (!this.state.filter.expertMode) {
4070
3923
  if (item.data.button) {
4071
3924
  val = [
4072
- 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 } }),
4073
3926
  ];
4074
3927
  }
4075
3928
  else if (item.data.switch) {
4076
3929
  val = [
4077
- react_1.default.createElement(material_1.Switch, { key: "switch", sx: {
3930
+ React.createElement(Switch, { key: "switch", sx: {
4078
3931
  '& .MuiSwitch-thumb': { color: info.style.color },
4079
3932
  '& .MuiSwitch-track': {
4080
3933
  backgroundColor: !!this.states[id].val && this.state.selected.includes(id)
@@ -4087,16 +3940,19 @@ class ObjectBrowserClass extends react_1.Component {
4087
3940
  ];
4088
3941
  }
4089
3942
  }
4090
- 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: {
4091
3944
  popper: { sx: styles.cellValueTooltipBox },
4092
3945
  tooltip: { sx: styles.cellValueTooltip },
4093
- }, 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 }); } },
4094
- 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': {
4095
3951
  transform: 'translate(0, 2px)',
4096
- } }) }, val)));
3952
+ },
3953
+ } }, val)));
4097
3954
  }
4098
3955
  _syncEnum(id, enumIds, newArray, cb) {
4099
- var _b, _c, _d;
4100
3956
  if (!enumIds || !enumIds.length) {
4101
3957
  if (cb) {
4102
3958
  cb();
@@ -4105,8 +3961,8 @@ class ObjectBrowserClass extends react_1.Component {
4105
3961
  }
4106
3962
  const enumId = enumIds.pop() || '';
4107
3963
  const promises = [];
4108
- if ((_b = this.info.objects[enumId]) === null || _b === void 0 ? void 0 : _b.common) {
4109
- 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) {
4110
3966
  const pos = this.info.objects[enumId].common.members.indexOf(id);
4111
3967
  if (pos !== -1 && !newArray.includes(enumId)) {
4112
3968
  // delete it from members
@@ -4119,7 +3975,7 @@ class ObjectBrowserClass extends react_1.Component {
4119
3975
  }
4120
3976
  }
4121
3977
  // add to it
4122
- 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)) {
4123
3979
  // add to object
4124
3980
  const obj = JSON.parse(JSON.stringify(this.info.objects[enumId]));
4125
3981
  obj.common.members = obj.common.members || [];
@@ -4153,28 +4009,25 @@ class ObjectBrowserClass extends react_1.Component {
4153
4009
  const itemEnums = this.state.enumDialogEnums;
4154
4010
  const enumsOriginal = this.state.enumDialog.enumsOriginal;
4155
4011
  const enums = (type === 'room' ? this.info.roomEnums : this.info.funcEnums)
4156
- .map(id => {
4157
- var _b, _c;
4158
- return ({
4159
- 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),
4160
- value: id,
4161
- icon: getSelectIdIconFromObjects(this.objects, id, this.props.lang, this.imagePrefix),
4162
- });
4163
- })
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
+ }))
4164
4017
  .sort((a, b) => (a.name > b.name ? 1 : -1));
4165
4018
  enums.forEach(_item => {
4166
4019
  if (_item.icon && typeof _item.icon === 'string') {
4167
- _item.icon = (react_1.default.createElement(material_1.Box, { style: styles.enumIconDiv },
4168
- 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 })));
4169
4022
  }
4170
4023
  });
4171
4024
  // const hasIcons = !!enums.find(item => item.icon);
4172
- 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 },
4173
- 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" },
4174
4027
  type === 'func' ? this.props.t('ra_Define functions') : this.props.t('ra_Define rooms'),
4175
- 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 })) },
4176
- react_1.default.createElement(icons_material_1.Check, null))),
4177
- 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 => {
4178
4031
  let id;
4179
4032
  let name;
4180
4033
  let icon;
@@ -4188,7 +4041,7 @@ class ObjectBrowserClass extends react_1.Component {
4188
4041
  name = _item;
4189
4042
  }
4190
4043
  const labelId = `checkbox-list-label-${id}`;
4191
- 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: () => {
4192
4045
  const pos = itemEnums.indexOf(id);
4193
4046
  const enumDialogEnums = JSON.parse(JSON.stringify(this.state.enumDialogEnums));
4194
4047
  if (pos === -1) {
@@ -4200,9 +4053,9 @@ class ObjectBrowserClass extends react_1.Component {
4200
4053
  }
4201
4054
  this.setState({ enumDialogEnums });
4202
4055
  }, secondaryAction: icon },
4203
- react_1.default.createElement(material_1.ListItemIcon, { sx: { '&.MuiListItemIcon-root': styles.enumCheckbox } },
4204
- react_1.default.createElement(material_1.Checkbox, { edge: "start", checked: itemEnums.includes(id), tabIndex: -1, disableRipple: true, inputProps: { 'aria-labelledby': labelId } })),
4205
- 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)));
4206
4059
  }))));
4207
4060
  }
4208
4061
  renderEditRoleDialog() {
@@ -4211,7 +4064,7 @@ class ObjectBrowserClass extends react_1.Component {
4211
4064
  }
4212
4065
  if (this.state.roleDialog && this.props.objectBrowserEditRole) {
4213
4066
  const ObjectBrowserEditRole = this.props.objectBrowserEditRole;
4214
- 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) => {
4215
4068
  if (obj) {
4216
4069
  this.info.objects[this.state.roleDialog] = obj;
4217
4070
  }
@@ -4221,7 +4074,6 @@ class ObjectBrowserClass extends react_1.Component {
4221
4074
  return null;
4222
4075
  }
4223
4076
  onColumnsEditCustomDialogClose(isSave) {
4224
- var _b, _c;
4225
4077
  // cannot be null
4226
4078
  const customColumnDialog = this.customColumnDialog;
4227
4079
  if (isSave) {
@@ -4234,11 +4086,10 @@ class ObjectBrowserClass extends react_1.Component {
4234
4086
  }
4235
4087
  this.customColumnDialog = null;
4236
4088
  this.props.socket
4237
- .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 || '')
4238
4090
  .then(obj => {
4239
- var _b;
4240
4091
  if (obj &&
4241
- _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)) {
4242
4093
  return this.props.socket.setObject(obj._id, obj);
4243
4094
  }
4244
4095
  throw new Error(this.props.t('ra_Cannot update attribute, because not found in the object'));
@@ -4256,24 +4107,24 @@ class ObjectBrowserClass extends react_1.Component {
4256
4107
  return null;
4257
4108
  }
4258
4109
  if (!this.customColumnDialog) {
4259
- 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);
4260
4111
  this.customColumnDialog = {
4261
4112
  type: (this.state.columnsEditCustomDialog.it.type || typeof value),
4262
4113
  initValue: (value === null || value === undefined ? '' : value).toString(),
4263
4114
  value: (value === null || value === undefined ? '' : value).toString(),
4264
4115
  };
4265
4116
  }
4266
- return (react_1.default.createElement(material_1.Dialog, { onClose: () => this.setState({ columnsEditCustomDialog: null }), maxWidth: "md", "aria-labelledby": "custom-dialog-title", open: !0 },
4267
- react_1.default.createElement(material_1.DialogTitle, { id: "custom-dialog-title" }, `${this.props.t('ra_Edit object field')}: ${this.state.columnsEditCustomDialog.obj._id}`),
4268
- react_1.default.createElement(material_1.DialogContent, null,
4269
- 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 => {
4270
4121
  const customColumnDialog = this.customColumnDialog;
4271
4122
  customColumnDialog.value = e.target.checked.toString();
4272
4123
  const changed = customColumnDialog.value !== customColumnDialog.initValue;
4273
4124
  if (changed === !this.state.customColumnDialogValueChanged) {
4274
4125
  this.setState({ customColumnDialogValueChanged: changed });
4275
4126
  }
4276
- } }), 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 => {
4277
4128
  const customColumnDialog = this.customColumnDialog;
4278
4129
  customColumnDialog.value = e.target.value;
4279
4130
  const changed = customColumnDialog.value !== customColumnDialog.initValue;
@@ -4281,13 +4132,12 @@ class ObjectBrowserClass extends react_1.Component {
4281
4132
  this.setState({ customColumnDialogValueChanged: changed });
4282
4133
  }
4283
4134
  }, autoFocus: true })))),
4284
- react_1.default.createElement(material_1.DialogActions, null,
4285
- 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')),
4286
- 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')))));
4287
4138
  }
4288
4139
  static getCustomValue(obj, it) {
4289
- var _b;
4290
- 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) {
4291
4141
  const p = it.path;
4292
4142
  let value;
4293
4143
  const anyObj = obj;
@@ -4334,8 +4184,7 @@ class ObjectBrowserClass extends react_1.Component {
4334
4184
  return null;
4335
4185
  }
4336
4186
  static setCustomValue(obj, it, value) {
4337
- var _b;
4338
- 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) {
4339
4188
  const p = it.path;
4340
4189
  const anyObj = obj;
4341
4190
  if (anyObj[p[0]] && typeof anyObj[p[0]] === 'object') {
@@ -4391,15 +4240,22 @@ class ObjectBrowserClass extends react_1.Component {
4391
4240
  * Renders a custom value.
4392
4241
  */
4393
4242
  renderCustomValue(obj, it, item) {
4394
- const text = _a.getCustomValue(obj, it);
4243
+ const text = ObjectBrowserClass.getCustomValue(obj, it);
4395
4244
  if (text !== null && text !== undefined) {
4396
4245
  if (it.edit && !this.props.notEditable && (!it.objTypes || it.objTypes.includes(obj.type))) {
4397
- 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({
4398
4251
  columnsEditCustomDialog: { item, it, obj },
4399
4252
  customColumnDialogValueChanged: false,
4400
4253
  }) }, text));
4401
4254
  }
4402
- 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));
4403
4259
  }
4404
4260
  return null;
4405
4261
  }
@@ -4408,7 +4264,7 @@ class ObjectBrowserClass extends react_1.Component {
4408
4264
  // read the type of operation
4409
4265
  const aliasObj = this.objects[this.info.aliasesMap[id][_index]].common.alias.id;
4410
4266
  if (aliasObj) {
4411
- return (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
4267
+ return (React.createElement(Box, { component: "div", onClick: e => {
4412
4268
  e.stopPropagation();
4413
4269
  e.preventDefault();
4414
4270
  const aliasId = this.info.aliasesMap[id][_index];
@@ -4419,7 +4275,7 @@ class ObjectBrowserClass extends react_1.Component {
4419
4275
  this.onSelect(aliasId);
4420
4276
  setTimeout(() => this.expandAllSelected(() => this.scrollToItem(aliasId)), 100);
4421
4277
  }, sx: customStyle || this.styles.aliasAlone },
4422
- 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)
4423
4279
  ? '↔'
4424
4280
  : aliasObj.read === id
4425
4281
  ? '→'
@@ -4432,43 +4288,42 @@ class ObjectBrowserClass extends react_1.Component {
4432
4288
  * Renders a leaf.
4433
4289
  */
4434
4290
  renderLeaf(item, isExpanded, counter) {
4435
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
4436
4291
  const id = item.data.id;
4437
4292
  counter.count++;
4438
4293
  isExpanded = isExpanded === undefined ? this.state.expanded.includes(id) : isExpanded;
4439
4294
  // icon
4440
4295
  let iconFolder;
4441
4296
  const obj = item.data.obj;
4442
- const itemType = obj === null || obj === void 0 ? void 0 : obj.type;
4297
+ const itemType = obj?.type;
4443
4298
  if (item.children ||
4444
4299
  itemType === 'folder' ||
4445
4300
  itemType === 'device' ||
4446
4301
  itemType === 'channel' ||
4447
4302
  itemType === 'meta') {
4448
- 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) }));
4449
4304
  }
4450
4305
  else if (obj && obj.common && obj.common.write === false && obj.type === 'state') {
4451
- iconFolder = react_1.default.createElement(IconDocumentReadOnly_1.default, { style: this.styles.cellIdIconDocument });
4306
+ iconFolder = React.createElement(IconDocumentReadOnly, { style: this.styles.cellIdIconDocument });
4452
4307
  }
4453
4308
  else {
4454
- iconFolder = react_1.default.createElement(IconDocument_1.default, { style: this.styles.cellIdIconDocument });
4309
+ iconFolder = React.createElement(IconDocument, { style: this.styles.cellIdIconDocument });
4455
4310
  }
4456
4311
  let iconItem = null;
4457
4312
  if (item.data.icon) {
4458
4313
  if (typeof item.data.icon === 'string') {
4459
4314
  if (item.data.icon.length < 3) {
4460
- 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
4461
4316
  }
4462
4317
  else {
4463
- 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: "" }));
4464
4319
  }
4465
4320
  }
4466
4321
  else {
4467
4322
  iconItem = item.data.icon;
4468
4323
  }
4469
4324
  }
4470
- const common = obj === null || obj === void 0 ? void 0 : obj.common;
4471
- 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" });
4472
4327
  const paddingLeft = this.levelPadding * (item.data.level || 0);
4473
4328
  // recalculate rooms and function names if the language changed
4474
4329
  if (item.data.lang !== this.props.lang) {
@@ -4482,11 +4337,11 @@ class ObjectBrowserClass extends react_1.Component {
4482
4337
  }
4483
4338
  const checkbox = this.props.multiSelect &&
4484
4339
  this.objects[id] &&
4485
- (!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;
4486
4341
  let valueEditable = !this.props.notEditable &&
4487
4342
  itemType === 'state' &&
4488
- (this.state.filter.expertMode || (common === null || common === void 0 ? void 0 : common.write) !== false);
4489
- 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') {
4490
4345
  valueEditable = true;
4491
4346
  }
4492
4347
  const enumEditable = !this.props.notEditable &&
@@ -4496,7 +4351,7 @@ class ObjectBrowserClass extends react_1.Component {
4496
4351
  let newValue = '';
4497
4352
  const newValueTitle = [];
4498
4353
  if (checkVisibleObjectType) {
4499
- newValue = (_b = this.states[id]) === null || _b === void 0 ? void 0 : _b.from;
4354
+ newValue = this.states[id]?.from;
4500
4355
  if (newValue === undefined) {
4501
4356
  newValue = '&nbsp;';
4502
4357
  }
@@ -4504,7 +4359,7 @@ class ObjectBrowserClass extends react_1.Component {
4504
4359
  newValue = newValue ? newValue.replace(/^system\.adapter\.|^system\./, '') : '';
4505
4360
  newValueTitle.push(`${this.texts.stateChangedFrom} ${newValue}`);
4506
4361
  }
4507
- if (obj === null || obj === void 0 ? void 0 : obj.user) {
4362
+ if (obj?.user) {
4508
4363
  const user = obj.user.replace('system.user.', '');
4509
4364
  newValue += `/${user}`;
4510
4365
  newValueTitle.push(`${this.texts.stateChangedBy} ${user}`);
@@ -4518,16 +4373,16 @@ class ObjectBrowserClass extends react_1.Component {
4518
4373
  newValueTitle.push(`${this.texts.objectChangedBy} ${obj.user.replace(/^system\.user\./, '')}`);
4519
4374
  }
4520
4375
  if (obj.ts) {
4521
- 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)}`);
4522
4377
  }
4523
4378
  }
4524
4379
  let readWriteAlias = false;
4525
4380
  let alias = null;
4526
- 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) {
4527
4382
  readWriteAlias = typeof common.alias.id === 'object';
4528
4383
  if (readWriteAlias) {
4529
- alias = (react_1.default.createElement("div", { style: styles.cellIdAliasReadWriteDiv },
4530
- 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 => {
4531
4386
  e.stopPropagation();
4532
4387
  e.preventDefault();
4533
4388
  this.onSelect(common.alias.id.read);
@@ -4535,7 +4390,7 @@ class ObjectBrowserClass extends react_1.Component {
4535
4390
  }, sx: this.styles.aliasReadWrite },
4536
4391
  "\u2190",
4537
4392
  common.alias.id.read)) : null,
4538
- 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 => {
4539
4394
  e.stopPropagation();
4540
4395
  e.preventDefault();
4541
4396
  this.onSelect(common.alias.id.write);
@@ -4545,7 +4400,7 @@ class ObjectBrowserClass extends react_1.Component {
4545
4400
  common.alias.id.write)) : null));
4546
4401
  }
4547
4402
  else {
4548
- alias = (react_1.default.createElement(material_1.Box, { component: "div", onClick: e => {
4403
+ alias = (React.createElement(Box, { component: "div", onClick: e => {
4549
4404
  e.stopPropagation();
4550
4405
  e.preventDefault();
4551
4406
  this.onSelect(common.alias.id);
@@ -4559,7 +4414,7 @@ class ObjectBrowserClass extends react_1.Component {
4559
4414
  // Some alias points to this object. It can be more than one
4560
4415
  if (this.info.aliasesMap[id].length > 1) {
4561
4416
  // Show number of aliases and open a menu by click
4562
- 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 => {
4563
4418
  e.stopPropagation();
4564
4419
  e.preventDefault();
4565
4420
  this.setState({ aliasMenu: id });
@@ -4570,11 +4425,11 @@ class ObjectBrowserClass extends react_1.Component {
4570
4425
  alias = this.renderAliasLink(id, 0);
4571
4426
  }
4572
4427
  }
4573
- let checkColor = common === null || common === void 0 ? void 0 : common.color;
4428
+ let checkColor = common?.color;
4574
4429
  let invertBackground;
4575
4430
  if (checkColor && !this.state.selected.includes(id)) {
4576
4431
  const background = this.props.themeName === 'dark' ? '#1f1f1f' : this.props.themeName === 'blue' ? '#222a2e' : '#FFFFFF';
4577
- const distance = Utils_1.default.colorDistance(checkColor, background);
4432
+ const distance = Utils.colorDistance(checkColor, background);
4578
4433
  // console.log(`Distance: ${checkColor} - ${background} = ${distance}`);
4579
4434
  if (distance < 1000) {
4580
4435
  invertBackground = this.props.themeType === 'dark' ? '#9a9a9a' : '#565656';
@@ -4604,17 +4459,16 @@ class ObjectBrowserClass extends react_1.Component {
4604
4459
  checkColor = 'inherit';
4605
4460
  }
4606
4461
  const icons = [];
4607
- if (common === null || common === void 0 ? void 0 : common.statusStates) {
4462
+ if (common?.statusStates) {
4608
4463
  const ids = {};
4609
4464
  Object.keys(common.statusStates).forEach(name => {
4610
- var _b;
4611
4465
  let _id = common.statusStates[name];
4612
4466
  if (_id.split('.').length < 3) {
4613
4467
  _id = `${id}.${_id}`;
4614
4468
  }
4615
4469
  ids[name] = _id;
4616
4470
  if (!this.states[_id]) {
4617
- if (((_b = this.objects[_id]) === null || _b === void 0 ? void 0 : _b.type) === 'state') {
4471
+ if (this.objects[_id]?.type === 'state') {
4618
4472
  if (!this.recordStates.includes(_id)) {
4619
4473
  this.recordStates.push(_id);
4620
4474
  }
@@ -4632,7 +4486,7 @@ class ObjectBrowserClass extends react_1.Component {
4632
4486
  if (common.statusStates.errorId && this.states[ids.errorId] && this.states[ids.errorId].val) {
4633
4487
  checkColor = this.props.themeType === 'dark' ? COLOR_NAME_ERROR_DARK : COLOR_NAME_ERROR_LIGHT;
4634
4488
  colorSet = true;
4635
- icons.push(react_1.default.createElement(icons_material_1.Error, { key: "error",
4489
+ icons.push(React.createElement(IconError, { key: "error",
4636
4490
  // title={this.texts.deviceError}
4637
4491
  style: this.styles.iconDeviceError }));
4638
4492
  }
@@ -4641,7 +4495,7 @@ class ObjectBrowserClass extends react_1.Component {
4641
4495
  if (this.states[ids.onlineId].val) {
4642
4496
  checkColor =
4643
4497
  this.props.themeType === 'dark' ? COLOR_NAME_CONNECTED_DARK : COLOR_NAME_CONNECTED_LIGHT;
4644
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4498
+ icons.push(React.createElement(IconConnection, { key: "conn",
4645
4499
  // title={this.texts.deviceError}
4646
4500
  style: this.styles.iconDeviceConnected }));
4647
4501
  }
@@ -4650,18 +4504,18 @@ class ObjectBrowserClass extends react_1.Component {
4650
4504
  this.props.themeType === 'dark'
4651
4505
  ? COLOR_NAME_DISCONNECTED_DARK
4652
4506
  : COLOR_NAME_DISCONNECTED_LIGHT;
4653
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4507
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4654
4508
  // title={this.texts.deviceError}
4655
4509
  style: this.styles.iconDeviceDisconnected }));
4656
4510
  }
4657
4511
  }
4658
4512
  else if (this.states[ids.onlineId].val) {
4659
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4513
+ icons.push(React.createElement(IconConnection, { key: "conn",
4660
4514
  // title={this.texts.deviceError}
4661
4515
  style: this.styles.iconDeviceConnected }));
4662
4516
  }
4663
4517
  else {
4664
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4518
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4665
4519
  // title={this.texts.deviceError}
4666
4520
  style: this.styles.iconDeviceDisconnected }));
4667
4521
  }
@@ -4673,85 +4527,102 @@ class ObjectBrowserClass extends react_1.Component {
4673
4527
  this.props.themeType === 'dark'
4674
4528
  ? COLOR_NAME_DISCONNECTED_DARK
4675
4529
  : COLOR_NAME_DISCONNECTED_LIGHT;
4676
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4530
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4677
4531
  // title={this.texts.deviceError}
4678
4532
  style: this.styles.iconDeviceDisconnected }));
4679
4533
  }
4680
4534
  else {
4681
4535
  checkColor =
4682
4536
  this.props.themeType === 'dark' ? COLOR_NAME_CONNECTED_DARK : COLOR_NAME_CONNECTED_LIGHT;
4683
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4537
+ icons.push(React.createElement(IconConnection, { key: "conn",
4684
4538
  // title={this.texts.deviceError}
4685
4539
  style: this.styles.iconDeviceConnected }));
4686
4540
  }
4687
4541
  }
4688
4542
  else if (this.states[ids.offlineId].val) {
4689
- icons.push(react_1.default.createElement(icons_material_1.WifiOff, { key: "disc",
4543
+ icons.push(React.createElement(IconDisconnected, { key: "disc",
4690
4544
  // title={this.texts.deviceError}
4691
4545
  style: this.styles.iconDeviceDisconnected }));
4692
4546
  }
4693
4547
  else {
4694
- icons.push(react_1.default.createElement(icons_material_1.Wifi, { key: "conn",
4548
+ icons.push(React.createElement(IconConnection, { key: "conn",
4695
4549
  // title={this.texts.deviceError}
4696
4550
  style: this.styles.iconDeviceConnected }));
4697
4551
  }
4698
4552
  }
4699
4553
  }
4700
- const q = checkVisibleObjectType ? Utils_1.default.quality2text(((_d = this.states[id]) === null || _d === void 0 ? void 0 : _d.q) || 0).join(', ') : null;
4701
- 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 || '';
4702
4556
  let useDesc = false;
4703
4557
  if (this.state.showDescription) {
4704
4558
  const oTooltip = getObjectTooltip(item.data, this.props.lang);
4705
4559
  if (oTooltip) {
4706
4560
  name = [
4707
- react_1.default.createElement("div", { key: "name", style: styles.cellNameDivDiv }, name),
4708
- 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),
4709
4563
  ];
4710
4564
  useDesc = !!oTooltip;
4711
4565
  }
4712
4566
  }
4713
4567
  const narrowStyleWithDetails = this.props.width === 'xs' && this.state.focused === id;
4714
- const colID = (react_1.default.createElement(material_1.Grid2, { container: true, wrap: "nowrap", direction: "row", sx: styles.cellId, style: { width: this.columnsVisibility.id, paddingLeft } },
4715
- 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" },
4716
4570
  checkbox,
4717
4571
  iconFolder),
4718
- 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 }) },
4719
- react_1.default.createElement(material_1.Tooltip, { title: getIdFieldTooltip(item.data, this.props.lang), slotProps: { popper: { sx: styles.tooltip } } },
4720
- 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)),
4721
4580
  alias,
4722
4581
  icons),
4723
- react_1.default.createElement("div", { style: Object.assign(Object.assign({}, styles.grow), (invertBackground ? this.styles.invertedBackgroundFlex : {})) }),
4724
- react_1.default.createElement(material_1.Grid2, { container: true, alignItems: "center" }, iconItem),
4725
- this.props.width !== 'xs' ? (react_1.default.createElement("div", null,
4726
- react_1.default.createElement(IconCopy_1.default, { className: narrowStyleWithDetails ? '' : 'copyButton', style: styles.cellCopyButton, onClick: e => this.onCopy(e, id) }))) : null));
4727
- 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
+ } },
4728
4592
  name,
4729
- !narrowStyleWithDetails && ((_f = item.data) === null || _f === void 0 ? void 0 : _f.title) ? (react_1.default.createElement(material_1.Box, { style: { color: checkColor } },
4730
- 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;
4731
4595
  let colMiddle;
4732
4596
  if (!this.state.statesView) {
4733
4597
  colMiddle = [
4734
- (narrowStyleWithDetails && (obj === null || obj === void 0 ? void 0 : obj.type)) || this.columnsVisibility.type
4598
+ (narrowStyleWithDetails && obj?.type) || this.columnsVisibility.type
4735
4599
  ? {
4736
- 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
+ } },
4737
4604
  typeImg,
4738
- "\u00A0", obj === null || obj === void 0 ? void 0 :
4739
- obj.type)),
4605
+ "\u00A0",
4606
+ obj?.type)),
4740
4607
  type: 'filter_type',
4741
4608
  }
4742
4609
  : null,
4743
4610
  (narrowStyleWithDetails && common) || this.columnsVisibility.role
4744
4611
  ? {
4745
- 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 &&
4746
4616
  enumEditable &&
4747
4617
  this.props.objectBrowserEditRole
4748
4618
  ? 'text'
4749
- : 'default' }), onClick: !narrowStyleWithDetails &&
4619
+ : 'default',
4620
+ }, onClick: !narrowStyleWithDetails &&
4750
4621
  this.state.filter.expertMode &&
4751
4622
  enumEditable &&
4752
4623
  this.props.objectBrowserEditRole
4753
4624
  ? () => this.setState({ roleDialog: item.data.id })
4754
- : undefined }, common === null || common === void 0 ? void 0 : common.role)),
4625
+ : undefined }, common?.role)),
4755
4626
  type: 'filter_role',
4756
4627
  onClick: narrowStyleWithDetails &&
4757
4628
  this.state.filter.expertMode &&
@@ -4763,7 +4634,12 @@ class ObjectBrowserClass extends react_1.Component {
4763
4634
  : null,
4764
4635
  (narrowStyleWithDetails && common) || this.columnsVisibility.room
4765
4636
  ? {
4766
- 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
4767
4643
  ? () => {
4768
4644
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'roomEnums');
4769
4645
  this.setState({
@@ -4794,7 +4670,12 @@ class ObjectBrowserClass extends react_1.Component {
4794
4670
  : null,
4795
4671
  (narrowStyleWithDetails && common) || this.columnsVisibility.func
4796
4672
  ? {
4797
- 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
4798
4679
  ? () => {
4799
4680
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'funcEnums');
4800
4681
  this.setState({
@@ -4827,57 +4708,76 @@ class ObjectBrowserClass extends react_1.Component {
4827
4708
  }
4828
4709
  else {
4829
4710
  colMiddle = [
4830
- (narrowStyleWithDetails && checkVisibleObjectType && ((_g = this.states[id]) === null || _g === void 0 ? void 0 : _g.from)) ||
4711
+ (narrowStyleWithDetails && checkVisibleObjectType && this.states[id]?.from) ||
4831
4712
  this.columnsVisibility.changedFrom
4832
4713
  ? {
4833
- 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)),
4834
4718
  type: 'from',
4835
4719
  }
4836
4720
  : null,
4837
4721
  (narrowStyleWithDetails && q) || this.columnsVisibility.qualityCode
4838
4722
  ? {
4839
- 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)),
4840
4727
  type: 'quality',
4841
4728
  }
4842
4729
  : null,
4843
- (narrowStyleWithDetails && checkVisibleObjectType && ((_j = this.states[id]) === null || _j === void 0 ? void 0 : _j.ts)) ||
4730
+ (narrowStyleWithDetails && checkVisibleObjectType && this.states[id]?.ts) ||
4844
4731
  this.columnsVisibility.timestamp
4845
4732
  ? {
4846
- 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)
4847
- ? 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)
4848
4738
  : null)),
4849
4739
  type: 'ts',
4850
4740
  }
4851
4741
  : null,
4852
- (narrowStyleWithDetails && checkVisibleObjectType && ((_l = this.states[id]) === null || _l === void 0 ? void 0 : _l.lc)) ||
4742
+ (narrowStyleWithDetails && checkVisibleObjectType && this.states[id]?.lc) ||
4853
4743
  this.columnsVisibility.lastChange
4854
4744
  ? {
4855
- 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)
4856
- ? 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)
4857
4750
  : null)),
4858
4751
  type: 'lc',
4859
4752
  }
4860
4753
  : null,
4861
4754
  ];
4862
4755
  }
4863
- 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'
4864
4759
  ? this.columnsVisibility[it.id]
4865
- : 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;
4866
4762
  const columnValue = narrowStyleWithDetails || this.columnsVisibility.val
4867
4763
  ? this.renderColumnValue(id, item, narrowStyleWithDetails)
4868
4764
  : null;
4869
- 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
4870
- ? (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'
4871
4770
  ? 'zoom-in'
4872
4771
  : item.data.button
4873
4772
  ? 'grab'
4874
4773
  : 'text'
4875
- : 'default' }), onClick: valueEditable
4774
+ : 'default',
4775
+ }, onClick: valueEditable
4876
4776
  ? () => {
4877
4777
  if (!obj || !this.states) {
4878
4778
  // return;
4879
4779
  }
4880
- else if ((common === null || common === void 0 ? void 0 : common.type) === 'file') {
4780
+ else if (common?.type === 'file') {
4881
4781
  this.setState({ viewFileDialog: id });
4882
4782
  }
4883
4783
  else if (!this.state.filter.expertMode && item.data.button) {
@@ -4903,7 +4803,10 @@ class ObjectBrowserClass extends react_1.Component {
4903
4803
  }
4904
4804
  }
4905
4805
  : undefined }, columnValue)) : null;
4906
- 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;
4907
4810
  let colDetails = null;
4908
4811
  if (this.props.width === 'xs' && this.state.focused === id) {
4909
4812
  colMiddle = colMiddle.filter(a => a);
@@ -4916,14 +4819,14 @@ class ObjectBrowserClass extends react_1.Component {
4916
4819
  if (!it) {
4917
4820
  return null;
4918
4821
  }
4919
- return (react_1.default.createElement("div", { key: it.type, style: styles.cellDetailsLine },
4920
- 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 },
4921
4824
  this.texts[it.type],
4922
4825
  ":"),
4923
4826
  it.el,
4924
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4925
- it.onClick ? (react_1.default.createElement(icons_material_1.Edit, { style: styles.cellCopyButtonInDetails, onClick: () => {
4926
- 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) {
4927
4830
  it.onClick();
4928
4831
  }
4929
4832
  } })) : null));
@@ -4932,32 +4835,32 @@ class ObjectBrowserClass extends react_1.Component {
4932
4835
  if (!colCustom.length) {
4933
4836
  colCustom = null;
4934
4837
  }
4935
- colDetails = (react_1.default.createElement(material_1.Paper, { style: {
4838
+ colDetails = (React.createElement(Paper, { style: {
4936
4839
  width: '100%',
4937
4840
  display: 'flex',
4938
4841
  flexDirection: 'column',
4939
4842
  padding: 10,
4940
4843
  backgroundColor: this.props.theme.palette.mode === 'dark' ? '#333' : '#ccc',
4941
4844
  } },
4942
- react_1.default.createElement("div", { style: styles.cellDetailsLine },
4943
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4944
- react_1.default.createElement(IconCopy_1.default, { style: styles.cellCopyButtonInDetails, onClick: e => this.onCopy(e, id) })),
4945
- colName && (react_1.default.createElement("div", { style: styles.cellDetailsLine },
4946
- 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 },
4947
4850
  this.texts.name,
4948
4851
  ":"),
4949
4852
  colName,
4950
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4951
- ((_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)),
4952
4855
  renderedMiddle,
4953
- colCustom && react_1.default.createElement("div", { style: styles.cellDetailsLine }, colCustom),
4954
- ((_q = this.objects[id]) === null || _q === void 0 ? void 0 : _q.type) === 'state' && (react_1.default.createElement("div", { style: styles.cellDetailsLine },
4955
- 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 },
4956
4859
  this.texts.value,
4957
4860
  ":"),
4958
4861
  colValue,
4959
- react_1.default.createElement("div", { style: { flexGrow: 1 } }),
4960
- 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 => {
4961
4864
  const { valText } = formatValue({
4962
4865
  state: this.states[id],
4963
4866
  obj: this.objects[id],
@@ -4969,14 +4872,14 @@ class ObjectBrowserClass extends react_1.Component {
4969
4872
  });
4970
4873
  this.onCopy(e, valText.v.toString());
4971
4874
  }, key: "cc" }))),
4972
- 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))));
4973
4876
  colName = null;
4974
4877
  colMiddle = null;
4975
4878
  colCustom = null;
4976
4879
  colValue = null;
4977
4880
  colButtons = null;
4978
4881
  }
4979
- 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 &&
4980
4883
  !item.data.visible &&
4981
4884
  !item.data.hasVisibleChildren &&
4982
4885
  styles.filteredParentOut, this.state.selected.includes(id) && styles.itemSelected, this.state.selectedNonObject === id && styles.itemSelected), key: id, id: id, onMouseDown: e => {
@@ -5008,8 +4911,8 @@ class ObjectBrowserClass extends react_1.Component {
5008
4911
  }
5009
4912
  } },
5010
4913
  colID,
5011
- colName, colMiddle === null || colMiddle === void 0 ? void 0 :
5012
- colMiddle.map(it => it === null || it === void 0 ? void 0 : it.el),
4914
+ colName,
4915
+ colMiddle?.map(it => it?.el),
5013
4916
  colCustom,
5014
4917
  colValue,
5015
4918
  colButtons));
@@ -5026,11 +4929,11 @@ class ObjectBrowserClass extends react_1.Component {
5026
4929
  const DragWrapper = this.props.DragWrapper;
5027
4930
  if (this.props.dragEnabled && DragWrapper) {
5028
4931
  if (root.data.sumVisibility) {
5029
- 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));
5030
4933
  }
5031
4934
  else {
5032
4935
  // change cursor
5033
- 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));
5034
4937
  }
5035
4938
  }
5036
4939
  else {
@@ -5248,11 +5151,106 @@ class ObjectBrowserClass extends react_1.Component {
5248
5151
  }
5249
5152
  }
5250
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
+ };
5251
5250
  /**
5252
5251
  * Handle keyboard events for navigation
5253
5252
  */
5254
5253
  navigateKeyPress(event) {
5255
- var _b, _c;
5256
5254
  const selectedId = this.state.selectedNonObject || this.state.selected[0];
5257
5255
  if (!selectedId) {
5258
5256
  return;
@@ -5260,7 +5258,7 @@ class ObjectBrowserClass extends react_1.Component {
5260
5258
  if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
5261
5259
  event.preventDefault();
5262
5260
  const ids = [];
5263
- (_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));
5264
5262
  const idx = ids.indexOf(selectedId);
5265
5263
  const newIdx = event.code === 'ArrowDown' ? idx + 1 : idx - 1;
5266
5264
  const newId = ids[newIdx] || selectedId;
@@ -5271,10 +5269,10 @@ class ObjectBrowserClass extends react_1.Component {
5271
5269
  this.toggleExpanded(selectedId);
5272
5270
  }
5273
5271
  if (event.code === 'Delete' && this.root && selectedId) {
5274
- const item = _a.getItemFromRoot(this.root, selectedId);
5272
+ const item = ObjectBrowserClass.getItemFromRoot(this.root, selectedId);
5275
5273
  if (item) {
5276
5274
  const { obj } = item.data;
5277
- if (obj && !((_c = obj.common) === null || _c === void 0 ? void 0 : _c.dontDelete)) {
5275
+ if (obj && !obj.common?.dontDelete) {
5278
5276
  this.showDeleteDialog({ id: selectedId, obj, item });
5279
5277
  }
5280
5278
  }
@@ -5282,86 +5280,146 @@ class ObjectBrowserClass extends react_1.Component {
5282
5280
  }
5283
5281
  /**
5284
5282
  * Find the id from the root
5283
+ *
5284
+ * @param root The current root
5285
+ * @param id The object id to find
5285
5286
  */
5286
- static getItemFromRoot(
5287
- /** The current root */
5288
- root,
5289
- /** the object id to find */
5290
- id) {
5291
- var _b;
5287
+ static getItemFromRoot(root, id) {
5292
5288
  const idArr = id.split('.');
5293
5289
  let currId = '';
5294
5290
  let _root = root;
5295
- for (const idEntry of idArr) {
5291
+ for (let i = 0; i < idArr.length; i++) {
5292
+ const idEntry = idArr[i];
5296
5293
  currId = currId ? `${currId}.${idEntry}` : idEntry;
5297
- _root = (_b = _root.children) === null || _b === void 0 ? void 0 : _b.find(item => item.data.id === currId);
5298
- if (!_root) {
5299
- break;
5294
+ let found = false;
5295
+ if (_root.children) {
5296
+ for (let j = 0; j < _root.children.length; j++) {
5297
+ if (_root.children[j].data.id === currId) {
5298
+ _root = _root.children[j];
5299
+ found = true;
5300
+ break;
5301
+ }
5302
+ }
5303
+ }
5304
+ if (!found) {
5305
+ return null;
5300
5306
  }
5301
5307
  }
5302
5308
  return _root || null;
5303
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
+ };
5304
5317
  /**
5305
5318
  * Render the right handle for resizing
5306
5319
  */
5307
5320
  renderHandleRight() {
5308
- 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') }));
5309
5322
  }
5310
5323
  renderHeader() {
5311
5324
  let filterClearInValue = null;
5312
5325
  if (!this.columnsVisibility.buttons && !this.isFilterEmpty()) {
5313
- filterClearInValue = (react_1.default.createElement(material_1.IconButton, { onClick: () => this.clearFilter(), style: styles.buttonClearFilter, title: this.props.t('ra_Clear filter'), size: "large" },
5314
- react_1.default.createElement(IconClearFilter_1.default, null),
5315
- 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 })));
5316
5329
  }
5317
5330
  if (this.props.width === 'xs') {
5318
- return (react_1.default.createElement("div", { style: styles.headerRow },
5319
- 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'))));
5320
5333
  }
5321
- return (react_1.default.createElement("div", { style: styles.headerRow },
5322
- 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" },
5323
5336
  this.getFilterInput('id'),
5324
5337
  this.renderHandleRight()),
5325
- 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" },
5326
5339
  this.getFilterInput('name'),
5327
5340
  this.renderHandleRight())) : null,
5328
- !this.state.statesView && (react_1.default.createElement(react_1.default.Fragment, null,
5329
- 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" },
5330
5347
  this.getFilterSelectType(),
5331
5348
  this.renderHandleRight())) : null,
5332
- 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" },
5333
5354
  this.getFilterSelectRole(),
5334
5355
  this.renderHandleRight())) : null,
5335
- 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" },
5336
5361
  this.getFilterSelectRoom(),
5337
5362
  this.renderHandleRight())) : null,
5338
- 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" },
5339
5368
  this.getFilterSelectFunction(),
5340
5369
  this.renderHandleRight())) : null)),
5341
- this.state.statesView && (react_1.default.createElement(react_1.default.Fragment, null,
5342
- 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" },
5343
5377
  this.props.t('ra_Changed from'),
5344
5378
  this.renderHandleRight()),
5345
- 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" },
5346
5385
  this.props.t('ra_Quality code'),
5347
5386
  this.renderHandleRight()),
5348
- 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" },
5349
5393
  this.props.t('ra_Timestamp'),
5350
5394
  this.renderHandleRight()),
5351
- 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" },
5352
5401
  this.props.t('ra_Last change'),
5353
5402
  this.renderHandleRight()))),
5354
- 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))),
5355
- 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" },
5356
5414
  this.props.t('ra_Value'),
5357
5415
  filterClearInValue)) : null,
5358
- 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 } },
5359
5417
  ' ',
5360
5418
  this.getFilterSelectCustoms())) : null));
5361
5419
  }
5362
5420
  renderToast() {
5363
- 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: '' }) },
5364
- 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" })) }));
5365
5423
  }
5366
5424
  /**
5367
5425
  * Called when component is updated.
@@ -5380,7 +5438,7 @@ class ObjectBrowserClass extends react_1.Component {
5380
5438
  scrollToItem(id) {
5381
5439
  this.selectFirst = '';
5382
5440
  const node = window.document.getElementById(id);
5383
- node === null || node === void 0 ? void 0 : node.scrollIntoView({
5441
+ node?.scrollIntoView({
5384
5442
  behavior: 'auto',
5385
5443
  block: 'center',
5386
5444
  inline: 'center',
@@ -5389,10 +5447,9 @@ class ObjectBrowserClass extends react_1.Component {
5389
5447
  renderCustomDialog() {
5390
5448
  if (this.state.customDialog && this.props.objectCustomDialog) {
5391
5449
  const ObjectCustomDialog = this.props.objectCustomDialog;
5392
- 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
5393
5451
  ? this.systemConfig.common.isFloatComma
5394
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: () => {
5395
- var _b;
5396
5453
  this.pauseSubscribe(false);
5397
5454
  this.setState({ customDialog: null });
5398
5455
  if (this.changedIds) {
@@ -5400,7 +5457,7 @@ class ObjectBrowserClass extends react_1.Component {
5400
5457
  // update all changed IDs
5401
5458
  this.forceUpdate();
5402
5459
  }
5403
- (_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate('tab-objects');
5460
+ this.props.router?.doNavigate('tab-objects');
5404
5461
  }, systemConfig: this.systemConfig }));
5405
5462
  }
5406
5463
  return null;
@@ -5420,18 +5477,17 @@ class ObjectBrowserClass extends react_1.Component {
5420
5477
  return null;
5421
5478
  }
5422
5479
  const ObjectBrowserEditObject = this.props.objectBrowserEditObject;
5423
- 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
5424
5481
  ? this.systemConfig.common.isFloatComma
5425
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
5426
5483
  .setObject(obj._id, obj)
5427
5484
  .then(() => this.setState({ editObjectDialog: obj._id, editObjectAlias: false }, () => this.onSelect(obj._id)))
5428
5485
  .catch(e => this.showError(`Cannot write object: ${e}`)), onClose: (obj) => {
5429
- var _b, _c;
5430
5486
  if (obj) {
5431
5487
  let updateAlias;
5432
5488
  if (this.state.editObjectDialog.startsWith('alias.')) {
5433
- if (JSON.stringify((_b = this.objects[this.state.editObjectDialog].common) === null || _b === void 0 ? void 0 : _b.alias) !==
5434
- 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)) {
5435
5491
  updateAlias = this.state.editObjectDialog;
5436
5492
  }
5437
5493
  }
@@ -5453,14 +5509,14 @@ class ObjectBrowserClass extends react_1.Component {
5453
5509
  return null;
5454
5510
  }
5455
5511
  const ObjectBrowserViewFile = this.props.objectBrowserViewFile;
5456
- 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: '' }) }));
5457
5513
  }
5458
5514
  renderAliasEditorDialog() {
5459
5515
  if (!this.props.objectBrowserAliasEditor || !this.state.showAliasEditor) {
5460
5516
  return null;
5461
5517
  }
5462
5518
  const ObjectBrowserAliasEditor = this.props.objectBrowserAliasEditor;
5463
- 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(() => {
5464
5520
  this.scrollToItem(id);
5465
5521
  setTimeout(() => this.setState({
5466
5522
  editObjectDialog: id,
@@ -5484,8 +5540,8 @@ class ObjectBrowserClass extends react_1.Component {
5484
5540
  if (!this.state.aliasMenu) {
5485
5541
  return null;
5486
5542
  }
5487
- 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) },
5488
- 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, {
5489
5545
  '& .admin-browser-arrow': {
5490
5546
  mr: '8px',
5491
5547
  },
@@ -5495,7 +5551,6 @@ class ObjectBrowserClass extends react_1.Component {
5495
5551
  * Renders the right mouse button context menu
5496
5552
  */
5497
5553
  renderContextMenu() {
5498
- var _b, _c, _d, _e, _f, _g, _h;
5499
5554
  if (!this.state.showContextMenu) {
5500
5555
  return null;
5501
5556
  }
@@ -5545,8 +5600,8 @@ class ObjectBrowserClass extends react_1.Component {
5545
5600
  key: '0',
5546
5601
  visibility: !!(this.props.objectBrowserEditObject &&
5547
5602
  obj &&
5548
- (this.state.filter.expertMode || _a.isNonExpertId(id))),
5549
- 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 })),
5550
5605
  label: this.texts.editObject,
5551
5606
  onClick: () => this.setState({ editObjectDialog: item.data.id, showContextMenu: null, editObjectAlias: false }),
5552
5607
  },
@@ -5557,9 +5612,9 @@ class ObjectBrowserClass extends react_1.Component {
5557
5612
  obj &&
5558
5613
  obj.type === 'state' &&
5559
5614
  // @ts-expect-error deprecated from js-controller 6
5560
- ((_b = obj.common) === null || _b === void 0 ? void 0 : _b.type) !== 'file' &&
5615
+ obj.common?.type !== 'file' &&
5561
5616
  (this.state.filter.expertMode || obj.common.write !== false)),
5562
- 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 })),
5563
5618
  label: this.props.t('ra_Edit value'),
5564
5619
  onClick: () => {
5565
5620
  this.edit = {
@@ -5573,12 +5628,12 @@ class ObjectBrowserClass extends react_1.Component {
5573
5628
  },
5574
5629
  VIEW: {
5575
5630
  visibility: !!this.props.objectBrowserViewFile &&
5576
- (obj === null || obj === void 0 ? void 0 : obj.type) === 'state' &&
5631
+ obj?.type === 'state' &&
5577
5632
  // @ts-expect-error deprecated from js-controller 6
5578
- ((_c = obj.common) === null || _c === void 0 ? void 0 : _c.type) === 'file',
5579
- 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 })),
5580
5635
  label: this.props.t('ra_View file'),
5581
- onClick: () => this.setState({ viewFileDialog: (obj === null || obj === void 0 ? void 0 : obj._id) || '', showContextMenu: null }),
5636
+ onClick: () => this.setState({ viewFileDialog: obj?._id || '', showContextMenu: null }),
5582
5637
  },
5583
5638
  CUSTOM: {
5584
5639
  key: '2',
@@ -5587,16 +5642,15 @@ class ObjectBrowserClass extends react_1.Component {
5587
5642
  obj &&
5588
5643
  obj.type === 'state' &&
5589
5644
  // @ts-expect-error deprecated from js-controller 6
5590
- ((_d = obj.common) === null || _d === void 0 ? void 0 : _d.type) !== 'file'),
5591
- 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
5592
5647
  ? this.styles.cellButtonsButtonWithCustoms
5593
5648
  : styles.cellButtonsButtonWithoutCustoms })),
5594
5649
  style: this.styles.contextMenuCustom,
5595
5650
  label: this.texts.customConfig,
5596
5651
  onClick: () => {
5597
- var _b;
5598
5652
  this.pauseSubscribe(true);
5599
- (_b = this.props.router) === null || _b === void 0 ? void 0 : _b.doNavigate(null, 'customs', id);
5653
+ this.props.router?.doNavigate(null, 'customs', id);
5600
5654
  this.setState({ customDialog: [id], showContextMenu: null });
5601
5655
  },
5602
5656
  },
@@ -5617,14 +5671,14 @@ class ObjectBrowserClass extends react_1.Component {
5617
5671
  ROLE: {
5618
5672
  key: '4',
5619
5673
  visibility: !!(this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole),
5620
- 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 })),
5621
5675
  label: this.props.t('ra_Edit role'),
5622
5676
  onClick: () => this.setState({ roleDialog: item.data.id, showContextMenu: null }),
5623
5677
  },
5624
5678
  FUNCTION: {
5625
5679
  key: '5',
5626
5680
  visibility: !!enumEditable,
5627
- 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 })),
5628
5682
  label: this.props.t('ra_Edit function'),
5629
5683
  onClick: () => {
5630
5684
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'funcEnums');
@@ -5642,7 +5696,7 @@ class ObjectBrowserClass extends react_1.Component {
5642
5696
  ROOM: {
5643
5697
  key: '6',
5644
5698
  visibility: !!enumEditable,
5645
- 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 })),
5646
5700
  label: this.props.t('ra_Edit room'),
5647
5701
  onClick: () => {
5648
5702
  const enums = findEnumsForObjectAsIds(this.info, item.data.id, 'roomEnums');
@@ -5662,19 +5716,17 @@ class ObjectBrowserClass extends react_1.Component {
5662
5716
  visibility: !!(!this.props.notEditable &&
5663
5717
  this.props.objectBrowserAliasEditor &&
5664
5718
  this.props.objectBrowserEditObject &&
5665
- this.state.filter.expertMode &&
5666
- (obj === null || obj === void 0 ? void 0 : obj.type) === 'state' &&
5719
+ obj?.type === 'state' &&
5667
5720
  // @ts-expect-error deprecated from js-controller 6
5668
- ((_e = obj.common) === null || _e === void 0 ? void 0 : _e.type) !== 'file'),
5669
- 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
5670
5723
  ? this.styles.cellButtonsButtonWithCustoms
5671
5724
  : styles.cellButtonsButtonWithoutCustoms })),
5672
5725
  label: this.info.aliasesMap[item.data.id]
5673
5726
  ? this.props.t('ra_Edit alias')
5674
5727
  : this.props.t('ra_Create alias'),
5675
5728
  onClick: () => {
5676
- var _b;
5677
- if ((_b = obj === null || obj === void 0 ? void 0 : obj.common) === null || _b === void 0 ? void 0 : _b.alias) {
5729
+ if (obj?.common?.alias) {
5678
5730
  this.setState({ showContextMenu: null, editObjectDialog: item.data.id, editObjectAlias: true });
5679
5731
  }
5680
5732
  else {
@@ -5686,49 +5738,49 @@ class ObjectBrowserClass extends react_1.Component {
5686
5738
  key: '+',
5687
5739
  visibility: (item.data.id.startsWith('0_userdata.0') || item.data.id.startsWith('javascript.')) &&
5688
5740
  (createStateVisible || createChannelVisible || createDeviceVisible || createFolderVisible),
5689
- 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 })),
5690
5742
  style: styles.contextMenuWithSubMenu,
5691
5743
  label: this.texts.create,
5692
5744
  subMenu: [
5693
5745
  {
5694
5746
  label: this.texts.createBooleanState,
5695
5747
  visibility: createStateVisible,
5696
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5748
+ icon: React.createElement(IconState, { fontSize: "small" }),
5697
5749
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state', 'boolean'),
5698
5750
  },
5699
5751
  {
5700
5752
  label: this.texts.createNumberState,
5701
5753
  visibility: createStateVisible,
5702
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5754
+ icon: React.createElement(IconState, { fontSize: "small" }),
5703
5755
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state', 'number'),
5704
5756
  },
5705
5757
  {
5706
5758
  label: this.texts.createStringState,
5707
5759
  visibility: createStateVisible,
5708
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5760
+ icon: React.createElement(IconState, { fontSize: "small" }),
5709
5761
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state', 'string'),
5710
5762
  },
5711
5763
  {
5712
5764
  label: this.texts.createState,
5713
5765
  visibility: createStateVisible,
5714
- icon: react_1.default.createElement(IconState_1.default, { fontSize: "small" }),
5766
+ icon: React.createElement(IconState, { fontSize: "small" }),
5715
5767
  onClick: () => this.showAddDataPointDialog(item.data.id, 'state'),
5716
5768
  },
5717
5769
  {
5718
5770
  label: this.texts.createChannel,
5719
5771
  visibility: createChannelVisible,
5720
- icon: react_1.default.createElement(IconChannel_1.default, { fontSize: "small" }),
5772
+ icon: React.createElement(IconChannel, { fontSize: "small" }),
5721
5773
  onClick: () => this.showAddDataPointDialog(item.data.id, 'channel'),
5722
5774
  },
5723
5775
  {
5724
5776
  label: this.texts.createDevice,
5725
5777
  visibility: createDeviceVisible,
5726
- icon: react_1.default.createElement(IconDevice_1.default, { fontSize: "small" }),
5778
+ icon: React.createElement(IconDevice, { fontSize: "small" }),
5727
5779
  onClick: () => this.showAddDataPointDialog(item.data.id, 'device'),
5728
5780
  },
5729
5781
  {
5730
5782
  label: this.texts.createFolder,
5731
- icon: react_1.default.createElement(icons_material_1.CreateNewFolder, { fontSize: "small" }),
5783
+ icon: React.createElement(IconFolder, { fontSize: "small" }),
5732
5784
  visibility: createFolderVisible,
5733
5785
  onClick: () => this.showAddDataPointDialog(item.data.id, 'folder'),
5734
5786
  },
@@ -5737,8 +5789,8 @@ class ObjectBrowserClass extends react_1.Component {
5737
5789
  DELETE: {
5738
5790
  key: 'Delete',
5739
5791
  visibility: !!(this.props.onObjectDelete &&
5740
- (((_g = item.children) === null || _g === void 0 ? void 0 : _g.length) || (obj && !((_h = obj.common) === null || _h === void 0 ? void 0 : _h.dontDelete)))),
5741
- 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 })),
5742
5794
  style: this.styles.contextMenuDelete,
5743
5795
  label: this.texts.deleteObject,
5744
5796
  onClick: () => this.setState({ showContextMenu: null }, () => this.showDeleteDialog({
@@ -5749,10 +5801,9 @@ class ObjectBrowserClass extends react_1.Component {
5749
5801
  },
5750
5802
  };
5751
5803
  Object.keys(ITEMS).forEach(key => {
5752
- var _b, _c;
5753
5804
  if (ITEMS[key].visibility) {
5754
5805
  if (ITEMS[key].subMenu) {
5755
- 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 &&
5756
5807
  this.setState({
5757
5808
  showContextMenu: {
5758
5809
  item: this.state.showContextMenu.item,
@@ -5761,14 +5812,14 @@ class ObjectBrowserClass extends react_1.Component {
5761
5812
  subAnchor: e.target,
5762
5813
  },
5763
5814
  }), style: ITEMS[key].style },
5764
- react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, ITEMS[key].iconStyle), ITEMS[key].listItemIconStyle) }, ITEMS[key].icon),
5765
- 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,
5766
5817
  ITEMS[key].label,
5767
5818
  "..."),
5768
- react_1.default.createElement(material_1.ListItemSecondaryAction, null,
5769
- react_1.default.createElement(icons_material_1.ArrowRight, null))));
5770
- if (((_b = this.state.showContextMenu) === null || _b === void 0 ? void 0 : _b.subItem) === key) {
5771
- 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: () => {
5772
5823
  if (this.state.showContextMenu) {
5773
5824
  this.setState({
5774
5825
  showContextMenu: {
@@ -5778,16 +5829,19 @@ class ObjectBrowserClass extends react_1.Component {
5778
5829
  });
5779
5830
  }
5780
5831
  this.contextMenu = null;
5781
- } }, (_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 },
5782
- react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, subItem.iconStyle), (subItem.listItemIconStyle || undefined)) }, subItem.icon),
5783
- 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)));
5784
5838
  }
5785
5839
  }
5786
5840
  else {
5787
- items.push(react_1.default.createElement(material_1.MenuItem, { key: key, onClick: ITEMS[key].onClick, sx: ITEMS[key].style },
5788
- react_1.default.createElement(material_1.ListItemIcon, { style: Object.assign(Object.assign({}, ITEMS[key].iconStyle), ITEMS[key].listItemIconStyle) }, ITEMS[key].icon),
5789
- react_1.default.createElement(material_1.ListItemText, null, ITEMS[key].label),
5790
- 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));
5791
5845
  }
5792
5846
  }
5793
5847
  });
@@ -5795,7 +5849,7 @@ class ObjectBrowserClass extends react_1.Component {
5795
5849
  setTimeout(() => this.setState({ showContextMenu: null }), 100);
5796
5850
  return null;
5797
5851
  }
5798
- 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 => {
5799
5853
  e.preventDefault();
5800
5854
  if (e.altKey) {
5801
5855
  Object.keys(ITEMS).forEach(key => {
@@ -5810,7 +5864,6 @@ class ObjectBrowserClass extends react_1.Component {
5810
5864
  } }, items));
5811
5865
  }
5812
5866
  renderEditValueDialog() {
5813
- var _b;
5814
5867
  if (!this.state.updateOpened || !this.props.objectBrowserValue) {
5815
5868
  return null;
5816
5869
  }
@@ -5822,12 +5875,12 @@ class ObjectBrowserClass extends react_1.Component {
5822
5875
  console.error(`Something went wrong. Possibly the object ${this.edit.id} was deleted.`);
5823
5876
  return null;
5824
5877
  }
5825
- 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
5826
5879
  ? this.objects[this.edit.id].common.type
5827
5880
  : typeof this.edit.val;
5828
5881
  const role = this.objects[this.edit.id].common.role;
5829
5882
  const ObjectBrowserValue = this.props.objectBrowserValue;
5830
- 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
5831
5884
  ? this.systemConfig.common.isFloatComma
5832
5885
  : this.props.isFloatComma, onClose: (res) => {
5833
5886
  this.setState({ updateOpened: false });
@@ -5846,26 +5899,26 @@ class ObjectBrowserClass extends react_1.Component {
5846
5899
  }
5847
5900
  if (this.styleTheme !== this.props.themeType) {
5848
5901
  this.styles = {
5849
- cellIdIconFolder: Utils_1.default.getStyle(this.props.theme, styles.cellIdIconFolder),
5850
- cellIdIconDocument: Utils_1.default.getStyle(this.props.theme, styles.cellIdIconDocument),
5851
- iconDeviceError: Utils_1.default.getStyle(this.props.theme, styles.iconDeviceError),
5852
- iconDeviceConnected: Utils_1.default.getStyle(this.props.theme, styles.iconDeviceConnected),
5853
- iconDeviceDisconnected: Utils_1.default.getStyle(this.props.theme, styles.iconDeviceDisconnected),
5854
- cellButtonsButtonWithCustoms: Utils_1.default.getStyle(this.props.theme, styles.cellButtonsButtonWithCustoms),
5855
- invertedBackground: Utils_1.default.getStyle(this.props.theme, styles.invertedBackground),
5856
- invertedBackgroundFlex: Utils_1.default.getStyle(this.props.theme, styles.invertedBackgroundFlex),
5857
- contextMenuEdit: Utils_1.default.getStyle(this.props.theme, styles.contextMenuEdit),
5858
- contextMenuEditValue: Utils_1.default.getStyle(this.props.theme, styles.contextMenuEditValue),
5859
- contextMenuView: Utils_1.default.getStyle(this.props.theme, styles.contextMenuView),
5860
- contextMenuCustom: Utils_1.default.getStyle(this.props.theme, styles.contextMenuCustom),
5861
- contextMenuACL: Utils_1.default.getStyle(this.props.theme, styles.contextMenuACL),
5862
- contextMenuRoom: Utils_1.default.getStyle(this.props.theme, styles.contextMenuRoom),
5863
- contextMenuRole: Utils_1.default.getStyle(this.props.theme, styles.contextMenuRole),
5864
- contextMenuDelete: Utils_1.default.getStyle(this.props.theme, styles.contextMenuDelete),
5865
- filterInput: Utils_1.default.getStyle(this.props.theme, styles.headerCellInput, styles.filterInput),
5866
- iconCopy: Utils_1.default.getStyle(this.props.theme, styles.cellButtonsValueButton, styles.cellButtonsValueButtonCopy),
5867
- aliasReadWrite: Utils_1.default.getStyle(this.props.theme, styles.cellIdAlias, styles.cellIdAliasReadWrite),
5868
- 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),
5869
5922
  };
5870
5923
  this.styleTheme = this.props.themeType;
5871
5924
  }
@@ -5887,11 +5940,11 @@ class ObjectBrowserClass extends react_1.Component {
5887
5940
  this.checkUnsubscribes();
5888
5941
  }, 200);
5889
5942
  if (!this.state.loaded) {
5890
- return react_1.default.createElement(material_1.CircularProgress, { key: `${this.props.dialogName}_c` });
5943
+ return React.createElement(CircularProgress, { key: `${this.props.dialogName}_c` });
5891
5944
  }
5892
5945
  const items = this.root ? this.renderItem(this.root, undefined) : null;
5893
- return (react_1.default.createElement(TabContainer_1.default, { key: this.props.dialogName },
5894
- react_1.default.createElement("style", null, `
5946
+ return (React.createElement(TabContainer, { key: this.props.dialogName },
5947
+ React.createElement("style", null, `
5895
5948
  @keyframes newValueAnimation-light {
5896
5949
  0% {
5897
5950
  color: #00f900;
@@ -5921,10 +5974,10 @@ class ObjectBrowserClass extends react_1.Component {
5921
5974
  animation: newValueAnimation-light 2s ease-in-out;
5922
5975
  }
5923
5976
  `),
5924
- react_1.default.createElement(TabHeader_1.default, null, this.getToolbar()),
5925
- react_1.default.createElement(TabContent_1.default, null,
5977
+ React.createElement(TabHeader, null, this.getToolbar()),
5978
+ React.createElement(TabContent, null,
5926
5979
  this.renderHeader(),
5927
- 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)),
5928
5981
  this.renderContextMenu(),
5929
5982
  this.renderAliasMenu(),
5930
5983
  this.renderToast(),
@@ -5946,8 +5999,5 @@ class ObjectBrowserClass extends react_1.Component {
5946
5999
  this.props.modalEditOfAccessControl(this, this.state.modalEditOfAccessObjData)));
5947
6000
  }
5948
6001
  }
5949
- exports.ObjectBrowserClass = ObjectBrowserClass;
5950
- _a = ObjectBrowserClass;
5951
- /** Namespaces which are allowed to be edited by non-expert users */
5952
- _ObjectBrowserClass_NON_EXPERT_NAMESPACES = { value: ['0_userdata.0.', 'alias.0.'] };
5953
- exports.default = (0, withWidth_1.default)()(ObjectBrowserClass);
6002
+ export const ObjectBrowser = withWidth()(ObjectBrowserClass);
6003
+ //# sourceMappingURL=ObjectBrowser.js.map