@iobroker/adapter-react-v5 7.2.3 → 7.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build/AdminConnection.d.ts +1 -0
- package/build/AdminConnection.js +2 -0
- package/build/AdminConnection.js.map +1 -0
- package/{src/Components/404.tsx → build/Components/404.js} +14 -39
- package/build/Components/404.js.map +1 -0
- package/{Components → build/Components}/ColorPicker.d.ts +2 -2
- package/{Components → build/Components}/ColorPicker.js +50 -65
- package/build/Components/ColorPicker.js.map +1 -0
- package/{Components → build/Components}/ComplexCron.d.ts +2 -2
- package/{Components → build/Components}/ComplexCron.js +43 -71
- package/build/Components/ComplexCron.js.map +1 -0
- package/{Components → build/Components}/CopyToClipboard.d.ts +1 -2
- package/{src/Components/CopyToClipboard.tsx → build/Components/CopyToClipboard.js} +20 -38
- package/build/Components/CopyToClipboard.js.map +1 -0
- package/{Components → build/Components}/CustomModal.d.ts +3 -3
- package/build/Components/CustomModal.js +60 -0
- package/build/Components/CustomModal.js.map +1 -0
- package/{Components → build/Components}/FileBrowser.d.ts +21 -21
- package/{Components → build/Components}/FileBrowser.js +253 -248
- package/build/Components/FileBrowser.js.map +1 -0
- package/build/Components/FileViewer.d.ts +48 -0
- package/build/Components/FileViewer.js +277 -0
- package/build/Components/FileViewer.js.map +1 -0
- package/{Components → build/Components}/Icon.d.ts +1 -1
- package/build/Components/Icon.js +140 -0
- package/build/Components/Icon.js.map +1 -0
- package/{Components → build/Components}/IconPicker.d.ts +2 -2
- package/build/Components/IconPicker.js +73 -0
- package/build/Components/IconPicker.js.map +1 -0
- package/{Components → build/Components}/IconSelector.d.ts +3 -3
- package/{Components → build/Components}/IconSelector.js +29 -57
- package/build/Components/IconSelector.js.map +1 -0
- package/{Components → build/Components}/Image.d.ts +2 -2
- package/{Components → build/Components}/Image.js +16 -22
- package/build/Components/Image.js.map +1 -0
- package/{Components → build/Components}/Loader.d.ts +2 -2
- package/{Components → build/Components}/Loader.js +15 -40
- package/build/Components/Loader.js.map +1 -0
- package/{Components → build/Components}/Loaders/MV.d.ts +2 -2
- package/build/Components/Loaders/MV.js +61 -0
- package/build/Components/Loaders/MV.js.map +1 -0
- package/{Components → build/Components}/Loaders/PT.d.ts +2 -2
- package/{Components → build/Components}/Loaders/PT.js +10 -35
- package/build/Components/Loaders/PT.js.map +1 -0
- package/{Components → build/Components}/Loaders/Vendor.d.ts +2 -2
- package/build/Components/Loaders/Vendor.js +52 -0
- package/build/Components/Loaders/Vendor.js.map +1 -0
- package/{Components → build/Components}/Logo.d.ts +2 -2
- package/build/Components/Logo.js +108 -0
- package/build/Components/Logo.js.map +1 -0
- package/{Components → build/Components}/MDUtils.d.ts +1 -2
- package/{Components → build/Components}/MDUtils.js +4 -9
- package/build/Components/MDUtils.js.map +1 -0
- package/{Components → build/Components}/ObjectBrowser.d.ts +7 -4
- package/{Components → build/Components}/ObjectBrowser.js +1183 -1133
- package/build/Components/ObjectBrowser.js.map +1 -0
- package/{Components → build/Components}/Router.d.ts +1 -2
- package/{Components → build/Components}/Router.js +6 -7
- package/build/Components/Router.js.map +1 -0
- package/{Components → build/Components}/SaveCloseButtons.d.ts +2 -2
- package/build/Components/SaveCloseButtons.js +65 -0
- package/build/Components/SaveCloseButtons.js.map +1 -0
- package/{Components → build/Components}/Schedule.d.ts +3 -3
- package/{Components → build/Components}/Schedule.js +246 -261
- package/build/Components/Schedule.js.map +1 -0
- package/{Components → build/Components}/SelectWithIcon.d.ts +2 -2
- package/build/Components/SelectWithIcon.js +135 -0
- package/build/Components/SelectWithIcon.js.map +1 -0
- package/build/Components/SimpleCron/cronText.js +15 -0
- package/build/Components/SimpleCron/cronText.js.map +1 -0
- package/{Components → build/Components}/SimpleCron/index.d.ts +2 -2
- package/{Components → build/Components}/SimpleCron/index.js +55 -56
- package/build/Components/SimpleCron/index.js.map +1 -0
- package/{Components → build/Components}/TabContainer.d.ts +2 -2
- package/build/Components/TabContainer.js +23 -0
- package/build/Components/TabContainer.js.map +1 -0
- package/{Components → build/Components}/TabContent.d.ts +3 -2
- package/build/Components/TabContent.js +20 -0
- package/build/Components/TabContent.js.map +1 -0
- package/build/Components/TabHeader.d.ts +6 -0
- package/build/Components/TabHeader.js +6 -0
- package/build/Components/TabHeader.js.map +1 -0
- package/{Components → build/Components}/TableResize.d.ts +2 -2
- package/{src/Components/TableResize.tsx → build/Components/TableResize.js} +64 -134
- package/build/Components/TableResize.js.map +1 -0
- package/{Components → build/Components}/TextWithIcon.d.ts +2 -2
- package/{src/Components/TextWithIcon.tsx → build/Components/TextWithIcon.js} +30 -75
- package/build/Components/TextWithIcon.js.map +1 -0
- package/{Components → build/Components}/ToggleThemeMenu.d.ts +1 -1
- package/build/Components/ToggleThemeMenu.js +13 -0
- package/build/Components/ToggleThemeMenu.js.map +1 -0
- package/{Components → build/Components}/TreeTable.d.ts +3 -3
- package/{Components → build/Components}/TreeTable.js +87 -99
- package/build/Components/TreeTable.js.map +1 -0
- package/{Components → build/Components}/UploadImage.d.ts +2 -2
- package/{Components → build/Components}/UploadImage.js +46 -69
- package/build/Components/UploadImage.js.map +1 -0
- package/{Components → build/Components}/Utils.d.ts +2 -2
- package/{Components → build/Components}/Utils.js +47 -60
- package/build/Components/Utils.js.map +1 -0
- package/build/Components/withWidth.d.ts +2 -0
- package/build/Components/withWidth.js +22 -0
- package/build/Components/withWidth.js.map +1 -0
- package/build/Connection.d.ts +1 -0
- package/build/Connection.js +2 -0
- package/build/Connection.js.map +1 -0
- package/{Dialogs → build/Dialogs}/ComplexCron.d.ts +2 -2
- package/build/Dialogs/ComplexCron.js +85 -0
- package/build/Dialogs/ComplexCron.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Confirm.d.ts +2 -2
- package/build/Dialogs/Confirm.js +83 -0
- package/build/Dialogs/Confirm.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Cron.d.ts +2 -2
- package/build/Dialogs/Cron.js +72 -0
- package/build/Dialogs/Cron.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Error.d.ts +2 -2
- package/build/Dialogs/Error.js +27 -0
- package/build/Dialogs/Error.js.map +1 -0
- package/{Dialogs → build/Dialogs}/Message.d.ts +2 -2
- package/build/Dialogs/Message.js +29 -0
- package/build/Dialogs/Message.js.map +1 -0
- package/{Dialogs → build/Dialogs}/SelectFile.d.ts +2 -2
- package/build/Dialogs/SelectFile.js +116 -0
- package/build/Dialogs/SelectFile.js.map +1 -0
- package/{Dialogs → build/Dialogs}/SelectID.d.ts +3 -3
- package/{Dialogs → build/Dialogs}/SelectID.js +28 -53
- package/build/Dialogs/SelectID.js.map +1 -0
- package/{Dialogs → build/Dialogs}/SimpleCron.d.ts +2 -2
- package/build/Dialogs/SimpleCron.js +46 -0
- package/build/Dialogs/SimpleCron.js.map +1 -0
- package/build/Dialogs/TextInput.d.ts +2 -0
- package/build/Dialogs/TextInput.js +31 -0
- package/build/Dialogs/TextInput.js.map +1 -0
- package/{GenericApp.d.ts → build/GenericApp.d.ts} +2 -3
- package/{GenericApp.js → build/GenericApp.js} +162 -176
- package/build/GenericApp.js.map +1 -0
- package/{LegacyConnection.d.ts → build/LegacyConnection.d.ts} +69 -4
- package/{LegacyConnection.js → build/LegacyConnection.js} +106 -99
- package/build/LegacyConnection.js.map +1 -0
- package/{Prompt.d.ts → build/Prompt.d.ts} +1 -1
- package/{Prompt.js → build/Prompt.js} +3 -4
- package/build/Prompt.js.map +1 -0
- package/build/Theme.d.ts +5 -0
- package/{Theme.js → build/Theme.js} +37 -32
- package/build/Theme.js.map +1 -0
- package/build/assets/devices/parseNames.d.ts +0 -0
- package/build/assets/devices/parseNames.js +35 -0
- package/build/assets/devices/parseNames.js.map +1 -0
- package/build/assets/rooms/parseNames.d.ts +0 -0
- package/build/assets/rooms/parseNames.js +35 -0
- package/build/assets/rooms/parseNames.js.map +1 -0
- package/build/dictionary.d.ts +1 -0
- package/build/dictionary.js +25 -0
- package/build/dictionary.js.map +1 -0
- package/build/i18n/de.json +449 -0
- package/build/i18n/en.json +449 -0
- package/build/i18n/es.json +449 -0
- package/build/i18n/fr.json +449 -0
- package/build/i18n/it.json +449 -0
- package/build/i18n/nl.json +449 -0
- package/build/i18n/pl.json +449 -0
- package/build/i18n/pt.json +449 -0
- package/build/i18n/ru.json +449 -0
- package/build/i18n/uk.json +449 -0
- package/build/i18n/zh-cn.json +449 -0
- package/{i18n.d.ts → build/i18n.d.ts} +2 -2
- package/{i18n.js → build/i18n.js} +9 -11
- package/build/i18n.js.map +1 -0
- package/build/icons/IconAdapter.d.ts +3 -0
- package/build/icons/IconAdapter.js +6 -0
- package/build/icons/IconAdapter.js.map +1 -0
- package/build/icons/IconAlias.d.ts +3 -0
- package/build/icons/IconAlias.js +6 -0
- package/build/icons/IconAlias.js.map +1 -0
- package/build/icons/IconChannel.d.ts +3 -0
- package/build/icons/IconChannel.js +9 -0
- package/build/icons/IconChannel.js.map +1 -0
- package/build/icons/IconClearFilter.d.ts +3 -0
- package/build/icons/IconClearFilter.js +7 -0
- package/build/icons/IconClearFilter.js.map +1 -0
- package/build/icons/IconClosed.d.ts +3 -0
- package/build/icons/IconClosed.js +6 -0
- package/build/icons/IconClosed.js.map +1 -0
- package/build/icons/IconCopy.d.ts +3 -0
- package/build/icons/IconCopy.js +5 -0
- package/build/icons/IconCopy.js.map +1 -0
- package/build/icons/IconDevice.d.ts +3 -0
- package/build/icons/IconDevice.js +15 -0
- package/build/icons/IconDevice.js.map +1 -0
- package/build/icons/IconDocument.d.ts +3 -0
- package/build/icons/IconDocument.js +6 -0
- package/build/icons/IconDocument.js.map +1 -0
- package/build/icons/IconDocumentReadOnly.d.ts +3 -0
- package/build/icons/IconDocumentReadOnly.js +7 -0
- package/build/icons/IconDocumentReadOnly.js.map +1 -0
- package/build/icons/IconExpert.d.ts +3 -0
- package/build/icons/IconExpert.js +6 -0
- package/build/icons/IconExpert.js.map +1 -0
- package/build/icons/IconFx.d.ts +3 -0
- package/build/icons/IconFx.js +5 -0
- package/build/icons/IconFx.js.map +1 -0
- package/build/icons/IconInstance.d.ts +3 -0
- package/build/icons/IconInstance.js +6 -0
- package/build/icons/IconInstance.js.map +1 -0
- package/build/icons/IconLogout.d.ts +3 -0
- package/build/icons/IconLogout.js +6 -0
- package/build/icons/IconLogout.js.map +1 -0
- package/build/icons/IconNoIcon.d.ts +3 -0
- package/build/icons/IconNoIcon.js +5 -0
- package/build/icons/IconNoIcon.js.map +1 -0
- package/build/icons/IconOpen.d.ts +3 -0
- package/build/icons/IconOpen.js +6 -0
- package/build/icons/IconOpen.js.map +1 -0
- package/{icons → build/icons}/IconProps.d.ts +1 -1
- package/build/icons/IconProps.js +2 -0
- package/build/icons/IconProps.js.map +1 -0
- package/build/icons/IconState.d.ts +3 -0
- package/build/icons/IconState.js +6 -0
- package/build/icons/IconState.js.map +1 -0
- package/build/index.d.ts +67 -0
- package/build/index.js +67 -0
- package/build/index.js.map +1 -0
- package/{types.d.ts → build/types.d.ts} +1 -1
- package/package.json +84 -47
- package/AdminConnection.d.ts +0 -2
- package/AdminConnection.js +0 -4
- package/Components/404.js +0 -101
- package/Components/CopyToClipboard.js +0 -163
- package/Components/CustomModal.js +0 -88
- package/Components/FileViewer.d.ts +0 -10
- package/Components/FileViewer.js +0 -305
- package/Components/Icon.js +0 -148
- package/Components/IconPicker.js +0 -98
- package/Components/Loaders/MV.js +0 -66
- package/Components/Loaders/Vendor.js +0 -77
- package/Components/Logo.js +0 -117
- package/Components/SaveCloseButtons.js +0 -69
- package/Components/SelectWithIcon.js +0 -168
- package/Components/SimpleCron/cronText.js +0 -19
- package/Components/TabContainer.js +0 -25
- package/Components/TabContent.js +0 -21
- package/Components/TabHeader.d.ts +0 -6
- package/Components/TabHeader.js +0 -11
- package/Components/TableResize.js +0 -226
- package/Components/TextWithIcon.js +0 -119
- package/Components/ToggleThemeMenu.js +0 -18
- package/Components/withWidth.d.ts +0 -3
- package/Components/withWidth.js +0 -27
- package/Connection.d.ts +0 -3
- package/Connection.js +0 -8
- package/Dialogs/ComplexCron.js +0 -90
- package/Dialogs/Confirm.js +0 -111
- package/Dialogs/Cron.js +0 -100
- package/Dialogs/Error.js +0 -55
- package/Dialogs/Message.js +0 -57
- package/Dialogs/SelectFile.js +0 -119
- package/Dialogs/SimpleCron.js +0 -51
- package/Dialogs/TextInput.d.ts +0 -3
- package/Dialogs/TextInput.js +0 -35
- package/Theme.d.ts +0 -6
- package/i18n/de.json +0 -449
- package/i18n/en.json +0 -449
- package/i18n/es.json +0 -449
- package/i18n/fr.json +0 -449
- package/i18n/it.json +0 -449
- package/i18n/nl.json +0 -449
- package/i18n/pl.json +0 -449
- package/i18n/pt.json +0 -449
- package/i18n/ru.json +0 -449
- package/i18n/uk.json +0 -449
- package/i18n/zh-cn.json +0 -449
- package/icons/IconAdapter.d.ts +0 -4
- package/icons/IconAdapter.js +0 -10
- package/icons/IconAlias.d.ts +0 -4
- package/icons/IconAlias.js +0 -10
- package/icons/IconChannel.d.ts +0 -4
- package/icons/IconChannel.js +0 -13
- package/icons/IconClearFilter.d.ts +0 -4
- package/icons/IconClearFilter.js +0 -11
- package/icons/IconClosed.d.ts +0 -4
- package/icons/IconClosed.js +0 -10
- package/icons/IconCopy.d.ts +0 -4
- package/icons/IconCopy.js +0 -9
- package/icons/IconDevice.d.ts +0 -4
- package/icons/IconDevice.js +0 -19
- package/icons/IconDocument.d.ts +0 -4
- package/icons/IconDocument.js +0 -10
- package/icons/IconDocumentReadOnly.d.ts +0 -4
- package/icons/IconDocumentReadOnly.js +0 -11
- package/icons/IconExpert.d.ts +0 -4
- package/icons/IconExpert.js +0 -10
- package/icons/IconFx.d.ts +0 -4
- package/icons/IconFx.js +0 -9
- package/icons/IconInstance.d.ts +0 -4
- package/icons/IconInstance.js +0 -10
- package/icons/IconLogout.d.ts +0 -4
- package/icons/IconLogout.js +0 -10
- package/icons/IconNoIcon.d.ts +0 -4
- package/icons/IconNoIcon.js +0 -9
- package/icons/IconOpen.d.ts +0 -4
- package/icons/IconOpen.js +0 -10
- package/icons/IconProps.js +0 -2
- package/icons/IconState.d.ts +0 -4
- package/icons/IconState.js +0 -10
- package/index.d.ts +0 -128
- package/index.js +0 -215
- package/src/AdminConnection.tsx +0 -3
- package/src/Components/ColorPicker.tsx +0 -343
- package/src/Components/ComplexCron.tsx +0 -561
- package/src/Components/CustomModal.tsx +0 -170
- package/src/Components/FileBrowser.tsx +0 -2550
- package/src/Components/FileViewer.tsx +0 -412
- package/src/Components/Icon.tsx +0 -238
- package/src/Components/IconPicker.tsx +0 -165
- package/src/Components/IconSelector.tsx +0 -2220
- package/src/Components/Image.tsx +0 -193
- package/src/Components/Loader.tsx +0 -328
- package/src/Components/Logo.tsx +0 -176
- package/src/Components/MDUtils.tsx +0 -104
- package/src/Components/ObjectBrowser.tsx +0 -8935
- package/src/Components/Router.tsx +0 -90
- package/src/Components/SaveCloseButtons.tsx +0 -117
- package/src/Components/Schedule.tsx +0 -1995
- package/src/Components/SelectWithIcon.tsx +0 -239
- package/src/Components/TabContainer.tsx +0 -57
- package/src/Components/TabContent.tsx +0 -38
- package/src/Components/TabHeader.tsx +0 -20
- package/src/Components/ToggleThemeMenu.tsx +0 -52
- package/src/Components/TreeTable.tsx +0 -1002
- package/src/Components/UploadImage.tsx +0 -643
- package/src/Components/Utils.tsx +0 -1802
- package/src/Components/loader.css +0 -231
- package/src/Components/withWidth.tsx +0 -32
- package/src/Connection.tsx +0 -5
- package/src/Dialogs/ComplexCron.tsx +0 -163
- package/src/Dialogs/Confirm.tsx +0 -185
- package/src/Dialogs/Cron.tsx +0 -192
- package/src/Dialogs/Error.tsx +0 -67
- package/src/Dialogs/Message.tsx +0 -73
- package/src/Dialogs/SelectFile.tsx +0 -280
- package/src/Dialogs/SelectID.tsx +0 -310
- package/src/Dialogs/SimpleCron.tsx +0 -101
- package/src/Dialogs/TextInput.tsx +0 -99
- package/src/GenericApp.tsx +0 -1076
- package/src/LegacyConnection.tsx +0 -3720
- package/src/Prompt.tsx +0 -22
- package/src/Theme.tsx +0 -472
- package/src/icons/IconAdapter.tsx +0 -22
- package/src/icons/IconAlias.tsx +0 -22
- package/src/icons/IconChannel.tsx +0 -60
- package/src/icons/IconClearFilter.tsx +0 -24
- package/src/icons/IconClosed.tsx +0 -22
- package/src/icons/IconCopy.tsx +0 -21
- package/src/icons/IconDevice.tsx +0 -126
- package/src/icons/IconDocument.tsx +0 -22
- package/src/icons/IconDocumentReadOnly.tsx +0 -27
- package/src/icons/IconExpert.tsx +0 -26
- package/src/icons/IconFx.tsx +0 -38
- package/src/icons/IconInstance.tsx +0 -22
- package/src/icons/IconLogout.tsx +0 -32
- package/src/icons/IconNoIcon.tsx +0 -21
- package/src/icons/IconOpen.tsx +0 -22
- package/src/icons/IconProps.tsx +0 -16
- package/src/icons/IconState.tsx +0 -38
- package/src/index.css +0 -56
- /package/{Components → build/Components}/404.d.ts +0 -0
- /package/{Components → build/Components}/SimpleCron/cronText.d.ts +0 -0
- /package/{assets → build/assets}/devices.json +0 -0
- /package/{assets → build/assets}/lamp_ceiling.svg +0 -0
- /package/{assets → build/assets}/lamp_table.svg +0 -0
- /package/{assets → build/assets}/no_icon.svg +0 -0
- /package/{assets → build/assets}/rooms.json +0 -0
- /package/{index.css → build/index.css} +0 -0
- /package/{tasks.js → tasksExample.js} +0 -0
|
@@ -1,62 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
1
|
/**
|
|
30
2
|
* Copyright 2018-2024 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
31
3
|
*
|
|
32
4
|
* MIT License
|
|
33
5
|
*
|
|
34
6
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const de_json_1 = __importDefault(require("./i18n/de.json"));
|
|
51
|
-
const ru_json_1 = __importDefault(require("./i18n/ru.json"));
|
|
52
|
-
const pt_json_1 = __importDefault(require("./i18n/pt.json"));
|
|
53
|
-
const nl_json_1 = __importDefault(require("./i18n/nl.json"));
|
|
54
|
-
const fr_json_1 = __importDefault(require("./i18n/fr.json"));
|
|
55
|
-
const it_json_1 = __importDefault(require("./i18n/it.json"));
|
|
56
|
-
const es_json_1 = __importDefault(require("./i18n/es.json"));
|
|
57
|
-
const pl_json_1 = __importDefault(require("./i18n/pl.json"));
|
|
58
|
-
const uk_json_1 = __importDefault(require("./i18n/uk.json"));
|
|
59
|
-
const zh_cn_json_1 = __importDefault(require("./i18n/zh-cn.json"));
|
|
7
|
+
import React, {} from 'react';
|
|
8
|
+
import { PROGRESS, Connection } from '@iobroker/socket-client';
|
|
9
|
+
import * as Sentry from '@sentry/browser';
|
|
10
|
+
import { Snackbar, IconButton } from '@mui/material';
|
|
11
|
+
import { Close as IconClose } from '@mui/icons-material';
|
|
12
|
+
import { printPrompt } from './Prompt';
|
|
13
|
+
import { Theme } from './Theme';
|
|
14
|
+
import { Loader } from './Components/Loader';
|
|
15
|
+
import { Router } from './Components/Router';
|
|
16
|
+
import { Utils } from './Components/Utils';
|
|
17
|
+
import { SaveCloseButtons } from './Components/SaveCloseButtons';
|
|
18
|
+
import { DialogConfirm } from './Dialogs/Confirm';
|
|
19
|
+
import { I18n } from './i18n';
|
|
20
|
+
import { DialogError } from './Dialogs/Error';
|
|
21
|
+
import { dictionary } from './dictionary';
|
|
60
22
|
// import './index.css';
|
|
61
23
|
const cssStyle = `
|
|
62
24
|
html {
|
|
@@ -108,12 +70,27 @@ body {
|
|
|
108
70
|
}
|
|
109
71
|
}
|
|
110
72
|
`;
|
|
111
|
-
class GenericApp extends
|
|
73
|
+
export class GenericApp extends Router {
|
|
74
|
+
socket;
|
|
75
|
+
instance;
|
|
76
|
+
adapterName;
|
|
77
|
+
instanceId;
|
|
78
|
+
newReact;
|
|
79
|
+
encryptedFields;
|
|
80
|
+
sentryDSN;
|
|
81
|
+
alertDialogRendered;
|
|
82
|
+
_secret;
|
|
83
|
+
_systemConfig;
|
|
84
|
+
// it is not readonly
|
|
85
|
+
savedNative;
|
|
86
|
+
common = null;
|
|
87
|
+
sentryStarted = false;
|
|
88
|
+
sentryInited = false;
|
|
89
|
+
resizeTimer = null;
|
|
112
90
|
constructor(props, settings) {
|
|
113
|
-
var _a, _b;
|
|
114
91
|
const ConnectionClass = (props.Connection ||
|
|
115
|
-
|
|
116
|
-
|
|
92
|
+
settings?.Connection ||
|
|
93
|
+
Connection);
|
|
117
94
|
// const ConnectionClass = props.Connection === 'admin' || settings.Connection = 'admin' ? AdminConnection : (props.Connection || settings.Connection || Connection);
|
|
118
95
|
if (!window.document.getElementById('generic-app-iobroker-component')) {
|
|
119
96
|
const style = window.document.createElement('style');
|
|
@@ -128,65 +105,12 @@ class GenericApp extends Router_1.default {
|
|
|
128
105
|
delete window.io;
|
|
129
106
|
window.io = io;
|
|
130
107
|
}
|
|
131
|
-
catch
|
|
108
|
+
catch {
|
|
132
109
|
// ignore
|
|
133
110
|
}
|
|
134
111
|
}
|
|
135
112
|
super(props);
|
|
136
|
-
|
|
137
|
-
this.sentryStarted = false;
|
|
138
|
-
this.sentryInited = false;
|
|
139
|
-
this.resizeTimer = null;
|
|
140
|
-
this.onSystemConfigChanged = (id, obj) => {
|
|
141
|
-
var _a, _b;
|
|
142
|
-
if (obj && id === 'system.config') {
|
|
143
|
-
if (this.socket.systemLang !== (obj === null || obj === void 0 ? void 0 : obj.common.language)) {
|
|
144
|
-
this.socket.systemLang = (obj === null || obj === void 0 ? void 0 : obj.common.language) || 'en';
|
|
145
|
-
i18n_1.default.setLanguage(this.socket.systemLang);
|
|
146
|
-
}
|
|
147
|
-
if (((_a = this._systemConfig) === null || _a === void 0 ? void 0 : _a.expertMode) !== !!((_b = obj === null || obj === void 0 ? void 0 : obj.common) === null || _b === void 0 ? void 0 : _b.expertMode)) {
|
|
148
|
-
this._systemConfig =
|
|
149
|
-
(obj === null || obj === void 0 ? void 0 : obj.common) || {};
|
|
150
|
-
this.setState({ expertMode: this.getExpertMode() });
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
this._systemConfig =
|
|
154
|
-
(obj === null || obj === void 0 ? void 0 : obj.common) || {};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
this.onReceiveMessage = (message) => {
|
|
159
|
-
if (message === null || message === void 0 ? void 0 : message.data) {
|
|
160
|
-
if (message.data === 'updateTheme') {
|
|
161
|
-
const newThemeName = Utils_1.default.getThemeName();
|
|
162
|
-
Utils_1.default.setThemeName(Utils_1.default.getThemeName());
|
|
163
|
-
const newTheme = this.createTheme(newThemeName);
|
|
164
|
-
this.setState({
|
|
165
|
-
theme: newTheme,
|
|
166
|
-
themeName: this.getThemeName(newTheme),
|
|
167
|
-
themeType: this.getThemeType(newTheme),
|
|
168
|
-
}, () => {
|
|
169
|
-
this.props.onThemeChange && this.props.onThemeChange(newThemeName);
|
|
170
|
-
this.onThemeChanged && this.onThemeChanged(newThemeName);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
else if (message.data === 'updateExpertMode') {
|
|
174
|
-
this.onToggleExpertMode && this.onToggleExpertMode(this.getExpertMode());
|
|
175
|
-
}
|
|
176
|
-
else if (message.data !== 'chartReady') {
|
|
177
|
-
// if not "echart ready" message
|
|
178
|
-
console.debug(`Received unknown message: "${JSON.stringify(message.data)}". May be it will be processed later`);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
this.onResize = () => {
|
|
183
|
-
this.resizeTimer && clearTimeout(this.resizeTimer);
|
|
184
|
-
this.resizeTimer = setTimeout(() => {
|
|
185
|
-
this.resizeTimer = null;
|
|
186
|
-
this.setState({ width: GenericApp.getWidth() });
|
|
187
|
-
}, 200);
|
|
188
|
-
};
|
|
189
|
-
(0, Prompt_1.default)();
|
|
113
|
+
printPrompt();
|
|
190
114
|
const query = (window.location.search || '').replace(/^\?/, '').replace(/#.*$/, '');
|
|
191
115
|
const args = {};
|
|
192
116
|
query
|
|
@@ -205,38 +129,49 @@ class GenericApp extends Router_1.default {
|
|
|
205
129
|
});
|
|
206
130
|
// extract instance from URL
|
|
207
131
|
this.instance =
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
132
|
+
settings?.instance ??
|
|
133
|
+
props.instance ??
|
|
134
|
+
(args.instance !== undefined
|
|
135
|
+
? parseInt(args.instance, 10) || 0
|
|
136
|
+
: parseInt(window.location.search.slice(1), 10) || 0);
|
|
211
137
|
// extract adapter name from URL
|
|
212
138
|
const tmp = window.location.pathname.split('/');
|
|
213
139
|
this.adapterName =
|
|
214
|
-
|
|
140
|
+
settings?.adapterName || props.adapterName || window.adapterName || tmp[tmp.length - 2] || 'iot';
|
|
215
141
|
this.instanceId = `system.adapter.${this.adapterName}.${this.instance}`;
|
|
216
142
|
this.newReact = args.newReact === true; // it is admin5
|
|
217
|
-
const location =
|
|
143
|
+
const location = Router.getLocation();
|
|
218
144
|
location.tab =
|
|
219
145
|
location.tab ||
|
|
220
146
|
(window._localStorage || window.localStorage).getItem(`${this.adapterName}-adapter`) ||
|
|
221
147
|
'';
|
|
222
148
|
const themeInstance = this.createTheme();
|
|
223
|
-
this.state = Object.assign(
|
|
149
|
+
this.state = Object.assign(this.state || {}, // keep the existing state
|
|
150
|
+
{
|
|
151
|
+
selectedTab: (window._localStorage || window.localStorage).getItem(`${this.adapterName}-adapter`) || '',
|
|
152
|
+
selectedTabNum: -1,
|
|
153
|
+
native: {},
|
|
154
|
+
errorText: '',
|
|
155
|
+
changed: false,
|
|
156
|
+
connected: false,
|
|
157
|
+
loaded: false,
|
|
158
|
+
isConfigurationError: '',
|
|
159
|
+
expertMode: false,
|
|
160
|
+
toast: '',
|
|
161
|
+
theme: themeInstance,
|
|
162
|
+
themeName: this.getThemeName(themeInstance),
|
|
163
|
+
themeType: this.getThemeType(themeInstance),
|
|
164
|
+
bottomButtons: (settings && settings.bottomButtons) === false ? false : props?.bottomButtons !== false,
|
|
165
|
+
width: GenericApp.getWidth(),
|
|
166
|
+
confirmClose: false,
|
|
167
|
+
_alert: false,
|
|
168
|
+
_alertType: 'info',
|
|
169
|
+
_alertMessage: '',
|
|
170
|
+
});
|
|
224
171
|
// init translations
|
|
225
|
-
const translations =
|
|
226
|
-
en: en_json_1.default,
|
|
227
|
-
de: de_json_1.default,
|
|
228
|
-
ru: ru_json_1.default,
|
|
229
|
-
pt: pt_json_1.default,
|
|
230
|
-
nl: nl_json_1.default,
|
|
231
|
-
fr: fr_json_1.default,
|
|
232
|
-
it: it_json_1.default,
|
|
233
|
-
es: es_json_1.default,
|
|
234
|
-
pl: pl_json_1.default,
|
|
235
|
-
uk: uk_json_1.default,
|
|
236
|
-
'zh-cn': zh_cn_json_1.default,
|
|
237
|
-
};
|
|
172
|
+
const translations = dictionary;
|
|
238
173
|
// merge together
|
|
239
|
-
if (settings
|
|
174
|
+
if (settings?.translations) {
|
|
240
175
|
Object.keys(settings.translations).forEach(lang => {
|
|
241
176
|
if (settings.translations) {
|
|
242
177
|
translations[lang] = Object.assign(translations[lang], settings.translations[lang] || {});
|
|
@@ -250,9 +185,9 @@ class GenericApp extends Router_1.default {
|
|
|
250
185
|
}
|
|
251
186
|
});
|
|
252
187
|
}
|
|
253
|
-
|
|
188
|
+
I18n.setTranslations(translations);
|
|
254
189
|
this.savedNative = {}; // to detect if the config changed
|
|
255
|
-
this.encryptedFields = props.encryptedFields ||
|
|
190
|
+
this.encryptedFields = props.encryptedFields || settings?.encryptedFields || [];
|
|
256
191
|
this.sentryDSN = (settings && settings.sentryDSN) || props.sentryDSN;
|
|
257
192
|
if (window.socketUrl) {
|
|
258
193
|
if (window.socketUrl.startsWith(':')) {
|
|
@@ -279,18 +214,23 @@ class GenericApp extends Router_1.default {
|
|
|
279
214
|
}
|
|
280
215
|
};
|
|
281
216
|
// @ts-expect-error either make props in ConnectionProps required or the constructor needs to accept than as they are (means adapt socket-client)
|
|
282
|
-
this.socket = new ConnectionClass(
|
|
283
|
-
|
|
217
|
+
this.socket = new ConnectionClass({
|
|
218
|
+
...(props?.socket || settings?.socket),
|
|
219
|
+
name: this.adapterName,
|
|
220
|
+
doNotLoadAllObjects: settings?.doNotLoadAllObjects,
|
|
221
|
+
onProgress: (progress) => {
|
|
222
|
+
if (progress === PROGRESS.CONNECTING) {
|
|
284
223
|
this.setState({ connected: false });
|
|
285
224
|
}
|
|
286
|
-
else if (progress ===
|
|
225
|
+
else if (progress === PROGRESS.READY) {
|
|
287
226
|
this.setState({ connected: true });
|
|
288
227
|
}
|
|
289
228
|
else {
|
|
290
229
|
this.setState({ connected: true });
|
|
291
230
|
}
|
|
292
|
-
},
|
|
293
|
-
|
|
231
|
+
},
|
|
232
|
+
onReady: ( /* objects, scripts */) => {
|
|
233
|
+
I18n.setLanguage(this.socket.systemLang);
|
|
294
234
|
// subscribe because of language and expert mode
|
|
295
235
|
this.socket
|
|
296
236
|
.subscribeObject('system.config', this.onSystemConfigChanged)
|
|
@@ -298,17 +238,16 @@ class GenericApp extends Router_1.default {
|
|
|
298
238
|
.then(obj => {
|
|
299
239
|
this._secret =
|
|
300
240
|
(typeof obj !== 'undefined' && obj.native && obj.native.secret) || 'Zgfr56gFe87jJOM';
|
|
301
|
-
this._systemConfig =
|
|
241
|
+
this._systemConfig = obj?.common || {};
|
|
302
242
|
return this.socket.getObject(this.instanceId);
|
|
303
243
|
})
|
|
304
244
|
.then(async (obj) => {
|
|
305
|
-
var _a, _b;
|
|
306
245
|
let waitPromise;
|
|
307
246
|
const instanceObj = obj;
|
|
308
|
-
const sentryPluginEnabled = (
|
|
247
|
+
const sentryPluginEnabled = (await this.socket.getState(`${this.instanceId}.plugins.sentry.enabled`))?.val;
|
|
309
248
|
const sentryEnabled = sentryPluginEnabled !== false &&
|
|
310
|
-
|
|
311
|
-
|
|
249
|
+
this._systemConfig?.diag !== 'none' &&
|
|
250
|
+
instanceObj?.common &&
|
|
312
251
|
instanceObj.common.name &&
|
|
313
252
|
instanceObj.common.version &&
|
|
314
253
|
// @ts-expect-error will be extended in js-controller TODO: (BF: 2024.05.30) this is redundant to state `${this.instanceId}.plugins.sentry.enabled`, remove this in future when admin sets the state correctly
|
|
@@ -335,10 +274,10 @@ class GenericApp extends Router_1.default {
|
|
|
335
274
|
}
|
|
336
275
|
});
|
|
337
276
|
}
|
|
338
|
-
waitPromise = waitPromise
|
|
277
|
+
waitPromise = (waitPromise instanceof Promise) ? waitPromise : Promise.resolve();
|
|
339
278
|
void waitPromise.then(() => {
|
|
340
279
|
if (instanceObj) {
|
|
341
|
-
this.common = instanceObj
|
|
280
|
+
this.common = instanceObj?.common;
|
|
342
281
|
this.onPrepareLoad(instanceObj.native, instanceObj.encryptedNative); // decode all secrets
|
|
343
282
|
this.savedNative = JSON.parse(JSON.stringify(instanceObj.native));
|
|
344
283
|
this.setState({ native: instanceObj.native, loaded: true, expertMode: this.getExpertMode() }, () => this.onConnectionReady && this.onConnectionReady());
|
|
@@ -354,10 +293,12 @@ class GenericApp extends Router_1.default {
|
|
|
354
293
|
});
|
|
355
294
|
})
|
|
356
295
|
.catch(e => window.alert(`Cannot settings: ${e}`));
|
|
357
|
-
},
|
|
296
|
+
},
|
|
297
|
+
onError: (err) => {
|
|
358
298
|
console.error(err);
|
|
359
299
|
this.showError(err);
|
|
360
|
-
}
|
|
300
|
+
},
|
|
301
|
+
});
|
|
361
302
|
}
|
|
362
303
|
/**
|
|
363
304
|
* Checks if this connection is running in a web adapter and not in an admin.
|
|
@@ -379,12 +320,29 @@ class GenericApp extends Router_1.default {
|
|
|
379
320
|
}
|
|
380
321
|
renderAlertSnackbar() {
|
|
381
322
|
this.alertDialogRendered = true;
|
|
382
|
-
return (
|
|
323
|
+
return (React.createElement(Snackbar, { style: this.state._alertType === 'error'
|
|
383
324
|
? { backgroundColor: '#f44336' }
|
|
384
325
|
: this.state._alertType === 'success'
|
|
385
326
|
? { backgroundColor: '#4caf50' }
|
|
386
327
|
: undefined, open: this.state._alert, autoHideDuration: 6000, onClose: (_e, reason) => reason !== 'clickaway' && this.setState({ _alert: false }), message: this.state._alertMessage }));
|
|
387
328
|
}
|
|
329
|
+
onSystemConfigChanged = (id, obj) => {
|
|
330
|
+
if (obj && id === 'system.config') {
|
|
331
|
+
if (this.socket.systemLang !== obj?.common.language) {
|
|
332
|
+
this.socket.systemLang = obj?.common.language || 'en';
|
|
333
|
+
I18n.setLanguage(this.socket.systemLang);
|
|
334
|
+
}
|
|
335
|
+
if (this._systemConfig?.expertMode !== !!obj?.common?.expertMode) {
|
|
336
|
+
this._systemConfig =
|
|
337
|
+
obj?.common || {};
|
|
338
|
+
this.setState({ expertMode: this.getExpertMode() });
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
this._systemConfig =
|
|
342
|
+
obj?.common || {};
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
};
|
|
388
346
|
/**
|
|
389
347
|
* Called immediately after a component is mounted. Setting state here will trigger re-rendering.
|
|
390
348
|
*/
|
|
@@ -401,6 +359,37 @@ class GenericApp extends Router_1.default {
|
|
|
401
359
|
window.removeEventListener('message', this.onReceiveMessage, false);
|
|
402
360
|
super.componentWillUnmount();
|
|
403
361
|
}
|
|
362
|
+
onReceiveMessage = (message) => {
|
|
363
|
+
if (message?.data) {
|
|
364
|
+
if (message.data === 'updateTheme') {
|
|
365
|
+
const newThemeName = Utils.getThemeName();
|
|
366
|
+
Utils.setThemeName(Utils.getThemeName());
|
|
367
|
+
const newTheme = this.createTheme(newThemeName);
|
|
368
|
+
this.setState({
|
|
369
|
+
theme: newTheme,
|
|
370
|
+
themeName: this.getThemeName(newTheme),
|
|
371
|
+
themeType: this.getThemeType(newTheme),
|
|
372
|
+
}, () => {
|
|
373
|
+
this.props.onThemeChange && this.props.onThemeChange(newThemeName);
|
|
374
|
+
this.onThemeChanged && this.onThemeChanged(newThemeName);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
else if (message.data === 'updateExpertMode') {
|
|
378
|
+
this.onToggleExpertMode && this.onToggleExpertMode(this.getExpertMode());
|
|
379
|
+
}
|
|
380
|
+
else if (message.data !== 'chartReady') {
|
|
381
|
+
// if not "echart ready" message
|
|
382
|
+
console.debug(`Received unknown message: "${JSON.stringify(message.data)}". May be it will be processed later`);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
onResize = () => {
|
|
387
|
+
this.resizeTimer && clearTimeout(this.resizeTimer);
|
|
388
|
+
this.resizeTimer = setTimeout(() => {
|
|
389
|
+
this.resizeTimer = null;
|
|
390
|
+
this.setState({ width: GenericApp.getWidth() });
|
|
391
|
+
}, 200);
|
|
392
|
+
};
|
|
404
393
|
/**
|
|
405
394
|
* Gets the width depending on the window inner width.
|
|
406
395
|
*/
|
|
@@ -429,7 +418,7 @@ class GenericApp extends Router_1.default {
|
|
|
429
418
|
*/
|
|
430
419
|
// eslint-disable-next-line class-methods-use-this
|
|
431
420
|
createTheme(name) {
|
|
432
|
-
return (
|
|
421
|
+
return Theme(Utils.getThemeName(name));
|
|
433
422
|
}
|
|
434
423
|
/**
|
|
435
424
|
* Get the theme name
|
|
@@ -465,7 +454,7 @@ class GenericApp extends Router_1.default {
|
|
|
465
454
|
? 'light'
|
|
466
455
|
: 'dark');
|
|
467
456
|
if (newThemeName !== themeName) {
|
|
468
|
-
|
|
457
|
+
Utils.setThemeName(newThemeName);
|
|
469
458
|
const newTheme = this.createTheme(newThemeName);
|
|
470
459
|
this.setState({
|
|
471
460
|
theme: newTheme,
|
|
@@ -487,8 +476,7 @@ class GenericApp extends Router_1.default {
|
|
|
487
476
|
* Get current expert mode
|
|
488
477
|
*/
|
|
489
478
|
getExpertMode() {
|
|
490
|
-
|
|
491
|
-
return window.sessionStorage.getItem('App.expertMode') === 'true' || !!((_a = this._systemConfig) === null || _a === void 0 ? void 0 : _a.expertMode);
|
|
479
|
+
return window.sessionStorage.getItem('App.expertMode') === 'true' || !!this._systemConfig?.expertMode;
|
|
492
480
|
}
|
|
493
481
|
/**
|
|
494
482
|
* Gets called when the socket.io connection is ready.
|
|
@@ -525,7 +513,7 @@ class GenericApp extends Router_1.default {
|
|
|
525
513
|
* You may override this if needed.
|
|
526
514
|
*/
|
|
527
515
|
onHashChanged() {
|
|
528
|
-
const location =
|
|
516
|
+
const location = Router.getLocation();
|
|
529
517
|
if (location.tab !== this.state.selectedTab) {
|
|
530
518
|
this.selectTab(location.tab);
|
|
531
519
|
}
|
|
@@ -581,9 +569,9 @@ class GenericApp extends Router_1.default {
|
|
|
581
569
|
async getExtendableInstances() {
|
|
582
570
|
try {
|
|
583
571
|
const instances = await this.socket.getObjectViewSystem('instance', 'system.adapter.', 'system.adapter.\u9999');
|
|
584
|
-
return Object.values(instances).filter(instance =>
|
|
572
|
+
return Object.values(instances).filter(instance => !!instance?.common?.webExtendable);
|
|
585
573
|
}
|
|
586
|
-
catch
|
|
574
|
+
catch {
|
|
587
575
|
return [];
|
|
588
576
|
}
|
|
589
577
|
}
|
|
@@ -591,16 +579,15 @@ class GenericApp extends Router_1.default {
|
|
|
591
579
|
* Gets the IP addresses of the given host.
|
|
592
580
|
*/
|
|
593
581
|
async getIpAddresses(host) {
|
|
594
|
-
|
|
595
|
-
const ips = await this.socket.getHostByIp(host || ((_a = this.common) === null || _a === void 0 ? void 0 : _a.host) || '');
|
|
582
|
+
const ips = await this.socket.getHostByIp(host || this.common?.host || '');
|
|
596
583
|
// translate names
|
|
597
584
|
const ip4 = ips.find(ip => ip.address === '0.0.0.0');
|
|
598
585
|
if (ip4) {
|
|
599
|
-
ip4.name = `[IPv4] 0.0.0.0 - ${
|
|
586
|
+
ip4.name = `[IPv4] 0.0.0.0 - ${I18n.t('ra_Listen on all IPs')}`;
|
|
600
587
|
}
|
|
601
588
|
const ip6 = ips.find(ip => ip.address === '::');
|
|
602
589
|
if (ip6) {
|
|
603
|
-
ip6.name = `[IPv4] :: - ${
|
|
590
|
+
ip6.name = `[IPv4] :: - ${I18n.t('ra_Listen on all IPs')}`;
|
|
604
591
|
}
|
|
605
592
|
return ips;
|
|
606
593
|
}
|
|
@@ -656,7 +643,7 @@ class GenericApp extends Router_1.default {
|
|
|
656
643
|
try {
|
|
657
644
|
window.parent.postMessage('nochange', '*');
|
|
658
645
|
}
|
|
659
|
-
catch
|
|
646
|
+
catch {
|
|
660
647
|
// ignore
|
|
661
648
|
}
|
|
662
649
|
this.setState({ changed: false });
|
|
@@ -668,16 +655,15 @@ class GenericApp extends Router_1.default {
|
|
|
668
655
|
* Renders the toast.
|
|
669
656
|
*/
|
|
670
657
|
renderToast() {
|
|
671
|
-
var _a;
|
|
672
658
|
if (!this.state.toast) {
|
|
673
659
|
return null;
|
|
674
660
|
}
|
|
675
|
-
return (
|
|
661
|
+
return (React.createElement(Snackbar, { anchorOrigin: {
|
|
676
662
|
vertical: 'bottom',
|
|
677
663
|
horizontal: 'left',
|
|
678
|
-
}, open: !0, autoHideDuration: 6000, onClose: () => this.setState({ toast: '' }), ContentProps: { 'aria-describedby': 'message-id' }, message:
|
|
679
|
-
|
|
680
|
-
|
|
664
|
+
}, open: !0, autoHideDuration: 6000, onClose: () => this.setState({ toast: '' }), ContentProps: { 'aria-describedby': 'message-id' }, message: React.createElement("span", { id: "message-id" }, this.state.toast), action: [
|
|
665
|
+
React.createElement(IconButton, { key: "close", "aria-label": "Close", color: "inherit", className: this.props.classes?.close, onClick: () => this.setState({ toast: '' }), size: "large" },
|
|
666
|
+
React.createElement(IconClose, null)),
|
|
681
667
|
] }));
|
|
682
668
|
}
|
|
683
669
|
/**
|
|
@@ -693,7 +679,7 @@ class GenericApp extends Router_1.default {
|
|
|
693
679
|
window.parent.postMessage('close', '*');
|
|
694
680
|
}
|
|
695
681
|
}
|
|
696
|
-
catch
|
|
682
|
+
catch {
|
|
697
683
|
window.parent.postMessage('close', '*');
|
|
698
684
|
}
|
|
699
685
|
}
|
|
@@ -705,7 +691,7 @@ class GenericApp extends Router_1.default {
|
|
|
705
691
|
if (!this.state.errorText) {
|
|
706
692
|
return null;
|
|
707
693
|
}
|
|
708
|
-
return (
|
|
694
|
+
return (React.createElement(DialogError, { text: this.state.errorText, onClose: () => this.setState({ errorText: '' }) }));
|
|
709
695
|
}
|
|
710
696
|
/**
|
|
711
697
|
* Checks if the configuration has changed.
|
|
@@ -743,8 +729,8 @@ class GenericApp extends Router_1.default {
|
|
|
743
729
|
if (!this.state.confirmClose && !this.state.bottomButtons) {
|
|
744
730
|
return null;
|
|
745
731
|
}
|
|
746
|
-
return (
|
|
747
|
-
this.state.bottomButtons ? (
|
|
732
|
+
return (React.createElement(React.Fragment, null,
|
|
733
|
+
this.state.bottomButtons ? (React.createElement(SaveCloseButtons, { theme: this.state.theme, newReact: this.newReact, noTextOnButtons: this.state.width === 'xs' || this.state.width === 'sm' || this.state.width === 'md', changed: this.state.changed, onSave: isClose => this.onSave(isClose), onClose: () => {
|
|
748
734
|
if (this.state.changed) {
|
|
749
735
|
this.setState({ confirmClose: true });
|
|
750
736
|
}
|
|
@@ -752,7 +738,7 @@ class GenericApp extends Router_1.default {
|
|
|
752
738
|
GenericApp.onClose();
|
|
753
739
|
}
|
|
754
740
|
} })) : null,
|
|
755
|
-
this.state.confirmClose ? (
|
|
741
|
+
this.state.confirmClose ? (React.createElement(DialogConfirm, { title: I18n.t('ra_Please confirm'), text: I18n.t('ra_Some data are not stored. Discard?'), ok: I18n.t('ra_Discard'), cancel: I18n.t('ra_Cancel'), onClose: isYes => this.setState({ confirmClose: false }, () => isYes && GenericApp.onClose()) })) : null));
|
|
756
742
|
}
|
|
757
743
|
_updateNativeValue(obj, attrs, value) {
|
|
758
744
|
if (typeof attrs !== 'object') {
|
|
@@ -794,7 +780,7 @@ class GenericApp extends Router_1.default {
|
|
|
794
780
|
try {
|
|
795
781
|
window.parent.postMessage(changed ? 'change' : 'nochange', '*');
|
|
796
782
|
}
|
|
797
|
-
catch
|
|
783
|
+
catch {
|
|
798
784
|
// ignore
|
|
799
785
|
}
|
|
800
786
|
}
|
|
@@ -819,7 +805,7 @@ class GenericApp extends Router_1.default {
|
|
|
819
805
|
* Renders helper dialogs
|
|
820
806
|
*/
|
|
821
807
|
renderHelperDialogs() {
|
|
822
|
-
return (
|
|
808
|
+
return (React.createElement(React.Fragment, null,
|
|
823
809
|
this.renderError(),
|
|
824
810
|
this.renderToast(),
|
|
825
811
|
this.renderSaveCloseButtons(),
|
|
@@ -830,13 +816,13 @@ class GenericApp extends Router_1.default {
|
|
|
830
816
|
*/
|
|
831
817
|
render() {
|
|
832
818
|
if (!this.state.loaded) {
|
|
833
|
-
return
|
|
819
|
+
return React.createElement(Loader, { themeType: this.state.themeType });
|
|
834
820
|
}
|
|
835
|
-
return (
|
|
821
|
+
return (React.createElement("div", { className: "App" },
|
|
836
822
|
this.renderError(),
|
|
837
823
|
this.renderToast(),
|
|
838
824
|
this.renderSaveCloseButtons(),
|
|
839
825
|
this.renderAlertSnackbar()));
|
|
840
826
|
}
|
|
841
827
|
}
|
|
842
|
-
|
|
828
|
+
//# sourceMappingURL=GenericApp.js.map
|