cloudmr-ux 1.3.5 → 1.3.7
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 +10 -2
- package/dist/index.mjs +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -321,6 +321,7 @@ function CmrUploadWindow({
|
|
|
321
321
|
return;
|
|
322
322
|
return fileName.split(".").pop();
|
|
323
323
|
};
|
|
324
|
+
const INVALID_ALIAS_REGEX = /[ .,:%><]/;
|
|
324
325
|
const handleConfirm = () => {
|
|
325
326
|
if (uploadedFiles.length === 0) {
|
|
326
327
|
setInfoOpen(true);
|
|
@@ -336,6 +337,13 @@ function CmrUploadWindow({
|
|
|
336
337
|
setTimeout(() => setInfoOpen(false), 2500);
|
|
337
338
|
return;
|
|
338
339
|
}
|
|
340
|
+
if (INVALID_ALIAS_REGEX.test(fileAlias)) {
|
|
341
|
+
setInfoOpen(true);
|
|
342
|
+
setInfoStyle("error");
|
|
343
|
+
setWarningText("Alias contains invalid characters ( . , : % > < or spaces )");
|
|
344
|
+
setTimeout(() => setInfoOpen(false), 3e3);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
339
347
|
setOpen(false);
|
|
340
348
|
upload(uploadedFiles[0], fileAlias, locationSelection).then((response) => {
|
|
341
349
|
console.log(response);
|
|
@@ -594,7 +602,7 @@ function CmrUploadWindow({
|
|
|
594
602
|
import_Button.default,
|
|
595
603
|
{
|
|
596
604
|
color: "inherit",
|
|
597
|
-
|
|
605
|
+
variant: "outlined",
|
|
598
606
|
disabled: UpBtnDisabled,
|
|
599
607
|
onClick: handleClose,
|
|
600
608
|
children: "Cancel"
|
|
@@ -857,7 +865,7 @@ function CmrConfirmation({
|
|
|
857
865
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogContent3.default, { sx: { width }, children: [
|
|
858
866
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_DialogContentText2.default, { alignContent: "center", children: message }),
|
|
859
867
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogActions3.default, { className: "mt-4", children: [
|
|
860
|
-
cancellable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: cancelText }),
|
|
868
|
+
cancellable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
|
|
861
869
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
862
870
|
] })
|
|
863
871
|
] })
|
package/dist/index.mjs
CHANGED
|
@@ -273,6 +273,7 @@ function CmrUploadWindow({
|
|
|
273
273
|
return;
|
|
274
274
|
return fileName.split(".").pop();
|
|
275
275
|
};
|
|
276
|
+
const INVALID_ALIAS_REGEX = /[ .,:%><]/;
|
|
276
277
|
const handleConfirm = () => {
|
|
277
278
|
if (uploadedFiles.length === 0) {
|
|
278
279
|
setInfoOpen(true);
|
|
@@ -288,6 +289,13 @@ function CmrUploadWindow({
|
|
|
288
289
|
setTimeout(() => setInfoOpen(false), 2500);
|
|
289
290
|
return;
|
|
290
291
|
}
|
|
292
|
+
if (INVALID_ALIAS_REGEX.test(fileAlias)) {
|
|
293
|
+
setInfoOpen(true);
|
|
294
|
+
setInfoStyle("error");
|
|
295
|
+
setWarningText("Alias contains invalid characters ( . , : % > < or spaces )");
|
|
296
|
+
setTimeout(() => setInfoOpen(false), 3e3);
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
291
299
|
setOpen(false);
|
|
292
300
|
upload(uploadedFiles[0], fileAlias, locationSelection).then((response) => {
|
|
293
301
|
console.log(response);
|
|
@@ -546,7 +554,7 @@ function CmrUploadWindow({
|
|
|
546
554
|
Button2,
|
|
547
555
|
{
|
|
548
556
|
color: "inherit",
|
|
549
|
-
|
|
557
|
+
variant: "outlined",
|
|
550
558
|
disabled: UpBtnDisabled,
|
|
551
559
|
onClick: handleClose,
|
|
552
560
|
children: "Cancel"
|
|
@@ -809,7 +817,7 @@ function CmrConfirmation({
|
|
|
809
817
|
/* @__PURE__ */ jsxs8(DialogContent3, { sx: { width }, children: [
|
|
810
818
|
/* @__PURE__ */ jsx12(DialogContentText2, { alignContent: "center", children: message }),
|
|
811
819
|
/* @__PURE__ */ jsxs8(DialogActions3, { className: "mt-4", children: [
|
|
812
|
-
cancellable && /* @__PURE__ */ jsx12(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: cancelText }),
|
|
820
|
+
cancellable && /* @__PURE__ */ jsx12(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
|
|
813
821
|
/* @__PURE__ */ jsx12(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
814
822
|
] })
|
|
815
823
|
] })
|