react-responsive-masonry
Advanced tools
Comparing version 2.1.6 to 2.1.7
@@ -41,6 +41,13 @@ import PropTypes from "prop-types"; | ||
var MasonryResponsive = function MasonryResponsive(_ref) { | ||
var columnsCountBreakPoints = _ref.columnsCountBreakPoints, | ||
var _ref$columnsCountBrea = _ref.columnsCountBreakPoints, | ||
columnsCountBreakPoints = _ref$columnsCountBrea === void 0 ? { | ||
350: 1, | ||
750: 2, | ||
900: 3 | ||
} : _ref$columnsCountBrea, | ||
children = _ref.children, | ||
className = _ref.className, | ||
style = _ref.style; | ||
_ref$className = _ref.className, | ||
className = _ref$className === void 0 ? null : _ref$className, | ||
_ref$style = _ref.style, | ||
style = _ref$style === void 0 ? null : _ref$style; | ||
var windowWidth = useWindowWidth(); | ||
@@ -76,11 +83,2 @@ var columnsCount = useMemo(function () { | ||
} : {}; | ||
MasonryResponsive.defaultProps = { | ||
columnsCountBreakPoints: { | ||
350: 1, | ||
750: 2, | ||
900: 3 | ||
}, | ||
className: null, | ||
style: null | ||
}; | ||
export default MasonryResponsive; |
@@ -54,6 +54,13 @@ "use strict"; | ||
var MasonryResponsive = function MasonryResponsive(_ref) { | ||
var columnsCountBreakPoints = _ref.columnsCountBreakPoints, | ||
var _ref$columnsCountBrea = _ref.columnsCountBreakPoints, | ||
columnsCountBreakPoints = _ref$columnsCountBrea === void 0 ? { | ||
350: 1, | ||
750: 2, | ||
900: 3 | ||
} : _ref$columnsCountBrea, | ||
children = _ref.children, | ||
className = _ref.className, | ||
style = _ref.style; | ||
_ref$className = _ref.className, | ||
className = _ref$className === void 0 ? null : _ref$className, | ||
_ref$style = _ref.style, | ||
style = _ref$style === void 0 ? null : _ref$style; | ||
var windowWidth = useWindowWidth(); | ||
@@ -89,13 +96,4 @@ var columnsCount = (0, _react.useMemo)(function () { | ||
} : {}; | ||
MasonryResponsive.defaultProps = { | ||
columnsCountBreakPoints: { | ||
350: 1, | ||
750: 2, | ||
900: 3 | ||
}, | ||
className: null, | ||
style: null | ||
}; | ||
var _default = MasonryResponsive; | ||
exports["default"] = _default; | ||
module.exports = exports.default; |
{ | ||
"name": "react-responsive-masonry", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Cédric Delpoux", |
/*! | ||
* react-responsive-masonry v2.1.6 - https://github.com/cedricdelpoux/react-responsive-masonry#readme | ||
* react-responsive-masonry v2.1.7 - https://github.com/cedricdelpoux/react-responsive-masonry#readme | ||
* MIT Licensed | ||
@@ -272,6 +272,13 @@ */ | ||
var ResponsiveMasonry_MasonryResponsive = function MasonryResponsive(_ref) { | ||
var columnsCountBreakPoints = _ref.columnsCountBreakPoints, | ||
var _ref$columnsCountBrea = _ref.columnsCountBreakPoints, | ||
columnsCountBreakPoints = _ref$columnsCountBrea === void 0 ? { | ||
350: 1, | ||
750: 2, | ||
900: 3 | ||
} : _ref$columnsCountBrea, | ||
children = _ref.children, | ||
className = _ref.className, | ||
style = _ref.style; | ||
_ref$className = _ref.className, | ||
className = _ref$className === void 0 ? null : _ref$className, | ||
_ref$style = _ref.style, | ||
style = _ref$style === void 0 ? null : _ref$style; | ||
var windowWidth = ResponsiveMasonry_useWindowWidth(); | ||
@@ -307,11 +314,2 @@ var columnsCount = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["useMemo"])(function () { | ||
}; | ||
ResponsiveMasonry_MasonryResponsive.defaultProps = { | ||
columnsCountBreakPoints: { | ||
350: 1, | ||
750: 2, | ||
900: 3 | ||
}, | ||
className: null, | ||
style: null | ||
}; | ||
/* harmony default export */ var ResponsiveMasonry = (ResponsiveMasonry_MasonryResponsive); | ||
@@ -318,0 +316,0 @@ // CONCATENATED MODULE: ./src/index.js |
/*! | ||
* react-responsive-masonry v2.1.6 - https://github.com/cedricdelpoux/react-responsive-masonry#readme | ||
* react-responsive-masonry v2.1.7 - https://github.com/cedricdelpoux/react-responsive-masonry#readme | ||
* MIT Licensed | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactResponsiveMasonry=t(require("react")):e.ReactResponsiveMasonry=t(e.React)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";n.r(t),n.d(t,"ResponsiveMasonry",(function(){return p}));var r=n(0),o=n.n(r);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var c=r.prototype;return c.getColumns=function(){var e=this.props,t=e.children,n=e.columnsCount,r=Array.from({length:n},(function(){return[]}));return o.a.Children.forEach(t,(function(e,t){e&&o.a.isValidElement(e)&&r[t%n].push(e)})),r},c.renderColumns=function(){var e=this.props.gutter;return this.getColumns().map((function(t,n){return o.a.createElement("div",{key:n,style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignContent:"stretch",flex:1,width:0,gap:e}},t.map((function(e){return e})))}))},c.render=function(){var e=this.props,t=e.gutter,n=e.className,r=e.style;return o.a.createElement("div",{style:u({display:"flex",flexDirection:"row",justifyContent:"center",alignContent:"stretch",boxSizing:"border-box",width:"100%",gap:t},r),className:n},this.renderColumns())},r}(o.a.Component);c.defaultProps={columnsCount:3,gutter:"0",className:null,style:{}};var a=c,s="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,l=function(){var e=function(){var e=Object(r.useState)(!1),t=e[0],n=e[1];return s((function(){n(!0)}),[]),t}(),t=Object(r.useState)(0),n=t[0],o=t[1],u=Object(r.useCallback)((function(){e&&o(window.innerWidth)}),[e]);return s((function(){if(e)return window.addEventListener("resize",u),u(),function(){return window.removeEventListener("resize",u)}}),[e,u]),n},f=function(e){var t=e.columnsCountBreakPoints,n=e.children,u=e.className,i=e.style,c=l(),a=Object(r.useMemo)((function(){var e=Object.keys(t).sort((function(e,t){return e-t})),n=e.length>0?t[e[0]]:1;return e.forEach((function(e){e<c&&(n=t[e])})),n}),[c,t]);return o.a.createElement("div",{className:u,style:i},o.a.Children.map(n,(function(e,t){return o.a.cloneElement(e,{key:t,columnsCount:a})})))};f.defaultProps={columnsCountBreakPoints:{350:1,750:2,900:3},className:null,style:null};var p=f;t.default=a}]).default})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactResponsiveMasonry=t(require("react")):e.ReactResponsiveMasonry=t(e.React)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";n.r(t),n.d(t,"ResponsiveMasonry",(function(){return l}));var r=n(0),o=n.n(r);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var c=r.prototype;return c.getColumns=function(){var e=this.props,t=e.children,n=e.columnsCount,r=Array.from({length:n},(function(){return[]}));return o.a.Children.forEach(t,(function(e,t){e&&o.a.isValidElement(e)&&r[t%n].push(e)})),r},c.renderColumns=function(){var e=this.props.gutter;return this.getColumns().map((function(t,n){return o.a.createElement("div",{key:n,style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignContent:"stretch",flex:1,width:0,gap:e}},t.map((function(e){return e})))}))},c.render=function(){var e=this.props,t=e.gutter,n=e.className,r=e.style;return o.a.createElement("div",{style:u({display:"flex",flexDirection:"row",justifyContent:"center",alignContent:"stretch",boxSizing:"border-box",width:"100%",gap:t},r),className:n},this.renderColumns())},r}(o.a.Component);c.defaultProps={columnsCount:3,gutter:"0",className:null,style:{}};var a=c,s="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,f=function(){var e=function(){var e=Object(r.useState)(!1),t=e[0],n=e[1];return s((function(){n(!0)}),[]),t}(),t=Object(r.useState)(0),n=t[0],o=t[1],u=Object(r.useCallback)((function(){e&&o(window.innerWidth)}),[e]);return s((function(){if(e)return window.addEventListener("resize",u),u(),function(){return window.removeEventListener("resize",u)}}),[e,u]),n},l=function(e){var t=e.columnsCountBreakPoints,n=void 0===t?{350:1,750:2,900:3}:t,u=e.children,i=e.className,c=void 0===i?null:i,a=e.style,s=void 0===a?null:a,l=f(),p=Object(r.useMemo)((function(){var e=Object.keys(n).sort((function(e,t){return e-t})),t=e.length>0?n[e[0]]:1;return e.forEach((function(e){e<l&&(t=n[e])})),t}),[l,n]);return o.a.createElement("div",{className:c,style:s},o.a.Children.map(u,(function(e,t){return o.a.cloneElement(e,{key:t,columnsCount:p})})))};t.default=a}]).default})); | ||
//# sourceMappingURL=react-responsive-masonry.min.js.map |
Sorry, the diff of this file is not supported yet
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
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
52439
640