@iobroker/adapter-react-v5 2.1.6 → 2.1.10
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.
- package/Components/404.js +17 -25
- package/Components/404.js.map +1 -1
- package/Components/ColorPicker.js +25 -35
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js +29 -37
- package/Components/ComplexCron.js.map +1 -1
- package/Components/FileBrowser.js +41 -62
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +18 -28
- package/Components/FileViewer.js.map +1 -1
- package/Components/Icon.js +15 -25
- package/Components/Icon.js.map +1 -1
- package/Components/IconPicker.js +6 -6
- package/Components/IconPicker.js.map +1 -1
- package/Components/IconSelector.js +25 -31
- package/Components/IconSelector.js.map +1 -1
- package/Components/Image.js +15 -25
- package/Components/Image.js.map +1 -1
- package/Components/Loader.js +14 -24
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +13 -23
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +14 -24
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/Logo.js +18 -28
- package/Components/Logo.js.map +1 -1
- package/Components/MDUtils.js +14 -11
- package/Components/MDUtils.js.map +1 -1
- package/Components/ObjectBrowser.js +150 -238
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js +13 -21
- package/Components/Router.js.map +1 -1
- package/Components/SaveCloseButtons.js +15 -25
- package/Components/SaveCloseButtons.js.map +1 -1
- package/Components/Schedule.js +23 -37
- package/Components/Schedule.js.map +1 -1
- package/Components/SelectWithIcon.js +18 -26
- package/Components/SelectWithIcon.js.map +1 -1
- package/Components/SimpleCron/cron2text.js.map +1 -1
- package/Components/SimpleCron/cronText.js +2 -2
- package/Components/SimpleCron/cronText.js.map +1 -1
- package/Components/SimpleCron/index.js +24 -34
- package/Components/SimpleCron/index.js.map +1 -1
- package/Components/SimpleCron/jquery.cron.locale.js.map +1 -1
- package/Components/TabContainer.js +18 -28
- package/Components/TabContainer.js.map +1 -1
- package/Components/TabContent.js +17 -27
- package/Components/TabContent.js.map +1 -1
- package/Components/TabHeader.js +13 -23
- package/Components/TabHeader.js.map +1 -1
- package/Components/TextWithIcon.js +5 -5
- package/Components/TextWithIcon.js.map +1 -1
- package/Components/ToggleThemeMenu.js +2 -2
- package/Components/ToggleThemeMenu.js.map +1 -1
- package/Components/TreeTable.js +21 -42
- package/Components/TreeTable.js.map +1 -1
- package/Components/Utils.js +34 -42
- package/Components/Utils.js.map +1 -1
- package/Components/copy-to-clipboard.js.map +1 -1
- package/Components/withWidth.js +42 -0
- package/Components/withWidth.js.map +1 -0
- package/Connection.js +20 -23
- package/Connection.js.map +1 -1
- package/Dialogs/ComplexCron.js +15 -25
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Confirm.js +15 -25
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/Cron.js +19 -27
- package/Dialogs/Cron.js.map +1 -1
- package/Dialogs/Error.js +15 -25
- package/Dialogs/Error.js.map +1 -1
- package/Dialogs/Message.js +15 -25
- package/Dialogs/Message.js.map +1 -1
- package/Dialogs/SelectID.js +19 -27
- package/Dialogs/SelectID.js.map +1 -1
- package/Dialogs/SimpleCron.js +15 -25
- package/Dialogs/SimpleCron.js.map +1 -1
- package/Dialogs/TextInput.js +18 -28
- package/Dialogs/TextInput.js.map +1 -1
- package/GenericApp.js +41 -50
- package/GenericApp.js.map +1 -1
- package/Prompt.js.map +1 -1
- package/README.md +12 -0
- package/Theme.js +2 -2
- package/Theme.js.map +1 -1
- package/i18n/de.json +3 -3
- package/i18n/en.json +3 -3
- package/i18n/es.json +3 -3
- package/i18n/fr.json +3 -3
- package/i18n/it.json +3 -3
- package/i18n/nl.json +3 -3
- package/i18n/pl.json +3 -3
- package/i18n/pt.json +3 -3
- package/i18n/ru.json +3 -3
- package/i18n/zh-cn.json +3 -3
- package/i18n.js +22 -13
- package/i18n.js.map +1 -1
- package/icons/IconAdapter.js +2 -2
- package/icons/IconAdapter.js.map +1 -1
- package/icons/IconAlias.js +2 -2
- package/icons/IconAlias.js.map +1 -1
- package/icons/IconChannel.js +2 -2
- package/icons/IconChannel.js.map +1 -1
- package/icons/IconClearFilter.js +2 -2
- package/icons/IconClearFilter.js.map +1 -1
- package/icons/IconClosed.js +2 -2
- package/icons/IconClosed.js.map +1 -1
- package/icons/IconCopy.js +2 -2
- package/icons/IconCopy.js.map +1 -1
- package/icons/IconDevice.js +2 -2
- package/icons/IconDevice.js.map +1 -1
- package/icons/IconDocument.js +2 -2
- package/icons/IconDocument.js.map +1 -1
- package/icons/IconExpert.js +2 -2
- package/icons/IconExpert.js.map +1 -1
- package/icons/IconFx.js +2 -2
- package/icons/IconFx.js.map +1 -1
- package/icons/IconInstance.js +2 -2
- package/icons/IconInstance.js.map +1 -1
- package/icons/IconLogout.js +2 -2
- package/icons/IconLogout.js.map +1 -1
- package/icons/IconOpen.js +2 -2
- package/icons/IconOpen.js.map +1 -1
- package/icons/IconState.js +6 -6
- package/icons/IconState.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
10
|
exports["default"] = void 0;
|
|
7
11
|
|
|
12
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
+
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
|
|
16
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
+
|
|
18
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
+
|
|
20
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
+
|
|
22
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
23
|
+
|
|
24
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
|
+
|
|
26
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
|
+
|
|
28
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
|
+
|
|
30
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
|
+
|
|
32
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
33
|
+
|
|
8
34
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
35
|
|
|
10
36
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -13,10 +39,6 @@ var _copyToClipboard = _interopRequireDefault(require("./copy-to-clipboard"));
|
|
|
13
39
|
|
|
14
40
|
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
|
15
41
|
|
|
16
|
-
var _styles = require("@mui/material/styles");
|
|
17
|
-
|
|
18
|
-
var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
|
|
19
|
-
|
|
20
42
|
var _reactInlinesvg = _interopRequireDefault(require("react-inlinesvg"));
|
|
21
43
|
|
|
22
44
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
@@ -161,82 +183,20 @@ var _TabContent = _interopRequireDefault(require("./TabContent"));
|
|
|
161
183
|
|
|
162
184
|
var _TabHeader = _interopRequireDefault(require("./TabHeader"));
|
|
163
185
|
|
|
164
|
-
|
|
186
|
+
var _withWidth = _interopRequireDefault(require("./withWidth"));
|
|
165
187
|
|
|
166
188
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
167
189
|
|
|
168
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
190
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
169
191
|
|
|
170
192
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
171
193
|
|
|
172
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
173
|
-
|
|
174
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
175
|
-
|
|
176
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
177
|
-
|
|
178
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
179
|
-
|
|
180
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
181
|
-
|
|
182
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
183
|
-
|
|
184
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
185
|
-
|
|
186
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
187
|
-
|
|
188
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
189
|
-
|
|
190
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
194
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
191
195
|
|
|
192
|
-
function
|
|
196
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
193
197
|
|
|
194
198
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
195
199
|
|
|
196
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
197
|
-
|
|
198
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
199
|
-
|
|
200
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
201
|
-
|
|
202
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
203
|
-
|
|
204
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
205
|
-
|
|
206
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
207
|
-
|
|
208
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
209
|
-
|
|
210
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
211
|
-
|
|
212
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
213
|
-
|
|
214
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
215
|
-
|
|
216
|
-
function useWidth() {
|
|
217
|
-
var theme = (0, _styles.useTheme)();
|
|
218
|
-
|
|
219
|
-
var keys = _toConsumableArray(theme.breakpoints.keys).reverse();
|
|
220
|
-
|
|
221
|
-
return keys.reduce(function (output, key) {
|
|
222
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
223
|
-
var matches = (0, _useMediaQuery["default"])(theme.breakpoints.up(key));
|
|
224
|
-
return !output && matches ? key : output;
|
|
225
|
-
}, null) || 'xs';
|
|
226
|
-
} // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
var withWidth = function withWidth() {
|
|
230
|
-
return function (WrappedComponent) {
|
|
231
|
-
return function (props) {
|
|
232
|
-
var width = useWidth();
|
|
233
|
-
return /*#__PURE__*/_react["default"].createElement(WrappedComponent, _extends({}, props, {
|
|
234
|
-
width: width
|
|
235
|
-
}));
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
|
|
240
200
|
var ICON_SIZE = 24;
|
|
241
201
|
var ROW_HEIGHT = 32;
|
|
242
202
|
var ITEM_LEVEL = 16;
|
|
@@ -345,7 +305,7 @@ var styles = function styles(theme) {
|
|
|
345
305
|
paddingTop: 0,
|
|
346
306
|
//theme.spacing(1),
|
|
347
307
|
paddingLeft: 0,
|
|
348
|
-
width: "calc(100% - ".concat(theme.spacing(1), "
|
|
308
|
+
width: "calc(100% - ".concat(theme.spacing(1), ")"),
|
|
349
309
|
height: "calc(100% - 38px)",
|
|
350
310
|
overflow: 'auto'
|
|
351
311
|
},
|
|
@@ -625,6 +585,7 @@ var styles = function styles(theme) {
|
|
|
625
585
|
opacity: 1
|
|
626
586
|
},
|
|
627
587
|
paddingTop: 0,
|
|
588
|
+
paddingLeft: 0,
|
|
628
589
|
marginTop: -2
|
|
629
590
|
},
|
|
630
591
|
cellButtonsEmptyButton: {
|
|
@@ -658,7 +619,7 @@ var styles = function styles(theme) {
|
|
|
658
619
|
cursor: 'pointer'
|
|
659
620
|
},
|
|
660
621
|
cellButtonsValueButtonEdit: {
|
|
661
|
-
right: SMALL_BUTTON_SIZE / 2 + theme.spacing(2)
|
|
622
|
+
right: SMALL_BUTTON_SIZE / 2 + parseInt(theme.spacing(2), 10)
|
|
662
623
|
},
|
|
663
624
|
filteredOut: {
|
|
664
625
|
opacity: 0.5
|
|
@@ -864,7 +825,8 @@ function binarySearch(list, find, _start, _end) {
|
|
|
864
825
|
}
|
|
865
826
|
}
|
|
866
827
|
|
|
867
|
-
function applyFilter(item, filters, lang, objects, context, counter, customFilter, selectedTypes) {
|
|
828
|
+
function applyFilter(item, filters, lang, objects, context, counter, customFilter, selectedTypes, _depth) {
|
|
829
|
+
_depth = _depth || 0;
|
|
868
830
|
var filteredOut = false;
|
|
869
831
|
|
|
870
832
|
if (!context) {
|
|
@@ -980,9 +942,9 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
|
|
|
980
942
|
data.visible = !filteredOut;
|
|
981
943
|
data.hasVisibleChildren = false;
|
|
982
944
|
|
|
983
|
-
if (item.children) {
|
|
945
|
+
if (item.children && _depth < 20) {
|
|
984
946
|
item.children.forEach(function (_item) {
|
|
985
|
-
var visible = applyFilter(_item, filters, lang, objects, context, counter, customFilter, selectedTypes);
|
|
947
|
+
var visible = applyFilter(_item, filters, lang, objects, context, counter, customFilter, selectedTypes, _depth + 1);
|
|
986
948
|
|
|
987
949
|
if (visible) {
|
|
988
950
|
data.hasVisibleChildren = true;
|
|
@@ -1318,7 +1280,7 @@ function findNode(root, id, _parts, _path, _level) {
|
|
|
1318
1280
|
}
|
|
1319
1281
|
|
|
1320
1282
|
function getName(name, lang) {
|
|
1321
|
-
if (name &&
|
|
1283
|
+
if (name && (0, _typeof2["default"])(name) === 'object') {
|
|
1322
1284
|
return (name[lang] || name.en || '').toString();
|
|
1323
1285
|
} else {
|
|
1324
1286
|
return (name || '').toString();
|
|
@@ -1457,49 +1419,18 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1457
1419
|
var isCommon = obj.common;
|
|
1458
1420
|
var valText = {};
|
|
1459
1421
|
var v = isCommon && isCommon.type === 'file' ? '[file]' : !state || state.val === null ? '(null)' : state.val === undefined ? '[undef]' : state.val;
|
|
1460
|
-
|
|
1461
|
-
var type = _typeof(v);
|
|
1422
|
+
var type = (0, _typeof2["default"])(v);
|
|
1462
1423
|
|
|
1463
1424
|
if (isCommon && isCommon.role && typeof isCommon.role === 'string' && isCommon.role.match(/^value\.time|^date/)) {
|
|
1464
1425
|
if (v && typeof v === 'string') {
|
|
1465
1426
|
if (v.length === 13) {
|
|
1466
1427
|
// (length of "1647597254924") warning, this solution only works till Nov 20 2286 18:46:39CET
|
|
1467
1428
|
v = new Date(parseInt(v, 10)).toString();
|
|
1468
|
-
} else
|
|
1469
|
-
// YYYY.MM.DD
|
|
1470
|
-
var parts = v.split(/[-.]/);
|
|
1471
|
-
|
|
1472
|
-
if (parts.length === 3) {
|
|
1473
|
-
if (parts[0].length === 4) {
|
|
1474
|
-
// YYYY.MM.DD
|
|
1475
|
-
v = new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) + 1, parseInt(parts[2], 10));
|
|
1476
|
-
} else if (parts[0].length === 4) {
|
|
1477
|
-
// DD.MM.YYYY
|
|
1478
|
-
v = new Date(parseInt(parts[2], 10), parseInt(parts[1], 10) + 1, parseInt(parts[0], 10));
|
|
1479
|
-
}
|
|
1480
|
-
} else {
|
|
1481
|
-
v = new Date(v).toString(); // Let the browser convert it somehow
|
|
1482
|
-
}
|
|
1483
|
-
} else if (v.length === 8) {
|
|
1484
|
-
// YY.MM.DD
|
|
1485
|
-
var _parts2 = v.split(/[-.]/);
|
|
1486
|
-
|
|
1487
|
-
if (_parts2.length === 3) {
|
|
1488
|
-
v = new Date(parseInt(_parts2[0], 10), parseInt(_parts2[1], 10) + 1, parseInt(_parts2[2], 10));
|
|
1489
|
-
} else {
|
|
1490
|
-
v = new Date(v).toString(); // Let the browser convert it somehow
|
|
1491
|
-
}
|
|
1492
|
-
} else {
|
|
1493
|
-
v = new Date(v).toString(); // Let the browser convert it somehow
|
|
1429
|
+
} else {// we don't know what is that, so leave it as it is
|
|
1494
1430
|
}
|
|
1495
1431
|
} else {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
} else if (v === undefined) {
|
|
1499
|
-
v = 'undefined';
|
|
1500
|
-
} else {
|
|
1501
|
-
v = v ? new Date(v).toString() : v;
|
|
1502
|
-
}
|
|
1432
|
+
// null and undefined could not be here. See `let v = (isCommon && isCommon.type === 'file') ....` above
|
|
1433
|
+
v = v ? new Date(v).toString() : v;
|
|
1503
1434
|
}
|
|
1504
1435
|
} else {
|
|
1505
1436
|
if (type === 'number') {
|
|
@@ -1517,11 +1448,12 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1517
1448
|
if (typeof v !== 'string') {
|
|
1518
1449
|
v = v.toString();
|
|
1519
1450
|
}
|
|
1520
|
-
}
|
|
1451
|
+
} // try to replace number with "common.states"
|
|
1452
|
+
|
|
1521
1453
|
|
|
1522
1454
|
if (states && states[v] !== undefined) {
|
|
1523
1455
|
valText.s = v;
|
|
1524
|
-
v = states[
|
|
1456
|
+
v = states[v];
|
|
1525
1457
|
}
|
|
1526
1458
|
|
|
1527
1459
|
var valFull;
|
|
@@ -1536,7 +1468,7 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1536
1468
|
}];
|
|
1537
1469
|
|
|
1538
1470
|
if (state) {
|
|
1539
|
-
if (state.ack !== undefined) {
|
|
1471
|
+
if (state.ack !== undefined && state.ack !== null) {
|
|
1540
1472
|
valFull.push({
|
|
1541
1473
|
t: texts.ack,
|
|
1542
1474
|
v: state.ack.toString()
|
|
@@ -1868,7 +1800,7 @@ var objectsAlreadyLoaded = false;
|
|
|
1868
1800
|
*/
|
|
1869
1801
|
|
|
1870
1802
|
var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
1871
|
-
|
|
1803
|
+
(0, _inherits2["default"])(ObjectBrowser, _Component);
|
|
1872
1804
|
|
|
1873
1805
|
var _super = _createSuper(ObjectBrowser);
|
|
1874
1806
|
|
|
@@ -1878,11 +1810,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
1878
1810
|
function ObjectBrowser(props) {
|
|
1879
1811
|
var _this;
|
|
1880
1812
|
|
|
1881
|
-
|
|
1882
|
-
|
|
1813
|
+
(0, _classCallCheck2["default"])(this, ObjectBrowser);
|
|
1883
1814
|
_this = _super.call(this, props);
|
|
1884
|
-
|
|
1885
|
-
_defineProperty(_assertThisInitialized(_this), "onStateChange", function (id, state) {
|
|
1815
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onStateChange", function (id, state) {
|
|
1886
1816
|
console.log('> stateChange ' + id);
|
|
1887
1817
|
|
|
1888
1818
|
if (_this.states[id]) {
|
|
@@ -1910,8 +1840,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
1910
1840
|
}
|
|
1911
1841
|
}
|
|
1912
1842
|
});
|
|
1913
|
-
|
|
1914
|
-
_defineProperty(_assertThisInitialized(_this), "onObjectChange", function (id, obj, oldObj) {
|
|
1843
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onObjectChange", function (id, obj, oldObj) {
|
|
1915
1844
|
var newState;
|
|
1916
1845
|
|
|
1917
1846
|
if (Array.isArray(id)) {
|
|
@@ -1954,8 +1883,6 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
1954
1883
|
return;
|
|
1955
1884
|
}
|
|
1956
1885
|
|
|
1957
|
-
;
|
|
1958
|
-
|
|
1959
1886
|
if (id.startsWith('system.adapter.') && obj && obj.type === 'adapter') {
|
|
1960
1887
|
var columnsForAdmin = JSON.parse(JSON.stringify(_this.state.columnsForAdmin));
|
|
1961
1888
|
|
|
@@ -2000,8 +1927,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2000
1927
|
}, 500);
|
|
2001
1928
|
}
|
|
2002
1929
|
});
|
|
2003
|
-
|
|
2004
|
-
_defineProperty(_assertThisInitialized(_this), "getEnumsForId", function (id) {
|
|
1930
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getEnumsForId", function (id) {
|
|
2005
1931
|
var result = [];
|
|
2006
1932
|
|
|
2007
1933
|
_this.info.enums.forEach(function (_id) {
|
|
@@ -2027,12 +1953,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2027
1953
|
|
|
2028
1954
|
return result.length ? result : undefined;
|
|
2029
1955
|
});
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(enums, objId) {
|
|
1956
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_createAllEnums", /*#__PURE__*/function () {
|
|
1957
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(enums, objId) {
|
|
2033
1958
|
var e, _enObj$common, _enObj$common$members, id, _enObj, enObj;
|
|
2034
1959
|
|
|
2035
|
-
return
|
|
1960
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
2036
1961
|
while (1) {
|
|
2037
1962
|
switch (_context.prev = _context.next) {
|
|
2038
1963
|
case 0:
|
|
@@ -2047,7 +1972,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2047
1972
|
id = enums[e];
|
|
2048
1973
|
_enObj = void 0;
|
|
2049
1974
|
|
|
2050
|
-
if (
|
|
1975
|
+
if ((0, _typeof2["default"])(id) === 'object') {
|
|
2051
1976
|
_enObj = id;
|
|
2052
1977
|
id = id._id;
|
|
2053
1978
|
}
|
|
@@ -2107,11 +2032,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2107
2032
|
return _ref.apply(this, arguments);
|
|
2108
2033
|
};
|
|
2109
2034
|
}());
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(objs) {
|
|
2035
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "loadObjects", /*#__PURE__*/function () {
|
|
2036
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(objs) {
|
|
2113
2037
|
var id, obj, enums, state;
|
|
2114
|
-
return
|
|
2038
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
2115
2039
|
while (1) {
|
|
2116
2040
|
switch (_context2.prev = _context2.next) {
|
|
2117
2041
|
case 0:
|
|
@@ -2120,7 +2044,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2120
2044
|
break;
|
|
2121
2045
|
}
|
|
2122
2046
|
|
|
2123
|
-
_context2.t0 =
|
|
2047
|
+
_context2.t0 = _regenerator["default"].keys(objs);
|
|
2124
2048
|
|
|
2125
2049
|
case 2:
|
|
2126
2050
|
if ((_context2.t1 = _context2.t0()).done) {
|
|
@@ -2228,17 +2152,16 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2228
2152
|
return _ref2.apply(this, arguments);
|
|
2229
2153
|
};
|
|
2230
2154
|
}());
|
|
2231
|
-
|
|
2232
|
-
_defineProperty(_assertThisInitialized(_this), "handleJsonUpload", function (evt) {
|
|
2155
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleJsonUpload", function (evt) {
|
|
2233
2156
|
var f = evt.target.files[0];
|
|
2234
2157
|
|
|
2235
2158
|
if (f) {
|
|
2236
2159
|
var r = new FileReader();
|
|
2237
2160
|
|
|
2238
2161
|
r.onload = /*#__PURE__*/function () {
|
|
2239
|
-
var _ref3 =
|
|
2162
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(e) {
|
|
2240
2163
|
var contents, json, len, id, enums, state;
|
|
2241
|
-
return
|
|
2164
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
2242
2165
|
while (1) {
|
|
2243
2166
|
switch (_context3.prev = _context3.next) {
|
|
2244
2167
|
case 0:
|
|
@@ -2346,8 +2269,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2346
2269
|
window.alert(_this.props.t('ra_Failed to open JSON File'));
|
|
2347
2270
|
}
|
|
2348
2271
|
});
|
|
2349
|
-
|
|
2350
|
-
_defineProperty(_assertThisInitialized(_this), "toolTipObjectCreating", function () {
|
|
2272
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toolTipObjectCreating", function () {
|
|
2351
2273
|
var _this$objects$id2;
|
|
2352
2274
|
|
|
2353
2275
|
var t = _this.props.t;
|
|
@@ -2380,7 +2302,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2380
2302
|
var id = _this.state.selected[0] || _this.state.selectedNonObject;
|
|
2381
2303
|
|
|
2382
2304
|
if (id.split('.').length < 2 || _this.objects[id] && ((_this$objects$id = _this.objects[id]) === null || _this$objects$id === void 0 ? void 0 : _this$objects$id.type) === 'state') {} else {
|
|
2383
|
-
if (_this.
|
|
2305
|
+
if (_this.state.filter.expertMode) {
|
|
2384
2306
|
switch ((_this$objects$id2 = _this.objects[id]) === null || _this$objects$id2 === void 0 ? void 0 : _this$objects$id2.type) {
|
|
2385
2307
|
case 'device':
|
|
2386
2308
|
value = [/*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -2427,8 +2349,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2427
2349
|
|
|
2428
2350
|
return value.length ? value : t('ra_Add new child object to selected parent');
|
|
2429
2351
|
});
|
|
2430
|
-
|
|
2431
|
-
_defineProperty(_assertThisInitialized(_this), "renderTooltipAccessControl", function (acl) {
|
|
2352
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderTooltipAccessControl", function (acl) {
|
|
2432
2353
|
// acl ={object,state,owner,ownerGroup}
|
|
2433
2354
|
if (!acl) {
|
|
2434
2355
|
return null;
|
|
@@ -2499,25 +2420,22 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2499
2420
|
return el;
|
|
2500
2421
|
})) : '';
|
|
2501
2422
|
});
|
|
2502
|
-
|
|
2503
|
-
_defineProperty(_assertThisInitialized(_this), "extendObject", function (id, data) {
|
|
2423
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "extendObject", function (id, data) {
|
|
2504
2424
|
return _this.props.socket.extendObject(id, data)["catch"](function (error) {
|
|
2505
2425
|
return window.alert(error);
|
|
2506
2426
|
});
|
|
2507
2427
|
});
|
|
2508
|
-
|
|
2509
|
-
_defineProperty(_assertThisInitialized(_this), "setObject", function (id, data) {
|
|
2428
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setObject", function (id, data) {
|
|
2510
2429
|
return _this.props.socket.setObject(id, data)["catch"](function (error) {
|
|
2511
2430
|
return window.alert(error);
|
|
2512
2431
|
});
|
|
2513
2432
|
});
|
|
2514
|
-
|
|
2515
2433
|
_this.lastSelectedItems = window.localStorage.getItem("".concat(props.dialogName || 'App', ".objectSelected")) || '[]';
|
|
2516
2434
|
|
|
2517
2435
|
try {
|
|
2518
2436
|
_this.lastSelectedItems = JSON.parse(_this.lastSelectedItems);
|
|
2519
2437
|
|
|
2520
|
-
if (
|
|
2438
|
+
if ((0, _typeof2["default"])(_this.lastSelectedItems) !== 'object') {
|
|
2521
2439
|
_this.lastSelectedItems = [_this.lastSelectedItems];
|
|
2522
2440
|
}
|
|
2523
2441
|
|
|
@@ -2581,7 +2499,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2581
2499
|
|
|
2582
2500
|
var selected = props.selected || '';
|
|
2583
2501
|
|
|
2584
|
-
if (
|
|
2502
|
+
if ((0, _typeof2["default"])(selected) !== 'object') {
|
|
2585
2503
|
selected = [selected];
|
|
2586
2504
|
}
|
|
2587
2505
|
|
|
@@ -2707,7 +2625,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2707
2625
|
return _this;
|
|
2708
2626
|
}
|
|
2709
2627
|
|
|
2710
|
-
|
|
2628
|
+
(0, _createClass2["default"])(ObjectBrowser, [{
|
|
2711
2629
|
key: "loadAllObjects",
|
|
2712
2630
|
value: function loadAllObjects(update) {
|
|
2713
2631
|
var _this2 = this;
|
|
@@ -2740,17 +2658,15 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2740
2658
|
|
|
2741
2659
|
if (typeof props.filterFunc === 'function') {
|
|
2742
2660
|
_this2.objects = {};
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
for (var k = 0; k < keys.length; k++) {
|
|
2661
|
+
Object.keys(objects).forEach(function (id) {
|
|
2746
2662
|
try {
|
|
2747
|
-
if (props.filterFunc(objects[
|
|
2748
|
-
_this2.objects[
|
|
2663
|
+
if (props.filterFunc(objects[id])) {
|
|
2664
|
+
_this2.objects[id] = objects[id];
|
|
2749
2665
|
}
|
|
2750
2666
|
} catch (e) {
|
|
2751
|
-
console.log("Error by filtering of \"".concat(
|
|
2667
|
+
console.log("Error by filtering of \"".concat(id, "\": ").concat(e));
|
|
2752
2668
|
}
|
|
2753
|
-
}
|
|
2669
|
+
});
|
|
2754
2670
|
} else if (props.types) {
|
|
2755
2671
|
_this2.objects = {};
|
|
2756
2672
|
Object.keys(objects).forEach(function (id) {
|
|
@@ -2829,8 +2745,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2829
2745
|
}, {
|
|
2830
2746
|
key: "expandAllSelected",
|
|
2831
2747
|
value: function expandAllSelected(cb) {
|
|
2832
|
-
var expanded =
|
|
2833
|
-
|
|
2748
|
+
var expanded = (0, _toConsumableArray2["default"])(this.state.expanded);
|
|
2834
2749
|
var changed = false;
|
|
2835
2750
|
this.state.selected.forEach(function (id) {
|
|
2836
2751
|
var parts = id.split('.');
|
|
@@ -2866,7 +2781,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2866
2781
|
value: function onAfterSelect(isDouble) {
|
|
2867
2782
|
var _this3 = this;
|
|
2868
2783
|
|
|
2869
|
-
this.lastSelectedItems =
|
|
2784
|
+
this.lastSelectedItems = (0, _toConsumableArray2["default"])(this.state.selected);
|
|
2870
2785
|
|
|
2871
2786
|
if (this.state.selected && this.state.selected.length) {
|
|
2872
2787
|
window.localStorage.setItem("".concat(this.props.dialogName || 'App', ".objectSelected"), JSON.stringify(this.lastSelectedItems));
|
|
@@ -3003,7 +2918,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3003
2918
|
key: "showError",
|
|
3004
2919
|
value: function showError(error) {
|
|
3005
2920
|
this.setState({
|
|
3006
|
-
error:
|
|
2921
|
+
error: (0, _typeof2["default"])(error) === 'object' ? error && typeof error.toString === 'function' ? error.toString() : JSON.stringify(error) : error
|
|
3007
2922
|
});
|
|
3008
2923
|
}
|
|
3009
2924
|
/**
|
|
@@ -3043,9 +2958,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3043
2958
|
} else {
|
|
3044
2959
|
if (this.objects[toggleItem] && (!this.props.types || this.props.types.includes(this.objects[toggleItem].type))) {
|
|
3045
2960
|
window.localStorage.removeItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"));
|
|
3046
|
-
|
|
3047
|
-
var selected = _toConsumableArray(this.state.selected);
|
|
3048
|
-
|
|
2961
|
+
var selected = (0, _toConsumableArray2["default"])(this.state.selected);
|
|
3049
2962
|
var pos = selected.indexOf(toggleItem);
|
|
3050
2963
|
|
|
3051
2964
|
if (pos === -1) {
|
|
@@ -3074,8 +2987,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3074
2987
|
value: function _renderDefinedList(isLast) {
|
|
3075
2988
|
var _this9 = this;
|
|
3076
2989
|
|
|
3077
|
-
var cols =
|
|
3078
|
-
|
|
2990
|
+
var cols = (0, _toConsumableArray2["default"])(this.possibleCols);
|
|
3079
2991
|
cols.unshift('id');
|
|
3080
2992
|
|
|
3081
2993
|
if (this.props.columns && !this.props.columns.includes('buttons')) {
|
|
@@ -3089,11 +3001,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3089
3001
|
return cols.filter(function (id) {
|
|
3090
3002
|
return isLast && (id === 'val' || id === 'buttons') || !isLast && id !== 'val' && id !== 'buttons';
|
|
3091
3003
|
}).map(function (id) {
|
|
3092
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
3093
|
-
button: true,
|
|
3004
|
+
return /*#__PURE__*/_react["default"].createElement(ListItemButton, {
|
|
3094
3005
|
onClick: function onClick() {
|
|
3095
3006
|
if (!_this9.state.columnsAuto && id !== 'id') {
|
|
3096
|
-
var columns =
|
|
3007
|
+
var columns = (0, _toConsumableArray2["default"])(_this9.state.columns || []);
|
|
3097
3008
|
|
|
3098
3009
|
var _pos = columns.indexOf(id);
|
|
3099
3010
|
|
|
@@ -3192,11 +3103,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3192
3103
|
});
|
|
3193
3104
|
} else {
|
|
3194
3105
|
if (!_this10.state.columns) {
|
|
3195
|
-
_this10.calculateColumnsVisibility(false,
|
|
3106
|
+
_this10.calculateColumnsVisibility(false, (0, _toConsumableArray2["default"])(_this10.visibleCols));
|
|
3196
3107
|
|
|
3197
3108
|
_this10.setState({
|
|
3198
3109
|
columnsAuto: false,
|
|
3199
|
-
columns:
|
|
3110
|
+
columns: (0, _toConsumableArray2["default"])(_this10.visibleCols)
|
|
3200
3111
|
});
|
|
3201
3112
|
} else {
|
|
3202
3113
|
_this10.calculateColumnsVisibility(false);
|
|
@@ -3254,12 +3165,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3254
3165
|
}
|
|
3255
3166
|
}), /*#__PURE__*/_react["default"].createElement(_List["default"], null, this._renderDefinedList(false), this.state.columnsForAdmin && Object.keys(this.state.columnsForAdmin).sort().map(function (adapter) {
|
|
3256
3167
|
return _this10.state.columnsForAdmin[adapter].map(function (column) {
|
|
3257
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
3258
|
-
button: true,
|
|
3168
|
+
return /*#__PURE__*/_react["default"].createElement(ListItemButton, {
|
|
3259
3169
|
onClick: function onClick() {
|
|
3260
3170
|
if (!_this10.state.columnsAuto) {
|
|
3261
|
-
var columns =
|
|
3262
|
-
|
|
3171
|
+
var columns = (0, _toConsumableArray2["default"])(_this10.state.columns || []);
|
|
3263
3172
|
var id = '_' + adapter + '_' + column.path;
|
|
3264
3173
|
var pos = columns.indexOf(id);
|
|
3265
3174
|
|
|
@@ -3420,12 +3329,12 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3420
3329
|
if (obj.common && obj.common.adminColumns && obj.common.name) {
|
|
3421
3330
|
var columns = obj.common.adminColumns;
|
|
3422
3331
|
|
|
3423
|
-
if (
|
|
3332
|
+
if ((0, _typeof2["default"])(columns) !== 'object') {
|
|
3424
3333
|
columns = [columns];
|
|
3425
3334
|
}
|
|
3426
3335
|
|
|
3427
3336
|
columns = columns.map(function (item) {
|
|
3428
|
-
if (
|
|
3337
|
+
if ((0, _typeof2["default"])(item) !== 'object') {
|
|
3429
3338
|
return {
|
|
3430
3339
|
path: item,
|
|
3431
3340
|
name: item.split('.').pop()
|
|
@@ -3433,7 +3342,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3433
3342
|
} // string => array
|
|
3434
3343
|
|
|
3435
3344
|
|
|
3436
|
-
if (item.objTypes &&
|
|
3345
|
+
if (item.objTypes && (0, _typeof2["default"])(item.objTypes) !== 'object') {
|
|
3437
3346
|
item.objTypes = [item.objTypes];
|
|
3438
3347
|
} else if (!item.objTypes) {
|
|
3439
3348
|
item.objTypes = null;
|
|
@@ -3450,7 +3359,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3450
3359
|
};
|
|
3451
3360
|
}
|
|
3452
3361
|
|
|
3453
|
-
if (
|
|
3362
|
+
if ((0, _typeof2["default"])(item.name) !== 'object' && item.path) {
|
|
3454
3363
|
return {
|
|
3455
3364
|
path: item.path,
|
|
3456
3365
|
name: item.name,
|
|
@@ -3735,7 +3644,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3735
3644
|
var name;
|
|
3736
3645
|
var icon;
|
|
3737
3646
|
|
|
3738
|
-
if (
|
|
3647
|
+
if ((0, _typeof2["default"])(item) === 'object') {
|
|
3739
3648
|
id = item.value;
|
|
3740
3649
|
name = item.name;
|
|
3741
3650
|
icon = item.icon;
|
|
@@ -3962,9 +3871,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3962
3871
|
value: function onExpandVisible() {
|
|
3963
3872
|
if (this.state.depth < 9) {
|
|
3964
3873
|
var depth = this.state.depth + 1;
|
|
3965
|
-
|
|
3966
|
-
var expanded = _toConsumableArray(this.state.expanded);
|
|
3967
|
-
|
|
3874
|
+
var expanded = (0, _toConsumableArray2["default"])(this.state.expanded);
|
|
3968
3875
|
this.expandDepth(this.root, depth, expanded);
|
|
3969
3876
|
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
3970
3877
|
this.setState({
|
|
@@ -4085,9 +3992,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4085
3992
|
});
|
|
4086
3993
|
}
|
|
4087
3994
|
}, this.props.t('ra_All objects')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3995
|
+
color: "primary",
|
|
4088
3996
|
variant: "contained",
|
|
4089
3997
|
autoFocus: true,
|
|
4090
|
-
color: "primary",
|
|
4091
3998
|
onClick: function onClick() {
|
|
4092
3999
|
return _this25.setState({
|
|
4093
4000
|
showExportDialog: false
|
|
@@ -4095,7 +4002,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4095
4002
|
return _this25._exportObjects(false);
|
|
4096
4003
|
});
|
|
4097
4004
|
}
|
|
4098
|
-
}, this.props.t('
|
|
4005
|
+
}, this.props.t('ra_Only selected')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4099
4006
|
color: "grey",
|
|
4100
4007
|
variant: "contained",
|
|
4101
4008
|
onClick: function onClick() {
|
|
@@ -4130,7 +4037,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4130
4037
|
if (id.split('.').length < 2 || this.objects[id] && this.objects[id].type === 'state') {
|
|
4131
4038
|
allowObjectCreation = false;
|
|
4132
4039
|
} else {
|
|
4133
|
-
if (this.
|
|
4040
|
+
if (this.state.filter.expertMode) {
|
|
4134
4041
|
allowObjectCreation = true;
|
|
4135
4042
|
} else if (id.startsWith('alias.0') || id.startsWith('0_userdata')) {
|
|
4136
4043
|
allowObjectCreation = true;
|
|
@@ -4361,7 +4268,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4361
4268
|
if (!item.data.obj) {
|
|
4362
4269
|
return this.props.onObjectDelete || this.props.objectEditOfAccessControl ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
4363
4270
|
className: classes.buttonDiv
|
|
4364
|
-
}, this.
|
|
4271
|
+
}, this.state.filter.expertMode && this.props.objectEditOfAccessControl ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4365
4272
|
className: _Utils["default"].clsx(classes.cellButtonsButton, classes.cellButtonsEmptyButton, classes.cellButtonMinWidth),
|
|
4366
4273
|
onClick: function onClick() {
|
|
4367
4274
|
return _this27.setState({
|
|
@@ -4387,7 +4294,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4387
4294
|
item.data.aclTooltip = item.data.aclTooltip || this.renderTooltipAccessControl(item.data.obj.acl);
|
|
4388
4295
|
var acl = item.data.obj.acl ? item.data.obj.type === 'state' ? item.data.obj.acl.state : item.data.obj.acl.object : 0;
|
|
4389
4296
|
var aclSystemConfig = item.data.obj.acl && (item.data.obj.type === 'state' ? this.systemConfig.common.defaultNewAcl.state : this.systemConfig.common.defaultNewAcl.object);
|
|
4390
|
-
return [this.
|
|
4297
|
+
return [this.state.filter.expertMode && this.props.objectEditOfAccessControl ? /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
4391
4298
|
key: "acl",
|
|
4392
4299
|
title: item.data.aclTooltip
|
|
4393
4300
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
@@ -4591,13 +4498,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4591
4498
|
info.val = copyText;
|
|
4592
4499
|
info.valText = [/*#__PURE__*/_react["default"].createElement("span", {
|
|
4593
4500
|
className: classes.newValue || classes.newValue,
|
|
4594
|
-
key: "
|
|
4501
|
+
key: "valText"
|
|
4595
4502
|
}, info.valText.v.toString()), info.valText.u ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
4596
4503
|
className: _Utils["default"].clsx(classes.cellValueTextUnit, classes.newValue),
|
|
4597
|
-
key: "
|
|
4504
|
+
key: "unit"
|
|
4598
4505
|
}, info.valText.u) : null, info.valText.s !== undefined ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
4599
4506
|
className: _Utils["default"].clsx(classes.cellValueTextState, classes.newValue),
|
|
4600
|
-
key: "
|
|
4507
|
+
key: "states"
|
|
4601
4508
|
}, "(", info.valText.s, ")") : null, /*#__PURE__*/_react["default"].createElement(_IconCopy["default"], {
|
|
4602
4509
|
className: _Utils["default"].clsx(classes.cellButtonsValueButton, 'copyButton', classes.cellButtonsValueButtonCopy),
|
|
4603
4510
|
onClick: function onClick(e) {
|
|
@@ -4610,7 +4517,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4610
4517
|
|
|
4611
4518
|
var val = info.valText;
|
|
4612
4519
|
|
|
4613
|
-
if (!this.
|
|
4520
|
+
if (!this.state.filter.expertMode && item.data.button) {
|
|
4614
4521
|
val = /*#__PURE__*/_react["default"].createElement(_RoomService["default"], {
|
|
4615
4522
|
className: _Utils["default"].clsx(this.props.classes.cellValueButton, !this.states[id] || !this.states[id].val ? this.props.classes.cellValueButtonFalse : '')
|
|
4616
4523
|
});
|
|
@@ -4703,8 +4610,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4703
4610
|
value: function syncEnum(id, enumName, newArray) {
|
|
4704
4611
|
var _this31 = this;
|
|
4705
4612
|
|
|
4706
|
-
var toCheck =
|
|
4707
|
-
|
|
4613
|
+
var toCheck = (0, _toConsumableArray2["default"])(this.info[enumName === 'func' ? 'funcEnums' : 'roomEnums']);
|
|
4708
4614
|
return new Promise(function (resolve) {
|
|
4709
4615
|
return _this31._syncEnum(id, toCheck, newArray, function (error) {
|
|
4710
4616
|
error && _this31.showError(error); // force update of object
|
|
@@ -4780,7 +4686,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4780
4686
|
var name;
|
|
4781
4687
|
var icon;
|
|
4782
4688
|
|
|
4783
|
-
if (
|
|
4689
|
+
if ((0, _typeof2["default"])(item) === 'object') {
|
|
4784
4690
|
id = item.value;
|
|
4785
4691
|
name = item.name;
|
|
4786
4692
|
icon = item.icon;
|
|
@@ -4913,7 +4819,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4913
4819
|
if (!this.customColumnDialog) {
|
|
4914
4820
|
var value = this.getCustomValue(this.state.columnsEditCustomDialog.obj, this.state.columnsEditCustomDialog.it);
|
|
4915
4821
|
this.customColumnDialog = {
|
|
4916
|
-
type: this.state.columnsEditCustomDialog.it.type ||
|
|
4822
|
+
type: this.state.columnsEditCustomDialog.it.type || (0, _typeof2["default"])(value),
|
|
4917
4823
|
initValue: (value === null || value === undefined ? '' : value).toString(),
|
|
4918
4824
|
value: (value === null || value === undefined ? '' : value).toString()
|
|
4919
4825
|
};
|
|
@@ -5002,18 +4908,18 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5002
4908
|
var p = it.path;
|
|
5003
4909
|
var value;
|
|
5004
4910
|
|
|
5005
|
-
if (obj[p[0]] &&
|
|
4911
|
+
if (obj[p[0]] && (0, _typeof2["default"])(obj[p[0]]) === 'object') {
|
|
5006
4912
|
if (p.length === 2) {
|
|
5007
4913
|
// most common case
|
|
5008
4914
|
value = obj[p[0]][p[1]];
|
|
5009
4915
|
} else if (p.length === 3) {
|
|
5010
|
-
value = obj[p[0]][p[1]] &&
|
|
4916
|
+
value = obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' ? obj[p[0]][p[1]][p[2]] : null;
|
|
5011
4917
|
} else if (p.length === 4) {
|
|
5012
|
-
value = obj[p[0]][p[1]] &&
|
|
4918
|
+
value = obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' && obj[p[0]][p[1]][p[2]] ? obj[p[0]][p[1]][p[2]][p[3]] : null;
|
|
5013
4919
|
} else if (p.length === 5) {
|
|
5014
|
-
value = obj[p[0]][p[1]] &&
|
|
4920
|
+
value = obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' && obj[p[0]][p[1]][p[2]] && obj[p[0]][p[1]][p[2]][p[3]] ? obj[p[0]][p[1]][p[2]][p[3]][p[4]] : null;
|
|
5015
4921
|
} else if (p.length === 6) {
|
|
5016
|
-
value = obj[p[0]][p[1]] &&
|
|
4922
|
+
value = obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' && obj[p[0]][p[1]][p[2]] && obj[p[0]][p[1]][p[2]][p[3]] && obj[p[0]][p[1]][p[2]][p[3]][p[4]] ? obj[p[0]][p[1]][p[2]][p[3]][p[4]][p[5]] : null;
|
|
5017
4923
|
}
|
|
5018
4924
|
|
|
5019
4925
|
if (value === undefined || value === null) {
|
|
@@ -5039,28 +4945,28 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5039
4945
|
if (obj && obj._id && obj._id.startsWith(it.adapter + '.') && it.path.length > 1) {
|
|
5040
4946
|
var p = it.path;
|
|
5041
4947
|
|
|
5042
|
-
if (obj[p[0]] &&
|
|
4948
|
+
if (obj[p[0]] && (0, _typeof2["default"])(obj[p[0]]) === 'object') {
|
|
5043
4949
|
if (p.length === 2) {
|
|
5044
4950
|
// most common case
|
|
5045
4951
|
obj[p[0]][p[1]] = value;
|
|
5046
4952
|
return true;
|
|
5047
4953
|
} else if (p.length === 3) {
|
|
5048
|
-
if (obj[p[0]][p[1]] &&
|
|
4954
|
+
if (obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object') {
|
|
5049
4955
|
obj[p[0]][p[1]][p[2]] = value;
|
|
5050
4956
|
return true;
|
|
5051
4957
|
}
|
|
5052
4958
|
} else if (p.length === 4) {
|
|
5053
|
-
if (obj[p[0]][p[1]] &&
|
|
4959
|
+
if (obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' && obj[p[0]][p[1]][p[2]] && (0, _typeof2["default"])(obj[p[0]][p[1]][p[2]]) === 'object') {
|
|
5054
4960
|
obj[p[0]][p[1]][p[2]][p[3]] = value;
|
|
5055
4961
|
return true;
|
|
5056
4962
|
}
|
|
5057
4963
|
} else if (p.length === 5) {
|
|
5058
|
-
if (obj[p[0]][p[1]] &&
|
|
4964
|
+
if (obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' && obj[p[0]][p[1]][p[2]] && (0, _typeof2["default"])(obj[p[0]][p[1]][p[2]]) === 'object' && obj[p[0]][p[1]][p[2]][p[3]] && (0, _typeof2["default"])(obj[p[0]][p[1]][p[2]][p[3]]) === 'object') {
|
|
5059
4965
|
obj[p[0]][p[1]][p[2]][p[3]][p[4]] = value;
|
|
5060
4966
|
return true;
|
|
5061
4967
|
}
|
|
5062
4968
|
} else if (p.length === 6) {
|
|
5063
|
-
if (obj[p[0]][p[1]] &&
|
|
4969
|
+
if (obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' && obj[p[0]][p[1]][p[2]] && (0, _typeof2["default"])(obj[p[0]][p[1]][p[2]]) === 'object' && obj[p[0]][p[1]][p[2]][p[3]] && (0, _typeof2["default"])(obj[p[0]][p[1]][p[2]][p[3]]) === 'object' && obj[p[0]][p[1]][p[2]][p[3]][p[4]] && (0, _typeof2["default"])(obj[p[0]][p[1]][p[2]][p[3]][p[4]]) === 'object') {
|
|
5064
4970
|
obj[p[0]][p[1]][p[2]][p[3]][p[4]][p[5]] = value;
|
|
5065
4971
|
return true;
|
|
5066
4972
|
}
|
|
@@ -5121,15 +5027,12 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5121
5027
|
}, {
|
|
5122
5028
|
key: "renderLeaf",
|
|
5123
5029
|
value: function renderLeaf(item, isExpanded, classes, counter) {
|
|
5124
|
-
var
|
|
5125
|
-
_this37 = this,
|
|
5030
|
+
var _this37 = this,
|
|
5126
5031
|
_common$alias,
|
|
5127
5032
|
_common$alias2,
|
|
5128
|
-
_item$data,
|
|
5129
|
-
_item$data$common,
|
|
5130
5033
|
_this$states$id2,
|
|
5034
|
+
_item$data,
|
|
5131
5035
|
_item$data2,
|
|
5132
|
-
_item$data3,
|
|
5133
5036
|
_this$states$id3,
|
|
5134
5037
|
_this$states$id4,
|
|
5135
5038
|
_this$states$id5;
|
|
@@ -5139,7 +5042,8 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5139
5042
|
isExpanded = isExpanded === undefined ? this.state.expanded.includes(id) : isExpanded; // icon
|
|
5140
5043
|
|
|
5141
5044
|
var iconFolder;
|
|
5142
|
-
var
|
|
5045
|
+
var obj = item.data.obj;
|
|
5046
|
+
var itemType = obj === null || obj === void 0 ? void 0 : obj.type;
|
|
5143
5047
|
|
|
5144
5048
|
if (item.children || itemType === 'folder' || itemType === 'device' || itemType === 'channel' || itemType === 'meta') {
|
|
5145
5049
|
iconFolder = isExpanded ? /*#__PURE__*/_react["default"].createElement(_IconOpen["default"], {
|
|
@@ -5179,7 +5083,6 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5179
5083
|
}
|
|
5180
5084
|
}
|
|
5181
5085
|
|
|
5182
|
-
var obj = item.data.obj;
|
|
5183
5086
|
var common = obj === null || obj === void 0 ? void 0 : obj.common;
|
|
5184
5087
|
|
|
5185
5088
|
var typeImg = obj && obj.type && ITEM_IMAGES[obj.type] || /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -5209,13 +5112,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5209
5112
|
className: classes.checkBox,
|
|
5210
5113
|
checked: this.state.selected.includes(id)
|
|
5211
5114
|
}) : null;
|
|
5212
|
-
var valueEditable = !this.props.notEditable && itemType === 'state' && (this.
|
|
5115
|
+
var valueEditable = !this.props.notEditable && itemType === 'state' && (this.state.filter.expertMode || (common === null || common === void 0 ? void 0 : common.write) !== false);
|
|
5213
5116
|
|
|
5214
5117
|
if (this.props.objectBrowserViewFile && (common === null || common === void 0 ? void 0 : common.type) === 'file') {
|
|
5215
5118
|
valueEditable = true;
|
|
5216
5119
|
}
|
|
5217
5120
|
|
|
5218
|
-
var enumEditable = !this.props.notEditable && this.objects[id] && (this.
|
|
5121
|
+
var enumEditable = !this.props.notEditable && this.objects[id] && (this.state.filter.expertMode || itemType === 'state' || itemType === 'channel' || itemType === 'device');
|
|
5219
5122
|
var checkVisibleObjectType = this.state.statesView && (itemType === 'state' || itemType === 'channel' || itemType === 'device');
|
|
5220
5123
|
var newValue = '';
|
|
5221
5124
|
var newValueTitle = [];
|
|
@@ -5245,53 +5148,53 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5245
5148
|
obj.ts && newValueTitle.push(this.texts.objectChangedByUser + ' ' + _Utils["default"].formatDate(new Date(obj.ts), this.props.dateFormat));
|
|
5246
5149
|
}
|
|
5247
5150
|
|
|
5248
|
-
var readWriteAlias =
|
|
5151
|
+
var readWriteAlias = (0, _typeof2["default"])(common === null || common === void 0 ? void 0 : (_common$alias = common.alias) === null || _common$alias === void 0 ? void 0 : _common$alias.id) === 'object';
|
|
5249
5152
|
var alias = id.startsWith('alias.') && common !== null && common !== void 0 && (_common$alias2 = common.alias) !== null && _common$alias2 !== void 0 && _common$alias2.id ? readWriteAlias ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5250
5153
|
className: classes.cellIdAliasReadWriteDiv
|
|
5251
|
-
},
|
|
5154
|
+
}, common.alias.id.read ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5252
5155
|
onClick: function onClick(e) {
|
|
5253
5156
|
e.stopPropagation();
|
|
5254
5157
|
e.preventDefault();
|
|
5255
5158
|
|
|
5256
|
-
_this37.onSelect(
|
|
5159
|
+
_this37.onSelect(common.alias.id.read);
|
|
5257
5160
|
|
|
5258
5161
|
setTimeout(function () {
|
|
5259
5162
|
_this37.expandAllSelected(function () {
|
|
5260
|
-
return _this37.scrollToItem(
|
|
5163
|
+
return _this37.scrollToItem(common.alias.id.read);
|
|
5261
5164
|
});
|
|
5262
5165
|
}, 100);
|
|
5263
5166
|
},
|
|
5264
5167
|
className: _Utils["default"].clsx(classes.cellIdAlias, classes.cellIdAliasReadWrite)
|
|
5265
|
-
}, "\u2190",
|
|
5168
|
+
}, "\u2190", common.alias.id.read) : null, common.alias.id.write ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5266
5169
|
onClick: function onClick(e) {
|
|
5267
5170
|
e.stopPropagation();
|
|
5268
5171
|
e.preventDefault();
|
|
5269
5172
|
|
|
5270
|
-
_this37.onSelect(
|
|
5173
|
+
_this37.onSelect(common.alias.id.write);
|
|
5271
5174
|
|
|
5272
5175
|
setTimeout(function () {
|
|
5273
5176
|
_this37.expandAllSelected(function () {
|
|
5274
|
-
return _this37.scrollToItem(
|
|
5177
|
+
return _this37.scrollToItem(common.alias.id.write);
|
|
5275
5178
|
});
|
|
5276
5179
|
}, 100);
|
|
5277
5180
|
},
|
|
5278
5181
|
className: _Utils["default"].clsx(classes.cellIdAlias, classes.cellIdAliasReadWrite)
|
|
5279
|
-
}, "\u2192",
|
|
5182
|
+
}, "\u2192", common.alias.id.write) : null) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
5280
5183
|
onClick: function onClick(e) {
|
|
5281
5184
|
e.stopPropagation();
|
|
5282
5185
|
e.preventDefault();
|
|
5283
5186
|
|
|
5284
|
-
_this37.onSelect(
|
|
5187
|
+
_this37.onSelect(common.alias.id);
|
|
5285
5188
|
|
|
5286
5189
|
setTimeout(function () {
|
|
5287
5190
|
_this37.expandAllSelected(function () {
|
|
5288
|
-
return _this37.scrollToItem(
|
|
5191
|
+
return _this37.scrollToItem(common.alias.id);
|
|
5289
5192
|
});
|
|
5290
5193
|
}, 100);
|
|
5291
5194
|
},
|
|
5292
5195
|
className: _Utils["default"].clsx(classes.cellIdAlias, classes.cellIdAliasAlone)
|
|
5293
|
-
}, "\u2192",
|
|
5294
|
-
var checkColor =
|
|
5196
|
+
}, "\u2192", common.alias.id) : null;
|
|
5197
|
+
var checkColor = common === null || common === void 0 ? void 0 : common.color;
|
|
5295
5198
|
var invertBackground = 'none';
|
|
5296
5199
|
|
|
5297
5200
|
if (checkColor && !this.state.selected.includes(id)) {
|
|
@@ -5474,7 +5377,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5474
5377
|
style: {
|
|
5475
5378
|
width: this.columnsVisibility.name
|
|
5476
5379
|
}
|
|
5477
|
-
}, ((_item$
|
|
5380
|
+
}, ((_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.title) || '', (_item$data2 = item.data) !== null && _item$data2 !== void 0 && _item$data2.title ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5478
5381
|
style: {
|
|
5479
5382
|
color: checkColor
|
|
5480
5383
|
}
|
|
@@ -5492,14 +5395,14 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5492
5395
|
className: classes.cellRole,
|
|
5493
5396
|
style: {
|
|
5494
5397
|
width: this.columnsVisibility.role,
|
|
5495
|
-
cursor: this.
|
|
5398
|
+
cursor: this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole ? 'text' : 'default'
|
|
5496
5399
|
},
|
|
5497
|
-
onClick: this.
|
|
5400
|
+
onClick: this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole ? function () {
|
|
5498
5401
|
return _this37.setState({
|
|
5499
5402
|
roleDialog: item.data.id
|
|
5500
5403
|
});
|
|
5501
5404
|
} : undefined
|
|
5502
|
-
},
|
|
5405
|
+
}, common === null || common === void 0 ? void 0 : common.role) : null, this.columnsVisibility.room ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5503
5406
|
className: "".concat(classes.cellRoom, " ").concat(item.data.per ? classes.cellEnumParent : ''),
|
|
5504
5407
|
style: {
|
|
5505
5408
|
width: this.columnsVisibility.room,
|
|
@@ -5584,7 +5487,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5584
5487
|
} // in non-expert mode control button directly
|
|
5585
5488
|
|
|
5586
5489
|
|
|
5587
|
-
if (!_this37.
|
|
5490
|
+
if (!_this37.state.filter.expertMode && item.data.button) {
|
|
5588
5491
|
return _this37.props.socket.setState(id, true)["catch"](function (e) {
|
|
5589
5492
|
return window.alert("Cannot write state \"".concat(id, "\": ").concat(e));
|
|
5590
5493
|
});
|
|
@@ -6042,7 +5945,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6042
5945
|
var ObjectCustomDialog = this.props.objectCustomDialog;
|
|
6043
5946
|
return /*#__PURE__*/_react["default"].createElement(ObjectCustomDialog, {
|
|
6044
5947
|
reportChangedIds: function reportChangedIds(changedIds) {
|
|
6045
|
-
return _this43.changedIds =
|
|
5948
|
+
return _this43.changedIds = (0, _toConsumableArray2["default"])(changedIds);
|
|
6046
5949
|
},
|
|
6047
5950
|
objectIDs: this.state.customDialog,
|
|
6048
5951
|
expertMode: this.state.filter.expertMode,
|
|
@@ -6190,7 +6093,17 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6190
6093
|
return null;
|
|
6191
6094
|
}
|
|
6192
6095
|
|
|
6193
|
-
|
|
6096
|
+
if (!this.edit.id) {
|
|
6097
|
+
console.error('Invalid ID for edit: ' + JSON.stringify(this.edit));
|
|
6098
|
+
return null;
|
|
6099
|
+
}
|
|
6100
|
+
|
|
6101
|
+
if (!this.objects[this.edit.id]) {
|
|
6102
|
+
console.error("Something went wrong. Possibly the object ".concat(this.edit.id, " was deleted."));
|
|
6103
|
+
return null;
|
|
6104
|
+
}
|
|
6105
|
+
|
|
6106
|
+
var type = (_this$objects$this$ed = this.objects[this.edit.id].common) !== null && _this$objects$this$ed !== void 0 && _this$objects$this$ed.type ? this.objects[this.edit.id].common.type : (0, _typeof2["default"])(this.edit.val);
|
|
6194
6107
|
var ObjectBrowserValue = this.props.objectBrowserValue;
|
|
6195
6108
|
return /*#__PURE__*/_react["default"].createElement(ObjectBrowserValue, {
|
|
6196
6109
|
t: this.props.t,
|
|
@@ -6287,7 +6200,6 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6287
6200
|
return changed ? newState : null;
|
|
6288
6201
|
}
|
|
6289
6202
|
}]);
|
|
6290
|
-
|
|
6291
6203
|
return ObjectBrowser;
|
|
6292
6204
|
}(_react.Component);
|
|
6293
6205
|
|
|
@@ -6367,7 +6279,7 @@ ObjectBrowser.propTypes = {
|
|
|
6367
6279
|
};
|
|
6368
6280
|
/** @type {typeof ObjectBrowser} */
|
|
6369
6281
|
|
|
6370
|
-
var _export =
|
|
6282
|
+
var _export = (0, _withWidth["default"])()((0, _withStyles["default"])(styles)(ObjectBrowser));
|
|
6371
6283
|
|
|
6372
6284
|
var _default = _export;
|
|
6373
6285
|
exports["default"] = _default;
|