dtable-ui-component 4.3.10-alpha5 → 4.3.10-alpha6

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.
@@ -17,6 +17,11 @@
17
17
  overflow: auto;
18
18
  }
19
19
 
20
+ .dtable-ui-collaborator-editor-popover .collaborator-list-container .search-option-null {
21
+ opacity: 0.5;
22
+ padding-left: 10px;
23
+ }
24
+
20
25
  .dtable-ui-collaborator-editor-popover .collaborator-list-container .collaborator-item-container {
21
26
  display: flex;
22
27
  align-items: center;
@@ -9,7 +9,7 @@ import './index.css';
9
9
  class CollaboratorEditor extends React.Component {
10
10
  constructor(props) {
11
11
  super(props);
12
- this.onDocumentClick = e => {
12
+ this.onDocumentMouseDown = e => {
13
13
  if (this.editorContainer !== e.target && !this.editorContainer.contains(e.target)) {
14
14
  this.onClosePopover();
15
15
  }
@@ -56,29 +56,18 @@ class CollaboratorEditor extends React.Component {
56
56
  this.props.onCommit(updated);
57
57
  };
58
58
  this.onCollaboratorItemToggle = collaborator => {
59
- if (this.props.isMultilple) {
60
- let newValue = this.state.newValue.slice();
61
- let collaboratorIndex = newValue.findIndex(collaboratorEmail => collaboratorEmail === collaborator.email);
62
- if (collaboratorIndex !== -1) {
63
- newValue.splice(collaboratorIndex, 1);
64
- } else {
65
- newValue.push(collaborator.email);
66
- }
67
- this.setState({
68
- newValue
69
- }, () => {
70
- this.onCommit(newValue);
71
- });
59
+ let newValue = this.state.newValue.slice();
60
+ let collaboratorIndex = newValue.findIndex(collaboratorEmail => collaboratorEmail === collaborator.email);
61
+ if (collaboratorIndex !== -1) {
62
+ newValue.splice(collaboratorIndex, 1);
72
63
  } else {
73
- const collaboratorIndex = this.state.newValue.findIndex(collaboratorEmail => collaboratorEmail === collaborator.email);
74
- const newValue = collaboratorIndex === -1 ? [collaborator.email] : [];
75
- this.setState({
76
- newValue
77
- }, () => {
78
- this.onCommit(newValue);
79
- this.onClosePopover();
80
- });
64
+ newValue.push(collaborator.email);
81
65
  }
66
+ this.setState({
67
+ newValue
68
+ }, () => {
69
+ this.onCommit(newValue);
70
+ });
82
71
  };
83
72
  this.onDeleteCollaborator = collaborator => {
84
73
  let newValue = this.state.newValue.slice();
@@ -140,10 +129,10 @@ class CollaboratorEditor extends React.Component {
140
129
  };
141
130
  }
142
131
  componentDidMount() {
143
- document.addEventListener('click', this.onDocumentClick);
132
+ document.addEventListener('mousedown', this.onDocumentMouseDown);
144
133
  }
145
134
  componentWillUnmount() {
146
- document.removeEventListener('click', this.onDocumentClick);
135
+ document.removeEventListener('mousedown', this.onDocumentMouseDown);
147
136
  }
148
137
  render() {
149
138
  let {
@@ -197,7 +186,6 @@ class CollaboratorEditor extends React.Component {
197
186
  }
198
187
  }
199
188
  CollaboratorEditor.defaultProps = {
200
- isMultilple: true,
201
189
  isShowEditButton: true,
202
190
  isReadOnly: false,
203
191
  value: []
@@ -11,7 +11,7 @@ import './index.css';
11
11
  class LinkEditor extends React.Component {
12
12
  constructor(props) {
13
13
  super(props);
14
- this.onDocumentToggle = e => {
14
+ this.onMouseDown = e => {
15
15
  if (this.editorContainer !== e.target && !this.editorContainer.contains(e.target)) {
16
16
  this.onClosePopover();
17
17
  }
@@ -197,10 +197,10 @@ class LinkEditor extends React.Component {
197
197
  };
198
198
  }
199
199
  componentDidMount() {
200
- document.addEventListener('click', this.onDocumentToggle);
200
+ document.addEventListener('mousedown', this.onMouseDown);
201
201
  }
202
202
  componentWillUnmount() {
203
- document.removeEventListener('click', this.onDocumentToggle);
203
+ document.removeEventListener('mousedown', this.onMouseDown);
204
204
  }
205
205
  render() {
206
206
  let {
@@ -7,7 +7,7 @@ import './index.css';
7
7
  class MultipleSelectEditor extends React.Component {
8
8
  constructor(props) {
9
9
  super(props);
10
- this.onDocumentToggle = e => {
10
+ this.onMouseDown = e => {
11
11
  if (this.editorContainer !== e.target && !this.editorContainer.contains(e.target)) {
12
12
  this.onClosePopover();
13
13
  }
@@ -121,10 +121,10 @@ class MultipleSelectEditor extends React.Component {
121
121
  this.options = _column.data && (_column.data.options || []);
122
122
  }
123
123
  componentDidMount() {
124
- document.addEventListener('click', this.onDocumentToggle);
124
+ document.addEventListener('mousedown', this.onMouseDown);
125
125
  }
126
126
  componentWillUnmount() {
127
- document.removeEventListener('click', this.onDocumentToggle);
127
+ document.removeEventListener('mousedown', this.onMouseDown);
128
128
  }
129
129
  render() {
130
130
  let {
@@ -4,9 +4,9 @@ import './index.css';
4
4
  export default class NotificationPopover extends React.Component {
5
5
  constructor() {
6
6
  super(...arguments);
7
- this.handleOutsideClick = e => {
7
+ this.onMouseDown = e => {
8
8
  if (!this.notificationContainerRef.contains(e.target)) {
9
- document.removeEventListener('mousedown', this.handleOutsideClick);
9
+ document.removeEventListener('mousedown', this.onMouseDown);
10
10
  if (e.target.className === 'tool notification' || e.target.parentNode.className === 'tool notification') {
11
11
  return;
12
12
  }
@@ -28,10 +28,10 @@ export default class NotificationPopover extends React.Component {
28
28
  };
29
29
  }
30
30
  componentDidMount() {
31
- document.addEventListener('mousedown', this.handleOutsideClick);
31
+ document.addEventListener('mousedown', this.onMouseDown);
32
32
  }
33
33
  componentWillUnmount() {
34
- document.removeEventListener('mousedown', this.handleOutsideClick);
34
+ document.removeEventListener('mousedown', this.onMouseDown);
35
35
  }
36
36
  render() {
37
37
  const {
@@ -7,7 +7,7 @@ import './index.css';
7
7
  class SingleSelectEditor extends React.Component {
8
8
  constructor(props) {
9
9
  super(props);
10
- this.onDocumentToggle = e => {
10
+ this.onMouseDown = e => {
11
11
  if (this.editorContainer !== e.target && !this.editorContainer.contains(e.target)) {
12
12
  this.onClosePopover();
13
13
  }
@@ -102,10 +102,10 @@ class SingleSelectEditor extends React.Component {
102
102
  this.options = _column.data && (_column.data.options || []);
103
103
  }
104
104
  componentDidMount() {
105
- document.addEventListener('click', this.onDocumentToggle);
105
+ document.addEventListener('mousedown', this.onMouseDown);
106
106
  }
107
107
  componentWillUnmount() {
108
- document.removeEventListener('click', this.onDocumentToggle);
108
+ document.removeEventListener('mousedown', this.onMouseDown);
109
109
  }
110
110
  render() {
111
111
  let {
@@ -5,17 +5,17 @@ import './delete-tip.css';
5
5
  export default class DeleteTip extends React.Component {
6
6
  constructor() {
7
7
  super(...arguments);
8
- this.handleOutsideClick = e => {
8
+ this.onMouseDown = e => {
9
9
  if (this.tipContainer && !this.tipContainer.contains(e.target)) {
10
10
  this.props.toggle();
11
11
  }
12
12
  };
13
13
  }
14
14
  componentDidMount() {
15
- document.addEventListener('click', this.handleOutsideClick);
15
+ document.addEventListener('mousedown', this.onMouseDown);
16
16
  }
17
17
  componentWillUnmount() {
18
- document.removeEventListener('click', this.handleOutsideClick);
18
+ document.removeEventListener('mousedown', this.onMouseDown);
19
19
  }
20
20
  render() {
21
21
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.3.10-alpha5",
3
+ "version": "4.3.10-alpha6",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",