dtable-ui-component 4.3.10-alpha2 → 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.onAddOptionToggle = event => {
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
- }, /*#__PURE__*/React.createElement(EditEditorButton, {
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.onAddOptionToggle
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
  };
@@ -86,7 +86,6 @@ class DateEditor extends React.Component {
86
86
  lang,
87
87
  column
88
88
  } = this.props;
89
- console.log('date editor 98', lang);
90
89
  let {
91
90
  newValue,
92
91
  isPopoverShow,
@@ -50,7 +50,6 @@ class PCDateEditorPopover extends React.Component {
50
50
  lang
51
51
  } = this.props;
52
52
  let defaultValue = dayjs().clone();
53
- console.log('pc date editor', 67, getLocale('Please_input'));
54
53
  return /*#__PURE__*/React.createElement(Calendar, {
55
54
  locale: initDateEditorLanguage(lang),
56
55
  style: {
package/lib/lang/index.js CHANGED
@@ -14,13 +14,11 @@ export function setLocale(args) {
14
14
  let lang = typeof args === 'string' ? args : LANGUAGE;
15
15
  LANGUAGE_MAP = langData[lang] || langData[LANGUAGE];
16
16
  }
17
- console.log(22, LANGUAGE_MAP);
18
17
  export function getLocale(key, def) {
19
18
  if (!key) return def;
20
19
  if (!LANGUAGE_MAP[key]) {
21
20
  return def || key;
22
21
  }
23
- console.log(LANGUAGE_MAP[key]);
24
22
  return LANGUAGE_MAP[key];
25
23
  }
26
24
  export function substitute(str, obj) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.3.10-alpha2",
3
+ "version": "4.3.10-alpha3",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",