@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
|
@@ -19,11 +19,11 @@ interface DialogCronState {
|
|
|
19
19
|
cron: string;
|
|
20
20
|
mode: 'simple' | 'complex' | 'wizard';
|
|
21
21
|
}
|
|
22
|
-
declare class DialogCron extends React.Component<DialogCronProps, DialogCronState> {
|
|
22
|
+
export declare class DialogCron extends React.Component<DialogCronProps, DialogCronState> {
|
|
23
23
|
constructor(props: DialogCronProps);
|
|
24
24
|
handleCancel(): void;
|
|
25
25
|
handleOk(): void;
|
|
26
26
|
setMode(mode: 'simple' | 'complex' | 'wizard'): void;
|
|
27
27
|
render(): JSX.Element;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, DialogTitle, DialogContent, DialogActions, Dialog, Radio } from '@mui/material';
|
|
3
|
+
import { Check as IconOk, Cancel as IconCancel } from '@mui/icons-material';
|
|
4
|
+
import { ComplexCron } from '../Components/ComplexCron';
|
|
5
|
+
import { SimpleCron, cron2state } from '../Components/SimpleCron';
|
|
6
|
+
import { Schedule } from '../Components/Schedule';
|
|
7
|
+
import { I18n } from '../i18n';
|
|
8
|
+
// Generate cron expression
|
|
9
|
+
const styles = {
|
|
10
|
+
dialogPaper: {
|
|
11
|
+
height: 'calc(100% - 96px)',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export class DialogCron extends React.Component {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super(props);
|
|
17
|
+
let cron;
|
|
18
|
+
if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^["']/, '')[0] !== '{') {
|
|
19
|
+
cron = this.props.cron.replace(/['"]/g, '').trim();
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
cron = this.props.cron || '{}';
|
|
23
|
+
if (typeof cron === 'string') {
|
|
24
|
+
cron = cron.replace(/^["']/, '').replace(/["']\n?$/, '');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
this.state = {
|
|
28
|
+
cron,
|
|
29
|
+
mode: this.props.simple
|
|
30
|
+
? 'simple'
|
|
31
|
+
: this.props.complex
|
|
32
|
+
? 'complex'
|
|
33
|
+
: (typeof cron === 'object' || cron[0] === '{') && !this.props.noWizard
|
|
34
|
+
? 'wizard'
|
|
35
|
+
: cron2state(this.props.cron || '* * * * *')
|
|
36
|
+
? 'simple'
|
|
37
|
+
: 'complex',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
handleCancel() {
|
|
41
|
+
this.props.onClose();
|
|
42
|
+
}
|
|
43
|
+
handleOk() {
|
|
44
|
+
this.props.onOk(this.state.cron);
|
|
45
|
+
this.props.onClose();
|
|
46
|
+
}
|
|
47
|
+
setMode(mode) {
|
|
48
|
+
this.setState({ mode });
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return (React.createElement(Dialog, { onClose: () => { }, maxWidth: "md", fullWidth: true, sx: { '& .MuiDialog-paper': styles.dialogPaper }, open: !0, "aria-labelledby": "cron-dialog-title" },
|
|
52
|
+
React.createElement(DialogTitle, { id: "cron-dialog-title" }, this.props.title || I18n.t('ra_Define schedule...')),
|
|
53
|
+
React.createElement(DialogContent, { style: { height: '100%', overflow: 'hidden' } },
|
|
54
|
+
(this.props.simple && this.props.complex) || (!this.props.simple && !this.props.complex) ? (React.createElement("div", null,
|
|
55
|
+
!this.props.simple && !this.props.complex && !this.props.noWizard && (React.createElement(React.Fragment, null,
|
|
56
|
+
React.createElement(Radio, { key: "wizard", checked: this.state.mode === 'wizard', onChange: () => this.setMode('wizard') }),
|
|
57
|
+
React.createElement("label", { onClick: () => this.setMode('wizard'), style: this.state.mode !== 'wizard' ? { color: 'lightgrey' } : {} }, I18n.t('sc_wizard')))),
|
|
58
|
+
((!this.props.simple && !this.props.complex) || this.props.simple) && (React.createElement(React.Fragment, null,
|
|
59
|
+
React.createElement(Radio, { key: "simple", checked: this.state.mode === 'simple', onChange: () => this.setMode('simple') }),
|
|
60
|
+
React.createElement("label", { onClick: () => this.setMode('simple'), style: this.state.mode !== 'simple' ? { color: 'lightgrey' } : {} }, I18n.t('sc_simple')))),
|
|
61
|
+
((!this.props.simple && !this.props.complex) || this.props.complex) && (React.createElement(React.Fragment, null,
|
|
62
|
+
React.createElement(Radio, { key: "complex", checked: this.state.mode === 'complex', onChange: () => this.setMode('complex') }),
|
|
63
|
+
React.createElement("label", { onClick: () => this.setMode('complex'), style: this.state.mode !== 'complex' ? { color: 'lightgrey' } : {} }, I18n.t('sc_cron')))))) : null,
|
|
64
|
+
this.state.mode === 'simple' && (React.createElement(SimpleCron, { cronExpression: this.state.cron, onChange: cron => this.setState({ cron }), language: I18n.getLanguage() })),
|
|
65
|
+
this.state.mode === 'wizard' && (React.createElement(Schedule, { theme: this.props.theme, schedule: this.state.cron, onChange: (cron) => this.setState({ cron }) })),
|
|
66
|
+
this.state.mode === 'complex' && (React.createElement(ComplexCron, { cronExpression: this.state.cron, onChange: cron => this.setState({ cron }), language: I18n.getLanguage() }))),
|
|
67
|
+
React.createElement(DialogActions, null,
|
|
68
|
+
React.createElement(Button, { variant: "contained", onClick: () => this.handleOk(), color: "primary", startIcon: React.createElement(IconOk, null) }, this.props.ok || I18n.t('ra_Ok')),
|
|
69
|
+
React.createElement(Button, { variant: "contained", onClick: () => this.handleCancel(), color: "grey", startIcon: React.createElement(IconCancel, null) }, this.props.cancel || I18n.t('ra_Cancel')))));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=Cron.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cron.js","sourceRoot":"./src/","sources":["Dialogs/Cron.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjG,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,2BAA2B;AAE3B,MAAM,MAAM,GAAwC;IAChD,WAAW,EAAE;QACT,MAAM,EAAE,mBAAmB;KAC9B;CACJ,CAAC;AAuBF,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,SAA2C;IAC7E,YAAY,KAAs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GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAC9B,KAAK,EAAC,SAAS,EACf,SAAS,EAAE,oBAAC,MAAM,OAAG,IAEpB,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAC5B;gBACT,oBAAC,MAAM,IACH,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAClC,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE,oBAAC,UAAU,OAAG,IAExB,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CACpC,CACG,CACX,CACZ,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Button, DialogTitle, DialogContent, DialogActions, Dialog, Radio } from '@mui/material';\n\nimport { Check as IconOk, Cancel as IconCancel } from '@mui/icons-material';\n\nimport { ComplexCron } from '../Components/ComplexCron';\nimport { SimpleCron, cron2state } from '../Components/SimpleCron';\nimport { Schedule } from '../Components/Schedule';\n\nimport { I18n } from '../i18n';\nimport type { IobTheme } from '../types';\n\n// Generate cron expression\n\nconst styles: Record<string, React.CSSProperties> = {\n dialogPaper: {\n height: 'calc(100% - 96px)',\n },\n};\n\ninterface DialogCronProps {\n onClose: () => void;\n onOk: (cron: string) => void;\n title?: string;\n cron?: string;\n cancel?: string;\n ok?: string;\n /** show only simple configuration */\n simple?: boolean;\n /** show only complex configuration */\n complex?: boolean;\n /** do not show wizard */\n noWizard?: boolean;\n theme: IobTheme;\n}\n\ninterface DialogCronState {\n cron: string;\n mode: 'simple' | 'complex' | 'wizard';\n}\n\nexport class DialogCron extends React.Component<DialogCronProps, DialogCronState> {\n constructor(props: DialogCronProps) {\n super(props);\n let cron;\n if (this.props.cron && typeof this.props.cron === 'string' && this.props.cron.replace(/^[\"']/, '')[0] !== '{') {\n cron = this.props.cron.replace(/['\"]/g, '').trim();\n } else {\n cron = this.props.cron || '{}';\n if (typeof cron === 'string') {\n cron = cron.replace(/^[\"']/, '').replace(/[\"']\\n?$/, '');\n }\n }\n\n this.state = {\n cron,\n mode: this.props.simple\n ? 'simple'\n : this.props.complex\n ? 'complex'\n : (typeof cron === 'object' || cron[0] === '{') && !this.props.noWizard\n ? 'wizard'\n : cron2state(this.props.cron || '* * * * *')\n ? 'simple'\n : 'complex',\n };\n }\n\n handleCancel(): void {\n this.props.onClose();\n }\n\n handleOk(): void {\n this.props.onOk(this.state.cron);\n this.props.onClose();\n }\n\n setMode(mode: 'simple' | 'complex' | 'wizard'): void {\n this.setState({ mode });\n }\n\n render(): JSX.Element {\n return (\n <Dialog\n onClose={() => {}}\n maxWidth=\"md\"\n fullWidth\n sx={{ '& .MuiDialog-paper': styles.dialogPaper }}\n open={!0}\n aria-labelledby=\"cron-dialog-title\"\n >\n <DialogTitle id=\"cron-dialog-title\">{this.props.title || I18n.t('ra_Define schedule...')}</DialogTitle>\n <DialogContent style={{ height: '100%', overflow: 'hidden' }}>\n {(this.props.simple && this.props.complex) || (!this.props.simple && !this.props.complex) ? (\n <div>\n {!this.props.simple && !this.props.complex && !this.props.noWizard && (\n <>\n <Radio\n key=\"wizard\"\n checked={this.state.mode === 'wizard'}\n onChange={() => this.setMode('wizard')}\n />\n <label\n onClick={() => this.setMode('wizard')}\n style={this.state.mode !== 'wizard' ? { color: 'lightgrey' } : {}}\n >\n {I18n.t('sc_wizard')}\n </label>\n </>\n )}\n\n {((!this.props.simple && !this.props.complex) || this.props.simple) && (\n <>\n <Radio\n key=\"simple\"\n checked={this.state.mode === 'simple'}\n onChange={() => this.setMode('simple')}\n />\n <label\n onClick={() => this.setMode('simple')}\n style={this.state.mode !== 'simple' ? { color: 'lightgrey' } : {}}\n >\n {I18n.t('sc_simple')}\n </label>\n </>\n )}\n\n {((!this.props.simple && !this.props.complex) || this.props.complex) && (\n <>\n <Radio\n key=\"complex\"\n checked={this.state.mode === 'complex'}\n onChange={() => this.setMode('complex')}\n />\n <label\n onClick={() => this.setMode('complex')}\n style={this.state.mode !== 'complex' ? { color: 'lightgrey' } : {}}\n >\n {I18n.t('sc_cron')}\n </label>\n </>\n )}\n </div>\n ) : null}\n\n {this.state.mode === 'simple' && (\n <SimpleCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({ cron })}\n language={I18n.getLanguage()}\n />\n )}\n {this.state.mode === 'wizard' && (\n <Schedule\n theme={this.props.theme}\n schedule={this.state.cron}\n onChange={(cron: string) => this.setState({ cron })}\n />\n )}\n {this.state.mode === 'complex' && (\n <ComplexCron\n cronExpression={this.state.cron}\n onChange={cron => this.setState({ cron })}\n language={I18n.getLanguage()}\n />\n )}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n onClick={() => this.handleOk()}\n color=\"primary\"\n startIcon={<IconOk />}\n >\n {this.props.ok || I18n.t('ra_Ok')}\n </Button>\n <Button\n variant=\"contained\"\n onClick={() => this.handleCancel()}\n color=\"grey\"\n startIcon={<IconCancel />}\n >\n {this.props.cancel || I18n.t('ra_Cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n}\n"]}
|
|
@@ -11,8 +11,8 @@ interface DialogErrorProps {
|
|
|
11
11
|
onClose?: () => void;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare class DialogError extends Component<DialogErrorProps> {
|
|
14
|
+
export declare class DialogError extends Component<DialogErrorProps> {
|
|
15
15
|
handleOk(): void;
|
|
16
16
|
render(): JSX.Element;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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 } from 'react';
|
|
9
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
|
|
10
|
+
import { Check as IconCheck } from '@mui/icons-material';
|
|
11
|
+
import { I18n } from '../i18n';
|
|
12
|
+
export class DialogError extends Component {
|
|
13
|
+
handleOk() {
|
|
14
|
+
if (this.props.onClose) {
|
|
15
|
+
this.props.onClose();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (React.createElement(Dialog, { open: !0, maxWidth: "sm", fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true, onClose: () => this.handleOk(), "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" },
|
|
20
|
+
React.createElement(DialogTitle, { id: "ar_alert_dialog_title" }, this.props.title || I18n.t('ra_Error')),
|
|
21
|
+
React.createElement(DialogContent, null,
|
|
22
|
+
React.createElement(DialogContentText, { id: "ar_alert_dialog_description" }, this.props.text || I18n.t('ra_Unknown error!'))),
|
|
23
|
+
React.createElement(DialogActions, null,
|
|
24
|
+
React.createElement(Button, { id: "ar_dialog_error_ok", variant: "contained", onClick: () => this.handleOk(), color: "primary", autoFocus: true, startIcon: React.createElement(IconCheck, null) }, I18n.t('ra_Ok')))));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=Error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Error.js","sourceRoot":"./src/","sources":["Dialogs/Error.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,uHAAuH;AACvH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE7G,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAa/B,MAAM,OAAO,WAAY,SAAQ,SAA2B;IACxD,QAAQ;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC;IACL,CAAC;IAED,MAAM;QACF,OAAO,CACH,oBAAC,MAAM,IACH,IAAI,EAAE,CAAC,CAAC,EACR,QAAQ,EAAC,IAAI,EACb,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAC3E,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,qBACd,oBAAoB,sBACnB,0BAA0B;YAE3C,oBAAC,WAAW,IAAC,EAAE,EAAC,uBAAuB,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAe;YAC9F,oBAAC,aAAa;gBACV,oBAAC,iBAAiB,IAAC,EAAE,EAAC,6BAA6B,IAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAC/B,CACR;YAChB,oBAAC,aAAa;gBACV,oBAAC,MAAM,IACH,EAAE,EAAC,oBAAoB,EACvB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAC9B,KAAK,EAAC,SAAS,EACf,SAAS,QACT,SAAS,EAAE,oBAAC,SAAS,OAAG,IAEvB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CACX,CACG,CACX,CACZ,CAAC;IACN,CAAC;CACJ","sourcesContent":["/**\n * Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n */\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React, { Component, type JSX } from 'react';\n\nimport { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';\n\nimport { Check as IconCheck } from '@mui/icons-material';\n\nimport { I18n } from '../i18n';\n\ninterface DialogErrorProps {\n /* The dialog title; default: Error (translated) */\n title?: string;\n /* The dialog text */\n text: string | React.JSX.Element | React.JSX.Element[];\n /* Close handler. */\n onClose?: () => void;\n /* if the dialog must be fill sized */\n fullWidth?: boolean;\n}\n\nexport class DialogError extends Component<DialogErrorProps> {\n handleOk(): void {\n if (this.props.onClose) {\n this.props.onClose();\n }\n }\n\n render(): JSX.Element {\n return (\n <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"alert-dialog-title\"\n aria-describedby=\"alert-dialog-description\"\n >\n <DialogTitle id=\"ar_alert_dialog_title\">{this.props.title || I18n.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"ar_alert_dialog_description\">\n {this.props.text || I18n.t('ra_Unknown error!')}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n id=\"ar_dialog_error_ok\"\n variant=\"contained\"\n onClick={() => this.handleOk()}\n color=\"primary\"\n autoFocus\n startIcon={<IconCheck />}\n >\n {I18n.t('ra_Ok')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n}\n"]}
|
|
@@ -13,8 +13,8 @@ interface DialogMessageProps {
|
|
|
13
13
|
icon?: React.JSX.Element;
|
|
14
14
|
ok?: string;
|
|
15
15
|
}
|
|
16
|
-
declare class DialogMessage extends Component<DialogMessageProps> {
|
|
16
|
+
export declare class DialogMessage extends Component<DialogMessageProps> {
|
|
17
17
|
handleOk(): void;
|
|
18
18
|
render(): JSX.Element;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
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 } from 'react';
|
|
9
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
|
|
10
|
+
import { Close as IconClose } from '@mui/icons-material';
|
|
11
|
+
import { I18n } from '../i18n';
|
|
12
|
+
export class DialogMessage extends Component {
|
|
13
|
+
handleOk() {
|
|
14
|
+
if (this.props.onClose) {
|
|
15
|
+
this.props.onClose();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (React.createElement(Dialog, { open: !0, maxWidth: "sm", fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true, onClose: () => this.handleOk(), "aria-labelledby": "ar_dialog_message_title", "aria-describedby": "ar_dialog_message_description" },
|
|
20
|
+
React.createElement(DialogTitle, { id: "ar_dialog_message_title" }, this.props.title || I18n.t('ra_Message')),
|
|
21
|
+
React.createElement(DialogContent, null,
|
|
22
|
+
React.createElement(DialogContentText, { id: "ar_dialog_message_description" },
|
|
23
|
+
React.createElement("span", { style: { marginRight: this.props.icon ? 8 : 0 } }, this.props.icon || null),
|
|
24
|
+
this.props.text)),
|
|
25
|
+
React.createElement(DialogActions, null,
|
|
26
|
+
React.createElement(Button, { id: "ar_dialog_message_ok", variant: "contained", onClick: () => this.handleOk(), color: "primary", autoFocus: true, startIcon: React.createElement(IconClose, null) }, this.props.ok || I18n.t('ra_Close')))));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.js","sourceRoot":"./src/","sources":["Dialogs/Message.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uHAAu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;gBACV,oBAAC,MAAM,IACH,EAAE,EAAC,sBAAsB,EACzB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAC9B,KAAK,EAAC,SAAS,EACf,SAAS,QACT,SAAS,EAAE,oBAAC,SAAS,OAAG,IAEvB,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAC/B,CACG,CACX,CACZ,CAAC;IACN,CAAC;CACJ","sourcesContent":["/**\n * Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n */\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React, { Component, type JSX } from 'react';\n\nimport { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';\n\nimport { Close as IconClose } from '@mui/icons-material';\n\nimport { I18n } from '../i18n';\n\ninterface DialogMessageProps {\n /* The dialog title; default: Message (translated) */\n title?: string;\n /* The dialog text */\n text: string | React.JSX.Element | React.JSX.Element[];\n /* Close handler. */\n onClose?: () => void;\n /* if the dialog must be fill sized */\n fullWidth?: boolean;\n /* optional icon */\n icon?: React.JSX.Element;\n /* optional ok button text */\n ok?: string;\n}\n\nexport class DialogMessage extends Component<DialogMessageProps> {\n handleOk(): void {\n if (this.props.onClose) {\n this.props.onClose();\n }\n }\n\n render(): JSX.Element {\n return (\n <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"ar_dialog_message_title\"\n aria-describedby=\"ar_dialog_message_description\"\n >\n <DialogTitle id=\"ar_dialog_message_title\">{this.props.title || I18n.t('ra_Message')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"ar_dialog_message_description\">\n <span style={{ marginRight: this.props.icon ? 8 : 0 }}>{this.props.icon || null}</span>\n {this.props.text}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n id=\"ar_dialog_message_ok\"\n variant=\"contained\"\n onClick={() => this.handleOk()}\n color=\"primary\"\n autoFocus\n startIcon={<IconClose />}\n >\n {this.props.ok || I18n.t('ra_Close')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n}\n"]}
|
|
@@ -72,7 +72,7 @@ interface DialogSelectFileProps {
|
|
|
72
72
|
interface DialogSelectFileState {
|
|
73
73
|
selected: string[];
|
|
74
74
|
}
|
|
75
|
-
declare class DialogSelectFile extends React.Component<DialogSelectFileProps, DialogSelectFileState> {
|
|
75
|
+
export declare class DialogSelectFile extends React.Component<DialogSelectFileProps, DialogSelectFileState> {
|
|
76
76
|
private readonly dialogName;
|
|
77
77
|
private readonly filters;
|
|
78
78
|
constructor(props: DialogSelectFileProps);
|
|
@@ -80,4 +80,4 @@ declare class DialogSelectFile extends React.Component<DialogSelectFileProps, Di
|
|
|
80
80
|
handleOk(): void;
|
|
81
81
|
render(): JSX.Element;
|
|
82
82
|
}
|
|
83
|
-
export
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
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 from 'react';
|
|
9
|
+
import { Button, DialogTitle, DialogContent, DialogActions, Dialog } from '@mui/material';
|
|
10
|
+
import { Cancel as IconCancel, Check as IconOk } from '@mui/icons-material';
|
|
11
|
+
import { I18n } from '../i18n';
|
|
12
|
+
import { FileBrowser } from '../Components/FileBrowser';
|
|
13
|
+
const styles = {
|
|
14
|
+
headerID: {
|
|
15
|
+
fontWeight: 'bold',
|
|
16
|
+
fontStyle: 'italic',
|
|
17
|
+
},
|
|
18
|
+
dialog: {
|
|
19
|
+
height: '95%',
|
|
20
|
+
},
|
|
21
|
+
dialogMobile: {
|
|
22
|
+
// it is sx
|
|
23
|
+
padding: '4px',
|
|
24
|
+
width: '100%',
|
|
25
|
+
maxWidth: '100%',
|
|
26
|
+
maxHeight: 'calc(100% - 16px)',
|
|
27
|
+
height: '100%',
|
|
28
|
+
},
|
|
29
|
+
content: {
|
|
30
|
+
height: '100%',
|
|
31
|
+
overflow: 'hidden',
|
|
32
|
+
},
|
|
33
|
+
contentMobile: {
|
|
34
|
+
padding: '8px 4px',
|
|
35
|
+
},
|
|
36
|
+
titleRoot: {
|
|
37
|
+
whiteSpace: 'nowrap',
|
|
38
|
+
width: 'calc(100% - 72px)',
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
display: 'inline-block',
|
|
41
|
+
textOverflow: 'ellipsis',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export class DialogSelectFile extends React.Component {
|
|
45
|
+
dialogName;
|
|
46
|
+
filters;
|
|
47
|
+
constructor(props) {
|
|
48
|
+
super(props);
|
|
49
|
+
this.dialogName = this.props.dialogName || 'default';
|
|
50
|
+
this.dialogName = `SelectFile.${this.dialogName}`;
|
|
51
|
+
const filters = (window._localStorage || window.localStorage).getItem(this.dialogName) || '{}';
|
|
52
|
+
try {
|
|
53
|
+
this.filters = JSON.parse(filters);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
this.filters = {};
|
|
57
|
+
}
|
|
58
|
+
if (props.filters) {
|
|
59
|
+
this.filters = { ...this.filters, ...props.filters };
|
|
60
|
+
}
|
|
61
|
+
let selected = this.props.selected || [];
|
|
62
|
+
if (typeof selected !== 'object') {
|
|
63
|
+
selected = [selected];
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
selected = [...selected];
|
|
67
|
+
}
|
|
68
|
+
selected = selected.filter(id => id);
|
|
69
|
+
this.state = {
|
|
70
|
+
selected,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
handleCancel() {
|
|
74
|
+
this.props.onClose();
|
|
75
|
+
}
|
|
76
|
+
handleOk() {
|
|
77
|
+
this.props.onOk(this.props.multiSelect || !Array.isArray(this.state.selected)
|
|
78
|
+
? this.state.selected
|
|
79
|
+
: this.state.selected[0] || '');
|
|
80
|
+
this.props.onClose();
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
let title;
|
|
84
|
+
if (this.state.selected.length) {
|
|
85
|
+
if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {
|
|
86
|
+
title = [
|
|
87
|
+
React.createElement("span", { key: "selected" },
|
|
88
|
+
I18n.t('ra_Selected'),
|
|
89
|
+
"\u00A0"),
|
|
90
|
+
React.createElement("span", { key: "id", style: styles.headerID }, this.state.selected),
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
title = [
|
|
95
|
+
React.createElement("span", { key: "selected" },
|
|
96
|
+
I18n.t('ra_Selected'),
|
|
97
|
+
"\u00A0"),
|
|
98
|
+
React.createElement("span", { key: "id", style: styles.headerID }, I18n.t('%s items', this.state.selected.length)),
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
title = this.props.title || I18n.t('ra_Please select file...');
|
|
104
|
+
}
|
|
105
|
+
return (React.createElement(Dialog, { onClose: () => { }, maxWidth: false, sx: { '& .MuiDialog-paper': { ...styles.dialog, ...styles.dialogMobile } }, fullWidth: true, open: !0, "aria-labelledby": "ar_dialog_selectfile_title" },
|
|
106
|
+
React.createElement(DialogTitle, { id: "ar_dialog_selectfile_title", sx: { '&.MuiDialogTitle-root': styles.titleRoot } }, title),
|
|
107
|
+
React.createElement(DialogContent, { style: { ...styles.content, ...styles.contentMobile } },
|
|
108
|
+
React.createElement(FileBrowser, { ready: true, imagePrefix: this.props.imagePrefix || this.props.prefix || '../', allowUpload: !!this.props.allowUpload, allowDownload: this.props.allowDownload !== false, allowCreateFolder: !!this.props.allowCreateFolder, allowDelete: !!this.props.allowDelete, allowView: this.props.allowView !== false, showViewTypeButton: this.props.showViewTypeButton !== false, showToolbar: this.props.showToolbar !== false, limitPath: this.props.limitPath, filterFiles: this.props.filterFiles, filterByType: this.props.filterByType, selected: this.props.selected, restrictToFolder: this.props.restrictToFolder, allowNonRestricted: this.props.allowNonRestricted, onSelect: (selected, isDoubleClick, isFolder) => {
|
|
109
|
+
this.setState({ selected: Array.isArray(selected) ? selected : [selected] }, () => isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk());
|
|
110
|
+
}, t: this.props.t || I18n.t, lang: this.props.lang || I18n.getLanguage(), socket: this.props.socket, themeType: this.props.themeType, themeName: this.props.themeName, theme: this.props.theme, showExpertButton: this.props.showExpertButton, expertMode: this.props.expertMode, showTypeSelector: this.props.showTypeSelector })),
|
|
111
|
+
React.createElement(DialogActions, null,
|
|
112
|
+
React.createElement(Button, { variant: "contained", onClick: () => this.handleOk(), startIcon: React.createElement(IconOk, null), disabled: !this.state.selected.length, color: "primary" }, this.props.ok || I18n.t('ra_Ok')),
|
|
113
|
+
React.createElement(Button, { color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: React.createElement(IconCancel, null) }, this.props.cancel || I18n.t('ra_Cancel')))));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=SelectFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectFile.js","sourceRoot":"./src/","sources":["Dialogs/SelectFile.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,uHAAuH;AACvH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI5E,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA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AC,CAAC,IAAI,IAAI,CAAC,CAAC,EACzB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,EAC3C,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAC7C,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAC/C,CACU;YAChB,oBAAC,aAAa;gBACV,oBAAC,MAAM,IACH,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAC9B,SAAS,EAAE,oBAAC,MAAM,OAAG,EACrB,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EACrC,KAAK,EAAC,SAAS,IAEd,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAC5B;gBACT,oBAAC,MAAM,IACH,KAAK,EAAC,MAAM,EACZ,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAClC,SAAS,EAAE,oBAAC,UAAU,OAAG,IAExB,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CACpC,CACG,CACX,CACZ,CAAC;IACN,CAAC;CACJ","sourcesContent":["/*\n * Copyright 2022-2024 Denis Haev (bluefox) <dogafox@gmail.com>\n *\n * MIT License\n *\n */\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React, { type JSX } from 'react';\n\nimport { Button, DialogTitle, DialogContent, DialogActions, Dialog } from '@mui/material';\n\nimport { Cancel as IconCancel, Check as IconOk } from '@mui/icons-material';\n\nimport type { Connection } from '@iobroker/socket-client';\n\nimport { I18n } from '../i18n';\nimport { FileBrowser } from '../Components/FileBrowser';\nimport type { IobTheme } from '../types';\n\nconst styles: Record<string, React.CSSProperties> = {\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic',\n },\n dialog: {\n height: '95%',\n },\n dialogMobile: {\n // it is sx\n padding: '4px',\n width: '100%',\n maxWidth: '100%',\n maxHeight: 'calc(100% - 16px)',\n height: '100%',\n },\n content: {\n height: '100%',\n overflow: 'hidden',\n },\n contentMobile: {\n padding: '8px 4px',\n },\n titleRoot: {\n whiteSpace: 'nowrap',\n width: 'calc(100% - 72px)',\n overflow: 'hidden',\n display: 'inline-block',\n textOverflow: 'ellipsis',\n },\n};\n\ninterface DialogSelectFileProps {\n /** where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated) */\n dialogName?: string;\n /** The dialog title; default: Please select object ID... (translated) */\n title?: string;\n /** Set to true to allow the selection of multiple IDs. */\n multiSelect?: boolean;\n /** Image prefix. Normally, admin has '../..' and the web has '../' */\n imagePrefix?: string; // Prefix (default: '.')\n /** @deprecated Image prefix */\n prefix?: string;\n /** Show the expert button? */\n showExpertButton?: boolean;\n /** Language */\n lang?: ioBroker.Languages;\n /** Socket class */\n socket: Connection;\n /** Theme name. */\n themeName?: string;\n /** Theme type. */\n themeType?: 'dark' | 'light';\n /** Theme object. */\n theme: IobTheme;\n /** The selected IDs. */\n selected?: string | string[];\n /** The ok button text; default: OK (translated) */\n ok?: string;\n /** The cancel button text; default: Cancel (translated) */\n cancel?: string;\n /** If download of files enabled */\n allowUpload?: boolean;\n /** If download of files enabled */\n allowDownload?: boolean;\n /** If creation of folders enabled */\n allowCreateFolder?: boolean;\n /** If creation of folders enabled */\n allowDelete?: boolean;\n /** if tile view enabled (default true) */\n allowView?: boolean;\n /** Show toolbar (default true) */\n showToolbar?: boolean;\n /** Limit file browser to one specific objectID of type meta and the following path (like vis.0/main) */\n limitPath?: string;\n /** like `['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']` */\n filterFiles?: string[];\n /** images, code, txt, audio, video */\n filterByType?: 'images' | 'code' | 'txt';\n /** allow only folder's selection */\n selectOnlyFolders?: boolean;\n /** Close handler that is always called when the dialog is closed. */\n onClose: () => void;\n /** Handler that is called when the user presses OK or by double click. */\n onOk: (selected: string | string[] | undefined) => void;\n /** The styling class names. */\n filters?: Record<string, string>;\n /** Allow switch views Table<=>Rows */\n showViewTypeButton?: boolean;\n /** If type selector should be shown */\n showTypeSelector?: boolean;\n /** If defined, allow selecting only files from this folder */\n restrictToFolder?: string;\n /** If restrictToFolder defined, allow selecting files outside of this folder */\n allowNonRestricted?: boolean;\n /** force expert mode */\n expertMode?: boolean;\n /** Translate function - optional */\n t?: (text: string, ...args: any[]) => string;\n}\n\ninterface DialogSelectFileState {\n selected: string[];\n}\n\nexport class DialogSelectFile extends React.Component<DialogSelectFileProps, DialogSelectFileState> {\n private readonly dialogName: string;\n\n private readonly filters: Record<string, string>;\n\n constructor(props: DialogSelectFileProps) {\n super(props);\n this.dialogName = this.props.dialogName || 'default';\n this.dialogName = `SelectFile.${this.dialogName}`;\n\n const filters: string = ((window as any)._localStorage || window.localStorage).getItem(this.dialogName) || '{}';\n\n try {\n this.filters = JSON.parse(filters);\n } catch {\n this.filters = {};\n }\n\n if (props.filters) {\n this.filters = { ...this.filters, ...props.filters };\n }\n\n let selected = this.props.selected || [];\n if (typeof selected !== 'object') {\n selected = [selected];\n } else {\n selected = [...selected];\n }\n selected = selected.filter(id => id);\n\n this.state = {\n selected,\n };\n }\n\n handleCancel(): void {\n this.props.onClose();\n }\n\n handleOk(): void {\n this.props.onOk(\n this.props.multiSelect || !Array.isArray(this.state.selected)\n ? this.state.selected\n : this.state.selected[0] || '',\n );\n this.props.onClose();\n }\n\n render(): JSX.Element {\n let title;\n if (this.state.selected.length) {\n if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n \n </span>,\n <span\n key=\"id\"\n style={styles.headerID}\n >\n {this.state.selected}\n </span>,\n ];\n } else {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n \n </span>,\n <span\n key=\"id\"\n style={styles.headerID}\n >\n {I18n.t('%s items', this.state.selected.length)}\n </span>,\n ];\n }\n } else {\n title = this.props.title || I18n.t('ra_Please select file...');\n }\n\n return (\n <Dialog\n onClose={() => {}}\n maxWidth={false}\n sx={{ '& .MuiDialog-paper': { ...styles.dialog, ...styles.dialogMobile } }}\n fullWidth\n open={!0}\n aria-labelledby=\"ar_dialog_selectfile_title\"\n >\n <DialogTitle\n id=\"ar_dialog_selectfile_title\"\n sx={{ '&.MuiDialogTitle-root': styles.titleRoot }}\n >\n {title}\n </DialogTitle>\n <DialogContent style={{ ...styles.content, ...styles.contentMobile }}>\n <FileBrowser\n ready\n imagePrefix={this.props.imagePrefix || this.props.prefix || '../'} // prefix is for back compatibility\n allowUpload={!!this.props.allowUpload}\n allowDownload={this.props.allowDownload !== false}\n allowCreateFolder={!!this.props.allowCreateFolder}\n allowDelete={!!this.props.allowDelete}\n allowView={this.props.allowView !== false}\n showViewTypeButton={this.props.showViewTypeButton !== false}\n showToolbar={this.props.showToolbar !== false}\n limitPath={this.props.limitPath}\n filterFiles={this.props.filterFiles}\n filterByType={this.props.filterByType}\n selected={this.props.selected}\n restrictToFolder={this.props.restrictToFolder}\n allowNonRestricted={this.props.allowNonRestricted}\n onSelect={(selected: string | string[], isDoubleClick?: boolean, isFolder?: boolean) => {\n this.setState(\n { selected: Array.isArray(selected) ? selected : [selected] },\n () => isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk(),\n );\n }}\n t={this.props.t || I18n.t}\n lang={this.props.lang || I18n.getLanguage()}\n socket={this.props.socket}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n theme={this.props.theme}\n showExpertButton={this.props.showExpertButton}\n expertMode={this.props.expertMode}\n showTypeSelector={this.props.showTypeSelector}\n />\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n onClick={() => this.handleOk()}\n startIcon={<IconOk />}\n disabled={!this.state.selected.length}\n color=\"primary\"\n >\n {this.props.ok || I18n.t('ra_Ok')}\n </Button>\n <Button\n color=\"grey\"\n variant=\"contained\"\n onClick={() => this.handleCancel()}\n startIcon={<IconCancel />}\n >\n {this.props.cancel || I18n.t('ra_Cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
import { Component, type JSX } from 'react';
|
|
8
|
-
import type Connection from '../Connection';
|
|
8
|
+
import type { Connection } from '../Connection';
|
|
9
9
|
import type { ObjectBrowserColumn, ObjectBrowserCustomFilter, ObjectBrowserType } from '../Components/types';
|
|
10
10
|
import type { IobTheme } from '../types';
|
|
11
11
|
export interface SelectIDFilters {
|
|
@@ -82,7 +82,7 @@ interface DialogSelectIDState {
|
|
|
82
82
|
selected: string[];
|
|
83
83
|
name: string;
|
|
84
84
|
}
|
|
85
|
-
declare class DialogSelectID extends Component<DialogSelectIDProps, DialogSelectIDState> {
|
|
85
|
+
export declare class DialogSelectID extends Component<DialogSelectIDProps, DialogSelectIDState> {
|
|
86
86
|
private readonly dialogName;
|
|
87
87
|
private filters;
|
|
88
88
|
private readonly filterFunc?;
|
|
@@ -91,4 +91,4 @@ declare class DialogSelectID extends Component<DialogSelectIDProps, DialogSelect
|
|
|
91
91
|
handleOk(): void;
|
|
92
92
|
render(): JSX.Element;
|
|
93
93
|
}
|
|
94
|
-
export
|
|
94
|
+
export {};
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
1
|
/**
|
|
30
2
|
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
31
3
|
*
|
|
@@ -33,12 +5,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
5
|
*
|
|
34
6
|
*/
|
|
35
7
|
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class DialogSelectID extends
|
|
8
|
+
import React, { Component } from 'react';
|
|
9
|
+
import { Button, DialogTitle, DialogContent, DialogActions, Dialog } from '@mui/material';
|
|
10
|
+
import { Cancel as IconCancel, Check as IconOk } from '@mui/icons-material';
|
|
11
|
+
import { I18n } from '../i18n';
|
|
12
|
+
import { ObjectBrowser } from '../Components/ObjectBrowser';
|
|
13
|
+
export class DialogSelectID extends Component {
|
|
14
|
+
dialogName;
|
|
15
|
+
filters;
|
|
16
|
+
filterFunc;
|
|
42
17
|
constructor(props) {
|
|
43
18
|
super(props);
|
|
44
19
|
this.dialogName = this.props.dialogName || 'default';
|
|
@@ -47,11 +22,11 @@ class DialogSelectID extends react_1.Component {
|
|
|
47
22
|
try {
|
|
48
23
|
this.filters = JSON.parse(filters);
|
|
49
24
|
}
|
|
50
|
-
catch
|
|
25
|
+
catch {
|
|
51
26
|
this.filters = {};
|
|
52
27
|
}
|
|
53
28
|
if (props.filters) {
|
|
54
|
-
this.filters =
|
|
29
|
+
this.filters = { ...this.filters, ...(props.filters || {}) };
|
|
55
30
|
}
|
|
56
31
|
let selected = this.props.selected || [];
|
|
57
32
|
if (!Array.isArray(selected)) {
|
|
@@ -63,7 +38,7 @@ class DialogSelectID extends react_1.Component {
|
|
|
63
38
|
try {
|
|
64
39
|
this.filterFunc = new Function('obj', props.filterFunc);
|
|
65
40
|
}
|
|
66
|
-
catch
|
|
41
|
+
catch {
|
|
67
42
|
console.error(`Cannot parse filter function: "obj => ${props.filterFunc}"`);
|
|
68
43
|
this.filterFunc = undefined;
|
|
69
44
|
}
|
|
@@ -89,26 +64,26 @@ class DialogSelectID extends react_1.Component {
|
|
|
89
64
|
if (this.state.name || this.state.selected.length) {
|
|
90
65
|
if (this.state.selected.length === 1) {
|
|
91
66
|
title = [
|
|
92
|
-
|
|
93
|
-
|
|
67
|
+
React.createElement("span", { key: "selected" },
|
|
68
|
+
I18n.t('ra_Selected'),
|
|
94
69
|
"\u00A0"),
|
|
95
|
-
|
|
70
|
+
React.createElement("span", { key: "id", style: { fontWeight: 'bold', fontStyle: 'italic' } }, (this.state.name || this.state.selected[0]) +
|
|
96
71
|
(this.state.name ? ` [${this.state.selected[0]}]` : '')),
|
|
97
72
|
];
|
|
98
73
|
}
|
|
99
74
|
else {
|
|
100
75
|
title = [
|
|
101
|
-
|
|
102
|
-
|
|
76
|
+
React.createElement("span", { key: "selected" },
|
|
77
|
+
I18n.t('ra_Selected'),
|
|
103
78
|
"\u00A0"),
|
|
104
|
-
|
|
79
|
+
React.createElement("span", { key: "id", style: { fontWeight: 'bold', fontStyle: 'italic' } }, I18n.t('%s items', this.state.selected.length.toString())),
|
|
105
80
|
];
|
|
106
81
|
}
|
|
107
82
|
}
|
|
108
83
|
else {
|
|
109
|
-
title = this.props.title ||
|
|
84
|
+
title = this.props.title || I18n.t('ra_Please select object ID...');
|
|
110
85
|
}
|
|
111
|
-
return (
|
|
86
|
+
return (React.createElement(Dialog, { onClose: () => { }, maxWidth: false, sx: {
|
|
112
87
|
'& .MuiDialog-paper': {
|
|
113
88
|
height: '95%',
|
|
114
89
|
p: '4px',
|
|
@@ -117,25 +92,25 @@ class DialogSelectID extends react_1.Component {
|
|
|
117
92
|
maxHeight: 'calc(100% - 16px)',
|
|
118
93
|
},
|
|
119
94
|
}, fullWidth: true, open: !0, "aria-labelledby": "ar_dialog_selectid_title" },
|
|
120
|
-
|
|
95
|
+
React.createElement(DialogTitle, { id: "ar_dialog_selectid_title", style: {
|
|
121
96
|
whiteSpace: 'nowrap',
|
|
122
97
|
width: 'calc(100% - 72px)',
|
|
123
98
|
overflow: 'hidden',
|
|
124
99
|
display: 'inline-block',
|
|
125
100
|
textOverflow: 'ellipsis',
|
|
126
101
|
} }, title),
|
|
127
|
-
|
|
102
|
+
React.createElement(DialogContent, { style: {
|
|
128
103
|
height: '100%',
|
|
129
104
|
overflow: 'hidden',
|
|
130
105
|
padding: '8px 4px',
|
|
131
106
|
} },
|
|
132
|
-
|
|
107
|
+
React.createElement(ObjectBrowser, { foldersFirst: this.props.foldersFirst, imagePrefix: this.props.imagePrefix || this.props.prefix, dateFormat: this.props.dateFormat, defaultFilters: this.filters, dialogName: this.dialogName, isFloatComma: this.props.isFloatComma, showExpertButton: this.props.showExpertButton !== undefined ? this.props.showExpertButton : true, expertMode: this.props.expertMode,
|
|
133
108
|
// style={{ width: '100%', height: '100%' }}
|
|
134
109
|
columns: this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val'], types: this.props.types
|
|
135
110
|
? Array.isArray(this.props.types)
|
|
136
111
|
? this.props.types
|
|
137
112
|
: [this.props.types]
|
|
138
|
-
: ['state'], root: this.props.root, t:
|
|
113
|
+
: ['state'], root: this.props.root, t: I18n.t, lang: this.props.lang || I18n.getLanguage(), socket: this.props.socket, selected: this.state.selected, multiSelect: this.props.multiSelect, notEditable: this.props.notEditable === undefined ? true : this.props.notEditable,
|
|
139
114
|
// name={this.state.name}
|
|
140
115
|
themeName: this.props.themeName, themeType: this.props.themeType, theme: this.props.theme, customFilter: this.props.customFilter, onFilterChanged: (filterConfig) => {
|
|
141
116
|
this.filters = filterConfig;
|
|
@@ -155,9 +130,9 @@ class DialogSelectID extends react_1.Component {
|
|
|
155
130
|
this.handleOk();
|
|
156
131
|
}
|
|
157
132
|
}, filterFunc: this.filterFunc, title: "", classes: {} })),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
133
|
+
React.createElement(DialogActions, null,
|
|
134
|
+
React.createElement(Button, { id: `ar_dialog_selectid_ok_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleOk(), startIcon: React.createElement(IconOk, null), disabled: !this.state.selected.length, color: "primary" }, this.props.ok || I18n.t('ra_Ok')),
|
|
135
|
+
React.createElement(Button, { id: `ar_dialog_selectid_cancel_${this.props.dialogName || ''}`, color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: React.createElement(IconCancel, null) }, this.props.cancel || I18n.t('ra_Cancel')))));
|
|
161
136
|
}
|
|
162
137
|
}
|
|
163
|
-
|
|
138
|
+
//# sourceMappingURL=SelectID.js.map
|