@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
package/src/Dialogs/SelectID.tsx
DELETED
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
8
|
-
import React, { Component, type JSX } from 'react';
|
|
9
|
-
|
|
10
|
-
import { Button, DialogTitle, DialogContent, DialogActions, Dialog } from '@mui/material';
|
|
11
|
-
|
|
12
|
-
import { Cancel as IconCancel, Check as IconOk } from '@mui/icons-material';
|
|
13
|
-
|
|
14
|
-
import type Connection from '../Connection';
|
|
15
|
-
|
|
16
|
-
import I18n from '../i18n';
|
|
17
|
-
import ObjectBrowser, { type ObjectBrowserFilter } from '../Components/ObjectBrowser';
|
|
18
|
-
import type { ObjectBrowserColumn, ObjectBrowserCustomFilter, ObjectBrowserType } from '../Components/types';
|
|
19
|
-
import type { IobTheme } from '../types';
|
|
20
|
-
|
|
21
|
-
export interface SelectIDFilters {
|
|
22
|
-
id?: string;
|
|
23
|
-
name?: string;
|
|
24
|
-
room?: string;
|
|
25
|
-
func?: string;
|
|
26
|
-
role?: string;
|
|
27
|
-
type?: string;
|
|
28
|
-
custom?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface DialogSelectIDProps {
|
|
32
|
-
/** The internal name of the dialog; default: "default". Used to store settings in local storage */
|
|
33
|
-
dialogName?: string;
|
|
34
|
-
/** The dialog title; default: Please select object ID... (translated) */
|
|
35
|
-
title?: string;
|
|
36
|
-
/** Set to true to allow the selection of multiple IDs. */
|
|
37
|
-
multiSelect?: boolean;
|
|
38
|
-
/** Show folders before any leaves. */
|
|
39
|
-
foldersFirst?: boolean;
|
|
40
|
-
/** Path prefix for images (default: '.') */
|
|
41
|
-
imagePrefix?: string;
|
|
42
|
-
/** @deprecated same as imagePrefix */
|
|
43
|
-
prefix?: string;
|
|
44
|
-
/** Show the expert button */
|
|
45
|
-
showExpertButton?: boolean;
|
|
46
|
-
/** Force expert mode */
|
|
47
|
-
expertMode?: boolean;
|
|
48
|
-
/** optional ['name', 'type', 'role', 'room', 'func', 'val', 'buttons'] */
|
|
49
|
-
columns?: ObjectBrowserColumn[];
|
|
50
|
-
/** Object types to show; default: 'state' only */
|
|
51
|
-
types?: ObjectBrowserType | ObjectBrowserType[];
|
|
52
|
-
/** The language. */
|
|
53
|
-
lang?: ioBroker.Languages;
|
|
54
|
-
/** The socket connection. */
|
|
55
|
-
socket: Connection;
|
|
56
|
-
/** Can't objects be edited? (default: true) */
|
|
57
|
-
notEditable?: boolean;
|
|
58
|
-
/** Theme name. */
|
|
59
|
-
themeName?: string;
|
|
60
|
-
/** Theme type: dark or light */
|
|
61
|
-
themeType?: string;
|
|
62
|
-
/** The theme object */
|
|
63
|
-
theme: IobTheme;
|
|
64
|
-
/** The date format for the date columns */
|
|
65
|
-
dateFormat?: string;
|
|
66
|
-
/** Is use comma or point for displaying of float numbers */
|
|
67
|
-
isFloatComma?: boolean;
|
|
68
|
-
/** Custom filter. */
|
|
69
|
-
customFilter?: ObjectBrowserCustomFilter;
|
|
70
|
-
/** The selected IDs. */
|
|
71
|
-
selected?: string | string[];
|
|
72
|
-
/** The ok button text; default: OK (translated) */
|
|
73
|
-
ok?: string;
|
|
74
|
-
/** The cancel button text; default: Cancel (translated) */
|
|
75
|
-
cancel?: string;
|
|
76
|
-
/** Close handler that is always called when the dialog is closed. */
|
|
77
|
-
onClose: () => void;
|
|
78
|
-
/** Handler that is called when the user presses OK. */
|
|
79
|
-
onOk: (selected: string | string[] | undefined, name: string) => void;
|
|
80
|
-
/**
|
|
81
|
-
* Function to filter out all unnecessary objects. Can be string or function.
|
|
82
|
-
* It cannot be used together with "types".
|
|
83
|
-
* Example for function: `obj => obj.common?.type === 'boolean'` to show only boolean states
|
|
84
|
-
* In case of string, it must look like `obj.common && obj.common.type === 'boolean'`
|
|
85
|
-
*/
|
|
86
|
-
filterFunc?: string | ((obj: ioBroker.Object) => boolean);
|
|
87
|
-
/** predefined filter fields, like {"id":"","name":"","room":"","func":"","role":"level","type":"","custom":""} */
|
|
88
|
-
filters?: SelectIDFilters;
|
|
89
|
-
/** Show elements only of this root ID */
|
|
90
|
-
root?: string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
interface DialogSelectIDState {
|
|
94
|
-
selected: string[];
|
|
95
|
-
name: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
class DialogSelectID extends Component<DialogSelectIDProps, DialogSelectIDState> {
|
|
99
|
-
private readonly dialogName: string;
|
|
100
|
-
|
|
101
|
-
private filters: ObjectBrowserFilter;
|
|
102
|
-
|
|
103
|
-
private readonly filterFunc?: (obj: ioBroker.Object) => boolean;
|
|
104
|
-
|
|
105
|
-
constructor(props: DialogSelectIDProps) {
|
|
106
|
-
super(props);
|
|
107
|
-
this.dialogName = this.props.dialogName || 'default';
|
|
108
|
-
this.dialogName = `SelectID.${this.dialogName}`;
|
|
109
|
-
|
|
110
|
-
const filters: string = ((window as any)._localStorage || window.localStorage).getItem(this.dialogName) || '{}';
|
|
111
|
-
|
|
112
|
-
try {
|
|
113
|
-
this.filters = JSON.parse(filters);
|
|
114
|
-
} catch {
|
|
115
|
-
this.filters = {};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (props.filters) {
|
|
119
|
-
this.filters = { ...this.filters, ...(props.filters || {}) };
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
let selected = this.props.selected || [];
|
|
123
|
-
if (!Array.isArray(selected)) {
|
|
124
|
-
selected = [selected];
|
|
125
|
-
}
|
|
126
|
-
selected = selected.filter(id => id);
|
|
127
|
-
|
|
128
|
-
if (props.filterFunc) {
|
|
129
|
-
if (typeof props.filterFunc === 'string') {
|
|
130
|
-
try {
|
|
131
|
-
this.filterFunc = new Function('obj', props.filterFunc) as (obj: ioBroker.Object) => boolean;
|
|
132
|
-
} catch {
|
|
133
|
-
console.error(`Cannot parse filter function: "obj => ${props.filterFunc}"`);
|
|
134
|
-
this.filterFunc = undefined;
|
|
135
|
-
}
|
|
136
|
-
} else {
|
|
137
|
-
this.filterFunc = props.filterFunc;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
this.state = {
|
|
142
|
-
selected,
|
|
143
|
-
name: '',
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
handleCancel(): void {
|
|
148
|
-
this.props.onClose();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
handleOk(): void {
|
|
152
|
-
this.props.onOk(this.props.multiSelect ? this.state.selected : this.state.selected[0] || '', this.state.name);
|
|
153
|
-
this.props.onClose();
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
render(): JSX.Element {
|
|
157
|
-
let title;
|
|
158
|
-
if (this.state.name || this.state.selected.length) {
|
|
159
|
-
if (this.state.selected.length === 1) {
|
|
160
|
-
title = [
|
|
161
|
-
<span key="selected">
|
|
162
|
-
{I18n.t('ra_Selected')}
|
|
163
|
-
|
|
164
|
-
</span>,
|
|
165
|
-
<span
|
|
166
|
-
key="id"
|
|
167
|
-
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
|
|
168
|
-
>
|
|
169
|
-
{(this.state.name || this.state.selected[0]) +
|
|
170
|
-
(this.state.name ? ` [${this.state.selected[0]}]` : '')}
|
|
171
|
-
</span>,
|
|
172
|
-
];
|
|
173
|
-
} else {
|
|
174
|
-
title = [
|
|
175
|
-
<span key="selected">
|
|
176
|
-
{I18n.t('ra_Selected')}
|
|
177
|
-
|
|
178
|
-
</span>,
|
|
179
|
-
<span
|
|
180
|
-
key="id"
|
|
181
|
-
style={{ fontWeight: 'bold', fontStyle: 'italic' }}
|
|
182
|
-
>
|
|
183
|
-
{I18n.t('%s items', this.state.selected.length.toString())}
|
|
184
|
-
</span>,
|
|
185
|
-
];
|
|
186
|
-
}
|
|
187
|
-
} else {
|
|
188
|
-
title = this.props.title || I18n.t('ra_Please select object ID...');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return (
|
|
192
|
-
<Dialog
|
|
193
|
-
onClose={() => {}}
|
|
194
|
-
maxWidth={false}
|
|
195
|
-
sx={{
|
|
196
|
-
'& .MuiDialog-paper': {
|
|
197
|
-
height: '95%',
|
|
198
|
-
p: '4px',
|
|
199
|
-
width: '100%',
|
|
200
|
-
maxWidth: '100%',
|
|
201
|
-
maxHeight: 'calc(100% - 16px)',
|
|
202
|
-
},
|
|
203
|
-
}}
|
|
204
|
-
fullWidth
|
|
205
|
-
open={!0}
|
|
206
|
-
aria-labelledby="ar_dialog_selectid_title"
|
|
207
|
-
>
|
|
208
|
-
<DialogTitle
|
|
209
|
-
id="ar_dialog_selectid_title"
|
|
210
|
-
style={{
|
|
211
|
-
whiteSpace: 'nowrap',
|
|
212
|
-
width: 'calc(100% - 72px)',
|
|
213
|
-
overflow: 'hidden',
|
|
214
|
-
display: 'inline-block',
|
|
215
|
-
textOverflow: 'ellipsis',
|
|
216
|
-
}}
|
|
217
|
-
>
|
|
218
|
-
{title}
|
|
219
|
-
</DialogTitle>
|
|
220
|
-
<DialogContent
|
|
221
|
-
style={{
|
|
222
|
-
height: '100%',
|
|
223
|
-
overflow: 'hidden',
|
|
224
|
-
padding: '8px 4px',
|
|
225
|
-
}}
|
|
226
|
-
>
|
|
227
|
-
<ObjectBrowser
|
|
228
|
-
foldersFirst={this.props.foldersFirst}
|
|
229
|
-
imagePrefix={this.props.imagePrefix || this.props.prefix} // prefix is for back compatibility
|
|
230
|
-
dateFormat={this.props.dateFormat}
|
|
231
|
-
defaultFilters={this.filters}
|
|
232
|
-
dialogName={this.dialogName}
|
|
233
|
-
isFloatComma={this.props.isFloatComma}
|
|
234
|
-
showExpertButton={
|
|
235
|
-
this.props.showExpertButton !== undefined ? this.props.showExpertButton : true
|
|
236
|
-
}
|
|
237
|
-
expertMode={this.props.expertMode}
|
|
238
|
-
// style={{ width: '100%', height: '100%' }}
|
|
239
|
-
columns={this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val']}
|
|
240
|
-
types={
|
|
241
|
-
this.props.types
|
|
242
|
-
? Array.isArray(this.props.types)
|
|
243
|
-
? this.props.types
|
|
244
|
-
: [this.props.types]
|
|
245
|
-
: ['state']
|
|
246
|
-
}
|
|
247
|
-
root={this.props.root}
|
|
248
|
-
t={I18n.t}
|
|
249
|
-
lang={this.props.lang || I18n.getLanguage()}
|
|
250
|
-
socket={this.props.socket}
|
|
251
|
-
selected={this.state.selected}
|
|
252
|
-
multiSelect={this.props.multiSelect}
|
|
253
|
-
notEditable={this.props.notEditable === undefined ? true : this.props.notEditable}
|
|
254
|
-
// name={this.state.name}
|
|
255
|
-
themeName={this.props.themeName}
|
|
256
|
-
themeType={this.props.themeType}
|
|
257
|
-
theme={this.props.theme}
|
|
258
|
-
customFilter={this.props.customFilter}
|
|
259
|
-
onFilterChanged={(filterConfig: ObjectBrowserFilter) => {
|
|
260
|
-
this.filters = filterConfig;
|
|
261
|
-
((window as any)._localStorage || window.localStorage).setItem(
|
|
262
|
-
this.dialogName,
|
|
263
|
-
JSON.stringify(filterConfig),
|
|
264
|
-
);
|
|
265
|
-
}}
|
|
266
|
-
onSelect={(_selected: string | string[], name: string, isDouble?: boolean) => {
|
|
267
|
-
let selected: string[];
|
|
268
|
-
if (!Array.isArray(_selected)) {
|
|
269
|
-
selected = [_selected];
|
|
270
|
-
} else {
|
|
271
|
-
selected = _selected;
|
|
272
|
-
}
|
|
273
|
-
if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {
|
|
274
|
-
this.setState({ selected, name }, () => isDouble && this.handleOk());
|
|
275
|
-
} else if (isDouble) {
|
|
276
|
-
this.handleOk();
|
|
277
|
-
}
|
|
278
|
-
}}
|
|
279
|
-
filterFunc={this.filterFunc}
|
|
280
|
-
title=""
|
|
281
|
-
classes={{}}
|
|
282
|
-
/>
|
|
283
|
-
</DialogContent>
|
|
284
|
-
<DialogActions>
|
|
285
|
-
<Button
|
|
286
|
-
id={`ar_dialog_selectid_ok_${this.props.dialogName || ''}`}
|
|
287
|
-
variant="contained"
|
|
288
|
-
onClick={() => this.handleOk()}
|
|
289
|
-
startIcon={<IconOk />}
|
|
290
|
-
disabled={!this.state.selected.length}
|
|
291
|
-
color="primary"
|
|
292
|
-
>
|
|
293
|
-
{this.props.ok || I18n.t('ra_Ok')}
|
|
294
|
-
</Button>
|
|
295
|
-
<Button
|
|
296
|
-
id={`ar_dialog_selectid_cancel_${this.props.dialogName || ''}`}
|
|
297
|
-
color="grey"
|
|
298
|
-
variant="contained"
|
|
299
|
-
onClick={() => this.handleCancel()}
|
|
300
|
-
startIcon={<IconCancel />}
|
|
301
|
-
>
|
|
302
|
-
{this.props.cancel || I18n.t('ra_Cancel')}
|
|
303
|
-
</Button>
|
|
304
|
-
</DialogActions>
|
|
305
|
-
</Dialog>
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export default DialogSelectID;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React, { type JSX } from 'react';
|
|
2
|
-
import { Button, DialogTitle, DialogContent, DialogActions, Dialog } from '@mui/material';
|
|
3
|
-
|
|
4
|
-
import { Check as IconOk, Cancel as IconCancel } from '@mui/icons-material';
|
|
5
|
-
|
|
6
|
-
import SimpleCron from '../Components/SimpleCron';
|
|
7
|
-
|
|
8
|
-
import I18n from '../i18n';
|
|
9
|
-
|
|
10
|
-
// Generates cron expression
|
|
11
|
-
|
|
12
|
-
const styles: Record<string, React.CSSProperties> = {
|
|
13
|
-
dialogPaper: {
|
|
14
|
-
height: 'calc(100% - 96px)',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
interface DialogCronProps {
|
|
19
|
-
onClose: () => void;
|
|
20
|
-
onOk: (cron: string) => void;
|
|
21
|
-
title?: string;
|
|
22
|
-
cron?: string;
|
|
23
|
-
cancel?: string;
|
|
24
|
-
ok?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface DialogCronState {
|
|
28
|
-
cron: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
class DialogSimpleCron extends React.Component<DialogCronProps, DialogCronState> {
|
|
32
|
-
constructor(props: DialogCronProps) {
|
|
33
|
-
super(props);
|
|
34
|
-
|
|
35
|
-
let cron;
|
|
36
|
-
if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^["']/, '')[0] !== '{') {
|
|
37
|
-
cron = this.props.cron.replace(/['"]/g, '').trim();
|
|
38
|
-
} else {
|
|
39
|
-
cron = this.props.cron || '{}';
|
|
40
|
-
if (typeof cron === 'string') {
|
|
41
|
-
cron = cron.replace(/^["']/, '').replace(/["']\n?$/, '');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
this.state = {
|
|
46
|
-
cron,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
handleCancel(): void {
|
|
51
|
-
this.props.onClose();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
handleOk(): void {
|
|
55
|
-
this.props.onOk(this.state.cron);
|
|
56
|
-
this.props.onClose();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
render(): JSX.Element {
|
|
60
|
-
return (
|
|
61
|
-
<Dialog
|
|
62
|
-
onClose={() => {}}
|
|
63
|
-
maxWidth="md"
|
|
64
|
-
fullWidth
|
|
65
|
-
sx={{ '& .MuiDialog-paper': styles.dialogPaper }}
|
|
66
|
-
open={!0}
|
|
67
|
-
aria-labelledby="cron-dialog-title"
|
|
68
|
-
>
|
|
69
|
-
<DialogTitle id="cron-dialog-title">{this.props.title || I18n.t('ra_Define CRON...')}</DialogTitle>
|
|
70
|
-
<DialogContent style={{ height: '100%', overflow: 'hidden' }}>
|
|
71
|
-
<SimpleCron
|
|
72
|
-
cronExpression={this.state.cron}
|
|
73
|
-
onChange={cron => this.setState({ cron })}
|
|
74
|
-
language={I18n.getLanguage()}
|
|
75
|
-
/>
|
|
76
|
-
</DialogContent>
|
|
77
|
-
<DialogActions>
|
|
78
|
-
<Button
|
|
79
|
-
variant="contained"
|
|
80
|
-
disabled={!this.state.cron || this.state.cron.includes('_')}
|
|
81
|
-
onClick={() => this.handleOk()}
|
|
82
|
-
color="primary"
|
|
83
|
-
startIcon={<IconOk />}
|
|
84
|
-
>
|
|
85
|
-
{this.props.ok || I18n.t('ra_Ok')}
|
|
86
|
-
</Button>
|
|
87
|
-
<Button
|
|
88
|
-
variant="contained"
|
|
89
|
-
onClick={() => this.handleCancel()}
|
|
90
|
-
color="grey"
|
|
91
|
-
startIcon={<IconCancel />}
|
|
92
|
-
>
|
|
93
|
-
{this.props.cancel || I18n.t('ra_Cancel')}
|
|
94
|
-
</Button>
|
|
95
|
-
</DialogActions>
|
|
96
|
-
</Dialog>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export default DialogSimpleCron;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import React, { type JSX } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Button, TextField, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
import { Close as IconClose, Check as IconCheck } from '@mui/icons-material';
|
|
6
|
-
|
|
7
|
-
import I18n from '../i18n';
|
|
8
|
-
|
|
9
|
-
import withWidth from '../Components/withWidth';
|
|
10
|
-
|
|
11
|
-
interface TextInputProps {
|
|
12
|
-
/** The dialog close callback */
|
|
13
|
-
onClose: (text: string | null) => void;
|
|
14
|
-
/** The title text */
|
|
15
|
-
titleText: string;
|
|
16
|
-
/** Prompt text (default: empty) */
|
|
17
|
-
promptText?: string;
|
|
18
|
-
/** Label text (default: empty) */
|
|
19
|
-
labelText?: string;
|
|
20
|
-
/** The text of the cancel button */
|
|
21
|
-
cancelText: string;
|
|
22
|
-
/** The text of the "apply" button */
|
|
23
|
-
applyText: string;
|
|
24
|
-
/** The verification callback. Return a non-empty string if there was an error */
|
|
25
|
-
verify?: (text: string) => string;
|
|
26
|
-
/** The text replacement callback */
|
|
27
|
-
rule?: (text: string) => string;
|
|
28
|
-
/** The type of the textbox (default: text) */
|
|
29
|
-
type?: 'text' | 'number' | 'password' | 'email';
|
|
30
|
-
/** The initial input value when opening the dialog */
|
|
31
|
-
value?: string;
|
|
32
|
-
/** @deprecated Use value. The input when opening the dialog */
|
|
33
|
-
input?: string;
|
|
34
|
-
/** If true, the dialog will be full width */
|
|
35
|
-
fullWidth?: boolean;
|
|
36
|
-
}
|
|
37
|
-
function TextInput(props: TextInputProps): JSX.Element {
|
|
38
|
-
const [text, setText] = React.useState<string>(props.input || props.value || '');
|
|
39
|
-
const [error, setError] = React.useState<string | boolean>('');
|
|
40
|
-
return (
|
|
41
|
-
<Dialog
|
|
42
|
-
open={!0}
|
|
43
|
-
onClose={() => props.onClose(null)}
|
|
44
|
-
aria-labelledby="form-dialog-title"
|
|
45
|
-
fullWidth={props.fullWidth !== undefined ? props.fullWidth : false}
|
|
46
|
-
>
|
|
47
|
-
<DialogTitle id="form-dialog-title">{props.titleText}</DialogTitle>
|
|
48
|
-
<DialogContent>
|
|
49
|
-
<DialogContentText>{props.promptText}</DialogContentText>
|
|
50
|
-
<TextField
|
|
51
|
-
variant="standard"
|
|
52
|
-
autoFocus
|
|
53
|
-
margin="dense"
|
|
54
|
-
error={!!error}
|
|
55
|
-
helperText={error === true || !error ? '' : error}
|
|
56
|
-
value={text}
|
|
57
|
-
label={props.labelText || ''}
|
|
58
|
-
type={props.type || 'text'}
|
|
59
|
-
onKeyUp={e => e.code === 'Enter' && text && props.onClose(text)}
|
|
60
|
-
onChange={e => {
|
|
61
|
-
let _error: string | boolean = '';
|
|
62
|
-
if (props.verify) {
|
|
63
|
-
_error = !props.verify(e.target.value);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (props.rule) {
|
|
67
|
-
setText(props.rule(e.target.value));
|
|
68
|
-
} else {
|
|
69
|
-
setText(e.target.value);
|
|
70
|
-
}
|
|
71
|
-
setError(_error);
|
|
72
|
-
}}
|
|
73
|
-
fullWidth
|
|
74
|
-
/>
|
|
75
|
-
</DialogContent>
|
|
76
|
-
<DialogActions>
|
|
77
|
-
<Button
|
|
78
|
-
variant="contained"
|
|
79
|
-
disabled={!text || !!error}
|
|
80
|
-
onClick={() => props.onClose(text)}
|
|
81
|
-
color="primary"
|
|
82
|
-
startIcon={<IconCheck />}
|
|
83
|
-
>
|
|
84
|
-
{props.applyText || I18n.t('ra_Ok')}
|
|
85
|
-
</Button>
|
|
86
|
-
<Button
|
|
87
|
-
color="grey"
|
|
88
|
-
variant="contained"
|
|
89
|
-
onClick={() => props.onClose(null)}
|
|
90
|
-
startIcon={<IconClose />}
|
|
91
|
-
>
|
|
92
|
-
{props.cancelText || I18n.t('ra_Cancel')}
|
|
93
|
-
</Button>
|
|
94
|
-
</DialogActions>
|
|
95
|
-
</Dialog>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export default withWidth()(TextInput);
|