@ctlyst.id/internal-ui 5.4.0 → 5.4.1
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 +10 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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 = () => {
|
@@ -6150,7 +6155,7 @@ var Uploader = ({
|
|
6150
6155
|
"data-test-id": `CT_component_base-image-uploader_image-preview${testId ? `_${testId}` : ""}`,
|
6151
6156
|
justify: "center",
|
6152
6157
|
align: "center",
|
6153
|
-
children: /* @__PURE__ */ jsx66(
|
6158
|
+
children: filePreview.includes("blob") ? /* @__PURE__ */ jsx66(
|
6154
6159
|
ChakraImage,
|
6155
6160
|
{
|
6156
6161
|
h: size2 === "lg" ? "120" : "100",
|
@@ -6158,7 +6163,7 @@ var Uploader = ({
|
|
6158
6163
|
alt: "uploader-preview",
|
6159
6164
|
objectFit: "contain"
|
6160
6165
|
}
|
6161
|
-
)
|
6166
|
+
) : filePreview
|
6162
6167
|
}
|
6163
6168
|
) }),
|
6164
6169
|
!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: [
|