dtable-ui-component 7.0.0-ahn.12 → 7.0.0-ahn.13
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.
|
@@ -16,30 +16,23 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
16
16
|
class DTableCustomizeSelect extends _react.Component {
|
|
17
17
|
constructor(props) {
|
|
18
18
|
super(props);
|
|
19
|
-
this.getEventClassName = target => {
|
|
20
|
-
const className = target.className;
|
|
21
|
-
if (!className) return '';
|
|
22
|
-
if (typeof className === 'string') return className;
|
|
23
|
-
if (typeof className === 'object' && typeof className.baseVal === 'string') return className.baseVal;
|
|
24
|
-
return '';
|
|
25
|
-
};
|
|
26
19
|
this.onSelectToggle = event => {
|
|
27
20
|
event.preventDefault();
|
|
28
|
-
|
|
21
|
+
/*
|
|
22
|
+
if select is showing, click events do not need to be monitored by other click events,
|
|
23
|
+
so it can be closed when other select is clicked.
|
|
24
|
+
*/
|
|
29
25
|
if (this.state.isShowSelectOptions) event.stopPropagation();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
if (event.target.closest && event.target.closest('.option-search-control')) return;
|
|
35
|
-
if (eventClassName === 'seatable-select-search') return;
|
|
26
|
+
let eventClassName = event.target.className;
|
|
27
|
+
if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'seatable-select-search') return;
|
|
28
|
+
// Prevent closing by pressing the spacebar in the search input
|
|
29
|
+
if (event.target.value === '') return;
|
|
36
30
|
this.setState({
|
|
37
31
|
isShowSelectOptions: !this.state.isShowSelectOptions
|
|
38
32
|
});
|
|
39
33
|
};
|
|
40
34
|
this.onClick = event => {
|
|
41
|
-
|
|
42
|
-
if (this.props.isShowSelected && eventClassName.indexOf('icon-fork-number') > -1) {
|
|
35
|
+
if (this.props.isShowSelected && event.target.className.includes('icon-fork-number')) {
|
|
43
36
|
return;
|
|
44
37
|
}
|
|
45
38
|
if (!this.selector.contains(event.target)) {
|