@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/Cron.tsx
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import React, { type JSX } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Button, DialogTitle, DialogContent, DialogActions, Dialog, Radio } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
import { Check as IconOk, Cancel as IconCancel } from '@mui/icons-material';
|
|
6
|
-
|
|
7
|
-
import ComplexCron from '../Components/ComplexCron';
|
|
8
|
-
import SimpleCron, { cron2state } from '../Components/SimpleCron';
|
|
9
|
-
import Schedule from '../Components/Schedule';
|
|
10
|
-
|
|
11
|
-
import I18n from '../i18n';
|
|
12
|
-
import type { IobTheme } from '../types';
|
|
13
|
-
|
|
14
|
-
// Generate cron expression
|
|
15
|
-
|
|
16
|
-
const styles: Record<string, React.CSSProperties> = {
|
|
17
|
-
dialogPaper: {
|
|
18
|
-
height: 'calc(100% - 96px)',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
interface DialogCronProps {
|
|
23
|
-
onClose: () => void;
|
|
24
|
-
onOk: (cron: string) => void;
|
|
25
|
-
title?: string;
|
|
26
|
-
cron?: string;
|
|
27
|
-
cancel?: string;
|
|
28
|
-
ok?: string;
|
|
29
|
-
/** show only simple configuration */
|
|
30
|
-
simple?: boolean;
|
|
31
|
-
/** show only complex configuration */
|
|
32
|
-
complex?: boolean;
|
|
33
|
-
/** do not show wizard */
|
|
34
|
-
noWizard?: boolean;
|
|
35
|
-
theme: IobTheme;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface DialogCronState {
|
|
39
|
-
cron: string;
|
|
40
|
-
mode: 'simple' | 'complex' | 'wizard';
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
class DialogCron extends React.Component<DialogCronProps, DialogCronState> {
|
|
44
|
-
constructor(props: DialogCronProps) {
|
|
45
|
-
super(props);
|
|
46
|
-
let cron;
|
|
47
|
-
if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^["']/, '')[0] !== '{') {
|
|
48
|
-
cron = this.props.cron.replace(/['"]/g, '').trim();
|
|
49
|
-
} else {
|
|
50
|
-
cron = this.props.cron || '{}';
|
|
51
|
-
if (typeof cron === 'string') {
|
|
52
|
-
cron = cron.replace(/^["']/, '').replace(/["']\n?$/, '');
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
this.state = {
|
|
57
|
-
cron,
|
|
58
|
-
mode: this.props.simple
|
|
59
|
-
? 'simple'
|
|
60
|
-
: this.props.complex
|
|
61
|
-
? 'complex'
|
|
62
|
-
: (typeof cron === 'object' || cron[0] === '{') && !this.props.noWizard
|
|
63
|
-
? 'wizard'
|
|
64
|
-
: cron2state(this.props.cron || '* * * * *')
|
|
65
|
-
? 'simple'
|
|
66
|
-
: 'complex',
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
handleCancel(): void {
|
|
71
|
-
this.props.onClose();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
handleOk(): void {
|
|
75
|
-
this.props.onOk(this.state.cron);
|
|
76
|
-
this.props.onClose();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
setMode(mode: 'simple' | 'complex' | 'wizard'): void {
|
|
80
|
-
this.setState({ mode });
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
render(): JSX.Element {
|
|
84
|
-
return (
|
|
85
|
-
<Dialog
|
|
86
|
-
onClose={() => {}}
|
|
87
|
-
maxWidth="md"
|
|
88
|
-
fullWidth
|
|
89
|
-
sx={{ '& .MuiDialog-paper': styles.dialogPaper }}
|
|
90
|
-
open={!0}
|
|
91
|
-
aria-labelledby="cron-dialog-title"
|
|
92
|
-
>
|
|
93
|
-
<DialogTitle id="cron-dialog-title">{this.props.title || I18n.t('ra_Define schedule...')}</DialogTitle>
|
|
94
|
-
<DialogContent style={{ height: '100%', overflow: 'hidden' }}>
|
|
95
|
-
{(this.props.simple && this.props.complex) || (!this.props.simple && !this.props.complex) ? (
|
|
96
|
-
<div>
|
|
97
|
-
{!this.props.simple && !this.props.complex && !this.props.noWizard && (
|
|
98
|
-
<>
|
|
99
|
-
<Radio
|
|
100
|
-
key="wizard"
|
|
101
|
-
checked={this.state.mode === 'wizard'}
|
|
102
|
-
onChange={() => this.setMode('wizard')}
|
|
103
|
-
/>
|
|
104
|
-
<label
|
|
105
|
-
onClick={() => this.setMode('wizard')}
|
|
106
|
-
style={this.state.mode !== 'wizard' ? { color: 'lightgrey' } : {}}
|
|
107
|
-
>
|
|
108
|
-
{I18n.t('sc_wizard')}
|
|
109
|
-
</label>
|
|
110
|
-
</>
|
|
111
|
-
)}
|
|
112
|
-
|
|
113
|
-
{((!this.props.simple && !this.props.complex) || this.props.simple) && (
|
|
114
|
-
<>
|
|
115
|
-
<Radio
|
|
116
|
-
key="simple"
|
|
117
|
-
checked={this.state.mode === 'simple'}
|
|
118
|
-
onChange={() => this.setMode('simple')}
|
|
119
|
-
/>
|
|
120
|
-
<label
|
|
121
|
-
onClick={() => this.setMode('simple')}
|
|
122
|
-
style={this.state.mode !== 'simple' ? { color: 'lightgrey' } : {}}
|
|
123
|
-
>
|
|
124
|
-
{I18n.t('sc_simple')}
|
|
125
|
-
</label>
|
|
126
|
-
</>
|
|
127
|
-
)}
|
|
128
|
-
|
|
129
|
-
{((!this.props.simple && !this.props.complex) || this.props.complex) && (
|
|
130
|
-
<>
|
|
131
|
-
<Radio
|
|
132
|
-
key="complex"
|
|
133
|
-
checked={this.state.mode === 'complex'}
|
|
134
|
-
onChange={() => this.setMode('complex')}
|
|
135
|
-
/>
|
|
136
|
-
<label
|
|
137
|
-
onClick={() => this.setMode('complex')}
|
|
138
|
-
style={this.state.mode !== 'complex' ? { color: 'lightgrey' } : {}}
|
|
139
|
-
>
|
|
140
|
-
{I18n.t('sc_cron')}
|
|
141
|
-
</label>
|
|
142
|
-
</>
|
|
143
|
-
)}
|
|
144
|
-
</div>
|
|
145
|
-
) : null}
|
|
146
|
-
|
|
147
|
-
{this.state.mode === 'simple' && (
|
|
148
|
-
<SimpleCron
|
|
149
|
-
cronExpression={this.state.cron}
|
|
150
|
-
onChange={cron => this.setState({ cron })}
|
|
151
|
-
language={I18n.getLanguage()}
|
|
152
|
-
/>
|
|
153
|
-
)}
|
|
154
|
-
{this.state.mode === 'wizard' && (
|
|
155
|
-
<Schedule
|
|
156
|
-
theme={this.props.theme}
|
|
157
|
-
schedule={this.state.cron}
|
|
158
|
-
onChange={(cron: string) => this.setState({ cron })}
|
|
159
|
-
/>
|
|
160
|
-
)}
|
|
161
|
-
{this.state.mode === 'complex' && (
|
|
162
|
-
<ComplexCron
|
|
163
|
-
cronExpression={this.state.cron}
|
|
164
|
-
onChange={cron => this.setState({ cron })}
|
|
165
|
-
language={I18n.getLanguage()}
|
|
166
|
-
/>
|
|
167
|
-
)}
|
|
168
|
-
</DialogContent>
|
|
169
|
-
<DialogActions>
|
|
170
|
-
<Button
|
|
171
|
-
variant="contained"
|
|
172
|
-
onClick={() => this.handleOk()}
|
|
173
|
-
color="primary"
|
|
174
|
-
startIcon={<IconOk />}
|
|
175
|
-
>
|
|
176
|
-
{this.props.ok || I18n.t('ra_Ok')}
|
|
177
|
-
</Button>
|
|
178
|
-
<Button
|
|
179
|
-
variant="contained"
|
|
180
|
-
onClick={() => this.handleCancel()}
|
|
181
|
-
color="grey"
|
|
182
|
-
startIcon={<IconCancel />}
|
|
183
|
-
>
|
|
184
|
-
{this.props.cancel || I18n.t('ra_Cancel')}
|
|
185
|
-
</Button>
|
|
186
|
-
</DialogActions>
|
|
187
|
-
</Dialog>
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export default DialogCron;
|
package/src/Dialogs/Error.tsx
DELETED
|
@@ -1,67 +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, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
|
|
11
|
-
|
|
12
|
-
import { Check as IconCheck } from '@mui/icons-material';
|
|
13
|
-
|
|
14
|
-
import I18n from '../i18n';
|
|
15
|
-
|
|
16
|
-
interface DialogErrorProps {
|
|
17
|
-
/* The dialog title; default: Error (translated) */
|
|
18
|
-
title?: string;
|
|
19
|
-
/* The dialog text */
|
|
20
|
-
text: string | React.JSX.Element | React.JSX.Element[];
|
|
21
|
-
/* Close handler. */
|
|
22
|
-
onClose?: () => void;
|
|
23
|
-
/* if the dialog must be fill sized */
|
|
24
|
-
fullWidth?: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
class DialogError extends Component<DialogErrorProps> {
|
|
28
|
-
handleOk(): void {
|
|
29
|
-
if (this.props.onClose) {
|
|
30
|
-
this.props.onClose();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
render(): JSX.Element {
|
|
35
|
-
return (
|
|
36
|
-
<Dialog
|
|
37
|
-
open={!0}
|
|
38
|
-
maxWidth="sm"
|
|
39
|
-
fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}
|
|
40
|
-
onClose={() => this.handleOk()}
|
|
41
|
-
aria-labelledby="alert-dialog-title"
|
|
42
|
-
aria-describedby="alert-dialog-description"
|
|
43
|
-
>
|
|
44
|
-
<DialogTitle id="ar_alert_dialog_title">{this.props.title || I18n.t('ra_Error')}</DialogTitle>
|
|
45
|
-
<DialogContent>
|
|
46
|
-
<DialogContentText id="ar_alert_dialog_description">
|
|
47
|
-
{this.props.text || I18n.t('ra_Unknown error!')}
|
|
48
|
-
</DialogContentText>
|
|
49
|
-
</DialogContent>
|
|
50
|
-
<DialogActions>
|
|
51
|
-
<Button
|
|
52
|
-
id="ar_dialog_error_ok"
|
|
53
|
-
variant="contained"
|
|
54
|
-
onClick={() => this.handleOk()}
|
|
55
|
-
color="primary"
|
|
56
|
-
autoFocus
|
|
57
|
-
startIcon={<IconCheck />}
|
|
58
|
-
>
|
|
59
|
-
{I18n.t('ra_Ok')}
|
|
60
|
-
</Button>
|
|
61
|
-
</DialogActions>
|
|
62
|
-
</Dialog>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export default DialogError;
|
package/src/Dialogs/Message.tsx
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
9
|
-
import React, { Component, type JSX } from 'react';
|
|
10
|
-
|
|
11
|
-
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
|
|
12
|
-
|
|
13
|
-
import { Close as IconClose } from '@mui/icons-material';
|
|
14
|
-
|
|
15
|
-
import I18n from '../i18n';
|
|
16
|
-
|
|
17
|
-
interface DialogMessageProps {
|
|
18
|
-
/* The dialog title; default: Message (translated) */
|
|
19
|
-
title?: string;
|
|
20
|
-
/* The dialog text */
|
|
21
|
-
text: string | React.JSX.Element | React.JSX.Element[];
|
|
22
|
-
/* Close handler. */
|
|
23
|
-
onClose?: () => void;
|
|
24
|
-
/* if the dialog must be fill sized */
|
|
25
|
-
fullWidth?: boolean;
|
|
26
|
-
/* optional icon */
|
|
27
|
-
icon?: React.JSX.Element;
|
|
28
|
-
/* optional ok button text */
|
|
29
|
-
ok?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
class DialogMessage extends Component<DialogMessageProps> {
|
|
33
|
-
handleOk(): void {
|
|
34
|
-
if (this.props.onClose) {
|
|
35
|
-
this.props.onClose();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
render(): JSX.Element {
|
|
40
|
-
return (
|
|
41
|
-
<Dialog
|
|
42
|
-
open={!0}
|
|
43
|
-
maxWidth="sm"
|
|
44
|
-
fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}
|
|
45
|
-
onClose={() => this.handleOk()}
|
|
46
|
-
aria-labelledby="ar_dialog_message_title"
|
|
47
|
-
aria-describedby="ar_dialog_message_description"
|
|
48
|
-
>
|
|
49
|
-
<DialogTitle id="ar_dialog_message_title">{this.props.title || I18n.t('ra_Message')}</DialogTitle>
|
|
50
|
-
<DialogContent>
|
|
51
|
-
<DialogContentText id="ar_dialog_message_description">
|
|
52
|
-
<span style={{ marginRight: this.props.icon ? 8 : 0 }}>{this.props.icon || null}</span>
|
|
53
|
-
{this.props.text}
|
|
54
|
-
</DialogContentText>
|
|
55
|
-
</DialogContent>
|
|
56
|
-
<DialogActions>
|
|
57
|
-
<Button
|
|
58
|
-
id="ar_dialog_message_ok"
|
|
59
|
-
variant="contained"
|
|
60
|
-
onClick={() => this.handleOk()}
|
|
61
|
-
color="primary"
|
|
62
|
-
autoFocus
|
|
63
|
-
startIcon={<IconClose />}
|
|
64
|
-
>
|
|
65
|
-
{this.props.ok || I18n.t('ra_Close')}
|
|
66
|
-
</Button>
|
|
67
|
-
</DialogActions>
|
|
68
|
-
</Dialog>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default DialogMessage;
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2022-2024 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, { 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 '@iobroker/socket-client';
|
|
15
|
-
|
|
16
|
-
import I18n from '../i18n';
|
|
17
|
-
import FileBrowser from '../Components/FileBrowser';
|
|
18
|
-
import type { IobTheme } from '../types';
|
|
19
|
-
|
|
20
|
-
const styles: Record<string, React.CSSProperties> = {
|
|
21
|
-
headerID: {
|
|
22
|
-
fontWeight: 'bold',
|
|
23
|
-
fontStyle: 'italic',
|
|
24
|
-
},
|
|
25
|
-
dialog: {
|
|
26
|
-
height: '95%',
|
|
27
|
-
},
|
|
28
|
-
dialogMobile: {
|
|
29
|
-
// it is sx
|
|
30
|
-
padding: '4px',
|
|
31
|
-
width: '100%',
|
|
32
|
-
maxWidth: '100%',
|
|
33
|
-
maxHeight: 'calc(100% - 16px)',
|
|
34
|
-
height: '100%',
|
|
35
|
-
},
|
|
36
|
-
content: {
|
|
37
|
-
height: '100%',
|
|
38
|
-
overflow: 'hidden',
|
|
39
|
-
},
|
|
40
|
-
contentMobile: {
|
|
41
|
-
padding: '8px 4px',
|
|
42
|
-
},
|
|
43
|
-
titleRoot: {
|
|
44
|
-
whiteSpace: 'nowrap',
|
|
45
|
-
width: 'calc(100% - 72px)',
|
|
46
|
-
overflow: 'hidden',
|
|
47
|
-
display: 'inline-block',
|
|
48
|
-
textOverflow: 'ellipsis',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
interface DialogSelectFileProps {
|
|
53
|
-
/** where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated) */
|
|
54
|
-
dialogName?: string;
|
|
55
|
-
/** The dialog title; default: Please select object ID... (translated) */
|
|
56
|
-
title?: string;
|
|
57
|
-
/** Set to true to allow the selection of multiple IDs. */
|
|
58
|
-
multiSelect?: boolean;
|
|
59
|
-
/** Image prefix. Normally, admin has '../..' and the web has '../' */
|
|
60
|
-
imagePrefix?: string; // Prefix (default: '.')
|
|
61
|
-
/** @deprecated Image prefix */
|
|
62
|
-
prefix?: string;
|
|
63
|
-
/** Show the expert button? */
|
|
64
|
-
showExpertButton?: boolean;
|
|
65
|
-
/** Language */
|
|
66
|
-
lang?: ioBroker.Languages;
|
|
67
|
-
/** Socket class */
|
|
68
|
-
socket: Connection;
|
|
69
|
-
/** Theme name. */
|
|
70
|
-
themeName?: string;
|
|
71
|
-
/** Theme type. */
|
|
72
|
-
themeType?: 'dark' | 'light';
|
|
73
|
-
/** Theme object. */
|
|
74
|
-
theme: IobTheme;
|
|
75
|
-
/** The selected IDs. */
|
|
76
|
-
selected?: string | string[];
|
|
77
|
-
/** The ok button text; default: OK (translated) */
|
|
78
|
-
ok?: string;
|
|
79
|
-
/** The cancel button text; default: Cancel (translated) */
|
|
80
|
-
cancel?: string;
|
|
81
|
-
/** If download of files enabled */
|
|
82
|
-
allowUpload?: boolean;
|
|
83
|
-
/** If download of files enabled */
|
|
84
|
-
allowDownload?: boolean;
|
|
85
|
-
/** If creation of folders enabled */
|
|
86
|
-
allowCreateFolder?: boolean;
|
|
87
|
-
/** If creation of folders enabled */
|
|
88
|
-
allowDelete?: boolean;
|
|
89
|
-
/** if tile view enabled (default true) */
|
|
90
|
-
allowView?: boolean;
|
|
91
|
-
/** Show toolbar (default true) */
|
|
92
|
-
showToolbar?: boolean;
|
|
93
|
-
/** Limit file browser to one specific objectID of type meta and the following path (like vis.0/main) */
|
|
94
|
-
limitPath?: string;
|
|
95
|
-
/** like `['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']` */
|
|
96
|
-
filterFiles?: string[];
|
|
97
|
-
/** images, code, txt, audio, video */
|
|
98
|
-
filterByType?: 'images' | 'code' | 'txt';
|
|
99
|
-
/** allow only folder's selection */
|
|
100
|
-
selectOnlyFolders?: boolean;
|
|
101
|
-
/** Close handler that is always called when the dialog is closed. */
|
|
102
|
-
onClose: () => void;
|
|
103
|
-
/** Handler that is called when the user presses OK or by double click. */
|
|
104
|
-
onOk: (selected: string | string[] | undefined) => void;
|
|
105
|
-
/** The styling class names. */
|
|
106
|
-
filters?: Record<string, string>;
|
|
107
|
-
/** Allow switch views Table<=>Rows */
|
|
108
|
-
showViewTypeButton?: boolean;
|
|
109
|
-
/** If type selector should be shown */
|
|
110
|
-
showTypeSelector?: boolean;
|
|
111
|
-
/** If defined, allow selecting only files from this folder */
|
|
112
|
-
restrictToFolder?: string;
|
|
113
|
-
/** If restrictToFolder defined, allow selecting files outside of this folder */
|
|
114
|
-
allowNonRestricted?: boolean;
|
|
115
|
-
/** force expert mode */
|
|
116
|
-
expertMode?: boolean;
|
|
117
|
-
/** Translate function - optional */
|
|
118
|
-
t?: (text: string, ...args: any[]) => string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
interface DialogSelectFileState {
|
|
122
|
-
selected: string[];
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
class DialogSelectFile extends React.Component<DialogSelectFileProps, DialogSelectFileState> {
|
|
126
|
-
private readonly dialogName: string;
|
|
127
|
-
|
|
128
|
-
private readonly filters: Record<string, string>;
|
|
129
|
-
|
|
130
|
-
constructor(props: DialogSelectFileProps) {
|
|
131
|
-
super(props);
|
|
132
|
-
this.dialogName = this.props.dialogName || 'default';
|
|
133
|
-
this.dialogName = `SelectFile.${this.dialogName}`;
|
|
134
|
-
|
|
135
|
-
const filters: string = ((window as any)._localStorage || window.localStorage).getItem(this.dialogName) || '{}';
|
|
136
|
-
|
|
137
|
-
try {
|
|
138
|
-
this.filters = JSON.parse(filters);
|
|
139
|
-
} catch {
|
|
140
|
-
this.filters = {};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (props.filters) {
|
|
144
|
-
this.filters = { ...this.filters, ...props.filters };
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
let selected = this.props.selected || [];
|
|
148
|
-
if (typeof selected !== 'object') {
|
|
149
|
-
selected = [selected];
|
|
150
|
-
} else {
|
|
151
|
-
selected = [...selected];
|
|
152
|
-
}
|
|
153
|
-
selected = selected.filter(id => id);
|
|
154
|
-
|
|
155
|
-
this.state = {
|
|
156
|
-
selected,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
handleCancel(): void {
|
|
161
|
-
this.props.onClose();
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
handleOk(): void {
|
|
165
|
-
this.props.onOk(
|
|
166
|
-
this.props.multiSelect || !Array.isArray(this.state.selected)
|
|
167
|
-
? this.state.selected
|
|
168
|
-
: this.state.selected[0] || '',
|
|
169
|
-
);
|
|
170
|
-
this.props.onClose();
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
render(): JSX.Element {
|
|
174
|
-
let title;
|
|
175
|
-
if (this.state.selected.length) {
|
|
176
|
-
if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {
|
|
177
|
-
title = [
|
|
178
|
-
<span key="selected">
|
|
179
|
-
{I18n.t('ra_Selected')}
|
|
180
|
-
|
|
181
|
-
</span>,
|
|
182
|
-
<span
|
|
183
|
-
key="id"
|
|
184
|
-
style={styles.headerID}
|
|
185
|
-
>
|
|
186
|
-
{this.state.selected}
|
|
187
|
-
</span>,
|
|
188
|
-
];
|
|
189
|
-
} else {
|
|
190
|
-
title = [
|
|
191
|
-
<span key="selected">
|
|
192
|
-
{I18n.t('ra_Selected')}
|
|
193
|
-
|
|
194
|
-
</span>,
|
|
195
|
-
<span
|
|
196
|
-
key="id"
|
|
197
|
-
style={styles.headerID}
|
|
198
|
-
>
|
|
199
|
-
{I18n.t('%s items', this.state.selected.length)}
|
|
200
|
-
</span>,
|
|
201
|
-
];
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
title = this.props.title || I18n.t('ra_Please select file...');
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return (
|
|
208
|
-
<Dialog
|
|
209
|
-
onClose={() => {}}
|
|
210
|
-
maxWidth={false}
|
|
211
|
-
sx={{ '& .MuiDialog-paper': { ...styles.dialog, ...styles.dialogMobile } }}
|
|
212
|
-
fullWidth
|
|
213
|
-
open={!0}
|
|
214
|
-
aria-labelledby="ar_dialog_selectfile_title"
|
|
215
|
-
>
|
|
216
|
-
<DialogTitle
|
|
217
|
-
id="ar_dialog_selectfile_title"
|
|
218
|
-
sx={{ '&.MuiDialogTitle-root': styles.titleRoot }}
|
|
219
|
-
>
|
|
220
|
-
{title}
|
|
221
|
-
</DialogTitle>
|
|
222
|
-
<DialogContent style={{ ...styles.content, ...styles.contentMobile }}>
|
|
223
|
-
<FileBrowser
|
|
224
|
-
ready
|
|
225
|
-
imagePrefix={this.props.imagePrefix || this.props.prefix || '../'} // prefix is for back compatibility
|
|
226
|
-
allowUpload={!!this.props.allowUpload}
|
|
227
|
-
allowDownload={this.props.allowDownload !== false}
|
|
228
|
-
allowCreateFolder={!!this.props.allowCreateFolder}
|
|
229
|
-
allowDelete={!!this.props.allowDelete}
|
|
230
|
-
allowView={this.props.allowView !== false}
|
|
231
|
-
showViewTypeButton={this.props.showViewTypeButton !== false}
|
|
232
|
-
showToolbar={this.props.showToolbar !== false}
|
|
233
|
-
limitPath={this.props.limitPath}
|
|
234
|
-
filterFiles={this.props.filterFiles}
|
|
235
|
-
filterByType={this.props.filterByType}
|
|
236
|
-
selected={this.props.selected}
|
|
237
|
-
restrictToFolder={this.props.restrictToFolder}
|
|
238
|
-
allowNonRestricted={this.props.allowNonRestricted}
|
|
239
|
-
onSelect={(selected: string | string[], isDoubleClick?: boolean, isFolder?: boolean) => {
|
|
240
|
-
this.setState(
|
|
241
|
-
{ selected: Array.isArray(selected) ? selected : [selected] },
|
|
242
|
-
() => isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk(),
|
|
243
|
-
);
|
|
244
|
-
}}
|
|
245
|
-
t={this.props.t || I18n.t}
|
|
246
|
-
lang={this.props.lang || I18n.getLanguage()}
|
|
247
|
-
socket={this.props.socket}
|
|
248
|
-
themeType={this.props.themeType}
|
|
249
|
-
themeName={this.props.themeName}
|
|
250
|
-
theme={this.props.theme}
|
|
251
|
-
showExpertButton={this.props.showExpertButton}
|
|
252
|
-
expertMode={this.props.expertMode}
|
|
253
|
-
showTypeSelector={this.props.showTypeSelector}
|
|
254
|
-
/>
|
|
255
|
-
</DialogContent>
|
|
256
|
-
<DialogActions>
|
|
257
|
-
<Button
|
|
258
|
-
variant="contained"
|
|
259
|
-
onClick={() => this.handleOk()}
|
|
260
|
-
startIcon={<IconOk />}
|
|
261
|
-
disabled={!this.state.selected.length}
|
|
262
|
-
color="primary"
|
|
263
|
-
>
|
|
264
|
-
{this.props.ok || I18n.t('ra_Ok')}
|
|
265
|
-
</Button>
|
|
266
|
-
<Button
|
|
267
|
-
color="grey"
|
|
268
|
-
variant="contained"
|
|
269
|
-
onClick={() => this.handleCancel()}
|
|
270
|
-
startIcon={<IconCancel />}
|
|
271
|
-
>
|
|
272
|
-
{this.props.cancel || I18n.t('ra_Cancel')}
|
|
273
|
-
</Button>
|
|
274
|
-
</DialogActions>
|
|
275
|
-
</Dialog>
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export default DialogSelectFile;
|