dtable-ui-component 5.3.7 → 5.3.8-beta

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.
@@ -7,6 +7,7 @@
7
7
  font-size: 13px;
8
8
  border-radius: 10px;
9
9
  background: #eaeaea;
10
+ overflow: hidden;
10
11
  }
11
12
 
12
13
  .dtable-ui.collaborator-item .collaborator-avatar,
@@ -21,6 +22,7 @@
21
22
  align-items: center;
22
23
  justify-content: center;
23
24
  transform: translateY(0);
25
+ flex-shrink: 0;
24
26
  }
25
27
 
26
28
  .dtable-ui.collaborator-item .collaborator-name {
@@ -88,7 +88,8 @@ class ImageThumbnail extends _react.default.Component {
88
88
  index,
89
89
  downloadImage,
90
90
  src,
91
- className
91
+ className,
92
+ name
92
93
  } = this.props;
93
94
  const {
94
95
  imageThumbnailUrl
@@ -130,7 +131,7 @@ class ImageThumbnail extends _react.default.Component {
130
131
  hide: 0
131
132
  },
132
133
  fade: false
133
- }, (0, _url.getFileName)(src)));
134
+ }, name || (0, _url.getFileName)(src)));
134
135
  }
135
136
  }
136
137
  var _default = exports.default = ImageThumbnail;
@@ -113,10 +113,11 @@ class RowExpandFileEditor extends _react.default.Component {
113
113
  fileArr = value.map((file, index) => {
114
114
  const {
115
115
  fileIconUrl
116
- } = (0, _url.getFileThumbnailInfo)(file, config);
116
+ } = (0, _url.getFileThumbnailInfo)(file);
117
117
  return /*#__PURE__*/_react.default.createElement(_ImageThumbnail.default, {
118
118
  key: 'file-' + index,
119
119
  src: fileIconUrl,
120
+ name: file.name,
120
121
  index: index,
121
122
  config: config,
122
123
  deleteTip: (0, _lang.getLocale)('Are_you_sure_you_want_to_delete_this_file'),
@@ -4,3 +4,8 @@
4
4
  margin-left: -5px;
5
5
  margin-right: -5px;
6
6
  }
7
+
8
+ .dtable-ui-row-expand-image-editor .dtable-ui-row-expand-image-container img {
9
+ max-width: 96px;
10
+ max-height: 96px;
11
+ }
@@ -386,6 +386,7 @@ class RowExpandFormatter extends _react.default.Component {
386
386
  }
387
387
  }
388
388
  RowExpandFormatter.defaultProps = {
389
- className: ''
389
+ className: '',
390
+ valueKey: 'name'
390
391
  };
391
392
  var _default = exports.default = RowExpandFormatter;
package/lib/utils/url.js CHANGED
@@ -124,8 +124,13 @@ const getImageThumbnailUrl = function (url) {
124
124
  exports.getImageThumbnailUrl = getImageThumbnailUrl;
125
125
  const getFileName = url => {
126
126
  if (!url) return null;
127
- let lastIndex = url.lastIndexOf('/');
128
- return url.slice(lastIndex + 1);
127
+ let validUrl = url;
128
+ let qIndex = url.indexOf('/?');
129
+ if (qIndex !== -1) {
130
+ validUrl = validUrl.slice(0, qIndex);
131
+ }
132
+ const lastIndex = validUrl.lastIndexOf('/');
133
+ return url.slice(lastIndex + 1, qIndex);
129
134
  };
130
135
  exports.getFileName = getFileName;
131
136
  const imageCheck = filename => {
@@ -189,7 +194,7 @@ const getFileThumbnailInfo = function (file) {
189
194
  fileIconUrl: defaultIconUrl['192']
190
195
  };
191
196
  const isImage = imageCheck(file.name);
192
- if (isImage) return {
197
+ if (isImage && server) return {
193
198
  isImage,
194
199
  fileIconUrl: getImageThumbnailUrl(file.url, {
195
200
  server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "5.3.7",
3
+ "version": "5.3.8beta",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "3.0.1",