@iobroker/adapter-react-v5 4.8.1 → 4.9.0

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 (265) hide show
  1. package/Components/Logo.d.ts +9 -50
  2. package/Components/Logo.js +106 -173
  3. package/Components/ObjectBrowser.d.ts +9 -0
  4. package/Components/ObjectBrowser.js +370 -165
  5. package/Components/ObjectBrowser.js.map +1 -1
  6. package/Components/SaveCloseButtons.d.ts +17 -61
  7. package/Components/SaveCloseButtons.js +64 -124
  8. package/Components/Schedule.d.ts +31 -6
  9. package/Components/Schedule.js +1144 -1562
  10. package/Components/TabContainer.d.ts +9 -37
  11. package/Components/TabContainer.js +49 -74
  12. package/Components/TabContent.d.ts +6 -27
  13. package/Components/TabContent.js +24 -67
  14. package/Components/TabHeader.d.ts +6 -11
  15. package/Components/TabHeader.js +11 -40
  16. package/Components/ToggleThemeMenu.d.ts +10 -8
  17. package/Components/ToggleThemeMenu.js +16 -36
  18. package/Components/types.d.ts +10 -2
  19. package/Dialogs/SelectID.d.ts +39 -114
  20. package/Dialogs/SelectID.js +141 -246
  21. package/LegacyConnection.d.ts +1 -1
  22. package/README.md +6 -2
  23. package/i18n.d.ts +2 -2
  24. package/index.d.ts +127 -126
  25. package/index.js +213 -192
  26. package/package.json +6 -7
  27. package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
  28. package/Components/JsonConfigComponent/ChipInput.js +0 -763
  29. package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
  30. package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
  31. package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
  32. package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
  33. package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
  34. package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
  35. package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
  36. package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
  37. package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
  38. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
  39. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
  40. package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
  41. package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
  42. package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
  43. package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
  44. package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
  45. package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
  46. package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
  47. package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
  48. package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
  49. package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
  50. package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
  51. package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
  52. package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
  53. package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
  54. package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
  55. package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
  56. package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
  57. package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
  58. package/Components/JsonConfigComponent/ConfigChip.js +0 -120
  59. package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
  60. package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
  61. package/Components/JsonConfigComponent/ConfigColor.js +0 -120
  62. package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
  63. package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
  64. package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
  65. package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
  66. package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
  67. package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
  68. package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
  69. package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
  70. package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
  71. package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
  72. package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
  73. package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
  74. package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
  75. package/Components/JsonConfigComponent/ConfigFile.js +0 -228
  76. package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
  77. package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
  78. package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
  79. package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
  80. package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
  81. package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
  82. package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
  83. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
  84. package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
  85. package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
  86. package/Components/JsonConfigComponent/ConfigIP.js +0 -130
  87. package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
  88. package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
  89. package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
  90. package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
  91. package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
  92. package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
  93. package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
  94. package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
  95. package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
  96. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
  97. package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
  98. package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
  99. package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
  100. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
  101. package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
  102. package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
  103. package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
  104. package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
  105. package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
  106. package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
  107. package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
  108. package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
  109. package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
  110. package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
  111. package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
  112. package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
  113. package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
  114. package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
  115. package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
  116. package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
  117. package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
  118. package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
  119. package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
  120. package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
  121. package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
  122. package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
  123. package/Components/JsonConfigComponent/ConfigPort.js +0 -176
  124. package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
  125. package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
  126. package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
  127. package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
  128. package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
  129. package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
  130. package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
  131. package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
  132. package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
  133. package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
  134. package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
  135. package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
  136. package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
  137. package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
  138. package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
  139. package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
  140. package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
  141. package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
  142. package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
  143. package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
  144. package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
  145. package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
  146. package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
  147. package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
  148. package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
  149. package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
  150. package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
  151. package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
  152. package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
  153. package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
  154. package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
  155. package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
  156. package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
  157. package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
  158. package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
  159. package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
  160. package/Components/JsonConfigComponent/ConfigText.js +0 -226
  161. package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
  162. package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
  163. package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
  164. package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
  165. package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
  166. package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
  167. package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
  168. package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
  169. package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
  170. package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
  171. package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
  172. package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
  173. package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
  174. package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
  175. package/Components/JsonConfigComponent/ConfigUser.js +0 -142
  176. package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
  177. package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
  178. package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
  179. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
  180. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
  181. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
  182. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
  183. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
  184. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
  185. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
  186. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
  187. package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
  188. package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -226
  189. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
  190. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
  191. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
  192. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
  193. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
  194. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
  195. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
  196. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
  197. package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
  198. package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
  199. package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
  200. package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
  201. package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
  202. package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
  203. package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
  204. package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
  205. package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
  206. package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
  207. package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
  208. package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
  209. package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
  210. package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
  211. package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
  212. package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
  213. package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
  214. package/Components/JsonConfigComponent/index.d.ts +0 -26
  215. package/Components/JsonConfigComponent/index.js +0 -520
  216. package/Components/JsonConfigComponent/index.js.map +0 -1
  217. package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
  218. package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
  219. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
  220. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
  221. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
  222. package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
  223. package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
  224. package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
  225. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
  226. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
  227. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
  228. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
  229. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
  230. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
  231. package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
  232. package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
  233. package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
  234. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
  235. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
  236. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
  237. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
  238. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
  239. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
  240. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
  241. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
  242. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
  243. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
  244. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
  245. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
  246. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
  247. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
  248. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
  249. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
  250. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
  251. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
  252. package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
  253. package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
  254. package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
  255. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
  256. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
  257. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
  258. package/Components/Logo.js.map +0 -1
  259. package/Components/SaveCloseButtons.js.map +0 -1
  260. package/Components/Schedule.js.map +0 -1
  261. package/Components/TabContainer.js.map +0 -1
  262. package/Components/TabContent.js.map +0 -1
  263. package/Components/TabHeader.js.map +0 -1
  264. package/Components/ToggleThemeMenu.js.map +0 -1
  265. package/Dialogs/SelectID.js.map +0 -1
