cloudmr-ux 1.2.3 → 1.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/dist/index.js CHANGED
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
- CMRSelectUpload: () => SelectUpload_default,
34
33
  CMRUpload: () => Upload_default,
35
34
  CmrButton: () => CmrButton_default,
36
35
  CmrCheckbox: () => Checkbox_default,
@@ -46,9 +45,7 @@ __export(src_exports, {
46
45
  CmrRadioGroup: () => CmrRadioGroup_default,
47
46
  CmrSelect: () => CmrSelect_default,
48
47
  CmrTable: () => CmrTable2,
49
- CmrTabs: () => CmrTabs,
50
- CmrTooltip: () => Tooltip_default,
51
- CmrUploadWindow: () => CmrUploadWindow
48
+ CmrTabs: () => CmrTabs
52
49
  });
53
50
  module.exports = __toCommonJS(src_exports);
54
51
 
@@ -261,430 +258,37 @@ var CmrPanel = function(props) {
261
258
  };
262
259
  var Panel_default = CmrPanel;
263
260
 
264
- // src/CmrComponents/rename/edit.tsx
261
+ // src/CmrComponents/upload/Upload.tsx
262
+ var import_react4 = __toESM(require("react"));
263
+ var import_material7 = require("@mui/material");
264
+
265
+ // src/CmrComponents/upload/UploadWindow.tsx
265
266
  var React4 = __toESM(require("react"));
266
- var import_material6 = require("@mui/material");
267
+ var import_Button = __toESM(require("@mui/material/Button"));
267
268
  var import_TextField = __toESM(require("@mui/material/TextField"));
268
269
  var import_Dialog = __toESM(require("@mui/material/Dialog"));
269
270
  var import_DialogActions = __toESM(require("@mui/material/DialogActions"));
270
271
  var import_DialogContent = __toESM(require("@mui/material/DialogContent"));
271
- var import_DialogTitle = __toESM(require("@mui/material/DialogTitle"));
272
- var import_react4 = require("react");
273
- var import_jsx_runtime8 = require("react/jsx-runtime");
274
- function CmrNameDialog(props) {
275
- let { originalName, open, setOpen } = props;
276
- const [helperText, setHelperText] = React4.useState("");
277
- const [text, setText] = React4.useState(originalName);
278
- const [error, setError] = React4.useState(false);
279
- const renamingCallback = props.renamingCallback;
280
- const handleClose = () => {
281
- setOpen(false);
282
- };
283
- (0, import_react4.useEffect)(() => {
284
- checkError(originalName);
285
- }, [originalName]);
286
- const handleConfirm = async () => {
287
- if (await renamingCallback(text))
288
- handleClose();
289
- };
290
- const handleTextFieldChange = (e) => {
291
- setText(e.target.value);
292
- checkError(e.target.value);
293
- };
294
- const checkError = (text2) => {
295
- const fileNameRegex = /^[a-zA-Z0-9_\-]+\.[a-zA-Z]{1,5}$/;
296
- let newExtension = text2.split(".").pop();
297
- let orgExtension = originalName.indexOf(".") >= 0 ? originalName.split(".").pop() : "?";
298
- if (!fileNameRegex.test(text2)) {
299
- setError(true);
300
- if (text2.indexOf(".") < 0) {
301
- setHelperText("Invalid file name, needs a valid extension.");
302
- } else {
303
- setHelperText("Invalid file name, please check.");
304
- }
305
- } else if (newExtension !== orgExtension) {
306
- setHelperText(`You are modifying your file extension from .${orgExtension} to .${newExtension}.`);
307
- setError(false);
308
- } else {
309
- setError(false);
310
- setHelperText("");
311
- }
312
- };
313
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
314
- import_Dialog.default,
315
- {
316
- open,
317
- onClose: handleClose,
318
- fullWidth: true,
319
- maxWidth: "xs",
320
- children: [
321
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_DialogTitle.default, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material6.Typography, { children: [
322
- ' Rename "',
323
- originalName,
324
- '" as:'
325
- ] }) }),
326
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_DialogContent.default, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
327
- import_TextField.default,
328
- {
329
- autoFocus: true,
330
- margin: "dense",
331
- id: "name",
332
- defaultValue: originalName,
333
- onFocus: (event) => {
334
- event.target.select();
335
- },
336
- fullWidth: true,
337
- inputProps: { style: { fontSize: "16px" } },
338
- variant: "standard",
339
- onChange: handleTextFieldChange,
340
- error,
341
- helperText
342
- }
343
- ) }),
344
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_DialogActions.default, { children: [
345
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CmrButton_default, { variant: "outlined", onClick: handleClose, children: "Cancel" }),
346
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CmrButton_default, { variant: "contained", color: "primary", onClick: handleConfirm, children: "Confirm" })
347
- ] })
348
- ]
349
- }
350
- ) });
351
- }
352
-
353
- // src/CmrComponents/dialogue/Confirmation.tsx
354
- var React5 = __toESM(require("react"));
355
- var import_Dialog2 = __toESM(require("@mui/material/Dialog"));
356
- var import_DialogActions2 = __toESM(require("@mui/material/DialogActions"));
357
- var import_DialogContent2 = __toESM(require("@mui/material/DialogContent"));
358
272
  var import_DialogContentText = __toESM(require("@mui/material/DialogContentText"));
