cloudmr-ux 4.4.1 → 4.4.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.
|
@@ -4,4 +4,6 @@ export default function CmrNameDialog(props: {
|
|
|
4
4
|
open: boolean;
|
|
5
5
|
setOpen: (open: boolean) => void;
|
|
6
6
|
isDemoData?: boolean;
|
|
7
|
+
/** Checked state color for the Demo Data checkbox (e.g. CAMRIE `#1578A1`). */
|
|
8
|
+
checkboxCheckedColor?: string;
|
|
7
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -47,21 +47,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
49
49
|
import * as React from 'react';
|
|
50
|
-
import { Typography,
|
|
50
|
+
import { Typography, Box } from '@mui/material';
|
|
51
51
|
import TextField from '@mui/material/TextField';
|
|
52
52
|
import Dialog from '@mui/material/Dialog';
|
|
53
53
|
import DialogActions from '@mui/material/DialogActions';
|
|
54
54
|
import DialogContent from '@mui/material/DialogContent';
|
|
55
55
|
import DialogTitle from '@mui/material/DialogTitle';
|
|
56
56
|
import CmrButton from '../CmrButton/CmrButton';
|
|
57
|
+
import { CmrCheckbox } from '../CmrCheckbox/CmrCheckbox';
|
|
57
58
|
import { useEffect } from "react";
|
|
58
59
|
export default function CmrNameDialog(props) {
|
|
59
60
|
var _this = this;
|
|
60
|
-
var originalName = props.originalName, open = props.open, setOpen = props.setOpen, isDemoData = props.isDemoData;
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var
|
|
61
|
+
var originalName = props.originalName, open = props.open, setOpen = props.setOpen, isDemoData = props.isDemoData, _a = props.checkboxCheckedColor, checkboxCheckedColor = _a === void 0 ? '#1578A1' : _a;
|
|
62
|
+
var _b = React.useState(''), helperText = _b[0], setHelperText = _b[1];
|
|
63
|
+
var _c = React.useState(originalName), text = _c[0], setText = _c[1];
|
|
64
|
+
var _d = React.useState(false), error = _d[0], setError = _d[1];
|
|
65
|
+
var _e = React.useState(isDemoData !== null && isDemoData !== void 0 ? isDemoData : false), demoDataChecked = _e[0], setDemoDataChecked = _e[1];
|
|
65
66
|
var renamingCallback = props.renamingCallback;
|
|
66
67
|
var handleClose = function () {
|
|
67
68
|
setOpen(false);
|
|
@@ -113,5 +114,14 @@ export default function CmrNameDialog(props) {
|
|
|
113
114
|
// type="file"
|
|
114
115
|
value: text, onFocus: function (event) {
|
|
115
116
|
event.target.select();
|
|
116
|
-
}, fullWidth: true, inputProps: { style: { fontSize: "16px" } }, variant: "standard", onChange: handleTextFieldChange, error: error, helperText: helperText }), isDemoData !== undefined && (_jsx(
|
|
117
|
+
}, fullWidth: true, inputProps: { style: { fontSize: "16px" } }, variant: "standard", onChange: handleTextFieldChange, error: error, helperText: helperText }), isDemoData !== undefined && (_jsx(Box, __assign({ className: "cmr-name-dialog-demo-data", sx: {
|
|
118
|
+
mt: 2,
|
|
119
|
+
display: 'flex',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
'& .MuiFormControlLabel-root': {
|
|
122
|
+
margin: 0,
|
|
123
|
+
marginLeft: 0,
|
|
124
|
+
alignItems: 'center'
|
|
125
|
+
}
|
|
126
|
+
} }, { children: _jsx(CmrCheckbox, __assign({ checked: demoDataChecked, checkedColor: checkboxCheckedColor, onChange: function (e) { return setDemoDataChecked(e.target.checked); } }, { children: "Demo Data" })) })))] }), _jsxs(DialogActions, { children: [_jsx(CmrButton, __assign({ variant: "outlined", onClick: handleClose }, { children: "Cancel" })), _jsx(CmrButton, __assign({ variant: "contained", color: 'primary', onClick: handleConfirm }, { children: "Confirm" }))] })] })) }));
|
|
117
127
|
}
|
|
@@ -347,7 +347,7 @@ export default function CmrUploadWindow(_a) {
|
|
|
347
347
|
? '*'
|
|
348
348
|
: Array.isArray(fileExtension)
|
|
349
349
|
? fileExtension.join(',')
|
|
350
|
-
: fileExtension, style: { display: 'none' }, onChange: loadSelectedFiles }), selectedFiles.length > 1 && (_jsx(Box, __assign({ sx: { mt: 2, maxHeight: 180, overflowY: 'auto', border: '1px solid #E6E6EA', borderRadius: 1 } }, { children: _jsx(List, __assign({ dense: true, disablePadding: true }, { children: selectedFiles.map(function (file, index) { return (_jsx(ListItem, __assign({ secondaryAction: _jsx(IconButton, __assign({ edge: "end", "aria-label": "remove", onClick: function () { return removeFileAt(index); } }, { children: _jsx(DeleteOutlineIcon, { fontSize: "small" }) })) }, { children: _jsx(ListItemText, { primary: file.name, secondary: formatFileSize(file.size) }) }), "".concat(file.name, "-").concat(file.lastModified, "-").concat(index))); }) })) }))), _jsxs(Box, __assign({ component: "form", sx: { '& .MuiTextField-root': { m: 2, width: '25ch', mb: 0 } } }, { children: [_jsxs("div", { children: [template.showFileName && selectedFiles.length === 1 && (_jsx(TextField, { required: true, style: { marginTop: '30px' }, label: "File Alias:", value: fileAlias, variant: "standard", onChange: changeFileName })), selectedFiles.length === 1 && (_jsx(CmrLabel, __assign({ style: { marginLeft: '16px', fontSize: '9pt', color: '#267833' } }, { children: selectedFiles[0].name }))), template.
|
|
350
|
+
: fileExtension, style: { display: 'none' }, onChange: loadSelectedFiles }), selectedFiles.length > 1 && (_jsx(Box, __assign({ sx: { mt: 2, maxHeight: 180, overflowY: 'auto', border: '1px solid #E6E6EA', borderRadius: 1 } }, { children: _jsx(List, __assign({ dense: true, disablePadding: true }, { children: selectedFiles.map(function (file, index) { return (_jsx(ListItem, __assign({ secondaryAction: _jsx(IconButton, __assign({ edge: "end", "aria-label": "remove", onClick: function () { return removeFileAt(index); } }, { children: _jsx(DeleteOutlineIcon, { fontSize: "small" }) })) }, { children: _jsx(ListItemText, { primary: file.name, secondary: formatFileSize(file.size) }) }), "".concat(file.name, "-").concat(file.lastModified, "-").concat(index))); }) })) }))), _jsxs(Box, __assign({ component: "form", sx: { '& .MuiTextField-root': { m: 2, width: '25ch', mb: 0 } } }, { children: [_jsxs("div", { children: [template.showFileName && selectedFiles.length === 1 && (_jsx(TextField, { required: true, style: { marginTop: '30px' }, label: "File Alias:", value: fileAlias, variant: "standard", onChange: changeFileName })), selectedFiles.length === 1 && (_jsx(CmrLabel, __assign({ style: { marginLeft: '16px', fontSize: '9pt', color: '#267833' } }, { children: selectedFiles[0].name }))), template.showDatabase && (_jsx(TextField, __assign({ select: true, label: "Database:", defaultValue: "s3", helperText: "Upstream Storage Location", variant: "standard" }, { children: [{ value: 's3', label: 'S3' }].map(function (option) { return (_jsx(MenuItem, __assign({ value: option.value }, { children: option.label }), option.value)); }) })))] }), _jsxs("div", { children: [template.showFileSize && selectedFiles.length > 0 && (_jsx(TextField, { label: selectedFiles.length > 1 ? 'Total Size:' : 'File Size:', value: fileSize, InputProps: {
|
|
351
351
|
readOnly: true
|
|
352
352
|
}, variant: "standard" })), _jsx(Collapse, __assign({ "in": infoOpen }, { children: _jsx(Alert, __assign({ severity: infoStyle, sx: { m: 1 } }, { children: warningText })) }))] })] }))] })), _jsxs(DialogActions, { children: [_jsx(Button, __assign({ variant: "outlined", disabled: UpBtnDisabled, onClick: handleClose }, { children: "Cancel" })), _jsxs(Button, __assign({ variant: "contained", disabled: UpBtnDisabled || selectedFiles.length === 0, onClick: handleConfirm }, { children: [UpBtnText, selectedFiles.length > 1 ? " (".concat(selectedFiles.length, ")") : ''] }))] })] })] })) }));
|
|
353
353
|
}
|