@iobroker/adapter-react-v5 2.1.7 → 2.1.9
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 +40 -61
- 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 +15 -25
- package/Components/Logo.js.map +1 -1
- package/Components/MDUtils.js +14 -11
- package/Components/MDUtils.js.map +1 -1
- package/Components/ObjectBrowser.js +110 -175
- 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 +17 -25
- package/Components/SelectWithIcon.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/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 +31 -42
- package/Components/Utils.js.map +1 -1
- package/Connection.js +15 -22
- 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 +37 -49
- package/GenericApp.js.map +1 -1
- package/README.md +4 -0
- package/Theme.js +2 -2
- package/Theme.js.map +1 -1
- package/i18n.js +10 -14
- 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 +9 -9
|
@@ -1,10 +1,38 @@
|
|
|
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 _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
+
|
|
16
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
+
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
|
|
20
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
21
|
+
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
+
|
|
24
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
+
|
|
26
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
+
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
|
|
30
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
31
|
+
|
|
32
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
33
|
+
|
|
34
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
35
|
+
|
|
8
36
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
37
|
|
|
10
38
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -161,63 +189,21 @@ var _TabContent = _interopRequireDefault(require("./TabContent"));
|
|
|
161
189
|
|
|
162
190
|
var _TabHeader = _interopRequireDefault(require("./TabHeader"));
|
|
163
191
|
|
|
164
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
165
|
-
|
|
166
192
|
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
193
|
|
|
168
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
194
|
+
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
195
|
|
|
170
196
|
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
197
|
|
|
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"); } }
|
|
198
|
+
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; }
|
|
179
199
|
|
|
180
|
-
function
|
|
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); }
|
|
191
|
-
|
|
192
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
200
|
+
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
201
|
|
|
194
202
|
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
203
|
|
|
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
204
|
function useWidth() {
|
|
217
205
|
var theme = (0, _styles.useTheme)();
|
|
218
|
-
|
|
219
|
-
var keys = _toConsumableArray(theme.breakpoints.keys).reverse();
|
|
220
|
-
|
|
206
|
+
var keys = (0, _toConsumableArray2["default"])(theme.breakpoints.keys).reverse();
|
|
221
207
|
return keys.reduce(function (output, key) {
|
|
222
208
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
223
209
|
var matches = (0, _useMediaQuery["default"])(theme.breakpoints.up(key));
|
|
@@ -230,7 +216,7 @@ var withWidth = function withWidth() {
|
|
|
230
216
|
return function (WrappedComponent) {
|
|
231
217
|
return function (props) {
|
|
232
218
|
var width = useWidth();
|
|
233
|
-
return /*#__PURE__*/_react["default"].createElement(WrappedComponent,
|
|
219
|
+
return /*#__PURE__*/_react["default"].createElement(WrappedComponent, (0, _extends2["default"])({}, props, {
|
|
234
220
|
width: width
|
|
235
221
|
}));
|
|
236
222
|
};
|
|
@@ -1318,7 +1304,7 @@ function findNode(root, id, _parts, _path, _level) {
|
|
|
1318
1304
|
}
|
|
1319
1305
|
|
|
1320
1306
|
function getName(name, lang) {
|
|
1321
|
-
if (name &&
|
|
1307
|
+
if (name && (0, _typeof2["default"])(name) === 'object') {
|
|
1322
1308
|
return (name[lang] || name.en || '').toString();
|
|
1323
1309
|
} else {
|
|
1324
1310
|
return (name || '').toString();
|
|
@@ -1457,49 +1443,18 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1457
1443
|
var isCommon = obj.common;
|
|
1458
1444
|
var valText = {};
|
|
1459
1445
|
var v = isCommon && isCommon.type === 'file' ? '[file]' : !state || state.val === null ? '(null)' : state.val === undefined ? '[undef]' : state.val;
|
|
1460
|
-
|
|
1461
|
-
var type = _typeof(v);
|
|
1446
|
+
var type = (0, _typeof2["default"])(v);
|
|
1462
1447
|
|
|
1463
1448
|
if (isCommon && isCommon.role && typeof isCommon.role === 'string' && isCommon.role.match(/^value\.time|^date/)) {
|
|
1464
1449
|
if (v && typeof v === 'string') {
|
|
1465
1450
|
if (v.length === 13) {
|
|
1466
1451
|
// (length of "1647597254924") warning, this solution only works till Nov 20 2286 18:46:39CET
|
|
1467
1452
|
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
|
|
1453
|
+
} else {// we don't know what is that, so leave it as it is
|
|
1494
1454
|
}
|
|
1495
1455
|
} else {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
} else if (v === undefined) {
|
|
1499
|
-
v = 'undefined';
|
|
1500
|
-
} else {
|
|
1501
|
-
v = v ? new Date(v).toString() : v;
|
|
1502
|
-
}
|
|
1456
|
+
// null and undefined could not be here. See `let v = (isCommon && isCommon.type === 'file') ....` above
|
|
1457
|
+
v = v ? new Date(v).toString() : v;
|
|
1503
1458
|
}
|
|
1504
1459
|
} else {
|
|
1505
1460
|
if (type === 'number') {
|
|
@@ -1517,11 +1472,12 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1517
1472
|
if (typeof v !== 'string') {
|
|
1518
1473
|
v = v.toString();
|
|
1519
1474
|
}
|
|
1520
|
-
}
|
|
1475
|
+
} // try to replace number with "common.states"
|
|
1476
|
+
|
|
1521
1477
|
|
|
1522
1478
|
if (states && states[v] !== undefined) {
|
|
1523
1479
|
valText.s = v;
|
|
1524
|
-
v = states[
|
|
1480
|
+
v = states[v];
|
|
1525
1481
|
}
|
|
1526
1482
|
|
|
1527
1483
|
var valFull;
|
|
@@ -1536,7 +1492,7 @@ function formatValue(id, state, obj, texts, dateFormat, isFloatComma) {
|
|
|
1536
1492
|
}];
|
|
1537
1493
|
|
|
1538
1494
|
if (state) {
|
|
1539
|
-
if (state.ack !== undefined) {
|
|
1495
|
+
if (state.ack !== undefined && state.ack !== null) {
|
|
1540
1496
|
valFull.push({
|
|
1541
1497
|
t: texts.ack,
|
|
1542
1498
|
v: state.ack.toString()
|
|
@@ -1868,7 +1824,7 @@ var objectsAlreadyLoaded = false;
|
|
|
1868
1824
|
*/
|
|
1869
1825
|
|
|
1870
1826
|
var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
1871
|
-
|
|
1827
|
+
(0, _inherits2["default"])(ObjectBrowser, _Component);
|
|
1872
1828
|
|
|
1873
1829
|
var _super = _createSuper(ObjectBrowser);
|
|
1874
1830
|
|
|
@@ -1878,11 +1834,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
1878
1834
|
function ObjectBrowser(props) {
|
|
1879
1835
|
var _this;
|
|
1880
1836
|
|
|
1881
|
-
|
|
1882
|
-
|
|
1837
|
+
(0, _classCallCheck2["default"])(this, ObjectBrowser);
|
|
1883
1838
|
_this = _super.call(this, props);
|
|
1884
|
-
|
|
1885
|
-
_defineProperty(_assertThisInitialized(_this), "onStateChange", function (id, state) {
|
|
1839
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onStateChange", function (id, state) {
|
|
1886
1840
|
console.log('> stateChange ' + id);
|
|
1887
1841
|
|
|
1888
1842
|
if (_this.states[id]) {
|
|
@@ -1910,8 +1864,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
1910
1864
|
}
|
|
1911
1865
|
}
|
|
1912
1866
|
});
|
|
1913
|
-
|
|
1914
|
-
_defineProperty(_assertThisInitialized(_this), "onObjectChange", function (id, obj, oldObj) {
|
|
1867
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onObjectChange", function (id, obj, oldObj) {
|
|
1915
1868
|
var newState;
|
|
1916
1869
|
|
|
1917
1870
|
if (Array.isArray(id)) {
|
|
@@ -2000,8 +1953,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2000
1953
|
}, 500);
|
|
2001
1954
|
}
|
|
2002
1955
|
});
|
|
2003
|
-
|
|
2004
|
-
_defineProperty(_assertThisInitialized(_this), "getEnumsForId", function (id) {
|
|
1956
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getEnumsForId", function (id) {
|
|
2005
1957
|
var result = [];
|
|
2006
1958
|
|
|
2007
1959
|
_this.info.enums.forEach(function (_id) {
|
|
@@ -2027,12 +1979,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2027
1979
|
|
|
2028
1980
|
return result.length ? result : undefined;
|
|
2029
1981
|
});
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(enums, objId) {
|
|
1982
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_createAllEnums", /*#__PURE__*/function () {
|
|
1983
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(enums, objId) {
|
|
2033
1984
|
var e, _enObj$common, _enObj$common$members, id, _enObj, enObj;
|
|
2034
1985
|
|
|
2035
|
-
return
|
|
1986
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
2036
1987
|
while (1) {
|
|
2037
1988
|
switch (_context.prev = _context.next) {
|
|
2038
1989
|
case 0:
|
|
@@ -2047,7 +1998,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2047
1998
|
id = enums[e];
|
|
2048
1999
|
_enObj = void 0;
|
|
2049
2000
|
|
|
2050
|
-
if (
|
|
2001
|
+
if ((0, _typeof2["default"])(id) === 'object') {
|
|
2051
2002
|
_enObj = id;
|
|
2052
2003
|
id = id._id;
|
|
2053
2004
|
}
|
|
@@ -2107,11 +2058,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2107
2058
|
return _ref.apply(this, arguments);
|
|
2108
2059
|
};
|
|
2109
2060
|
}());
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(objs) {
|
|
2061
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "loadObjects", /*#__PURE__*/function () {
|
|
2062
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(objs) {
|
|
2113
2063
|
var id, obj, enums, state;
|
|
2114
|
-
return
|
|
2064
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
2115
2065
|
while (1) {
|
|
2116
2066
|
switch (_context2.prev = _context2.next) {
|
|
2117
2067
|
case 0:
|
|
@@ -2120,7 +2070,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2120
2070
|
break;
|
|
2121
2071
|
}
|
|
2122
2072
|
|
|
2123
|
-
_context2.t0 =
|
|
2073
|
+
_context2.t0 = _regenerator["default"].keys(objs);
|
|
2124
2074
|
|
|
2125
2075
|
case 2:
|
|
2126
2076
|
if ((_context2.t1 = _context2.t0()).done) {
|
|
@@ -2228,17 +2178,16 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2228
2178
|
return _ref2.apply(this, arguments);
|
|
2229
2179
|
};
|
|
2230
2180
|
}());
|
|
2231
|
-
|
|
2232
|
-
_defineProperty(_assertThisInitialized(_this), "handleJsonUpload", function (evt) {
|
|
2181
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleJsonUpload", function (evt) {
|
|
2233
2182
|
var f = evt.target.files[0];
|
|
2234
2183
|
|
|
2235
2184
|
if (f) {
|
|
2236
2185
|
var r = new FileReader();
|
|
2237
2186
|
|
|
2238
2187
|
r.onload = /*#__PURE__*/function () {
|
|
2239
|
-
var _ref3 =
|
|
2188
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(e) {
|
|
2240
2189
|
var contents, json, len, id, enums, state;
|
|
2241
|
-
return
|
|
2190
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
2242
2191
|
while (1) {
|
|
2243
2192
|
switch (_context3.prev = _context3.next) {
|
|
2244
2193
|
case 0:
|
|
@@ -2346,8 +2295,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2346
2295
|
window.alert(_this.props.t('ra_Failed to open JSON File'));
|
|
2347
2296
|
}
|
|
2348
2297
|
});
|
|
2349
|
-
|
|
2350
|
-
_defineProperty(_assertThisInitialized(_this), "toolTipObjectCreating", function () {
|
|
2298
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toolTipObjectCreating", function () {
|
|
2351
2299
|
var _this$objects$id2;
|
|
2352
2300
|
|
|
2353
2301
|
var t = _this.props.t;
|
|
@@ -2380,7 +2328,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2380
2328
|
var id = _this.state.selected[0] || _this.state.selectedNonObject;
|
|
2381
2329
|
|
|
2382
2330
|
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.
|
|
2331
|
+
if (_this.state.filter.expertMode) {
|
|
2384
2332
|
switch ((_this$objects$id2 = _this.objects[id]) === null || _this$objects$id2 === void 0 ? void 0 : _this$objects$id2.type) {
|
|
2385
2333
|
case 'device':
|
|
2386
2334
|
value = [/*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -2427,8 +2375,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2427
2375
|
|
|
2428
2376
|
return value.length ? value : t('ra_Add new child object to selected parent');
|
|
2429
2377
|
});
|
|
2430
|
-
|
|
2431
|
-
_defineProperty(_assertThisInitialized(_this), "renderTooltipAccessControl", function (acl) {
|
|
2378
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderTooltipAccessControl", function (acl) {
|
|
2432
2379
|
// acl ={object,state,owner,ownerGroup}
|
|
2433
2380
|
if (!acl) {
|
|
2434
2381
|
return null;
|
|
@@ -2499,25 +2446,22 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2499
2446
|
return el;
|
|
2500
2447
|
})) : '';
|
|
2501
2448
|
});
|
|
2502
|
-
|
|
2503
|
-
_defineProperty(_assertThisInitialized(_this), "extendObject", function (id, data) {
|
|
2449
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "extendObject", function (id, data) {
|
|
2504
2450
|
return _this.props.socket.extendObject(id, data)["catch"](function (error) {
|
|
2505
2451
|
return window.alert(error);
|
|
2506
2452
|
});
|
|
2507
2453
|
});
|
|
2508
|
-
|
|
2509
|
-
_defineProperty(_assertThisInitialized(_this), "setObject", function (id, data) {
|
|
2454
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setObject", function (id, data) {
|
|
2510
2455
|
return _this.props.socket.setObject(id, data)["catch"](function (error) {
|
|
2511
2456
|
return window.alert(error);
|
|
2512
2457
|
});
|
|
2513
2458
|
});
|
|
2514
|
-
|
|
2515
2459
|
_this.lastSelectedItems = window.localStorage.getItem("".concat(props.dialogName || 'App', ".objectSelected")) || '[]';
|
|
2516
2460
|
|
|
2517
2461
|
try {
|
|
2518
2462
|
_this.lastSelectedItems = JSON.parse(_this.lastSelectedItems);
|
|
2519
2463
|
|
|
2520
|
-
if (
|
|
2464
|
+
if ((0, _typeof2["default"])(_this.lastSelectedItems) !== 'object') {
|
|
2521
2465
|
_this.lastSelectedItems = [_this.lastSelectedItems];
|
|
2522
2466
|
}
|
|
2523
2467
|
|
|
@@ -2581,7 +2525,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2581
2525
|
|
|
2582
2526
|
var selected = props.selected || '';
|
|
2583
2527
|
|
|
2584
|
-
if (
|
|
2528
|
+
if ((0, _typeof2["default"])(selected) !== 'object') {
|
|
2585
2529
|
selected = [selected];
|
|
2586
2530
|
}
|
|
2587
2531
|
|
|
@@ -2707,7 +2651,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2707
2651
|
return _this;
|
|
2708
2652
|
}
|
|
2709
2653
|
|
|
2710
|
-
|
|
2654
|
+
(0, _createClass2["default"])(ObjectBrowser, [{
|
|
2711
2655
|
key: "loadAllObjects",
|
|
2712
2656
|
value: function loadAllObjects(update) {
|
|
2713
2657
|
var _this2 = this;
|
|
@@ -2827,8 +2771,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2827
2771
|
}, {
|
|
2828
2772
|
key: "expandAllSelected",
|
|
2829
2773
|
value: function expandAllSelected(cb) {
|
|
2830
|
-
var expanded =
|
|
2831
|
-
|
|
2774
|
+
var expanded = (0, _toConsumableArray2["default"])(this.state.expanded);
|
|
2832
2775
|
var changed = false;
|
|
2833
2776
|
this.state.selected.forEach(function (id) {
|
|
2834
2777
|
var parts = id.split('.');
|
|
@@ -2864,7 +2807,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2864
2807
|
value: function onAfterSelect(isDouble) {
|
|
2865
2808
|
var _this3 = this;
|
|
2866
2809
|
|
|
2867
|
-
this.lastSelectedItems =
|
|
2810
|
+
this.lastSelectedItems = (0, _toConsumableArray2["default"])(this.state.selected);
|
|
2868
2811
|
|
|
2869
2812
|
if (this.state.selected && this.state.selected.length) {
|
|
2870
2813
|
window.localStorage.setItem("".concat(this.props.dialogName || 'App', ".objectSelected"), JSON.stringify(this.lastSelectedItems));
|
|
@@ -3001,7 +2944,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3001
2944
|
key: "showError",
|
|
3002
2945
|
value: function showError(error) {
|
|
3003
2946
|
this.setState({
|
|
3004
|
-
error:
|
|
2947
|
+
error: (0, _typeof2["default"])(error) === 'object' ? error && typeof error.toString === 'function' ? error.toString() : JSON.stringify(error) : error
|
|
3005
2948
|
});
|
|
3006
2949
|
}
|
|
3007
2950
|
/**
|
|
@@ -3041,9 +2984,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3041
2984
|
} else {
|
|
3042
2985
|
if (this.objects[toggleItem] && (!this.props.types || this.props.types.includes(this.objects[toggleItem].type))) {
|
|
3043
2986
|
window.localStorage.removeItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"));
|
|
3044
|
-
|
|
3045
|
-
var selected = _toConsumableArray(this.state.selected);
|
|
3046
|
-
|
|
2987
|
+
var selected = (0, _toConsumableArray2["default"])(this.state.selected);
|
|
3047
2988
|
var pos = selected.indexOf(toggleItem);
|
|
3048
2989
|
|
|
3049
2990
|
if (pos === -1) {
|
|
@@ -3072,8 +3013,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3072
3013
|
value: function _renderDefinedList(isLast) {
|
|
3073
3014
|
var _this9 = this;
|
|
3074
3015
|
|
|
3075
|
-
var cols =
|
|
3076
|
-
|
|
3016
|
+
var cols = (0, _toConsumableArray2["default"])(this.possibleCols);
|
|
3077
3017
|
cols.unshift('id');
|
|
3078
3018
|
|
|
3079
3019
|
if (this.props.columns && !this.props.columns.includes('buttons')) {
|
|
@@ -3091,7 +3031,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3091
3031
|
button: true,
|
|
3092
3032
|
onClick: function onClick() {
|
|
3093
3033
|
if (!_this9.state.columnsAuto && id !== 'id') {
|
|
3094
|
-
var columns =
|
|
3034
|
+
var columns = (0, _toConsumableArray2["default"])(_this9.state.columns || []);
|
|
3095
3035
|
|
|
3096
3036
|
var _pos = columns.indexOf(id);
|
|
3097
3037
|
|
|
@@ -3190,11 +3130,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3190
3130
|
});
|
|
3191
3131
|
} else {
|
|
3192
3132
|
if (!_this10.state.columns) {
|
|
3193
|
-
_this10.calculateColumnsVisibility(false,
|
|
3133
|
+
_this10.calculateColumnsVisibility(false, (0, _toConsumableArray2["default"])(_this10.visibleCols));
|
|
3194
3134
|
|
|
3195
3135
|
_this10.setState({
|
|
3196
3136
|
columnsAuto: false,
|
|
3197
|
-
columns:
|
|
3137
|
+
columns: (0, _toConsumableArray2["default"])(_this10.visibleCols)
|
|
3198
3138
|
});
|
|
3199
3139
|
} else {
|
|
3200
3140
|
_this10.calculateColumnsVisibility(false);
|
|
@@ -3256,8 +3196,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3256
3196
|
button: true,
|
|
3257
3197
|
onClick: function onClick() {
|
|
3258
3198
|
if (!_this10.state.columnsAuto) {
|
|
3259
|
-
var columns =
|
|
3260
|
-
|
|
3199
|
+
var columns = (0, _toConsumableArray2["default"])(_this10.state.columns || []);
|
|
3261
3200
|
var id = '_' + adapter + '_' + column.path;
|
|
3262
3201
|
var pos = columns.indexOf(id);
|
|
3263
3202
|
|
|
@@ -3418,12 +3357,12 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3418
3357
|
if (obj.common && obj.common.adminColumns && obj.common.name) {
|
|
3419
3358
|
var columns = obj.common.adminColumns;
|
|
3420
3359
|
|
|
3421
|
-
if (
|
|
3360
|
+
if ((0, _typeof2["default"])(columns) !== 'object') {
|
|
3422
3361
|
columns = [columns];
|
|
3423
3362
|
}
|
|
3424
3363
|
|
|
3425
3364
|
columns = columns.map(function (item) {
|
|
3426
|
-
if (
|
|
3365
|
+
if ((0, _typeof2["default"])(item) !== 'object') {
|
|
3427
3366
|
return {
|
|
3428
3367
|
path: item,
|
|
3429
3368
|
name: item.split('.').pop()
|
|
@@ -3431,7 +3370,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3431
3370
|
} // string => array
|
|
3432
3371
|
|
|
3433
3372
|
|
|
3434
|
-
if (item.objTypes &&
|
|
3373
|
+
if (item.objTypes && (0, _typeof2["default"])(item.objTypes) !== 'object') {
|
|
3435
3374
|
item.objTypes = [item.objTypes];
|
|
3436
3375
|
} else if (!item.objTypes) {
|
|
3437
3376
|
item.objTypes = null;
|
|
@@ -3448,7 +3387,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3448
3387
|
};
|
|
3449
3388
|
}
|
|
3450
3389
|
|
|
3451
|
-
if (
|
|
3390
|
+
if ((0, _typeof2["default"])(item.name) !== 'object' && item.path) {
|
|
3452
3391
|
return {
|
|
3453
3392
|
path: item.path,
|
|
3454
3393
|
name: item.name,
|
|
@@ -3733,7 +3672,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3733
3672
|
var name;
|
|
3734
3673
|
var icon;
|
|
3735
3674
|
|
|
3736
|
-
if (
|
|
3675
|
+
if ((0, _typeof2["default"])(item) === 'object') {
|
|
3737
3676
|
id = item.value;
|
|
3738
3677
|
name = item.name;
|
|
3739
3678
|
icon = item.icon;
|
|
@@ -3960,9 +3899,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3960
3899
|
value: function onExpandVisible() {
|
|
3961
3900
|
if (this.state.depth < 9) {
|
|
3962
3901
|
var depth = this.state.depth + 1;
|
|
3963
|
-
|
|
3964
|
-
var expanded = _toConsumableArray(this.state.expanded);
|
|
3965
|
-
|
|
3902
|
+
var expanded = (0, _toConsumableArray2["default"])(this.state.expanded);
|
|
3966
3903
|
this.expandDepth(this.root, depth, expanded);
|
|
3967
3904
|
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
3968
3905
|
this.setState({
|
|
@@ -4083,9 +4020,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4083
4020
|
});
|
|
4084
4021
|
}
|
|
4085
4022
|
}, this.props.t('ra_All objects')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4023
|
+
color: "primary",
|
|
4086
4024
|
variant: "contained",
|
|
4087
4025
|
autoFocus: true,
|
|
4088
|
-
color: "primary",
|
|
4089
4026
|
onClick: function onClick() {
|
|
4090
4027
|
return _this25.setState({
|
|
4091
4028
|
showExportDialog: false
|
|
@@ -4128,7 +4065,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4128
4065
|
if (id.split('.').length < 2 || this.objects[id] && this.objects[id].type === 'state') {
|
|
4129
4066
|
allowObjectCreation = false;
|
|
4130
4067
|
} else {
|
|
4131
|
-
if (this.
|
|
4068
|
+
if (this.state.filter.expertMode) {
|
|
4132
4069
|
allowObjectCreation = true;
|
|
4133
4070
|
} else if (id.startsWith('alias.0') || id.startsWith('0_userdata')) {
|
|
4134
4071
|
allowObjectCreation = true;
|
|
@@ -4359,7 +4296,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4359
4296
|
if (!item.data.obj) {
|
|
4360
4297
|
return this.props.onObjectDelete || this.props.objectEditOfAccessControl ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
4361
4298
|
className: classes.buttonDiv
|
|
4362
|
-
}, this.
|
|
4299
|
+
}, this.state.filter.expertMode && this.props.objectEditOfAccessControl ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4363
4300
|
className: _Utils["default"].clsx(classes.cellButtonsButton, classes.cellButtonsEmptyButton, classes.cellButtonMinWidth),
|
|
4364
4301
|
onClick: function onClick() {
|
|
4365
4302
|
return _this27.setState({
|
|
@@ -4385,7 +4322,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4385
4322
|
item.data.aclTooltip = item.data.aclTooltip || this.renderTooltipAccessControl(item.data.obj.acl);
|
|
4386
4323
|
var acl = item.data.obj.acl ? item.data.obj.type === 'state' ? item.data.obj.acl.state : item.data.obj.acl.object : 0;
|
|
4387
4324
|
var aclSystemConfig = item.data.obj.acl && (item.data.obj.type === 'state' ? this.systemConfig.common.defaultNewAcl.state : this.systemConfig.common.defaultNewAcl.object);
|
|
4388
|
-
return [this.
|
|
4325
|
+
return [this.state.filter.expertMode && this.props.objectEditOfAccessControl ? /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
4389
4326
|
key: "acl",
|
|
4390
4327
|
title: item.data.aclTooltip
|
|
4391
4328
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
@@ -4589,13 +4526,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4589
4526
|
info.val = copyText;
|
|
4590
4527
|
info.valText = [/*#__PURE__*/_react["default"].createElement("span", {
|
|
4591
4528
|
className: classes.newValue || classes.newValue,
|
|
4592
|
-
key: "
|
|
4529
|
+
key: "valText"
|
|
4593
4530
|
}, info.valText.v.toString()), info.valText.u ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
4594
4531
|
className: _Utils["default"].clsx(classes.cellValueTextUnit, classes.newValue),
|
|
4595
|
-
key: "
|
|
4532
|
+
key: "unit"
|
|
4596
4533
|
}, info.valText.u) : null, info.valText.s !== undefined ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
4597
4534
|
className: _Utils["default"].clsx(classes.cellValueTextState, classes.newValue),
|
|
4598
|
-
key: "
|
|
4535
|
+
key: "states"
|
|
4599
4536
|
}, "(", info.valText.s, ")") : null, /*#__PURE__*/_react["default"].createElement(_IconCopy["default"], {
|
|
4600
4537
|
className: _Utils["default"].clsx(classes.cellButtonsValueButton, 'copyButton', classes.cellButtonsValueButtonCopy),
|
|
4601
4538
|
onClick: function onClick(e) {
|
|
@@ -4608,7 +4545,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4608
4545
|
|
|
4609
4546
|
var val = info.valText;
|
|
4610
4547
|
|
|
4611
|
-
if (!this.
|
|
4548
|
+
if (!this.state.filter.expertMode && item.data.button) {
|
|
4612
4549
|
val = /*#__PURE__*/_react["default"].createElement(_RoomService["default"], {
|
|
4613
4550
|
className: _Utils["default"].clsx(this.props.classes.cellValueButton, !this.states[id] || !this.states[id].val ? this.props.classes.cellValueButtonFalse : '')
|
|
4614
4551
|
});
|
|
@@ -4701,8 +4638,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4701
4638
|
value: function syncEnum(id, enumName, newArray) {
|
|
4702
4639
|
var _this31 = this;
|
|
4703
4640
|
|
|
4704
|
-
var toCheck =
|
|
4705
|
-
|
|
4641
|
+
var toCheck = (0, _toConsumableArray2["default"])(this.info[enumName === 'func' ? 'funcEnums' : 'roomEnums']);
|
|
4706
4642
|
return new Promise(function (resolve) {
|
|
4707
4643
|
return _this31._syncEnum(id, toCheck, newArray, function (error) {
|
|
4708
4644
|
error && _this31.showError(error); // force update of object
|
|
@@ -4778,7 +4714,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4778
4714
|
var name;
|
|
4779
4715
|
var icon;
|
|
4780
4716
|
|
|
4781
|
-
if (
|
|
4717
|
+
if ((0, _typeof2["default"])(item) === 'object') {
|
|
4782
4718
|
id = item.value;
|
|
4783
4719
|
name = item.name;
|
|
4784
4720
|
icon = item.icon;
|
|
@@ -4911,7 +4847,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4911
4847
|
if (!this.customColumnDialog) {
|
|
4912
4848
|
var value = this.getCustomValue(this.state.columnsEditCustomDialog.obj, this.state.columnsEditCustomDialog.it);
|
|
4913
4849
|
this.customColumnDialog = {
|
|
4914
|
-
type: this.state.columnsEditCustomDialog.it.type ||
|
|
4850
|
+
type: this.state.columnsEditCustomDialog.it.type || (0, _typeof2["default"])(value),
|
|
4915
4851
|
initValue: (value === null || value === undefined ? '' : value).toString(),
|
|
4916
4852
|
value: (value === null || value === undefined ? '' : value).toString()
|
|
4917
4853
|
};
|
|
@@ -5000,18 +4936,18 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5000
4936
|
var p = it.path;
|
|
5001
4937
|
var value;
|
|
5002
4938
|
|
|
5003
|
-
if (obj[p[0]] &&
|
|
4939
|
+
if (obj[p[0]] && (0, _typeof2["default"])(obj[p[0]]) === 'object') {
|
|
5004
4940
|
if (p.length === 2) {
|
|
5005
4941
|
// most common case
|
|
5006
4942
|
value = obj[p[0]][p[1]];
|
|
5007
4943
|
} else if (p.length === 3) {
|
|
5008
|
-
value = obj[p[0]][p[1]] &&
|
|
4944
|
+
value = obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object' ? obj[p[0]][p[1]][p[2]] : null;
|
|
5009
4945
|
} else if (p.length === 4) {
|
|
5010
|
-
value = obj[p[0]][p[1]] &&
|
|
4946
|
+
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;
|
|
5011
4947
|
} else if (p.length === 5) {
|
|
5012
|
-
value = obj[p[0]][p[1]] &&
|
|
4948
|
+
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;
|
|
5013
4949
|
} else if (p.length === 6) {
|
|
5014
|
-
value = obj[p[0]][p[1]] &&
|
|
4950
|
+
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;
|
|
5015
4951
|
}
|
|
5016
4952
|
|
|
5017
4953
|
if (value === undefined || value === null) {
|
|
@@ -5037,28 +4973,28 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5037
4973
|
if (obj && obj._id && obj._id.startsWith(it.adapter + '.') && it.path.length > 1) {
|
|
5038
4974
|
var p = it.path;
|
|
5039
4975
|
|
|
5040
|
-
if (obj[p[0]] &&
|
|
4976
|
+
if (obj[p[0]] && (0, _typeof2["default"])(obj[p[0]]) === 'object') {
|
|
5041
4977
|
if (p.length === 2) {
|
|
5042
4978
|
// most common case
|
|
5043
4979
|
obj[p[0]][p[1]] = value;
|
|
5044
4980
|
return true;
|
|
5045
4981
|
} else if (p.length === 3) {
|
|
5046
|
-
if (obj[p[0]][p[1]] &&
|
|
4982
|
+
if (obj[p[0]][p[1]] && (0, _typeof2["default"])(obj[p[0]][p[1]]) === 'object') {
|
|
5047
4983
|
obj[p[0]][p[1]][p[2]] = value;
|
|
5048
4984
|
return true;
|
|
5049
4985
|
}
|
|
5050
4986
|
} else if (p.length === 4) {
|
|
5051
|
-
if (obj[p[0]][p[1]] &&
|
|
4987
|
+
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') {
|
|
5052
4988
|
obj[p[0]][p[1]][p[2]][p[3]] = value;
|
|
5053
4989
|
return true;
|
|
5054
4990
|
}
|
|
5055
4991
|
} else if (p.length === 5) {
|
|
5056
|
-
if (obj[p[0]][p[1]] &&
|
|
4992
|
+
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') {
|
|
5057
4993
|
obj[p[0]][p[1]][p[2]][p[3]][p[4]] = value;
|
|
5058
4994
|
return true;
|
|
5059
4995
|
}
|
|
5060
4996
|
} else if (p.length === 6) {
|
|
5061
|
-
if (obj[p[0]][p[1]] &&
|
|
4997
|
+
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') {
|
|
5062
4998
|
obj[p[0]][p[1]][p[2]][p[3]][p[4]][p[5]] = value;
|
|
5063
4999
|
return true;
|
|
5064
5000
|
}
|
|
@@ -5204,13 +5140,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5204
5140
|
className: classes.checkBox,
|
|
5205
5141
|
checked: this.state.selected.includes(id)
|
|
5206
5142
|
}) : null;
|
|
5207
|
-
var valueEditable = !this.props.notEditable && itemType === 'state' && (this.
|
|
5143
|
+
var valueEditable = !this.props.notEditable && itemType === 'state' && (this.state.filter.expertMode || (common === null || common === void 0 ? void 0 : common.write) !== false);
|
|
5208
5144
|
|
|
5209
5145
|
if (this.props.objectBrowserViewFile && (common === null || common === void 0 ? void 0 : common.type) === 'file') {
|
|
5210
5146
|
valueEditable = true;
|
|
5211
5147
|
}
|
|
5212
5148
|
|
|
5213
|
-
var enumEditable = !this.props.notEditable && this.objects[id] && (this.
|
|
5149
|
+
var enumEditable = !this.props.notEditable && this.objects[id] && (this.state.filter.expertMode || itemType === 'state' || itemType === 'channel' || itemType === 'device');
|
|
5214
5150
|
var checkVisibleObjectType = this.state.statesView && (itemType === 'state' || itemType === 'channel' || itemType === 'device');
|
|
5215
5151
|
var newValue = '';
|
|
5216
5152
|
var newValueTitle = [];
|
|
@@ -5240,7 +5176,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5240
5176
|
obj.ts && newValueTitle.push(this.texts.objectChangedByUser + ' ' + _Utils["default"].formatDate(new Date(obj.ts), this.props.dateFormat));
|
|
5241
5177
|
}
|
|
5242
5178
|
|
|
5243
|
-
var readWriteAlias =
|
|
5179
|
+
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';
|
|
5244
5180
|
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", {
|
|
5245
5181
|
className: classes.cellIdAliasReadWriteDiv
|
|
5246
5182
|
}, common.alias.id.read ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -5487,9 +5423,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5487
5423
|
className: classes.cellRole,
|
|
5488
5424
|
style: {
|
|
5489
5425
|
width: this.columnsVisibility.role,
|
|
5490
|
-
cursor: this.
|
|
5426
|
+
cursor: this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole ? 'text' : 'default'
|
|
5491
5427
|
},
|
|
5492
|
-
onClick: this.
|
|
5428
|
+
onClick: this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole ? function () {
|
|
5493
5429
|
return _this37.setState({
|
|
5494
5430
|
roleDialog: item.data.id
|
|
5495
5431
|
});
|
|
@@ -5579,7 +5515,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5579
5515
|
} // in non-expert mode control button directly
|
|
5580
5516
|
|
|
5581
5517
|
|
|
5582
|
-
if (!_this37.
|
|
5518
|
+
if (!_this37.state.filter.expertMode && item.data.button) {
|
|
5583
5519
|
return _this37.props.socket.setState(id, true)["catch"](function (e) {
|
|
5584
5520
|
return window.alert("Cannot write state \"".concat(id, "\": ").concat(e));
|
|
5585
5521
|
});
|
|
@@ -6037,7 +5973,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6037
5973
|
var ObjectCustomDialog = this.props.objectCustomDialog;
|
|
6038
5974
|
return /*#__PURE__*/_react["default"].createElement(ObjectCustomDialog, {
|
|
6039
5975
|
reportChangedIds: function reportChangedIds(changedIds) {
|
|
6040
|
-
return _this43.changedIds =
|
|
5976
|
+
return _this43.changedIds = (0, _toConsumableArray2["default"])(changedIds);
|
|
6041
5977
|
},
|
|
6042
5978
|
objectIDs: this.state.customDialog,
|
|
6043
5979
|
expertMode: this.state.filter.expertMode,
|
|
@@ -6185,7 +6121,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6185
6121
|
return null;
|
|
6186
6122
|
}
|
|
6187
6123
|
|
|
6188
|
-
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 :
|
|
6124
|
+
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);
|
|
6189
6125
|
var ObjectBrowserValue = this.props.objectBrowserValue;
|
|
6190
6126
|
return /*#__PURE__*/_react["default"].createElement(ObjectBrowserValue, {
|
|
6191
6127
|
t: this.props.t,
|
|
@@ -6282,7 +6218,6 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6282
6218
|
return changed ? newState : null;
|
|
6283
6219
|
}
|
|
6284
6220
|
}]);
|
|
6285
|
-
|
|
6286
6221
|
return ObjectBrowser;
|
|
6287
6222
|
}(_react.Component);
|
|
6288
6223
|
|