@oliasoft-open-source/react-ui-library 4.18.0-beta-8 → 4.18.0-beta-9

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.d.ts CHANGED
@@ -670,6 +670,8 @@ declare interface IListItem {
670
670
  disabled?: boolean;
671
671
  onClick?: (evt: any) => void;
672
672
  title?: string;
673
+ details?: string;
674
+ metadata?: string;
673
675
  testId?: string;
674
676
  level?: number;
675
677
  label?: ILabel;
package/dist/index.js CHANGED
@@ -14698,11 +14698,19 @@ const List = ({
14698
14698
  }) => {
14699
14699
  const { hideScrollbar: hideScrollbar2, triggerScrollToActiveItem } = scrollDetails;
14700
14700
  const listContainerRef = useRef(null);
14701
- const MIN_ITEM_HEIGHT = 56;
14701
+ const estimateItemHeight = () => {
14702
+ let height22 = 37;
14703
+ if (list2.items.length > 0) {
14704
+ const item2 = list2.items[list2.items.length - 1];
14705
+ if (item2.details) height22 += 20;
14706
+ if (item2.metadata) height22 += 20;
14707
+ }
14708
+ return height22;
14709
+ };
14702
14710
  const virtualizer = useVirtualizer({
14703
14711
  count: list2.items.length,
14704
14712
  getScrollElement: () => listContainerRef.current,
14705
- estimateSize: () => MIN_ITEM_HEIGHT,
14713
+ estimateSize: () => estimateItemHeight(),
14706
14714
  overscan: 5
14707
14715
  });
14708
14716
  const findFirstActiveItemIndex = (items) => items.findIndex((item2) => item2.active === true);