cloudmr-ux 1.9.0 → 1.9.2
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.d.ts +11 -5
- package/dist/index.js +24 -12
- package/dist/index.mjs +29 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -161,18 +161,24 @@ declare function CmrNameDialog(props: {
|
|
|
161
161
|
setOpen: (open: boolean) => void;
|
|
162
162
|
}): react_jsx_runtime.JSX.Element;
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
type ExtraButton = {
|
|
165
|
+
text: string;
|
|
166
|
+
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
167
|
+
onClick: () => void;
|
|
168
|
+
};
|
|
169
|
+
declare function CmrConfirmation({ name, message, cancelText, confirmText, color, open, setOpen, confirmCallback, cancelCallback, cancellable, width, extraButtons, }: {
|
|
165
170
|
name: string | undefined;
|
|
166
|
-
cancelText?: string;
|
|
167
171
|
message: string | undefined;
|
|
168
|
-
|
|
172
|
+
cancelText?: string;
|
|
173
|
+
confirmText?: string;
|
|
174
|
+
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
169
175
|
open: boolean;
|
|
170
176
|
setOpen: (open: boolean) => void;
|
|
171
177
|
confirmCallback?: () => void;
|
|
172
|
-
cancellable?: boolean;
|
|
173
178
|
cancelCallback?: () => void;
|
|
179
|
+
cancellable?: boolean;
|
|
174
180
|
width?: number;
|
|
175
|
-
|
|
181
|
+
extraButtons?: ExtraButton[];
|
|
176
182
|
}): react_jsx_runtime.JSX.Element;
|
|
177
183
|
|
|
178
184
|
declare function CmrDeletionDialog(props: {
|
package/dist/index.js
CHANGED
|
@@ -843,7 +843,6 @@ function CmrNameDialog(props) {
|
|
|
843
843
|
}
|
|
844
844
|
|
|
845
845
|
// src/CmrComponents/dialogue/Confirmation.tsx
|
|
846
|
-
var React7 = __toESM(require("react"));
|
|
847
846
|
var import_Dialog3 = __toESM(require("@mui/material/Dialog"));
|
|
848
847
|
var import_DialogActions3 = __toESM(require("@mui/material/DialogActions"));
|
|
849
848
|
var import_DialogContent3 = __toESM(require("@mui/material/DialogContent"));
|
|
@@ -854,18 +853,18 @@ function CmrConfirmation({
|
|
|
854
853
|
name,
|
|
855
854
|
message,
|
|
856
855
|
cancelText = "Cancel",
|
|
856
|
+
confirmText = "Confirm",
|
|
857
857
|
color,
|
|
858
858
|
open,
|
|
859
859
|
setOpen,
|
|
860
860
|
confirmCallback = () => {
|
|
861
861
|
},
|
|
862
|
-
confirmText = "Confirm",
|
|
863
|
-
cancellable = false,
|
|
864
862
|
cancelCallback = () => {
|
|
865
863
|
},
|
|
866
|
-
|
|
864
|
+
cancellable = false,
|
|
865
|
+
width,
|
|
866
|
+
extraButtons = []
|
|
867
867
|
}) {
|
|
868
|
-
const [text, setText] = React7.useState("");
|
|
869
868
|
const handleClose = () => {
|
|
870
869
|
setOpen(false);
|
|
871
870
|
};
|
|
@@ -883,6 +882,19 @@ function CmrConfirmation({
|
|
|
883
882
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_DialogContentText2.default, { alignContent: "center", children: message }),
|
|
884
883
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogActions3.default, { className: "mt-4", children: [
|
|
885
884
|
cancellable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: cancelText }),
|
|
885
|
+
extraButtons.map((btn, idx) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
886
|
+
CmrButton_default,
|
|
887
|
+
{
|
|
888
|
+
variant: "contained",
|
|
889
|
+
color: btn.color || "primary",
|
|
890
|
+
onClick: () => {
|
|
891
|
+
btn.onClick();
|
|
892
|
+
handleClose();
|
|
893
|
+
},
|
|
894
|
+
children: btn.text
|
|
895
|
+
},
|
|
896
|
+
idx
|
|
897
|
+
)),
|
|
886
898
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
887
899
|
] })
|
|
888
900
|
] })
|
|
@@ -890,7 +902,7 @@ function CmrConfirmation({
|
|
|
890
902
|
}
|
|
891
903
|
|
|
892
904
|
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
893
|
-
var
|
|
905
|
+
var React7 = __toESM(require("react"));
|
|
894
906
|
var import_TextField3 = __toESM(require("@mui/material/TextField"));
|
|
895
907
|
var import_Dialog4 = __toESM(require("@mui/material/Dialog"));
|
|
896
908
|
var import_DialogActions4 = __toESM(require("@mui/material/DialogActions"));
|
|
@@ -899,8 +911,8 @@ var import_DialogContentText3 = __toESM(require("@mui/material/DialogContentText
|
|
|
899
911
|
var import_DialogTitle4 = __toESM(require("@mui/material/DialogTitle"));
|
|
900
912
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
901
913
|
function CmrDeletionDialog(props) {
|
|
902
|
-
const [open, setOpen] =
|
|
903
|
-
const [text, setText] =
|
|
914
|
+
const [open, setOpen] = React7.useState(true);
|
|
915
|
+
const [text, setText] = React7.useState("");
|
|
904
916
|
const handleClickOpen = () => {
|
|
905
917
|
setOpen(true);
|
|
906
918
|
};
|
|
@@ -943,7 +955,7 @@ function CmrDeletionDialog(props) {
|
|
|
943
955
|
}
|
|
944
956
|
|
|
945
957
|
// src/CmrComponents/dialogue/EditConfirmation.tsx
|
|
946
|
-
var
|
|
958
|
+
var React8 = __toESM(require("react"));
|
|
947
959
|
var import_TextField4 = __toESM(require("@mui/material/TextField"));
|
|
948
960
|
var import_Dialog5 = __toESM(require("@mui/material/Dialog"));
|
|
949
961
|
var import_DialogActions5 = __toESM(require("@mui/material/DialogActions"));
|
|
@@ -967,7 +979,7 @@ function CmrEditConfirmation({
|
|
|
967
979
|
},
|
|
968
980
|
suffix = ""
|
|
969
981
|
}) {
|
|
970
|
-
const [text, setText] =
|
|
982
|
+
const [text, setText] = React8.useState(defaultText);
|
|
971
983
|
(0, import_react6.useEffect)(() => {
|
|
972
984
|
if (open)
|
|
973
985
|
setText(defaultText);
|
|
@@ -1008,7 +1020,7 @@ function CmrEditConfirmation({
|
|
|
1008
1020
|
}
|
|
1009
1021
|
|
|
1010
1022
|
// src/CmrTabs/CmrTabs.tsx
|
|
1011
|
-
var
|
|
1023
|
+
var React9 = __toESM(require("react"));
|
|
1012
1024
|
var import_Tabs = __toESM(require("@mui/material/Tabs"));
|
|
1013
1025
|
var import_Tab = __toESM(require("@mui/material/Tab"));
|
|
1014
1026
|
var import_Container = __toESM(require("@mui/material/Container"));
|
|
@@ -1037,7 +1049,7 @@ function a11yProps(index) {
|
|
|
1037
1049
|
};
|
|
1038
1050
|
}
|
|
1039
1051
|
function CmrTabs(props) {
|
|
1040
|
-
const [value, setValue] =
|
|
1052
|
+
const [value, setValue] = React9.useState(0);
|
|
1041
1053
|
const handleChange = (event, newValue) => {
|
|
1042
1054
|
setValue(newValue);
|
|
1043
1055
|
if (props.onTabSelected)
|
package/dist/index.mjs
CHANGED
|
@@ -795,7 +795,6 @@ function CmrNameDialog(props) {
|
|
|
795
795
|
}
|
|
796
796
|
|
|
797
797
|
// src/CmrComponents/dialogue/Confirmation.tsx
|
|
798
|
-
import * as React7 from "react";
|
|
799
798
|
import Dialog3 from "@mui/material/Dialog";
|
|
800
799
|
import DialogActions3 from "@mui/material/DialogActions";
|
|
801
800
|
import DialogContent3 from "@mui/material/DialogContent";
|
|
@@ -806,18 +805,18 @@ function CmrConfirmation({
|
|
|
806
805
|
name,
|
|
807
806
|
message,
|
|
808
807
|
cancelText = "Cancel",
|
|
808
|
+
confirmText = "Confirm",
|
|
809
809
|
color,
|
|
810
810
|
open,
|
|
811
811
|
setOpen,
|
|
812
812
|
confirmCallback = () => {
|
|
813
813
|
},
|
|
814
|
-
confirmText = "Confirm",
|
|
815
|
-
cancellable = false,
|
|
816
814
|
cancelCallback = () => {
|
|
817
815
|
},
|
|
818
|
-
|
|
816
|
+
cancellable = false,
|
|
817
|
+
width,
|
|
818
|
+
extraButtons = []
|
|
819
819
|
}) {
|
|
820
|
-
const [text, setText] = React7.useState("");
|
|
821
820
|
const handleClose = () => {
|
|
822
821
|
setOpen(false);
|
|
823
822
|
};
|
|
@@ -835,6 +834,19 @@ function CmrConfirmation({
|
|
|
835
834
|
/* @__PURE__ */ jsx12(DialogContentText2, { alignContent: "center", children: message }),
|
|
836
835
|
/* @__PURE__ */ jsxs8(DialogActions3, { className: "mt-4", children: [
|
|
837
836
|
cancellable && /* @__PURE__ */ jsx12(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: cancelText }),
|
|
837
|
+
extraButtons.map((btn, idx) => /* @__PURE__ */ jsx12(
|
|
838
|
+
CmrButton_default,
|
|
839
|
+
{
|
|
840
|
+
variant: "contained",
|
|
841
|
+
color: btn.color || "primary",
|
|
842
|
+
onClick: () => {
|
|
843
|
+
btn.onClick();
|
|
844
|
+
handleClose();
|
|
845
|
+
},
|
|
846
|
+
children: btn.text
|
|
847
|
+
},
|
|
848
|
+
idx
|
|
849
|
+
)),
|
|
838
850
|
/* @__PURE__ */ jsx12(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
839
851
|
] })
|
|
840
852
|
] })
|
|
@@ -842,7 +854,7 @@ function CmrConfirmation({
|
|
|
842
854
|
}
|
|
843
855
|
|
|
844
856
|
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
845
|
-
import * as
|
|
857
|
+
import * as React7 from "react";
|
|
846
858
|
import TextField3 from "@mui/material/TextField";
|
|
847
859
|
import Dialog4 from "@mui/material/Dialog";
|
|
848
860
|
import DialogActions4 from "@mui/material/DialogActions";
|
|
@@ -851,8 +863,8 @@ import DialogContentText3 from "@mui/material/DialogContentText";
|
|
|
851
863
|
import DialogTitle4 from "@mui/material/DialogTitle";
|
|
852
864
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
853
865
|
function CmrDeletionDialog(props) {
|
|
854
|
-
const [open, setOpen] =
|
|
855
|
-
const [text, setText] =
|
|
866
|
+
const [open, setOpen] = React7.useState(true);
|
|
867
|
+
const [text, setText] = React7.useState("");
|
|
856
868
|
const handleClickOpen = () => {
|
|
857
869
|
setOpen(true);
|
|
858
870
|
};
|
|
@@ -895,7 +907,7 @@ function CmrDeletionDialog(props) {
|
|
|
895
907
|
}
|
|
896
908
|
|
|
897
909
|
// src/CmrComponents/dialogue/EditConfirmation.tsx
|
|
898
|
-
import * as
|
|
910
|
+
import * as React8 from "react";
|
|
899
911
|
import TextField4 from "@mui/material/TextField";
|
|
900
912
|
import Dialog5 from "@mui/material/Dialog";
|
|
901
913
|
import DialogActions5 from "@mui/material/DialogActions";
|
|
@@ -919,7 +931,7 @@ function CmrEditConfirmation({
|
|
|
919
931
|
},
|
|
920
932
|
suffix = ""
|
|
921
933
|
}) {
|
|
922
|
-
const [text, setText] =
|
|
934
|
+
const [text, setText] = React8.useState(defaultText);
|
|
923
935
|
useEffect2(() => {
|
|
924
936
|
if (open)
|
|
925
937
|
setText(defaultText);
|
|
@@ -960,7 +972,7 @@ function CmrEditConfirmation({
|
|
|
960
972
|
}
|
|
961
973
|
|
|
962
974
|
// src/CmrTabs/CmrTabs.tsx
|
|
963
|
-
import * as
|
|
975
|
+
import * as React9 from "react";
|
|
964
976
|
import Tabs from "@mui/material/Tabs";
|
|
965
977
|
import Tab from "@mui/material/Tab";
|
|
966
978
|
import Container from "@mui/material/Container";
|
|
@@ -989,7 +1001,7 @@ function a11yProps(index) {
|
|
|
989
1001
|
};
|
|
990
1002
|
}
|
|
991
1003
|
function CmrTabs(props) {
|
|
992
|
-
const [value, setValue] =
|
|
1004
|
+
const [value, setValue] = React9.useState(0);
|
|
993
1005
|
const handleChange = (event, newValue) => {
|
|
994
1006
|
setValue(newValue);
|
|
995
1007
|
if (props.onTabSelected)
|
|
@@ -1062,7 +1074,7 @@ var CmrInputNumber = (props) => {
|
|
|
1062
1074
|
var InputNumber_default = CmrInputNumber;
|
|
1063
1075
|
|
|
1064
1076
|
// src/CmrComponents/select-upload/SelectUpload.tsx
|
|
1065
|
-
import
|
|
1077
|
+
import React10, { Fragment } from "react";
|
|
1066
1078
|
import { Button as Button4 } from "@mui/material";
|
|
1067
1079
|
import Select2 from "react-select";
|
|
1068
1080
|
import Dialog6 from "@mui/material/Dialog";
|
|
@@ -1082,10 +1094,10 @@ function checkExtension(filename, allowed) {
|
|
|
1082
1094
|
}
|
|
1083
1095
|
}
|
|
1084
1096
|
var CMRSelectUpload = (props) => {
|
|
1085
|
-
let [open, setOpen] =
|
|
1086
|
-
let [fileIndex, selectFileIndex] =
|
|
1087
|
-
let [uploading, setUploading] =
|
|
1088
|
-
const [progress, setProgress] =
|
|
1097
|
+
let [open, setOpen] = React10.useState(false);
|
|
1098
|
+
let [fileIndex, selectFileIndex] = React10.useState(-1);
|
|
1099
|
+
let [uploading, setUploading] = React10.useState(false);
|
|
1100
|
+
const [progress, setProgress] = React10.useState(0);
|
|
1089
1101
|
const handleClickOpen = () => {
|
|
1090
1102
|
selectFileIndex(-1);
|
|
1091
1103
|
setOpen(true);
|