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