x-ui-design 0.2.83 → 0.2.85
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 +6 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -13
- package/dist/index.js.map +1 -1
- package/lib/components/Select/Select.tsx +35 -38
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2988,20 +2988,19 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
2988
2988
|
return;
|
|
2989
2989
|
}
|
|
2990
2990
|
setSearchQuery('');
|
|
2991
|
-
|
|
2991
|
+
let inputContainer = selectRef.current?.querySelector(`[id='${prefixCls}-search-tag-input']`);
|
|
2992
|
+
if (!inputContainer) {
|
|
2993
|
+
inputContainer = selectRef.current?.querySelector("[content-editable='plaintext-only']");
|
|
2994
|
+
}
|
|
2992
2995
|
if (inputContainer) {
|
|
2993
2996
|
inputContainer.innerText = '';
|
|
2994
2997
|
}
|
|
2995
|
-
}, [autoClearSearchValue]);
|
|
2998
|
+
}, [autoClearSearchValue, prefixCls]);
|
|
2996
2999
|
useEffect(() => {
|
|
2997
3000
|
const handleClickOutside = event => {
|
|
2998
3001
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
2999
3002
|
setIsOpen(open);
|
|
3000
|
-
|
|
3001
|
-
handleClearInputValue();
|
|
3002
|
-
} else {
|
|
3003
|
-
setSearchQuery('');
|
|
3004
|
-
}
|
|
3003
|
+
handleClearInputValue();
|
|
3005
3004
|
}
|
|
3006
3005
|
};
|
|
3007
3006
|
document.addEventListener('mousedown', handleClickOutside);
|
|
@@ -3126,12 +3125,6 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3126
3125
|
return selectRef.current ? getPopupContainer?.(selectRef.current) : selectRef.current;
|
|
3127
3126
|
}, [getPopupContainer]);
|
|
3128
3127
|
const extractedOptions = children ? (Array.isArray(children) ? children : [children]).filter(e => e).map(child => child.props) : options;
|
|
3129
|
-
useEffect(() => {
|
|
3130
|
-
console.log({
|
|
3131
|
-
filterOption,
|
|
3132
|
-
extractedOptions
|
|
3133
|
-
});
|
|
3134
|
-
}, [filterOption, extractedOptions]);
|
|
3135
3128
|
const filteredOptions = extractedOptions.filter(option => {
|
|
3136
3129
|
if (typeof filterOption === 'function') {
|
|
3137
3130
|
return filterOption(searchQuery, option);
|