react-photo-gallery
Advanced tools
Comparing version 5.0.4 to 5.0.5
@@ -65,11 +65,8 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"react-photo-gallery":[function(require,module,exports){ | ||
photoPreviewNodes = []; | ||
if (!this.props.cols) { | ||
cols = 3; | ||
} | ||
var contWidth = this.state.containerWidth - cols * 4; /* 4px for margin around each image*/ | ||
contWidth = Math.floor(contWidth - 2); // add some padding to prevent layout prob | ||
contWidth = Math.floor(contWidth); // add some padding to prevent layout prob | ||
var remainder = this.props.photos.length % cols; | ||
if (remainder) { | ||
// there are fewer than photos than cols num in last row | ||
var lastRowWidth = Math.floor(this.state.containerWidth - remainder * 4 - 2); | ||
// there are fewer photos than cols num in last row | ||
var lastRowWidth = Math.floor(this.state.containerWidth / cols * remainder - remainder * 4); | ||
var lastRowIndex = this.props.photos.length - remainder; | ||
@@ -191,2 +188,2 @@ } | ||
},{"react":undefined}]},{},[]) | ||
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvb2N0YXZpYS9kZXYvcmVhY3QtcGhvdG8tZ2FsbGVyeS9zcmMvR2FsbGVyeS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7cUJDQWtCLE9BQU87Ozs7SUFFbkIsT0FBTztjQUFQLE9BQU87O0FBQ0UsYUFEVCxPQUFPLEdBQ0k7OEJBR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xlcnk7XG4iXX0= |
@@ -66,11 +66,8 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Gallery = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
photoPreviewNodes = []; | ||
if (!this.props.cols) { | ||
cols = 3; | ||
} | ||
var contWidth = this.state.containerWidth - cols * 4; /* 4px for margin around each image*/ | ||
contWidth = Math.floor(contWidth - 2); // add some padding to prevent layout prob | ||
contWidth = Math.floor(contWidth); // add some padding to prevent layout prob | ||
var remainder = this.props.photos.length % cols; | ||
if (remainder) { | ||
// there are fewer than photos than cols num in last row | ||
var lastRowWidth = Math.floor(this.state.containerWidth - remainder * 4 - 2); | ||
// there are fewer photos than cols num in last row | ||
var lastRowWidth = Math.floor(this.state.containerWidth / cols * remainder - remainder * 4); | ||
var lastRowIndex = this.props.photos.length - remainder; | ||
@@ -77,0 +74,0 @@ } |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
value: true | ||
}); | ||
@@ -21,170 +21,137 @@ | ||
var _reactDom = require('react-dom'); | ||
var Gallery = (function (_React$Component) { | ||
_inherits(Gallery, _React$Component); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
function Gallery() { | ||
_classCallCheck(this, Gallery); | ||
var _reactImages = require('react-images'); | ||
_get(Object.getPrototypeOf(Gallery.prototype), 'constructor', this).call(this); | ||
this.state = { | ||
containerWidth: 0 | ||
}; | ||
this.handleResize = this.handleResize.bind(this); | ||
} | ||
var _reactImages2 = _interopRequireDefault(_reactImages); | ||
_createClass(Gallery, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this.setState({ containerWidth: Math.floor(this._gallery.clientWidth) }); | ||
window.addEventListener('resize', this.handleResize); | ||
} | ||
}, { | ||
key: 'componentDidUpdate', | ||
value: function componentDidUpdate() { | ||
if (this._gallery.clientWidth !== this.state.containerWidth) { | ||
this.setState({ containerWidth: Math.floor(this._gallery.clientWidth) }); | ||
} | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
window.removeEventListener('resize', this.handleResize, false); | ||
} | ||
}, { | ||
key: 'handleResize', | ||
value: function handleResize(e) { | ||
this.setState({ containerWidth: Math.floor(this._gallery.clientWidth) }); | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var _this = this; | ||
var Gallery = (function (_React$Component) { | ||
_inherits(Gallery, _React$Component); | ||
var cols = this.props.cols, | ||
photoPreviewNodes = []; | ||
var contWidth = this.state.containerWidth - cols * 4; /* 4px for margin around each image*/ | ||
contWidth = Math.floor(contWidth); // add some padding to prevent layout prob | ||
var remainder = this.props.photos.length % cols; | ||
if (remainder) { | ||
// there are fewer photos than cols num in last row | ||
var lastRowWidth = Math.floor(this.state.containerWidth / cols * remainder - remainder * 4); | ||
var lastRowIndex = this.props.photos.length - remainder; | ||
} | ||
// loop thru each set of cols num | ||
// eg. if cols is 3 it will loop thru 0,1,2, then 3,4,5 to perform calculations for the particular set | ||
for (var i = 0; i < this.props.photos.length; i += cols) { | ||
var totalAr = 0, | ||
commonHeight = 0; | ||
function Gallery() { | ||
_classCallCheck(this, Gallery); | ||
// get the total aspect ratio of the row | ||
for (var j = i; j < i + cols; j++) { | ||
if (j == this.props.photos.length) { | ||
break; | ||
} | ||
this.props.photos[j].aspectRatio = this.props.photos[j].width / this.props.photos[j].height; | ||
totalAr += this.props.photos[j].aspectRatio; | ||
} | ||
if (i === lastRowIndex) { | ||
commonHeight = lastRowWidth / totalAr; | ||
} else { | ||
commonHeight = contWidth / totalAr; | ||
} | ||
// run thru the same set of items again to give the width and common height | ||
_get(Object.getPrototypeOf(Gallery.prototype), 'constructor', this).call(this); | ||
this.state = { | ||
currentImage: 0, | ||
containerWidth: 0 | ||
}; | ||
this.handleResize = this.handleResize.bind(this); | ||
this.closeLightbox = this.closeLightbox.bind(this); | ||
this.gotoNext = this.gotoNext.bind(this); | ||
this.gotoPrevious = this.gotoPrevious.bind(this); | ||
this.openLightbox = this.openLightbox.bind(this); | ||
} | ||
var _loop = function (k) { | ||
if (k == _this.props.photos.length) { | ||
return 'break'; | ||
} | ||
src = _this.props.photos[k].src; | ||
_createClass(Gallery, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this.setState({ containerWidth: Math.floor(_reactDom2['default'].findDOMNode(this).clientWidth) }); | ||
window.addEventListener('resize', this.handleResize); | ||
} | ||
}, { | ||
key: 'componentDidUpdate', | ||
value: function componentDidUpdate() { | ||
if (_reactDom2['default'].findDOMNode(this).clientWidth !== this.state.containerWidth) { | ||
this.setState({ containerWidth: Math.floor(_reactDom2['default'].findDOMNode(this).clientWidth) }); | ||
} | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
window.removeEventListener('resize', this.handleResize, false); | ||
} | ||
}, { | ||
key: 'handleResize', | ||
value: function handleResize(e) { | ||
this.setState({ containerWidth: Math.floor(_reactDom2['default'].findDOMNode(this).clientWidth) }); | ||
} | ||
}, { | ||
key: 'openLightbox', | ||
value: function openLightbox(index, event) { | ||
event.preventDefault(); | ||
this.setState({ | ||
currentImage: index, | ||
lightboxIsOpen: true | ||
}); | ||
} | ||
}, { | ||
key: 'closeLightbox', | ||
value: function closeLightbox() { | ||
this.setState({ | ||
currentImage: 0, | ||
lightboxIsOpen: false | ||
}); | ||
} | ||
}, { | ||
key: 'gotoPrevious', | ||
value: function gotoPrevious() { | ||
this.setState({ | ||
currentImage: this.state.currentImage - 1 | ||
}); | ||
} | ||
}, { | ||
key: 'gotoNext', | ||
value: function gotoNext() { | ||
this.setState({ | ||
currentImage: this.state.currentImage + 1 | ||
}); | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var rowLimit = 1, | ||
photoPreviewNodes = []; | ||
if (this.state.containerWidth >= 480) { | ||
rowLimit = 2; | ||
} | ||
if (this.state.containerWidth >= 1024) { | ||
rowLimit = 3; | ||
} | ||
var contWidth = this.state.containerWidth - rowLimit * 4; /* 4px for margin around each image*/ | ||
contWidth = Math.floor(contWidth - 2); // add some padding to prevent layout prob | ||
var lightboxImages = []; | ||
for (var i = 0; i < this.props.photos.length; i += rowLimit) { | ||
var rowItems = []; | ||
// loop thru each set of rowLimit num | ||
// eg. if rowLimit is 3 it will loop thru 0,1,2, then 3,4,5 to perform calculations for the particular set | ||
var aspectRatio = 0, | ||
totalAr = 0, | ||
commonHeight = 0; | ||
for (var j = i; j < i + rowLimit; j++) { | ||
if (j == this.props.photos.length) { | ||
break; | ||
} | ||
totalAr += this.props.photos[j].aspectRatio; | ||
} | ||
commonHeight = contWidth / totalAr; | ||
// run thru the same set of items again to give the common height | ||
for (var k = i; k < i + rowLimit; k++) { | ||
if (k == this.props.photos.length) { | ||
break; | ||
} | ||
var src = this.props.photos[k].src; | ||
if (_this.props.onClickPhoto) { | ||
photoPreviewNodes.push(_react2['default'].createElement( | ||
'div', | ||
{ key: k, style: style }, | ||
_react2['default'].createElement( | ||
'a', | ||
{ href: '#', className: k, onClick: function (e) { | ||
return _this.props.onClickPhoto(k, e); | ||
} }, | ||
_react2['default'].createElement('img', { src: src, style: { display: 'block', border: 0 }, height: commonHeight, width: commonHeight * _this.props.photos[k].aspectRatio, alt: '' }) | ||
) | ||
)); | ||
} else { | ||
photoPreviewNodes.push(_react2['default'].createElement( | ||
'div', | ||
{ key: k, style: style }, | ||
_react2['default'].createElement('img', { src: src, style: { display: 'block', border: 0 }, height: commonHeight, width: commonHeight * _this.props.photos[k].aspectRatio, alt: '' }) | ||
)); | ||
} | ||
}; | ||
if (this.props.disableLightbox) { | ||
photoPreviewNodes.push(_react2['default'].createElement( | ||
'div', | ||
{ key: k, style: style }, | ||
_react2['default'].createElement('img', { src: src, style: { display: 'block', border: 0 }, height: commonHeight, width: commonHeight * this.props.photos[k].aspectRatio, alt: '' }) | ||
)); | ||
} else { | ||
lightboxImages.push(this.props.photos[k].lightboxImage); | ||
photoPreviewNodes.push(_react2['default'].createElement( | ||
'div', | ||
{ key: k, style: style }, | ||
_react2['default'].createElement( | ||
'a', | ||
{ href: '#', className: k, onClick: this.openLightbox.bind(this, k) }, | ||
_react2['default'].createElement('img', { src: src, style: { display: 'block', border: 0 }, height: commonHeight, width: commonHeight * this.props.photos[k].aspectRatio, alt: '' }) | ||
) | ||
)); | ||
} | ||
} | ||
} | ||
return this.renderGallery(photoPreviewNodes, lightboxImages); | ||
} | ||
}, { | ||
key: 'renderGallery', | ||
value: function renderGallery(photoPreviewNodes, lightboxImages) { | ||
if (this.props.disableLightbox) { | ||
return _react2['default'].createElement( | ||
'div', | ||
{ id: 'Gallery', className: 'clearfix' }, | ||
photoPreviewNodes | ||
); | ||
} else { | ||
return _react2['default'].createElement( | ||
'div', | ||
{ id: 'Gallery', className: 'clearfix' }, | ||
photoPreviewNodes, | ||
_react2['default'].createElement(_reactImages2['default'], { | ||
currentImage: this.state.currentImage, | ||
images: lightboxImages, | ||
isOpen: this.state.lightboxIsOpen, | ||
onClose: this.closeLightbox, | ||
onClickPrev: this.gotoPrevious, | ||
onClickNext: this.gotoNext, | ||
width: 1600, | ||
showImageCount: this.props.lightboxShowImageCount, | ||
backdropClosesModal: this.props.backdropClosesModal | ||
}) | ||
); | ||
} | ||
} | ||
}]); | ||
for (var k = i; k < i + cols; k++) { | ||
var src; | ||
return Gallery; | ||
var _ret = _loop(k); | ||
if (_ret === 'break') break; | ||
} | ||
} | ||
return this.renderGallery(photoPreviewNodes); | ||
} | ||
}, { | ||
key: 'renderGallery', | ||
value: function renderGallery(photoPreviewNodes) { | ||
var _this2 = this; | ||
if (this.props.disableLightbox) { | ||
return _react2['default'].createElement( | ||
'div', | ||
{ id: 'Gallery', className: 'clearfix', ref: function (c) { | ||
return _this2._gallery = c; | ||
} }, | ||
photoPreviewNodes | ||
); | ||
} else { | ||
return _react2['default'].createElement( | ||
'div', | ||
{ id: 'Gallery', className: 'clearfix', ref: function (c) { | ||
return _this2._gallery = c; | ||
} }, | ||
photoPreviewNodes | ||
); | ||
} | ||
} | ||
}]); | ||
return Gallery; | ||
})(_react2['default'].Component); | ||
@@ -195,28 +162,21 @@ | ||
Gallery.propTypes = { | ||
photos: function photos(props, propName, componentName) { | ||
var lightboxImageValidator = _react2['default'].PropTypes.object; | ||
if (!props.disableLightbox) { | ||
lightboxImageValidator = _react2['default'].PropTypes.object.isRequired; | ||
} | ||
return _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.shape({ | ||
src: _react2['default'].PropTypes.string.isRequired, | ||
width: _react2['default'].PropTypes.number.isRequired, | ||
height: _react2['default'].PropTypes.number.isRequired, | ||
aspectRatio: _react2['default'].PropTypes.number.isRequired, | ||
lightboxImage: lightboxImageValidator | ||
})).isRequired.apply(this, arguments); | ||
}, | ||
disableLightbox: _react2['default'].PropTypes.bool | ||
photos: function photos(props, propName, componentName) { | ||
return _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.shape({ | ||
src: _react2['default'].PropTypes.string.isRequired, | ||
width: _react2['default'].PropTypes.number.isRequired, | ||
height: _react2['default'].PropTypes.number.isRequired | ||
})).isRequired.apply(this, arguments); | ||
}, | ||
onClickPhoto: _react2['default'].PropTypes.func, | ||
cols: _react2['default'].PropTypes.number | ||
}; | ||
Gallery.defaultProps = { | ||
lightboxShowImageCount: false, | ||
backdropClosesModal: true, | ||
disableLightbox: false | ||
cols: 3 | ||
}; | ||
// Gallery image style | ||
var style = { | ||
display: 'block', | ||
margin: 2, | ||
backgroundColor: '#e3e3e3', | ||
float: 'left' | ||
display: 'block', | ||
margin: 2, | ||
backgroundColor: '#e3e3e3', | ||
float: 'left' | ||
}; | ||
@@ -223,0 +183,0 @@ |
{ | ||
"name": "react-photo-gallery", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"description": "Responsive React Photo Gallery Component", | ||
@@ -5,0 +5,0 @@ "main": "lib/Gallery.js", |
@@ -29,10 +29,7 @@ import React from 'react'; | ||
photoPreviewNodes = []; | ||
if (!this.props.cols){ | ||
cols = 3; | ||
} | ||
var contWidth = this.state.containerWidth - (cols * 4); /* 4px for margin around each image*/ | ||
contWidth = Math.floor(contWidth - 2); // add some padding to prevent layout prob | ||
contWidth = Math.floor(contWidth); // add some padding to prevent layout prob | ||
var remainder = this.props.photos.length % cols; | ||
if (remainder) { // there are fewer than photos than cols num in last row | ||
var lastRowWidth = Math.floor(this.state.containerWidth - (remainder * 4) - 2); | ||
if (remainder) { // there are fewer photos than cols num in last row | ||
var lastRowWidth = Math.floor( ((this.state.containerWidth / cols) * remainder) - (remainder * 4) ); | ||
var lastRowIndex = this.props.photos.length - remainder; | ||
@@ -39,0 +36,0 @@ } |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
25
2974947
49199
1
436