359
- var import_DialogTitle2 = __toESM(require("@mui/material/DialogTitle"));
360
- var import_jsx_runtime9 = require("react/jsx-runtime");
361
- function CmrConfirmation({
362
- name,
363
- message,
364
- cancelText = "Cancel",
365
- color,
366
- open,
367
- setOpen,
368
- confirmCallback = () => {
369
- },
370
- confirmText = "Confirm",
371
- cancellable = false,
372
- cancelCallback = () => {
373
- },
374
- width
375
- }) {
376
- const [text, setText] = React5.useState("");
377
- const handleClose = () => {
378
- setOpen(false);
379
- };
380
- const handleConfirm = () => {
381
- confirmCallback();
382
- handleClose();
383
- };
384
- const handleCancel = () => {
385
- cancelCallback();
386
- handleClose();
387
- };
388
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_Dialog2.default, { open, onClose: handleClose, children: [
389
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_DialogTitle2.default, { children: name ? name : "Confirmation" }),
390
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_DialogContent2.default, { sx: { width }, children: [
391
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_DialogContentText.default, { alignContent: "center", children: message }),
392
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_DialogActions2.default, { className: "mt-4", children: [
393
- cancellable && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
394
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
395
- ] })
396
- ] })
397
- ] });
398
- }
399
-
400
- // src/CmrComponents/dialogue/DeletionDialog.tsx
401
- var React6 = __toESM(require("react"));
402
- var import_TextField2 = __toESM(require("@mui/material/TextField"));
403
- var import_Dialog3 = __toESM(require("@mui/material/Dialog"));
404
- var import_DialogActions3 = __toESM(require("@mui/material/DialogActions"));
405
- var import_DialogContent3 = __toESM(require("@mui/material/DialogContent"));
406
- var import_DialogContentText2 = __toESM(require("@mui/material/DialogContentText"));
407
- var import_DialogTitle3 = __toESM(require("@mui/material/DialogTitle"));
408
- var import_jsx_runtime10 = require("react/jsx-runtime");
409
- function CmrDeletionDialog(props) {
410
- const [open, setOpen] = React6.useState(true);
411
- const [text, setText] = React6.useState("");
412
- const handleClickOpen = () => {
413
- setOpen(true);
414
- };
415
- const handleClose = () => {
416
- setOpen(false);
417
- };
418
- const handleConfirm = () => {
419
- if (text === props.name) {
420
- props.deletionCallback();
421
- setOpen(false);
422
- }
423
- };
424
- const handleTextFieldChange = (e) => {
425
- setText(e.target.value);
426
- };
427
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_Dialog3.default, { open, onClose: handleClose, children: [
428
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_DialogTitle3.default, { children: "Confirmation" }),
429
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_DialogContent3.default, { children: [
430
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_DialogContentText2.default, { children: "To delete the files, please type your full name below and confirm." }),
431
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
432
- import_TextField2.default,
433
- {
434
- autoFocus: true,
435
- margin: "dense",
436
- id: "name",
437
- type: "email",
438
- placeholder: props.name,
439
- fullWidth: true,
440
- inputProps: { style: { fontSize: "16pt" } },
441
- variant: "standard",
442
- onChange: handleTextFieldChange
443
- }
444
- )
445
- ] }),
446
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_DialogActions3.default, { children: [
447
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "btn btn-secondary", onClick: handleClose, children: "Cancel" }),
448
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "btn btn-danger", onClick: handleConfirm, children: "Confirm" })
449
- ] })
450
- ] }) });
451
- }
452
-
453
- // src/CmrComponents/dialogue/EditConfirmation.tsx
454
- var React7 = __toESM(require("react"));
455
- var import_TextField3 = __toESM(require("@mui/material/TextField"));
456
- var import_Dialog4 = __toESM(require("@mui/material/Dialog"));
457
- var import_DialogActions4 = __toESM(require("@mui/material/DialogActions"));
458
- var import_DialogContent4 = __toESM(require("@mui/material/DialogContent"));
459
- var import_DialogContentText3 = __toESM(require("@mui/material/DialogContentText"));
460
- var import_DialogTitle4 = __toESM(require("@mui/material/DialogTitle"));
461
- var import_material7 = require("@mui/material");
462
- var import_react5 = require("react");
463
- var import_jsx_runtime11 = require("react/jsx-runtime");
464
- function CmrEditConfirmation({
465
- name,
466
- message,
467
- defaultText = "",
468
- color,
469
- open,
470
- setOpen,
471
- confirmCallback = () => {
472
- },
473
- cancellable = false,
474
- cancelCallback = () => {
475
- },
476
- suffix = ""
477
- }) {
478
- const [text, setText] = React7.useState(defaultText);
479
- (0, import_react5.useEffect)(() => {
480
- if (open)
481
- setText(defaultText);
482
- }, [open]);
483
- const handleClose = () => {
484
- setOpen(false);
485
- };
486
- const handleConfirm = () => {
487
- confirmCallback(text + suffix);
488
- handleClose();
489
- };
490
- const handleCancel = () => {
491
- cancelCallback(text + suffix);
492
- handleClose();
493
- };
494
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_Dialog4.default, { maxWidth: "xs", fullWidth: true, open, onClose: handleCancel, children: [
495
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_DialogTitle4.default, { children: name ? name : "Confirmation" }),
496
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_DialogContent4.default, { children: [
497
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_DialogContentText3.default, { alignContent: "center", children: message }),
498
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_DialogActions4.default, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
499
- import_TextField3.default,
500
- {
501
- fullWidth: true,
502
- variant: "standard",
503
- InputProps: {
504
- endAdornment: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material7.InputAdornment, { position: "end", sx: { whiteSpace: "nowrap" }, children: suffix })
505
- },
506
- defaultValue: text,
507
- onChange: (e) => setText(e.target.value)
508
- }
509
- ) }),
510
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_DialogActions4.default, { children: [
511
- cancellable && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: "Cancel" }),
512
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: "Confirm" })
513
- ] })
514
- ] })
515
- ] });
516
- }
517
-
518
- // src/CmrTabs/CmrTabs.tsx
519
- var React8 = __toESM(require("react"));
520
- var import_Tabs = __toESM(require("@mui/material/Tabs"));
521
- var import_Tab = __toESM(require("@mui/material/Tab"));
522
- var import_Container = __toESM(require("@mui/material/Container"));
273
+ var import_DialogTitle = __toESM(require("@mui/material/DialogTitle"));
523
274
  var import_Typography = __toESM(require("@mui/material/Typography"));
524
275
  var import_Box = __toESM(require("@mui/material/Box"));
