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

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.
@@ -32,6 +32,22 @@ class CollaboratorSelect extends _react.Component {
32
32
  isShowSelectOptions: !this.state.isShowSelectOptions
33
33
  });
34
34
  };
35
+ this.onClick = event => {
36
+ const target = event.target;
37
+ const name = target.className;
38
+ const {
39
+ isShowSelectOptions
40
+ } = this.state;
41
+ if (!isShowSelectOptions || name === 'select-placeholder' || name.includes('icon-fork-number') || this.selector.contains(target)) {
42
+ return;
43
+ }
44
+ const {
45
+ isUsePopover
46
+ } = this.props;
47
+ if (isUsePopover && !this.collaboratorSelectPopoverRef.contains(target) || !isUsePopover && !this.selector.contains(target)) {
48
+ this.closeSelect();
49
+ }
50
+ };
35
51
  this.onMousedown = event => {
36
52
  const name = event.target.className;
37
53
  if (name === 'select-placeholder' || name.includes('icon-fork-number')) {
@@ -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
  };
@@ -144,7 +144,15 @@ class SelectOptionGroup extends _react.Component {
144
144
  return this.filterOptions.map((opt, i) => {
145
145
  let key = opt.value.column ? opt.value.column.key : i;
146
146
  let isActive = this.state.activeIndex === i;
147
- const isSelected = value && (opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value));
147
+ let isSelected = false;
148
+ if (value) {
149
+ // Handle both single value and array of values
150
+ if (Array.isArray(value.value)) {
151
+ isSelected = value.value.includes(opt.value);
152
+ } else {
153
+ isSelected = opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value);
154
+ }
155
+ }
148
156
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
149
157
  index: i,
150
158
  isActive: isActive,
@@ -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.25",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.4",