@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 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
- [acceptFormat, customValidation, dimension, handleRejection, maxFileSize, onHandleUploadFile]
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 = () => {
@@ -6279,7 +6284,7 @@ var Uploader = ({
6279
6284
  "data-test-id": `CT_component_base-image-uploader_image-preview${testId ? `_${testId}` : ""}`,
6280
6285
  justify: "center",
6281
6286
  align: "center",
6282
- children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6287
+ children: filePreview.includes("blob") ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6283
6288
  import_react93.Image,
6284
6289
  {
6285
6290
  h: size2 === "lg" ? "120" : "100",
@@ -6287,7 +6292,7 @@ var Uploader = ({
6287
6292
  alt: "uploader-preview",
6288
6293
  objectFit: "contain"
6289
6294
  }
6290
- )
6295
+ ) : filePreview
6291
6296
  }
6292
6297
  ) }),
6293
6298
  !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: [