cloudmr-ux 2.0.2 → 2.0.4

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 CHANGED
@@ -66,10 +66,6 @@
66
66
  }
67
67
 
68
68
  /* src/CmrComponents/CmrSelect/CmrSelect.css */
69
- .dropdown-select .MuiSelect-select.MuiSelect-placeholder {
70
- text-align: center;
71
- justify-content: center;
72
- }
73
69
 
74
70
  /* src/CmrComponents/collapse/Collapse.css */
75
71
  .collapse-bar {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonProps, FormControlProps, SelectProps, SxProps, Theme } from '@mui/material';
2
+ import { ButtonProps, 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';
@@ -45,7 +45,6 @@ interface Option {
45
45
  }
46
46
  interface CmrSelectProps {
47
47
  options: Option[];
48
- label: string;
49
48
  disabled?: boolean;
50
49
  /** Controlled usage (optional) */
51
50
  value?: string;
@@ -54,10 +53,10 @@ interface CmrSelectProps {
54
53
  defaultValue?: string;
55
54
  /** Layout/Styling */
56
55
  fullWidth?: boolean;
57
- sx?: FormControlProps['sx'];
56
+ sx?: any;
58
57
  className?: string;
59
- /** Pass-through to MUI Select */
60
- SelectProps?: Partial<SelectProps<string>>;
58
+ /** Pass-through kept for compatibility */
59
+ SelectProps?: Record<string, any>;
61
60
  }
62
61
  declare const CmrSelect: React__default.FC<CmrSelectProps>;
63
62
 
package/dist/index.js CHANGED
@@ -132,61 +132,86 @@ var CmrRadioGroup_default = CmrRadioGroup;
132
132
 
133
133
  // src/CmrComponents/CmrSelect/CmrSelect.tsx
134
134
  var import_react2 = require("react");
135
- var import_material5 = require("@mui/material");
135
+ var import_react_select = __toESM(require("react-select"));
136
136
  var import_jsx_runtime5 = require("react/jsx-runtime");
137
+ var baseStyles = {
138
+ control: (base, state) => ({
139
+ ...base,
140
+ minHeight: 40,
141
+ borderColor: state.isFocused ? "#580F8B" : base.borderColor,
142
+ boxShadow: state.isFocused ? "0 0 0 1px #580F8B" : "none",
143
+ "&:hover": { borderColor: "#580F8B" },
144
+ fontFamily: "Inter, Roboto, Helvetica, Arial, sans-serif",
145
+ borderRadius: 4
146
+ }),
147
+ placeholder: (base) => ({
148
+ ...base,
149
+ color: "rgba(0,0,0,0.6)"
150
+ }),
151
+ singleValue: (base) => ({
152
+ ...base,
153
+ color: "#580F8B",
154
+ fontWeight: 400,
155
+ fontFamily: "Inter, Roboto, Helvetica, Arial, sans-serif"
156
+ }),
157
+ option: (base, state) => ({
158
+ ...base,
159
+ backgroundColor: state.isFocused || state.isSelected ? "#F3E5F5" : "white",
160
+ color: "#000",
161
+ fontFamily: "Inter, Roboto, Helvetica, Arial, sans-serif",
162
+ cursor: state.isDisabled ? "not-allowed" : "pointer"
163
+ }),
164
+ menuPortal: (base) => ({ ...base, zIndex: 2e3 }),
165
+ menu: (base) => ({ ...base, zIndex: 1300 })
166
+ };
137
167
  var CmrSelect = ({
138
168
  options,
139
- label,
140
169
  disabled,
141
170
  value,
142
171
  onChange,
143
172
  defaultValue = "",
144
173
  fullWidth,
145
174
  sx,
146
- className,
147
- SelectProps: SelectProps2
175
+ className
148
176
  }) => {
149
177
  const isControlled = value !== void 0;
150
178
  const [internal, setInternal] = (0, import_react2.useState)(defaultValue);
151
- const current = isControlled ? value : internal;
179
+ const currentValue = isControlled ? value : internal;
152
180
  (0, import_react2.useEffect)(() => {
153
181
  if (isControlled)
154
182
  setInternal(value);
155
183
  }, [isControlled, value]);
156
184
  const id = (0, import_react2.useId)();
157
- const labelId = `${id}-label`;
158
- const selectId = `${id}-select`;
159
- const handleChange = (e) => {
160
- const next = e.target.value;
185
+ const rsValue = (0, import_react2.useMemo)(
186
+ () => options.find((o) => o.value === currentValue) ?? null,
187
+ [options, currentValue]
188
+ );
189
+ const handleChange = (opt) => {
190
+ const next = (opt == null ? void 0 : opt.value) ?? "";
161
191
  if (!isControlled)
162
192
  setInternal(next);
163
193
  onChange == null ? void 0 : onChange(next);
164
194
  };
165
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
166
- import_material5.FormControl,
195
+ const wrapperStyle = {
196
+ minWidth: 200,
197
+ maxWidth: 400,
198
+ width: fullWidth ? "100%" : "auto",
199
+ ...sx
200
+ };
201
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: className ?? "dropdown-select", style: wrapperStyle, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
202
+ import_react_select.default,
167
203
  {
168
- className: className ?? "dropdown-select",
169
- sx: { minWidth: 200, maxWidth: 400, width: fullWidth ? "100%" : "auto", ...sx },
170
- disabled,
171
- fullWidth,
172
- children: [
173
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.InputLabel, { id: labelId, className: "dropdown-label", children: label }),
174
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
175
- import_material5.Select,
176
- {
177
- labelId,
178
- id: selectId,
179
- value: current,
180
- label,
181
- onChange: handleChange,
182
- MenuProps: { classes: { paper: "custom-dropdown" }, ...SelectProps2 == null ? void 0 : SelectProps2.MenuProps },
183
- ...SelectProps2,
184
- children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.MenuItem, { value: opt.value, disabled: !!opt.disabled, children: opt.label }, `${opt.value}-${opt.label}`))
185
- }
186
- )
187
- ]
204
+ inputId: id,
205
+ isDisabled: !!disabled,
206
+ options: options.map((o) => ({ ...o, isDisabled: o.disabled })),
207
+ value: rsValue,
208
+ onChange: handleChange,
209
+ placeholder: "Select",
210
+ isClearable: true,
211
+ styles: baseStyles,
212
+ menuPortalTarget: document.body
188
213
  }