@@ -37,6 +37,7 @@ var _IconState = _interopRequireDefault(require("../icons/IconState"));
37
37
  var _IconClosed = _interopRequireDefault(require("../icons/IconClosed"));
38
38
  var _IconOpen = _interopRequireDefault(require("../icons/IconOpen"));
39
39
  var _IconClearFilter = _interopRequireDefault(require("../icons/IconClearFilter"));
40
+ var _Connection = _interopRequireDefault(require("../Connection"));
40
41
  var _Icon = _interopRequireDefault(require("./Icon"));
41
42
  var _withWidth = _interopRequireDefault(require("./withWidth"));
42
43
  var _Utils = _interopRequireDefault(require("./Utils"));
@@ -489,7 +490,7 @@ var styles = function styles(theme) {
489
490
  marginTop: -2
490
491
  },
491
492
  cellButtonsButtonWithCustoms: {
492
- color: theme.palette.secondary.main
493
+ color: theme.palette.mode === 'dark' ? theme.palette.primary.main : theme.palette.secondary.main
493
494
  },
494
495
  cellButtonsButtonWithoutCustoms: {
495
496
  opacity: 0.2
@@ -746,6 +747,9 @@ var styles = function styles(theme) {
746
747
  marginLeft: theme.spacing(1),
747
748
  opacity: 0.7,
748
749
  fontSize: 'smaller'
750
+ },
751
+ contextMenuWithSubMenu: {
752
+ display: 'flex'
749
753
  }
750
754
  };
751
755
  };
