dtable-ui-component 4.3.10-alpha1 → 4.3.10-alpha3
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.
|
@@ -28,7 +28,7 @@ class CollaboratorEditor extends React.Component {
|
|
|
28
28
|
}
|
|
29
29
|
return [];
|
|
30
30
|
};
|
|
31
|
-
this.
|
|
31
|
+
this.togglePopover = event => {
|
|
32
32
|
event.nativeEvent.stopImmediatePropagation();
|
|
33
33
|
event.stopPropagation();
|
|
34
34
|
if (this.props.isReadOnly) {
|
|
@@ -108,6 +108,12 @@ class CollaboratorEditor extends React.Component {
|
|
|
108
108
|
isPopoverShow: false
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
|
+
this.onClickContainer = e => {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
if (!this.props.isShowEditButton) {
|
|
114
|
+
this.togglePopover(e);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
111
117
|
this.setEditorContainerRef = editorContainer => {
|
|
112
118
|
this.editorContainer = editorContainer;
|
|
113
119
|
};
|
|
@@ -129,7 +135,8 @@ class CollaboratorEditor extends React.Component {
|
|
|
129
135
|
render() {
|
|
130
136
|
let {
|
|
131
137
|
collaborators,
|
|
132
|
-
isReadOnly
|
|
138
|
+
isReadOnly,
|
|
139
|
+
isShowEditButton
|
|
133
140
|
} = this.props;
|
|
134
141
|
let {
|
|
135
142
|
isPopoverShow,
|
|
@@ -142,10 +149,11 @@ class CollaboratorEditor extends React.Component {
|
|
|
142
149
|
className: "dtable-ui-collaborator-editor"
|
|
143
150
|
}, /*#__PURE__*/React.createElement("div", {
|
|
144
151
|
ref: this.setEditorRef,
|
|
145
|
-
className: "dtable-ui-collaborator-editor-container"
|
|
146
|
-
|
|
152
|
+
className: "dtable-ui-collaborator-editor-container",
|
|
153
|
+
onClick: this.onClickContainer
|
|
154
|
+
}, isShowEditButton && /*#__PURE__*/React.createElement(EditEditorButton, {
|
|
147
155
|
text: getLocale('Add_a_collaborator'),
|
|
148
|
-
onClick: this.
|
|
156
|
+
onClick: this.togglePopover
|
|
149
157
|
}), selectedCollaborators.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
150
158
|
className: "collaborators-container mt-2"
|
|
151
159
|
}, selectedCollaborators.map(collaborator => {
|
|
@@ -176,6 +184,7 @@ class CollaboratorEditor extends React.Component {
|
|
|
176
184
|
}
|
|
177
185
|
}
|
|
178
186
|
CollaboratorEditor.defaultProps = {
|
|
187
|
+
isShowEditButton: true,
|
|
179
188
|
isReadOnly: false,
|
|
180
189
|
value: []
|
|
181
190
|
};
|