dtable-ui-component 0.2.11 → 0.3.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.
@@ -45,10 +45,8 @@ var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
45
45
 
46
46
  var _ref = data || {},
47
47
  button_color = _ref.button_color,
48
- button_type = _ref.button_type,
49
48
  button_name = _ref.button_name;
50
49
 
51
- if (!button_type) return null;
52
50
  var colorOption = Array.isArray(optionColors) ? optionColors.find(function (item) {
53
51
  return item.COLOR === button_color;
54
52
  }) || optionColors[0] : {
@@ -48,17 +48,19 @@ var ImagesLazyLoad = /*#__PURE__*/function (_React$Component) {
48
48
  loadedCount: 0
49
49
  }, function () {
50
50
  var server = _this.props.server;
51
- images.forEach(function (item) {
51
+ images.forEach(function (item, index) {
52
52
  var url = getImageThumbnailUrl(item, server);
53
53
 
54
54
  _this.lazyLoadImage(url, function (image) {
55
55
  var _this$state = _this.state,
56
56
  loadedCount = _this$state.loadedCount,
57
57
  loadedImages = _this$state.loadedImages;
58
+ var newImageList = loadedImages.slice(0);
59
+ newImageList[index] = image;
58
60
 
59
61
  _this.setState({
60
62
  loadedCount: loadedCount + 1,
61
- loadedImages: loadedImages.concat(image)
63
+ loadedImages: newImageList
62
64
  });
63
65
  }, function () {
64
66
  var loadedCount = _this.state.loadedCount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.2.11",
3
+ "version": "0.3.0",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "0.0.9",