cloudmr-ux 1.9.5 → 1.9.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.d.ts +28 -6
- package/dist/index.js +80 -30
- package/dist/index.mjs +96 -41
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ButtonProps, SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { ButtonProps, FormControlProps, SelectProps, SxProps, Theme } from '@mui/material';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { ReactNode, ChangeEvent, CSSProperties, FC } from 'react';
|
|
5
5
|
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
@@ -41,11 +41,27 @@ declare const CmrRadioGroup: React__default.FC<CmrRadioProps>;
|
|
|
41
41
|
interface Option {
|
|
42
42
|
label: string;
|
|
43
43
|
value: string;
|
|
44
|
+
disabled?: boolean;
|
|
44
45
|
}
|
|
45
46
|
interface CmrSelectProps {
|
|
46
47
|
options: Option[];
|
|
47
48
|
label: string;
|
|
48
49
|
disabled?: boolean;
|
|
50
|
+
/** Controlled value (optional). If provided, component becomes controlled. */
|
|
51
|
+
value?: string;
|
|
52
|
+
/** Fires when selection changes. For controlled usage, update your state here. */
|
|
53
|
+
onChange?: (value: string) => void;
|
|
54
|
+
/** Initial value for uncontrolled mode. Defaults to ''. */
|
|
55
|
+
defaultValue?: string;
|
|
56
|
+
/** Top placeholder item. Shown as first item; disabled so users must pick another. */
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
/** Layout helpers */
|
|
59
|
+
fullWidth?: boolean;
|
|
60
|
+
/** Pass-through styling/props */
|
|
61
|
+
sx?: FormControlProps['sx'];
|
|
62
|
+
className?: string;
|
|
63
|
+
/** Optional passthrough to MUI Select */
|
|
64
|
+
SelectProps?: Partial<SelectProps<string>>;
|
|
49
65
|
}
|
|
50
66
|
declare const CmrSelect: React__default.FC<CmrSelectProps>;
|
|
51
67
|
|
|
@@ -161,18 +177,24 @@ declare function CmrNameDialog(props: {
|
|
|
161
177
|
setOpen: (open: boolean) => void;
|
|
162
178
|
}): react_jsx_runtime.JSX.Element;
|
|
163
179
|
|
|
164
|
-
|
|
180
|
+
type ExtraButton = {
|
|
181
|
+
text: string;
|
|
182
|
+
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
183
|
+
onClick: () => void;
|
|
184
|
+
};
|
|
185
|
+
declare function CmrConfirmation({ name, message, cancelText, confirmText, color, open, setOpen, confirmCallback, cancelCallback, cancellable, width, extraButtons, }: {
|
|
165
186
|
name: string | undefined;
|
|
166
|
-
cancelText?: string;
|
|
167
187
|
message: string | undefined;
|
|
168
|
-
|
|
188
|
+
cancelText?: string;
|
|
189
|
+
confirmText?: string;
|
|
190
|
+
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
|
|
169
191
|
open: boolean;
|
|
170
192
|
setOpen: (open: boolean) => void;
|
|
171
193
|
confirmCallback?: () => void;
|
|
172
|
-
cancellable?: boolean;
|
|
173
194
|
cancelCallback?: () => void;
|
|
195
|
+
cancellable?: boolean;
|
|
174
196
|
width?: number;
|
|
175
|
-
|
|
197
|
+
extraButtons?: ExtraButton[];
|
|
176
198
|
}): react_jsx_runtime.JSX.Element;
|
|
177
199
|
|
|
178
200
|
declare function CmrDeletionDialog(props: {
|
package/dist/index.js
CHANGED
|
@@ -134,26 +134,64 @@ var CmrRadioGroup_default = CmrRadioGroup;
|
|
|
134
134
|
var import_react2 = require("react");
|
|
135
135
|
var import_material5 = require("@mui/material");
|
|
136
136
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
137
|
-
var CmrSelect = ({
|
|
138
|
-
|
|
137
|
+
var CmrSelect = ({
|
|
138
|
+
options,
|
|
139
|
+
label,
|
|
140
|
+
disabled,
|
|
141
|
+
value,
|
|
142
|
+
// controlled value (optional)
|
|
143
|
+
onChange,
|
|
144
|
+
// callback (optional)
|
|
145
|
+
defaultValue = "",
|
|
146
|
+
// for uncontrolled
|
|
147
|
+
placeholder,
|
|
148
|
+
// optional top disabled item
|
|
149
|
+
fullWidth,
|
|
150
|
+
sx,
|
|
151
|
+
className,
|
|
152
|
+
SelectProps: SelectProps2
|
|
153
|
+
}) => {
|
|
154
|
+
const isControlled = value !== void 0;
|
|
155
|
+
const [internalValue, setInternalValue] = (0, import_react2.useState)(defaultValue);
|
|
156
|
+
const currentValue = isControlled ? value : internalValue;
|
|
157
|
+
(0, import_react2.useEffect)(() => {
|
|
158
|
+
if (isControlled) {
|
|
159
|
+
setInternalValue(value);
|
|
160
|
+
}
|
|
161
|
+
}, [isControlled, value]);
|
|
162
|
+
const id = (0, import_react2.useId)();
|
|
163
|
+
const labelId = `${id}-label`;
|
|
139
164
|
const handleChange = (event) => {
|
|
140
|
-
|
|
141
|
-
|
|
165
|
+
const next = event.target.value;
|
|
166
|
+
if (!isControlled)
|
|
167
|
+
setInternalValue(next);
|
|
168
|
+
onChange == null ? void 0 : onChange(next);
|
|
142
169
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
170
|
+
const items = placeholder ? [{ label: placeholder, value: "", disabled: true }, ...options] : options;
|
|
171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
172
|
+
import_material5.FormControl,
|
|
173
|
+
{
|
|
174
|
+
className: className ?? "dropdown-select",
|
|
175
|
+
sx: { minWidth: 200, maxWidth: 400, width: fullWidth ? "100%" : "auto", ...sx },
|
|
176
|
+
disabled,
|
|
177
|
+
fullWidth,
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.InputLabel, { id: labelId, className: "dropdown-label", children: label }),
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
181
|
+
import_material5.Select,
|
|
182
|
+
{
|
|
183
|
+
labelId,
|
|
184
|
+
value: currentValue,
|
|
185
|
+
onChange: handleChange,
|
|
186
|
+
label,
|
|
187
|
+
MenuProps: { classes: { paper: "custom-dropdown" }, ...SelectProps2 == null ? void 0 : SelectProps2.MenuProps },
|
|
188
|
+
...SelectProps2,
|
|
189
|
+
children: items.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.MenuItem, { value: opt.value, disabled: !!opt.disabled, children: opt.label }, `${opt.value}-${opt.label}`))
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
);
|
|
157
195
|
};
|
|
158
196
|
var CmrSelect_default = CmrSelect;
|
|
159
197
|
|
|
@@ -843,7 +881,6 @@ function CmrNameDialog(props) {
|
|
|
843
881
|
}
|
|
844
882
|
|
|
845
883
|
// src/CmrComponents/dialogue/Confirmation.tsx
|
|
846
|
-
var React7 = __toESM(require("react"));
|
|
847
884
|
var import_Dialog3 = __toESM(require("@mui/material/Dialog"));
|
|
848
885
|
var import_DialogActions3 = __toESM(require("@mui/material/DialogActions"));
|
|
849
886
|
var import_DialogContent3 = __toESM(require("@mui/material/DialogContent"));
|
|
@@ -854,18 +891,18 @@ function CmrConfirmation({
|
|
|
854
891
|
name,
|
|
855
892
|
message,
|
|
856
893
|
cancelText = "Cancel",
|
|
894
|
+
confirmText = "Confirm",
|
|
857
895
|
color,
|
|
858
896
|
open,
|
|
859
897
|
setOpen,
|
|
860
898
|
confirmCallback = () => {
|
|
861
899
|
},
|
|
862
|
-
confirmText = "Confirm",
|
|
863
|
-
cancellable = false,
|
|
864
900
|
cancelCallback = () => {
|
|
865
901
|
},
|
|
866
|
-
|
|
902
|
+
cancellable = false,
|
|
903
|
+
width,
|
|
904
|
+
extraButtons = []
|
|
867
905
|
}) {
|
|
868
|
-
const [text, setText] = React7.useState("");
|
|
869
906
|
const handleClose = () => {
|
|
870
907
|
setOpen(false);
|
|
871
908
|
};
|
|
@@ -883,6 +920,19 @@ function CmrConfirmation({
|
|
|
883
920
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_DialogContentText2.default, { alignContent: "center", children: message }),
|
|
884
921
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogActions3.default, { className: "mt-4", children: [
|
|
885
922
|
cancellable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: cancelText }),
|
|
923
|
+
extraButtons.map((btn, idx) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
924
|
+
CmrButton_default,
|
|
925
|
+
{
|
|
926
|
+
variant: "outlined",
|
|
927
|
+
color: btn.color || "success",
|
|
928
|
+
onClick: () => {
|
|
929
|
+
btn.onClick();
|
|
930
|
+
handleClose();
|
|
931
|
+
},
|
|
932
|
+
children: btn.text
|
|
933
|
+
},
|
|
934
|
+
idx
|
|
935
|
+
)),
|
|
886
936
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
887
937
|
] })
|
|
888
938
|
] })
|
|
@@ -890,7 +940,7 @@ function CmrConfirmation({
|
|
|
890
940
|
}
|
|
891
941
|
|
|
892
942
|
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
893
|
-
var
|
|
943
|
+
var React7 = __toESM(require("react"));
|
|
894
944
|
var import_TextField3 = __toESM(require("@mui/material/TextField"));
|
|
895
945
|
var import_Dialog4 = __toESM(require("@mui/material/Dialog"));
|
|
896
946
|
var import_DialogActions4 = __toESM(require("@mui/material/DialogActions"));
|
|
@@ -899,8 +949,8 @@ var import_DialogContentText3 = __toESM(require("@mui/material/DialogContentText
|
|
|
899
949
|
var import_DialogTitle4 = __toESM(require("@mui/material/DialogTitle"));
|
|
900
950
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
901
951
|
function CmrDeletionDialog(props) {
|
|
902
|
-
const [open, setOpen] =
|
|
903
|
-
const [text, setText] =
|
|
952
|
+
const [open, setOpen] = React7.useState(true);
|
|
953
|
+
const [text, setText] = React7.useState("");
|
|
904
954
|
const handleClickOpen = () => {
|
|
905
955
|
setOpen(true);
|
|
906
956
|
};
|
|
@@ -943,7 +993,7 @@ function CmrDeletionDialog(props) {
|
|
|
943
993
|
}
|
|
944
994
|
|
|
945
995
|
// src/CmrComponents/dialogue/EditConfirmation.tsx
|
|
946
|
-
var
|
|
996
|
+
var React8 = __toESM(require("react"));
|
|
947
997
|
var import_TextField4 = __toESM(require("@mui/material/TextField"));
|
|
948
998
|
var import_Dialog5 = __toESM(require("@mui/material/Dialog"));
|
|
949
999
|
var import_DialogActions5 = __toESM(require("@mui/material/DialogActions"));
|
|
@@ -967,7 +1017,7 @@ function CmrEditConfirmation({
|
|
|
967
1017
|
},
|
|
968
1018
|
suffix = ""
|
|
969
1019
|
}) {
|
|
970
|
-
const [text, setText] =
|
|
1020
|
+
const [text, setText] = React8.useState(defaultText);
|
|
971
1021
|
(0, import_react6.useEffect)(() => {
|
|
972
1022
|
if (open)
|
|
973
1023
|
setText(defaultText);
|
|
@@ -1008,7 +1058,7 @@ function CmrEditConfirmation({
|
|
|
1008
1058
|
}
|
|
1009
1059
|
|
|
1010
1060
|
// src/CmrTabs/CmrTabs.tsx
|
|
1011
|
-
var
|
|
1061
|
+
var React9 = __toESM(require("react"));
|
|
1012
1062
|
var import_Tabs = __toESM(require("@mui/material/Tabs"));
|
|
1013
1063
|
var import_Tab = __toESM(require("@mui/material/Tab"));
|
|
1014
1064
|
var import_Container = __toESM(require("@mui/material/Container"));
|
|
@@ -1037,7 +1087,7 @@ function a11yProps(index) {
|
|
|
1037
1087
|
};
|
|
1038
1088
|
}
|
|
1039
1089
|
function CmrTabs(props) {
|
|
1040
|
-
const [value, setValue] =
|
|
1090
|
+
const [value, setValue] = React9.useState(0);
|
|
1041
1091
|
const handleChange = (event, newValue) => {
|
|
1042
1092
|
setValue(newValue);
|
|
1043
1093
|
if (props.onTabSelected)
|
package/dist/index.mjs
CHANGED
|
@@ -83,29 +83,72 @@ var CmrRadioGroup = ({
|
|
|
83
83
|
var CmrRadioGroup_default = CmrRadioGroup;
|
|
84
84
|
|
|
85
85
|
// src/CmrComponents/CmrSelect/CmrSelect.tsx
|
|
86
|
-
import { useState as useState2 } from "react";
|
|
87
|
-
import {
|
|
86
|
+
import { useEffect, useId, useState as useState2 } from "react";
|
|
87
|
+
import {
|
|
88
|
+
Select,
|
|
89
|
+
MenuItem,
|
|
90
|
+
FormControl as FormControl2,
|
|
91
|
+
InputLabel
|
|
92
|
+
} from "@mui/material";
|
|
88
93
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
89
|
-
var CmrSelect = ({
|
|
90
|
-
|
|
94
|
+
var CmrSelect = ({
|
|
95
|
+
options,
|
|
96
|
+
label,
|
|
97
|
+
disabled,
|
|
98
|
+
value,
|
|
99
|
+
// controlled value (optional)
|
|
100
|
+
onChange,
|
|
101
|
+
// callback (optional)
|
|
102
|
+
defaultValue = "",
|
|
103
|
+
// for uncontrolled
|
|
104
|
+
placeholder,
|
|
105
|
+
// optional top disabled item
|
|
106
|
+
fullWidth,
|
|
107
|
+
sx,
|
|
108
|
+
className,
|
|
109
|
+
SelectProps: SelectProps2
|
|
110
|
+
}) => {
|
|
111
|
+
const isControlled = value !== void 0;
|
|
112
|
+
const [internalValue, setInternalValue] = useState2(defaultValue);
|
|
113
|
+
const currentValue = isControlled ? value : internalValue;
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (isControlled) {
|
|
116
|
+
setInternalValue(value);
|
|
117
|
+
}
|
|
118
|
+
}, [isControlled, value]);
|
|
119
|
+
const id = useId();
|
|
120
|
+
const labelId = `${id}-label`;
|
|
91
121
|
const handleChange = (event) => {
|
|
92
|
-
|
|
93
|
-
|
|
122
|
+
const next = event.target.value;
|
|
123
|
+
if (!isControlled)
|
|
124
|
+
setInternalValue(next);
|
|
125
|
+
onChange == null ? void 0 : onChange(next);
|
|
94
126
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
127
|
+
const items = placeholder ? [{ label: placeholder, value: "", disabled: true }, ...options] : options;
|
|
128
|
+
return /* @__PURE__ */ jsxs2(
|
|
129
|
+
FormControl2,
|
|
130
|
+
{
|
|
131
|
+
className: className ?? "dropdown-select",
|
|
132
|
+
sx: { minWidth: 200, maxWidth: 400, width: fullWidth ? "100%" : "auto", ...sx },
|
|
133
|
+
disabled,
|
|
134
|
+
fullWidth,
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsx5(InputLabel, { id: labelId, className: "dropdown-label", children: label }),
|
|
137
|
+
/* @__PURE__ */ jsx5(
|
|
138
|
+
Select,
|
|
139
|
+
{
|
|
140
|
+
labelId,
|
|
141
|
+
value: currentValue,
|
|
142
|
+
onChange: handleChange,
|
|
143
|
+
label,
|
|
144
|
+
MenuProps: { classes: { paper: "custom-dropdown" }, ...SelectProps2 == null ? void 0 : SelectProps2.MenuProps },
|
|
145
|
+
...SelectProps2,
|
|
146
|
+
children: items.map((opt) => /* @__PURE__ */ jsx5(MenuItem, { value: opt.value, disabled: !!opt.disabled, children: opt.label }, `${opt.value}-${opt.label}`))
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
);
|
|
109
152
|
};
|
|
110
153
|
var CmrSelect_default = CmrSelect;
|
|
111
154
|
|
|
@@ -713,7 +756,7 @@ import Dialog2 from "@mui/material/Dialog";
|
|
|
713
756
|
import DialogActions2 from "@mui/material/DialogActions";
|
|
714
757
|
import DialogContent2 from "@mui/material/DialogContent";
|
|
715
758
|
import DialogTitle2 from "@mui/material/DialogTitle";
|
|
716
|
-
import { useEffect } from "react";
|
|
759
|
+
import { useEffect as useEffect2 } from "react";
|
|
717
760
|
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
718
761
|
function CmrNameDialog(props) {
|
|
719
762
|
let { originalName, open, setOpen } = props;
|
|
@@ -724,7 +767,7 @@ function CmrNameDialog(props) {
|
|
|
724
767
|
const handleClose = () => {
|
|
725
768
|
setOpen(false);
|
|
726
769
|
};
|
|
727
|
-
|
|
770
|
+
useEffect2(() => {
|
|
728
771
|
checkError(originalName);
|
|
729
772
|
}, [originalName]);
|
|
730
773
|
const handleConfirm = async () => {
|
|
@@ -795,7 +838,6 @@ function CmrNameDialog(props) {
|
|
|
795
838
|
}
|
|
796
839
|
|
|
797
840
|
// src/CmrComponents/dialogue/Confirmation.tsx
|
|
798
|
-
import * as React7 from "react";
|
|
799
841
|
import Dialog3 from "@mui/material/Dialog";
|
|
800
842
|
import DialogActions3 from "@mui/material/DialogActions";
|
|
801
843
|
import DialogContent3 from "@mui/material/DialogContent";
|
|
@@ -806,18 +848,18 @@ function CmrConfirmation({
|
|
|
806
848
|
name,
|
|
807
849
|
message,
|
|
808
850
|
cancelText = "Cancel",
|
|
851
|
+
confirmText = "Confirm",
|
|
809
852
|
color,
|
|
810
853
|
open,
|
|
811
854
|
setOpen,
|
|
812
855
|
confirmCallback = () => {
|
|
813
856
|
},
|
|
814
|
-
confirmText = "Confirm",
|
|
815
|
-
cancellable = false,
|
|
816
857
|
cancelCallback = () => {
|
|
817
858
|
},
|
|
818
|
-
|
|
859
|
+
cancellable = false,
|
|
860
|
+
width,
|
|
861
|
+
extraButtons = []
|
|
819
862
|
}) {
|
|
820
|
-
const [text, setText] = React7.useState("");
|
|
821
863
|
const handleClose = () => {
|
|
822
864
|
setOpen(false);
|
|
823
865
|
};
|
|
@@ -835,6 +877,19 @@ function CmrConfirmation({
|
|
|
835
877
|
/* @__PURE__ */ jsx12(DialogContentText2, { alignContent: "center", children: message }),
|
|
836
878
|
/* @__PURE__ */ jsxs8(DialogActions3, { className: "mt-4", children: [
|
|
837
879
|
cancellable && /* @__PURE__ */ jsx12(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: cancelText }),
|
|
880
|
+
extraButtons.map((btn, idx) => /* @__PURE__ */ jsx12(
|
|
881
|
+
CmrButton_default,
|
|
882
|
+
{
|
|
883
|
+
variant: "outlined",
|
|
884
|
+
color: btn.color || "success",
|
|
885
|
+
onClick: () => {
|
|
886
|
+
btn.onClick();
|
|
887
|
+
handleClose();
|
|
888
|
+
},
|
|
889
|
+
children: btn.text
|
|
890
|
+
},
|
|
891
|
+
idx
|
|
892
|
+
)),
|
|
838
893
|
/* @__PURE__ */ jsx12(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
|
|
839
894
|
] })
|
|
840
895
|
] })
|
|
@@ -842,7 +897,7 @@ function CmrConfirmation({
|
|
|
842
897
|
}
|
|
843
898
|
|
|
844
899
|
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
845
|
-
import * as
|
|
900
|
+
import * as React7 from "react";
|
|
846
901
|
import TextField3 from "@mui/material/TextField";
|
|
847
902
|
import Dialog4 from "@mui/material/Dialog";
|
|
848
903
|
import DialogActions4 from "@mui/material/DialogActions";
|
|
@@ -851,8 +906,8 @@ import DialogContentText3 from "@mui/material/DialogContentText";
|
|
|
851
906
|
import DialogTitle4 from "@mui/material/DialogTitle";
|
|
852
907
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
853
908
|
function CmrDeletionDialog(props) {
|
|
854
|
-
const [open, setOpen] =
|
|
855
|
-
const [text, setText] =
|
|
909
|
+
const [open, setOpen] = React7.useState(true);
|
|
910
|
+
const [text, setText] = React7.useState("");
|
|
856
911
|
const handleClickOpen = () => {
|
|
857
912
|
setOpen(true);
|
|
858
913
|
};
|
|
@@ -895,7 +950,7 @@ function CmrDeletionDialog(props) {
|
|
|
895
950
|
}
|
|
896
951
|
|
|
897
952
|
// src/CmrComponents/dialogue/EditConfirmation.tsx
|
|
898
|
-
import * as
|
|
953
|
+
import * as React8 from "react";
|
|
899
954
|
import TextField4 from "@mui/material/TextField";
|
|
900
955
|
import Dialog5 from "@mui/material/Dialog";
|
|
901
956
|
import DialogActions5 from "@mui/material/DialogActions";
|
|
@@ -903,7 +958,7 @@ import DialogContent5 from "@mui/material/DialogContent";
|
|
|
903
958
|
import DialogContentText4 from "@mui/material/DialogContentText";
|
|
904
959
|
import DialogTitle5 from "@mui/material/DialogTitle";
|
|
905
960
|
import { InputAdornment } from "@mui/material";
|
|
906
|
-
import { useEffect as
|
|
961
|
+
import { useEffect as useEffect3 } from "react";
|
|
907
962
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
908
963
|
function CmrEditConfirmation({
|
|
909
964
|
name,
|
|
@@ -919,8 +974,8 @@ function CmrEditConfirmation({
|
|
|
919
974
|
},
|
|
920
975
|
suffix = ""
|
|
921
976
|
}) {
|
|
922
|
-
const [text, setText] =
|
|
923
|
-
|
|
977
|
+
const [text, setText] = React8.useState(defaultText);
|
|
978
|
+
useEffect3(() => {
|
|
924
979
|
if (open)
|
|
925
980
|
setText(defaultText);
|
|
926
981
|
}, [open]);
|
|
@@ -960,7 +1015,7 @@ function CmrEditConfirmation({
|
|
|
960
1015
|
}
|
|
961
1016
|
|
|
962
1017
|
// src/CmrTabs/CmrTabs.tsx
|
|
963
|
-
import * as
|
|
1018
|
+
import * as React9 from "react";
|
|
964
1019
|
import Tabs from "@mui/material/Tabs";
|
|
965
1020
|
import Tab from "@mui/material/Tab";
|
|
966
1021
|
import Container from "@mui/material/Container";
|
|
@@ -989,7 +1044,7 @@ function a11yProps(index) {
|
|
|
989
1044
|
};
|
|
990
1045
|
}
|
|
991
1046
|
function CmrTabs(props) {
|
|
992
|
-
const [value, setValue] =
|
|
1047
|
+
const [value, setValue] = React9.useState(0);
|
|
993
1048
|
const handleChange = (event, newValue) => {
|
|
994
1049
|
setValue(newValue);
|
|
995
1050
|
if (props.onTabSelected)
|
|
@@ -1062,7 +1117,7 @@ var CmrInputNumber = (props) => {
|
|
|
1062
1117
|
var InputNumber_default = CmrInputNumber;
|
|
1063
1118
|
|
|
1064
1119
|
// src/CmrComponents/select-upload/SelectUpload.tsx
|
|
1065
|
-
import
|
|
1120
|
+
import React10, { Fragment } from "react";
|
|
1066
1121
|
import { Button as Button4 } from "@mui/material";
|
|
1067
1122
|
import Select2 from "react-select";
|
|
1068
1123
|
import Dialog6 from "@mui/material/Dialog";
|
|
@@ -1082,10 +1137,10 @@ function checkExtension(filename, allowed) {
|
|
|
1082
1137
|
}
|
|
1083
1138
|
}
|
|
1084
1139
|
var CMRSelectUpload = (props) => {
|
|
1085
|
-
let [open, setOpen] =
|
|
1086
|
-
let [fileIndex, selectFileIndex] =
|
|
1087
|
-
let [uploading, setUploading] =
|
|
1088
|
-
const [progress, setProgress] =
|
|
1140
|
+
let [open, setOpen] = React10.useState(false);
|
|
1141
|
+
let [fileIndex, selectFileIndex] = React10.useState(-1);
|
|
1142
|
+
let [uploading, setUploading] = React10.useState(false);
|
|
1143
|
+
const [progress, setProgress] = React10.useState(0);
|
|
1089
1144
|
const handleClickOpen = () => {
|
|
1090
1145
|
selectFileIndex(-1);
|
|
1091
1146
|
setOpen(true);
|