dtable-ui-component 0.3.28 → 4.3.0

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,7 +31,7 @@ var CollaboratorSelect = /*#__PURE__*/function (_Component) {
31
31
  isShowSelectOptions: !_this.state.isShowSelectOptions
32
32
  });
33
33
  };
34
- _this.onClick = function (event) {
34
+ _this.onMousedown = function (event) {
35
35
  var name = event.target.className;
36
36
  if (name === 'select-placeholder' || name.includes('icon-fork-number')) {
37
37
  return;
@@ -115,13 +115,13 @@ var CollaboratorSelect = /*#__PURE__*/function (_Component) {
115
115
  _createClass(CollaboratorSelect, [{
116
116
  key: "componentDidMount",
117
117
  value: function componentDidMount() {
118
- document.addEventListener('click', this.onClick);
118
+ document.addEventListener('mousedown', this.onMousedown);
119
119
  this.btnWidth = this.selector.clientWidth;
120
120
  }
121
121
  }, {
122
122
  key: "componentWillUnmount",
123
123
  value: function componentWillUnmount() {
124
- document.removeEventListener('click', this.onClick);
124
+ document.removeEventListener('mousedown', this.onMousedown);
125
125
  }
126
126
  }, {
127
127
  key: "render",
@@ -28,7 +28,7 @@ var DTableCustomizeSelect = /*#__PURE__*/function (_Component) {
28
28
  isShowSelectOptions: !_this.state.isShowSelectOptions
29
29
  });
30
30
  };
31
- _this.onClick = function (event) {
31
+ _this.onMousedown = function (event) {
32
32
  if (_this.props.isShowSelected && event.target.className.includes('icon-fork-number')) {
33
33
  return;
34
34
  }
@@ -74,12 +74,12 @@ var DTableCustomizeSelect = /*#__PURE__*/function (_Component) {
74
74
  _createClass(DTableCustomizeSelect, [{
75
75
  key: "componentDidMount",
76
76
  value: function componentDidMount() {
77
- document.addEventListener('click', this.onClick);
77
+ document.addEventListener('mousedown', this.onMousedown);
78
78
  }
79
79
  }, {
80
80
  key: "componentWillUnmount",
81
81
  value: function componentWillUnmount() {
82
- document.removeEventListener('click', this.onClick);
82
+ document.removeEventListener('mousedown', this.onMousedown);
83
83
  }
84
84
  }, {
85
85
  key: "render",
@@ -33,7 +33,7 @@ var DTablePopover = /*#__PURE__*/function (_React$Component) {
33
33
  e.stopImmediatePropagation();
34
34
  }
35
35
  };
36
- _this.onClick = function (e) {
36
+ _this.onMousedown = function (e) {
37
37
  var canHideDTablePopover = _this.props.canHideDTablePopover;
38
38
  if (!canHideDTablePopover) return;
39
39
  if (_this.dtablePopoverRef && e && getEventClassName(e).indexOf('popover') === -1 && !_this.dtablePopoverRef.contains(e.target)) {
@@ -48,14 +48,14 @@ var DTablePopover = /*#__PURE__*/function (_React$Component) {
48
48
  _createClass(DTablePopover, [{
49
49
  key: "componentDidMount",
50
50
  value: function componentDidMount() {
51
- document.addEventListener('click', this.onClick);
51
+ document.addEventListener('mousedown', this.onMousedown);
52
52
  document.addEventListener('keydown', this.onKeyDown);
53
53
  window.addEventListener('popstate', this.onHistoryState);
54
54
  }
55
55
  }, {
56
56
  key: "componentWillUnmount",
57
57
  value: function componentWillUnmount() {
58
- document.removeEventListener('click', this.onClick);
58
+ document.removeEventListener('mousedown', this.onMousedown);
59
59
  document.removeEventListener('keydown', this.onKeyDown);
60
60
  window.removeEventListener('popstate', this.onHistoryState);
61
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.3.28",
3
+ "version": "4.3.0",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",