cloudmr-ux 1.9.1 → 1.9.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/dist/index.d.ts +11 -5
- package/dist/index.js +30 -12
- package/dist/index.mjs +35 -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,25 @@ 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: "outlined",
|
|
889
|
+
color: btn.color || "primary",
|
|
890
|
+
onClick: () => {
|
|
891
|
+
btn.onClick();
|
|
892
|
+
handleClose();
|
|
893
|
+
},
|
|
894
|
+
sx: {
|
|
895
|
+
backgroundColor: "#f3e5f5",
|
|
896
|
+
"&:hover": {
|
|
897
|
+
backgroundColor: "#e1bee7"
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
children: btn.text
|
|
901
|
+
},
|
|
902
|
+
idx
|
|
903
|
+
)),
|
|
886
904
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
887
905
|
] })
|
|
888
906
|
] })
|
|
@@ -890,7 +908,7 @@ function CmrConfirmation({
|
|
|
890
908
|
}
|
|
891
909
|
|
|
892
910
|
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
893
|
-
var
|
|
911
|
+
var React7 = __toESM(require("react"));
|
|
894
912
|
var import_TextField3 = __toESM(require("@mui/material/TextField"));
|
|
895
913
|
var import_Dialog4 = __toESM(require("@mui/material/Dialog"));
|
|
896
914
|
var import_DialogActions4 = __toESM(require("@mui/material/DialogActions"));
|
|
@@ -899,8 +917,8 @@ var import_DialogContentText3 = __toESM(require("@mui/material/DialogContentText
|
|
|
899
917
|
var import_DialogTitle4 = __toESM(require("@mui/material/DialogTitle"));
|
|
900
918
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
901
919
|
function CmrDeletionDialog(props) {
|
|
902
|
-
const [open, setOpen] =
|
|
903
|
-
const [text, setText] =
|
|
920
|
+
const [open, setOpen] = React7.useState(true);
|
|
921
|
+
const [text, setText] = React7.useState("");
|
|
904
922
|
const handleClickOpen = () => {
|
|
905
923
|
setOpen(true);
|
|
906
924
|
};
|
|
@@ -943,7 +961,7 @@ function CmrDeletionDialog(props) {
|
|
|
943
961
|
}
|
|
944
962
|
|
|
945
963
|
// src/CmrComponents/dialogue/EditConfirmation.tsx
|
|
946
|
-
var
|
|
964
|
+
var React8 = __toESM(require("react"));
|
|
947
965
|
var import_TextField4 = __toESM(require("@mui/material/TextField"));
|
|
948
966
|
var import_Dialog5 = __toESM(require("@mui/material/Dialog"));
|
|
949
967
|
var import_DialogActions5 = __toESM(require("@mui/material/DialogActions"));
|
|
@@ -967,7 +985,7 @@ function CmrEditConfirmation({
|
|
|
967
985
|
},
|
|
968
986
|
suffix = ""
|
|
969
987
|
}) {
|
|
970
|
-
const [text, setText] =
|
|
988
|
+
const [text, setText] = React8.useState(defaultText);
|
|
971
989
|
(0, import_react6.useEffect)(() => {
|
|
972
990
|
if (open)
|
|
973
991
|
setText(defaultText);
|
|
@@ -1008,7 +1026,7 @@ function CmrEditConfirmation({
|
|
|
1008
1026
|
}
|
|
1009
1027
|
|
|
1010
1028
|
// src/CmrTabs/CmrTabs.tsx
|
|
1011
|
-
var
|
|
1029
|
+
var React9 = __toESM(require("react"));
|
|
1012
1030
|
var import_Tabs = __toESM(require("@mui/material/Tabs"));
|
|
1013
1031
|
var import_Tab = __toESM(require("@mui/material/Tab"));
|
|
1014
1032
|
var import_Container = __toESM(require("@mui/material/Container"));
|
|
@@ -1037,7 +1055,7 @@ function a11yProps(index) {
|
|
|
1037
1055
|
};
|
|
1038
1056
|
}
|
|
1039
1057
|
function CmrTabs(props) {
|
|
1040
|
-
const [value, setValue] =
|
|
1058
|
+
const [value, setValue] = React9.useState(0);
|
|
1041
1059
|
const handleChange = (event, newValue) => {
|
|
1042
1060
|
setValue(newValue);
|
|
1043
1061
|
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,25 @@ 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: "outlined",
|
|
841
|
+
color: btn.color || "primary",
|
|
842
|
+
onClick: () => {
|
|
843
|
+
btn.onClick();
|
|
844
|
+
handleClose();
|
|
845
|
+
},
|
|
846
|
+
sx: {
|
|
847
|
+
backgroundColor: "#f3e5f5",
|
|
848
|
+
"&:hover": {
|
|
849
|
+
backgroundColor: "#e1bee7"
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
children: btn.text
|
|
853
|
+
},
|
|
854
|
+
idx
|
|
855
|
+
)),
|
|
838
856
|
/* @__PURE__ */ jsx12(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
839
857
|
] })
|
|
840
858
|
] })
|
|
@@ -842,7 +860,7 @@ function CmrConfirmation({
|
|
|
842
860
|
}
|
|
843
861
|
|
|
844
862
|
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
845
|
-
import * as
|
|
863
|
+
import * as React7 from "react";
|
|
846
864
|
import TextField3 from "@mui/material/TextField";
|
|
847
865
|
import Dialog4 from "@mui/material/Dialog";
|
|
848
866
|
import DialogActions4 from "@mui/material/DialogActions";
|
|
@@ -851,8 +869,8 @@ import DialogContentText3 from "@mui/material/DialogContentText";
|
|
|
851
869
|
import DialogTitle4 from "@mui/material/DialogTitle";
|
|
852
870
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
853
871
|
function CmrDeletionDialog(props) {
|
|
854
|
-
const [open, setOpen] =
|
|
855
|
-
const [text, setText] =
|
|
872
|
+
const [open, setOpen] = React7.useState(true);
|
|
873
|
+
const [text, setText] = React7.useState("");
|
|
856
874
|
const handleClickOpen = () => {
|
|
857
875
|
setOpen(true);
|
|
858
876
|
};
|
|
@@ -895,7 +913,7 @@ function CmrDeletionDialog(props) {
|
|
|
895
913
|
}
|
|
896
914
|
|
|
897
915
|
// src/CmrComponents/dialogue/EditConfirmation.tsx
|
|
898
|
-
import * as
|
|
916
|
+
import * as React8 from "react";
|
|
899
917
|
import TextField4 from "@mui/material/TextField";
|
|
900
918
|
import Dialog5 from "@mui/material/Dialog";
|
|
901
919
|
import DialogActions5 from "@mui/material/DialogActions";
|
|
@@ -919,7 +937,7 @@ function CmrEditConfirmation({
|
|
|
919
937
|
},
|
|
920
938
|
suffix = ""
|
|
921
939
|
}) {
|
|
922
|
-
const [text, setText] =
|
|
940
|
+
const [text, setText] = React8.useState(defaultText);
|
|
923
941
|
useEffect2(() => {
|
|
924
942
|
if (open)
|
|
925
943
|
setText(defaultText);
|
|
@@ -960,7 +978,7 @@ function CmrEditConfirmation({
|
|
|
960
978
|
}
|
|
961
979
|
|
|
962
980
|
// src/CmrTabs/CmrTabs.tsx
|
|
963
|
-
import * as
|
|
981
|
+
import * as React9 from "react";
|
|
964
982
|
import Tabs from "@mui/material/Tabs";
|
|
965
983
|
import Tab from "@mui/material/Tab";
|
|
966
984
|
import Container from "@mui/material/Container";
|
|
@@ -989,7 +1007,7 @@ function a11yProps(index) {
|
|
|
989
1007
|
};
|
|
990
1008
|
}
|
|
991
1009
|
function CmrTabs(props) {
|
|
992
|
-
const [value, setValue] =
|
|
1010
|
+
const [value, setValue] = React9.useState(0);
|
|
993
1011
|
const handleChange = (event, newValue) => {
|
|
994
1012
|
setValue(newValue);
|
|
995
1013
|
if (props.onTabSelected)
|
|
@@ -1062,7 +1080,7 @@ var CmrInputNumber = (props) => {
|
|
|
1062
1080
|
var InputNumber_default = CmrInputNumber;
|
|
1063
1081
|
|
|
1064
1082
|
// src/CmrComponents/select-upload/SelectUpload.tsx
|
|
1065
|
-
import
|
|
1083
|
+
import React10, { Fragment } from "react";
|
|
1066
1084
|
import { Button as Button4 } from "@mui/material";
|
|
1067
1085
|
import Select2 from "react-select";
|
|
1068
1086
|
import Dialog6 from "@mui/material/Dialog";
|
|
@@ -1082,10 +1100,10 @@ function checkExtension(filename, allowed) {
|
|
|
1082
1100
|
}
|
|
1083
1101
|
}
|
|
1084
1102
|
var CMRSelectUpload = (props) => {
|
|
1085
|
-
let [open, setOpen] =
|
|
1086
|
-
let [fileIndex, selectFileIndex] =
|
|
1087
|
-
let [uploading, setUploading] =
|
|
1088
|
-
const [progress, setProgress] =
|
|
1103
|
+
let [open, setOpen] = React10.useState(false);
|
|
1104
|
+
let [fileIndex, selectFileIndex] = React10.useState(-1);
|
|
1105
|
+
let [uploading, setUploading] = React10.useState(false);
|
|
1106
|
+
const [progress, setProgress] = React10.useState(0);
|
|
1089
1107
|
const handleClickOpen = () => {
|
|
1090
1108
|
selectFileIndex(-1);
|
|
1091
1109
|
setOpen(true);
|