@iobroker/adapter-react-v5 7.2.4 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -15
- 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 +5 -3
- package/{Components → build/Components}/FileBrowser.js +230 -236
- package/build/Components/FileBrowser.js.map +1 -0
- package/build/Components/FileViewer.d.ts +49 -0
- package/build/Components/FileViewer.js +247 -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 +4 -4
- package/{Components → build/Components}/ObjectBrowser.js +1159 -1122
- 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 +2 -2
- package/{Components → build/Components}/Schedule.js +242 -257
- 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 -58
- 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 +45 -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} +36 -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 +5 -0
- package/build/icons/IconAdapter.js.map +1 -0
- package/build/icons/IconAlias.d.ts +3 -0
- package/build/icons/IconAlias.js +5 -0
- package/build/icons/IconAlias.js.map +1 -0
- package/build/icons/IconChannel.d.ts +3 -0
- package/build/icons/IconChannel.js +8 -0
- package/build/icons/IconChannel.js.map +1 -0
- package/build/icons/IconClearFilter.d.ts +3 -0
- package/build/icons/IconClearFilter.js +6 -0
- package/build/icons/IconClearFilter.js.map +1 -0
- package/build/icons/IconClosed.d.ts +3 -0
- package/build/icons/IconClosed.js +5 -0
- package/build/icons/IconClosed.js.map +1 -0
- package/build/icons/IconCopy.d.ts +3 -0
- package/build/icons/IconCopy.js +4 -0
- package/build/icons/IconCopy.js.map +1 -0
- package/build/icons/IconDevice.d.ts +3 -0
- package/build/icons/IconDevice.js +14 -0
- package/build/icons/IconDevice.js.map +1 -0
- package/build/icons/IconDocument.d.ts +3 -0
- package/build/icons/IconDocument.js +5 -0
- package/build/icons/IconDocument.js.map +1 -0
- package/build/icons/IconDocumentReadOnly.d.ts +3 -0
- package/build/icons/IconDocumentReadOnly.js +6 -0
- package/build/icons/IconDocumentReadOnly.js.map +1 -0
- package/build/icons/IconExpert.d.ts +3 -0
- package/build/icons/IconExpert.js +5 -0
- package/build/icons/IconExpert.js.map +1 -0
- package/build/icons/IconFx.d.ts +3 -0
- package/build/icons/IconFx.js +4 -0
- package/build/icons/IconFx.js.map +1 -0
- package/build/icons/IconInstance.d.ts +3 -0
- package/build/icons/IconInstance.js +5 -0
- package/build/icons/IconInstance.js.map +1 -0
- package/build/icons/IconLogout.d.ts +3 -0
- package/build/icons/IconLogout.js +5 -0
- package/build/icons/IconLogout.js.map +1 -0
- package/build/icons/IconNoIcon.d.ts +3 -0
- package/build/icons/IconNoIcon.js +4 -0
- package/build/icons/IconNoIcon.js.map +1 -0
- package/build/icons/IconOpen.d.ts +3 -0
- package/build/icons/IconOpen.js +5 -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 +5 -0
- package/build/icons/IconState.js.map +1 -0
- package/build/index.d.ts +76 -0
- package/build/index.js +75 -0
- package/build/index.js.map +1 -0
- package/{types.d.ts → build/types.d.ts} +1 -1
- package/package.json +84 -48
- 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 -2560
- 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 -8947
- package/src/Components/Router.tsx +0 -90
- package/src/Components/SaveCloseButtons.tsx +0 -117
- package/src/Components/Schedule.tsx +0 -1998
- 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,226 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
/**
|
|
27
|
-
* Copyright 2022-2024, Denis Haev <dogafox@gmail.com>
|
|
28
|
-
*
|
|
29
|
-
* MIT License
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
const react_1 = __importStar(require("react"));
|
|
33
|
-
const material_1 = require("@mui/material");
|
|
34
|
-
class TableResize extends react_1.Component {
|
|
35
|
-
constructor(props) {
|
|
36
|
-
super(props);
|
|
37
|
-
this.widthFilled = false;
|
|
38
|
-
this.installTimeout = null;
|
|
39
|
-
this.resizerMin = 0;
|
|
40
|
-
this.resizerMinNext = 0;
|
|
41
|
-
this.resizerPosition = 0;
|
|
42
|
-
this.resizerOldWidth = 0;
|
|
43
|
-
this.resizerOldWidthNext = 0;
|
|
44
|
-
this.resizerReset = () => {
|
|
45
|
-
for (let c = 0; c < this.resizerCurrentWidths.length; c++) {
|
|
46
|
-
this.resizerCurrentWidths[c] = (this.props.initialWidths || [])[c] || 'auto';
|
|
47
|
-
}
|
|
48
|
-
(window._localStorage || window.localStorage).setItem(`App.${this.props.name || 'history'}.table`, JSON.stringify(this.resizerCurrentWidths));
|
|
49
|
-
this.resizerApplyWidths();
|
|
50
|
-
};
|
|
51
|
-
this.resizerMouseMove = (e) => {
|
|
52
|
-
if (this.resizerActiveDiv && this.resizerActiveIndex !== null) {
|
|
53
|
-
const width = this.resizerOldWidth + e.clientX - this.resizerPosition;
|
|
54
|
-
const widthNext = this.resizerOldWidthNext - e.clientX + this.resizerPosition;
|
|
55
|
-
if ((!this.resizerMin || width > this.resizerMin) &&
|
|
56
|
-
(!this.resizerMinNext || widthNext > this.resizerMinNext)) {
|
|
57
|
-
this.resizerCurrentWidths[this.resizerActiveIndex] = width;
|
|
58
|
-
this.resizerCurrentWidths[this.resizerActiveIndex + 1] = widthNext;
|
|
59
|
-
this.resizerApplyWidths();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
this.resizerMouseUp = () => {
|
|
64
|
-
(window._localStorage || window.localStorage).setItem(`App.${this.props.name || 'history'}.table`, JSON.stringify(this.resizerCurrentWidths));
|
|
65
|
-
this.resizerActiveIndex = null;
|
|
66
|
-
this.resizerActiveDiv = null;
|
|
67
|
-
window.removeEventListener('mousemove', this.resizerMouseMove);
|
|
68
|
-
window.removeEventListener('mouseup', this.resizerMouseUp);
|
|
69
|
-
};
|
|
70
|
-
this.resizerMouseDown = (e) => {
|
|
71
|
-
var _a, _b, _c, _d;
|
|
72
|
-
if (this.resizerActiveIndex === null || this.resizerActiveIndex === undefined) {
|
|
73
|
-
console.log(`Mouse down ${(_a = e.target) === null || _a === void 0 ? void 0 : _a.dataset.index}`);
|
|
74
|
-
this.resizerActiveIndex = parseInt(((_b = e.target) === null || _b === void 0 ? void 0 : _b.dataset.index) || '0', 10);
|
|
75
|
-
this.resizerActiveDiv = e.target;
|
|
76
|
-
this.resizerMin = this.props.minWidths ? this.props.minWidths[this.resizerActiveIndex] : 0;
|
|
77
|
-
this.resizerMinNext = this.props.minWidths ? this.props.minWidths[this.resizerActiveIndex + 1] : 0;
|
|
78
|
-
this.resizerPosition = e.clientX;
|
|
79
|
-
let ths;
|
|
80
|
-
if (this.resizerCurrentWidths[this.resizerActiveIndex] === 'auto') {
|
|
81
|
-
ths = (_c = this.resizerRefTable.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('th');
|
|
82
|
-
if (ths) {
|
|
83
|
-
this.resizerCurrentWidths[this.resizerActiveIndex] = ths[this.resizerActiveIndex].offsetWidth;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (this.resizerCurrentWidths[this.resizerActiveIndex + 1] === 'auto') {
|
|
87
|
-
ths = ths || ((_d = this.resizerRefTable.current) === null || _d === void 0 ? void 0 : _d.querySelectorAll('th'));
|
|
88
|
-
if (ths) {
|
|
89
|
-
this.resizerCurrentWidths[this.resizerActiveIndex + 1] =
|
|
90
|
-
ths[this.resizerActiveIndex + 1].offsetWidth;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
this.resizerOldWidth = this.resizerCurrentWidths[this.resizerActiveIndex];
|
|
94
|
-
this.resizerOldWidthNext = this.resizerCurrentWidths[this.resizerActiveIndex + 1];
|
|
95
|
-
window.addEventListener('mousemove', this.resizerMouseMove);
|
|
96
|
-
window.addEventListener('mouseup', this.resizerMouseUp);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
this.resizerRefTable = react_1.default.createRef();
|
|
100
|
-
this.resizerActiveIndex = null;
|
|
101
|
-
this.resizerActiveDiv = null;
|
|
102
|
-
this.resizerCurrentWidths = [];
|
|
103
|
-
}
|
|
104
|
-
componentDidMount() {
|
|
105
|
-
this.resizerInstall();
|
|
106
|
-
}
|
|
107
|
-
componentWillUnmount() {
|
|
108
|
-
this.resizerUninstall();
|
|
109
|
-
}
|
|
110
|
-
resizerInstall() {
|
|
111
|
-
if (this.resizerRefTable.current && !this.resizerRefTable.current._installed) {
|
|
112
|
-
this.resizerRefTable.current._installed = true;
|
|
113
|
-
const ths = this.resizerRefTable.current.querySelectorAll('th');
|
|
114
|
-
const widthsStored = (window._localStorage || window.localStorage).getItem(`App.${this.props.name || 'history'}.table`);
|
|
115
|
-
this.widthFilled = false;
|
|
116
|
-
if (widthsStored) {
|
|
117
|
-
try {
|
|
118
|
-
this.resizerCurrentWidths = JSON.parse(widthsStored);
|
|
119
|
-
this.widthFilled = true;
|
|
120
|
-
}
|
|
121
|
-
catch (_a) {
|
|
122
|
-
// ignore
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (this.widthFilled) {
|
|
126
|
-
if (this.resizerCurrentWidths.length !== ths.length) {
|
|
127
|
-
this.resizerCurrentWidths = [];
|
|
128
|
-
this.widthFilled = false;
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
const tableWidth = this.resizerRefTable.current.offsetWidth;
|
|
132
|
-
let storedWidth = 0;
|
|
133
|
-
for (let w = 0; w < this.resizerCurrentWidths.length; w++) {
|
|
134
|
-
if (window.isFinite(this.resizerCurrentWidths[w])) {
|
|
135
|
-
storedWidth += this.resizerCurrentWidths[w];
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
storedWidth = null;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (storedWidth !== null && Math.abs(storedWidth - tableWidth) > 20) {
|
|
143
|
-
this.resizerCurrentWidths = [];
|
|
144
|
-
this.widthFilled = false;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
for (let i = 0; i < ths.length; i++) {
|
|
149
|
-
!this.widthFilled && this.resizerCurrentWidths.push(ths[i].offsetWidth);
|
|
150
|
-
// last column does need a handle
|
|
151
|
-
if (i < ths.length - 1) {
|
|
152
|
-
const div = window.document.createElement('div');
|
|
153
|
-
div.dataset.index = i.toString();
|
|
154
|
-
div.onmousedown = this.resizerMouseDown;
|
|
155
|
-
div.ondblclick = this.resizerReset;
|
|
156
|
-
div.title = this.props.dblTitle || 'Double click to reset table layout';
|
|
157
|
-
div.className = 'resize-handle';
|
|
158
|
-
ths[i].appendChild(div);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (this.widthFilled) {
|
|
162
|
-
this.resizerApplyWidths();
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
this.installTimeout = setTimeout(() => {
|
|
167
|
-
this.installTimeout = null;
|
|
168
|
-
this.resizerInstall();
|
|
169
|
-
}, 100);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
resizerUninstall() {
|
|
173
|
-
this.installTimeout && clearTimeout(this.installTimeout);
|
|
174
|
-
this.installTimeout = null;
|
|
175
|
-
// resizer
|
|
176
|
-
if (this.resizerRefTable.current && this.resizerRefTable.current._installed) {
|
|
177
|
-
this.resizerRefTable.current._installed = false;
|
|
178
|
-
const ths = this.resizerRefTable.current.querySelectorAll('th');
|
|
179
|
-
for (let i = 0; i < ths.length; i++) {
|
|
180
|
-
const div = ths[i].querySelector('.resize-handle');
|
|
181
|
-
if (div) {
|
|
182
|
-
div.onmousedown = null;
|
|
183
|
-
div.remove();
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
resizerApplyWidths() {
|
|
189
|
-
const gridTemplateColumns = [];
|
|
190
|
-
if (this.resizerCurrentWidths.length) {
|
|
191
|
-
for (let c = 0; c < this.resizerCurrentWidths.length; c++) {
|
|
192
|
-
if (this.resizerCurrentWidths[c]) {
|
|
193
|
-
gridTemplateColumns.push(this.resizerCurrentWidths[c] !== 'auto' ? `${this.resizerCurrentWidths[c]}px` : 'auto');
|
|
194
|
-
}
|
|
195
|
-
else if (this.props.initialWidths && this.props.initialWidths[c]) {
|
|
196
|
-
gridTemplateColumns.push(this.props.initialWidths[c] !== 'auto' ? `${this.props.initialWidths[c]}px` : 'auto');
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
gridTemplateColumns.push('auto');
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
else if (this.props.initialWidths) {
|
|
204
|
-
for (let c = 0; c < this.props.initialWidths.length; c++) {
|
|
205
|
-
if (this.props.initialWidths[c]) {
|
|
206
|
-
gridTemplateColumns.push(this.props.initialWidths[c] !== 'auto' ? `${this.props.initialWidths[c]}px` : 'auto');
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
gridTemplateColumns.push('auto');
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (this.resizerRefTable.current && gridTemplateColumns.length) {
|
|
214
|
-
this.resizerRefTable.current.style.gridTemplateColumns = gridTemplateColumns.join(' ');
|
|
215
|
-
}
|
|
216
|
-
return gridTemplateColumns.length ? gridTemplateColumns.join(' ') : undefined;
|
|
217
|
-
}
|
|
218
|
-
render() {
|
|
219
|
-
if (this.props.ready === false) {
|
|
220
|
-
return react_1.default.createElement(material_1.Skeleton, null);
|
|
221
|
-
}
|
|
222
|
-
const style = { gridTemplateColumns: this.resizerApplyWidths() };
|
|
223
|
-
return (react_1.default.createElement(material_1.Table, { stickyHeader: this.props.stickyHeader, size: this.props.size || 'small', className: this.props.className, sx: this.props.sx, ref: this.resizerRefTable, style: Object.assign(Object.assign({}, (this.props.style || undefined)), style) }, this.props.children));
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
exports.default = TableResize;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const Icon_1 = __importDefault(require("./Icon"));
|
|
8
|
-
const Utils_1 = __importDefault(require("./Utils"));
|
|
9
|
-
const styles = {
|
|
10
|
-
div: {
|
|
11
|
-
borderRadius: 3,
|
|
12
|
-
padding: '0 3px',
|
|
13
|
-
lineHeight: '20px',
|
|
14
|
-
whiteSpace: 'nowrap',
|
|
15
|
-
overflow: 'hidden',
|
|
16
|
-
display: 'flex',
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
},
|
|
19
|
-
icon: {
|
|
20
|
-
width: 16,
|
|
21
|
-
height: 16,
|
|
22
|
-
marginRight: 8,
|
|
23
|
-
verticalAlign: 'middle',
|
|
24
|
-
},
|
|
25
|
-
text: {
|
|
26
|
-
display: 'inline-block',
|
|
27
|
-
overflow: 'hidden',
|
|
28
|
-
textOverflow: 'ellipsis',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
const TextWithIcon = (props) => {
|
|
32
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
|
-
const value = props.value;
|
|
34
|
-
let item;
|
|
35
|
-
const prefix = props.removePrefix || '';
|
|
36
|
-
if (typeof value === 'string') {
|
|
37
|
-
const list = props.list || props.options;
|
|
38
|
-
if (list) {
|
|
39
|
-
// if a list is array, then it is list of ioBroker.Object
|
|
40
|
-
if (Array.isArray(list)) {
|
|
41
|
-
const _item = list.find((obj) => obj._id === prefix + value);
|
|
42
|
-
if (_item) {
|
|
43
|
-
item = {
|
|
44
|
-
name: Utils_1.default.getObjectNameFromObj(_item, props.lang).replace('system.group.', ''),
|
|
45
|
-
value: _item._id,
|
|
46
|
-
icon: props.icon || ((_a = _item.common) === null || _a === void 0 ? void 0 : _a.icon),
|
|
47
|
-
color: props.color || ((_b = _item.common) === null || _b === void 0 ? void 0 : _b.color),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
item = {
|
|
52
|
-
name: value,
|
|
53
|
-
value: prefix + value,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else if (list[prefix + value]) {
|
|
58
|
-
// List is object with key-value pairs: {'enum.rooms.1': {common: {name: 'Room 1'}}}
|
|
59
|
-
const obj = list[prefix + value];
|
|
60
|
-
item = {
|
|
61
|
-
name: Utils_1.default.getObjectNameFromObj(obj, props.lang).replace('system.group.', ''),
|
|
62
|
-
value: obj._id,
|
|
63
|
-
icon: props.icon || ((_c = obj.common) === null || _c === void 0 ? void 0 : _c.icon),
|
|
64
|
-
color: props.color || ((_d = obj.common) === null || _d === void 0 ? void 0 : _d.color),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
// value is a string, ignore list
|
|
69
|
-
item = {
|
|
70
|
-
name: value,
|
|
71
|
-
value: prefix + value,
|
|
72
|
-
icon: props.icon,
|
|
73
|
-
color: props.color,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
item = {
|
|
79
|
-
name: value,
|
|
80
|
-
value: prefix + value,
|
|
81
|
-
icon: props.icon,
|
|
82
|
-
color: props.color,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else if (!value || typeof value !== 'object') {
|
|
87
|
-
item = {
|
|
88
|
-
name: '',
|
|
89
|
-
value: '',
|
|
90
|
-
icon: props.icon,
|
|
91
|
-
color: props.color,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
// Item is an ioBroker.Object
|
|
96
|
-
const obj = value;
|
|
97
|
-
item = {
|
|
98
|
-
name: Utils_1.default.getObjectNameFromObj(obj, props.lang)
|
|
99
|
-
.replace('system.group.', '')
|
|
100
|
-
.replace('system.user.', '')
|
|
101
|
-
.replace('enum.rooms.', '')
|
|
102
|
-
.replace('enum.functions.', ''),
|
|
103
|
-
value: obj._id,
|
|
104
|
-
icon: props.icon || ((_e = obj.common) === null || _e === void 0 ? void 0 : _e.icon),
|
|
105
|
-
color: props.color || ((_f = obj.common) === null || _f === void 0 ? void 0 : _f.color),
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
const style = (item === null || item === void 0 ? void 0 : item.color)
|
|
109
|
-
? {
|
|
110
|
-
border: `1px solid ${Utils_1.default.invertColor(item === null || item === void 0 ? void 0 : item.color)}`,
|
|
111
|
-
color: Utils_1.default.getInvertedColor(item === null || item === void 0 ? void 0 : item.color, props.themeType || 'light', true) || undefined,
|
|
112
|
-
backgroundColor: item === null || item === void 0 ? void 0 : item.color,
|
|
113
|
-
}
|
|
114
|
-
: {};
|
|
115
|
-
return (react_1.default.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, (props.style || undefined)), styles.div), (style || undefined)), className: Utils_1.default.clsx(props.className, (_g = props.moreClasses) === null || _g === void 0 ? void 0 : _g.root), title: props.title || item.value },
|
|
116
|
-
(item === null || item === void 0 ? void 0 : item.icon) ? (react_1.default.createElement(Icon_1.default, { src: item === null || item === void 0 ? void 0 : item.icon, className: (_h = props.moreClasses) === null || _h === void 0 ? void 0 : _h.icon, style: styles.icon })) : null,
|
|
117
|
-
react_1.default.createElement("div", { style: styles.text, className: (_j = props.moreClasses) === null || _j === void 0 ? void 0 : _j.text }, item === null || item === void 0 ? void 0 : item.name)));
|
|
118
|
-
};
|
|
119
|
-
exports.default = TextWithIcon;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = ToggleThemeMenu;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
9
|
-
const icons_material_1 = require("@mui/icons-material");
|
|
10
|
-
function ToggleThemeMenu({ themeName, toggleTheme, t, className, style, size, }) {
|
|
11
|
-
return (react_1.default.createElement("div", { className: className || undefined, style: style || undefined },
|
|
12
|
-
react_1.default.createElement(material_1.Tooltip, { title: t('ra_Change color theme'), slotProps: { popper: { sx: { pointerEvents: 'none' } } } },
|
|
13
|
-
react_1.default.createElement(material_1.IconButton, { onClick: () => toggleTheme(), size: size || 'medium' },
|
|
14
|
-
themeName === 'dark' && react_1.default.createElement(icons_material_1.Brightness4, { className: className }),
|
|
15
|
-
themeName === 'blue' && react_1.default.createElement(icons_material_1.Brightness5, { className: className }),
|
|
16
|
-
themeName === 'colored' && react_1.default.createElement(icons_material_1.Brightness6, { className: className }),
|
|
17
|
-
themeName !== 'dark' && themeName !== 'blue' && themeName !== 'colored' && (react_1.default.createElement(icons_material_1.Brightness7, { className: className }))))));
|
|
18
|
-
}
|
package/Components/withWidth.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const styles_1 = require("@mui/material/styles");
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
9
|
-
function useWidth() {
|
|
10
|
-
const theme = (0, styles_1.useTheme)();
|
|
11
|
-
const keys = [...theme.breakpoints.keys].reverse();
|
|
12
|
-
return (keys.reduce((output, key) => {
|
|
13
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
14
|
-
const matches = (0, material_1.useMediaQuery)(theme.breakpoints.up(key));
|
|
15
|
-
return !output && matches ? key : output;
|
|
16
|
-
}, null) || 'xs');
|
|
17
|
-
}
|
|
18
|
-
// FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
|
|
19
|
-
function withWidth() {
|
|
20
|
-
return (WrappedComponent) => {
|
|
21
|
-
return function AnyComponent(props) {
|
|
22
|
-
const width = useWidth();
|
|
23
|
-
return (react_1.default.createElement(WrappedComponent, Object.assign({}, props, { width: width })));
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
exports.default = withWidth;
|
package/Connection.d.ts
DELETED
package/Connection.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PERMISSION_ERROR = exports.ERRORS = exports.PROGRESS = void 0;
|
|
4
|
-
const socket_client_1 = require("@iobroker/socket-client");
|
|
5
|
-
Object.defineProperty(exports, "PROGRESS", { enumerable: true, get: function () { return socket_client_1.PROGRESS; } });
|
|
6
|
-
Object.defineProperty(exports, "ERRORS", { enumerable: true, get: function () { return socket_client_1.ERRORS; } });
|
|
7
|
-
Object.defineProperty(exports, "PERMISSION_ERROR", { enumerable: true, get: function () { return socket_client_1.PERMISSION_ERROR; } });
|
|
8
|
-
exports.default = socket_client_1.Connection;
|
package/Dialogs/ComplexCron.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const material_1 = require("@mui/material");
|
|
8
|
-
const icons_material_1 = require("@mui/icons-material");
|
|
9
|
-
const ComplexCron_1 = __importDefault(require("../Components/ComplexCron"));
|
|
10
|
-
const Confirm_1 = __importDefault(require("../Dialogs/Confirm"));
|
|
11
|
-
const i18n_1 = __importDefault(require("../i18n"));
|
|
12
|
-
// Generate cron expression
|
|
13
|
-
const styles = {
|
|
14
|
-
headerID: {
|
|
15
|
-
fontWeight: 'bold',
|
|
16
|
-
fontStyle: 'italic',
|
|
17
|
-
},
|
|
18
|
-
radio: {
|
|
19
|
-
display: 'inline-block',
|
|
20
|
-
},
|
|
21
|
-
dialogPaper: {
|
|
22
|
-
height: 'calc(100% - 96px)',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
class DialogComplexCron extends react_1.default.Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
let cron;
|
|
29
|
-
if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^["']/, '')[0] !== '{') {
|
|
30
|
-
cron = this.props.cron.replace(/['"]/g, '').trim();
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
cron = this.props.cron || '{}';
|
|
34
|
-
if (typeof cron === 'string') {
|
|
35
|
-
cron = cron.replace(/^["']/, '').replace(/["']\n?$/, '');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
this.state = {
|
|
39
|
-
showWarning: '',
|
|
40
|
-
cron,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
handleCancel() {
|
|
44
|
-
this.props.onClose();
|
|
45
|
-
}
|
|
46
|
-
handleOk(ignoreCheck) {
|
|
47
|
-
if (!ignoreCheck) {
|
|
48
|
-
// Check if the CRON will be executed every second or every minute and warn about it
|
|
49
|
-
const cron = ComplexCron_1.default.cron2state(this.state.cron);
|
|
50
|
-
if (cron.seconds === '*' || cron.seconds === '*/1') {
|
|
51
|
-
this.setState({ showWarning: 'everySecond' });
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (cron.minutes === '*' || cron.minutes === '*/1') {
|
|
55
|
-
this.setState({ showWarning: 'everyMinute' });
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
this.props.onOk(this.state.cron);
|
|
60
|
-
this.props.onClose();
|
|
61
|
-
}
|
|
62
|
-
renderWarningDialog() {
|
|
63
|
-
if (!this.state.showWarning) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
return (react_1.default.createElement(Confirm_1.default, { title: i18n_1.default.t('ra_Please confirm'), text: i18n_1.default.t(this.state.showWarning === 'everySecond'
|
|
67
|
-
? 'ra_The schedule will be executed every second. Are you sure?'
|
|
68
|
-
: 'ra_The schedule will be executed every minute. Are you sure?'), onClose: (ok) => this.setState({ showWarning: '' }, () => {
|
|
69
|
-
if (ok) {
|
|
70
|
-
this.handleOk(true);
|
|
71
|
-
}
|
|
72
|
-
}) }));
|
|
73
|
-
}
|
|
74
|
-
handleClear() {
|
|
75
|
-
this.props.onOk(false);
|
|
76
|
-
this.props.onClose();
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
79
|
-
return (react_1.default.createElement(material_1.Dialog, { onClose: () => { }, maxWidth: "md", fullWidth: true, sx: { '& .MuiDialog-paper': styles.dialogPaper }, open: !0, "aria-labelledby": "cron-dialog-title" },
|
|
80
|
-
this.renderWarningDialog(),
|
|
81
|
-
react_1.default.createElement(material_1.DialogTitle, { id: "cron-dialog-title" }, this.props.title || i18n_1.default.t('ra_Define schedule...')),
|
|
82
|
-
react_1.default.createElement(material_1.DialogContent, { style: { height: '100%', overflow: 'hidden' } },
|
|
83
|
-
react_1.default.createElement(ComplexCron_1.default, { cronExpression: this.state.cron, onChange: cron => this.setState({ cron }), language: i18n_1.default.getLanguage() })),
|
|
84
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
85
|
-
!!this.props.clearButton && (react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleClear(), startIcon: react_1.default.createElement(icons_material_1.Delete, null) }, this.props.clear || i18n_1.default.t('ra_Clear'))),
|
|
86
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleOk(), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
87
|
-
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel')))));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.default = DialogComplexCron;
|
package/Dialogs/Confirm.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright 2019-2024 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
4
|
-
*
|
|
5
|
-
* MIT License
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
36
|
-
const react_1 = __importStar(require("react"));
|
|
37
|
-
const material_1 = require("@mui/material");
|
|
38
|
-
const icons_material_1 = require("@mui/icons-material");
|
|
39
|
-
const i18n_1 = __importDefault(require("../i18n"));
|
|
40
|
-
const styles = {
|
|
41
|
-
suppress: {
|
|
42
|
-
fontSize: 12,
|
|
43
|
-
},
|
|
44
|
-
suppressRoot: {
|
|
45
|
-
// it is sx
|
|
46
|
-
marginTop: '16px',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
class DialogConfirm extends react_1.Component {
|
|
50
|
-
constructor(props) {
|
|
51
|
-
super(props);
|
|
52
|
-
if (!this.props.dialogName && this.props.suppressQuestionMinutes) {
|
|
53
|
-
throw new Error('dialogName required if suppressQuestionMinutes used');
|
|
54
|
-
}
|
|
55
|
-
let suppress = false;
|
|
56
|
-
if (this.props.suppressQuestionMinutes) {
|
|
57
|
-
suppress =
|
|
58
|
-
parseInt((window._localStorage || window.localStorage).getItem(this.props.dialogName), 10) ||
|
|
59
|
-
0;
|
|
60
|
-
if (!suppress) {
|
|
61
|
-
suppress = false;
|
|
62
|
-
}
|
|
63
|
-
else if (Date.now() > suppress) {
|
|
64
|
-
(window._localStorage || window.localStorage).removeItem(this.props.dialogName);
|
|
65
|
-
suppress = false;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
this.state = {
|
|
69
|
-
suppress,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
handleOk() {
|
|
73
|
-
if (this.state.suppress) {
|
|
74
|
-
(window._localStorage || window.localStorage).setItem(this.props.dialogName, Date.now() + (this.props.suppressQuestionMinutes || 2) * 60000);
|
|
75
|
-
}
|
|
76
|
-
if (this.props.onClose) {
|
|
77
|
-
this.props.onClose(true);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
handleCancel() {
|
|
81
|
-
if (this.props.onClose) {
|
|
82
|
-
this.props.onClose(false);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
render() {
|
|
86
|
-
if (typeof this.state.suppress === 'number') {
|
|
87
|
-
setTimeout(() => this.props.onClose && this.props.onClose(true), 100);
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
return (react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "md", fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true, onClose: (event, reason) => {
|
|
91
|
-
if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {
|
|
92
|
-
this.handleCancel();
|
|
93
|
-
}
|
|
94
|
-
}, "aria-labelledby": "ar_confirmation_dialog_title", "aria-describedby": "ar_confirmation_dialog_description" },
|
|
95
|
-
react_1.default.createElement(material_1.DialogTitle, { id: "ar_confirmation_dialog_title" }, this.props.title || i18n_1.default.t('ra_Are you sure?')),
|
|
96
|
-
react_1.default.createElement(material_1.DialogContent, null,
|
|
97
|
-
react_1.default.createElement(material_1.DialogContentText, { id: "ar_confirmation_dialog_description" },
|
|
98
|
-
this.props.icon || null,
|
|
99
|
-
this.props.text,
|
|
100
|
-
this.props.suppressQuestionMinutes ? react_1.default.createElement("br", null) : null,
|
|
101
|
-
this.props.suppressQuestionMinutes ? (react_1.default.createElement(material_1.FormControlLabel, { sx: {
|
|
102
|
-
'& .FormControlLabel-label': styles.suppress,
|
|
103
|
-
'&.FormControlLabel-root': styles.suppressRoot,
|
|
104
|
-
}, control: react_1.default.createElement(material_1.Checkbox, { id: `ar_dialog_confirm_suppress_${this.props.dialogName || ''}`, checked: !!this.state.suppress, onChange: () => this.setState({ suppress: !this.state.suppress }) }), label: this.props.suppressText ||
|
|
105
|
-
i18n_1.default.t('ra_Suppress question for next %s minutes', (this.props.suppressQuestionMinutes || 2).toString()) })) : null)),
|
|
106
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
107
|
-
react_1.default.createElement(material_1.Button, { id: `ar_dialog_confirm_ok_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleOk(), color: "primary", autoFocus: true, startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
108
|
-
react_1.default.createElement(material_1.Button, { id: `ar_dialog_confirm_cancel_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleCancel(), color: "grey", startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel')))));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.default = DialogConfirm;
|