dtable-ui-component 4.3.10-alpha3 → 4.3.10-alpha4

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.
@@ -14,7 +14,6 @@
14
14
  min-height: 160px;
15
15
  max-height: 200px;
16
16
  margin: 10px 0;
17
- padding: 0 10px;
18
17
  overflow: auto;
19
18
  }
20
19
 
@@ -23,7 +22,7 @@
23
22
  align-items: center;
24
23
  justify-content: space-between;
25
24
  height: 30px;
26
- padding-left: 12px;
25
+ padding: 0 10px;
27
26
  font-size: 14px;
28
27
  cursor: pointer;
29
28
  }
@@ -45,3 +44,22 @@
45
44
  font-size: 12px;
46
45
  color: #798d99;
47
46
  }
47
+
48
+ .dtable-ui-collaborator-editor .dtable-ui-collaborator-editor-container-no-btn {
49
+ min-height: 40px;
50
+ padding: 0.375rem 0.75rem;
51
+ border: 1px solid rgba(0, 40, 100, 0.12);
52
+ border-radius: 3px;
53
+ transition: border-color .15s ease-in-out;
54
+ }
55
+
56
+ .dtable-ui-collaborator-editor .dtable-ui-collaborator-editor-container-no-btn .collaborators-container {
57
+ min-height: 26px;
58
+ display: flex;
59
+ align-items: center;
60
+ flex-wrap: wrap;
61
+ }
62
+
63
+ .dtable-ui-collaborator-editor .dtable-ui-collaborator-editor-container-no-btn .collaborators-container .collaborator-item {
64
+ margin: 2px 10px 2px 0;
65
+ }
@@ -9,7 +9,7 @@ import './index.css';
9
9
  class CollaboratorEditor extends React.Component {
10
10
  constructor(props) {
11
11
  super(props);
12
- this.onDocumentToggle = e => {
12
+ this.onDocumentClick = e => {
13
13
  if (this.editorContainer !== e.target && !this.editorContainer.contains(e.target)) {
14
14
  this.onClosePopover();
15
15
  }
@@ -67,7 +67,6 @@ class CollaboratorEditor extends React.Component {
67
67
  newValue
68
68
  }, () => {
69
69
  this.onCommit(newValue);
70
- this.onClosePopover();
71
70
  });
72
71
  };
73
72
  this.onDeleteCollaborator = collaborator => {
@@ -110,8 +109,11 @@ class CollaboratorEditor extends React.Component {
110
109
  };
111
110
  this.onClickContainer = e => {
112
111
  e.stopPropagation();
113
- if (!this.props.isShowEditButton) {
114
- this.togglePopover(e);
112
+ if (!this.props.isShowEditButton && !this.state.isPopoverShow) {
113
+ this.setState({
114
+ isPopoverShow: true,
115
+ popoverPosition: this.caculatePopoverPosition()
116
+ });
115
117
  }
116
118
  };
117
119
  this.setEditorContainerRef = editorContainer => {
@@ -127,10 +129,10 @@ class CollaboratorEditor extends React.Component {
127
129
  };
128
130
  }
129
131
  componentDidMount() {
130
- document.addEventListener('click', this.onDocumentToggle);
132
+ document.addEventListener('click', this.onDocumentClick);
131
133
  }
132
134
  componentWillUnmount() {
133
- document.removeEventListener('click', this.onDocumentToggle);
135
+ document.removeEventListener('click', this.onDocumentClick);
134
136
  }
135
137
  render() {
136
138
  let {
@@ -149,13 +151,13 @@ class CollaboratorEditor extends React.Component {
149
151
  className: "dtable-ui-collaborator-editor"
150
152
  }, /*#__PURE__*/React.createElement("div", {
151
153
  ref: this.setEditorRef,
152
- className: "dtable-ui-collaborator-editor-container",
154
+ className: "dtable-ui-collaborator-editor-container ".concat(isShowEditButton ? '' : 'dtable-ui-collaborator-editor-container-no-btn'),
153
155
  onClick: this.onClickContainer
154
156
  }, isShowEditButton && /*#__PURE__*/React.createElement(EditEditorButton, {
155
157
  text: getLocale('Add_a_collaborator'),
156
158
  onClick: this.togglePopover
157
159
  }), selectedCollaborators.length > 0 && /*#__PURE__*/React.createElement("div", {
158
- className: "collaborators-container mt-2"
160
+ className: "collaborators-container ".concat(isShowEditButton ? 'mt-2' : '')
159
161
  }, selectedCollaborators.map(collaborator => {
160
162
  return /*#__PURE__*/React.createElement(CollaboratorItem, {
161
163
  key: collaborator.email,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.3.10-alpha3",
3
+ "version": "4.3.10-alpha4",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",