@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.js
CHANGED
@@ -6142,6 +6142,11 @@ var Uploader = ({
|
|
6142
6142
|
const file = files[0];
|
6143
6143
|
const imageUrl = URL.createObjectURL(file);
|
6144
6144
|
const img = new Image();
|
6145
|
+
if (file.type === "image/heic") {
|
6146
|
+
setFilePreview(file.name);
|
6147
|
+
onHandleUploadFile == null ? void 0 : onHandleUploadFile(file, null);
|
6148
|
+
return null;
|
6149
|
+
}
|
6145
6150
|
img.src = imageUrl;
|
6146
6151
|
img.onload = () => {
|
6147
6152
|
const imgWidth = img.width;
|
@@ -6158,7 +6163,7 @@ var Uploader = ({
|
|
6158
6163
|
};
|
6159
6164
|
return null;
|
6160
6165
|
},
|
6161
|
-
[
|
6166
|
+
[customValidation, dimension, handleRejection, onHandleUploadFile]
|
6162
6167
|
);
|
6163
6168
|
const onDropRejected = (0, import_react94.useCallback)((fileRejections) => {
|
6164
6169
|
defaultOnHandleRejections(fileRejections, { acceptFormat, maxFileSize }, handleRejection);
|
@@ -6186,8 +6191,8 @@ var Uploader = ({
|
|
6186
6191
|
accept: Object.fromEntries(acceptFile),
|
6187
6192
|
maxFiles: 1,
|
6188
6193
|
maxSize: maxFileSize == null ? void 0 : maxFileSize.validate,
|
6189
|
-
noClick: isDisabled,
|
6190
|
-
noDrag: isDisabled,
|
6194
|
+
noClick: isDisabled || !!filePreview,
|
6195
|
+
noDrag: isDisabled || !!filePreview,
|
6191
6196
|
validator
|
6192
6197
|
});
|
6193
6198
|
const renderHelperText = () => {
|
@@ -6217,6 +6222,10 @@ var Uploader = ({
|
|
6217
6222
|
if (typeof value === "string") {
|
6218
6223
|
setFilePreview(value);
|
6219
6224
|
} else {
|
6225
|
+
if (value.type === "image/heic") {
|
6226
|
+
setFilePreview(value.name);
|
6227
|
+
return;
|
6228
|
+
}
|
6220
6229
|
setFilePreview(URL.createObjectURL(value));
|
6221
6230
|
}
|
6222
6231
|
} else {
|
@@ -6279,7 +6288,7 @@ var Uploader = ({
|
|
6279
6288
|
"data-test-id": `CT_component_base-image-uploader_image-preview${testId ? `_${testId}` : ""}`,
|
6280
6289
|
justify: "center",
|
6281
6290
|
align: "center",
|
6282
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
6291
|
+
children: filePreview.includes("blob") ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
6283
6292
|
import_react93.Image,
|
6284
6293
|
{
|
6285
6294
|
h: size2 === "lg" ? "120" : "100",
|
@@ -6287,7 +6296,7 @@ var Uploader = ({
|
|
6287
6296
|
alt: "uploader-preview",
|
6288
6297
|
objectFit: "contain"
|
6289
6298
|
}
|
6290
|
-
)
|
6299
|
+
) : filePreview
|
6291
6300
|
}
|
6292
6301
|
) }),
|
6293
6302
|
!filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react93.Text, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react93.Flex, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
|