@luscii-healthtech/web-ui 28.10.0 → 28.11.0

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.
@@ -1,10 +1,8 @@
1
- import React, { MouseEventHandler } from "react";
2
- interface ImageProps {
3
- src: string;
4
- className: string;
5
- children?: React.ReactNode;
6
- onClick?: MouseEventHandler<HTMLSpanElement>;
7
- showIconOnFailure?: boolean;
8
- }
9
- declare const Image: React.VFC<ImageProps>;
10
- export default Image;
1
+ import React from "react";
2
+ /**
3
+ * When you have many elements to lazy load in the same page, you might get poor performance because each one is
4
+ * listening to the scroll/resize events. In that case, it's better to wrap the deepest common parent of those
5
+ * components with a HOC to track those events (trackWindowScroll).
6
+ */
7
+ declare const _default: React.ComponentType<Omit<import("react-lazy-load-image-component").LazyComponentProps, "scrollPosition">>;
8
+ export default _default;
@@ -5146,12 +5146,13 @@ const Image$1 = (_a) => {
5146
5146
  return null;
5147
5147
  }
5148
5148
  }
5149
- return React__namespace.default.createElement(reactLazyLoadImageComponent.LazyLoadImage, Object.assign({ className: classNames__default.default(className), effect: "blur", placeholder: React__namespace.default.createElement(
5149
+ return React__namespace.default.createElement(reactLazyLoadImageComponent.LazyLoadImage, Object.assign({ className: classNames__default.default(className), effect: "blur", useIntersectionObserver: true, placeholder: React__namespace.default.createElement(
5150
5150
  "div",
5151
5151
  { className: "ui-flex ui-h-full ui-w-full ui-flex-row ui-items-center ui-justify-center ui-rounded" },
5152
5152
  React__namespace.default.createElement("img", { src: img, alt: "image-icon" })
5153
5153
  ), src, onClick, onError: () => setIsError(true), wrapperClassName: "ui-w-full ui-h-full" }, otherProps));
5154
5154
  };
5155
+ var Image$2 = reactLazyLoadImageComponent.trackWindowScroll(Image$1);
5155
5156
 
5156
5157
  const ImageCategory = (props) => {
5157
5158
  return React__namespace.default.createElement(
@@ -5167,7 +5168,7 @@ const ImageCategory = (props) => {
5167
5168
  "ui-h-11 ui-w-11": props.isTypeCompact,
5168
5169
  "ui-h-22 ui-w-36": !props.isTypeCompact
5169
5170
  }) },
5170
- React__namespace.default.createElement(Image$1, { className: "ui-h-full ui-w-full ui-rounded", onClick: props.handleImageClick, src: option, "data-index": index })
5171
+ React__namespace.default.createElement(Image$2, { className: "ui-h-full ui-w-full ui-rounded", onClick: props.handleImageClick, src: option, "data-index": index })
5171
5172
  );
5172
5173
  }))
5173
5174
  );
@@ -5290,7 +5291,7 @@ const ImagePickerInner = ({
5290
5291
  "ui-h-44 ui-w-full": !isTypeCompact
5291
5292
  }) },
5292
5293
  isUploading && React__namespace.default.createElement(LoadingIndicator, { className: "ui-my-16" }),
5293
- !isUploading && selectedMediaType === "image" && React__namespace.default.createElement(Image$1, { className: classNames__default.default("ui-h-full", {
5294
+ !isUploading && selectedMediaType === "image" && React__namespace.default.createElement(Image$2, { className: classNames__default.default("ui-h-full", {
5294
5295
  "ui-w-full ui-rounded ui-bg-secondary ui-object-contain ui-p-3": !isTypeCompact,
5295
5296
  "ui-w-full": isTypeCompact
5296
5297
  }), src: selectedMedia }),
@@ -6523,7 +6524,7 @@ exports.HeartMinusIcon = HeartMinusIcon;
6523
6524
  exports.HomeIcon = HomeIcon;
6524
6525
  exports.HoverIndicatorControl = HoverIndicatorControl;
6525
6526
  exports.Icon = Icon;
6526
- exports.Image = Image$1;
6527
+ exports.Image = Image$2;
6527
6528
  exports.ImageIcon = ImageIcon;
6528
6529
  exports.InfoField = InfoField;
6529
6530
  exports.InfoIcon = InfoIcon;