x-ui-design 0.4.10 → 0.4.11
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 +7 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/lib/components/Select/Select.tsx +13 -13
- package/package.json +1 -1
- package/src/app/page.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3550,6 +3550,10 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3550
3550
|
},
|
|
3551
3551
|
"data-value": searchQuery
|
|
3552
3552
|
}, searchQuery), filteredOptions.length ? dataRender : !asTag ? notFoundContent || /*#__PURE__*/React.createElement(EmptyContent, null) : null));
|
|
3553
|
+
const selectedOption = (() => {
|
|
3554
|
+
const option = extractedOptions.find(e => e.value === selected || e.label === selected || e.children === selected);
|
|
3555
|
+
return option?.children || option?.label || option?.value || null;
|
|
3556
|
+
})();
|
|
3553
3557
|
return /*#__PURE__*/React.createElement("div", {
|
|
3554
3558
|
id: id,
|
|
3555
3559
|
ref: selectRef,
|
|
@@ -3613,21 +3617,18 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3613
3617
|
contentEditable: "plaintext-only",
|
|
3614
3618
|
id: `${prefixCls}-search-tag-input`,
|
|
3615
3619
|
className: `${prefixCls}-tag-input`
|
|
3616
|
-
}), !hasMode && !searchQuery.length ? selected === '' ? placeholder :
|
|
3620
|
+
}), !hasMode && !searchQuery.length ? selected === '' ? placeholder : selectedOption : null) : !hasMode ? /*#__PURE__*/React.createElement("div", {
|
|
3617
3621
|
className: `${prefixCls}-input globalEllipsis`,
|
|
3618
3622
|
style: {
|
|
3619
3623
|
opacity: isOpen || selected === '' ? '0.6' : '1'
|
|
3620
3624
|
}
|
|
3621
|
-
}, selected === '' ? placeholder :
|
|
3625
|
+
}, selected === '' ? placeholder : selectedOption) : null) : !hasMode ? /*#__PURE__*/React.createElement("div", {
|
|
3622
3626
|
className: `${prefixCls}-input globalEllipsis`,
|
|
3623
3627
|
onClick: () => !disabled && setIsOpen(!isOpen || open),
|
|
3624
3628
|
style: {
|
|
3625
3629
|
opacity: isOpen || selected === '' ? '0.6' : '1'
|
|
3626
3630
|
}
|
|
3627
|
-
}, selected === '' ? placeholder :
|
|
3628
|
-
const option = extractedOptions.find(e => e.value === selected || e.label === selected || e.children === selected);
|
|
3629
|
-
return option?.children || option?.value || option?.label || null;
|
|
3630
|
-
})()) : null, isHover && !loading ? allowClear && selected ? /*#__PURE__*/React.createElement("button", {
|
|
3631
|
+
}, selected === '' ? placeholder : selectedOption) : null, isHover && !loading ? allowClear && selected ? /*#__PURE__*/React.createElement("button", {
|
|
3631
3632
|
className: `${prefixCls}-clear-btn`,
|
|
3632
3633
|
onClick: handleClear
|
|
3633
3634
|
}, removeIcon || /*#__PURE__*/React.createElement(ClearIcon, null)) : /*#__PURE__*/React.createElement("span", {
|