pesona-ui 1.0.17 → 1.0.19

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/index.cjs.js CHANGED
@@ -8617,16 +8617,17 @@ const SelectWithSearch = React.forwardRef(({ name, label, selectLabel, size = 'm
8617
8617
  React.useEffect(() => {
8618
8618
  setSelectedValue(value);
8619
8619
  }, [value]);
8620
+ const displayText = selectedValue
8621
+ ? options.find((option) => option.value === selectedValue)?.label
8622
+ : selectLabel || 'Select an option';
8620
8623
  return (React.createElement(React.Fragment, null,
8621
8624
  label && !floatingLabel && (React.createElement("label", { htmlFor: name },
8622
8625
  label,
8623
8626
  required && React.createElement("span", { className: "text-danger" }, "*"))),
8624
8627
  React.createElement("div", { className: `dropdown-select-container ${size}`, ref: dropdownRef },
8625
8628
  React.createElement("div", { className: `dropdown-header ${isOpen ? 'open' : ''} ${disabled ? 'disabled' : ''}`, onClick: () => !disabled && setIsOpen(!isOpen), ref: ref, "aria-haspopup": "listbox", "aria-expanded": isOpen },
8626
- selectedValue && selectedValue !== ''
8627
- ? options.find((option) => option.value === selectedValue)?.label
8628
- : selectLabel || 'Select an option',
8629
- React.createElement(FiChevronDown, null)),
8629
+ React.createElement("span", { className: "label" }, displayText),
8630
+ React.createElement(FiChevronDown, { className: "arrow" })),
8630
8631
  isOpen && (React.createElement("div", { className: `dropdown-options scrollbar ${disabled ? 'disabled' : ''}`, ref: dropdownOptionsRef, role: "listbox" },
8631
8632
  React.createElement("div", { className: "search-input" },
8632
8633
  React.createElement(Input, { name: "search", placeholder: "Ketik untuk mencari..", type: "search", tabIndex: 0, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: false, role: "textbox", value: selectSearch, autoFocus: true, onChange: (e) => {