525
- var import_react6 = require("react");
526
- var import_jsx_runtime12 = require("react/jsx-runtime");
527
- function CustomTabPanel(props) {
528
- const { children, value, index, ...other } = props;
529
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
530
- "div",
531
- {
532
- role: "tabpanel",
533
- hidden: value !== index,
534
- id: `simple-tabpanel-${index}`,
535
- "aria-labelledby": `simple-tab-${index}`,
536
- ...other,
537
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Box.default, { sx: { p: 0 }, style: { display: value === index ? void 0 : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Typography.default, { children }) })
538
- }
539
- );
540
- }
541
- function a11yProps(index) {
542
- return {
543
- id: `simple-tab-${index}`,
544
- "aria-controls": `simple-tabpanel-${index}`
545
- };
546
- }
547
- function CmrTabs(props) {
548
- const [value, setValue] = React8.useState(0);
549
- const handleChange = (event, newValue) => {
550
- setValue(newValue);
551
- if (props.onTabSelected)
552
- props.onTabSelected(newValue);
553
- };
554
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
555
- import_Container.default,
556
- {
557
- maxWidth: "lg",
558
- sx: {
559
- flex: 1,
560
- display: "flex",
561
- flexDirection: "column",
562
- mt: 4
563
- },
564
- children: [
565
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Box.default, { sx: { borderBottom: 1, borderColor: "divider", mb: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
566
- import_Tabs.default,
567
- {
568
- value,
569
- onChange: handleChange,
570
- "aria-label": "basic tabs example",
571
- textColor: "inherit",
572
- TabIndicatorProps: {
573
- style: {
574
- backgroundColor: "#580F8B"
575
- }
576
- },
577
- children: props.tabList.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Tab.default, { sx: { color: value == index ? "#580F8B" : void 0 }, style: { fontSize: "14px", textTransform: "uppercase", fontWeight: 400 }, label: tab.text, ...a11yProps(index) }))
578
- }
579
- ) }),
580
- props.tabList.map(
581
- (tab, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CustomTabPanel, { value, index, children: (0, import_react6.cloneElement)(tab.children, {
582
- visible: value == index
583
- }) })
584
- )
585
- ]
586
- }
587
- );
588
- }
589
-
590
- // src/CmrComponents/checkbox/Checkbox.tsx
591
- var import_material8 = require("@mui/material");
276
+ var import_material6 = require("@mui/material");
592
277
 
593
278
  // src/CmrComponents/label/Label.tsx
594
- var import_jsx_runtime13 = require("react/jsx-runtime");
279
+ var import_jsx_runtime8 = require("react/jsx-runtime");
595
280
  var CmrLabel = (props) => {
596
281
  const { children, required = false } = props;
597
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "cmr-label", style: { fontSize: "16px", ...props.style }, children: [
282
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "cmr-label", style: { fontSize: "16px", ...props.style }, children: [
598
283
  children,
599
- required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "asterik", children: "*" })
284
+ required && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "asterik", children: "*" })
600
285
  ] });
601
286
  };
602
287
  var Label_default = CmrLabel;
603
288
 
604
- // src/CmrComponents/checkbox/Checkbox.tsx
605
- var import_material9 = require("@mui/material");
606
- var import_jsx_runtime14 = require("react/jsx-runtime");
607
- var CmrCheckbox = (props) => {
608
- const { defaultChecked, onChange, children, ...rest } = props;
609
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
610
- import_material9.FormControlLabel,
611
- {
612
- disabled: props.disabled,
613
- style: props.style,
614
- className: props.className,
615
- control: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material8.Checkbox, { style: props.style, checked: props.checked, defaultChecked, onChange }),
616
- label: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Label_default, { children: props.children }),
617
- sx: props.sx,
618
- labelPlacement: "end"
619
- }
620
- );
621
- };
622
- var Checkbox_default = CmrCheckbox;
623
-
624
- // src/CmrComponents/input-number/InputNumber.tsx
625
- var import_antd2 = require("antd");
626
- var import_jsx_runtime15 = require("react/jsx-runtime");
627
- var CmrInputNumber = (props) => {
628
- const { defaultValue, style, max, min, value, onChange, children, ...rest } = props;
629
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd2.InputNumber, { defaultValue, max, style, min, value, onChange, ...rest, children });
630
- };
631
- var InputNumber_default = CmrInputNumber;
632
-
633
- // src/CmrComponents/tooltip/Tooltip.tsx
634
- var import_antd3 = require("antd");
635
- var import_jsx_runtime16 = require("react/jsx-runtime");
636
- var CmrTooltip = (props) => {
637
- const {
638
- arrowPointAtCenter,
639
- autoAdjustOverflow,
640
- color,
641
- defaultVisible,
642
- mouseEnterDelay,
643
- mouseLeaveDelay,
644
- overlayClassName,
645
- placement,
646
- visible,
647
- ...rest
648
- } = props;
649
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
650
- import_antd3.Tooltip,
651
- {
652
- arrowPointAtCenter,
653
- autoAdjustOverflow,
654
- color,
655
- defaultVisible,
656
- mouseEnterDelay,
657
- mouseLeaveDelay,
658
- overlayClassName,
659
- placement,
660
- visible,
661
- ...rest
662
- }
663
- );
664
- };
665
- var Tooltip_default = CmrTooltip;
666
-
667
- // src/CmrComponents/select-upload/SelectUpload.tsx
668
- var import_react8 = __toESM(require("react"));
669
-
670
- // src/CmrComponents/upload/Upload.tsx
671
- var import_react7 = __toESM(require("react"));
672
- var import_material11 = require("@mui/material");
673
-
674
289
  // src/CmrComponents/upload/UploadWindow.tsx
