@iobroker/adapter-react-v5 7.2.4 → 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 +6 -6
- 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 +2 -2
- package/{Components → build/Components}/FileBrowser.js +229 -236
- 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 +4 -4
- package/{Components → build/Components}/ObjectBrowser.js +1152 -1116
- 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 +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 -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,239 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
|
|
3
|
-
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material';
|
|
4
|
-
import type { InputProps } from '@mui/material/Input';
|
|
5
|
-
|
|
6
|
-
import type { ThemeType, Translate } from '../types';
|
|
7
|
-
|
|
8
|
-
import Icon from './Icon';
|
|
9
|
-
import Utils from './Utils';
|
|
10
|
-
import I18n from '../i18n';
|
|
11
|
-
|
|
12
|
-
const styles: Record<string, React.CSSProperties> = {
|
|
13
|
-
different: {
|
|
14
|
-
opacity: 0.5,
|
|
15
|
-
},
|
|
16
|
-
icon: {
|
|
17
|
-
width: 16,
|
|
18
|
-
height: 16,
|
|
19
|
-
marginRight: 8,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
interface SelectWithIconProps {
|
|
24
|
-
t: Translate;
|
|
25
|
-
lang: ioBroker.Languages;
|
|
26
|
-
themeType: ThemeType;
|
|
27
|
-
value?: string;
|
|
28
|
-
onChange: (id: string) => void;
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
list?: ioBroker.Object[] | Record<string, ioBroker.Object>; // one of "list"(Array) or "options"(object) is required
|
|
31
|
-
options?: Record<string, any>; // one of "list"(Array) or "options"(object) is required
|
|
32
|
-
different?: string | boolean;
|
|
33
|
-
label?: string;
|
|
34
|
-
fullWidth?: boolean;
|
|
35
|
-
className?: string;
|
|
36
|
-
style?: React.CSSProperties;
|
|
37
|
-
removePrefix?: string;
|
|
38
|
-
allowNone?: boolean;
|
|
39
|
-
inputProps?: InputProps['inputProps'];
|
|
40
|
-
dense?: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface TextWithIconItem {
|
|
44
|
-
name: string;
|
|
45
|
-
value: string;
|
|
46
|
-
icon?: string;
|
|
47
|
-
color?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
interface SelectWithIconState {
|
|
51
|
-
list: TextWithIconItem[];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
class SelectWithIcon extends Component<SelectWithIconProps, SelectWithIconState> {
|
|
55
|
-
private readonly wordDifferent: string | undefined;
|
|
56
|
-
|
|
57
|
-
private timeout: ReturnType<typeof setTimeout> | null = null;
|
|
58
|
-
|
|
59
|
-
constructor(props: SelectWithIconProps) {
|
|
60
|
-
super(props);
|
|
61
|
-
|
|
62
|
-
if (props.different) {
|
|
63
|
-
this.wordDifferent = props.t('ra___different__');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let list: TextWithIconItem[];
|
|
67
|
-
if (Array.isArray(props.list || props.options)) {
|
|
68
|
-
list = ((props.list || props.options) as ioBroker.Object[]).map(obj => ({
|
|
69
|
-
name: Utils.getObjectNameFromObj(obj, props.lang)
|
|
70
|
-
.replace('system.group.', '')
|
|
71
|
-
.replace('system.user.', '')
|
|
72
|
-
.replace('enum.rooms.', '')
|
|
73
|
-
.replace('enum.functions.', ''),
|
|
74
|
-
value: obj._id,
|
|
75
|
-
icon: obj.common?.icon,
|
|
76
|
-
color: obj.common?.color,
|
|
77
|
-
}));
|
|
78
|
-
} else {
|
|
79
|
-
list = Object.values((props.list || props.options) as Record<string, ioBroker.Object>).map(obj => ({
|
|
80
|
-
name: Utils.getObjectNameFromObj(obj, props.lang)
|
|
81
|
-
.replace('system.group.', '')
|
|
82
|
-
.replace('system.user.', '')
|
|
83
|
-
.replace('enum.rooms.', '')
|
|
84
|
-
.replace('enum.functions.', ''),
|
|
85
|
-
value: obj._id,
|
|
86
|
-
icon: obj.common?.icon,
|
|
87
|
-
color: obj.common?.color,
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (props.different && props.value === props.different) {
|
|
92
|
-
list.unshift({ value: props.different, name: this.wordDifferent || '' });
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (props.allowNone) {
|
|
96
|
-
list.unshift({ value: '', name: I18n.t('ra_none') });
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
this.state = {
|
|
100
|
-
list,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
render(): React.JSX.Element {
|
|
105
|
-
if (this.props.allowNone && !this.state.list.find(obj => obj.value === '')) {
|
|
106
|
-
this.timeout =
|
|
107
|
-
this.timeout ||
|
|
108
|
-
setTimeout(() => {
|
|
109
|
-
this.timeout = null;
|
|
110
|
-
const list = JSON.parse(JSON.stringify(this.state.list));
|
|
111
|
-
list.unshift({ value: '', name: I18n.t('ra_none') });
|
|
112
|
-
this.setState({ list });
|
|
113
|
-
}, 100);
|
|
114
|
-
} else if (!this.props.allowNone && this.state.list.find(obj => obj.value === '')) {
|
|
115
|
-
this.timeout =
|
|
116
|
-
this.timeout ||
|
|
117
|
-
setTimeout(() => {
|
|
118
|
-
this.timeout = null;
|
|
119
|
-
const list = JSON.parse(JSON.stringify(this.state.list));
|
|
120
|
-
const i = this.state.list.findIndex(obj => obj.value === '');
|
|
121
|
-
list.splice(i, 1);
|
|
122
|
-
this.setState({ list });
|
|
123
|
-
}, 100);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const item = this.state.list.find(
|
|
127
|
-
it =>
|
|
128
|
-
it.value === this.props.value ||
|
|
129
|
-
(this.props.removePrefix && it.value.replace(this.props.removePrefix, '') === this.props.value),
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
const style =
|
|
133
|
-
this.props.value === this.props.different
|
|
134
|
-
? {}
|
|
135
|
-
: {
|
|
136
|
-
color: item?.color || undefined,
|
|
137
|
-
backgroundColor: Utils.getInvertedColor(item?.color || '', this.props.themeType),
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
if (this.props.dense && this.props.style) {
|
|
141
|
-
Object.assign(style, this.props.style);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const select = (
|
|
145
|
-
<Select
|
|
146
|
-
variant="standard"
|
|
147
|
-
disabled={this.props.disabled}
|
|
148
|
-
value={this.props.value}
|
|
149
|
-
slotProps={{
|
|
150
|
-
input: this.props.inputProps,
|
|
151
|
-
}}
|
|
152
|
-
renderValue={
|
|
153
|
-
(/* value */) => (
|
|
154
|
-
<span>
|
|
155
|
-
{item?.icon ? (
|
|
156
|
-
<Icon
|
|
157
|
-
src={item?.icon}
|
|
158
|
-
style={styles.icon}
|
|
159
|
-
/>
|
|
160
|
-
) : null}
|
|
161
|
-
{item?.name}
|
|
162
|
-
</span>
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
sx={{
|
|
166
|
-
'&.MuiSelect-root': this.props.value === this.props.different ? styles.different : {},
|
|
167
|
-
}}
|
|
168
|
-
classes={{
|
|
169
|
-
root: this.props.dense ? this.props.className : '',
|
|
170
|
-
}}
|
|
171
|
-
style={style}
|
|
172
|
-
onChange={el => {
|
|
173
|
-
if (this.props.different && el.target.value !== this.props.different) {
|
|
174
|
-
let pos = null;
|
|
175
|
-
for (let i = 0; i < this.state.list.length; i++) {
|
|
176
|
-
if (this.state.list[i].value === this.props.different) {
|
|
177
|
-
pos = i;
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
if (pos !== null) {
|
|
182
|
-
const list: TextWithIconItem[] = Utils.clone(this.state.list) as TextWithIconItem[];
|
|
183
|
-
list.splice(pos, 1);
|
|
184
|
-
this.setState({ list }, () => this.props.onChange(el.target.value));
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
this.props.onChange(
|
|
190
|
-
this.props.removePrefix
|
|
191
|
-
? el.target.value.replace(this.props.removePrefix, '')
|
|
192
|
-
: el.target.value,
|
|
193
|
-
);
|
|
194
|
-
}}
|
|
195
|
-
>
|
|
196
|
-
{this.state.list.map(el => (
|
|
197
|
-
<MenuItem
|
|
198
|
-
style={
|
|
199
|
-
this.props.different && el.value === this.props.different
|
|
200
|
-
? styles.different
|
|
201
|
-
: {
|
|
202
|
-
color: el.color || undefined,
|
|
203
|
-
backgroundColor: Utils.getInvertedColor(el.color || '', this.props.themeType),
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
key={el.value}
|
|
207
|
-
value={el.value}
|
|
208
|
-
>
|
|
209
|
-
{el.icon ? (
|
|
210
|
-
<Icon
|
|
211
|
-
src={el.icon}
|
|
212
|
-
style={styles.icon}
|
|
213
|
-
/>
|
|
214
|
-
) : null}
|
|
215
|
-
{el.name}
|
|
216
|
-
</MenuItem>
|
|
217
|
-
))}
|
|
218
|
-
</Select>
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
if (this.props.dense) {
|
|
222
|
-
return select;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
return (
|
|
226
|
-
<FormControl
|
|
227
|
-
variant="standard"
|
|
228
|
-
fullWidth={!!this.props.fullWidth}
|
|
229
|
-
style={this.props.style}
|
|
230
|
-
className={this.props.className}
|
|
231
|
-
>
|
|
232
|
-
<InputLabel>{this.props.label}</InputLabel>
|
|
233
|
-
{select}
|
|
234
|
-
</FormControl>
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export default SelectWithIcon;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Grid2, Paper } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
const styles: Record<string, React.CSSProperties> = {
|
|
6
|
-
root: {
|
|
7
|
-
width: '100%',
|
|
8
|
-
height: '100%',
|
|
9
|
-
},
|
|
10
|
-
overflowHidden: {
|
|
11
|
-
overflow: 'hidden',
|
|
12
|
-
},
|
|
13
|
-
container: {
|
|
14
|
-
height: '100%',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
interface TabContainerProps {
|
|
19
|
-
/* The elevation of the tab container. */
|
|
20
|
-
elevation?: number;
|
|
21
|
-
/* Set to 'visible' show the overflow. */
|
|
22
|
-
overflow?: string;
|
|
23
|
-
styles?: {
|
|
24
|
-
root?: React.CSSProperties;
|
|
25
|
-
container?: React.CSSProperties;
|
|
26
|
-
};
|
|
27
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
28
|
-
tabIndex?: number;
|
|
29
|
-
/** The content of the component. */
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function TabContainer(props: TabContainerProps): React.JSX.Element {
|
|
34
|
-
return (
|
|
35
|
-
<Paper
|
|
36
|
-
elevation={!Number.isNaN(props.elevation) ? props.elevation : 1}
|
|
37
|
-
style={{
|
|
38
|
-
...styles.root,
|
|
39
|
-
...(props.styles?.root || undefined),
|
|
40
|
-
...(props.overflow !== 'visible' ? styles.overflowHidden : undefined),
|
|
41
|
-
}}
|
|
42
|
-
onKeyDown={props.onKeyDown}
|
|
43
|
-
tabIndex={props.tabIndex}
|
|
44
|
-
>
|
|
45
|
-
<Grid2
|
|
46
|
-
container
|
|
47
|
-
direction="column"
|
|
48
|
-
wrap="nowrap"
|
|
49
|
-
sx={styles.container}
|
|
50
|
-
>
|
|
51
|
-
{props.children}
|
|
52
|
-
</Grid2>
|
|
53
|
-
</Paper>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default TabContainer;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Grid2 } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
const styles: Record<string, React.CSSProperties> = {
|
|
6
|
-
root: {
|
|
7
|
-
height: '100%',
|
|
8
|
-
overflow: 'hidden',
|
|
9
|
-
},
|
|
10
|
-
overflowAuto: {
|
|
11
|
-
overflow: 'auto',
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
interface TabContentProps {
|
|
16
|
-
/** The content of the component. */
|
|
17
|
-
children: React.JSX.Element | (React.JSX.Element | null | React.JSX.Element[])[];
|
|
18
|
-
/** Overflow behavior */
|
|
19
|
-
overflow?: 'auto';
|
|
20
|
-
|
|
21
|
-
style?: React.CSSProperties;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function TabContent(props: TabContentProps): React.JSX.Element {
|
|
25
|
-
return (
|
|
26
|
-
<Grid2
|
|
27
|
-
sx={{
|
|
28
|
-
...styles.root,
|
|
29
|
-
...(props?.style || undefined),
|
|
30
|
-
...(props.overflow === 'auto' ? styles.overflowAuto : undefined),
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
{props.children}
|
|
34
|
-
</Grid2>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default TabContent;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Grid2 } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
interface TabHeaderProps {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function TabHeader(props: TabHeaderProps): React.JSX.Element {
|
|
10
|
-
return (
|
|
11
|
-
<Grid2
|
|
12
|
-
container
|
|
13
|
-
alignItems="center"
|
|
14
|
-
>
|
|
15
|
-
{props.children}
|
|
16
|
-
</Grid2>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default TabHeader;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, { type JSX } from 'react';
|
|
2
|
-
|
|
3
|
-
import { IconButton, Tooltip } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Brightness4 as Brightness4Icon,
|
|
7
|
-
Brightness5 as Brightness5Icon,
|
|
8
|
-
Brightness6 as Brightness6Icon,
|
|
9
|
-
Brightness7 as Brightness7Icon,
|
|
10
|
-
} from '@mui/icons-material';
|
|
11
|
-
|
|
12
|
-
interface ToggleThemeMenuProps {
|
|
13
|
-
themeName: 'dark' | 'blue' | 'colored' | 'light';
|
|
14
|
-
toggleTheme: () => void;
|
|
15
|
-
t: (key: string) => string;
|
|
16
|
-
className?: string;
|
|
17
|
-
style?: React.CSSProperties;
|
|
18
|
-
size?: 'small' | 'medium' | 'large';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default function ToggleThemeMenu({
|
|
22
|
-
themeName,
|
|
23
|
-
toggleTheme,
|
|
24
|
-
t,
|
|
25
|
-
className,
|
|
26
|
-
style,
|
|
27
|
-
size,
|
|
28
|
-
}: ToggleThemeMenuProps): JSX.Element {
|
|
29
|
-
return (
|
|
30
|
-
<div
|
|
31
|
-
className={className || undefined}
|
|
32
|
-
style={style || undefined}
|
|
33
|
-
>
|
|
34
|
-
<Tooltip
|
|
35
|
-
title={t('ra_Change color theme')}
|
|
36
|
-
slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}
|
|
37
|
-
>
|
|
38
|
-
<IconButton
|
|
39
|
-
onClick={() => toggleTheme()}
|
|
40
|
-
size={size || 'medium'}
|
|
41
|
-
>
|
|
42
|
-
{themeName === 'dark' && <Brightness4Icon className={className} />}
|
|
43
|
-
{themeName === 'blue' && <Brightness5Icon className={className} />}
|
|
44
|
-
{themeName === 'colored' && <Brightness6Icon className={className} />}
|
|
45
|
-
{themeName !== 'dark' && themeName !== 'blue' && themeName !== 'colored' && (
|
|
46
|
-
<Brightness7Icon className={className} />
|
|
47
|
-
)}
|
|
48
|
-
</IconButton>
|
|
49
|
-
</Tooltip>
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
}
|