dtable-ui-component 4.4.7 → 4.4.8-alpha.0

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.
@@ -49,25 +49,17 @@ class ImageFormatter extends _react.default.Component {
49
49
  this.props.downloadImage(imageItemUrl);
50
50
  };
51
51
  this.deleteImage = index => {
52
- const {
53
- readOnly
54
- } = this.props;
55
- if (readOnly) return;
56
- if (!this.props.deleteImage) return;
57
52
  this.props.deleteImage(index);
58
53
  };
59
54
  this.onRotateImage = (index, degree) => {
60
- const {
61
- readOnly
62
- } = this.props;
63
- if (readOnly) return;
64
- if (!this.props.rotateImage) return;
65
55
  this.props.rotateImage(index, degree);
66
56
  };
67
57
  this.state = {
68
58
  isPreviewImage: false,
69
59
  previewImageIndex: -1
70
60
  };
61
+ this.canDelete = props.deleteImage && !props.readOnly;
62
+ this.canRotate = props.rotateImage && !props.readOnly;
71
63
  }
72
64
  render() {
73
65
  const {
@@ -110,9 +102,9 @@ class ImageFormatter extends _react.default.Component {
110
102
  closeImagePopup: this.closeImagePopup,
111
103
  moveToPrevImage: this.movePrev,
112
104
  moveToNextImage: this.moveNext,
113
- deleteImage: readOnly ? null : this.deleteImage,
105
+ deleteImage: this.canDelete ? this.deleteImage : null,
114
106
  downloadImage: this.downloadImage,
115
- onRotateImage: readOnly ? null : this.onRotateImage,
107
+ onRotateImage: this.canRotate ? this.onRotateImage : null,
116
108
  readOnly: readOnly,
117
109
  server: server,
118
110
  moveToPrevRowImage: this.props.moveToPrevRowImage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.4.7",
3
+ "version": "4.4.8-alpha.0",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",
@@ -11,12 +11,14 @@
11
11
  "dayjs": "1.10.7",
12
12
  "dtable-utils": "4.4.0",
13
13
  "is-hotkey": "0.2.0",
14
+ "prop-types": "^15.8.1",
14
15
  "react": "17.0.2",
15
16
  "react-app-polyfill": "^3.0.0",
16
17
  "react-dom": "17.0.2",
17
18
  "react-responsive": "9.0.2",
18
19
  "react-select": "5.7.0",
19
- "react-transition-group": "^4.4.1"
20
+ "react-transition-group": "^4.4.1",
21
+ "reactstrap": "8.9.0"
20
22
  },
21
23
  "scripts": {
22
24
  "lint": "./node_modules/.bin/eslint ./src/ --fix",
@@ -117,6 +119,7 @@
117
119
  "less-loader": "^11.1.3",
118
120
  "mini-css-extract-plugin": "^2.4.5",
119
121
  "node-polyfill-webpack-plugin": "2.0.1",
122
+ "path-browserify": "^1.0.1",
120
123
  "postcss": "^8.4.31",
121
124
  "postcss-flexbugs-fixes": "^5.0.2",
122
125
  "postcss-loader": "^6.2.1",