fis-component 0.0.58 → 0.0.60

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
@@ -62970,6 +62970,7 @@ const FISTab = ({ children, active: propActive, defaultActive, size = "md", clas
62970
62970
  return (jsxRuntime.jsxs(DivTabItemSC, { ref: (el) => (tabRefs.current[value] = el), "$isActive": activeKey === value, "$disabled": disabled, "$size": size, className: itemClassName, "$fullWidth": fullWidth, onClick: () => handleTabClick(value, disabled), children: [startIcon, title && jsxRuntime.jsx(SpanContentSC$1, { children: title }), endIcon] }, value));
62971
62971
  }), jsxRuntime.jsx(DivActiveIndicatorSC, { style: indicatorStyle })] }), activeContent && jsxRuntime.jsx("div", { className: contentClassName, children: activeContent })] }));
62972
62972
  };
62973
+ FISTab.displayName = "FISTab";
62973
62974
 
62974
62975
  const DivSegmentedContainerSC = styled.div `
62975
62976
  width: 100%;
@@ -71020,7 +71021,7 @@ function mergeRefs(...refs) {
71020
71021
  }
71021
71022
 
71022
71023
  const FISInputDate = React.forwardRef((props, ref) => {
71023
- const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, ...restProps } = props;
71024
+ const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
71024
71025
  const [open, setOpen] = React.useState(false);
71025
71026
  const [inputValue, setInputValue] = React.useState(value ? dayjs(value).format(format) : "");
71026
71027
  const [dateValue, setDateValue] = React.useState(value ? dayjs(value) : null);
@@ -71063,7 +71064,7 @@ const FISInputDate = React.forwardRef((props, ref) => {
71063
71064
  onChange?.(null);
71064
71065
  }
71065
71066
  };
71066
- return (jsxRuntime.jsxs(DivWrapperSC$2, { children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { children: [jsxRuntime.jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
71067
+ return (jsxRuntime.jsxs(DivWrapperSC$2, { children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { children: [jsxRuntime.jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
71067
71068
  disabled,
71068
71069
  negative,
71069
71070
  positive,
@@ -73378,9 +73379,12 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73378
73379
  return found ? [found] : [];
73379
73380
  }
73380
73381
  }, [value, multi]);
73381
- const computedDisplayValue = React.useMemo(() => {
73382
+ const computedDisplayValue = () => {
73382
73383
  if (multi) {
73383
73384
  const count = value.length;
73385
+ if (count === 0) {
73386
+ return "";
73387
+ }
73384
73388
  return multiDisplayText
73385
73389
  ? multiDisplayText(count)
73386
73390
  : `Selected ${count.toString().padStart(2, "0")} option${count !== 1 ? "s" : ""}`;
@@ -73390,7 +73394,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73390
73394
  return "";
73391
73395
  return (displayValue?.(selectedItems[0]) || selectedItems[0].label);
73392
73396
  }
73393
- }, [value, multi, displayValue, multiDisplayText, selectedItems, options]);
73397
+ };
73394
73398
  const handleToggle = React.useCallback(() => {
73395
73399
  if (!disabled)
73396
73400
  setIsOpen((prev) => !prev);