fis-component 0.0.96 → 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.
package/dist/cjs/index.js CHANGED
@@ -67627,7 +67627,7 @@ const FISMenuSection = ({ label, withAction = false, actionText, actionLabel = f
67627
67627
  };
67628
67628
  FISMenuSection.displayName = "FISMenuSection";
67629
67629
 
67630
- 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, }) => {
67630
+ 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, }) => {
67631
67631
  const [localSearch, setLocalSearch] = React.useState(searchValue);
67632
67632
  React.useEffect(() => {
67633
67633
  setLocalSearch(searchValue);
@@ -67708,7 +67708,7 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
67708
67708
  onClickMenu?.();
67709
67709
  }
67710
67710
  };
67711
- return (jsxRuntime.jsxs(DivContainerSC$4, { "$maxHeight": maxHeight, className: className, children: [showInput && !combobox && (jsxRuntime.jsx(DivSearchSC, { children: jsxRuntime.jsx(FISInputText, { iconPrefix: jsxRuntime.jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoResultIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoDataIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsxRuntime.jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxRuntime.jsxs(DivWrapperSC$4, { children: [index !== 0 && jsxRuntime.jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsxRuntime.jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsxRuntime.jsx(FISTooltip, { title: item.label, variant: "primary", children: jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }) }, idx)))] }, index))) }), removeSelectedGroup && (jsxRuntime.jsx(FixedBottomSection, { children: jsxRuntime.jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsxRuntime.jsx(FISTooltip, { title: item.label, variant: "primary", children: jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsxRuntime.jsx(RemoveIcon, {}), negative: true }) }, idx))) }) }))] }))] }));
67711
+ return (jsxRuntime.jsxs(DivContainerSC$4, { "$maxHeight": maxHeight, className: className, onScroll: onPopupScroll, children: [showInput && !combobox && (jsxRuntime.jsx(DivSearchSC, { children: jsxRuntime.jsx(FISInputText, { iconPrefix: jsxRuntime.jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoResultIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoDataIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsxRuntime.jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxRuntime.jsxs(DivWrapperSC$4, { children: [index !== 0 && jsxRuntime.jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsxRuntime.jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsxRuntime.jsx(FISTooltip, { title: item.label, variant: "primary", children: jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }) }, idx)))] }, index))) }), removeSelectedGroup && (jsxRuntime.jsx(FixedBottomSection, { children: jsxRuntime.jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsxRuntime.jsx(FISTooltip, { title: item.label, variant: "primary", children: jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsxRuntime.jsx(RemoveIcon, {}), negative: true }) }, idx))) }) }))] }))] }));
67712
67712
  };
67713
67713
  FISMenuSelect.displayName = "FISMenuSelect";
67714
67714
 
@@ -71326,6 +71326,12 @@ const FISInputDate = React.forwardRef((props, ref) => {
71326
71326
  return;
71327
71327
  const newInputValue = e.target.value;
71328
71328
  setInputValue(newInputValue);
71329
+ // Handle empty input - user wants to clear the date
71330
+ if (newInputValue === "") {
71331
+ setDateValue(null);
71332
+ onChange?.(null);
71333
+ return;
71334
+ }
71329
71335
  // Try to parse the input as a date
71330
71336
  const parsedDate = dayjs(newInputValue, finalFormat);
71331
71337
  if (parsedDate.isValid()) {
@@ -71340,6 +71346,10 @@ const FISInputDate = React.forwardRef((props, ref) => {
71340
71346
  if (originalOnBlur) {
71341
71347
  originalOnBlur(e);
71342
71348
  }
71349
+ // Don't revert if input is empty (user intentionally cleared)
71350
+ if (inputValue === "") {
71351
+ return;
71352
+ }
71343
71353
  // On blur, if input format is invalid, revert to the current date value's formatted string
71344
71354
  const parsedDate = dayjs(inputValue, finalFormat);
71345
71355
  if (!parsedDate.isValid() && dateValue) {
@@ -73657,7 +73667,7 @@ function isMenuSize(value) {
73657
73667
  return value === "sm" || value === "md";
73658
73668
  }
73659
73669
 
73660
- const FISSelect = React.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) => {
73670
+ const FISSelect = React.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) => {
73661
73671
  const [isOpen, setIsOpen] = React.useState(false);
73662
73672
  const [referenceElement, setReferenceElement] = React.useState(null);
73663
73673
  const [popperElement, setPopperElement] = React.useState(null);
@@ -73761,6 +73771,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73761
73771
  searchValue,
73762
73772
  onSearchChange,
73763
73773
  maxHeight,
73774
+ onPopupScroll,
73764
73775
  ...restProps,
73765
73776
  }), [
73766
73777
  options,
@@ -73774,6 +73785,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73774
73785
  searchValue,
73775
73786
  onSearchChange,
73776
73787
  maxHeight,
73788
+ onPopupScroll,
73777
73789
  restProps,
73778
73790
  ]);
73779
73791
  React.useEffect(() => {