@iobroker/gui-components 10.0.2 → 10.0.3
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 +5 -1
- package/build/Components/FileBrowser.js +18 -13
- package/build/Components/FileBrowser.js.map +1 -1
- package/build/Components/{ObjectBrowser.d.ts → ObjectBrowser/ObjectBrowserClass.d.ts} +142 -77
- package/build/Components/ObjectBrowser/ObjectBrowserClass.js +2462 -0
- package/build/Components/ObjectBrowser/ObjectBrowserClass.js.map +1 -0
- package/build/Components/ObjectBrowser/constants.d.ts +50 -0
- package/build/Components/ObjectBrowser/constants.js +138 -0
- package/build/Components/ObjectBrowser/constants.js.map +1 -0
- package/build/Components/ObjectBrowser/contextMenu.d.ts +13 -0
- package/build/Components/ObjectBrowser/contextMenu.js +354 -0
- package/build/Components/ObjectBrowser/contextMenu.js.map +1 -0
- package/build/Components/ObjectBrowser/dialogs.d.ts +31 -0
- package/build/Components/ObjectBrowser/dialogs.js +421 -0
- package/build/Components/ObjectBrowser/dialogs.js.map +1 -0
- package/build/Components/ObjectBrowser/index.d.ts +20 -0
- package/build/Components/ObjectBrowser/index.js +20 -0
- package/build/Components/ObjectBrowser/index.js.map +1 -0
- package/build/Components/ObjectBrowser/renderLeaf.d.ts +41 -0
- package/build/Components/ObjectBrowser/renderLeaf.js +1077 -0
- package/build/Components/ObjectBrowser/renderLeaf.js.map +1 -0
- package/build/Components/ObjectBrowser/styles.d.ts +7 -0
- package/build/Components/ObjectBrowser/styles.js +662 -0
- package/build/Components/ObjectBrowser/styles.js.map +1 -0
- package/build/Components/ObjectBrowser/toolbar.d.ts +26 -0
- package/build/Components/ObjectBrowser/toolbar.js +327 -0
- package/build/Components/ObjectBrowser/toolbar.js.map +1 -0
- package/build/Components/{objectBrowser.types.d.ts → ObjectBrowser/types.d.ts} +15 -10
- package/build/Components/{objectBrowserUtils.d.ts → ObjectBrowser/utils.d.ts} +22 -2
- package/build/Components/{objectBrowserUtils.js → ObjectBrowser/utils.js} +46 -2
- package/build/Components/ObjectBrowser/utils.js.map +1 -0
- package/build/Components/TreeTable.d.ts +2 -2
- package/build/Components/TreeTable.js.map +1 -1
- package/build/Dialogs/SelectID.d.ts +4 -4
- package/build/Dialogs/SelectID.js +2 -2
- package/build/Dialogs/SelectID.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/build/Components/ObjectBrowser.js +0 -5162
- package/build/Components/ObjectBrowser.js.map +0 -1
- package/build/Components/objectBrowserUtils.js.map +0 -1
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020-2026, Denis Haev <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Part of the object browser, see ./ObjectBrowserClass.tsx
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Utils } from '../Utils';
|
|
10
|
+
import { Box, Button, Checkbox, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Fab, FormControlLabel, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Menu, MenuItem, Snackbar, Switch, TextField, } from '@mui/material';
|
|
11
|
+
import { Check as IconCheck, Close as IconClose } from '@mui/icons-material';
|
|
12
|
+
import { IconExpert } from '../../icons/IconExpert';
|
|
13
|
+
import { getCustomValue, getName, getSelectIdIconFromObjects } from './utils';
|
|
14
|
+
import { styles } from './styles';
|
|
15
|
+
import { DEFAULT_DATE_FORMAT } from './constants';
|
|
16
|
+
/**
|
|
17
|
+
* Renders the error dialog.
|
|
18
|
+
*/
|
|
19
|
+
export function renderErrorDialog(that) {
|
|
20
|
+
return that.state.error ? (React.createElement(Dialog, { open: !0, maxWidth: "sm", fullWidth: true, onClose: () => that.setState({ error: '' }), "aria-labelledby": "error-dialog-title", "aria-describedby": "error-dialog-description" },
|
|
21
|
+
React.createElement(DialogTitle, { id: "alert-dialog-title" }, that.props.t('ra_Error')),
|
|
22
|
+
React.createElement(DialogContent, null,
|
|
23
|
+
React.createElement(DialogContentText, { id: "alert-dialog-description" }, that.state.error)),
|
|
24
|
+
React.createElement(DialogActions, null,
|
|
25
|
+
React.createElement(Button, { variant: "contained", onClick: () => that.setState({ error: '' }), color: "primary", autoFocus: true, startIcon: React.createElement(IconCheck, null) }, that.props.t('ra_Ok'))))) : null;
|
|
26
|
+
}
|
|
27
|
+
export function _renderDefinedList(that, isLast) {
|
|
28
|
+
const cols = [...that.possibleCols];
|
|
29
|
+
cols.unshift('id');
|
|
30
|
+
if (that.props.columns && !that.props.columns.includes('buttons')) {
|
|
31
|
+
const pos = cols.indexOf('buttons');
|
|
32
|
+
if (pos !== -1) {
|
|
33
|
+
cols.splice(pos, 1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return cols
|
|
37
|
+
.filter(id => (isLast && (id === 'val' || id === 'buttons')) || (!isLast && id !== 'val' && id !== 'buttons'))
|
|
38
|
+
.map(id => (React.createElement(ListItemButton, { onClick: () => {
|
|
39
|
+
if (!that.state.columnsAuto && id !== 'id') {
|
|
40
|
+
const columns = [...(that.state.columns || [])];
|
|
41
|
+
const pos = columns.indexOf(id);
|
|
42
|
+
if (pos === -1) {
|
|
43
|
+
columns.push(id);
|
|
44
|
+
columns.sort();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
columns.splice(pos, 1);
|
|
48
|
+
}
|
|
49
|
+
that.localStorage.setItem(`${that.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
|
|
50
|
+
that.calculateColumnsVisibility(null, columns);
|
|
51
|
+
that.setState({ columns });
|
|
52
|
+
}
|
|
53
|
+
}, key: id },
|
|
54
|
+
React.createElement(Checkbox, { edge: "start", disabled: id === 'id' || that.state.columnsAuto, checked: id === 'id' ||
|
|
55
|
+
!!(that.state.columnsAuto ? that.visibleCols.includes(id) : that.state.columns?.includes(id)), disableRipple: true }),
|
|
56
|
+
React.createElement(ListItemText, { primary: that.texts[`filter_${id}`] || that.props.t(`ra_${id}`) }))));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders the columns' selector.
|
|
60
|
+
*/
|
|
61
|
+
export function renderColumnsSelectorDialog(that) {
|
|
62
|
+
if (!that.state.columnsSelectorShow) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return (React.createElement(Dialog, { onClose: () => that.setState({ columnsSelectorShow: false }), open: !0, sx: {
|
|
66
|
+
'& .MuiPaper-root': Utils.getStyle(that.props.theme, styles.dialogColumns, styles[`transparent_${that.state.columnsDialogTransparent}`]),
|
|
67
|
+
} },
|
|
68
|
+
React.createElement(DialogTitle, { sx: styles.fontSizeTitle }, that.props.t('ra_Configure')),
|
|
69
|
+
React.createElement(DialogContent, { sx: styles.fontSizeTitle },
|
|
70
|
+
React.createElement(FormControlLabel, { style: styles.switchColumnAuto, control: React.createElement(Switch, { checked: that.state.foldersFirst, onChange: () => {
|
|
71
|
+
that.localStorage.setItem(`${that.props.dialogName || 'App'}.foldersFirst`, that.state.foldersFirst ? 'false' : 'true');
|
|
72
|
+
that.setState({ foldersFirst: !that.state.foldersFirst });
|
|
73
|
+
} }), label: that.props.t('ra_Folders always first') }),
|
|
74
|
+
React.createElement(FormControlLabel, { style: styles.switchColumnAuto, control: React.createElement(Switch, { checked: that.state.linesEnabled, onChange: () => {
|
|
75
|
+
that.localStorage.setItem(`${that.props.dialogName || 'App'}.lines`, that.state.linesEnabled ? 'false' : 'true');
|
|
76
|
+
that.setState({ linesEnabled: !that.state.linesEnabled });
|
|
77
|
+
} }), label: that.props.t('ra_Show lines between rows') }),
|
|
78
|
+
React.createElement(FormControlLabel, { style: styles.switchColumnAuto, control: React.createElement(Switch, { checked: that.state.columnsAuto, onChange: () => {
|
|
79
|
+
that.localStorage.setItem(`${that.props.dialogName || 'App'}.columnsAuto`, that.state.columnsAuto ? 'false' : 'true');
|
|
80
|
+
if (!that.state.columnsAuto) {
|
|
81
|
+
that.calculateColumnsVisibility(true);
|
|
82
|
+
that.setState({ columnsAuto: true });
|
|
83
|
+
}
|
|
84
|
+
else if (!that.state.columns) {
|
|
85
|
+
that.calculateColumnsVisibility(false, [...that.visibleCols]);
|
|
86
|
+
that.setState({ columnsAuto: false, columns: [...that.visibleCols] });
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
that.calculateColumnsVisibility(false);
|
|
90
|
+
that.setState({ columnsAuto: false });
|
|
91
|
+
}
|
|
92
|
+
} }), label: that.props.t('ra_Auto (no custom columns)') }),
|
|
93
|
+
React.createElement(List, null,
|
|
94
|
+
_renderDefinedList(that, false),
|
|
95
|
+
that.state.columnsForAdmin &&
|
|
96
|
+
Object.keys(that.state.columnsForAdmin)
|
|
97
|
+
.sort()
|
|
98
|
+
.map(adapter => that.state.columnsForAdmin?.[adapter].map(column => (React.createElement(ListItemButton, { onClick: () => {
|
|
99
|
+
if (!that.state.columnsAuto) {
|
|
100
|
+
const columns = [...(that.state.columns || [])];
|
|
101
|
+
const id = `_${adapter}_${column.path}`;
|
|
102
|
+
const pos = columns.indexOf(id);
|
|
103
|
+
if (pos === -1) {
|
|
104
|
+
columns.push(id);
|
|
105
|
+
columns.sort();
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
columns.splice(pos, 1);
|
|
109
|
+
}
|
|
110
|
+
that.calculateColumnsVisibility(null, columns);
|
|
111
|
+
that.localStorage.setItem(`${that.props.dialogName || 'App'}.columns`, JSON.stringify(columns));
|
|
112
|
+
that.setState({ columns });
|
|
113
|
+
}
|
|
114
|
+
}, key: `${adapter}_${column.name}` },
|
|
115
|
+
React.createElement(ListItemIcon, null,
|
|
116
|
+
React.createElement(Checkbox, { disabled: that.state.columnsAuto, edge: "start", checked: !that.state.columnsAuto &&
|
|
117
|
+
that.state.columns?.includes(`_${adapter}_${column.path}`), disableRipple: true })),
|
|
118
|
+
React.createElement(ListItemText, { primary: `${column.name} (${adapter})` }))))),
|
|
119
|
+
_renderDefinedList(that, true))),
|
|
120
|
+
React.createElement(DialogActions, null,
|
|
121
|
+
React.createElement(Button, { variant: "contained", onClick: () => that.setState({ columnsSelectorShow: false }), color: "primary", startIcon: React.createElement(IconClose, null) }, that.texts.close))));
|
|
122
|
+
}
|
|
123
|
+
export function renderExportDialog(that) {
|
|
124
|
+
if (that.state.showExportDialog === false) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return (React.createElement(Dialog, { open: !0, maxWidth: "lg" },
|
|
128
|
+
React.createElement(DialogTitle, null, that.props.t('ra_Select type of export')),
|
|
129
|
+
React.createElement(DialogContent, null,
|
|
130
|
+
React.createElement(DialogContentText, null, that.state.filter.expertMode || that.state.showAllExportOptions ? (React.createElement(React.Fragment, null,
|
|
131
|
+
that.props.t('ra_You can export all objects or just the selected branch.'),
|
|
132
|
+
React.createElement("br", null),
|
|
133
|
+
that.props.t('ra_Selected %s object(s)', that.state.showExportDialog),
|
|
134
|
+
React.createElement("br", null),
|
|
135
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: that.state.noStatesByExportImport, onChange: e => that.setState({ noStatesByExportImport: e.target.checked }) }), label: that.props.t('ra_Do not export values of states') }),
|
|
136
|
+
React.createElement("br", null),
|
|
137
|
+
that.props.t('These options can reduce the size of the export file:'),
|
|
138
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: that.state.beautifyJsonExport, onChange: e => that.setState({ beautifyJsonExport: e.target.checked }) }), label: that.props.t('Beautify JSON output') }),
|
|
139
|
+
React.createElement("br", null),
|
|
140
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: that.state.excludeSystemRepositoriesFromExport, onChange: e => that.setState({ excludeSystemRepositoriesFromExport: e.target.checked }) }), label: that.props.t('Exclude system repositories from export JSON') }),
|
|
141
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: that.state.excludeTranslations, onChange: e => that.setState({ excludeTranslations: e.target.checked }) }), label: that.props.t('Exclude translations (except english) from export JSON') }))) : null)),
|
|
142
|
+
React.createElement(DialogActions, null,
|
|
143
|
+
that.state.filter.expertMode || that.state.showAllExportOptions ? (React.createElement(Button, { color: "grey", variant: "outlined", onClick: () => that.setState({ showExportDialog: false, showAllExportOptions: false }, () => that._exportObjects({
|
|
144
|
+
isAll: true,
|
|
145
|
+
noStatesByExportImport: that.state.noStatesByExportImport,
|
|
146
|
+
beautify: that.state.beautifyJsonExport,
|
|
147
|
+
excludeSystemRepositories: that.state.excludeSystemRepositoriesFromExport,
|
|
148
|
+
excludeTranslations: that.state.excludeTranslations,
|
|
149
|
+
})) },
|
|
150
|
+
React.createElement("span", { style: { marginRight: 8 } }, that.props.t('ra_All objects')),
|
|
151
|
+
"(",
|
|
152
|
+
Object.keys(that.objects).length,
|
|
153
|
+
")")) : (React.createElement(Button, { color: "grey", variant: "outlined", startIcon: React.createElement(IconExpert, null), onClick: () => that.setState({ showAllExportOptions: true }) }, that.props.t('ra_Advanced options'))),
|
|
154
|
+
React.createElement(Button, { color: "primary", variant: "contained", autoFocus: true, onClick: () => that.setState({ showExportDialog: false, showAllExportOptions: false }, () => that._exportObjects({
|
|
155
|
+
isAll: false,
|
|
156
|
+
noStatesByExportImport: that.state.noStatesByExportImport,
|
|
157
|
+
beautify: that.state.beautifyJsonExport,
|
|
158
|
+
excludeSystemRepositories: that.state.excludeSystemRepositoriesFromExport,
|
|
159
|
+
excludeTranslations: that.state.excludeTranslations,
|
|
160
|
+
})) },
|
|
161
|
+
React.createElement("span", { style: { marginRight: 8 } }, that.props.t('ra_Only selected')),
|
|
162
|
+
"(",
|
|
163
|
+
that.state.showExportDialog,
|
|
164
|
+
")"),
|
|
165
|
+
React.createElement(Button, { color: "grey", variant: "contained", onClick: () => that.setState({ showExportDialog: false, showAllExportOptions: false }), startIcon: React.createElement(IconClose, null) }, that.props.t('ra_Cancel')))));
|
|
166
|
+
}
|
|
167
|
+
export function renderRenameDialog(that) {
|
|
168
|
+
if (!that.state.showRenameDialog) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
const ObjectMoveRenameDialog = that.props.objectMoveRenameDialog;
|
|
172
|
+
return (React.createElement(ObjectMoveRenameDialog, { expertMode: !!that.props.expertMode, onClose: () => that.setState({ showRenameDialog: null }), id: that.state.showRenameDialog.id, childrenIds: that.state.showRenameDialog.childrenIds, theme: that.props.theme, socket: that.props.socket, t: that.props.t, objectType: that.objects[that.state.showRenameDialog.id]?.type }));
|
|
173
|
+
}
|
|
174
|
+
export function renderInputJsonDialog(that) {
|
|
175
|
+
if (!that.state.showImportDialog) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const ObjectBrowserInsertJsonObjects = that.props.objectBrowserInsertJsonObjects;
|
|
179
|
+
return (React.createElement(ObjectBrowserInsertJsonObjects, { onClose: (text) => {
|
|
180
|
+
that.setState({ showImportDialog: false });
|
|
181
|
+
if (text) {
|
|
182
|
+
void that.parseJsonFile(text);
|
|
183
|
+
}
|
|
184
|
+
}, themeName: that.props.themeName, themeType: that.props.themeType, t: that.props.t }));
|
|
185
|
+
}
|
|
186
|
+
export function renderEnumDialog(that) {
|
|
187
|
+
if (!that.state.enumDialog) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
const type = that.state.enumDialog.type;
|
|
191
|
+
const item = that.state.enumDialog.item;
|
|
192
|
+
const itemEnums = that.state.enumDialogEnums;
|
|
193
|
+
const enumsOriginal = that.state.enumDialog.enumsOriginal;
|
|
194
|
+
const enums = (type === 'room' ? that.info.roomEnums : that.info.funcEnums)
|
|
195
|
+
.map(id => ({
|
|
196
|
+
name: getName(that.objects[id]?.common?.name || id.split('.').pop() || '', that.props.lang),
|
|
197
|
+
value: id,
|
|
198
|
+
icon: getSelectIdIconFromObjects(that.objects, id, that.props.lang, that.imagePrefix),
|
|
199
|
+
}))
|
|
200
|
+
.sort((a, b) => (a.name > b.name ? 1 : -1));
|
|
201
|
+
enums.forEach(_item => {
|
|
202
|
+
if (_item.icon && typeof _item.icon === 'string') {
|
|
203
|
+
_item.icon = (React.createElement(Box, { style: styles.enumIconDiv },
|
|
204
|
+
React.createElement("img", { src: _item.icon, style: styles.enumIcon, alt: _item.name })));
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
// const hasIcons = !!enums.find(item => item.icon);
|
|
208
|
+
return (React.createElement(Dialog, { sx: { '& .MuiPaper-root': styles.enumDialog }, onClose: () => that.setState({ enumDialog: null }), "aria-labelledby": "enum-dialog-title", open: !0 },
|
|
209
|
+
React.createElement(DialogTitle, { id: "enum-dialog-title", style: {
|
|
210
|
+
display: 'flex',
|
|
211
|
+
justifyContent: 'space-between',
|
|
212
|
+
width: '100%',
|
|
213
|
+
flexWrap: 'nowrap',
|
|
214
|
+
gap: 8,
|
|
215
|
+
paddingRight: 12,
|
|
216
|
+
} },
|
|
217
|
+
type === 'func' ? that.props.t('ra_Define functions') : that.props.t('ra_Define rooms'),
|
|
218
|
+
React.createElement(Fab, { color: "primary", disabled: enumsOriginal === JSON.stringify(itemEnums), size: "small", onClick: () => that
|
|
219
|
+
.syncEnum(item.data.id, type, itemEnums)
|
|
220
|
+
.then(() => that.setState({ enumDialog: null, enumDialogEnums: null })) },
|
|
221
|
+
React.createElement(IconCheck, null))),
|
|
222
|
+
React.createElement(List, { sx: { '&.MuiList-root': styles.enumList } }, enums.map(_item => {
|
|
223
|
+
let id;
|
|
224
|
+
let name;
|
|
225
|
+
let icon;
|
|
226
|
+
if (typeof _item === 'object') {
|
|
227
|
+
id = _item.value;
|
|
228
|
+
name = _item.name;
|
|
229
|
+
icon = _item.icon;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
id = _item;
|
|
233
|
+
name = _item;
|
|
234
|
+
}
|
|
235
|
+
const labelId = `checkbox-list-label-${id}`;
|
|
236
|
+
return (React.createElement(ListItem, { sx: styles.headerCellSelectItem, key: id, onClick: () => {
|
|
237
|
+
const pos = itemEnums.indexOf(id);
|
|
238
|
+
const enumDialogEnums = JSON.parse(JSON.stringify(that.state.enumDialogEnums));
|
|
239
|
+
if (pos === -1) {
|
|
240
|
+
enumDialogEnums.push(id);
|
|
241
|
+
enumDialogEnums.sort();
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
enumDialogEnums.splice(pos, 1);
|
|
245
|
+
}
|
|
246
|
+
that.setState({ enumDialogEnums });
|
|
247
|
+
}, secondaryAction: icon },
|
|
248
|
+
React.createElement(ListItemIcon, { sx: { '&.MuiListItemIcon-root': styles.enumCheckbox } },
|
|
249
|
+
React.createElement(Checkbox, { edge: "start", checked: itemEnums.includes(id), tabIndex: -1, disableRipple: true, slotProps: {
|
|
250
|
+
input: { 'aria-labelledby': labelId },
|
|
251
|
+
} })),
|
|
252
|
+
React.createElement(ListItemText, { id: labelId }, name)));
|
|
253
|
+
}))));
|
|
254
|
+
}
|
|
255
|
+
export function renderEditRoleDialog(that) {
|
|
256
|
+
if (!that.state.roleDialog || !that.props.objectBrowserEditRole) {
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
if (that.state.roleDialog && that.props.objectBrowserEditRole) {
|
|
260
|
+
const ObjectBrowserEditRole = that.props.objectBrowserEditRole;
|
|
261
|
+
return (React.createElement(ObjectBrowserEditRole, { key: "objectBrowserEditRole", id: that.state.roleDialog, socket: that.props.socket, t: that.props.t, roleArray: that.info.roles, commonType: that.info.objects[that.state.roleDialog]?.common?.type, onClose: (obj) => {
|
|
262
|
+
if (obj && that.state.roleDialog) {
|
|
263
|
+
that.info.objects[that.state.roleDialog] = obj;
|
|
264
|
+
}
|
|
265
|
+
that.setState({ roleDialog: null });
|
|
266
|
+
} }));
|
|
267
|
+
}
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
export function renderColumnsEditCustomDialog(that) {
|
|
271
|
+
if (!that.state.columnsEditCustomDialog) {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
if (!that.customColumnDialog) {
|
|
275
|
+
const value = getCustomValue(that.state.columnsEditCustomDialog.obj, that.state.columnsEditCustomDialog.it);
|
|
276
|
+
that.customColumnDialog = {
|
|
277
|
+
type: (that.state.columnsEditCustomDialog.it.type || typeof value),
|
|
278
|
+
initValue: (value === null || value === undefined ? '' : value).toString(),
|
|
279
|
+
value: (value === null || value === undefined ? '' : value).toString(),
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
return (React.createElement(Dialog, { onClose: () => that.setState({ columnsEditCustomDialog: null }), maxWidth: "md", "aria-labelledby": "custom-dialog-title", open: !0 },
|
|
283
|
+
React.createElement(DialogTitle, { id: "custom-dialog-title" }, `${that.props.t('ra_Edit object field')}: ${that.state.columnsEditCustomDialog.obj._id}`),
|
|
284
|
+
React.createElement(DialogContent, null,
|
|
285
|
+
React.createElement(DialogContentText, { id: "alert-dialog-description" }, that.customColumnDialog.type === 'boolean' ? (React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { onKeyUp: e => e.key === 'Enter' && that.onColumnsEditCustomDialogClose(true), defaultChecked: that.customColumnDialog.value === 'true', onChange: e => {
|
|
286
|
+
const customColumnDialog = that.customColumnDialog;
|
|
287
|
+
customColumnDialog.value = e.target.checked.toString();
|
|
288
|
+
const changed = customColumnDialog.value !== customColumnDialog.initValue;
|
|
289
|
+
if (changed === !that.state.customColumnDialogValueChanged) {
|
|
290
|
+
that.setState({ customColumnDialogValueChanged: changed });
|
|
291
|
+
}
|
|
292
|
+
} }), label: `${that.state.columnsEditCustomDialog.it.name} (${that.state.columnsEditCustomDialog.it.pathText})` })) : (React.createElement(TextField, { variant: "standard", defaultValue: that.customColumnDialog.value, fullWidth: true, onKeyUp: e => e.key === 'Enter' && that.onColumnsEditCustomDialogClose(true), label: `${that.state.columnsEditCustomDialog.it.name} (${that.state.columnsEditCustomDialog.it.pathText})`, onChange: e => {
|
|
293
|
+
const customColumnDialog = that.customColumnDialog;
|
|
294
|
+
customColumnDialog.value = e.target.value;
|
|
295
|
+
const changed = customColumnDialog.value !== customColumnDialog.initValue;
|
|
296
|
+
if (changed === !that.state.customColumnDialogValueChanged) {
|
|
297
|
+
that.setState({ customColumnDialogValueChanged: changed });
|
|
298
|
+
}
|
|
299
|
+
}, autoFocus: true })))),
|
|
300
|
+
React.createElement(DialogActions, null,
|
|
301
|
+
React.createElement(Button, { variant: "contained", onClick: () => that.onColumnsEditCustomDialogClose(true), disabled: !that.state.customColumnDialogValueChanged, color: "primary", startIcon: React.createElement(IconCheck, null) }, that.props.t('ra_Update')),
|
|
302
|
+
React.createElement(Button, { color: "grey", variant: "contained", onClick: () => that.onColumnsEditCustomDialogClose(), startIcon: React.createElement(IconClose, null) }, that.props.t('ra_Cancel')))));
|
|
303
|
+
}
|
|
304
|
+
export function renderToast(that) {
|
|
305
|
+
return (React.createElement(Snackbar, { open: !!that.state.toast, autoHideDuration: 3000, onClick: () => that.setState({ toast: '' }), onClose: () => that.setState({ toast: '' }), message: that.state.toast, action: React.createElement(IconButton, { size: "small", "aria-label": "close", color: "inherit", onClick: () => that.setState({ toast: '' }) },
|
|
306
|
+
React.createElement(IconClose, { fontSize: "small" })) }));
|
|
307
|
+
}
|
|
308
|
+
export function renderCustomDialog(that) {
|
|
309
|
+
if (that.state.customDialog && that.props.objectCustomDialog && that.systemConfig) {
|
|
310
|
+
const ObjectCustomDialog = that.props.objectCustomDialog;
|
|
311
|
+
return (React.createElement(ObjectCustomDialog, { reportChangedIds: (changedIds) => (that.changedIds = [...changedIds]), objectIDs: that.state.customDialog, allVisibleObjects: !!that.state.customDialogAll, expertMode: that.state.filter.expertMode, isFloatComma: that.props.isFloatComma === undefined
|
|
312
|
+
? (that.systemConfig?.common.isFloatComma ?? true)
|
|
313
|
+
: that.props.isFloatComma, t: that.props.t, lang: that.props.lang, socket: that.props.socket, themeName: that.props.themeName, themeType: that.props.themeType, theme: that.props.theme, objects: that.objects, customsInstances: that.info.customs, onClose: () => {
|
|
314
|
+
that.pauseSubscribe(false);
|
|
315
|
+
that.setState({ customDialog: null });
|
|
316
|
+
if (that.changedIds) {
|
|
317
|
+
that.changedIds = null;
|
|
318
|
+
// update all changed IDs
|
|
319
|
+
that.forceUpdate();
|
|
320
|
+
}
|
|
321
|
+
that.props.router?.doNavigate('tab-objects');
|
|
322
|
+
}, systemConfig: that.systemConfig }));
|
|
323
|
+
}
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
export function renderEditObjectDialog(that) {
|
|
327
|
+
if (!that.state.editObjectDialog || !that.props.objectBrowserEditObject) {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
// Guard against opening the editor for a node without a real object (e.g. a virtual folder
|
|
331
|
+
// that only exists because child states share an ID prefix). Its constructor reads obj._id.
|
|
332
|
+
if (!that.objects[that.state.editObjectDialog]) {
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
const ObjectBrowserEditObject = that.props.objectBrowserEditObject;
|
|
336
|
+
return (React.createElement(ObjectBrowserEditObject, { key: that.state.editObjectDialog, obj: that.objects[that.state.editObjectDialog], roleArray: that.info.roles, objects: that.objects, dateFormat: that.props.dateFormat || that.systemConfig?.common.dateFormat || DEFAULT_DATE_FORMAT, isFloatComma: that.props.isFloatComma === undefined
|
|
337
|
+
? (that.systemConfig?.common.isFloatComma ?? true)
|
|
338
|
+
: that.props.isFloatComma, themeType: that.props.themeType, theme: that.props.theme, socket: that.props.socket, dialogName: that.props.dialogName, aliasTab: that.state.editObjectAlias, t: that.props.t, expertMode: !!that.state.filter.expertMode, onNewObject: (obj) => that.props.socket
|
|
339
|
+
.setObject(obj._id, obj)
|
|
340
|
+
.then(() => that.setState({ editObjectDialog: obj._id, editObjectAlias: false }, () => that.onSelect(obj._id)))
|
|
341
|
+
.catch(e => that.showError(`Cannot write object: ${e}`)), onClose: (obj) => {
|
|
342
|
+
if (obj) {
|
|
343
|
+
let updateAlias;
|
|
344
|
+
if (that.state.editObjectDialog.startsWith('alias.')) {
|
|
345
|
+
if (JSON.stringify(that.objects[that.state.editObjectDialog].common?.alias) !==
|
|
346
|
+
JSON.stringify(obj.common?.alias)) {
|
|
347
|
+
updateAlias = that.state.editObjectDialog;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
that.props.socket
|
|
351
|
+
.setObject(obj._id, obj)
|
|
352
|
+
.then(() => {
|
|
353
|
+
if (updateAlias && that.subscribes.includes(updateAlias)) {
|
|
354
|
+
that.unsubscribe(updateAlias);
|
|
355
|
+
setTimeout(() => that.subscribe(updateAlias), 100);
|
|
356
|
+
}
|
|
357
|
+
})
|
|
358
|
+
.catch(e => that.showError(`Cannot write object: ${e}`));
|
|
359
|
+
}
|
|
360
|
+
that.setState({ editObjectDialog: '', editObjectAlias: false });
|
|
361
|
+
}, width: that.width }));
|
|
362
|
+
}
|
|
363
|
+
export function renderViewObjectFileDialog(that) {
|
|
364
|
+
if (!that.state.viewFileDialog || !that.props.objectBrowserViewFile) {
|
|
365
|
+
return null;
|
|
366
|
+
}
|
|
367
|
+
const ObjectBrowserViewFile = that.props.objectBrowserViewFile;
|
|
368
|
+
return (React.createElement(ObjectBrowserViewFile, { key: "viewFile", obj: that.objects[that.state.viewFileDialog], socket: that.props.socket, t: that.props.t, onClose: () => that.setState({ viewFileDialog: '' }) }));
|
|
369
|
+
}
|
|
370
|
+
export function renderAliasEditorDialog(that) {
|
|
371
|
+
if (!that.props.objectBrowserAliasEditor || !that.state.showAliasEditor) {
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
const ObjectBrowserAliasEditor = that.props.objectBrowserAliasEditor;
|
|
375
|
+
return (React.createElement(ObjectBrowserAliasEditor, { key: "editAlias", obj: that.objects[that.state.showAliasEditor], roleArray: that.info.roles, objects: that.objects, socket: that.props.socket, t: that.props.t, onClose: () => that.setState({ showAliasEditor: '' }), onRedirect: (id, timeout) => setTimeout(() => that.onSelect(id, false, () => that.expandAllSelected(() => {
|
|
376
|
+
that.scrollToItem(id);
|
|
377
|
+
setTimeout(() => that.setState({
|
|
378
|
+
editObjectDialog: id,
|
|
379
|
+
showAliasEditor: '',
|
|
380
|
+
editObjectAlias: true,
|
|
381
|
+
}), 300);
|
|
382
|
+
})), timeout || 0) }));
|
|
383
|
+
}
|
|
384
|
+
export function renderAliasMenu(that) {
|
|
385
|
+
if (!that.state.aliasMenu) {
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
return (React.createElement(Menu, { key: "aliasmenu", open: !0, anchorEl: window.document.getElementById(`alias_${that.state.aliasMenu}`), onClose: () => that.setState({ aliasMenu: '' }) }, that.info.aliasesMap[that.state.aliasMenu].map((aliasId, i) => (React.createElement(MenuItem, { key: aliasId, onClick: () => that.onSelect(aliasId) },
|
|
389
|
+
React.createElement(ListItemText, null, that.renderAliasLink(that.state.aliasMenu, i, {
|
|
390
|
+
'& .admin-browser-arrow': {
|
|
391
|
+
mr: '8px',
|
|
392
|
+
},
|
|
393
|
+
})))))));
|
|
394
|
+
}
|
|
395
|
+
export function renderEditValueDialog(that) {
|
|
396
|
+
if (!that.state.updateOpened || !that.props.objectBrowserValue) {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
if (!that.edit.id) {
|
|
400
|
+
console.error(`Invalid ID for edit: ${JSON.stringify(that.edit)}`);
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
if (!that.objects[that.edit.id]) {
|
|
404
|
+
console.error(`Something went wrong. Possibly the object ${that.edit.id} was deleted.`);
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
const type = that.objects[that.edit.id].common?.type
|
|
408
|
+
? that.objects[that.edit.id].common.type
|
|
409
|
+
: typeof that.edit.val;
|
|
410
|
+
const role = that.objects[that.edit.id].common.role;
|
|
411
|
+
const ObjectBrowserValue = that.props.objectBrowserValue;
|
|
412
|
+
return (React.createElement(ObjectBrowserValue, { t: that.props.t, lang: that.props.lang, type: type, role: role || '', states: Utils.getStates(that.objects[that.edit.id]), themeType: that.props.themeType, theme: that.props.theme, expertMode: !!that.state.filter.expertMode, value: that.edit.val, socket: that.props.socket, object: that.objects[that.edit.id], defaultHistory: that.defaultHistory, dateFormat: that.props.dateFormat || that.systemConfig?.common.dateFormat || DEFAULT_DATE_FORMAT, isFloatComma: that.props.isFloatComma === undefined
|
|
413
|
+
? (that.systemConfig?.common.isFloatComma ?? true)
|
|
414
|
+
: that.props.isFloatComma, onClose: (res) => {
|
|
415
|
+
that.setState({ updateOpened: false });
|
|
416
|
+
if (res) {
|
|
417
|
+
that.onUpdate(res);
|
|
418
|
+
}
|
|
419
|
+
}, width: that.width }));
|
|
420
|
+
}
|
|
421
|
+
//# sourceMappingURL=dialogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogs.js","sourceRoot":"./src/","sources":["Components/ObjectBrowser/dialogs.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EACH,GAAG,EACH,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,GAAG,EACH,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,SAAS,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD;;GAEG;AACH,MAAM,UAAU,iB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UAAU,IAAI,mBAAmB,EAChG,YAAY,EACR,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS;YACjC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC;YAClD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAEjC,OAAO,EAAE,CAAC,GAKT,EAAE,EAAE;YACD,IAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;YACvC,IAAI,GAAG,EAAE,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACvB,CAAC;QACL,CAAC,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,GACnB,CACL,CAAC;AACN,CAAC","sourcesContent":["/**\n * Copyright 2020-2026, Denis Haev <dogafox@gmail.com>\n *\n * MIT License\n *\n * Part of the object browser, see ./ObjectBrowserClass.tsx\n */\nimport React, { type JSX } from 'react';\nimport { Utils } from '../Utils';\nimport {\n Box,\n Button,\n Checkbox,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Fab,\n FormControlLabel,\n IconButton,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Menu,\n MenuItem,\n Snackbar,\n Switch,\n TextField,\n} from '@mui/material';\nimport { Check as IconCheck, Close as IconClose } from '@mui/icons-material';\nimport { IconExpert } from '../../icons/IconExpert';\nimport { getCustomValue, getName, getSelectIdIconFromObjects } from './utils';\nimport { type ObjectBrowserPossibleColumns } from './types';\nimport { styles } from './styles';\nimport { DEFAULT_DATE_FORMAT } from './constants';\nimport type { ObjectBrowserClass } from './ObjectBrowserClass';\n\n/**\n * Renders the error dialog.\n */\nexport function renderErrorDialog(that: ObjectBrowserClass): JSX.Element | null {\n return that.state.error ? (\n <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth\n onClose={() => that.setState({ error: '' })}\n aria-labelledby=\"error-dialog-title\"\n aria-describedby=\"error-dialog-description\"\n >\n <DialogTitle id=\"alert-dialog-title\">{that.props.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">{that.state.error}</DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n onClick={() => that.setState({ error: '' })}\n color=\"primary\"\n autoFocus\n startIcon={<IconCheck />}\n >\n {that.props.t('ra_Ok')}\n </Button>\n </DialogActions>\n </Dialog>\n ) : null;\n}\n\nexport function _renderDefinedList(that: ObjectBrowserClass, isLast: boolean): JSX.Element[] {\n const cols = [...that.possibleCols];\n cols.unshift('id');\n if (that.props.columns && !that.props.columns.includes('buttons')) {\n const pos = cols.indexOf('buttons');\n if (pos !== -1) {\n cols.splice(pos, 1);\n }\n }\n return cols\n .filter(id => (isLast && (id === 'val' || id === 'buttons')) || (!isLast && id !== 'val' && id !== 'buttons'))\n .map(id => (\n <ListItemButton\n onClick={() => {\n if (!that.state.columnsAuto && id !== 'id') {\n const columns = [...(that.state.columns || [])];\n const pos = columns.indexOf(id);\n if (pos === -1) {\n columns.push(id);\n columns.sort();\n } else {\n columns.splice(pos, 1);\n }\n that.localStorage.setItem(`${that.props.dialogName || 'App'}.columns`, JSON.stringify(columns));\n that.calculateColumnsVisibility(null, columns);\n that.setState({ columns });\n }\n }}\n key={id}\n >\n <Checkbox\n edge=\"start\"\n disabled={id === 'id' || that.state.columnsAuto}\n checked={\n id === 'id' ||\n !!(that.state.columnsAuto ? that.visibleCols.includes(id) : that.state.columns?.includes(id))\n }\n disableRipple\n />\n <ListItemText primary={that.texts[`filter_${id}`] || that.props.t(`ra_${id}`)} />\n </ListItemButton>\n ));\n}\n\n/**\n * Renders the columns' selector.\n */\nexport function renderColumnsSelectorDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.columnsSelectorShow) {\n return null;\n }\n return (\n <Dialog\n onClose={() => that.setState({ columnsSelectorShow: false })}\n open={!0}\n sx={{\n '& .MuiPaper-root': Utils.getStyle(\n that.props.theme,\n styles.dialogColumns,\n styles[`transparent_${that.state.columnsDialogTransparent}`],\n ),\n }}\n >\n <DialogTitle sx={styles.fontSizeTitle}>{that.props.t('ra_Configure')}</DialogTitle>\n <DialogContent sx={styles.fontSizeTitle}>\n <FormControlLabel\n style={styles.switchColumnAuto}\n control={\n <Switch\n checked={that.state.foldersFirst}\n onChange={() => {\n that.localStorage.setItem(\n `${that.props.dialogName || 'App'}.foldersFirst`,\n that.state.foldersFirst ? 'false' : 'true',\n );\n that.setState({ foldersFirst: !that.state.foldersFirst });\n }}\n />\n }\n label={that.props.t('ra_Folders always first')}\n />\n <FormControlLabel\n style={styles.switchColumnAuto}\n control={\n <Switch\n checked={that.state.linesEnabled}\n onChange={() => {\n that.localStorage.setItem(\n `${that.props.dialogName || 'App'}.lines`,\n that.state.linesEnabled ? 'false' : 'true',\n );\n that.setState({ linesEnabled: !that.state.linesEnabled });\n }}\n />\n }\n label={that.props.t('ra_Show lines between rows')}\n />\n <FormControlLabel\n style={styles.switchColumnAuto}\n control={\n <Switch\n checked={that.state.columnsAuto}\n onChange={() => {\n that.localStorage.setItem(\n `${that.props.dialogName || 'App'}.columnsAuto`,\n that.state.columnsAuto ? 'false' : 'true',\n );\n if (!that.state.columnsAuto) {\n that.calculateColumnsVisibility(true);\n that.setState({ columnsAuto: true });\n } else if (!that.state.columns) {\n that.calculateColumnsVisibility(false, [...that.visibleCols]);\n that.setState({ columnsAuto: false, columns: [...that.visibleCols] });\n } else {\n that.calculateColumnsVisibility(false);\n that.setState({ columnsAuto: false });\n }\n }}\n />\n }\n label={that.props.t('ra_Auto (no custom columns)')}\n />\n <List>\n {_renderDefinedList(that, false)}\n\n {that.state.columnsForAdmin &&\n Object.keys(that.state.columnsForAdmin)\n .sort()\n .map(adapter =>\n that.state.columnsForAdmin?.[adapter].map(column => (\n <ListItemButton\n onClick={() => {\n if (!that.state.columnsAuto) {\n const columns = [...(that.state.columns || [])];\n const id: ObjectBrowserPossibleColumns =\n `_${adapter}_${column.path}` as ObjectBrowserPossibleColumns;\n const pos = columns.indexOf(id);\n if (pos === -1) {\n columns.push(id);\n columns.sort();\n } else {\n columns.splice(pos, 1);\n }\n that.calculateColumnsVisibility(null, columns);\n that.localStorage.setItem(\n `${that.props.dialogName || 'App'}.columns`,\n JSON.stringify(columns),\n );\n that.setState({ columns });\n }\n }}\n key={`${adapter}_${column.name}`}\n >\n <ListItemIcon>\n <Checkbox\n disabled={that.state.columnsAuto}\n edge=\"start\"\n checked={\n !that.state.columnsAuto &&\n that.state.columns?.includes(\n `_${adapter}_${column.path}` as ObjectBrowserPossibleColumns,\n )\n }\n disableRipple\n />\n </ListItemIcon>\n <ListItemText primary={`${column.name} (${adapter})`} />\n </ListItemButton>\n )),\n )}\n {_renderDefinedList(that, true)}\n </List>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n onClick={() => that.setState({ columnsSelectorShow: false })}\n color=\"primary\"\n startIcon={<IconClose />}\n >\n {that.texts.close}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\nexport function renderExportDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (that.state.showExportDialog === false) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n maxWidth=\"lg\"\n >\n <DialogTitle>{that.props.t('ra_Select type of export')}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n {that.state.filter.expertMode || that.state.showAllExportOptions ? (\n <>\n {that.props.t('ra_You can export all objects or just the selected branch.')}\n <br />\n {that.props.t('ra_Selected %s object(s)', that.state.showExportDialog)}\n <br />\n <FormControlLabel\n control={\n <Checkbox\n checked={that.state.noStatesByExportImport}\n onChange={e => that.setState({ noStatesByExportImport: e.target.checked })}\n />\n }\n label={that.props.t('ra_Do not export values of states')}\n />\n <br />\n {that.props.t('These options can reduce the size of the export file:')}\n <FormControlLabel\n control={\n <Checkbox\n checked={that.state.beautifyJsonExport}\n onChange={e => that.setState({ beautifyJsonExport: e.target.checked })}\n />\n }\n label={that.props.t('Beautify JSON output')}\n />\n <br />\n <FormControlLabel\n control={\n <Checkbox\n checked={that.state.excludeSystemRepositoriesFromExport}\n onChange={e =>\n that.setState({ excludeSystemRepositoriesFromExport: e.target.checked })\n }\n />\n }\n label={that.props.t('Exclude system repositories from export JSON')}\n />\n <FormControlLabel\n control={\n <Checkbox\n checked={that.state.excludeTranslations}\n onChange={e => that.setState({ excludeTranslations: e.target.checked })}\n />\n }\n label={that.props.t('Exclude translations (except english) from export JSON')}\n />\n </>\n ) : null}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n {that.state.filter.expertMode || that.state.showAllExportOptions ? (\n <Button\n color=\"grey\"\n variant=\"outlined\"\n onClick={() =>\n that.setState({ showExportDialog: false, showAllExportOptions: false }, () =>\n that._exportObjects({\n isAll: true,\n noStatesByExportImport: that.state.noStatesByExportImport,\n beautify: that.state.beautifyJsonExport,\n excludeSystemRepositories: that.state.excludeSystemRepositoriesFromExport,\n excludeTranslations: that.state.excludeTranslations,\n }),\n )\n }\n >\n <span style={{ marginRight: 8 }}>{that.props.t('ra_All objects')}</span>(\n {Object.keys(that.objects).length})\n </Button>\n ) : (\n <Button\n color=\"grey\"\n variant=\"outlined\"\n startIcon={<IconExpert />}\n onClick={() => that.setState({ showAllExportOptions: true })}\n >\n {that.props.t('ra_Advanced options')}\n </Button>\n )}\n <Button\n color=\"primary\"\n variant=\"contained\"\n autoFocus\n onClick={() =>\n that.setState({ showExportDialog: false, showAllExportOptions: false }, () =>\n that._exportObjects({\n isAll: false,\n noStatesByExportImport: that.state.noStatesByExportImport,\n beautify: that.state.beautifyJsonExport,\n excludeSystemRepositories: that.state.excludeSystemRepositoriesFromExport,\n excludeTranslations: that.state.excludeTranslations,\n }),\n )\n }\n >\n <span style={{ marginRight: 8 }}>{that.props.t('ra_Only selected')}</span>(\n {that.state.showExportDialog})\n </Button>\n <Button\n color=\"grey\"\n variant=\"contained\"\n onClick={() => that.setState({ showExportDialog: false, showAllExportOptions: false })}\n startIcon={<IconClose />}\n >\n {that.props.t('ra_Cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\nexport function renderRenameDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.showRenameDialog) {\n return null;\n }\n const ObjectMoveRenameDialog = that.props.objectMoveRenameDialog!;\n return (\n <ObjectMoveRenameDialog\n expertMode={!!that.props.expertMode}\n onClose={() => that.setState({ showRenameDialog: null })}\n id={that.state.showRenameDialog.id}\n childrenIds={that.state.showRenameDialog.childrenIds}\n theme={that.props.theme}\n socket={that.props.socket}\n t={that.props.t}\n objectType={that.objects[that.state.showRenameDialog.id]?.type}\n />\n );\n}\n\nexport function renderInputJsonDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.showImportDialog) {\n return null;\n }\n const ObjectBrowserInsertJsonObjects = that.props.objectBrowserInsertJsonObjects!;\n return (\n <ObjectBrowserInsertJsonObjects\n onClose={(text?: string): void => {\n that.setState({ showImportDialog: false });\n if (text) {\n void that.parseJsonFile(text);\n }\n }}\n themeName={that.props.themeName}\n themeType={that.props.themeType}\n t={that.props.t}\n />\n );\n}\n\nexport function renderEnumDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.enumDialog) {\n return null;\n }\n const type = that.state.enumDialog.type;\n const item = that.state.enumDialog.item;\n const itemEnums: string[] = that.state.enumDialogEnums!;\n const enumsOriginal = that.state.enumDialog.enumsOriginal;\n\n const enums = (type === 'room' ? that.info.roomEnums : that.info.funcEnums)\n .map(id => ({\n name: getName(that.objects[id]?.common?.name || id.split('.').pop() || '', that.props.lang),\n value: id,\n icon: getSelectIdIconFromObjects(that.objects, id, that.props.lang, that.imagePrefix),\n }))\n .sort((a, b) => (a.name > b.name ? 1 : -1));\n\n enums.forEach(_item => {\n if (_item.icon && typeof _item.icon === 'string') {\n _item.icon = (\n <Box style={styles.enumIconDiv}>\n <img\n src={_item.icon}\n style={styles.enumIcon}\n alt={_item.name}\n />\n </Box>\n );\n }\n });\n\n // const hasIcons = !!enums.find(item => item.icon);\n\n return (\n <Dialog\n sx={{ '& .MuiPaper-root': styles.enumDialog }}\n onClose={() => that.setState({ enumDialog: null })}\n aria-labelledby=\"enum-dialog-title\"\n open={!0} // true\n >\n <DialogTitle\n id=\"enum-dialog-title\"\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n flexWrap: 'nowrap',\n gap: 8,\n paddingRight: 12,\n }}\n >\n {type === 'func' ? that.props.t('ra_Define functions') : that.props.t('ra_Define rooms')}\n <Fab\n color=\"primary\"\n disabled={enumsOriginal === JSON.stringify(itemEnums)}\n size=\"small\"\n onClick={() =>\n that\n .syncEnum(item.data.id, type, itemEnums)\n .then(() => that.setState({ enumDialog: null, enumDialogEnums: null }))\n }\n >\n <IconCheck />\n </Fab>\n </DialogTitle>\n <List sx={{ '&.MuiList-root': styles.enumList }}>\n {enums.map(_item => {\n let id;\n let name;\n let icon;\n\n if (typeof _item === 'object') {\n id = _item.value;\n name = _item.name;\n icon = _item.icon;\n } else {\n id = _item;\n name = _item;\n }\n const labelId = `checkbox-list-label-${id}`;\n\n return (\n <ListItem\n sx={styles.headerCellSelectItem}\n key={id}\n onClick={() => {\n const pos = itemEnums.indexOf(id);\n const enumDialogEnums: string[] = JSON.parse(\n JSON.stringify(that.state.enumDialogEnums),\n );\n if (pos === -1) {\n enumDialogEnums.push(id);\n enumDialogEnums.sort();\n } else {\n enumDialogEnums.splice(pos, 1);\n }\n that.setState({ enumDialogEnums });\n }}\n secondaryAction={icon}\n >\n <ListItemIcon sx={{ '&.MuiListItemIcon-root': styles.enumCheckbox }}>\n <Checkbox\n edge=\"start\"\n checked={itemEnums.includes(id)}\n tabIndex={-1}\n disableRipple\n slotProps={{\n input: { 'aria-labelledby': labelId },\n }}\n />\n </ListItemIcon>\n <ListItemText id={labelId}>{name}</ListItemText>\n </ListItem>\n );\n })}\n </List>\n </Dialog>\n );\n}\n\nexport function renderEditRoleDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.roleDialog || !that.props.objectBrowserEditRole) {\n return null;\n }\n\n if (that.state.roleDialog && that.props.objectBrowserEditRole) {\n const ObjectBrowserEditRole = that.props.objectBrowserEditRole;\n\n return (\n <ObjectBrowserEditRole\n key=\"objectBrowserEditRole\"\n id={that.state.roleDialog}\n socket={that.props.socket}\n t={that.props.t}\n roleArray={that.info.roles}\n commonType={that.info.objects[that.state.roleDialog]?.common?.type}\n onClose={(obj?: ioBroker.Object | null) => {\n if (obj && that.state.roleDialog) {\n that.info.objects[that.state.roleDialog] = obj;\n }\n that.setState({ roleDialog: null });\n }}\n />\n );\n }\n return null;\n}\n\nexport function renderColumnsEditCustomDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.columnsEditCustomDialog) {\n return null;\n }\n if (!that.customColumnDialog) {\n const value = getCustomValue(that.state.columnsEditCustomDialog.obj, that.state.columnsEditCustomDialog.it);\n that.customColumnDialog = {\n type: (that.state.columnsEditCustomDialog.it.type || typeof value) as 'boolean' | 'string' | 'number',\n initValue: (value === null || value === undefined ? '' : value).toString(),\n value: (value === null || value === undefined ? '' : value).toString(),\n };\n }\n\n return (\n <Dialog\n onClose={() => that.setState({ columnsEditCustomDialog: null })}\n maxWidth=\"md\"\n aria-labelledby=\"custom-dialog-title\"\n open={!0}\n >\n <DialogTitle id=\"custom-dialog-title\">\n {`${that.props.t('ra_Edit object field')}: ${that.state.columnsEditCustomDialog.obj._id}`}\n </DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n {that.customColumnDialog.type === 'boolean' ? (\n <FormControlLabel\n control={\n <Checkbox\n onKeyUp={e => e.key === 'Enter' && that.onColumnsEditCustomDialogClose(true)}\n defaultChecked={that.customColumnDialog.value === 'true'}\n onChange={e => {\n const customColumnDialog: {\n value: boolean | number | string;\n type: 'boolean' | 'number' | 'string';\n initValue: boolean | number | string;\n } = that.customColumnDialog as {\n value: boolean | number | string;\n type: 'boolean' | 'number' | 'string';\n initValue: boolean | number | string;\n };\n\n customColumnDialog.value = e.target.checked.toString();\n const changed = customColumnDialog.value !== customColumnDialog.initValue;\n if (changed === !that.state.customColumnDialogValueChanged) {\n that.setState({ customColumnDialogValueChanged: changed });\n }\n }}\n />\n }\n label={`${that.state.columnsEditCustomDialog.it.name} (${that.state.columnsEditCustomDialog.it.pathText})`}\n />\n ) : (\n <TextField\n variant=\"standard\"\n defaultValue={that.customColumnDialog.value}\n fullWidth\n onKeyUp={e => e.key === 'Enter' && that.onColumnsEditCustomDialogClose(true)}\n label={`${that.state.columnsEditCustomDialog.it.name} (${that.state.columnsEditCustomDialog.it.pathText})`}\n onChange={e => {\n const customColumnDialog: {\n value: boolean | number | string;\n type: 'boolean' | 'number' | 'string';\n initValue: boolean | number | string;\n } = that.customColumnDialog as {\n value: boolean | number | string;\n type: 'boolean' | 'number' | 'string';\n initValue: boolean | number | string;\n };\n\n customColumnDialog.value = e.target.value;\n const changed = customColumnDialog.value !== customColumnDialog.initValue;\n if (changed === !that.state.customColumnDialogValueChanged) {\n that.setState({ customColumnDialogValueChanged: changed });\n }\n }}\n autoFocus\n />\n )}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n onClick={() => that.onColumnsEditCustomDialogClose(true)}\n disabled={!that.state.customColumnDialogValueChanged}\n color=\"primary\"\n startIcon={<IconCheck />}\n >\n {that.props.t('ra_Update')}\n </Button>\n <Button\n color=\"grey\"\n variant=\"contained\"\n onClick={() => that.onColumnsEditCustomDialogClose()}\n startIcon={<IconClose />}\n >\n {that.props.t('ra_Cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\nexport function renderToast(that: ObjectBrowserClass): JSX.Element {\n return (\n <Snackbar\n open={!!that.state.toast}\n autoHideDuration={3000}\n onClick={() => that.setState({ toast: '' })}\n onClose={() => that.setState({ toast: '' })}\n message={that.state.toast}\n action={\n <IconButton\n size=\"small\"\n aria-label=\"close\"\n color=\"inherit\"\n onClick={() => that.setState({ toast: '' })}\n >\n <IconClose fontSize=\"small\" />\n </IconButton>\n }\n />\n );\n}\n\nexport function renderCustomDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (that.state.customDialog && that.props.objectCustomDialog && that.systemConfig) {\n const ObjectCustomDialog = that.props.objectCustomDialog;\n\n return (\n <ObjectCustomDialog\n reportChangedIds={(changedIds: string[]) => (that.changedIds = [...changedIds])}\n objectIDs={that.state.customDialog}\n allVisibleObjects={!!that.state.customDialogAll}\n expertMode={that.state.filter.expertMode}\n isFloatComma={\n that.props.isFloatComma === undefined\n ? (that.systemConfig?.common.isFloatComma ?? true)\n : that.props.isFloatComma\n }\n t={that.props.t}\n lang={that.props.lang}\n socket={that.props.socket}\n themeName={that.props.themeName}\n themeType={that.props.themeType}\n theme={that.props.theme}\n objects={that.objects}\n customsInstances={that.info.customs}\n onClose={() => {\n that.pauseSubscribe(false);\n that.setState({ customDialog: null });\n if (that.changedIds) {\n that.changedIds = null;\n // update all changed IDs\n that.forceUpdate();\n }\n\n that.props.router?.doNavigate('tab-objects');\n }}\n systemConfig={that.systemConfig}\n />\n );\n }\n return null;\n}\n\nexport function renderEditObjectDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.editObjectDialog || !that.props.objectBrowserEditObject) {\n return null;\n }\n\n // Guard against opening the editor for a node without a real object (e.g. a virtual folder\n // that only exists because child states share an ID prefix). Its constructor reads obj._id.\n if (!that.objects[that.state.editObjectDialog]) {\n return null;\n }\n\n const ObjectBrowserEditObject = that.props.objectBrowserEditObject;\n\n return (\n <ObjectBrowserEditObject\n key={that.state.editObjectDialog}\n obj={that.objects[that.state.editObjectDialog]}\n roleArray={that.info.roles}\n objects={that.objects}\n dateFormat={that.props.dateFormat || that.systemConfig?.common.dateFormat || DEFAULT_DATE_FORMAT}\n isFloatComma={\n that.props.isFloatComma === undefined\n ? (that.systemConfig?.common.isFloatComma ?? true)\n : that.props.isFloatComma\n }\n themeType={that.props.themeType}\n theme={that.props.theme}\n socket={that.props.socket}\n dialogName={that.props.dialogName}\n aliasTab={that.state.editObjectAlias}\n t={that.props.t}\n expertMode={!!that.state.filter.expertMode}\n onNewObject={(obj: ioBroker.AnyObject) =>\n that.props.socket\n .setObject(obj._id, obj)\n .then(() =>\n that.setState({ editObjectDialog: obj._id, editObjectAlias: false }, () =>\n that.onSelect(obj._id),\n ),\n )\n .catch(e => that.showError(`Cannot write object: ${e}`))\n }\n onClose={(obj?: ioBroker.AnyObject) => {\n if (obj) {\n let updateAlias: string;\n if (that.state.editObjectDialog.startsWith('alias.')) {\n if (\n JSON.stringify(that.objects[that.state.editObjectDialog].common?.alias) !==\n JSON.stringify((obj as ioBroker.StateObject).common?.alias)\n ) {\n updateAlias = that.state.editObjectDialog;\n }\n }\n\n that.props.socket\n .setObject(obj._id, obj)\n .then(() => {\n if (updateAlias && that.subscribes.includes(updateAlias)) {\n that.unsubscribe(updateAlias);\n setTimeout(() => that.subscribe(updateAlias), 100);\n }\n })\n .catch(e => that.showError(`Cannot write object: ${e}`));\n }\n that.setState({ editObjectDialog: '', editObjectAlias: false });\n }}\n width={that.width}\n />\n );\n}\n\nexport function renderViewObjectFileDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.viewFileDialog || !that.props.objectBrowserViewFile) {\n return null;\n }\n const ObjectBrowserViewFile = that.props.objectBrowserViewFile;\n\n return (\n <ObjectBrowserViewFile\n key=\"viewFile\"\n obj={that.objects[that.state.viewFileDialog]}\n socket={that.props.socket}\n t={that.props.t}\n onClose={() => that.setState({ viewFileDialog: '' })}\n />\n );\n}\n\nexport function renderAliasEditorDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.props.objectBrowserAliasEditor || !that.state.showAliasEditor) {\n return null;\n }\n const ObjectBrowserAliasEditor = that.props.objectBrowserAliasEditor;\n\n return (\n <ObjectBrowserAliasEditor\n key=\"editAlias\"\n obj={that.objects[that.state.showAliasEditor]}\n roleArray={that.info.roles}\n objects={that.objects}\n socket={that.props.socket}\n t={that.props.t}\n onClose={() => that.setState({ showAliasEditor: '' })}\n onRedirect={(id: string, timeout?: number) =>\n setTimeout(\n () =>\n that.onSelect(id, false, () =>\n that.expandAllSelected(() => {\n that.scrollToItem(id);\n setTimeout(\n () =>\n that.setState({\n editObjectDialog: id,\n showAliasEditor: '',\n editObjectAlias: true,\n }),\n 300,\n );\n }),\n ),\n timeout || 0,\n )\n }\n />\n );\n}\n\nexport function renderAliasMenu(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.aliasMenu) {\n return null;\n }\n\n return (\n <Menu\n key=\"aliasmenu\"\n open={!0}\n anchorEl={window.document.getElementById(`alias_${that.state.aliasMenu}`)}\n onClose={() => that.setState({ aliasMenu: '' })}\n >\n {that.info.aliasesMap[that.state.aliasMenu].map((aliasId, i) => (\n <MenuItem\n key={aliasId}\n onClick={() => that.onSelect(aliasId)}\n >\n <ListItemText>\n {that.renderAliasLink(that.state.aliasMenu, i, {\n '& .admin-browser-arrow': {\n mr: '8px',\n },\n })}\n </ListItemText>\n </MenuItem>\n ))}\n </Menu>\n );\n}\n\nexport function renderEditValueDialog(that: ObjectBrowserClass): JSX.Element | null {\n if (!that.state.updateOpened || !that.props.objectBrowserValue) {\n return null;\n }\n\n if (!that.edit.id) {\n console.error(`Invalid ID for edit: ${JSON.stringify(that.edit)}`);\n return null;\n }\n\n if (!that.objects[that.edit.id]) {\n console.error(`Something went wrong. Possibly the object ${that.edit.id} was deleted.`);\n return null;\n }\n\n const type = that.objects[that.edit.id].common?.type\n ? that.objects[that.edit.id].common.type\n : typeof that.edit.val;\n\n const role = that.objects[that.edit.id].common.role;\n\n const ObjectBrowserValue = that.props.objectBrowserValue;\n\n return (\n <ObjectBrowserValue\n t={that.props.t}\n lang={that.props.lang}\n type={type}\n role={role || ''}\n states={Utils.getStates(that.objects[that.edit.id] as ioBroker.StateObject)}\n themeType={that.props.themeType}\n theme={that.props.theme}\n expertMode={!!that.state.filter.expertMode}\n value={that.edit.val}\n socket={that.props.socket}\n object={that.objects[that.edit.id] as ioBroker.StateObject}\n defaultHistory={that.defaultHistory}\n dateFormat={that.props.dateFormat || that.systemConfig?.common.dateFormat || DEFAULT_DATE_FORMAT}\n isFloatComma={\n that.props.isFloatComma === undefined\n ? (that.systemConfig?.common.isFloatComma ?? true)\n : that.props.isFloatComma\n }\n onClose={(res?: {\n val: ioBroker.StateValue;\n ack: boolean;\n q: ioBroker.STATE_QUALITY[keyof ioBroker.STATE_QUALITY];\n expire: number | undefined;\n }) => {\n that.setState({ updateOpened: false });\n if (res) {\n that.onUpdate(res);\n }\n }}\n width={that.width}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020-2026, Denis Haev <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Public API of the object browser. The implementation is split into:
|
|
7
|
+
* - `ObjectBrowserClass.tsx` - the component itself (state, subscriptions, tree, rendering)
|
|
8
|
+
* - `dialogs.tsx` - all modal dialogs of the browser
|
|
9
|
+
* - `toolbar.tsx` - toolbar, filter fields and the table header
|
|
10
|
+
* - `renderLeaf.tsx` - rendering of one row of the table
|
|
11
|
+
* - `contextMenu.tsx` - the context menu of a row
|
|
12
|
+
* - `styles.ts` - styles of the component
|
|
13
|
+
* - `constants.tsx` - constants and the icons of the object types
|
|
14
|
+
* - `utils.tsx` - pure helper functions and small helper components
|
|
15
|
+
* - `types.d.ts` - types of the component
|
|
16
|
+
*/
|
|
17
|
+
export { ObjectBrowserClass, ObjectBrowser } from './ObjectBrowserClass';
|
|
18
|
+
export { ITEM_IMAGES } from './constants';
|
|
19
|
+
export { getSelectIdIconFromObjects, pattern2RegEx } from './utils';
|
|
20
|
+
export type { TreeItemData, TreeItem, ObjectBrowserFilter, ObjectBrowserCustomFilter, ObjectBrowserColumn, ObjectBrowserProps, ObjectBrowserNavigation, } from './types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020-2026, Denis Haev <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Public API of the object browser. The implementation is split into:
|
|
7
|
+
* - `ObjectBrowserClass.tsx` - the component itself (state, subscriptions, tree, rendering)
|
|
8
|
+
* - `dialogs.tsx` - all modal dialogs of the browser
|
|
9
|
+
* - `toolbar.tsx` - toolbar, filter fields and the table header
|
|
10
|
+
* - `renderLeaf.tsx` - rendering of one row of the table
|
|
11
|
+
* - `contextMenu.tsx` - the context menu of a row
|
|
12
|
+
* - `styles.ts` - styles of the component
|
|
13
|
+
* - `constants.tsx` - constants and the icons of the object types
|
|
14
|
+
* - `utils.tsx` - pure helper functions and small helper components
|
|
15
|
+
* - `types.d.ts` - types of the component
|
|
16
|
+
*/
|
|
17
|
+
export { ObjectBrowserClass, ObjectBrowser } from './ObjectBrowserClass';
|
|
18
|
+
export { ITEM_IMAGES } from './constants';
|
|
19
|
+
export { getSelectIdIconFromObjects, pattern2RegEx } from './utils';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|