189
- );
214
+ ) });
190
215
  };
191
216
  var CmrSelect_default = CmrSelect;
192
217
 
@@ -296,7 +321,7 @@ var Panel_default = CmrPanel;
296
321
 
297
322
  // src/CmrComponents/upload/Upload.tsx
298
323
  var import_react4 = __toESM(require("react"));
299
- var import_material7 = require("@mui/material");
324
+ var import_material6 = require("@mui/material");
300
325
  var import_Upload3 = __toESM(require("@mui/icons-material/Upload"));
301
326
 
302
327
  // src/CmrComponents/upload/UploadWindow.tsx
@@ -310,7 +335,7 @@ var import_DialogContentText = __toESM(require("@mui/material/DialogContentText"
310
335
  var import_DialogTitle = __toESM(require("@mui/material/DialogTitle"));
311
336
  var import_Typography = __toESM(require("@mui/material/Typography"));
312
337
  var import_Box = __toESM(require("@mui/material/Box"));
313
- var import_material6 = require("@mui/material");
338
+ var import_material5 = require("@mui/material");
314
339
 
315
340
  // src/CmrComponents/label/Label.tsx
316
341
  var import_jsx_runtime8 = require("react/jsx-runtime");
@@ -627,7 +652,7 @@ function CmrUploadWindow({
627
652
  defaultValue: "s3",
628
653
  helperText: "Upstream Storage Location",
629
654
  variant: "standard",
630
- children: [{ value: "s3", label: "S3" }].map((option) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material6.MenuItem, { value: option.value, children: option.label }, option.value))
655
+ children: [{ value: "s3", label: "S3" }].map((option) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material5.MenuItem, { value: option.value, children: option.label }, option.value))
631
656
  }
632
657
  )
633
658
  ] }),
@@ -643,7 +668,7 @@ function CmrUploadWindow({
643
668
  variant: "standard"
644
669
  }
645
670
  ),
646
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material6.Collapse, { in: infoOpen, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material6.Alert, { severity: infoStyle, sx: { m: 1 }, children: warningText }) })
671
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material5.Collapse, { in: infoOpen, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material5.Alert, { severity: infoStyle, sx: { m: 1 }, children: warningText }) })
647
672
  ] })
648
673
  ] })
649
674
  ] }),
@@ -748,7 +773,7 @@ var CmrUpload = (props) => {
748
773
  }
