x-ui-design 0.5.37 → 0.5.38

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.esm.js CHANGED
@@ -3231,7 +3231,7 @@ function getTextFromNode(node) {
3231
3231
  if (typeof node === 'string' || typeof node === 'number') {
3232
3232
  return node.toString();
3233
3233
  }
3234
- if (/*#__PURE__*/React.isValidElement(node)) {
3234
+ if (/*#__PURE__*/isValidElement(node)) {
3235
3235
  const html = ReactDOMServer.renderToStaticMarkup(node);
3236
3236
  return html.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
3237
3237
  }
@@ -3321,6 +3321,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3321
3321
  return;
3322
3322
  }
3323
3323
  setSearchQuery('');
3324
+ onSearch?.('');
3324
3325
  let inputContainer = selectRef.current?.querySelector(`[id='${prefixCls}-search-tag-input']`);
3325
3326
  if (!inputContainer) {
3326
3327
  inputContainer = selectRef.current?.querySelector("[content-editable='plaintext-only']");
@@ -3488,8 +3489,8 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3488
3489
  if (!isOpen) {
3489
3490
  return;
3490
3491
  }
3491
- e.target.value = e.target.innerText.trim().replace('\n', '');
3492
3492
  const timeout = setTimeout(() => {
3493
+ e.target.value = (searchInputRef.current?.innerText || e.target.innerText).replace('\n', '');
3493
3494
  setSearchQuery(e.target.value);
3494
3495
  onSearch?.(e.target.value);
3495
3496
  if (e.key === 'Enter' && searchQuery.trim() !== '') {
@@ -3562,7 +3563,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3562
3563
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3563
3564
  // @ts-expect-error
3564
3565
  const optionFilterPropValue = option[optionFilterProp];
3565
- const valueToCheck = optionFilterProp && typeof optionFilterPropValue === 'string' ? String(optionFilterPropValue) : getTextFromNode(option.children) || String(option.label) || String(option.value);
3566
+ const valueToCheck = optionFilterProp && typeof optionFilterPropValue === 'string' ? String(optionFilterPropValue) : Array.isArray(option.children) && typeof option.children[0] === 'string' ? option.children[0] : getTextFromNode(option.children) || String(option.label) || String(option.value);
3566
3567
  return valueToCheck.toLowerCase().includes(searchQuery.toLowerCase());
3567
3568
  });
3568
3569
  const handleTriggerClick = () => {