cloudmr-ux 1.7.4 → 1.7.6
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.js +8 -10
- package/dist/index.mjs +8 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1117,6 +1117,7 @@ var import_DialogContentText5 = __toESM(require("@mui/material/DialogContentText
|
|
|
1117
1117
|
var import_Box3 = __toESM(require("@mui/material/Box"));
|
|
1118
1118
|
var import_Autocomplete = __toESM(require("@mui/material/Autocomplete"));
|
|
1119
1119
|
var import_TextField5 = __toESM(require("@mui/material/TextField"));
|
|
1120
|
+
var import_Autocomplete2 = require("@mui/material/Autocomplete");
|
|
1120
1121
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1121
1122
|
var CMRSelectUpload = (props) => {
|
|
1122
1123
|
let [open, setOpen] = import_react8.default.useState(false);
|
|
@@ -1127,6 +1128,10 @@ var CMRSelectUpload = (props) => {
|
|
|
1127
1128
|
selectFileIndex(-1);
|
|
1128
1129
|
setOpen(true);
|
|
1129
1130
|
};
|
|
1131
|
+
const customFilter = (0, import_Autocomplete2.createFilterOptions)({
|
|
1132
|
+
matchFrom: "start",
|
|
1133
|
+
stringify: (option) => typeof option === "string" ? option : (option == null ? void 0 : option.fileName) || ""
|
|
1134
|
+
});
|
|
1130
1135
|
const handleClose = () => {
|
|
1131
1136
|
setOpen(false);
|
|
1132
1137
|
};
|
|
@@ -1143,16 +1148,9 @@ var CMRSelectUpload = (props) => {
|
|
|
1143
1148
|
{
|
|
1144
1149
|
disabled: uploading,
|
|
1145
1150
|
options: props.fileSelection,
|
|
1146
|
-
filterOptions:
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
(option) => option.fileName.toLowerCase().startsWith(input)
|
|
1150
|
-
);
|
|
1151
|
-
return filtered.sort(
|
|
1152
|
-
(a, b) => a.fileName.toLowerCase().localeCompare(b.fileName.toLowerCase())
|
|
1153
|
-
);
|
|
1154
|
-
},
|
|
1155
|
-
getOptionLabel: (option) => option.fileName,
|
|
1151
|
+
filterOptions: customFilter,
|
|
1152
|
+
getOptionLabel: (option) => typeof option === "string" ? option : (option == null ? void 0 : option.fileName) || "",
|
|
1153
|
+
noOptionsText: "No files found starting with input",
|
|
1156
1154
|
isOptionEqualToValue: (option, value) => option.id === value.id,
|
|
1157
1155
|
onChange: (event, newValue) => {
|
|
1158
1156
|
if (newValue) {
|
package/dist/index.mjs
CHANGED
|
@@ -1069,6 +1069,7 @@ import DialogContentText5 from "@mui/material/DialogContentText";
|
|
|
1069
1069
|
import Box4 from "@mui/material/Box";
|
|
1070
1070
|
import Autocomplete from "@mui/material/Autocomplete";
|
|
1071
1071
|
import TextField5 from "@mui/material/TextField";
|
|
1072
|
+
import { createFilterOptions } from "@mui/material/Autocomplete";
|
|
1072
1073
|
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1073
1074
|
var CMRSelectUpload = (props) => {
|
|
1074
1075
|
let [open, setOpen] = React11.useState(false);
|
|
@@ -1079,6 +1080,10 @@ var CMRSelectUpload = (props) => {
|
|
|
1079
1080
|
selectFileIndex(-1);
|
|
1080
1081
|
setOpen(true);
|
|
1081
1082
|
};
|
|
1083
|
+
const customFilter = createFilterOptions({
|
|
1084
|
+
matchFrom: "start",
|
|
1085
|
+
stringify: (option) => typeof option === "string" ? option : (option == null ? void 0 : option.fileName) || ""
|
|
1086
|
+
});
|
|
1082
1087
|
const handleClose = () => {
|
|
1083
1088
|
setOpen(false);
|
|
1084
1089
|
};
|
|
@@ -1095,16 +1100,9 @@ var CMRSelectUpload = (props) => {
|
|
|
1095
1100
|
{
|
|
1096
1101
|
disabled: uploading,
|
|
1097
1102
|
options: props.fileSelection,
|
|
1098
|
-
filterOptions:
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
(option) => option.fileName.toLowerCase().startsWith(input)
|
|
1102
|
-
);
|
|
1103
|
-
return filtered.sort(
|
|
1104
|
-
(a, b) => a.fileName.toLowerCase().localeCompare(b.fileName.toLowerCase())
|
|
1105
|
-
);
|
|
1106
|
-
},
|
|
1107
|
-
getOptionLabel: (option) => option.fileName,
|
|
1103
|
+
filterOptions: customFilter,
|
|
1104
|
+
getOptionLabel: (option) => typeof option === "string" ? option : (option == null ? void 0 : option.fileName) || "",
|
|
1105
|
+
noOptionsText: "No files found starting with input",
|
|
1108
1106
|
isOptionEqualToValue: (option, value) => option.id === value.id,
|
|
1109
1107
|
onChange: (event, newValue) => {
|
|
1110
1108
|
if (newValue) {
|