675
- var React9 = __toESM(require("react"));
676
- var import_Button = __toESM(require("@mui/material/Button"));
677
- var import_TextField4 = __toESM(require("@mui/material/TextField"));
678
- var import_Dialog5 = __toESM(require("@mui/material/Dialog"));
679
- var import_DialogActions5 = __toESM(require("@mui/material/DialogActions"));
680
- var import_DialogContent5 = __toESM(require("@mui/material/DialogContent"));
681
- var import_DialogContentText4 = __toESM(require("@mui/material/DialogContentText"));
682
- var import_DialogTitle5 = __toESM(require("@mui/material/DialogTitle"));
683
- var import_Typography2 = __toESM(require("@mui/material/Typography"));
684
- var import_Box2 = __toESM(require("@mui/material/Box"));
685
- var import_material10 = require("@mui/material");
686
- var import_jsx_runtime17 = require("react/jsx-runtime");
687
- function CmrUploadWindow({
290
+ var import_jsx_runtime9 = require("react/jsx-runtime");
291
+ function UploadWindow({
688
292
  upload,
689
293
  open,
690
294
  setOpen,
@@ -692,17 +296,17 @@ function CmrUploadWindow({
692
296
  template = { showFileName: true, showDatabase: true, showFileSize: true }
693
297
  // default values
694
298
  }) {
695
- const [fileOriginalName, setFileOriginalName] = React9.useState("");
696
- const [fileAlias, setFileAlias] = React9.useState("/");
697
- const [fileSize, setFileSize] = React9.useState("0 MB");
698
- const [warningText, setWarningText] = React9.useState("Unknown Status");
699
- const [infoOpen, setInfoOpen] = React9.useState(false);
700
- const [locationSelection, setLocationSelection] = React9.useState("s3");
701
- const [infoStyle, setInfoStyle] = React9.useState("info");
702
- const [uploadedFiles, setUploaded] = React9.useState([]);
703
- const [UpBtnDisabled, setUpBtnDisabled] = React9.useState(false);
704
- const [UpBtnText, setUpBtnText] = React9.useState("Upload");
705
- const [uploadBoxWarning, setUploadBoxWarning] = React9.useState(void 0);
299
+ const [fileOriginalName, setFileOriginalName] = React4.useState("");
300
+ const [fileAlias, setFileAlias] = React4.useState("/");
301
+ const [fileSize, setFileSize] = React4.useState("0 MB");
302
+ const [warningText, setWarningText] = React4.useState("Unknown Status");
303
+ const [infoOpen, setInfoOpen] = React4.useState(false);
304
+ const [locationSelection, setLocationSelection] = React4.useState("s3");
305
+ const [infoStyle, setInfoStyle] = React4.useState("info");
306
+ const [uploadedFiles, setUploaded] = React4.useState([]);
307
+ const [UpBtnDisabled, setUpBtnDisabled] = React4.useState(false);
308
+ const [UpBtnText, setUpBtnText] = React4.useState("Upload");
309
+ const [uploadBoxWarning, setUploadBoxWarning] = React4.useState(void 0);
706
310
  const handleClickOpen = () => {
707
311
  setOpen(true);
708
312
  };
@@ -891,13 +495,13 @@ function CmrUploadWindow({
891
495
  const fileElem = document.getElementById("file-window");
892
496
  loadFiles(fileElem.files);
893
497
  };
894
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_Dialog5.default, { open, onClose: handleClose, children: [
895
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_DialogTitle5.default, { children: "File Upload" }),
896
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_DialogContent5.default, { children: [
897
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_DialogContentText4.default, {}),
898
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_DialogContent5.default, { dividers: true, children: [
899
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
900
- import_Box2.default,
498
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_Dialog.default, { open, onClose: handleClose, children: [
499
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_DialogTitle.default, { children: "File Upload" }),
500
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_DialogContent.default, { children: [
501
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_DialogContentText.default, {}),
502
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_DialogContent.default, { dividers: true, children: [
503
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
504
+ import_Box.default,
901
505
  {
902
506
  width: 500,
903
507
  height: 250,
@@ -906,8 +510,8 @@ function CmrUploadWindow({
906
510
  borderRadius: "5pt",
907
511
  borderColor: uploadBoxWarning == void 0 ? "lightGray" : "#BA3C3C"
908
512
  },
909
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Typography2.default, { component: "div", style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
910
- import_Box2.default,
513
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Typography.default, { component: "div", style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
514
+ import_Box.default,
911
515
  {
912
516
  style: {
913
517
  display: "flex",
@@ -919,17 +523,17 @@ function CmrUploadWindow({
919
523
  onClick: fileInputClick,
920
524
  ref: fileInput,
921
525
  children: [
922
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_Typography2.default, { variant: "body1", align: "center", style: { marginTop: "auto" }, children: [
526
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_Typography.default, { variant: "body1", align: "center", style: { marginTop: "auto" }, children: [
923
527
  "Drag & Drop or Click to Upload Your File Here ",
924
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("sup", { children: "*" })
528
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("sup", { children: "*" })
925
529
  ] }),
926
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Typography2.default, { variant: "body2", align: "center", style: { marginTop: "auto", fontSize: "0.8rem", fontStyle: "italic" }, children: "* Warning: The file you are uploading may contain sensitive information protected under privacy laws. Please ensure all PHI is anonymized before proceeding.Before proceeding. The user is the sole responsible for data anonymization." })
530
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Typography.default, { variant: "body2", align: "center", style: { marginTop: "auto", fontSize: "0.8rem", fontStyle: "italic" }, children: "* Warning: The file you are uploading may contain sensitive information protected under privacy laws. Please ensure all PHI is anonymized before proceeding.Before proceeding. The user is the sole responsible for data anonymization." })
927
531
  ]
928
532
  }
929
533
  ) })
930
534
  }
931
535
  ),
932
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
536
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
933
537
  "input",
934
538
  {
935
539
  type: "file",
@@ -940,10 +544,10 @@ function CmrUploadWindow({
940
544
  onChange: loadSelectedFiles
941
545
  }
942
546
  ),
943
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_Box2.default, { component: "form", sx: { "& .MuiTextField-root": { m: 2, width: "25ch", mb: 0 } }, children: [
944
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
945
- template.showFileName && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
946
- import_TextField4.default,
547
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_Box.default, { component: "form", sx: { "& .MuiTextField-root": { m: 2, width: "25ch", mb: 0 } }, children: [
548
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
549
+ template.showFileName && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
550
+ import_TextField.default,
947
551
  {
948
552
  required: true,
949
553
  style: { marginTop: "30px" },
@@ -953,22 +557,22 @@ function CmrUploadWindow({
953
557
  onChange: changeFileName
954
558
  }
955
559
  ),
956
- fileOriginalName != "" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Label_default, { style: { marginLeft: "16px", fontSize: "9pt", color: "#267833" }, children: fileOriginalName }),
957
- template.showDatabase && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
958
- import_TextField4.default,
560
+ fileOriginalName != "" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label_default, { style: { marginLeft: "16px", fontSize: "9pt", color: "#267833" }, children: fileOriginalName }),
561
+ template.showDatabase && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
562
+ import_TextField.default,
959
563
  {
960
564
  select: true,
961
565
  label: "Database:",
962
566
  defaultValue: "s3",
963
567
  helperText: "Upstream Storage Location",
964
568
  variant: "standard",
965
- children: [{ value: "s3", label: "S3" }].map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material10.MenuItem, { value: option.value, children: option.label }, option.value))
569
+ children: [{ value: "s3", label: "S3" }].map((option) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material6.MenuItem, { value: option.value, children: option.label }, option.value))
966
570
  }
967
571
  )
968
572
  ] }),
969
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
970
- template.showFileSize && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
971
- import_TextField4.default,
573
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
574
+ template.showFileSize && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
575
+ import_TextField.default,
972
576
  {
973
577
  label: "File Size:",
974
578
  value: fileSize,
@@ -978,12 +582,12 @@ function CmrUploadWindow({
978
582
  variant: "standard"
979
583
  }
980
584
  ),
981
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material10.Collapse, { in: infoOpen, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material10.Alert, { severity: infoStyle, sx: { m: 1 }, children: warningText }) })
585
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material6.Collapse, { in: infoOpen, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material6.Alert, { severity: infoStyle, sx: { m: 1 }, children: warningText }) })
982
586
  ] })
983
587
  ] })
984
588
  ] }),
