x-ui-design 0.3.85 → 0.3.87
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 +5 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/lib/components/Select/Select.tsx +29 -28
- package/package.json +1 -1
- package/src/app/page.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3053,7 +3053,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3053
3053
|
const asMultiple = mode === 'multiple';
|
|
3054
3054
|
const hasMode = asTag || asMultiple;
|
|
3055
3055
|
const initialValue = useMemo(() => value || defaultValue || '', [value, defaultValue]);
|
|
3056
|
-
const checkModeInitialValue = useMemo(() => (!Array.isArray(initialValue) ? [initialValue] : initialValue).filter(e => e !== undefined), [initialValue]);
|
|
3056
|
+
const checkModeInitialValue = useMemo(() => (!Array.isArray(initialValue) ? [initialValue] : initialValue).filter(e => e !== undefined && e !== ''), [initialValue]);
|
|
3057
3057
|
const [isHover, setIsHover] = useState(false);
|
|
3058
3058
|
const selectRef = useRef(null);
|
|
3059
3059
|
const [searchInputWidth, setSearchInputWidth] = useState(0);
|
|
@@ -3089,6 +3089,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3089
3089
|
}
|
|
3090
3090
|
}, [autoClearSearchValue, prefixCls]);
|
|
3091
3091
|
useEffect(() => {
|
|
3092
|
+
console.log(hasMode ? checkModeInitialValue : initialValue);
|
|
3092
3093
|
setSelected(hasMode ? checkModeInitialValue : initialValue);
|
|
3093
3094
|
}, [checkModeInitialValue, hasMode, initialValue]);
|
|
3094
3095
|
useEffect(() => {
|
|
@@ -3435,7 +3436,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3435
3436
|
minWidth: `${searchInputWidth}px`
|
|
3436
3437
|
},
|
|
3437
3438
|
className: `${prefixCls}-tag-container`
|
|
3438
|
-
},
|
|
3439
|
+
}, hasMode ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, selected.length ? selected.map((tag, index) => tagRender ? /*#__PURE__*/React$1.createElement("div", {
|
|
3439
3440
|
key: `${index}_${tag}`
|
|
3440
3441
|
}, tagRender?.({
|
|
3441
3442
|
label: extractedOptions.find(e => e.value === tag)?.children || tag,
|
|
@@ -3448,11 +3449,11 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3448
3449
|
label: extractedOptions.find(e => e.value === tag)?.children || tag,
|
|
3449
3450
|
onClose: handleRemoveTag,
|
|
3450
3451
|
key: `${index}_${tag}`
|
|
3451
|
-
})) :
|
|
3452
|
+
})) : /*#__PURE__*/React$1.createElement("span", {
|
|
3452
3453
|
style: {
|
|
3453
3454
|
opacity: 0.5
|
|
3454
3455
|
}
|
|
3455
|
-
}, placeholder), isOpen ? /*#__PURE__*/React$1.createElement("div", {
|
|
3456
|
+
}, placeholder)) : null, isOpen ? /*#__PURE__*/React$1.createElement("div", {
|
|
3456
3457
|
className: `${prefixCls}-tag`
|
|
3457
3458
|
}, /*#__PURE__*/React$1.createElement("div", {
|
|
3458
3459
|
onClick: e => {
|