dtable-ui-component 6.0.110-oot.24 → 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')) {
|
|
@@ -54,22 +70,6 @@ class CollaboratorSelect extends _react.Component {
|
|
|
54
70
|
if (!searchable) return options || [];
|
|
55
71
|
return (0, _dtableUtils.searchCollaborators)(options, searchValue);
|
|
56
72
|
};
|
|
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
|
-
};
|
|
73
73
|
this.renderOptionGroup = () => {
|
|
74
74
|
const {
|
|
75
75
|
value,
|
|
@@ -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
|
-
|
|
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,
|