985
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_DialogActions5.default, { children: [
986
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
589
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_DialogActions.default, { children: [
590
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
987
591
  import_Button.default,
988
592
  {
989
593
  color: "inherit",
@@ -993,7 +597,7 @@ function CmrUploadWindow({
993
597
  children: "Cancel"
994
598
  }
995
599
  ),
996
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
600
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
997
601
  import_Button.default,
998
602
  {
999
603
  variant: "contained",
@@ -1009,12 +613,12 @@ function CmrUploadWindow({
1009
613
 
1010
614
  // src/CmrComponents/upload/Upload.tsx
1011
615
  var import_axios = __toESM(require("axios"));
1012
- var import_jsx_runtime18 = require("react/jsx-runtime");
616
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1013
617
  var CmrUpload = (props) => {
1014
- let [open, setOpen] = (0, import_react7.useState)(false);
1015
- let [uploading, setUploading] = (0, import_react7.useState)(false);
1016
- let [progress, setProgress] = (0, import_react7.useState)(0);
1017
- let [uploadedFile, setUploadedFile] = (0, import_react7.useState)(void 0);
618
+ let [open, setOpen] = (0, import_react4.useState)(false);
619
+ let [uploading, setUploading] = (0, import_react4.useState)(false);
620
+ let [progress, setProgress] = (0, import_react4.useState)(0);
621
+ let [uploadedFile, setUploadedFile] = (0, import_react4.useState)(void 0);
1018
622
  const upload = async (file, fileAlias, fileDatabase) => {
1019
623
  setUploading(true);
1020
624
  const onProgress = (progress2) => {
@@ -1075,154 +679,411 @@ var CmrUpload = (props) => {
1075
679
  setProgress(0);
1076
680
  return status;
1077
681
  };
1078
- function failUpload() {
1079
- setUploading(false);
1080
- setProgress(0);
1081
- if (props.uploadFailed)
1082
- return props.uploadFailed();
1083
- return 0;
1084
- }
1085
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react7.default.Fragment, { children: [
1086
- !uploading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1087
- import_material11.Button,
1088
- {
1089
- fullWidth: props.fullWidth,
1090
- style: props.style,
1091
- variant: uploadedFile == void 0 ? "contained" : "outlined",
1092
- onClick: () => {
1093
- setOpen(true);
1094
- },
1095
- color: props.color || "primary",
1096
- sx: props.sx,
1097
- children: [
1098
- props.changeNameAfterUpload ? uploadedFile === void 0 ? props.uploadButtonName ? props.uploadButtonName : "Upload" : uploadedFile : props.uploadButtonName ? props.uploadButtonName : "Upload",
1099
- " "
1100
- ]
1101
- }
1102
- ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_material11.Button, { fullWidth: props.fullWidth, style: props.style, variant: "contained", sx: { overflowWrap: "inherit" }, color: "primary", disabled: true, children: [
1103
- "Uploading ",
1104
- progress,
1105
- "%"
1106
- ] }),
1107
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1108
- CmrUploadWindow,
1109
- {
1110
- open,
1111
- setOpen,
1112
- upload,
1113
- fileExtension: props.fileExtension,
1114
- template: { showFileName: true, showFileSize: true }
1115
- }
1116
- )
682
+ function failUpload() {
683
+ setUploading(false);
684
+ setProgress(0);
685
+ if (props.uploadFailed)
686
+ return props.uploadFailed();
687
+ return 0;
688
+ }
689
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react4.default.Fragment, { children: [
690
+ !uploading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
691
+ import_material7.Button,
692
+ {
693
+ fullWidth: props.fullWidth,
694
+ style: props.style,
695
+ variant: uploadedFile == void 0 ? "contained" : "outlined",
696
+ onClick: () => {
697
+ setOpen(true);
698
+ },
699
+ color: props.color || "primary",
700
+ sx: props.sx,
701
+ children: [
702
+ props.changeNameAfterUpload ? uploadedFile === void 0 ? props.uploadButtonName ? props.uploadButtonName : "Upload" : uploadedFile : props.uploadButtonName ? props.uploadButtonName : "Upload",
703
+ " "
704
+ ]
705
+ }
706
+ ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_material7.Button, { fullWidth: props.fullWidth, style: props.style, variant: "contained", sx: { overflowWrap: "inherit" }, color: "primary", disabled: true, children: [
707
+ "Uploading ",
708
+ progress,
709
+ "%"
710
+ ] }),
711
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
712
+ UploadWindow,
713
+ {
714
+ open,
715
+ setOpen,
716
+ upload,
717
+ fileExtension: props.fileExtension,
718
+ template: { showFileName: true, showFileSize: true }
719
+ }
720
+ )
721
+ ] });
722
+ };
723
+ CmrUpload.defaultProps = {
724
+ changeNameAfterUpload: true
725
+ };
726
+ var Upload_default = CmrUpload;
727
+
728
+ // src/CmrComponents/rename/edit.tsx
729
+ var React6 = __toESM(require("react"));
730
+ var import_material8 = require("@mui/material");
731
+ var import_TextField2 = __toESM(require("@mui/material/TextField"));
732
+ var import_Dialog2 = __toESM(require("@mui/material/Dialog"));
733
+ var import_DialogActions2 = __toESM(require("@mui/material/DialogActions"));
734
+ var import_DialogContent2 = __toESM(require("@mui/material/DialogContent"));
735
+ var import_DialogTitle2 = __toESM(require("@mui/material/DialogTitle"));
736
+ var import_react5 = require("react");
737
+ var import_jsx_runtime11 = require("react/jsx-runtime");
738
+ function CmrNameDialog(props) {
739
+ let { originalName, open, setOpen } = props;
740
+ const [helperText, setHelperText] = React6.useState("");
741
+ const [text, setText] = React6.useState(originalName);
742
+ const [error, setError] = React6.useState(false);
743
+ const renamingCallback = props.renamingCallback;
744
+ const handleClose = () => {
745
+ setOpen(false);
746
+ };
747
+ (0, import_react5.useEffect)(() => {
748
+ checkError(originalName);
749
+ }, [originalName]);
750
+ const handleConfirm = async () => {
751
+ if (await renamingCallback(text))
752
+ handleClose();
753
+ };
754
+ const handleTextFieldChange = (e) => {
755
+ setText(e.target.value);
756
+ checkError(e.target.value);
757
+ };
758
+ const checkError = (text2) => {
759
+ const fileNameRegex = /^[a-zA-Z0-9_\-]+\.[a-zA-Z]{1,5}$/;
760
+ let newExtension = text2.split(".").pop();
761
+ let orgExtension = originalName.indexOf(".") >= 0 ? originalName.split(".").pop() : "?";
762
+ if (!fileNameRegex.test(text2)) {
763
+ setError(true);
764
+ if (text2.indexOf(".") < 0) {
765
+ setHelperText("Invalid file name, needs a valid extension.");
766
+ } else {
767
+ setHelperText("Invalid file name, please check.");
768
+ }
769
+ } else if (newExtension !== orgExtension) {
770
+ setHelperText(`You are modifying your file extension from .${orgExtension} to .${newExtension}.`);
771
+ setError(false);
772
+ } else {
773
+ setError(false);
774
+ setHelperText("");
775
+ }
776
+ };
777
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
778
+ import_Dialog2.default,
779
+ {
780
+ open,
781
+ onClose: handleClose,
782
+ fullWidth: true,
783
+ maxWidth: "xs",
784
+ children: [
785
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_DialogTitle2.default, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_material8.Typography, { children: [
786
+ " Rename the File ",
787
+ originalName,
788
+ " as:"
789
+ ] }) }),
790
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_DialogContent2.default, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
791
+ import_TextField2.default,
792
+ {
793
+ autoFocus: true,
794
+ margin: "dense",
795
+ id: "name",
796
+ defaultValue: originalName,
797
+ onFocus: (event) => {
798
+ event.target.select();
799
+ },
800
+ fullWidth: true,
801
+ inputProps: { style: { fontSize: "16px" } },
802
+ variant: "standard",
803
+ onChange: handleTextFieldChange,
804
+ error,
805
+ helperText
806
+ }
807
+ ) }),
808
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_DialogActions2.default, { children: [
809
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton_default, { variant: "outlined", onClick: handleClose, children: "Cancel" }),
810
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton_default, { variant: "contained", color: "primary", onClick: handleConfirm, children: "Confirm" })
811
+ ] })
812
+ ]
813
+ }
814
+ ) });
815
+ }
816
+
817
+ // src/CmrComponents/dialogue/Confirmation.tsx
818
+ var React7 = __toESM(require("react"));
819
+ var import_Dialog3 = __toESM(require("@mui/material/Dialog"));
820
+ var import_DialogActions3 = __toESM(require("@mui/material/DialogActions"));
821
+ var import_DialogContent3 = __toESM(require("@mui/material/DialogContent"));
822
+ var import_DialogContentText2 = __toESM(require("@mui/material/DialogContentText"));
823
+ var import_DialogTitle3 = __toESM(require("@mui/material/DialogTitle"));
824
+ var import_jsx_runtime12 = require("react/jsx-runtime");
825
+ function CmrConfirmation({
826
+ name,
827
+ message,
828
+ cancelText = "Cancel",
829
+ color,
830
+ open,
831
+ setOpen,
832
+ confirmCallback = () => {
833
+ },
834
+ confirmText = "Confirm",
835
+ cancellable = false,
836
+ cancelCallback = () => {
837
+ },
838
+ width
839
+ }) {
840
+ const [text, setText] = React7.useState("");
841
+ const handleClose = () => {
842
+ setOpen(false);
843
+ };
844
+ const handleConfirm = () => {
845
+ confirmCallback();
846
+ handleClose();
847
+ };
848
+ const handleCancel = () => {
849
+ cancelCallback();
850
+ handleClose();
851
+ };
852
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_Dialog3.default, { open, onClose: handleClose, children: [
853
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_DialogTitle3.default, { children: name ? name : "Confirmation" }),
854
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogContent3.default, { sx: { width }, children: [
855
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_DialogContentText2.default, { alignContent: "center", children: message }),
856
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogActions3.default, { className: "mt-4", children: [
857
+ cancellable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
858
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
859
+ ] })
860
+ ] })
1117
861
  ] });
