cloudmr-ux 0.0.3 → 1.0.0
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/README.md +24 -16
- package/dist/index.975ef6c8.js +75418 -0
- package/dist/index.975ef6c8.js.map +1 -0
- package/dist/index.css +140 -14
- package/dist/index.d.ts +58 -0
- package/dist/index.db9ed22c.css +171 -0
- package/dist/index.db9ed22c.css.map +1 -0
- package/dist/index.html +13 -0
- package/dist/index.js +170 -141
- package/dist/index.mjs +157 -0
- package/package.json +39 -99
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js +0 -147
- package/dist/index.modern.js.map +0 -1
- package/src/.eslintrc +0 -5
- package/src/common/components/Cmr-components/avatar/Avatar.scss +0 -0
- package/src/common/components/Cmr-components/avatar/Avatar.tsx +0 -25
- package/src/common/components/Cmr-components/button/Button.scss +0 -0
- package/src/common/components/Cmr-components/button/Button.tsx +0 -14
- package/src/common/components/Cmr-components/checkbox/Checkbox.scss +0 -11
- package/src/common/components/Cmr-components/checkbox/Checkbox.tsx +0 -29
- package/src/common/components/Cmr-components/collapse/Collapse.scss +0 -3
- package/src/common/components/Cmr-components/collapse/Collapse.tsx +0 -75
- package/src/common/components/Cmr-components/dialogue/Confirmation.tsx +0 -48
- package/src/common/components/Cmr-components/dialogue/DeletionDialog.tsx +0 -61
- package/src/common/components/Cmr-components/dialogue/EditConfirmation.tsx +0 -72
- package/src/common/components/Cmr-components/double-slider/DualSlider.tsx +0 -198
- package/src/common/components/Cmr-components/double-slider/InvertibleDualSlider.tsx +0 -224
- package/src/common/components/Cmr-components/dropdown/Dropdown.scss +0 -36
- package/src/common/components/Cmr-components/dropdown/Dropdown.tsx +0 -83
- package/src/common/components/Cmr-components/gui-slider/ControlledSlider.tsx +0 -139
- package/src/common/components/Cmr-components/gui-slider/Slider.tsx +0 -170
- package/src/common/components/Cmr-components/header/Header.scss +0 -20
- package/src/common/components/Cmr-components/header/Header.tsx +0 -101
- package/src/common/components/Cmr-components/input/Input.scss +0 -0
- package/src/common/components/Cmr-components/input/Input.tsx +0 -39
- package/src/common/components/Cmr-components/input-number/InputNumber.scss +0 -0
- package/src/common/components/Cmr-components/input-number/InputNumber.tsx +0 -29
- package/src/common/components/Cmr-components/label/Label.scss +0 -13
- package/src/common/components/Cmr-components/label/Label.tsx +0 -20
- package/src/common/components/Cmr-components/option/Option.scss +0 -0
- package/src/common/components/Cmr-components/option/Option.tsx +0 -24
- package/src/common/components/Cmr-components/panel/Panel.scss +0 -0
- package/src/common/components/Cmr-components/panel/Panel.tsx +0 -54
- package/src/common/components/Cmr-components/progress/Progress.scss +0 -0
- package/src/common/components/Cmr-components/progress/Progress.tsx +0 -38
- package/src/common/components/Cmr-components/radio/Radio.scss +0 -0
- package/src/common/components/Cmr-components/radio/Radio.tsx +0 -23
- package/src/common/components/Cmr-components/radio-group/RadioGroup.scss +0 -0
- package/src/common/components/Cmr-components/radio-group/RadioGroup.tsx +0 -32
- package/src/common/components/Cmr-components/rename/edit.tsx +0 -94
- package/src/common/components/Cmr-components/select/Select.scss +0 -3
- package/src/common/components/Cmr-components/select/Select.tsx +0 -33
- package/src/common/components/Cmr-components/select-upload/SelectUpload.scss +0 -0
- package/src/common/components/Cmr-components/select-upload/SelectUpload.tsx +0 -133
- package/src/common/components/Cmr-components/slider/Slider.scss +0 -0
- package/src/common/components/Cmr-components/slider/Slider.tsx +0 -66
- package/src/common/components/Cmr-components/spin/Spin.scss +0 -0
- package/src/common/components/Cmr-components/spin/Spin.tsx +0 -31
- package/src/common/components/Cmr-components/tooltip/Tooltip.scss +0 -0
- package/src/common/components/Cmr-components/tooltip/Tooltip.tsx +0 -50
- package/src/common/components/Cmr-components/upload/Upload.scss +0 -5
- package/src/common/components/Cmr-components/upload/Upload.tsx +0 -188
- package/src/common/components/Cmr-components/upload/UploadWindow.tsx +0 -355
- package/src/index.js +0 -8
- package/src/index.test.js +0 -7
- package/src/styles.module.css +0 -9
package/dist/index.js
CHANGED
|
@@ -1,153 +1,182 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
CmrButton: () => CmrButton,
|
|
24
|
+
CmrCheckbox: () => CmrCheckbox,
|
|
25
|
+
CmrInput: () => CmrInput,
|
|
26
|
+
CmrRadioGroup: () => CmrRadioGroup_default,
|
|
27
|
+
CmrSelect: () => CmrSelect_default
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(src_exports);
|
|
22
30
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
textTransform:
|
|
31
|
+
// src/CmrComponents/CmrButton/CmrButton.tsx
|
|
32
|
+
var import_material = require("@mui/material");
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var CmrButton = (props) => {
|
|
35
|
+
const { children, onClick, variant = "contained", disabled = false, ...rest } = props;
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
37
|
+
import_material.Button,
|
|
38
|
+
{
|
|
39
|
+
onClick,
|
|
40
|
+
...rest,
|
|
41
|
+
className: `cmr-button ${variant}`,
|
|
42
|
+
style: { textTransform: "none" },
|
|
43
|
+
variant,
|
|
44
|
+
disabled,
|
|
45
|
+
sx: {
|
|
46
|
+
boxShadow: "none",
|
|
47
|
+
// Removes the shadow on the button by default
|
|
48
|
+
"&:hover": {
|
|
49
|
+
boxShadow: "none"
|
|
50
|
+
// Removes the shadow on hover as well
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
children
|
|
35
54
|
}
|
|
36
|
-
|
|
55
|
+
);
|
|
37
56
|
};
|
|
38
57
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, rest));
|
|
58
|
+
// src/CmrComponents/CmrCheckbox/CmrCheckbox.tsx
|
|
59
|
+
var import_material2 = require("@mui/material");
|
|
60
|
+
var import_material3 = require("@mui/material");
|
|
61
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
62
|
+
var CmrCheckbox = (props) => {
|
|
63
|
+
const { defaultChecked, onChange, children, ...rest } = props;
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
65
|
+
import_material3.FormControlLabel,
|
|
66
|
+
{
|
|
67
|
+
disabled: props.disabled,
|
|
68
|
+
style: props.style,
|
|
69
|
+
className: props.className,
|
|
70
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
71
|
+
import_material2.Checkbox,
|
|
72
|
+
{
|
|
73
|
+
style: props.style,
|
|
74
|
+
checked: props.checked,
|
|
75
|
+
defaultChecked,
|
|
76
|
+
onChange
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "cmr-label", style: { paddingRight: 0, color: "var(--bs-card-color)" }, children: props.children }),
|
|
80
|
+
labelPlacement: "end"
|
|
81
|
+
}
|
|
82
|
+
);
|
|
65
83
|
};
|
|
66
84
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
onChange
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
className: "cmr-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
color: 'var(--bs-card-color)'
|
|
89
|
-
}
|
|
90
|
-
}, props.children),
|
|
91
|
-
labelPlacement: "start"
|
|
92
|
-
});
|
|
85
|
+
// src/CmrComponents/CmrInput/CmrInput.tsx
|
|
86
|
+
var import_antd = require("antd");
|
|
87
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
88
|
+
var CmrInput = (props) => {
|
|
89
|
+
const { defaultValue, id, maxLength, size, value, type, prefix, bordered, onChange, onPressEnter, ...rest } = props;
|
|
90
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
91
|
+
import_antd.Input,
|
|
92
|
+
{
|
|
93
|
+
defaultValue,
|
|
94
|
+
id,
|
|
95
|
+
maxLength,
|
|
96
|
+
size,
|
|
97
|
+
value,
|
|
98
|
+
type,
|
|
99
|
+
prefix,
|
|
100
|
+
onChange,
|
|
101
|
+
onPressEnter,
|
|
102
|
+
...rest,
|
|
103
|
+
className: "cmr-input"
|
|
104
|
+
}
|
|
105
|
+
);
|
|
93
106
|
};
|
|
94
107
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
panelKey: index,
|
|
114
|
-
onToggle: key => {
|
|
115
|
-
let i = activeKeys.indexOf(key);
|
|
116
|
-
if (i < 0) {
|
|
117
|
-
let newKeys = [...activeKeys];
|
|
118
|
-
newKeys.push(index);
|
|
119
|
-
setActiveKeys(newKeys);
|
|
120
|
-
if (onChange != undefined) onChange(newKeys);
|
|
121
|
-
} else {
|
|
122
|
-
let newKeys = [...activeKeys];
|
|
123
|
-
newKeys.splice(i, 1);
|
|
124
|
-
setActiveKeys(newKeys);
|
|
125
|
-
if (onChange != undefined) onChange(newKeys);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
return React.cloneElement(child, props);
|
|
130
|
-
}) : children ? React.cloneElement(children, {
|
|
131
|
-
expanded: activeKeys.indexOf(0) >= 0,
|
|
132
|
-
panelKey: 0,
|
|
133
|
-
onToggle: key => {
|
|
134
|
-
let i = activeKeys.indexOf(key);
|
|
135
|
-
if (i < 0) {
|
|
136
|
-
let newKeys = [...activeKeys];
|
|
137
|
-
newKeys.push(0);
|
|
138
|
-
setActiveKeys(newKeys);
|
|
139
|
-
} else {
|
|
140
|
-
let newKeys = [...activeKeys];
|
|
141
|
-
newKeys.splice(i, 1);
|
|
142
|
-
setActiveKeys(newKeys);
|
|
143
|
-
}
|
|
144
|
-
if (onChange != undefined) onChange([0]);
|
|
108
|
+
// src/CmrComponents/CmrRadioGroup/CmrRadioGroup.tsx
|
|
109
|
+
var import_react = require("react");
|
|
110
|
+
var import_material4 = require("@mui/material");
|
|
111
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
112
|
+
var CmrRadioGroup = ({
|
|
113
|
+
options,
|
|
114
|
+
groupLabel,
|
|
115
|
+
defaultValue,
|
|
116
|
+
onChange
|
|
117
|
+
}) => {
|
|
118
|
+
const [selectedValue, setSelectedValue] = (0, import_react.useState)(defaultValue || "");
|
|
119
|
+
const handleChange = (event) => {
|
|
120
|
+
const newValue = event.target.value;
|
|
121
|
+
setSelectedValue(newValue);
|
|
122
|
+
if (onChange) {
|
|
123
|
+
onChange(newValue);
|
|
124
|
+
} else {
|
|
125
|
+
console.log("Selected Radio Value:", newValue);
|
|
145
126
|
}
|
|
146
|
-
}
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "cmr-radio-label", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_material4.FormControl, { component: "fieldset", children: [
|
|
129
|
+
groupLabel && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.FormLabel, { component: "legend", children: groupLabel }),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.RadioGroup, { value: selectedValue, onChange: handleChange, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
131
|
+
import_material4.FormControlLabel,
|
|
132
|
+
{
|
|
133
|
+
value: option.value,
|
|
134
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.Radio, { disabled: option.disabled }),
|
|
135
|
+
label: option.label,
|
|
136
|
+
sx: {
|
|
137
|
+
"& .MuiTypography-root": {
|
|
138
|
+
fontSize: "14.4px",
|
|
139
|
+
fontFamily: '"Source Sans 3", sans-serif'
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
option.value
|
|
144
|
+
)) })
|
|
145
|
+
] }) });
|
|
147
146
|
};
|
|
147
|
+
var CmrRadioGroup_default = CmrRadioGroup;
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
// src/CmrComponents/CmrSelect/CmrSelect.tsx
|
|
150
|
+
var import_react2 = require("react");
|
|
151
|
+
var import_material5 = require("@mui/material");
|
|
152
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
153
|
+
var CmrSelect = ({ options, label, disabled }) => {
|
|
154
|
+
const [selectedValue, setSelectedValue] = (0, import_react2.useState)("");
|
|
155
|
+
const handleChange = (event) => {
|
|
156
|
+
setSelectedValue(event.target.value);
|
|
157
|
+
console.log("Selected Value:", event.target.value);
|
|
158
|
+
};
|
|
159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.FormControl, { className: "dropdown-select", sx: {
|
|
160
|
+
minWidth: 200,
|
|
161
|
+
// Minimum width for the dropdown
|
|
162
|
+
maxWidth: 400,
|
|
163
|
+
// Optional: Maximum width for the dropdown
|
|
164
|
+
width: "auto"
|
|
165
|
+
// Allow auto-resizing based on content
|
|
166
|
+
}, disabled, children: [
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.InputLabel, { className: "dropdown-label", children: label }),
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Select, { value: selectedValue, onChange: handleChange, label, MenuProps: {
|
|
169
|
+
classes: { paper: "custom-dropdown" }
|
|
170
|
+
// Apply the class to the dropdown menu
|
|
171
|
+
}, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.MenuItem, { value: option.value, children: option.label }, option.value)) })
|
|
172
|
+
] });
|
|
173
|
+
};
|
|
174
|
+
var CmrSelect_default = CmrSelect;
|
|
175
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
176
|
+
0 && (module.exports = {
|
|
177
|
+
CmrButton,
|
|
178
|
+
CmrCheckbox,
|
|
179
|
+
CmrInput,
|
|
180
|
+
CmrRadioGroup,
|
|
181
|
+
CmrSelect
|
|
182
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// src/CmrComponents/CmrButton/CmrButton.tsx
|
|
2
|
+
import { Button } from "@mui/material";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var CmrButton = (props) => {
|
|
5
|
+
const { children, onClick, variant = "contained", disabled = false, ...rest } = props;
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Button,
|
|
8
|
+
{
|
|
9
|
+
onClick,
|
|
10
|
+
...rest,
|
|
11
|
+
className: `cmr-button ${variant}`,
|
|
12
|
+
style: { textTransform: "none" },
|
|
13
|
+
variant,
|
|
14
|
+
disabled,
|
|
15
|
+
sx: {
|
|
16
|
+
boxShadow: "none",
|
|
17
|
+
// Removes the shadow on the button by default
|
|
18
|
+
"&:hover": {
|
|
19
|
+
boxShadow: "none"
|
|
20
|
+
// Removes the shadow on hover as well
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/CmrComponents/CmrCheckbox/CmrCheckbox.tsx
|
|
29
|
+
import { Checkbox } from "@mui/material";
|
|
30
|
+
import { FormControlLabel } from "@mui/material";
|
|
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
|
+
|
|
55
|
+
// src/CmrComponents/CmrInput/CmrInput.tsx
|
|
56
|
+
import { Input } from "antd";
|
|
57
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
58
|
+
var CmrInput = (props) => {
|
|
59
|
+
const { defaultValue, id, maxLength, size, value, type, prefix, bordered, onChange, onPressEnter, ...rest } = props;
|
|
60
|
+
return /* @__PURE__ */ jsx3(
|
|
61
|
+
Input,
|
|
62
|
+
{
|
|
63
|
+
defaultValue,
|
|
64
|
+
id,
|
|
65
|
+
maxLength,
|
|
66
|
+
size,
|
|
67
|
+
value,
|
|
68
|
+
type,
|
|
69
|
+
prefix,
|
|
70
|
+
onChange,
|
|
71
|
+
onPressEnter,
|
|
72
|
+
...rest,
|
|
73
|
+
className: "cmr-input"
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// src/CmrComponents/CmrRadioGroup/CmrRadioGroup.tsx
|
|
79
|
+
import { useState } from "react";
|
|
80
|
+
import {
|
|
81
|
+
Radio,
|
|
82
|
+
RadioGroup,
|
|
83
|
+
FormControl,
|
|
84
|
+
FormControlLabel as FormControlLabel2,
|
|
85
|
+
FormLabel
|
|
86
|
+
} from "@mui/material";
|
|
87
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
88
|
+
var CmrRadioGroup = ({
|
|
89
|
+
options,
|
|
90
|
+
groupLabel,
|
|
91
|
+
defaultValue,
|
|
92
|
+
onChange
|
|
93
|
+
}) => {
|
|
94
|
+
const [selectedValue, setSelectedValue] = useState(defaultValue || "");
|
|
95
|
+
const handleChange = (event) => {
|
|
96
|
+
const newValue = event.target.value;
|
|
97
|
+
setSelectedValue(newValue);
|
|
98
|
+
if (onChange) {
|
|
99
|
+
onChange(newValue);
|
|
100
|
+
} else {
|
|
101
|
+
console.log("Selected Radio Value:", newValue);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
return /* @__PURE__ */ jsx4("div", { className: "cmr-radio-label", children: /* @__PURE__ */ jsxs(FormControl, { component: "fieldset", children: [
|
|
105
|
+
groupLabel && /* @__PURE__ */ jsx4(FormLabel, { component: "legend", children: groupLabel }),
|
|
106
|
+
/* @__PURE__ */ jsx4(RadioGroup, { value: selectedValue, onChange: handleChange, children: options.map((option) => /* @__PURE__ */ jsx4(
|
|
107
|
+
FormControlLabel2,
|
|
108
|
+
{
|
|
109
|
+
value: option.value,
|
|
110
|
+
control: /* @__PURE__ */ jsx4(Radio, { disabled: option.disabled }),
|
|
111
|
+
label: option.label,
|
|
112
|
+
sx: {
|
|
113
|
+
"& .MuiTypography-root": {
|
|
114
|
+
fontSize: "14.4px",
|
|
115
|
+
fontFamily: '"Source Sans 3", sans-serif'
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
option.value
|
|
120
|
+
)) })
|
|
121
|
+
] }) });
|
|
122
|
+
};
|
|
123
|
+
var CmrRadioGroup_default = CmrRadioGroup;
|
|
124
|
+
|
|
125
|
+
// src/CmrComponents/CmrSelect/CmrSelect.tsx
|
|
126
|
+
import { useState as useState2 } from "react";
|
|
127
|
+
import { Select, MenuItem, FormControl as FormControl2, InputLabel } from "@mui/material";
|
|
128
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
129
|
+
var CmrSelect = ({ options, label, disabled }) => {
|
|
130
|
+
const [selectedValue, setSelectedValue] = useState2("");
|
|
131
|
+
const handleChange = (event) => {
|
|
132
|
+
setSelectedValue(event.target.value);
|
|
133
|
+
console.log("Selected Value:", event.target.value);
|
|
134
|
+
};
|
|
135
|
+
return /* @__PURE__ */ jsxs2(FormControl2, { className: "dropdown-select", sx: {
|
|
136
|
+
minWidth: 200,
|
|
137
|
+
// Minimum width for the dropdown
|
|
138
|
+
maxWidth: 400,
|
|
139
|
+
// Optional: Maximum width for the dropdown
|
|
140
|
+
width: "auto"
|
|
141
|
+
// Allow auto-resizing based on content
|
|
142
|
+
}, disabled, children: [
|
|
143
|
+
/* @__PURE__ */ jsx5(InputLabel, { className: "dropdown-label", children: label }),
|
|
144
|
+
/* @__PURE__ */ jsx5(Select, { value: selectedValue, onChange: handleChange, label, MenuProps: {
|
|
145
|
+
classes: { paper: "custom-dropdown" }
|
|
146
|
+
// Apply the class to the dropdown menu
|
|
147
|
+
}, children: options.map((option) => /* @__PURE__ */ jsx5(MenuItem, { value: option.value, children: option.label }, option.value)) })
|
|
148
|
+
] });
|
|
149
|
+
};
|
|
150
|
+
var CmrSelect_default = CmrSelect;
|
|
151
|
+
export {
|
|
152
|
+
CmrButton,
|
|
153
|
+
CmrCheckbox,
|
|
154
|
+
CmrInput,
|
|
155
|
+
CmrRadioGroup_default as CmrRadioGroup,
|
|
156
|
+
CmrSelect_default as CmrSelect
|
|
157
|
+
};
|
package/package.json
CHANGED
|
@@ -1,99 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cloudmr-ux",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"axios": "^1.4.0",
|
|
41
|
-
"bootstrap": "^5.3.1",
|
|
42
|
-
"gl-matrix": "^3.4.3",
|
|
43
|
-
"https-browserify": "^1.0.0",
|
|
44
|
-
"jszip": "^3.10.1",
|
|
45
|
-
"lil-gui": "^0.19.1",
|
|
46
|
-
"mathjax": "^3.2.2",
|
|
47
|
-
"mathjs": "^11.9.1",
|
|
48
|
-
"moment": "^2.29.4",
|
|
49
|
-
"plotly.js-dist-min": "^2.27.0",
|
|
50
|
-
"react": "^18.2.0",
|
|
51
|
-
"react-color": "^2.19.3",
|
|
52
|
-
"react-dom": "^18.2.0",
|
|
53
|
-
"react-redux": "^8.1.1",
|
|
54
|
-
"react-router-dom": "^6.14.2",
|
|
55
|
-
"react-scripts": "5.0.1",
|
|
56
|
-
"redux-persist": "^6.0.0",
|
|
57
|
-
"sass": "^1.64.1",
|
|
58
|
-
"web-vitals": "^2.1.0",
|
|
59
|
-
"babel-eslint": "^10.0.3",
|
|
60
|
-
"cross-env": "^7.0.2",
|
|
61
|
-
"eslint": "^6.8.0",
|
|
62
|
-
"eslint-config-prettier": "^6.7.0",
|
|
63
|
-
"eslint-config-standard": "^14.1.0",
|
|
64
|
-
"eslint-config-standard-react": "^9.2.0",
|
|
65
|
-
"eslint-plugin-import": "^2.18.2",
|
|
66
|
-
"eslint-plugin-node": "^11.0.0",
|
|
67
|
-
"eslint-plugin-prettier": "^3.1.1",
|
|
68
|
-
"eslint-plugin-promise": "^4.2.1",
|
|
69
|
-
"eslint-plugin-react": "^7.17.0",
|
|
70
|
-
"eslint-plugin-standard": "^4.0.1",
|
|
71
|
-
"gh-pages": "^2.2.0",
|
|
72
|
-
"microbundle-crl": "^0.13.10",
|
|
73
|
-
"npm-run-all": "^4.1.5",
|
|
74
|
-
"prettier": "^2.0.4"
|
|
75
|
-
},
|
|
76
|
-
"files": [
|
|
77
|
-
"dist",
|
|
78
|
-
"src/**"
|
|
79
|
-
],
|
|
80
|
-
"eslintConfig": {
|
|
81
|
-
"extends": [
|
|
82
|
-
"react-app",
|
|
83
|
-
"react-app/jest"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"browserslist": {
|
|
87
|
-
"production": [
|
|
88
|
-
">0.2%",
|
|
89
|
-
"not dead",
|
|
90
|
-
"not op_mini all"
|
|
91
|
-
],
|
|
92
|
-
"development": [
|
|
93
|
-
"last 1 chrome version",
|
|
94
|
-
"last 1 firefox version",
|
|
95
|
-
"last 1 safari version"
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "cloudmr-ux",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"author": "erosmontin@gmail.com",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "erosmontin/cloudmr-ux",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.esm.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --external react,react-dom"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": "^18.0.0",
|
|
18
|
+
"react-dom": "^18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"process": "^0.11.10",
|
|
22
|
+
"react": "^18.0.0",
|
|
23
|
+
"react-dom": "^18.0.0",
|
|
24
|
+
"tsup": "^6.7.0",
|
|
25
|
+
"typescript": "^5.6.3"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@emotion/react": "^11.14.0",
|
|
29
|
+
"@emotion/styled": "^11.14.0",
|
|
30
|
+
"@mui/icons-material": "^5.14.1",
|
|
31
|
+
"@mui/material": "^5.14.2",
|
|
32
|
+
"@mui/x-data-grid": "^6.10.1",
|
|
33
|
+
"antd": "^5.22.1",
|
|
34
|
+
"css-loader": "^7.1.2",
|
|
35
|
+
"sass": "^1.81.0",
|
|
36
|
+
"sass-loader": "^16.0.3",
|
|
37
|
+
"style-loader": "^4.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/common/components/Cmr-components/button/Button.tsx","../src/common/components/Cmr-components/input/Input.tsx","../src/common/components/Cmr-components/checkbox/Checkbox.tsx","../src/common/components/Cmr-components/collapse/Collapse.tsx"],"sourcesContent":["import React from 'react';\nimport '../button/Button.scss';\nimport { Button, ButtonProps } from '@mui/material';\n\nexport const CmrButton = (props: ButtonProps) => {\n const { children, onClick, ...rest } = props;\n\n return (\n <Button onClick={onClick} {...rest} style={{...props.style, textTransform:'none'}}>\n {children}\n </Button>\n );\n};\n\n","import React from 'react';\nimport './Input.scss';\nimport { Input } from 'antd';\nimport { SizeType } from 'antd/lib/config-provider/SizeContext';\nimport { LiteralUnion } from 'antd/lib/_util/type';\n\ninterface CmrInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {\n defaultValue?: string;\n id?: string;\n maxLength?: number;\n size?: SizeType;\n value?: string;\n type?: any;\n prefix?: React.ReactNode;\n bordered?: boolean;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n}\n\nexport const CmrInput = (props: CmrInputProps) => {\n const { defaultValue, id, maxLength, size, value, type, prefix, bordered, onChange, onPressEnter, ...rest } = props;\n\n return (\n <Input\n defaultValue={defaultValue}\n id={id}\n maxLength={maxLength}\n size={size}\n value={value}\n type={type}\n prefix={prefix}\n bordered={bordered}\n onChange={onChange}\n onPressEnter={onPressEnter}\n {...rest}\n />\n );\n};\n\n","import React, {ChangeEvent} from 'react';\nimport { Checkbox } from '@mui/material';\nimport './Checkbox.scss';\nimport { CheckboxChangeEvent } from 'antd/es/checkbox';\nimport { FormControlLabel } from '@mui/material';\n\ninterface CmrCheckboxProps extends React.HTMLAttributes<HTMLDivElement>{\n autoFocus?: boolean;\n checked?: boolean;\n defaultChecked?: boolean;\n disabled?: boolean;\n indeterminate?: boolean;\n onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n children?: any;\n style?: any;\n}\n\nexport const CmrCheckbox = (props: CmrCheckboxProps) => {\n const { defaultChecked, onChange, children, ...rest } = props;\n\n return (\n <FormControlLabel disabled={props.disabled} style={props.style} className={props.className} control={<Checkbox style={props.style} checked={props.checked} defaultChecked={defaultChecked} onChange={onChange}/>}\n label={<span className='cmr-label' style={{paddingRight:0, color:'var(--bs-card-color)'}}>\n {props.children}\n </span>}\n labelPlacement=\"start\"/>\n );\n};\n\n","import React, {cloneElement} from 'react';\nimport { Collapse } from 'antd';\nimport { CollapsibleType } from 'antd/es/collapse/CollapsePanel';\nimport { ExpandIconPosition } from 'antd/es/collapse/Collapse';\nimport './Collapse.scss';\n\ninterface CmrCollapseProps {\n accordion?: boolean;\n activeKey?: Array<string | number>|number;\n bordered?: boolean;\n collapsible?: CollapsibleType;\n defaultActiveKey?: Array<string | number>;\n destroyInactivePanel?: boolean;\n expandIconPosition?: ExpandIconPosition;\n ghost?: boolean;\n onChange?: (key:Array<string | number>|number) => void;\n children?: JSX.Element[]|JSX.Element;\n}\n\nexport const CmrCollapse = (props: CmrCollapseProps) => {\n let {activeKey, defaultActiveKey, onChange, children}=props;\n defaultActiveKey = (defaultActiveKey)?defaultActiveKey:[];\n let [activeKeys, setActiveKeys] = React.useState(defaultActiveKey);\n if(activeKey!=undefined&&activeKey!=activeKeys){\n console.log(activeKey);\n if(activeKey instanceof Array)\n setActiveKeys(activeKey);\n else setActiveKeys([activeKey]);\n }\n return (\n <div className=\"cmr-collapse\">\n <div>\n {(children&&Array.isArray(children))?children.map((child,index)=>{\n let props = {expanded:activeKeys.indexOf(index)>=0,\n panelKey: index,\n onToggle: (key:number)=>{\n let i = activeKeys.indexOf(key);\n if(i<0) {\n let newKeys = [...activeKeys];\n newKeys.push(index);\n setActiveKeys(newKeys);\n if(onChange!=undefined)\n onChange(newKeys);\n }\n else {\n let newKeys = [...activeKeys];\n newKeys.splice(i,1);\n setActiveKeys(newKeys);\n if(onChange!=undefined)\n onChange(newKeys);\n }\n }};\n return cloneElement(child, props)\n }):((children?cloneElement(children,{expanded:activeKeys.indexOf(0)>=0,\n panelKey: 0,\n onToggle: (key:number)=>{\n let i = activeKeys.indexOf(key);\n if(i<0) {\n let newKeys = [...activeKeys];\n newKeys.push(0);\n setActiveKeys(newKeys);\n }\n else {\n let newKeys = [...activeKeys];\n newKeys.splice(i,1);\n setActiveKeys(newKeys);\n }\n if(onChange!=undefined)\n onChange([0]);\n }}):undefined))}\n </div>\n </div>\n );\n};\n\n"],"names":["CmrButton","props","children","onClick","rest","React","createElement","Button","_extends","style","textTransform","CmrInput","defaultValue","id","maxLength","size","value","type","prefix","bordered","onChange","onPressEnter","Input","CmrCheckbox","defaultChecked","FormControlLabel","disabled","className","control","Checkbox","checked","label","paddingRight","color","labelPlacement","CmrCollapse","activeKey","defaultActiveKey","activeKeys","setActiveKeys","useState","undefined","console","log","Array","isArray","map","child","index","expanded","indexOf","panelKey","onToggle","key","i","newKeys","push","splice","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAIaA,SAAS,GAAIC,KAAkB,IAAK;EAC7C,MAAM;IAAEC,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