@rc-component/select 1.6.10 → 1.6.12
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/es/OptionList.js
CHANGED
|
@@ -261,7 +261,8 @@ const OptionList = (_, ref) => {
|
|
|
261
261
|
}
|
|
262
262
|
const itemData = item.data || {};
|
|
263
263
|
const {
|
|
264
|
-
value
|
|
264
|
+
value,
|
|
265
|
+
disabled
|
|
265
266
|
} = itemData;
|
|
266
267
|
const {
|
|
267
268
|
group
|
|
@@ -273,7 +274,8 @@ const OptionList = (_, ref) => {
|
|
|
273
274
|
}, attrs, {
|
|
274
275
|
key: index
|
|
275
276
|
}, getItemAriaProps(item, index), {
|
|
276
|
-
"aria-selected": isAriaSelected(value)
|
|
277
|
+
"aria-selected": isAriaSelected(value),
|
|
278
|
+
"aria-disabled": disabled
|
|
277
279
|
}), value) : null;
|
|
278
280
|
};
|
|
279
281
|
const a11yProps = {
|
|
@@ -353,6 +355,7 @@ const OptionList = (_, ref) => {
|
|
|
353
355
|
}
|
|
354
356
|
return /*#__PURE__*/React.createElement("div", _extends({}, pickAttrs(passedProps), !virtual ? getItemAriaProps(item, itemIndex) : {}, {
|
|
355
357
|
"aria-selected": virtual ? undefined : isAriaSelected(value),
|
|
358
|
+
"aria-disabled": mergedDisabled,
|
|
356
359
|
className: optionClassName,
|
|
357
360
|
title: optionTitle,
|
|
358
361
|
onMouseMove: () => {
|
|
@@ -16,7 +16,8 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
|
|
|
16
16
|
activeValue,
|
|
17
17
|
displayValues,
|
|
18
18
|
maxLength,
|
|
19
|
-
mode
|
|
19
|
+
mode,
|
|
20
|
+
components
|
|
20
21
|
} = useSelectInputContext();
|
|
21
22
|
const {
|
|
22
23
|
triggerOpen,
|
|
@@ -68,7 +69,9 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
|
|
|
68
69
|
const showHasValueCls = displayValue && displayValue.label !== null && displayValue.label !== undefined && String(displayValue.label).trim() !== '';
|
|
69
70
|
|
|
70
71
|
// Render value
|
|
71
|
-
|
|
72
|
+
// Only render value when not using custom input in combobox mode
|
|
73
|
+
const shouldRenderValue = !(combobox && components?.input);
|
|
74
|
+
const renderValue = shouldRenderValue ? displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
|
|
72
75
|
className: clsx(`${prefixCls}-content-value`, optionClassName),
|
|
73
76
|
style: {
|
|
74
77
|
...(mergedSearchValue ? {
|
|
@@ -79,8 +82,7 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
|
|
|
79
82
|
title: optionTitle
|
|
80
83
|
}, displayValue.label) : displayValue.label : /*#__PURE__*/React.createElement(Placeholder, {
|
|
81
84
|
show: !mergedSearchValue
|
|
82
|
-
});
|
|
83
|
-
|
|
85
|
+
}) : null;
|
|
84
86
|
// Render
|
|
85
87
|
return /*#__PURE__*/React.createElement("div", {
|
|
86
88
|
className: clsx(`${prefixCls}-content`, showHasValueCls && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
|
package/lib/OptionList.js
CHANGED
|
@@ -269,7 +269,8 @@ const OptionList = (_, ref) => {
|
|
|
269
269
|
}
|
|
270
270
|
const itemData = item.data || {};
|
|
271
271
|
const {
|
|
272
|
-
value
|
|
272
|
+
value,
|
|
273
|
+
disabled
|
|
273
274
|
} = itemData;
|
|
274
275
|
const {
|
|
275
276
|
group
|
|
@@ -281,7 +282,8 @@ const OptionList = (_, ref) => {
|
|
|
281
282
|
}, attrs, {
|
|
282
283
|
key: index
|
|
283
284
|
}, getItemAriaProps(item, index), {
|
|
284
|
-
"aria-selected": isAriaSelected(value)
|
|
285
|
+
"aria-selected": isAriaSelected(value),
|
|
286
|
+
"aria-disabled": disabled
|
|
285
287
|
}), value) : null;
|
|
286
288
|
};
|
|
287
289
|
const a11yProps = {
|
|
@@ -361,6 +363,7 @@ const OptionList = (_, ref) => {
|
|
|
361
363
|
}
|
|
362
364
|
return /*#__PURE__*/React.createElement("div", _extends({}, (0, _pickAttrs.default)(passedProps), !virtual ? getItemAriaProps(item, itemIndex) : {}, {
|
|
363
365
|
"aria-selected": virtual ? undefined : isAriaSelected(value),
|
|
366
|
+
"aria-disabled": mergedDisabled,
|
|
364
367
|
className: optionClassName,
|
|
365
368
|
title: optionTitle,
|
|
366
369
|
onMouseMove: () => {
|
|
@@ -25,7 +25,8 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
|
|
|
25
25
|
activeValue,
|
|
26
26
|
displayValues,
|
|
27
27
|
maxLength,
|
|
28
|
-
mode
|
|
28
|
+
mode,
|
|
29
|
+
components
|
|
29
30
|
} = (0, _context.useSelectInputContext)();
|
|
30
31
|
const {
|
|
31
32
|
triggerOpen,
|
|
@@ -77,7 +78,9 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
|
|
|
77
78
|
const showHasValueCls = displayValue && displayValue.label !== null && displayValue.label !== undefined && String(displayValue.label).trim() !== '';
|
|
78
79
|
|
|
79
80
|
// Render value
|
|
80
|
-
|
|
81
|
+
// Only render value when not using custom input in combobox mode
|
|
82
|
+
const shouldRenderValue = !(combobox && components?.input);
|
|
83
|
+
const renderValue = shouldRenderValue ? displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
|
|
81
84
|
className: (0, _clsx.clsx)(`${prefixCls}-content-value`, optionClassName),
|
|
82
85
|
style: {
|
|
83
86
|
...(mergedSearchValue ? {
|
|
@@ -88,8 +91,7 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
|
|
|
88
91
|
title: optionTitle
|
|
89
92
|
}, displayValue.label) : displayValue.label : /*#__PURE__*/React.createElement(_Placeholder.default, {
|
|
90
93
|
show: !mergedSearchValue
|
|
91
|
-
});
|
|
92
|
-
|
|
94
|
+
}) : null;
|
|
93
95
|
// Render
|
|
94
96
|
return /*#__PURE__*/React.createElement("div", {
|
|
95
97
|
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),
|