fis-component 0.0.59 → 0.0.61

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
@@ -73379,9 +73379,12 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73379
73379
  return found ? [found] : [];
73380
73380
  }
73381
73381
  }, [value, multi]);
73382
- const computedDisplayValue = React.useMemo(() => {
73382
+ const computedDisplayValue = () => {
73383
73383
  if (multi) {
73384
73384
  const count = value.length;
73385
+ if (count === 0) {
73386
+ return "";
73387
+ }
73385
73388
  return multiDisplayText
73386
73389
  ? multiDisplayText(count)
73387
73390
  : `Selected ${count.toString().padStart(2, "0")} option${count !== 1 ? "s" : ""}`;
@@ -73391,7 +73394,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73391
73394
  return "";
73392
73395
  return (displayValue?.(selectedItems[0]) || selectedItems[0].label);
73393
73396
  }
73394
- }, [value, multi, displayValue, multiDisplayText, selectedItems, options]);
73397
+ };
73395
73398
  const handleToggle = React.useCallback(() => {
73396
73399
  if (!disabled)
73397
73400
  setIsOpen((prev) => !prev);
@@ -73457,7 +73460,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73457
73460
  document.addEventListener("mousedown", handleClickOutside);
73458
73461
  return () => document.removeEventListener("mousedown", handleClickOutside);
73459
73462
  }, [referenceElement, popperElement]);
73460
- return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue, disabled: disabled, activeDropdown: isOpen }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73463
+ return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73461
73464
  ...styles.popper,
73462
73465
  width: referenceElement?.offsetWidth,
73463
73466
  zIndex: 9999,