@@ -1296,7 +1300,7 @@ function buildTree(objects, options) {
1296
1300
  do {
1297
1301
  repeat = false;
1298
1302
 
1299
- // If current level is still OK, and we can add ID to children
1303
+ // If the current level is still OK, and we can add ID to children
1300
1304
  if (!currentPath || id.startsWith("".concat(currentPath, "."))) {
1301
1305
  var _obj$common, _obj$common2, _obj$common3, _obj$common4;
1302
1306
  // if more than one level added
@@ -1913,7 +1917,14 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
1913
1917
  if (_this.contextMenu && Date.now() - _this.contextMenu.ts < 2000) {
1914
1918
  e.preventDefault();
1915
1919
  _this.setState({
1916
- showContextMenu: _this.contextMenu.item
1920
+ showContextMenu: {
1921
+ item: _this.contextMenu.item
1922
+ }
1923
+ });
1924
+ } else if (_this.state.showContextMenu) {
1925
+ e.preventDefault();
1926
+ _this.setState({
1927
+ showContextMenu: null
1917
1928
  });
1918
1929
  }
1919
1930
  _this.contextMenu = null;
@@ -2780,7 +2791,15 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
2780
2791
  aclEveryone_read_object: props.t('ra_aclEveryone_read_object'),
2781
2792
  aclEveryone_read_state: props.t('ra_aclEveryone_read_state'),
2782
2793
  aclEveryone_write_object: props.t('ra_aclEveryone_write_object'),
2783
- aclEveryone_write_state: props.t('ra_aclEveryone_write_state')
2794
+ aclEveryone_write_state: props.t('ra_aclEveryone_write_state'),
2795
+ create: props.t('ra_Create'),
2796
+ createBooleanState: props.t('ra_create_boolean_state'),
2797
+ createNumberState: props.t('ra_create_number_state'),
2798
+ createStringState: props.t('ra_create_string_state'),
2799
+ createState: props.t('ra_create_state'),
2800
+ createChannel: props.t('ra_create_channel'),
2801
+ createDevice: props.t('ra_create_device'),
2802
+ createFolder: props.t('ra_Create folder')
2784
2803
  };
2785
2804
  _this.levelPadding = props.levelPadding || ITEM_LEVEL;
2786
2805
  var resizerCurrentWidths = (window._localStorage || window.localStorage).getItem("".concat(_this.props.dialogName || 'App', ".table"));
@@ -2807,131 +2826,182 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
2807
2826
  }
2808
2827
  (0, _createClass2["default"])(ObjectBrowser, [{
2809
2828
  key: "loadAllObjects",
2810
- value: function loadAllObjects(update) {
2811
- var _this2 = this;
2812
- var props = this.props;
2813
- var objects;
2814
- return new Promise(function (resolve) {
2815
- _this2.setState({
2816
- updating: true
2817
- }, function () {
2818
- return resolve();
2819
- });
2820
- }).then(function () {
2821
- return _this2.props.objectsWorker ? _this2.props.objectsWorker.getObjects(update) : props.socket.getObjects(update, true);
2822
- }).then(function (_objects) {
2823
- objects = _objects;
2824
- if (props.types && props.types[0] !== 'state') {
2825
- if (props.length >= 1) {
2826
- console.error('more than one type does not supported! Use filterFunc instead');
2827
- }
2828
- return props.socket.getObjectViewSystem(props.types[0], null, null);
2829
- }
2830
- return !objects['system.config'] ? props.socket.getObject('system.config').then(function (obj) {
2831
- return {
2832
- 'system.config': obj
2833
- };
2834
- }) : Promise.resolve(null);
2835
- }).then(function (moreObjects) {
2836
- _this2.systemConfig = objects['system.config'] || moreObjects['system.config'] || {};
2837
- if (moreObjects) {
2838
- if (moreObjects['system.config']) {
2839
- delete moreObjects['system.config'];
2840
- }
2841
- Object.assign(objects, moreObjects);
2842
- }
2843
- _this2.systemConfig.common = _this2.systemConfig.common || {};
2844
- _this2.systemConfig.common.defaultNewAcl = _this2.systemConfig.common.defaultNewAcl || {};
2845
- _this2.systemConfig.common.defaultNewAcl.owner = _this2.systemConfig.common.defaultNewAcl.owner || 'system.user.admin';
2846
- _this2.systemConfig.common.defaultNewAcl.ownerGroup = _this2.systemConfig.common.defaultNewAcl.ownerGroup || 'system.group.administrator';
2847
- if (typeof _this2.systemConfig.common.defaultNewAcl.state !== 'number') {
2848
- // TODO: may be convert here from string
2849
- _this2.systemConfig.common.defaultNewAcl.state = 0x664;
2850
- }
2851
- if (typeof _this2.systemConfig.common.defaultNewAcl.object !== 'number') {
2852
- // TODO: may be convert here from string
2853
- _this2.systemConfig.common.defaultNewAcl.state = 0x664;
2854
- }
2855
- if (typeof props.filterFunc === 'function') {
2856
- _this2.objects = {};
2857
- Object.keys(objects).forEach(function (id) {
2858
- try {
2859
- if (props.filterFunc(objects[id])) {
2860
- _this2.objects[id] = objects[id];
2829
+ value: function () {
2830
+ var _loadAllObjects = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(update) {
2831
+ var _this2 = this;
2832
+ var props, objects, i, moreObjects, columnsForAdmin, _buildTree2, info, root, node;
2833
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
2834
+ while (1) switch (_context4.prev = _context4.next) {
2835
+ case 0:
2836
+ props = this.props;
2837
+ _context4.prev = 1;
2838
+ _context4.next = 4;
2839
+ return new Promise(function (resolve) {
2840
+ _this2.setState({
2841
+ updating: true
2842
+ }, function () {
2843
+ return resolve();
2844
+ });
2845
+ });
2846
+ case 4:
2847
+ if (!this.props.objectsWorker) {
2848
+ _context4.next = 10;
2849
+ break;
2850
+ }
2851
+ _context4.next = 7;
2852
+ return this.props.objectsWorker.getObjects(update);
2853
+ case 7:
2854
+ _context4.t0 = _context4.sent;
2855
+ _context4.next = 13;
2856
+ break;
2857
+ case 10:
2858
+ _context4.next = 12;
2859
+ return props.socket.getObjects(update, true);
2860
+ case 12:
2861
+ _context4.t0 = _context4.sent;
2862
+ case 13:
2863
+ objects = _context4.t0;
2864
+ if (!(props.types && _Connection["default"].isWeb())) {
2865
+ _context4.next = 26;
2866
+ break;
2867
+ }
2868
+ i = 0;
2869
+ case 16:
2870
+ if (!(i < props.types.length)) {
2871
+ _context4.next = 26;
2872
+ break;
2873
+ }
2874
+ if (!(props.types[i] === 'state' || props.types[i] === 'channel' || props.types[i] === 'device' || props.types[i] === 'enum')) {
2875
+ _context4.next = 19;
2876
+ break;
2877
+ }
2878
+ return _context4.abrupt("continue", 23);
2879
+ case 19:
2880
+ _context4.next = 21;
2881
+ return props.socket.getObjectViewSystem(props.types[i], null, null);
2882
+ case 21:
2883
+ moreObjects = _context4.sent;
2884
+ Object.assign(objects, moreObjects);
2885
+ case 23:
2886
+ i++;
2887
+ _context4.next = 16;
2888
+ break;
2889
+ case 26:
2890
+ _context4.t1 = this.systemConfig || objects['system.config'];
2891
+ if (_context4.t1) {
2892
+ _context4.next = 31;
2893
+ break;
2894
+ }
2895
+ _context4.next = 30;
2896
+ return props.socket.getObject('system.config');
2897
+ case 30:
2898
+ _context4.t1 = _context4.sent;
2899
+ case 31:
2900
+ this.systemConfig = _context4.t1;
2901
+ this.systemConfig.common = this.systemConfig.common || {};
2902
+ this.systemConfig.common.defaultNewAcl = this.systemConfig.common.defaultNewAcl || {};
2903
+ this.systemConfig.common.defaultNewAcl.owner = this.systemConfig.common.defaultNewAcl.owner || 'system.user.admin';
2904
+ this.systemConfig.common.defaultNewAcl.ownerGroup = this.systemConfig.common.defaultNewAcl.ownerGroup || 'system.group.administrator';
2905
+ if (typeof this.systemConfig.common.defaultNewAcl.state !== 'number') {
2906
+ // TODO: may be convert here from string
2907
+ this.systemConfig.common.defaultNewAcl.state = 0x664;
2908
+ }
2909
+ if (typeof this.systemConfig.common.defaultNewAcl.object !== 'number') {
2910
+ // TODO: may be convert here from string
2911
+ this.systemConfig.common.defaultNewAcl.state = 0x664;
2912
+ }
2913
+ if (typeof props.filterFunc === 'function') {
2914
+ this.objects = {};
2915
+ Object.keys(objects).forEach(function (id) {
2916
+ try {
2917
+ if (props.filterFunc(objects[id])) {
2918
+ _this2.objects[id] = objects[id];
2919
+ }
2920
+ } catch (e) {
2921
+ console.log("Error by filtering of \"".concat(id, "\": ").concat(e));
2922
+ }
2923
+ });
2924
+ } else if (props.types) {
2925
+ this.objects = {};
2926
+ Object.keys(objects).forEach(function (id) {
2927
+ var type = objects[id] && objects[id].type;
2928
+ // include "folder" types too
2929
+ if (type && (type === 'channel' || type === 'device' || type === 'enum' || type === 'folder' || type === 'adapter' || type === 'instance' || props.types.includes(type))) {
2930
+ _this2.objects[id] = objects[id];
2931
+ }
2932
+ });
2933
+ } else {
2934
+ this.objects = objects;
2861
2935
  }
2862
- } catch (e) {
2863
- console.log("Error by filtering of \"".concat(id, "\": ").concat(e));
2864
- }
2865
- });
2866
- } else if (props.types) {
2867
- _this2.objects = {};
2868
- Object.keys(objects).forEach(function (id) {
2869
- var type = objects[id] && objects[id].type;
2870
- // include "folder" types too
2871
- if (type && (type === 'channel' || type === 'device' || type === 'enum' || type === 'folder' || type === 'adapter' || type === 'instance' || props.types.includes(type))) {
2872
- _this2.objects[id] = objects[id];
2873
- }
2874
- });
2875
- } else {
2876
- _this2.objects = objects;
2877
- }
2878
-
2879
- // read default history
2880
- _this2.defaultHistory = _this2.systemConfig.common.defaultHistory;
2881
- if (_this2.defaultHistory) {
2882
- props.socket.getState("system.adapter.".concat(_this2.defaultHistory, ".alive")).then(function (state) {
2883
- if (!state || !state.val) {
2884
- _this2.defaultHistory = '';
2885
- }
2886
- })["catch"](function (e) {
2887
- return window.alert("Cannot get state: ".concat(e));
2888
- });
2889
- }
2890
- return _this2.getAdditionalColumns();
2891
- }).then(function (columnsForAdmin) {
2892
- _this2.calculateColumnsVisibility(null, null, columnsForAdmin);
2893
- var _buildTree2 = buildTree(_this2.objects, _this2.props),
2894
- info = _buildTree2.info,
2895
- root = _buildTree2.root;
2896
- _this2.root = root;
2897
- _this2.info = info;
2898
2936
 
2899
- // Show first selected item
2900
- var node = _this2.state.selected && _this2.state.selected.length && findNode(_this2.root, _this2.state.selected[0]);
2901
- _this2.lastAppliedFilter = null;
2937
+ // read default history
2938
+ this.defaultHistory = this.systemConfig.common.defaultHistory;
2939
+ if (this.defaultHistory) {
2940
+ props.socket.getState("system.adapter.".concat(this.defaultHistory, ".alive")).then(function (state) {
2941
+ if (!state || !state.val) {
2942
+ _this2.defaultHistory = '';
2943
+ }
2944
+ })["catch"](function (e) {
2945
+ return window.alert("Cannot get state: ".concat(e));
2946
+ });
2947
+ }
2948
+ _context4.next = 43;
2949
+ return this.getAdditionalColumns();
2950
+ case 43:
2951
+ columnsForAdmin = _context4.sent;
2952
+ this.calculateColumnsVisibility(null, null, columnsForAdmin);
2953
+ _buildTree2 = buildTree(this.objects, this.props), info = _buildTree2.info, root = _buildTree2.root;
2954
+ this.root = root;
2955
+ this.info = info;
2902
2956
 
2903
- // If the selected ID is not visible, reset filter
2904
- if (node && !applyFilter(node, _this2.state.filter, _this2.props.lang, _this2.objects, null, null, props.customFilter, props.types)) {
2905
- // reset filter
2906
- _this2.setState({
2907
- filter: _objectSpread({}, DEFAULT_FILTER),
2908
- columnsForAdmin: columnsForAdmin
2909
- }, function () {
2910
- _this2.setState({
2911
- loaded: true,
2912
- updating: false
2913
- }, function () {
2914
- return _this2.expandAllSelected(function () {
2915
- return _this2.onAfterSelect();
2916
- });
2917
- });
2918
- });
2919
- } else {
2920
- _this2.setState({
2921
- loaded: true,
2922
- updating: false,
2923
- columnsForAdmin: columnsForAdmin
2924
- }, function () {
2925
- return _this2.expandAllSelected(function () {
2926
- return _this2.onAfterSelect();
2927
- });
2928
- });
2929
- }
2930
- })["catch"](function (e) {
2931
- return _this2.showError(e);
2932
- });
2933
- }
2957
+ // Show first selected item
2958
+ node = this.state.selected && this.state.selected.length && findNode(this.root, this.state.selected[0]);
2959
+ this.lastAppliedFilter = null;
2934
2960
 
2961
+ // If the selected ID is not visible, reset filter
2962
+ if (node && !applyFilter(node, this.state.filter, this.props.lang, this.objects, null, null, props.customFilter, props.types)) {
2963
+ // reset filter
2964
+ this.setState({
2965
+ filter: _objectSpread({}, DEFAULT_FILTER),
2966
+ columnsForAdmin: columnsForAdmin
2967
+ }, function () {
2968
+ _this2.setState({
2969
+ loaded: true,
2970
+ updating: false
2971
+ }, function () {
2972
+ return _this2.expandAllSelected(function () {
2973
+ return _this2.onAfterSelect();
2974
+ });
2975
+ });
2976
+ });
2977
+ } else {
2978
+ this.setState({
2979
+ loaded: true,
2980
+ updating: false,
2981
+ columnsForAdmin: columnsForAdmin
2982
+ }, function () {
2983
+ return _this2.expandAllSelected(function () {
2984
+ return _this2.onAfterSelect();
2985
+ });
2986
+ });
2987
+ }
2988
+ _context4.next = 56;
2989
+ break;
2990
+ case 53:
2991
+ _context4.prev = 53;
2992
+ _context4.t2 = _context4["catch"](1);
2993
+ this.showError(_context4.t2);
2994
+ case 56:
2995
+ case "end":
2996
+ return _context4.stop();
2997
+ }
2998
+ }, _callee4, this, [[1, 53]]);
2999
+ }));
3000
+ function loadAllObjects(_x5) {
3001
+ return _loadAllObjects.apply(this, arguments);
3002
+ }
3003
+ return loadAllObjects;
3004
+ }()
2935
3005
  /**
2936
3006
  * Check if it is a non-expert id
2937
3007
  *
@@ -3018,11 +3088,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
3018
3088
  * Called when component is mounted.
3019
3089
  */
3020
3090
  function () {
3021
- var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
3022
- return _regenerator["default"].wrap(function _callee4$(_context4) {
3023
- while (1) switch (_context4.prev = _context4.next) {
3091
+ var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
3092
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
3093
+ while (1) switch (_context5.prev = _context5.next) {
3024
3094
  case 0:
3025
- _context4.next = 2;
3095
+ _context5.next = 2;
3026
3096
  return this.loadAllObjects(!objectsAlreadyLoaded);
3027
3097
  case 2:
3028
3098
  if (this.props.objectsWorker) {
@@ -3034,9 +3104,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
3034
3104
  window.addEventListener('contextmenu', this.onContextMenu, true);
3035
3105
  case 5:
3036
3106
  case "end":
3037
- return _context4.stop();
3107
+ return _context5.stop();
3038
3108
  }
3039
- }, _callee4, this);
3109
+ }, _callee5, this);
3040
3110
  }));
