dtable-ui-component 6.0.110-sam.1 → 6.0.110-sam.2
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.
|
@@ -31,11 +31,13 @@ class DTableSelect extends _react.default.Component {
|
|
|
31
31
|
className
|
|
32
32
|
} = this.props;
|
|
33
33
|
const processedOptions = (0, _utils.processOptionsWithClear)(options, isClearable);
|
|
34
|
+
const effectiveClearable = isClearable && !isMulti; // 只在非多选模式下显示清除按钮
|
|
34
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
|
|
35
36
|
value: value,
|
|
36
37
|
onChange: (0, _utils.createHandleChange)(onChange),
|
|
37
38
|
options: processedOptions,
|
|
38
39
|
isMulti: isMulti,
|
|
40
|
+
isClearable: effectiveClearable,
|
|
39
41
|
className: className,
|
|
40
42
|
classNamePrefix: classNamePrefix,
|
|
41
43
|
styles: style || _utils.MenuSelectStyle,
|
|
@@ -10,8 +10,11 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
class Option extends _react.Component {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
this.onSelectOption = value => {
|
|
14
|
-
this.props.
|
|
13
|
+
this.onSelectOption = (value, event) => {
|
|
14
|
+
if (this.props.supportMultipleSelect) {
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
}
|
|
17
|
+
this.props.onSelectOption(value, event);
|
|
15
18
|
};
|
|
16
19
|
this.onMouseEnter = () => {
|
|
17
20
|
if (!this.props.disableHover) {
|
|
@@ -27,10 +30,7 @@ class Option extends _react.Component {
|
|
|
27
30
|
render() {
|
|
28
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
29
32
|
className: this.props.isActive ? 'option option-active' : 'option',
|
|
30
|
-
onClick:
|
|
31
|
-
event.stopPropagation();
|
|
32
|
-
this.onSelectOption(this.props.value);
|
|
33
|
-
},
|
|
33
|
+
onClick: this.onSelectOption.bind(this, this.props.value),
|
|
34
34
|
onMouseEnter: this.onMouseEnter,
|
|
35
35
|
onMouseLeave: this.onMouseLeave,
|
|
36
36
|
children: this.props.children
|