@iobroker/adapter-react-v5 6.1.2 → 6.1.5

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