1118
- };
1119
- CmrUpload.defaultProps = {
1120
- changeNameAfterUpload: true
1121
- };
1122
- var Upload_default = CmrUpload;
862
+ }
1123
863
 
1124
- // src/CmrComponents/select-upload/SelectUpload.tsx
1125
- var import_material12 = require("@mui/material");
1126
- var import_Select = __toESM(require("@mui/material/Select"));
1127
- var import_Dialog6 = __toESM(require("@mui/material/Dialog"));
1128
- var import_DialogTitle6 = __toESM(require("@mui/material/DialogTitle"));
1129
- var import_DialogContent6 = __toESM(require("@mui/material/DialogContent"));
1130
- var import_DialogContentText5 = __toESM(require("@mui/material/DialogContentText"));
1131
- var import_Box3 = __toESM(require("@mui/material/Box"));
1132
- var import_jsx_runtime19 = require("react/jsx-runtime");
1133
- var CMRSelectUpload = (props) => {
1134
- let [open, setOpen] = import_react8.default.useState(false);
1135
- let [fileIndex, selectFileIndex] = import_react8.default.useState(-1);
1136
- let [uploading, setUploading] = import_react8.default.useState(false);
1137
- const [progress, setProgress] = import_react8.default.useState(0);
864
+ // src/CmrComponents/dialogue/DeletionDialog.tsx
865
+ var React8 = __toESM(require("react"));
866
+ var import_TextField3 = __toESM(require("@mui/material/TextField"));
867
+ var import_Dialog4 = __toESM(require("@mui/material/Dialog"));
868
+ var import_DialogActions4 = __toESM(require("@mui/material/DialogActions"));
869
+ var import_DialogContent4 = __toESM(require("@mui/material/DialogContent"));
870
+ var import_DialogContentText3 = __toESM(require("@mui/material/DialogContentText"));
871
+ var import_DialogTitle4 = __toESM(require("@mui/material/DialogTitle"));
872
+ var import_jsx_runtime13 = require("react/jsx-runtime");
873
+ function CmrDeletionDialog(props) {
874
+ const [open, setOpen] = React8.useState(true);
875
+ const [text, setText] = React8.useState("");
1138
876
  const handleClickOpen = () => {
1139
- selectFileIndex(-1);
1140
877
  setOpen(true);
1141
878
  };
1142
879
  const handleClose = () => {
1143
880
  setOpen(false);
1144
881
  };
1145
- const handleChange = (event) => {
1146
- selectFileIndex(event.target.value);
882
+ const handleConfirm = () => {
883
+ if (text === props.name) {
884
+ props.deletionCallback();
885
+ setOpen(false);
886
+ }
887
+ };
888
+ const handleTextFieldChange = (e) => {
889
+ setText(e.target.value);
1147
890
  };
1148
- const onSet = () => {
1149
- props.onSelected(props.fileSelection[fileIndex]);
891
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_Dialog4.default, { open, onClose: handleClose, children: [
892
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_DialogTitle4.default, { children: "Confirmation" }),
893
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_DialogContent4.default, { children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_DialogContentText3.default, { children: "To delete the files, please type your full name below and confirm." }),
895
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
896
+ import_TextField3.default,
897
+ {
898
+ autoFocus: true,
899
+ margin: "dense",
900
+ id: "name",
901
+ type: "email",
902
+ placeholder: props.name,
903
+ fullWidth: true,
904
+ inputProps: { style: { fontSize: "16pt" } },
905
+ variant: "standard",
906
+ onChange: handleTextFieldChange
907
+ }
908
+ )
909
+ ] }),
910
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_DialogActions4.default, { children: [
911
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { className: "btn btn-secondary", onClick: handleClose, children: "Cancel" }),
912
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { className: "btn btn-danger", onClick: handleConfirm, children: "Confirm" })
913
+ ] })
914
+ ] }) });
915
+ }
916
+
917
+ // src/CmrComponents/dialogue/EditConfirmation.tsx
918
+ var React9 = __toESM(require("react"));
919
+ var import_TextField4 = __toESM(require("@mui/material/TextField"));
920
+ var import_Dialog5 = __toESM(require("@mui/material/Dialog"));
921
+ var import_DialogActions5 = __toESM(require("@mui/material/DialogActions"));
922
+ var import_DialogContent5 = __toESM(require("@mui/material/DialogContent"));
923
+ var import_DialogContentText4 = __toESM(require("@mui/material/DialogContentText"));
924
+ var import_DialogTitle5 = __toESM(require("@mui/material/DialogTitle"));
925
+ var import_material9 = require("@mui/material");
926
+ var import_react6 = require("react");
927
+ var import_jsx_runtime14 = require("react/jsx-runtime");
928
+ function CmrEditConfirmation({
929
+ name,
930
+ message,
931
+ defaultText = "",
932
+ color,
933
+ open,
934
+ setOpen,
935
+ confirmCallback = () => {
936
+ },
937
+ cancellable = false,
938
+ cancelCallback = () => {
939
+ },
940
+ suffix = ""
941
+ }) {
942
+ const [text, setText] = React9.useState(defaultText);
943
+ (0, import_react6.useEffect)(() => {
944
+ if (open)
945
+ setText(defaultText);
946
+ }, [open]);
947
+ const handleClose = () => {
1150
948
  setOpen(false);
1151
949
  };
1152
- const selectionDialog = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_Dialog6.default, { open, onClose: handleClose, children: [
1153
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_DialogTitle6.default, { children: "Select or Upload" }),
1154
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_DialogContent6.default, { sx: { width: 520 }, children: [
1155
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_DialogContentText5.default, { sx: { pl: 1, pr: 1, pb: 0 }, children: uploading ? "Please wait for the upload to finish." : "" }),
1156
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_DialogContent6.default, { sx: { p: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1157
- import_Select.default,
950
+ const handleConfirm = () => {
951
+ confirmCallback(text + suffix);
952
+ handleClose();
953
+ };
954
+ const handleCancel = () => {
955
+ cancelCallback(text + suffix);
956
+ handleClose();
957
+ };
958
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_Dialog5.default, { maxWidth: "xs", fullWidth: true, open, onClose: handleCancel, children: [
959
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_DialogTitle5.default, { children: name ? name : "Confirmation" }),
960
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_DialogContent5.default, { children: [
961
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_DialogContentText4.default, { alignContent: "center", children: message }),
962
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_DialogActions5.default, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
963
+ import_TextField4.default,
1158
964
  {
1159
- value: fileIndex,
1160
- onChange: handleChange,
1161
- disabled: uploading,
1162
- inputProps: { "aria-label": "Without label" },
1163
- sx: { width: "100%" },
1164
- children: [
1165
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material12.MenuItem, { value: -1, children: props.fileSelection.length < 1 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("em", { children: "No Stored Files" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("em", { children: "Select a Stored File" }) }),
1166
- (props.fileSelection != void 0 ? props.fileSelection : []).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material12.MenuItem, { value: index, children: option.fileName }, index))
1167
- ]
965
+ fullWidth: true,
966
+ variant: "standard",
967
+ InputProps: {
968
+ endAdornment: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material9.InputAdornment, { position: "end", sx: { whiteSpace: "nowrap" }, children: suffix })
969
+ },
970
+ defaultValue: text,
971
+ onChange: (e) => setText(e.target.value)
1168
972
  }
1169
973
  ) }),
1170
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_Box3.default, { sx: { pt: 2, justifyContent: "center", display: "flex", padding: "8px" }, children: [
1171
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material12.Button, { fullWidth: true, variant: "outlined", sx: { marginRight: "8px" }, onClick: handleClose, children: "Cancel" }),
1172
- fileIndex !== -1 && !uploading && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material12.Button, { fullWidth: true, sx: { marginLeft: "8px" }, variant: "contained", onClick: onSet, children: "OK" }),
1173
- fileIndex == -1 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1174
- Upload_default,
974
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_DialogActions5.default, { children: [
975
+ cancellable && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: "Cancel" }),
976
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: "Confirm" })
977
+ ] })
978
+ ] })
979
+ ] });
980
+ }
981
+
982
+ // src/CmrTabs/CmrTabs.tsx
983
+ var React10 = __toESM(require("react"));
984
+ var import_Tabs = __toESM(require("@mui/material/Tabs"));
985
+ var import_Tab = __toESM(require("@mui/material/Tab"));
986
+ var import_Container = __toESM(require("@mui/material/Container"));
987
+ var import_Typography2 = __toESM(require("@mui/material/Typography"));
988
+ var import_Box2 = __toESM(require("@mui/material/Box"));
989
+ var import_react7 = require("react");
990
+ var import_jsx_runtime15 = require("react/jsx-runtime");
991
+ function CustomTabPanel(props) {
992
+ const { children, value, index, ...other } = props;
993
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
994
+ "div",
995
+ {
996
+ role: "tabpanel",
997
+ hidden: value !== index,
998
+ id: `simple-tabpanel-${index}`,
999
+ "aria-labelledby": `simple-tab-${index}`,
1000
+ ...other,
1001
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Box2.default, { sx: { p: 0 }, style: { display: value === index ? void 0 : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Typography2.default, { children }) })
1002
+ }
1003
+ );
1004
+ }
1005
+ function a11yProps(index) {
1006
+ return {
1007
+ id: `simple-tab-${index}`,
1008
+ "aria-controls": `simple-tabpanel-${index}`
1009
+ };
1010
+ }
1011
+ function CmrTabs(props) {
1012
+ const [value, setValue] = React10.useState(0);
1013
+ const handleChange = (event, newValue) => {
1014
+ setValue(newValue);
1015
+ if (props.onTabSelected)
1016
+ props.onTabSelected(newValue);
1017
+ };
1018
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1019
+ import_Container.default,
1020
+ {
1021
+ maxWidth: "lg",
1022
+ sx: {
1023
+ flex: 1,
1024
+ display: "flex",
1025
+ flexDirection: "column",
1026
+ mt: 4
1027
+ },
1028
+ children: [
1029
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Box2.default, { sx: { borderBottom: 1, borderColor: "divider", mb: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1030
+ import_Tabs.default,
1175
1031
  {
1176
- ...props,
1177
- color: "info",
1178
- fullWidth: true,
1179
- onUploaded: (res, file) => {
1180
- console.log("calling Setup level on uploaded");
1181
- console.log(props.onUploaded);
1182
- selectFileIndex(props.fileSelection.length);
1183
- props.onUploaded(res, file);
1184
- setOpen(false);
1185
- },
1186
- fileExtension: props.fileExtension,
1187
- uploadHandler: props.uploadHandler,
1188
- uploadStarted: () => {
1189
- setUploading(true);
1190
- props.onSelected(void 0);
1191
- },
1192
- uploadProgressed: (progress2) => {
1193
- setOpen(false);
1194
- setProgress(progress2);
1032
+ value,
1033
+ onChange: handleChange,
1034
+ "aria-label": "basic tabs example",
1035
+ textColor: "inherit",
1036
+ TabIndicatorProps: {
1037
+ style: {
1038
+ backgroundColor: "#580F8B"
1039
+ }
1195
1040
  },
1196
- uploadEnded: () => setUploading(false)
1041
+ children: props.tabList.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Tab.default, { sx: { color: value == index ? "#580F8B" : void 0 }, style: { fontSize: "14px", textTransform: "uppercase", fontWeight: 400 }, label: tab.text, ...a11yProps(index) }))
1197
1042
  }
1043
+ ) }),
1044
+ props.tabList.map(
1045
+ (tab, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CustomTabPanel, { value, index, children: (0, import_react7.cloneElement)(tab.children, {
1046
+ visible: value == index
1047
+ }) })
1198
1048
  )
1199
- ] })
1200
- ] })
1201
- ] });
1202
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react8.Fragment, { children: [
1203
- uploading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_material12.Button, { variant: "contained", style: { ...props.style, textTransform: "none" }, sx: { overflowWrap: "inherit" }, color: "primary", disabled: uploading, children: [
1204
- "Uploading ",
1205
- progress,
1206
- "%"
1207
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1208
- import_material12.Button,
1209
- {
1210
- variant: props.chosenFile == void 0 ? "contained" : "outlined",
1211
- color: "info",
1212
- onClick: handleClickOpen,
1213
- sx: { marginRight: "10pt" },
1214
- style: { ...props.style, textTransform: "none" },
1215
- children: props.chosenFile == void 0 ? props.buttonText ? props.buttonText : "Choose" : props.chosenFile
1216
- }
1217
- ),
1218
- selectionDialog
1219
- ] });
1049
+ ]
1050
+ }
1051
+ );
1052
+ }
1053
+
1054
+ // src/CmrComponents/checkbox/Checkbox.tsx
1055
+ var import_material10 = require("@mui/material");
1056
+ var import_material11 = require("@mui/material");
1057
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1058
+ var CmrCheckbox = (props) => {
1059
+ const { defaultChecked, onChange, children, ...rest } = props;
1060
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1061
+ import_material11.FormControlLabel,
1062
+ {
1063
+ disabled: props.disabled,
1064
+ style: props.style,
1065
+ className: props.className,
1066
+ control: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material10.Checkbox, { style: props.style, checked: props.checked, defaultChecked, onChange }),
1067
+ label: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label_default, { children: props.children }),
1068
+ sx: props.sx,
1069
+ labelPlacement: "end"
1070
+ }
1071
+ );
1072
+ };
1073
+ var Checkbox_default = CmrCheckbox;
1074
+
1075
+ // src/CmrComponents/input-number/InputNumber.tsx
1076
+ var import_antd2 = require("antd");
1077
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1078
+ var CmrInputNumber = (props) => {
1079
+ const { defaultValue, style, max, min, value, onChange, children, ...rest } = props;
1080
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_antd2.InputNumber, { defaultValue, max, style, min, value, onChange, ...rest, children });
1220
1081
  };