749
774
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react4.default.Fragment, { children: [
750
775
  !uploading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
751
- import_material7.Button,
776
+ import_material6.Button,
752
777
  {
753
778
  fullWidth: props.fullWidth,
754
779
  style: props.style,
@@ -764,7 +789,7 @@ var CmrUpload = (props) => {
764
789
  " "
765
790
  ]
766
791
  }
767
- ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_material7.Button, { fullWidth: props.fullWidth, style: props.style, variant: "contained", sx: { overflowWrap: "inherit" }, color: "primary", disabled: true, children: [
792
+ ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_material6.Button, { fullWidth: props.fullWidth, style: props.style, variant: "contained", sx: { overflowWrap: "inherit" }, color: "primary", disabled: true, children: [
768
793
  "Uploading ",
769
794
  progress,
770
795
  "%"
@@ -788,7 +813,7 @@ var Upload_default = CmrUpload;
788
813
 
789
814
  // src/CmrComponents/rename/edit.tsx
790
815
  var React6 = __toESM(require("react"));
791
- var import_material8 = require("@mui/material");
816
+ var import_material7 = require("@mui/material");
792
817
  var import_TextField2 = __toESM(require("@mui/material/TextField"));
793
818
  var import_Dialog2 = __toESM(require("@mui/material/Dialog"));
794
819
  var import_DialogActions2 = __toESM(require("@mui/material/DialogActions"));
@@ -843,7 +868,7 @@ function CmrNameDialog(props) {
843
868
  fullWidth: true,
844
869
  maxWidth: "xs",
845
870
  children: [
846
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_DialogTitle2.default, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_material8.Typography, { children: [
871
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_DialogTitle2.default, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_material7.Typography, { children: [
847
872
  " Rename the File ",
848
873
  originalName,
849
874
  " as:"
@@ -995,7 +1020,7 @@ var import_DialogActions5 = __toESM(require("@mui/material/DialogActions"));
995
1020
  var import_DialogContent5 = __toESM(require("@mui/material/DialogContent"));
996
1021
  var import_DialogContentText4 = __toESM(require("@mui/material/DialogContentText"));
997
1022
  var import_DialogTitle5 = __toESM(require("@mui/material/DialogTitle"));
998
- var import_material9 = require("@mui/material");
1023
+ var import_material8 = require("@mui/material");
999
1024
  var import_react6 = require("react");
1000
1025
  var import_jsx_runtime14 = require("react/jsx-runtime");
1001
1026
  function CmrEditConfirmation({
@@ -1038,7 +1063,7 @@ function CmrEditConfirmation({
1038
1063
  fullWidth: true,
1039
1064
  variant: "standard",
1040
1065
  InputProps: {
1041
- endAdornment: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material9.InputAdornment, { position: "end", sx: { whiteSpace: "nowrap" }, children: suffix })
1066
+ endAdornment: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material8.InputAdornment, { position: "end", sx: { whiteSpace: "nowrap" }, children: suffix })
1042
1067
  },
1043
1068
  defaultValue: text,
1044
1069
  onChange: (e) => setText(e.target.value)
@@ -1125,18 +1150,18 @@ function CmrTabs(props) {
1125
1150
  }
1126
1151
 
1127
1152
  // src/CmrComponents/checkbox/Checkbox.tsx
1153
+ var import_material9 = require("@mui/material");
1128
1154
  var import_material10 = require("@mui/material");
1129
- var import_material11 = require("@mui/material");
1130
1155
  var import_jsx_runtime16 = require("react/jsx-runtime");
1131
1156
  var CmrCheckbox = (props) => {
1132
1157
  const { defaultChecked, onChange, children, ...rest } = props;
1133
1158
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1134
- import_material11.FormControlLabel,
1159
+ import_material10.FormControlLabel,
1135
1160
  {
1136
1161
  disabled: props.disabled,
1137
1162
  style: props.style,
1138
1163
  className: props.className,
1139
- control: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material10.Checkbox, { style: props.style, checked: props.checked, defaultChecked, onChange }),
1164
+ control: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material9.Checkbox, { style: props.style, checked: props.checked, defaultChecked, onChange }),
1140
1165
  label: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label_default, { children: props.children }),
1141
1166
  sx: props.sx,
1142
1167
  labelPlacement: "end"
@@ -1156,8 +1181,8 @@ var InputNumber_default = CmrInputNumber;
1156
1181
 
1157
1182
  // src/CmrComponents/select-upload/SelectUpload.tsx
1158
1183
  var import_react8 = __toESM(require("react"));
1159
- var import_material12 = require("@mui/material");
1160
- var import_react_select = __toESM(require("react-select"));
1184
+ var import_material11 = require("@mui/material");
1185
+ var import_react_select2 = __toESM(require("react-select"));
1161
1186
  var import_Dialog6 = __toESM(require("@mui/material/Dialog"));
1162
1187
  var import_DialogTitle6 = __toESM(require("@mui/material/DialogTitle"));
1163
1188
  var import_DialogContent6 = __toESM(require("@mui/material/DialogContent"));
@@ -1195,7 +1220,7 @@ var CMRSelectUpload = (props) => {
1195
1220
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_DialogContent6.default, { sx: { width: 520 }, children: [
1196
1221
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_DialogContentText5.default, { sx: { pl: 1, pr: 1, pb: 0 }, children: uploading ? "Please wait for the upload to finish." : "" }),
1197
1222
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_Box3.default, { sx: { p: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1198
- import_react_select.default,
1223
+ import_react_select2.default,
1199
1224
  {
1200
1225
  classNamePrefix: "cmr-select",
1201
1226
  isDisabled: uploading,
@@ -1218,8 +1243,8 @@ var CMRSelectUpload = (props) => {
1218
1243
  }
1219
1244
  ) }),
1220
1245
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_Box3.default, { sx: { pt: 2, justifyContent: "center", display: "flex", padding: "8px" }, children: [
1221
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material12.Button, { fullWidth: true, sx: { marginRight: "8px" }, variant: "outlined", onClick: handleClose, children: " Cancel" }),
1222
- fileIndex !== -1 && !uploading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material12.Button, { fullWidth: true, variant: "contained", onClick: onSet, children: "OK" }),
1246
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material11.Button, { fullWidth: true, sx: { marginRight: "8px" }, variant: "outlined", onClick: handleClose, children: " Cancel" }),
1247
+ fileIndex !== -1 && !uploading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material11.Button, { fullWidth: true, variant: "contained", onClick: onSet, children: "OK" }),
1223
1248
  fileIndex == -1 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1224
1249
  Upload_default,
1225
1250
  {
@@ -1250,12 +1275,12 @@ var CMRSelectUpload = (props) => {
1250
1275
  ] })
1251
1276
  ] });
1252
1277
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react8.Fragment, { children: [
1253
- uploading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_material12.Button, { variant: "contained", style: { ...props.style, textTransform: "none" }, sx: { overflowWrap: "inherit" }, color: "primary", disabled: uploading, children: [
1278
+ uploading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_material11.Button, { variant: "contained", style: { ...props.style, textTransform: "none" }, sx: { overflowWrap: "inherit" }, color: "primary", disabled: uploading, children: [
1254
1279
  "Uploading ",
1255
1280
  progress,
1256
1281
  "%"
1257
1282
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1258
- import_material12.Button,
1283
+ import_material11.Button,
1259
1284
  {
1260
1285
  variant: props.chosenFile == void 0 ? "contained" : "outlined",
1261
1286
  color: "info",
package/dist/index.mjs CHANGED
@@ -83,67 +83,87 @@ var CmrRadioGroup = ({
83
83
  var CmrRadioGroup_default = CmrRadioGroup;
84
84
 
85
85
  // src/CmrComponents/CmrSelect/CmrSelect.tsx
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";
93
- import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
86
+ import { useEffect, useId, useMemo, useState as useState2 } from "react";
87
+ import ReactSelect from "react-select";
88
+ import { jsx as jsx5 } from "react/jsx-runtime";
89
+ var baseStyles = {
90
+ control: (base, state) => ({
91
+ ...base,
92
+ minHeight: 40,
93
+ borderColor: state.isFocused ? "#580F8B" : base.borderColor,
94
+ boxShadow: state.isFocused ? "0 0 0 1px #580F8B" : "none",
95
+ "&:hover": { borderColor: "#580F8B" },
96
+ fontFamily: "Inter, Roboto, Helvetica, Arial, sans-serif",
97
+ borderRadius: 4
98
+ }),
99
+ placeholder: (base) => ({
100
+ ...base,
101
+ color: "rgba(0,0,0,0.6)"
102
+ }),
103
+ singleValue: (base) => ({
104
+ ...base,
105
+ color: "#580F8B",
106
+ fontWeight: 400,
107
+ fontFamily: "Inter, Roboto, Helvetica, Arial, sans-serif"
108
+ }),
109
+ option: (base, state) => ({
110
+ ...base,
111
+ backgroundColor: state.isFocused || state.isSelected ? "#F3E5F5" : "white",
112
+ color: "#000",
113
+ fontFamily: "Inter, Roboto, Helvetica, Arial, sans-serif",
114
+ cursor: state.isDisabled ? "not-allowed" : "pointer"
115
+ }),
116
+ menuPortal: (base) => ({ ...base, zIndex: 2e3 }),
117
+ menu: (base) => ({ ...base, zIndex: 1300 })
118
+ };
94
119
  var CmrSelect = ({
95
120
  options,
96
- label,
97
121
  disabled,
98
122
  value,
99
123
  onChange,
100
124
  defaultValue = "",
101
125
  fullWidth,
102
126
  sx,
103
- className,
104
- SelectProps: SelectProps2
127
+ className
105
128
  }) => {
106
129
  const isControlled = value !== void 0;
107
130
  const [internal, setInternal] = useState2(defaultValue);
108
- const current = isControlled ? value : internal;
131
+ const currentValue = isControlled ? value : internal;
109
132
  useEffect(() => {
110
133
  if (isControlled)
111
134
  setInternal(value);
112
135
  }, [isControlled, value]);
113
136
  const id = useId();
114
- const labelId = `${id}-label`;
115
- const selectId = `${id}-select`;
116
- const handleChange = (e) => {
117
- const next = e.target.value;
137
+ const rsValue = useMemo(
138
+ () => options.find((o) => o.value === currentValue) ?? null,
139
+ [options, currentValue]
140
+ );
141
+ const handleChange = (opt) => {
142
+ const next = (opt == null ? void 0 : opt.value) ?? "";
118
143
  if (!isControlled)
119
144
  setInternal(next);
120
145
  onChange == null ? void 0 : onChange(next);
121
146
  };
122
- return /* @__PURE__ */ jsxs2(
123
- FormControl2,
147
+ const wrapperStyle = {
148
+ minWidth: 200,
149
+ maxWidth: 400,
150
+ width: fullWidth ? "100%" : "auto",
151
+ ...sx
152
+ };
153
+ return /* @__PURE__ */ jsx5("div", { className: className ?? "dropdown-select", style: wrapperStyle, children: /* @__PURE__ */ jsx5(
154
+ ReactSelect,
124
155
  {
125
- className: className ?? "dropdown-select",
126
- sx: { minWidth: 200, maxWidth: 400, width: fullWidth ? "100%" : "auto", ...sx },
127
- disabled,
128
- fullWidth,
129
- children: [
130
- /* @__PURE__ */ jsx5(InputLabel, { id: labelId, className: "dropdown-label", children: label }),
131
- /* @__PURE__ */ jsx5(
132
- Select,
133
- {
134
- labelId,
135
- id: selectId,
136
- value: current,
137
- label,
138
- onChange: handleChange,
139
- MenuProps: { classes: { paper: "custom-dropdown" }, ...SelectProps2 == null ? void 0 : SelectProps2.MenuProps },
140
- ...SelectProps2,
141
- children: options.map((opt) => /* @__PURE__ */ jsx5(MenuItem, { value: opt.value, disabled: !!opt.disabled, children: opt.label }, `${opt.value}-${opt.label}`))
142
- }
143
- )
144
- ]
156
+ inputId: id,
157
+ isDisabled: !!disabled,
158
+ options: options.map((o) => ({ ...o, isDisabled: o.disabled })),
159
+ value: rsValue,
160
+ onChange: handleChange,
161
+ placeholder: "Select",
162
+ isClearable: true,
163
+ styles: baseStyles,
164
+ menuPortalTarget: document.body
145
165
  }
146
- );
166
+ ) });
147
167
  };
148
168
  var CmrSelect_default = CmrSelect;
149
169
 
@@ -211,7 +231,7 @@ var Collapse_default = CmrCollapse;
211
231
  // src/CmrComponents/panel/Panel.tsx
212
232
  import ArrowDropUpIcon from "@mui/icons-material/ArrowDropUp";
213
233
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
214
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
234
+ import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
215
235
  var CmrPanel = function(props) {
216
236
  var _a, _b;
217
237
  let { expanded, onToggle } = props;
@@ -219,8 +239,8 @@ var CmrPanel = function(props) {
219
239
  if (onToggle)
220
240
  onToggle(props.panelKey);
221
241
  };
222
- return /* @__PURE__ */ jsxs3("div", { className: `card ${props.className}`, children: [
223
- /* @__PURE__ */ jsx7("div", { className: "card-header", style: { background: "white", display: props.header == void 0 ? "none" : void 0 }, children: /* @__PURE__ */ jsxs3("div", { className: "row align-items-center", children: [
242
+ return /* @__PURE__ */ jsxs2("div", { className: `card ${props.className}`, children: [
243
+ /* @__PURE__ */ jsx7("div", { className: "card-header", style: { background: "white", display: props.header == void 0 ? "none" : void 0 }, children: /* @__PURE__ */ jsxs2("div", { className: "row align-items-center", children: [
224
244
  /* @__PURE__ */ jsx7("div", { className: "col", children: props.header }),
225
245
  onToggle && /* @__PURE__ */ jsx7("div", { className: "col text-end", children: /* @__PURE__ */ jsx7(
226
246
  "span",
@@ -267,13 +287,13 @@ import DialogContentText from "@mui/material/DialogContentText";
267
287
  import DialogTitle from "@mui/material/DialogTitle";
268
288
  import Typography from "@mui/material/Typography";
269
289
  import Box from "@mui/material/Box";
270
- import { Alert, Collapse, MenuItem as MenuItem2 } from "@mui/material";
290
+ import { Alert, Collapse, MenuItem } from "@mui/material";
271
291
 
272
292
  // src/CmrComponents/label/Label.tsx
273
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
293
+ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
274
294
  var CmrLabel = (props) => {
275
295
  const { children, required = false } = props;
276
- return /* @__PURE__ */ jsxs4("label", { className: "cmr-label", style: { fontSize: "16px", ...props.style }, children: [
296
+ return /* @__PURE__ */ jsxs3("label", { className: "cmr-label", style: { fontSize: "16px", ...props.style }, children: [
277
297
  children,
278
298
  required && /* @__PURE__ */ jsx8("span", { className: "asterik", children: "*" })
279
299
  ] });
@@ -281,7 +301,7 @@ var CmrLabel = (props) => {
281
301
  var Label_default = CmrLabel;
282
302
 
283
303
  // src/CmrComponents/upload/UploadWindow.tsx
284
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
304
+ import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
285
305
  function CmrUploadWindow({
286
306
  upload,
287
307
  open,
@@ -513,11 +533,11 @@ function CmrUploadWindow({
513
533
  const fileElem = document.getElementById("file-window");
514
534
  loadFiles(fileElem.files);
515
535
  };
516
- return /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsxs5(Dialog, { open, onClose: handleClose, children: [
536
+ return /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsxs4(Dialog, { open, onClose: handleClose, children: [
517
537
  /* @__PURE__ */ jsx9(DialogTitle, { children: "File Upload" }),
518
- /* @__PURE__ */ jsxs5(DialogContent, { children: [
538
+ /* @__PURE__ */ jsxs4(DialogContent, { children: [
519
539
  /* @__PURE__ */ jsx9(DialogContentText, {}),
520
- /* @__PURE__ */ jsxs5(DialogContent, { dividers: true, children: [
540
+ /* @__PURE__ */ jsxs4(DialogContent, { dividers: true, children: [
521
541
  /* @__PURE__ */ jsx9(
522
542
  Box,
523
543
  {
@@ -528,7 +548,7 @@ function CmrUploadWindow({
528
548
  borderRadius: "5pt",
529
549
  borderColor: uploadBoxWarning == void 0 ? "lightGray" : "#BA3C3C"
530
550
  },
531
- children: /* @__PURE__ */ jsx9(Typography, { component: "div", style: { height: "100%" }, children: /* @__PURE__ */ jsxs5(
551
+ children: /* @__PURE__ */ jsx9(Typography, { component: "div", style: { height: "100%" }, children: /* @__PURE__ */ jsxs4(
532
552
  Box,
533
553
  {
534
554
  style: {
@@ -541,7 +561,7 @@ function CmrUploadWindow({
541
561
  onClick: fileInputClick,
542
562
  ref: fileInput,
543
563
  children: [
544
- /* @__PURE__ */ jsxs5(Typography, { variant: "body1", align: "center", style: { marginTop: "auto" }, children: [
564
+ /* @__PURE__ */ jsxs4(Typography, { variant: "body1", align: "center", style: { marginTop: "auto" }, children: [
545
565
  "Drag & Drop or Click to Upload Your File Here ",
546
566
  /* @__PURE__ */ jsx9("sup", { children: "*" })
547
567
  ] }),
@@ -562,8 +582,8 @@ function CmrUploadWindow({
562
582
  onChange: loadSelectedFiles
563
583
  }
564
584
  ),
565
- /* @__PURE__ */ jsxs5(Box, { component: "form", sx: { "& .MuiTextField-root": { m: 2, width: "25ch", mb: 0 } }, children: [
566
- /* @__PURE__ */ jsxs5("div", { children: [
585
+ /* @__PURE__ */ jsxs4(Box, { component: "form", sx: { "& .MuiTextField-root": { m: 2, width: "25ch", mb: 0 } }, children: [
586
+ /* @__PURE__ */ jsxs4("div", { children: [
567
587
  template.showFileName && /* @__PURE__ */ jsx9(
568
588
  TextField,
569
589
  {
@@ -584,11 +604,11 @@ function CmrUploadWindow({
584
604
  defaultValue: "s3",
585
605
  helperText: "Upstream Storage Location",
586
606
  variant: "standard",
587
- children: [{ value: "s3", label: "S3" }].map((option) => /* @__PURE__ */ jsx9(MenuItem2, { value: option.value, children: option.label }, option.value))
607
+ children: [{ value: "s3", label: "S3" }].map((option) => /* @__PURE__ */ jsx9(MenuItem, { value: option.value, children: option.label }, option.value))
588
608
  }
589
609
  )
590
610
  ] }),
591
- /* @__PURE__ */ jsxs5("div", { children: [
611
+ /* @__PURE__ */ jsxs4("div", { children: [
592
612
  template.showFileSize && /* @__PURE__ */ jsx9(
593
613
  TextField,
594
614
  {
@@ -604,7 +624,7 @@ function CmrUploadWindow({
604
624
  ] })
605
625
  ] })
606
626
  ] }),
607
- /* @__PURE__ */ jsxs5(DialogActions, { children: [
627
+ /* @__PURE__ */ jsxs4(DialogActions, { children: [
608
628
  /* @__PURE__ */ jsx9(
609
629
  Button2,
610
630
  {
@@ -630,7 +650,7 @@ function CmrUploadWindow({
630
650
 
631
651
  // src/CmrComponents/upload/Upload.tsx
632
652
  import axios from "axios";
633
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
653
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
634
654
  var CmrUpload = (props) => {
635
655
  let [open, setOpen] = useState4(false);
636
656
  let [uploading, setUploading] = useState4(false);
@@ -703,8 +723,8 @@ var CmrUpload = (props) => {
703
723
  return props.uploadFailed();
704
724
  return 0;
705
725
  }
706
- return /* @__PURE__ */ jsxs6(React5.Fragment, { children: [
707
- !uploading ? /* @__PURE__ */ jsxs6(
726
+ return /* @__PURE__ */ jsxs5(React5.Fragment, { children: [
727
+ !uploading ? /* @__PURE__ */ jsxs5(
708
728
  Button3,
709
729
  {
710
730
  fullWidth: props.fullWidth,
@@ -721,7 +741,7 @@ var CmrUpload = (props) => {
721
741
  " "
722
742
  ]
723
743
  }
724
- ) : /* @__PURE__ */ jsxs6(Button3, { fullWidth: props.fullWidth, style: props.style, variant: "contained", sx: { overflowWrap: "inherit" }, color: "primary", disabled: true, children: [
744
+ ) : /* @__PURE__ */ jsxs5(Button3, { fullWidth: props.fullWidth, style: props.style, variant: "contained", sx: { overflowWrap: "inherit" }, color: "primary", disabled: true, children: [
725
745
  "Uploading ",
726
746
  progress,
727
747
  "%"
@@ -752,7 +772,7 @@ import DialogActions2 from "@mui/material/DialogActions";
752
772
  import DialogContent2 from "@mui/material/DialogContent";
753
773
  import DialogTitle2 from "@mui/material/DialogTitle";
754
774
  import { useEffect as useEffect2 } from "react";
755
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
775
+ import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
756
776
  function CmrNameDialog(props) {
757
777
  let { originalName, open, setOpen } = props;
758
778
  const [helperText, setHelperText] = React6.useState("");
@@ -792,7 +812,7 @@ function CmrNameDialog(props) {
792
812
  setHelperText("");
793
813
  }
794
814
  };
795
- return /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsxs7(
815
+ return /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsxs6(
796
816
  Dialog2,
797
817
  {
798
818
  open,
@@ -800,7 +820,7 @@ function CmrNameDialog(props) {
800
820
  fullWidth: true,
801
821
  maxWidth: "xs",
802
822
  children: [
803
- /* @__PURE__ */ jsx11(DialogTitle2, { children: /* @__PURE__ */ jsxs7(Typography2, { children: [
823
+ /* @__PURE__ */ jsx11(DialogTitle2, { children: /* @__PURE__ */ jsxs6(Typography2, { children: [
804
824
  " Rename the File ",
805
825
  originalName,
806
826
  " as:"
@@ -823,7 +843,7 @@ function CmrNameDialog(props) {
823
843
  helperText
824
844
  }
825
845
  ) }),
826
- /* @__PURE__ */ jsxs7(DialogActions2, { children: [
846
+ /* @__PURE__ */ jsxs6(DialogActions2, { children: [
827
847
  /* @__PURE__ */ jsx11(CmrButton_default, { variant: "outlined", onClick: handleClose, children: "Cancel" }),
828
848
  /* @__PURE__ */ jsx11(CmrButton_default, { variant: "contained", color: "primary", onClick: handleConfirm, children: "Confirm" })
829
849
  ] })
@@ -838,7 +858,7 @@ import DialogActions3 from "@mui/material/DialogActions";
838
858
  import DialogContent3 from "@mui/material/DialogContent";
839
859
  import DialogContentText2 from "@mui/material/DialogContentText";
840
860
  import DialogTitle3 from "@mui/material/DialogTitle";
841
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
861
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
842
862
  function CmrConfirmation({
843
863
  name,
844
864
  message,
@@ -866,11 +886,11 @@ function CmrConfirmation({
866
886
  cancelCallback();
867
887
  handleClose();
868
888
  };
869
- return /* @__PURE__ */ jsxs8(Dialog3, { open, onClose: handleClose, children: [
889
+ return /* @__PURE__ */ jsxs7(Dialog3, { open, onClose: handleClose, children: [
870
890
  /* @__PURE__ */ jsx12(DialogTitle3, { children: name ? name : "Confirmation" }),
871
- /* @__PURE__ */ jsxs8(DialogContent3, { sx: { width }, children: [
891
+ /* @__PURE__ */ jsxs7(DialogContent3, { sx: { width }, children: [
872
892
  /* @__PURE__ */ jsx12(DialogContentText2, { alignContent: "center", children: message }),
873
- /* @__PURE__ */ jsxs8(DialogActions3, { className: "mt-4", children: [
893
+ /* @__PURE__ */ jsxs7(DialogActions3, { className: "mt-4", children: [
874
894
  cancellable && /* @__PURE__ */ jsx12(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: cancelText }),
875
895
  extraButtons.map((btn, idx) => /* @__PURE__ */ jsx12(
876
896
  CmrButton_default,
@@ -899,7 +919,7 @@ import DialogActions4 from "@mui/material/DialogActions";
899
919
  import DialogContent4 from "@mui/material/DialogContent";
900
920
  import DialogContentText3 from "@mui/material/DialogContentText";
901
921
  import DialogTitle4 from "@mui/material/DialogTitle";
902
- import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
922
+ import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
903
923
  function CmrDeletionDialog(props) {
904
924
  const [open, setOpen] = React7.useState(true);
905
925
  const [text, setText] = React7.useState("");
@@ -918,9 +938,9 @@ function CmrDeletionDialog(props) {
918
938
  const handleTextFieldChange = (e) => {
919
939
  setText(e.target.value);
920
940
  };
921
- return /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsxs9(Dialog4, { open, onClose: handleClose, children: [
941
+ return /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsxs8(Dialog4, { open, onClose: handleClose, children: [
922
942
  /* @__PURE__ */ jsx13(DialogTitle4, { children: "Confirmation" }),
923
- /* @__PURE__ */ jsxs9(DialogContent4, { children: [
943
+ /* @__PURE__ */ jsxs8(DialogContent4, { children: [
924
944
  /* @__PURE__ */ jsx13(DialogContentText3, { children: "To delete the files, please type your full name below and confirm." }),
925
945
  /* @__PURE__ */ jsx13(
926
946
  TextField3,
@@ -937,7 +957,7 @@ function CmrDeletionDialog(props) {
937
957
  }
938
958
  )
939
959
  ] }),
940
- /* @__PURE__ */ jsxs9(DialogActions4, { children: [
960
+ /* @__PURE__ */ jsxs8(DialogActions4, { children: [
941
961
  /* @__PURE__ */ jsx13("button", { className: "btn btn-secondary", onClick: handleClose, children: "Cancel" }),
942
962
  /* @__PURE__ */ jsx13("button", { className: "btn btn-danger", onClick: handleConfirm, children: "Confirm" })
943
963
  ] })
@@ -954,7 +974,7 @@ import DialogContentText4 from "@mui/material/DialogContentText";
954
974
  import DialogTitle5 from "@mui/material/DialogTitle";
955
975
  import { InputAdornment } from "@mui/material";
956
976
  import { useEffect as useEffect3 } from "react";
957
- import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
977
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
958
978
  function CmrEditConfirmation({
959
979
  name,
960
980
  message,
@@ -985,9 +1005,9 @@ function CmrEditConfirmation({
985
1005
  cancelCallback(text + suffix);
986
1006
  handleClose();
987
1007
  };
988
- return /* @__PURE__ */ jsxs10(Dialog5, { maxWidth: "xs", fullWidth: true, open, onClose: handleCancel, children: [
1008
+ return /* @__PURE__ */ jsxs9(Dialog5, { maxWidth: "xs", fullWidth: true, open, onClose: handleCancel, children: [
989
1009
  /* @__PURE__ */ jsx14(DialogTitle5, { children: name ? name : "Confirmation" }),
990
- /* @__PURE__ */ jsxs10(DialogContent5, { children: [
1010
+ /* @__PURE__ */ jsxs9(DialogContent5, { children: [
991
1011
  /* @__PURE__ */ jsx14(DialogContentText4, { alignContent: "center", children: message }),
992
1012
  /* @__PURE__ */ jsx14(DialogActions5, { children: /* @__PURE__ */ jsx14(
993
1013
  TextField4,
@@ -1001,7 +1021,7 @@ function CmrEditConfirmation({
1001
1021
  onChange: (e) => setText(e.target.value)
1002
1022
  }
1003
1023
  ) }),
1004
- /* @__PURE__ */ jsxs10(DialogActions5, { children: [
1024
+ /* @__PURE__ */ jsxs9(DialogActions5, { children: [
1005
1025
  cancellable && /* @__PURE__ */ jsx14(CmrButton_default, { variant: "outlined", onClick: handleCancel, children: "Cancel" }),
1006
1026
  /* @__PURE__ */ jsx14(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: "Confirm" })
1007
1027
  ] })
@@ -1017,7 +1037,7 @@ import Container from "@mui/material/Container";
1017
1037
  import Typography3 from "@mui/material/Typography";
1018
1038
  import Box3 from "@mui/material/Box";
1019
1039
  import { cloneElement as cloneElement2 } from "react";
1020
- import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1040
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
1021
1041
  function CustomTabPanel(props) {
1022
1042
  const { children, value, index, ...other } = props;
1023
1043
  return /* @__PURE__ */ jsx15(
@@ -1045,7 +1065,7 @@ function CmrTabs(props) {
1045
1065
  if (props.onTabSelected)
1046
1066
  props.onTabSelected(newValue);
1047
1067
  };
1048
- return /* @__PURE__ */ jsxs11(
1068
+ return /* @__PURE__ */ jsxs10(
1049
1069
  Container,
1050
1070
  {
1051
1071
  maxWidth: "lg",
@@ -1114,13 +1134,13 @@ var InputNumber_default = CmrInputNumber;
1114
1134
  // src/CmrComponents/select-upload/SelectUpload.tsx
1115
1135
  import React10, { Fragment } from "react";
1116
1136
  import { Button as Button4 } from "@mui/material";
1117
- import Select2 from "react-select";
1137
+ import Select from "react-select";
1118
1138
  import Dialog6 from "@mui/material/Dialog";
1119
1139
  import DialogTitle6 from "@mui/material/DialogTitle";
1120
1140
  import DialogContent6 from "@mui/material/DialogContent";
1121
1141
  import DialogContentText5 from "@mui/material/DialogContentText";
1122
1142
  import Box4 from "@mui/material/Box";
1123
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1143
+ import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
1124
1144
  function checkExtension(filename, allowed) {
1125
1145
  if (!filename || !allowed)
1126
1146
  return true;
@@ -1147,12 +1167,12 @@ var CMRSelectUpload = (props) => {
1147
1167
  props.onSelected(props.fileSelection[fileIndex]);
1148
1168
  setOpen(false);
1149
1169
  };
1150
- const selectionDialog = /* @__PURE__ */ jsxs12(Dialog6, { open, onClose: handleClose, children: [
1170
+ const selectionDialog = /* @__PURE__ */ jsxs11(Dialog6, { open, onClose: handleClose, children: [
1151
1171
  /* @__PURE__ */ jsx18(DialogTitle6, { children: "Select or Upload" }),
1152
- /* @__PURE__ */ jsxs12(DialogContent6, { sx: { width: 520 }, children: [
1172
+ /* @__PURE__ */ jsxs11(DialogContent6, { sx: { width: 520 }, children: [
1153
1173
  /* @__PURE__ */ jsx18(DialogContentText5, { sx: { pl: 1, pr: 1, pb: 0 }, children: uploading ? "Please wait for the upload to finish." : "" }),
1154
1174
  /* @__PURE__ */ jsx18(Box4, { sx: { p: 1 }, children: /* @__PURE__ */ jsx18(
1155
- Select2,
1175
+ Select,
1156
1176
  {
1157
1177
  classNamePrefix: "cmr-select",
1158
1178
  isDisabled: uploading,
@@ -1174,7 +1194,7 @@ var CMRSelectUpload = (props) => {
1174
1194
  styles: props.selectStyles
1175
1195
  }
1176
1196
  ) }),
1177
- /* @__PURE__ */ jsxs12(Box4, { sx: { pt: 2, justifyContent: "center", display: "flex", padding: "8px" }, children: [
1197
+ /* @__PURE__ */ jsxs11(Box4, { sx: { pt: 2, justifyContent: "center", display: "flex", padding: "8px" }, children: [
1178
1198
  /* @__PURE__ */ jsx18(Button4, { fullWidth: true, sx: { marginRight: "8px" }, variant: "outlined", onClick: handleClose, children: " Cancel" }),
1179
1199
  fileIndex !== -1 && !uploading && /* @__PURE__ */ jsx18(Button4, { fullWidth: true, variant: "contained", onClick: onSet, children: "OK" }),
1180
1200
  fileIndex == -1 && /* @__PURE__ */ jsx18(
@@ -1206,8 +1226,8 @@ var CMRSelectUpload = (props) => {
1206
1226
  ] })
1207
1227
  ] })
1208
1228
  ] });
1209
- return /* @__PURE__ */ jsxs12(Fragment, { children: [
1210
- uploading ? /* @__PURE__ */ jsxs12(Button4, { variant: "contained", style: { ...props.style, textTransform: "none" }, sx: { overflowWrap: "inherit" }, color: "primary", disabled: uploading, children: [
1229
+ return /* @__PURE__ */ jsxs11(Fragment, { children: [
1230
+ uploading ? /* @__PURE__ */ jsxs11(Button4, { variant: "contained", style: { ...props.style, textTransform: "none" }, sx: { overflowWrap: "inherit" }, color: "primary", disabled: uploading, children: [
1211
1231
  "Uploading ",
1212
1232
  progress,
1213
1233
  "%"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudmr-ux",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "author": "erosmontin@gmail.com",
5
5
  "license": "MIT",
6
6
  "repository": "erosmontin/cloudmr-ux",