dtable-ui-component 6.0.110-oot.23 → 6.0.110-oot.24

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.
@@ -54,6 +54,22 @@ class CollaboratorSelect extends _react.Component {
54
54
  if (!searchable) return options || [];
55
55
  return (0, _dtableUtils.searchCollaborators)(options, searchValue);
56
56
  };
57
+ this.onClick = event => {
58
+ const target = event.target;
59
+ const name = target.className;
60
+ const {
61
+ isShowSelectOptions
62
+ } = this.state;
63
+ if (!isShowSelectOptions || name === 'select-placeholder' || name.includes('icon-fork-number') || this.selector.contains(target)) {
64
+ return;
65
+ }
66
+ const {
67
+ isUsePopover
68
+ } = this.props;
69
+ if (isUsePopover && !this.collaboratorSelectPopoverRef.contains(target) || !isUsePopover && !this.selector.contains(target)) {
70
+ this.closeSelect();
71
+ }
72
+ };
57
73
  this.renderOptionGroup = () => {
58
74
  const {
59
75
  value,
@@ -81,7 +97,8 @@ class CollaboratorSelect extends _react.Component {
81
97
  getFilterOptions: this.getFilterOptions,
82
98
  supportMultipleSelect: this.props.supportMultipleSelect,
83
99
  stopClickEvent: true,
84
- isShowSelected: true
100
+ isShowSelected: true,
101
+ onClickOutside: this.onClick
85
102
  });
86
103
  }
87
104
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
@@ -106,7 +123,8 @@ class CollaboratorSelect extends _react.Component {
106
123
  getFilterOptions: this.getFilterOptions,
107
124
  supportMultipleSelect: this.props.supportMultipleSelect,
108
125
  stopClickEvent: true,
109
- isShowSelected: true
126
+ isShowSelected: true,
127
+ onClickOutside: this.onClick
110
128
  })
111
129
  });
112
130
  };
@@ -266,7 +266,7 @@ class SelectOptionGroup extends _react.Component {
266
266
  placeholder: searchPlaceholder,
267
267
  onChange: this.onChangeSearch,
268
268
  value: searchVal,
269
- clearValue: this.clearValue,
269
+ clearValue: () => this.onChangeSearch(''),
270
270
  autoFocus: true,
271
271
  isClearable: true,
272
272
  isMultiple: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.110oot.23",
3
+ "version": "6.0.110oot.24",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.4",