3041
3111
  function componentDidMount() {
3042
3112
  return _componentDidMount.apply(this, arguments);
@@ -4068,47 +4138,47 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
4068
4138
  }, {
4069
4139
  key: "_exportObjects",
4070
4140
  value: (function () {
4071
- var _exportObjects2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(options) {
4141
+ var _exportObjects2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(options) {
4072
4142
  var result, id, ids, _iterator2, _step2, _result$key, key, state, enums;
4073
- return _regenerator["default"].wrap(function _callee5$(_context5) {
4074
- while (1) switch (_context5.prev = _context5.next) {
4143
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
4144
+ while (1) switch (_context6.prev = _context6.next) {
4075
4145
  case 0:
4076
4146
  if (!options.isAll) {
4077
- _context5.next = 3;
4147
+ _context6.next = 3;
4078
4148
  break;
4079
4149
  }
4080
4150
  generateFile('allObjects.json', this.objects, options);
4081
- return _context5.abrupt("return");
4151
+ return _context6.abrupt("return");
4082
4152
  case 3:
4083
4153
  if (this.state.selected.length || this.state.selectedNonObject) {
4084
- _context5.next = 6;
4154
+ _context6.next = 6;
4085
4155
  break;
4086
4156
  }
4087
4157
  window.alert(this.props.t('ra_Save of objects-tree is not possible'));
4088
- return _context5.abrupt("return");
4158
+ return _context6.abrupt("return");
4089
4159
  case 6:
4090
4160
  result = {};
4091
4161
  id = this.state.selected[0] || this.state.selectedNonObject;
4092
4162
  ids = this._getSelectedIdsForExport();
4093
4163
  _iterator2 = _createForOfIteratorHelper(ids);
4094
- _context5.prev = 10;
4164
+ _context6.prev = 10;
4095
4165
  _iterator2.s();
4096
4166
  case 12:
4097
4167
  if ((_step2 = _iterator2.n()).done) {
4098
- _context5.next = 23;
4168
+ _context6.next = 23;
4099
4169
  break;
4100
4170
  }
4101
4171
  key = _step2.value;
4102
4172
  result[key] = JSON.parse(JSON.stringify(this.objects[key]));
4103
4173
  // read states values
4104
4174
  if (!(((_result$key = result[key]) === null || _result$key === void 0 ? void 0 : _result$key.type) === 'state' && !options.noStatesByExportImport)) {
4105
- _context5.next = 20;
4175
+ _context6.next = 20;
4106
4176
  break;
4107
4177
  }
4108
- _context5.next = 18;
4178
+ _context6.next = 18;
4109
4179
  return this.props.socket.getState(key);
4110
4180
  case 18:
4111
- state = _context5.sent;
4181
+ state = _context6.sent;
4112
4182
  if (state) {
4113
4183
  result[key].val = state.val;
4114
4184
  result[key].ack = state.ack;
@@ -4122,28 +4192,28 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
4122
4192
  }
4123
4193
  }
4124
4194
  case 21:
4125
- _context5.next = 12;
4195
+ _context6.next = 12;
4126
4196
  break;
4127
4197
  case 23:
4128
- _context5.next = 28;
4198
+ _context6.next = 28;
4129
4199
  break;
4130
4200
  case 25:
4131
- _context5.prev = 25;
4132
- _context5.t0 = _context5["catch"](10);
4133
- _iterator2.e(_context5.t0);
4201
+ _context6.prev = 25;
4202
+ _context6.t0 = _context6["catch"](10);
4203
+ _iterator2.e(_context6.t0);
4134
4204
  case 28:
4135
- _context5.prev = 28;
4205
+ _context6.prev = 28;
4136
4206
  _iterator2.f();
4137
- return _context5.finish(28);
4207
+ return _context6.finish(28);
4138
4208
  case 31:
4139
4209
  generateFile("".concat(id, ".json"), result, options);
4140
4210
  case 32:
4141
4211
  case "end":
4142
- return _context5.stop();
4212
+ return _context6.stop();
4143
4213
  }
4144
- }, _callee5, this, [[10, 25, 28, 31]]);
4214
+ }, _callee6, this, [[10, 25, 28, 31]]);
4145
4215
  }));
