cloudmr-ux 1.1.0 → 1.1.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.css +10 -0
- package/dist/index.d.ts +20 -14
- package/dist/index.js +88 -34
- package/dist/index.mjs +87 -34
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -172,6 +172,16 @@
|
|
|
172
172
|
margin-left: 4px;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
/* src/CmrComponents/checkbox/Checkbox.css */
|
|
176
|
+
.cmr-checkbox {
|
|
177
|
+
margin-bottom: 4px;
|
|
178
|
+
&__text {
|
|
179
|
+
font-size: 16px;
|
|
180
|
+
line-height: 15px;
|
|
181
|
+
text-align: justify;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
175
185
|
/* src/CmrTable/CmrTable.css */
|
|
176
186
|
.css-1lymaxv-MuiDataGrid-root .MuiDataGrid-columnHeader:focus-within,
|
|
177
187
|
.css-1lymaxv-MuiDataGrid-root .MuiDataGrid-cell:focus-within {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonProps, SxProps, Theme } from '@mui/material';
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { ReactNode, ChangeEvent, CSSProperties, FC } from 'react';
|
|
4
4
|
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
5
|
import { CollapsibleType } from 'antd/es/collapse/CollapsePanel';
|
|
6
6
|
import { ExpandIconPosition } from 'antd/es/collapse/Collapse';
|
|
@@ -9,18 +9,6 @@ import { DataGridProps } from '@mui/x-data-grid';
|
|
|
9
9
|
|
|
10
10
|
declare const CmrButton: (props: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
11
11
|
|
|
12
|
-
interface CmrCheckboxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
-
autoFocus?: boolean;
|
|
14
|
-
checked?: boolean;
|
|
15
|
-
defaultChecked?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
indeterminate?: boolean;
|
|
18
|
-
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
-
children?: any;
|
|
20
|
-
style?: any;
|
|
21
|
-
}
|
|
22
|
-
declare const CmrCheckbox: (props: CmrCheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
-
|
|
24
12
|
interface CmrInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
|
|
25
13
|
defaultValue?: string;
|
|
26
14
|
id?: string;
|
|
@@ -185,6 +173,11 @@ declare function CmrConfirmation({ name, message, cancelText, color, open, setOp
|
|
|
185
173
|
confirmText?: string;
|
|
186
174
|
}): react_jsx_runtime.JSX.Element;
|
|
187
175
|
|
|
176
|
+
declare function CmrDeletionDialog(props: {
|
|
177
|
+
name: string | undefined;
|
|
178
|
+
deletionCallback: () => void;
|
|
179
|
+
}): react_jsx_runtime.JSX.Element;
|
|
180
|
+
|
|
188
181
|
interface TabInfo {
|
|
189
182
|
id: number;
|
|
190
183
|
text: string;
|
|
@@ -198,6 +191,19 @@ interface CmrTabsProps {
|
|
|
198
191
|
}
|
|
199
192
|
declare function CmrTabs(props: CmrTabsProps): react_jsx_runtime.JSX.Element;
|
|
200
193
|
|
|
194
|
+
interface CmrCheckboxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
195
|
+
autoFocus?: boolean;
|
|
196
|
+
checked?: boolean;
|
|
197
|
+
defaultChecked?: boolean;
|
|
198
|
+
disabled?: boolean;
|
|
199
|
+
indeterminate?: boolean;
|
|
200
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
201
|
+
children?: any;
|
|
202
|
+
style?: any;
|
|
203
|
+
sx?: any;
|
|
204
|
+
}
|
|
205
|
+
declare const CmrCheckbox: (props: CmrCheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
206
|
+
|
|
201
207
|
interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
|
|
202
208
|
dataSource: any[];
|
|
203
209
|
idAlias?: string;
|
|
@@ -208,4 +214,4 @@ interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
|
|
|
208
214
|
|
|
209
215
|
declare const CmrTable: FC<CmrTableProps>;
|
|
210
216
|
|
|
211
|
-
export { CmrUpload as CMRUpload, CmrButton, CmrCheckbox, CmrCollapse, CmrConfirmation, CmrInput, CmrNameDialog, CmrPanel, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps, CmrTabs, LambdaFile };
|
|
217
|
+
export { CmrUpload as CMRUpload, CmrButton, CmrCheckbox, CmrCollapse, CmrConfirmation, CmrDeletionDialog, CmrInput, CmrNameDialog, CmrPanel, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps, CmrTabs, LambdaFile };
|
package/dist/index.js
CHANGED
|
@@ -32,9 +32,10 @@ var src_exports = {};
|
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
CMRUpload: () => Upload_default,
|
|
34
34
|
CmrButton: () => CmrButton,
|
|
35
|
-
CmrCheckbox: () =>
|
|
35
|
+
CmrCheckbox: () => Checkbox_default,
|
|
36
36
|
CmrCollapse: () => Collapse_default,
|
|
37
37
|
CmrConfirmation: () => CmrConfirmation,
|
|
38
|
+
CmrDeletionDialog: () => CmrDeletionDialog,
|
|
38
39
|
CmrInput: () => CmrInput,
|
|
39
40
|
CmrNameDialog: () => CmrNameDialog,
|
|
40
41
|
CmrPanel: () => Panel_default,
|
|
@@ -76,28 +77,6 @@ var CmrButton = (props) => {
|
|
|
76
77
|
var import_material2 = require("@mui/material");
|
|
77
78
|
var import_material3 = require("@mui/material");
|
|
78
79
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
79
|
-
var CmrCheckbox = (props) => {
|
|
80
|
-
const { defaultChecked, onChange, children, ...rest } = props;
|
|
81
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
82
|
-
import_material3.FormControlLabel,
|
|
83
|
-
{
|
|
84
|
-
disabled: props.disabled,
|
|
85
|
-
style: props.style,
|
|
86
|
-
className: props.className,
|
|
87
|
-
control: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
88
|
-
import_material2.Checkbox,
|
|
89
|
-
{
|
|
90
|
-
style: props.style,
|
|
91
|
-
checked: props.checked,
|
|
92
|
-
defaultChecked,
|
|
93
|
-
onChange
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "cmr-label", style: { paddingRight: 0, color: "var(--bs-card-color)" }, children: props.children }),
|
|
97
|
-
labelPlacement: "end"
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
80
|
|
|
102
81
|
// src/CmrComponents/CmrInput/CmrInput.tsx
|
|
103
82
|
var import_antd = require("antd");
|
|
@@ -897,18 +876,71 @@ function CmrConfirmation({
|
|
|
897
876
|
] });
|
|
898
877
|
}
|
|
899
878
|
|
|
900
|
-
// src/
|
|
879
|
+
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
901
880
|
var React8 = __toESM(require("react"));
|
|
881
|
+
var import_TextField3 = __toESM(require("@mui/material/TextField"));
|
|
882
|
+
var import_Dialog4 = __toESM(require("@mui/material/Dialog"));
|
|
883
|
+
var import_DialogActions4 = __toESM(require("@mui/material/DialogActions"));
|
|
884
|
+
var import_DialogContent4 = __toESM(require("@mui/material/DialogContent"));
|
|
885
|
+
var import_DialogContentText3 = __toESM(require("@mui/material/DialogContentText"));
|
|
886
|
+
var import_DialogTitle4 = __toESM(require("@mui/material/DialogTitle"));
|
|
887
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
888
|
+
function CmrDeletionDialog(props) {
|
|
889
|
+
const [open, setOpen] = React8.useState(true);
|
|
890
|
+
const [text, setText] = React8.useState("");
|
|
891
|
+
const handleClickOpen = () => {
|
|
892
|
+
setOpen(true);
|
|
893
|
+
};
|
|
894
|
+
const handleClose = () => {
|
|
895
|
+
setOpen(false);
|
|
896
|
+
};
|
|
897
|
+
const handleConfirm = () => {
|
|
898
|
+
if (text === props.name) {
|
|
899
|
+
props.deletionCallback();
|
|
900
|
+
setOpen(false);
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
const handleTextFieldChange = (e) => {
|
|
904
|
+
setText(e.target.value);
|
|
905
|
+
};
|
|
906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_Dialog4.default, { open, onClose: handleClose, children: [
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_DialogTitle4.default, { children: "Confirmation" }),
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_DialogContent4.default, { children: [
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_DialogContentText3.default, { children: "To delete the files, please type your full name below and confirm." }),
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
911
|
+
import_TextField3.default,
|
|
912
|
+
{
|
|
913
|
+
autoFocus: true,
|
|
914
|
+
margin: "dense",
|
|
915
|
+
id: "name",
|
|
916
|
+
type: "email",
|
|
917
|
+
placeholder: props.name,
|
|
918
|
+
fullWidth: true,
|
|
919
|
+
inputProps: { style: { fontSize: "16pt" } },
|
|
920
|
+
variant: "standard",
|
|
921
|
+
onChange: handleTextFieldChange
|
|
922
|
+
}
|
|
923
|
+
)
|
|
924
|
+
] }),
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_DialogActions4.default, { children: [
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { className: "btn btn-secondary", onClick: handleClose, children: "Cancel" }),
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { className: "btn btn-danger", onClick: handleConfirm, children: "Confirm" })
|
|
928
|
+
] })
|
|
929
|
+
] }) });
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// src/CmrTabs/CmrTabs.tsx
|
|
933
|
+
var React9 = __toESM(require("react"));
|
|
902
934
|
var import_Tabs = __toESM(require("@mui/material/Tabs"));
|
|
903
935
|
var import_Tab = __toESM(require("@mui/material/Tab"));
|
|
904
936
|
var import_Container = __toESM(require("@mui/material/Container"));
|
|
905
937
|
var import_Typography2 = __toESM(require("@mui/material/Typography"));
|
|
906
938
|
var import_Box2 = __toESM(require("@mui/material/Box"));
|
|
907
939
|
var import_react6 = require("react");
|
|
908
|
-
var
|
|
940
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
909
941
|
function CustomTabPanel(props) {
|
|
910
942
|
const { children, value, index, ...other } = props;
|
|
911
|
-
return /* @__PURE__ */ (0,
|
|
943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
912
944
|
"div",
|
|
913
945
|
{
|
|
914
946
|
role: "tabpanel",
|
|
@@ -916,7 +948,7 @@ function CustomTabPanel(props) {
|
|
|
916
948
|
id: `simple-tabpanel-${index}`,
|
|
917
949
|
"aria-labelledby": `simple-tab-${index}`,
|
|
918
950
|
...other,
|
|
919
|
-
children: /* @__PURE__ */ (0,
|
|
951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Box2.default, { sx: { p: 0 }, style: { display: value === index ? void 0 : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Typography2.default, { children }) })
|
|
920
952
|
}
|
|
921
953
|
);
|
|
922
954
|
}
|
|
@@ -927,13 +959,13 @@ function a11yProps(index) {
|
|
|
927
959
|
};
|
|
928
960
|
}
|
|
929
961
|
function CmrTabs(props) {
|
|
930
|
-
const [value, setValue] =
|
|
962
|
+
const [value, setValue] = React9.useState(0);
|
|
931
963
|
const handleChange = (event, newValue) => {
|
|
932
964
|
setValue(newValue);
|
|
933
965
|
if (props.onTabSelected)
|
|
934
966
|
props.onTabSelected(newValue);
|
|
935
967
|
};
|
|
936
|
-
return /* @__PURE__ */ (0,
|
|
968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
937
969
|
import_Container.default,
|
|
938
970
|
{
|
|
939
971
|
maxWidth: "lg",
|
|
@@ -944,7 +976,7 @@ function CmrTabs(props) {
|
|
|
944
976
|
mt: 4
|
|
945
977
|
},
|
|
946
978
|
children: [
|
|
947
|
-
/* @__PURE__ */ (0,
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Box2.default, { sx: { borderBottom: 1, borderColor: "divider", mb: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
948
980
|
import_Tabs.default,
|
|
949
981
|
{
|
|
950
982
|
value,
|
|
@@ -956,11 +988,11 @@ function CmrTabs(props) {
|
|
|
956
988
|
backgroundColor: "#580F8B"
|
|
957
989
|
}
|
|
958
990
|
},
|
|
959
|
-
children: props.tabList.map((tab, index) => /* @__PURE__ */ (0,
|
|
991
|
+
children: props.tabList.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Tab.default, { sx: { color: value == index ? "#580F8B" : void 0 }, style: { fontSize: "14px", textTransform: "uppercase", fontWeight: 400 }, label: tab.text, ...a11yProps(index) }))
|
|
960
992
|
}
|
|
961
993
|
) }),
|
|
962
994
|
props.tabList.map(
|
|
963
|
-
(tab, index) => /* @__PURE__ */ (0,
|
|
995
|
+
(tab, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CustomTabPanel, { value, index, children: (0, import_react6.cloneElement)(tab.children, {
|
|
964
996
|
visible: value == index
|
|
965
997
|
}) })
|
|
966
998
|
)
|
|
@@ -969,9 +1001,30 @@ function CmrTabs(props) {
|
|
|
969
1001
|
);
|
|
970
1002
|
}
|
|
971
1003
|
|
|
1004
|
+
// src/CmrComponents/checkbox/Checkbox.tsx
|
|
1005
|
+
var import_material9 = require("@mui/material");
|
|
1006
|
+
var import_material10 = require("@mui/material");
|
|
1007
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1008
|
+
var CmrCheckbox = (props) => {
|
|
1009
|
+
const { defaultChecked, onChange, children, ...rest } = props;
|
|
1010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1011
|
+
import_material10.FormControlLabel,
|
|
1012
|
+
{
|
|
1013
|
+
disabled: props.disabled,
|
|
1014
|
+
style: props.style,
|
|
1015
|
+
className: props.className,
|
|
1016
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material9.Checkbox, { style: props.style, checked: props.checked, defaultChecked, onChange }),
|
|
1017
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Label_default, { children: props.children }),
|
|
1018
|
+
sx: props.sx,
|
|
1019
|
+
labelPlacement: "end"
|
|
1020
|
+
}
|
|
1021
|
+
);
|
|
1022
|
+
};
|
|
1023
|
+
var Checkbox_default = CmrCheckbox;
|
|
1024
|
+
|
|
972
1025
|
// src/CmrTable/CmrTable.tsx
|
|
973
1026
|
var import_x_data_grid = require("@mui/x-data-grid");
|
|
974
|
-
var
|
|
1027
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
975
1028
|
var CmrTable = (props) => {
|
|
976
1029
|
const {
|
|
977
1030
|
dataSource,
|
|
@@ -983,7 +1036,7 @@ var CmrTable = (props) => {
|
|
|
983
1036
|
showCheckbox = true,
|
|
984
1037
|
...rest
|
|
985
1038
|
} = props;
|
|
986
|
-
return /* @__PURE__ */ (0,
|
|
1039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
987
1040
|
import_x_data_grid.DataGrid,
|
|
988
1041
|
{
|
|
989
1042
|
rows: dataSource ? dataSource.map((row) => ({
|
|
@@ -1014,6 +1067,7 @@ var CmrTable2 = CmrTable_default;
|
|
|
1014
1067
|
CmrCheckbox,
|
|
1015
1068
|
CmrCollapse,
|
|
1016
1069
|
CmrConfirmation,
|
|
1070
|
+
CmrDeletionDialog,
|
|
1017
1071
|
CmrInput,
|
|
1018
1072
|
CmrNameDialog,
|
|
1019
1073
|
CmrPanel,
|
package/dist/index.mjs
CHANGED
|
@@ -29,28 +29,6 @@ var CmrButton = (props) => {
|
|
|
29
29
|
import { Checkbox } from "@mui/material";
|
|
30
30
|
import { FormControlLabel } from "@mui/material";
|
|
31
31
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
32
|
-
var CmrCheckbox = (props) => {
|
|
33
|
-
const { defaultChecked, onChange, children, ...rest } = props;
|
|
34
|
-
return /* @__PURE__ */ jsx2(
|
|
35
|
-
FormControlLabel,
|
|
36
|
-
{
|
|
37
|
-
disabled: props.disabled,
|
|
38
|
-
style: props.style,
|
|
39
|
-
className: props.className,
|
|
40
|
-
control: /* @__PURE__ */ jsx2(
|
|
41
|
-
Checkbox,
|
|
42
|
-
{
|
|
43
|
-
style: props.style,
|
|
44
|
-
checked: props.checked,
|
|
45
|
-
defaultChecked,
|
|
46
|
-
onChange
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
label: /* @__PURE__ */ jsx2("span", { className: "cmr-label", style: { paddingRight: 0, color: "var(--bs-card-color)" }, children: props.children }),
|
|
50
|
-
labelPlacement: "end"
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
32
|
|
|
55
33
|
// src/CmrComponents/CmrInput/CmrInput.tsx
|
|
56
34
|
import { Input } from "antd";
|
|
@@ -856,18 +834,71 @@ function CmrConfirmation({
|
|
|
856
834
|
] });
|
|
857
835
|
}
|
|
858
836
|
|
|
859
|
-
// src/
|
|
837
|
+
// src/CmrComponents/dialogue/DeletionDialog.tsx
|
|
860
838
|
import * as React8 from "react";
|
|
839
|
+
import TextField3 from "@mui/material/TextField";
|
|
840
|
+
import Dialog4 from "@mui/material/Dialog";
|
|
841
|
+
import DialogActions4 from "@mui/material/DialogActions";
|
|
842
|
+
import DialogContent4 from "@mui/material/DialogContent";
|
|
843
|
+
import DialogContentText3 from "@mui/material/DialogContentText";
|
|
844
|
+
import DialogTitle4 from "@mui/material/DialogTitle";
|
|
845
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
846
|
+
function CmrDeletionDialog(props) {
|
|
847
|
+
const [open, setOpen] = React8.useState(true);
|
|
848
|
+
const [text, setText] = React8.useState("");
|
|
849
|
+
const handleClickOpen = () => {
|
|
850
|
+
setOpen(true);
|
|
851
|
+
};
|
|
852
|
+
const handleClose = () => {
|
|
853
|
+
setOpen(false);
|
|
854
|
+
};
|
|
855
|
+
const handleConfirm = () => {
|
|
856
|
+
if (text === props.name) {
|
|
857
|
+
props.deletionCallback();
|
|
858
|
+
setOpen(false);
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
const handleTextFieldChange = (e) => {
|
|
862
|
+
setText(e.target.value);
|
|
863
|
+
};
|
|
864
|
+
return /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsxs9(Dialog4, { open, onClose: handleClose, children: [
|
|
865
|
+
/* @__PURE__ */ jsx13(DialogTitle4, { children: "Confirmation" }),
|
|
866
|
+
/* @__PURE__ */ jsxs9(DialogContent4, { children: [
|
|
867
|
+
/* @__PURE__ */ jsx13(DialogContentText3, { children: "To delete the files, please type your full name below and confirm." }),
|
|
868
|
+
/* @__PURE__ */ jsx13(
|
|
869
|
+
TextField3,
|
|
870
|
+
{
|
|
871
|
+
autoFocus: true,
|
|
872
|
+
margin: "dense",
|
|
873
|
+
id: "name",
|
|
874
|
+
type: "email",
|
|
875
|
+
placeholder: props.name,
|
|
876
|
+
fullWidth: true,
|
|
877
|
+
inputProps: { style: { fontSize: "16pt" } },
|
|
878
|
+
variant: "standard",
|
|
879
|
+
onChange: handleTextFieldChange
|
|
880
|
+
}
|
|
881
|
+
)
|
|
882
|
+
] }),
|
|
883
|
+
/* @__PURE__ */ jsxs9(DialogActions4, { children: [
|
|
884
|
+
/* @__PURE__ */ jsx13("button", { className: "btn btn-secondary", onClick: handleClose, children: "Cancel" }),
|
|
885
|
+
/* @__PURE__ */ jsx13("button", { className: "btn btn-danger", onClick: handleConfirm, children: "Confirm" })
|
|
886
|
+
] })
|
|
887
|
+
] }) });
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// src/CmrTabs/CmrTabs.tsx
|
|
891
|
+
import * as React9 from "react";
|
|
861
892
|
import Tabs from "@mui/material/Tabs";
|
|
862
893
|
import Tab from "@mui/material/Tab";
|
|
863
894
|
import Container from "@mui/material/Container";
|
|
864
895
|
import Typography3 from "@mui/material/Typography";
|
|
865
896
|
import Box3 from "@mui/material/Box";
|
|
866
897
|
import { cloneElement as cloneElement2 } from "react";
|
|
867
|
-
import { jsx as
|
|
898
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
868
899
|
function CustomTabPanel(props) {
|
|
869
900
|
const { children, value, index, ...other } = props;
|
|
870
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsx14(
|
|
871
902
|
"div",
|
|
872
903
|
{
|
|
873
904
|
role: "tabpanel",
|
|
@@ -875,7 +906,7 @@ function CustomTabPanel(props) {
|
|
|
875
906
|
id: `simple-tabpanel-${index}`,
|
|
876
907
|
"aria-labelledby": `simple-tab-${index}`,
|
|
877
908
|
...other,
|
|
878
|
-
children: /* @__PURE__ */
|
|
909
|
+
children: /* @__PURE__ */ jsx14(Box3, { sx: { p: 0 }, style: { display: value === index ? void 0 : "none" }, children: /* @__PURE__ */ jsx14(Typography3, { children }) })
|
|
879
910
|
}
|
|
880
911
|
);
|
|
881
912
|
}
|
|
@@ -886,13 +917,13 @@ function a11yProps(index) {
|
|
|
886
917
|
};
|
|
887
918
|
}
|
|
888
919
|
function CmrTabs(props) {
|
|
889
|
-
const [value, setValue] =
|
|
920
|
+
const [value, setValue] = React9.useState(0);
|
|
890
921
|
const handleChange = (event, newValue) => {
|
|
891
922
|
setValue(newValue);
|
|
892
923
|
if (props.onTabSelected)
|
|
893
924
|
props.onTabSelected(newValue);
|
|
894
925
|
};
|
|
895
|
-
return /* @__PURE__ */
|
|
926
|
+
return /* @__PURE__ */ jsxs10(
|
|
896
927
|
Container,
|
|
897
928
|
{
|
|
898
929
|
maxWidth: "lg",
|
|
@@ -903,7 +934,7 @@ function CmrTabs(props) {
|
|
|
903
934
|
mt: 4
|
|
904
935
|
},
|
|
905
936
|
children: [
|
|
906
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ jsx14(Box3, { sx: { borderBottom: 1, borderColor: "divider", mb: 4 }, children: /* @__PURE__ */ jsx14(
|
|
907
938
|
Tabs,
|
|
908
939
|
{
|
|
909
940
|
value,
|
|
@@ -915,11 +946,11 @@ function CmrTabs(props) {
|
|
|
915
946
|
backgroundColor: "#580F8B"
|
|
916
947
|
}
|
|
917
948
|
},
|
|
918
|
-
children: props.tabList.map((tab, index) => /* @__PURE__ */
|
|
949
|
+
children: props.tabList.map((tab, index) => /* @__PURE__ */ jsx14(Tab, { sx: { color: value == index ? "#580F8B" : void 0 }, style: { fontSize: "14px", textTransform: "uppercase", fontWeight: 400 }, label: tab.text, ...a11yProps(index) }))
|
|
919
950
|
}
|
|
920
951
|
) }),
|
|
921
952
|
props.tabList.map(
|
|
922
|
-
(tab, index) => /* @__PURE__ */
|
|
953
|
+
(tab, index) => /* @__PURE__ */ jsx14(CustomTabPanel, { value, index, children: cloneElement2(tab.children, {
|
|
923
954
|
visible: value == index
|
|
924
955
|
}) })
|
|
925
956
|
)
|
|
@@ -928,9 +959,30 @@ function CmrTabs(props) {
|
|
|
928
959
|
);
|
|
929
960
|
}
|
|
930
961
|
|
|
962
|
+
// src/CmrComponents/checkbox/Checkbox.tsx
|
|
963
|
+
import { Checkbox as Checkbox2 } from "@mui/material";
|
|
964
|
+
import { FormControlLabel as FormControlLabel3 } from "@mui/material";
|
|
965
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
966
|
+
var CmrCheckbox = (props) => {
|
|
967
|
+
const { defaultChecked, onChange, children, ...rest } = props;
|
|
968
|
+
return /* @__PURE__ */ jsx15(
|
|
969
|
+
FormControlLabel3,
|
|
970
|
+
{
|
|
971
|
+
disabled: props.disabled,
|
|
972
|
+
style: props.style,
|
|
973
|
+
className: props.className,
|
|
974
|
+
control: /* @__PURE__ */ jsx15(Checkbox2, { style: props.style, checked: props.checked, defaultChecked, onChange }),
|
|
975
|
+
label: /* @__PURE__ */ jsx15(Label_default, { children: props.children }),
|
|
976
|
+
sx: props.sx,
|
|
977
|
+
labelPlacement: "end"
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
};
|
|
981
|
+
var Checkbox_default = CmrCheckbox;
|
|
982
|
+
|
|
931
983
|
// src/CmrTable/CmrTable.tsx
|
|
932
984
|
import { DataGrid } from "@mui/x-data-grid";
|
|
933
|
-
import { jsx as
|
|
985
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
934
986
|
var CmrTable = (props) => {
|
|
935
987
|
const {
|
|
936
988
|
dataSource,
|
|
@@ -942,7 +994,7 @@ var CmrTable = (props) => {
|
|
|
942
994
|
showCheckbox = true,
|
|
943
995
|
...rest
|
|
944
996
|
} = props;
|
|
945
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ jsx16("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ jsx16(
|
|
946
998
|
DataGrid,
|
|
947
999
|
{
|
|
948
1000
|
rows: dataSource ? dataSource.map((row) => ({
|
|
@@ -969,9 +1021,10 @@ var CmrTable2 = CmrTable_default;
|
|
|
969
1021
|
export {
|
|
970
1022
|
Upload_default as CMRUpload,
|
|
971
1023
|
CmrButton,
|
|
972
|
-
CmrCheckbox,
|
|
1024
|
+
Checkbox_default as CmrCheckbox,
|
|
973
1025
|
Collapse_default as CmrCollapse,
|
|
974
1026
|
CmrConfirmation,
|
|
1027
|
+
CmrDeletionDialog,
|
|
975
1028
|
CmrInput,
|
|
976
1029
|
CmrNameDialog,
|
|
977
1030
|
Panel_default as CmrPanel,
|