1221
- var SelectUpload_default = CMRSelectUpload;
1082
+ var InputNumber_default = CmrInputNumber;
1222
1083
 
1223
1084
  // src/CmrTable/CmrTable.tsx
1224
1085
  var import_x_data_grid = require("@mui/x-data-grid");
1225
- var import_jsx_runtime20 = require("react/jsx-runtime");
1086
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1226
1087
  var CmrTable = (props) => {
1227
1088
  const {
1228
1089
  dataSource,
@@ -1234,7 +1095,7 @@ var CmrTable = (props) => {
1234
1095
  showCheckbox = true,
1235
1096
  ...rest
1236
1097
  } = props;
1237
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1098
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1238
1099
  import_x_data_grid.DataGrid,
1239
1100
  {
1240
1101
  rows: dataSource ? dataSource.map((row) => ({
@@ -1260,7 +1121,6 @@ var CmrTable_default = CmrTable;
1260
1121
  var CmrTable2 = CmrTable_default;
1261
1122
  // Annotate the CommonJS export names for ESM import in node:
1262
1123
  0 && (module.exports = {
1263
- CMRSelectUpload,
1264
1124
  CMRUpload,
1265
1125
  CmrButton,
1266
1126
  CmrCheckbox,
@@ -1276,7 +1136,5 @@ var CmrTable2 = CmrTable_default;
1276
1136
  CmrRadioGroup,
1277
1137
  CmrSelect,
1278
1138
  CmrTable,
1279
- CmrTabs,
1280
- CmrTooltip,
1281
- CmrUploadWindow
1139
+ CmrTabs
1282
1140
  });