@ctlyst.id/internal-ui 5.4.0 → 5.4.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.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
@@ -6013,6 +6013,11 @@ var Uploader = ({
|
|
6013
6013
|
const file = files[0];
|
6014
6014
|
const imageUrl = URL.createObjectURL(file);
|
6015
6015
|
const img = new Image();
|
6016
|
+
if (file.type === "image/heic") {
|
6017
|
+
setFilePreview(file.name);
|
6018
|
+
onHandleUploadFile == null ? void 0 : onHandleUploadFile(file, null);
|
6019
|
+
return null;
|
6020
|
+
}
|
6016
6021
|
img.src = imageUrl;
|
6017
6022
|
img.onload = () => {
|
6018
6023
|
const imgWidth = img.width;
|
@@ -6029,7 +6034,7 @@ var Uploader = ({
|
|
6029
6034
|
};
|
6030
6035
|
return null;
|
6031
6036
|
},
|
6032
|
-
[
|
6037
|
+
[customValidation, dimension, handleRejection, onHandleUploadFile]
|
6033
6038
|
);
|
6034
6039
|
const onDropRejected = useCallback4((fileRejections) => {
|
6035
6040
|
defaultOnHandleRejections(fileRejections, { acceptFormat, maxFileSize }, handleRejection);
|
@@ -6057,8 +6062,8 @@ var Uploader = ({
|
|
6057
6062
|
accept: Object.fromEntries(acceptFile),
|
6058
6063
|
maxFiles: 1,
|
6059
6064
|
maxSize: maxFileSize == null ? void 0 : maxFileSize.validate,
|
6060
|
-
noClick: isDisabled,
|
6061
|
-
noDrag: isDisabled,
|
6065
|
+
noClick: isDisabled || !!filePreview,
|
6066
|
+
noDrag: isDisabled || !!filePreview,
|
6062
6067
|
validator
|
6063
6068
|
});
|
6064
6069
|
const renderHelperText = () => {
|
@@ -6088,6 +6093,10 @@ var Uploader = ({
|
|
6088
6093
|
if (typeof value === "string") {
|
6089
6094
|
setFilePreview(value);
|
6090
6095
|
} else {
|
6096
|
+
if (value.type === "image/heic") {
|
6097
|
+
setFilePreview(value.name);
|
6098
|
+
return;
|
6099
|
+
}
|
6091
6100
|
setFilePreview(URL.createObjectURL(value));
|
6092
6101
|
}
|
6093
6102
|
} else {
|
@@ -6150,7 +6159,7 @@ var Uploader = ({
|
|
6150
6159
|
"data-test-id": `CT_component_base-image-uploader_image-preview${testId ? `_${testId}` : ""}`,
|
6151
6160
|
justify: "center",
|
6152
6161
|
align: "center",
|
6153
|
-
children: /* @__PURE__ */ jsx66(
|
6162
|
+
children: filePreview.includes("blob") ? /* @__PURE__ */ jsx66(
|
6154
6163
|
ChakraImage,
|
6155
6164
|
{
|
6156
6165
|
h: size2 === "lg" ? "120" : "100",
|
@@ -6158,7 +6167,7 @@ var Uploader = ({
|
|
6158
6167
|
alt: "uploader-preview",
|
6159
6168
|
objectFit: "contain"
|
6160
6169
|
}
|
6161
|
-
)
|
6170
|
+
) : filePreview
|
6162
6171
|
}
|
6163
6172
|
) }),
|
6164
6173
|
!filePreview && /* @__PURE__ */ jsx66(Fragment12, { children: isDragActive ? /* @__PURE__ */ jsx66(Text18, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ jsxs31(Flex19, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
|