4146
- function _exportObjects(_x5) {
4216
+ function _exportObjects(_x6) {
4147
4217
  return _exportObjects2.apply(this, arguments);
4148
4218
  }
4149
4219
  return _exportObjects;
@@ -4398,7 +4468,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
4398
4468
  disabled: !allowObjectCreation,
4399
4469
  onClick: function onClick() {
4400
4470
  return _this25.setState({
4401
- modalNewObj: true
4471
+ modalNewObj: {
4472
+ id: _this25.state.selected[0] || _this25.state.selectedNonObject
4473
+ }
4402
4474
  });
4403
4475
  },
4404
4476
  size: "large"
@@ -6401,6 +6473,18 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
6401
6473
  }
6402
6474
  });
6403
6475
  }
6476
+ }, {
6477
+ key: "showAddDataPointDialog",
6478
+ value: function showAddDataPointDialog(id, initialType, initialStateType) {
6479
+ this.setState({
6480
+ showContextMenu: null,
6481
+ modalNewObj: {
6482
+ id: id,
6483
+ initialType: initialType,
6484
+ initialStateType: initialStateType
6485
+ }
6486
+ });
6487
+ }
6404
6488
 
6405
6489
  /**
6406
6490
  * Renders the right mouse button context menu
@@ -6422,7 +6506,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
6422
6506
  if (!this.state.showContextMenu) {
6423
6507
  return null;
6424
6508
  }
6425
- var item = this.state.showContextMenu;
6509
+ var item = this.state.showContextMenu.item;
6426
6510
  var id = item.data.id;
6427
6511
  var items = [];
6428
6512
  // const ctrl = isIOS() ? '⌘' : (this.props.lang === 'de' ? 'Strg+' : 'Ctrl+');
@@ -6439,6 +6523,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
6439
6523
  }
6440
6524
  }
6441
6525
  var enumEditable = !this.props.notEditable && obj && (this.state.filter.expertMode || obj.type === 'state' || obj.type === 'channel' || obj.type === 'device');
6526
+ var createStateVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.obj.type === 'channel' || item.data.obj.type === 'device' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
6527
+ var createChannelVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.obj.type === 'device' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
6528
+ var createDeviceVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
6529
+ var createFolderVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
6442
6530
  var ITEMS = {
6443
6531
  EDIT: {
6444
6532
  key: '0',
@@ -6612,6 +6700,80 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
6612
6700
  }
6613
6701
  }
6614
6702
  },
6703
+ CREATE: {
6704
+ key: '+',
6705
+ visibility: (item.data.id.startsWith('0_userdata.0') || item.data.id.startsWith('javascript.')) && (createStateVisible || createChannelVisible || createDeviceVisible || createFolderVisible),
6706
+ icon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Add, {
6707
+ fontSize: "small",
6708
+ className: this.props.classes.cellButtonsButtonWithCustoms
6709
+ }),
6710
+ className: this.props.classes.contextMenuWithSubMenu,
6711
+ label: this.texts.create,
6712
+ subMenu: [{
6713
+ label: this.texts.createBooleanState,
6714
+ visibility: createStateVisible,
6715
+ icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
6716
+ fontSize: "small"
6717
+ }),
6718
+ onClick: function onClick() {
6719
+ return _this46.showAddDataPointDialog(item.data.id, 'state', 'boolean');
6720
+ }
6721
+ }, {
6722
+ label: this.texts.createNumberState,
6723
+ visibility: createStateVisible,
6724
+ icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
6725
+ fontSize: "small"
6726
+ }),
6727
+ onClick: function onClick() {
6728
+ return _this46.showAddDataPointDialog(item.data.id, 'state', 'number');
6729
+ }
6730
+ }, {
6731
+ label: this.texts.createStringState,
6732
+ visibility: createStateVisible,
6733
+ icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
6734
+ fontSize: "small"
6735
+ }),
6736
+ onClick: function onClick() {
6737
+ return _this46.showAddDataPointDialog(item.data.id, 'state', 'string');
6738
+ }
6739
+ }, {
6740
+ label: this.texts.createState,
6741
+ visibility: createStateVisible,
6742
+ icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
6743
+ fontSize: "small"
6744
+ }),
6745
+ onClick: function onClick() {
6746
+ return _this46.showAddDataPointDialog(item.data.id, 'state');
6747
+ }
6748
+ }, {
6749
+ label: this.texts.createChannel,
6750
+ visibility: createChannelVisible,
6751
+ icon: /*#__PURE__*/_react["default"].createElement(_IconChannel["default"], {
6752
+ fontSize: "small"
6753
+ }),
6754
+ onClick: function onClick() {
6755
+ return _this46.showAddDataPointDialog(item.data.id, 'channel');
6756
+ }
6757
+ }, {
6758
+ label: this.texts.createDevice,
6759
+ visibility: createDeviceVisible,
6760
+ icon: /*#__PURE__*/_react["default"].createElement(_IconDevice["default"], {
6761
+ fontSize: "small"
6762
+ }),
6763
+ onClick: function onClick() {
6764
+ return _this46.showAddDataPointDialog(item.data.id, 'device');
6765
+ }
6766
+ }, {
6767
+ label: this.texts.createFolder,
6768
+ icon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.CreateNewFolder, {
6769
+ fontSize: "small"
6770
+ }),
6771
+ visibility: createFolderVisible,
6772
+ onClick: function onClick() {
6773
+ return _this46.showAddDataPointDialog(item.data.id, 'folder');
6774
+ }
6775
+ }]
6776
+ },
6615
6777
  DELETE: {
6616
6778
  key: 'Delete',
6617
6779
  visibility: this.props.onObjectDelete && (((_item$children6 = item.children) === null || _item$children6 === void 0 ? void 0 : _item$children6.length) || obj && !((_obj$common15 = obj.common) !== null && _obj$common15 !== void 0 && _obj$common15.dontDelete)),
@@ -6636,16 +6798,59 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
6636
6798
  };
