dtable-ui-component 4.4.1 → 4.4.3

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.
@@ -1,6 +1,7 @@
1
1
  import React, { Fragment } from 'react';
2
2
  import MediaQuery from 'react-responsive';
3
3
  import { getLocale } from '../lang';
4
+ import ModalPortal from '../common/modal-portal';
4
5
  import CollaboratorItem from '../CollaboratorItem';
5
6
  import EditEditorButton from '../EditEditorButton';
6
7
  import PCCollaboratorEditorPopover from './pc-collaborator-editor-popover';
@@ -10,6 +11,11 @@ class CollaboratorEditor extends React.Component {
10
11
  constructor(props) {
11
12
  super(props);
12
13
  this.onMouseDown = e => {
14
+ if (this.state.isPopoverShow && this.editorPopoverRef) {
15
+ if (this.editorPopoverRef === e.target || this.editorPopoverRef.contains(e.target)) {
16
+ return;
17
+ }
18
+ }
13
19
  if (this.editorContainer !== e.target && !this.editorContainer.contains(e.target)) {
14
20
  this.onClosePopover();
15
21
  }
@@ -82,6 +88,17 @@ class CollaboratorEditor extends React.Component {
82
88
  }
83
89
  };
84
90
  this.caculatePopoverPosition = () => {
91
+ if (this.props.isInModel) {
92
+ const {
93
+ top,
94
+ left
95
+ } = this.editor.getBoundingClientRect();
96
+ return {
97
+ top: top + 40,
98
+ left,
99
+ zIndex: 1051
100
+ };
101
+ }
85
102
  const POPOVER_MAX_HEIGHT = 200;
86
103
  let innerHeight = window.innerHeight;
87
104
  let {
@@ -122,6 +139,9 @@ class CollaboratorEditor extends React.Component {
122
139
  this.setEditorRef = editor => {
123
140
  this.editor = editor;
124
141
  };
142
+ this.setPopoverRef = ref => {
143
+ this.editorPopoverRef = ref;
144
+ };
125
145
  this.state = {
126
146
  newValue: Array.isArray(props.value) ? props.value : [],
127
147
  isPopoverShow: false,
@@ -167,13 +187,14 @@ class CollaboratorEditor extends React.Component {
167
187
  });
168
188
  }))), isPopoverShow && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MediaQuery, {
169
189
  query: '(min-width: 768px)'
170
- }, /*#__PURE__*/React.createElement(PCCollaboratorEditorPopover, {
190
+ }, /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement(PCCollaboratorEditorPopover, {
171
191
  popoverPosition: popoverPosition,
172
192
  isReadOnly: this.props.isReadOnly,
173
193
  selectedCollaborators: selectedCollaborators,
174
194
  collaborators: collaborators,
175
- onCollaboratorItemToggle: this.onCollaboratorItemToggle
176
- })), /*#__PURE__*/React.createElement(MediaQuery, {
195
+ onCollaboratorItemToggle: this.onCollaboratorItemToggle,
196
+ setPopoverRef: this.setPopoverRef
197
+ }))), /*#__PURE__*/React.createElement(MediaQuery, {
177
198
  query: '(max-width: 767.8px)'
178
199
  }, /*#__PURE__*/React.createElement(MBCollaboratorEditorPopover, {
179
200
  isReadOnly: this.props.isReadOnly,
@@ -188,6 +209,7 @@ class CollaboratorEditor extends React.Component {
188
209
  CollaboratorEditor.defaultProps = {
189
210
  isShowEditButton: true,
190
211
  isReadOnly: false,
191
- value: []
212
+ value: [],
213
+ isInModel: false
192
214
  };
193
215
  export default CollaboratorEditor;
@@ -54,7 +54,8 @@ class PCCollaboratorEditorPopover extends React.Component {
54
54
  });
55
55
  return /*#__PURE__*/React.createElement("div", {
56
56
  className: "dtable-ui-editor-popover dtable-ui-collaborator-editor-popover",
57
- style: popoverStyle
57
+ style: popoverStyle,
58
+ ref: this.props.setPopoverRef
58
59
  }, /*#__PURE__*/React.createElement("div", {
59
60
  className: "collaborator-search-container"
60
61
  }, /*#__PURE__*/React.createElement("input", {
@@ -211,6 +211,7 @@
211
211
  .filters-list .multiple-option-name {
212
212
  display: flex;
213
213
  align-items: center;
214
+ justify-content: space-between;
214
215
  }
215
216
 
216
217
  .filters-list .multiple-check-icon,
@@ -319,3 +320,23 @@
319
320
  color: #aaa;
320
321
  cursor: default;
321
322
  }
323
+
324
+ .option.option-active .filter-header-icon .dtable-font {
325
+ color: #fff;
326
+ }
327
+
328
+ .filters-list .single-select-option,
329
+ .filters-list .multiple-select-option {
330
+ display: block;
331
+ text-align: left;
332
+ width: min-content;
333
+ max-width: 150px;
334
+ line-height: 20px;
335
+ border-radius: 10px;
336
+ padding: 0px 10px;
337
+ margin: 0;
338
+ font-size: 13px;
339
+ overflow: hidden;
340
+ text-overflow: ellipsis;
341
+ white-space: nowrap;
342
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.4.1",
3
+ "version": "4.4.3",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",