fis-component 0.0.97 → 0.0.98

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.
@@ -30,6 +30,7 @@ export interface MenuProps {
30
30
  removeSelectedText?: string;
31
31
  selectedGroupLabel?: string;
32
32
  maxHeight?: string | number;
33
+ onPopupScroll?: (e: React.UIEvent<HTMLElement>) => void;
33
34
  }
34
35
  export interface MenuState {
35
36
  search: string;
@@ -21,6 +21,7 @@ type BaseSelectProps<T extends string | number> = Partial<InputLabelProps> & Omi
21
21
  renderOption?: (option: SelectOption<T>) => React.ReactNode;
22
22
  portal?: boolean;
23
23
  maxHeight?: string | number;
24
+ onPopupScroll?: (e: React.UIEvent<HTMLElement>) => void;
24
25
  };
25
26
  export type SingleSelectProps<T extends string | number> = BaseSelectProps<T> & {
26
27
  multi?: false;
package/dist/esm/index.js CHANGED
@@ -67607,7 +67607,7 @@ const FISMenuSection = ({ label, withAction = false, actionText, actionLabel = f
67607
67607
  };
67608
67608
  FISMenuSection.displayName = "FISMenuSection";
67609
67609
 
67610
- const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, selectedValues = [], onChangeSelected, searchValue = "", onSearchChange, loading = false, noData = false, noResult = false, combobox, className, onClickMenu, loadingText = "Data loading...", noDataText = "No data", noResultText = "No result", removeSelectedText = "Remove selected", selectedGroupLabel = "Selected", maxHeight, }) => {
67610
+ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, selectedValues = [], onChangeSelected, searchValue = "", onSearchChange, loading = false, noData = false, noResult = false, combobox, className, onClickMenu, loadingText = "Data loading...", noDataText = "No data", noResultText = "No result", removeSelectedText = "Remove selected", selectedGroupLabel = "Selected", maxHeight, onPopupScroll, }) => {
67611
67611
  const [localSearch, setLocalSearch] = useState(searchValue);
67612
67612
  useEffect(() => {
67613
67613
  setLocalSearch(searchValue);
@@ -67688,7 +67688,7 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
67688
67688
  onClickMenu?.();
67689
67689
  }
67690
67690
  };
67691
- return (jsxs(DivContainerSC$4, { "$maxHeight": maxHeight, className: className, children: [showInput && !combobox && (jsx(DivSearchSC, { children: jsx(FISInputText, { iconPrefix: jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoResultIcon, {}) }), jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoDataIcon, {}) }), jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxs(DivLoaderSC, { children: [jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxs(Fragment, { children: [jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxs(DivWrapperSC$4, { children: [index !== 0 && jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsx(FISTooltip, { title: item.label, variant: "primary", children: jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }) }, idx)))] }, index))) }), removeSelectedGroup && (jsx(FixedBottomSection, { children: jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsx(FISTooltip, { title: item.label, variant: "primary", children: jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsx(RemoveIcon, {}), negative: true }) }, idx))) }) }))] }))] }));
67691
+ return (jsxs(DivContainerSC$4, { "$maxHeight": maxHeight, className: className, onScroll: onPopupScroll, children: [showInput && !combobox && (jsx(DivSearchSC, { children: jsx(FISInputText, { iconPrefix: jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoResultIcon, {}) }), jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoDataIcon, {}) }), jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxs(DivLoaderSC, { children: [jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxs(Fragment, { children: [jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxs(DivWrapperSC$4, { children: [index !== 0 && jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsx(FISTooltip, { title: item.label, variant: "primary", children: jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }) }, idx)))] }, index))) }), removeSelectedGroup && (jsx(FixedBottomSection, { children: jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsx(FISTooltip, { title: item.label, variant: "primary", children: jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsx(RemoveIcon, {}), negative: true }) }, idx))) }) }))] }))] }));
67692
67692
  };
67693
67693
  FISMenuSelect.displayName = "FISMenuSelect";
67694
67694
 
@@ -73647,7 +73647,7 @@ function isMenuSize(value) {
73647
73647
  return value === "sm" || value === "md";
73648
73648
  }
73649
73649
 
73650
- const FISSelect = forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholder, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal, maxHeight, ...restProps }, ref) => {
73650
+ const FISSelect = forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholder, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal, maxHeight, onPopupScroll, ...restProps }, ref) => {
73651
73651
  const [isOpen, setIsOpen] = useState(false);
73652
73652
  const [referenceElement, setReferenceElement] = useState(null);
73653
73653
  const [popperElement, setPopperElement] = useState(null);
@@ -73751,6 +73751,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73751
73751
  searchValue,
73752
73752
  onSearchChange,
73753
73753
  maxHeight,
73754
+ onPopupScroll,
73754
73755
  ...restProps,
73755
73756
  }), [
73756
73757
  options,
@@ -73764,6 +73765,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73764
73765
  searchValue,
73765
73766
  onSearchChange,
73766
73767
  maxHeight,
73768
+ onPopupScroll,
73767
73769
  restProps,
73768
73770
  ]);
73769
73771
  useEffect(() => {