6637
6799
  Object.keys(ITEMS).forEach(function (key) {
6638
6800
  if (ITEMS[key].visibility) {
6639
- items.push( /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
6640
- key: key,
6641
- onClick: ITEMS[key].onClick,
6642
- className: ITEMS[key].className
6643
- }, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, {
6644
- style: ITEMS[key].iconStyle,
6645
- className: ITEMS[key].listItemIconClass
6646
- }, ITEMS[key].icon), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, null, ITEMS[key].label), ITEMS[key].key ? /*#__PURE__*/_react["default"].createElement("div", {
6647
- className: _this46.props.classes.contextMenuKeys
6648
- }, "Alt+".concat(ITEMS[key].key === 'Delete' ? _this46.props.t('ra_Del') : ITEMS[key].key)) : null));
6801
+ if (ITEMS[key].subMenu) {
6802
+ items.push( /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
6803
+ key: key,
6804
+ onClick: function onClick(e) {
6805
+ return _this46.setState({
6806
+ showContextMenu: {
6807
+ item: _this46.state.showContextMenu.item,
6808
+ subItem: key,
6809
+ subAnchor: e.target
6810
+ }
6811
+ });
6812
+ },
6813
+ className: ITEMS[key].className
6814
+ }, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, {
6815
+ style: ITEMS[key].iconStyle,
6816
+ className: ITEMS[key].listItemIconClass
6817
+ }, ITEMS[key].icon), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, null, ITEMS[key].label, "..."), /*#__PURE__*/_react["default"].createElement(_material.ListItemSecondaryAction, null, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.ArrowRight, null))));
6818
+ if (_this46.state.showContextMenu.subItem === key) {
6819
+ items.push( /*#__PURE__*/_react["default"].createElement(_material.Menu, {
6820
+ key: "subContextMenu",
6821
+ open: !0,
6822
+ anchorEl: _this46.state.showContextMenu.subAnchor,
6823
+ onClose: function onClose() {
6824
+ _this46.setState({
6825
+ showContextMenu: {
6826
+ item: _this46.state.showContextMenu.item
6827
+ }
6828
+ });
6829
+ _this46.contextMenu = null;
6830
+ }
6831
+ }, ITEMS[key].subMenu.map(function (subItem) {
6832
+ return subItem.visibility ? /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
6833
+ key: subItem.label,
6834
+ onClick: subItem.onClick,
6835
+ className: subItem.className
6836
+ }, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, {
6837
+ style: subItem.iconStyle,
6838
+ className: subItem.listItemIconClass
6839
+ }, subItem.icon), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, null, subItem.label)) : null;
6840
+ })));
6841
+ }
6842
+ } else {
6843
+ items.push( /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
6844
+ key: key,
6845
+ onClick: ITEMS[key].onClick,
6846
+ className: ITEMS[key].className
6847
+ }, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, {
6848
+ style: ITEMS[key].iconStyle,
6849
+ className: ITEMS[key].listItemIconClass
6850
+ }, ITEMS[key].icon), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, null, ITEMS[key].label), ITEMS[key].key ? /*#__PURE__*/_react["default"].createElement("div", {
6851
+ className: _this46.props.classes.contextMenuKeys
6852
+ }, "Alt+".concat(ITEMS[key].key === 'Delete' ? _this46.props.t('ra_Del') : ITEMS[key].key)) : null));
6853
+ }
6649
6854
  }
6650
6855
  });
6651
6856
  if (!items.length) {