dtable-ui-component 4.4.30-beta1 → 4.4.30-beta2

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.
@@ -20,8 +20,11 @@ class LongTextPreview extends _react.default.PureComponent {
20
20
  left,
21
21
  top
22
22
  } = formatterStyle;
23
+ const {
24
+ height,
25
+ opacity
26
+ } = this.state;
23
27
  const width = 520;
24
- const height = this.state.height;
25
28
  const padding = 6;
26
29
  left = left - width > 0 ? left - width - 12 : 0;
27
30
  top = top - padding;
@@ -31,7 +34,7 @@ class LongTextPreview extends _react.default.PureComponent {
31
34
  return {
32
35
  left,
33
36
  top,
34
- opacity: this.state.opacity
37
+ opacity
35
38
  };
36
39
  };
37
40
  this.onMouseEnter = e => {
@@ -47,13 +50,22 @@ class LongTextPreview extends _react.default.PureComponent {
47
50
  }
48
51
  componentDidMount() {
49
52
  setTimeout(() => {
53
+ var _value$images;
50
54
  if (!this.ref) return;
51
- const domHeight = this.ref.offsetHeight;
55
+ const {
56
+ value
57
+ } = this.props;
58
+ // If image is included, sets the preview height to the maximum height
59
+ const hasImage = (value === null || value === void 0 ? void 0 : (_value$images = value.images) === null || _value$images === void 0 ? void 0 : _value$images.length) >= 2 ? true : false;
60
+ let {
61
+ height: domHeight
62
+ } = this.ref.getBoundingClientRect();
63
+ domHeight = hasImage ? 450 : domHeight;
52
64
  this.setState({
53
65
  height: domHeight,
54
66
  opacity: 1
55
67
  });
56
- }, 0);
68
+ }, 10);
57
69
  }
58
70
  render() {
59
71
  const {
@@ -339,10 +339,12 @@
339
339
 
340
340
  .longtext-preview .sf-slate-viewer-scroll-container .sf-slate-viewer-article-container {
341
341
  width: 100%;
342
+ margin: 0;
342
343
  }
343
344
 
344
345
  .longtext-preview .longtext-container .article {
345
346
  padding: 10px 16px;
347
+ border: unset;
346
348
  }
347
349
 
348
350
  .row-height-128 .longtext-formatter .article {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.4.30beta1",
3
+ "version": "4.4.30beta2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",