fis-component 0.0.49 → 0.0.51

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
@@ -69971,12 +69971,15 @@ function getDefaultContainer() {
69971
69971
  rootPortal.setAttribute("id", rootId);
69972
69972
  return document.body.appendChild(rootPortal);
69973
69973
  }
69974
- function Portal(props) {
69974
+ function Portal({ container, children, portal }) {
69975
69975
  const [mountNode, setMountNode] = React.useState(null);
69976
69976
  React.useLayoutEffect(() => {
69977
- setMountNode(props.container || getDefaultContainer());
69978
- }, [props.container]);
69979
- return mountNode ? ReactDOM.createPortal(props.children, mountNode) : null;
69977
+ setMountNode(container || getDefaultContainer());
69978
+ }, [container]);
69979
+ if (!portal) {
69980
+ return children || null;
69981
+ }
69982
+ return mountNode ? ReactDOM.createPortal(children, mountNode) : null;
69980
69983
  }
69981
69984
 
69982
69985
  const DivChipButtonWrapperSC = styled.div `
@@ -73272,7 +73275,7 @@ function isMenuSize(value) {
73272
73275
  return value === "sm" || value === "md";
73273
73276
  }
73274
73277
 
73275
- const FISSelect = React.forwardRef(({ className, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, ...restProps }, ref) => {
73278
+ const FISSelect = React.forwardRef(({ className, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, portal, ...restProps }, ref) => {
73276
73279
  const [isOpen, setIsOpen] = React.useState(false);
73277
73280
  const [referenceElement, setReferenceElement] = React.useState(null);
73278
73281
  const [popperElement, setPopperElement] = React.useState(null);
@@ -73333,7 +73336,7 @@ const FISSelect = React.forwardRef(({ className, size = "md", options, value, di
73333
73336
  onChange(newValues);
73334
73337
  }
73335
73338
  }, [multi, onChange, value]);
73336
- return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, 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: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsxRuntime.jsx(FISMenuSelect, { size: isMenuSize(size) ? size : "md", groups: options, placeholder: placeholderSearch, loading: loading, multi: multi, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
73339
+ return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, 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: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsxRuntime.jsx(FISMenuSelect, { size: isMenuSize(size) ? size : "md", groups: options, placeholder: placeholderSearch, loading: loading, multi: multi, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
73337
73340
  if (multi) {
73338
73341
  onChange(values);
73339
73342
  }