@rc-component/select 1.6.7 → 1.6.9

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.
@@ -65,6 +65,8 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
65
65
  }, [combobox, activeValue]);
66
66
 
67
67
  // ========================== Render ==========================
68
+ const showHasValueCls = displayValue && displayValue.label !== null && displayValue.label !== undefined && String(displayValue.label).trim() !== '';
69
+
68
70
  // Render value
69
71
  const renderValue = displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
70
72
  className: clsx(`${prefixCls}-content-value`, optionClassName),
@@ -81,7 +83,7 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
81
83
 
82
84
  // Render
83
85
  return /*#__PURE__*/React.createElement("div", {
84
- className: clsx(`${prefixCls}-content`, displayValue && displayValue.label && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
86
+ className: clsx(`${prefixCls}-content`, showHasValueCls && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
85
87
  style: styles?.content,
86
88
  title: hasOptionStyle ? undefined : optionTitle
87
89
  }, renderValue, /*#__PURE__*/React.createElement(Input, _extends({
@@ -74,6 +74,8 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
74
74
  }, [combobox, activeValue]);
75
75
 
76
76
  // ========================== Render ==========================
77
+ const showHasValueCls = displayValue && displayValue.label !== null && displayValue.label !== undefined && String(displayValue.label).trim() !== '';
78
+
77
79
  // Render value
78
80
  const renderValue = displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
79
81
  className: (0, _clsx.clsx)(`${prefixCls}-content-value`, optionClassName),
@@ -90,7 +92,7 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
90
92
 
91
93
  // Render
92
94
  return /*#__PURE__*/React.createElement("div", {
93
- className: (0, _clsx.clsx)(`${prefixCls}-content`, displayValue && displayValue.label && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
95
+ className: (0, _clsx.clsx)(`${prefixCls}-content`, showHasValueCls && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
94
96
  style: styles?.content,
95
97
  title: hasOptionStyle ? undefined : optionTitle
96
98
  }, renderValue, /*#__PURE__*/React.createElement(_Input.default, _extends({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/select",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
4
4
  "description": "React Select",
5
5
  "engines": {
6
6
  "node": ">=8.x"