react-flexr
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -88,3 +88,3 @@ 'use strict'; | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(Cell).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (Cell.__proto__ || (0, _getPrototypeOf2.default)(Cell)).call(this, props, context)); | ||
@@ -105,9 +105,7 @@ _initialiseProps.call(_this); | ||
var _ref = size ? size.split('/') : []; | ||
var _ref = size ? size.split('/') : [], | ||
_ref2 = (0, _slicedToArray3.default)(_ref, 2), | ||
numerator = _ref2[0], | ||
denominator = _ref2[1]; | ||
var _ref2 = (0, _slicedToArray3.default)(_ref, 2); | ||
var numerator = _ref2[0]; | ||
var denominator = _ref2[1]; | ||
return { | ||
@@ -120,15 +118,15 @@ width: 100 / denominator * numerator + '%' | ||
value: function render() { | ||
var _props = this.props; | ||
var gutter = _props.gutter; | ||
var flex = _props.flex; | ||
var className = _props.className; | ||
var align = _props.align; | ||
var style = _props.style; | ||
var children = _props.children; | ||
var palm = _props.palm; | ||
var lap = _props.lap; | ||
var portable = _props.portable; | ||
var desk = _props.desk; | ||
var grow = _props.grow; | ||
var rest = (0, _objectWithoutProperties3.default)(_props, ['gutter', 'flex', 'className', 'align', 'style', 'children', 'palm', 'lap', 'portable', 'desk', 'grow']); | ||
var _props = this.props, | ||
gutter = _props.gutter, | ||
flex = _props.flex, | ||
className = _props.className, | ||
align = _props.align, | ||
style = _props.style, | ||
children = _props.children, | ||
palm = _props.palm, | ||
lap = _props.lap, | ||
portable = _props.portable, | ||
desk = _props.desk, | ||
grow = _props.grow, | ||
rest = (0, _objectWithoutProperties3.default)(_props, ['gutter', 'flex', 'className', 'align', 'style', 'children', 'palm', 'lap', 'portable', 'desk', 'grow']); | ||
@@ -178,5 +176,5 @@ | ||
this.handleFlexSize = function (breakpoint) { | ||
var _props2 = _this2.props; | ||
var grow = _props2.grow; | ||
var size = _props2.size; | ||
var _props2 = _this2.props, | ||
grow = _props2.grow, | ||
size = _props2.size; | ||
@@ -183,0 +181,0 @@ var growStyle = typeof grow === 'number' ? grow : grow === false ? 0 : undefined; |
@@ -89,5 +89,5 @@ 'use strict'; | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(Grid).call(this, props)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (Grid.__proto__ || (0, _getPrototypeOf2.default)(Grid)).call(this, props)); | ||
(0, _utils.findBreakpoints)(); | ||
(0, _utils.initBreakpoints)(); | ||
return _this; | ||
@@ -99,11 +99,11 @@ } | ||
value: function render() { | ||
var _props = this.props; | ||
var gutter = _props.gutter; | ||
var style = _props.style; | ||
var align = _props.align; | ||
var hAlign = _props.hAlign; | ||
var flexCells = _props.flexCells; | ||
var children = _props.children; | ||
var className = _props.className; | ||
var rest = (0, _objectWithoutProperties3.default)(_props, ['gutter', 'style', 'align', 'hAlign', 'flexCells', 'children', 'className']); | ||
var _props = this.props, | ||
gutter = _props.gutter, | ||
style = _props.style, | ||
align = _props.align, | ||
hAlign = _props.hAlign, | ||
flexCells = _props.flexCells, | ||
children = _props.children, | ||
className = _props.className, | ||
rest = (0, _objectWithoutProperties3.default)(_props, ['gutter', 'style', 'align', 'hAlign', 'flexCells', 'children', 'className']); | ||
@@ -110,0 +110,0 @@ |
@@ -26,2 +26,3 @@ 'use strict'; | ||
exports.findBreakpoints = findBreakpoints; | ||
exports.initBreakpoints = initBreakpoints; | ||
exports.findMatch = findMatch; | ||
@@ -45,4 +46,4 @@ exports.doubleUnit = doubleUnit; | ||
function generateMatchMediaString(_ref) { | ||
var min = _ref.min; | ||
var max = _ref.max; | ||
var min = _ref.min, | ||
max = _ref.max; | ||
@@ -99,2 +100,10 @@ var minStr = min ? '(min-width: ' + min + 'px)' : null; | ||
var initialized = false; | ||
function initBreakpoints() { | ||
if (!initialized) { | ||
initialized = true; | ||
findBreakpoints(); | ||
} | ||
} | ||
var optimizedResize = exports.optimizedResize = function () { | ||
@@ -120,11 +129,11 @@ var callbacks = new _map2.default(); | ||
while (more) { | ||
var _values$next = values.next(); | ||
var _values$next = values.next(), | ||
done = _values$next.done, | ||
callback = _values$next.value; | ||
var done = _values$next.done; | ||
var callback = _values$next.value; | ||
if (done) { | ||
return more = false; | ||
more = false; | ||
} else { | ||
callback(); | ||
} | ||
callback(); | ||
} | ||
@@ -179,9 +188,7 @@ running = false; | ||
function doubleUnit(str) { | ||
var _str$match = str.match(valunit); | ||
var _str$match = str.match(valunit), | ||
_str$match2 = (0, _slicedToArray3.default)(_str$match, 3), | ||
val = _str$match2[1], | ||
unit = _str$match2[2]; | ||
var _str$match2 = (0, _slicedToArray3.default)(_str$match, 3); | ||
var val = _str$match2[1]; | ||
var unit = _str$match2[2]; | ||
return '' + val * 2 + unit; | ||
@@ -188,0 +195,0 @@ } |
import stylesheet from './stylesheet'; | ||
import StyleSheet from 'stilr'; | ||
import React, { Component, PropTypes as Type } from 'react'; | ||
import { findBreakpoints, doubleUnit, vertical, horizontal, variables, assign } from './utils'; | ||
import { initBreakpoints, doubleUnit, vertical, horizontal, variables, assign } from './utils'; | ||
@@ -38,3 +38,3 @@ const styles = StyleSheet.create({ | ||
super(props); | ||
findBreakpoints(); | ||
initBreakpoints(); | ||
} | ||
@@ -41,0 +41,0 @@ |
@@ -75,2 +75,10 @@ export const canUseDOM = (() => ( | ||
let initialized = false; | ||
export function initBreakpoints() { | ||
if (!initialized) { | ||
initialized = true; | ||
findBreakpoints(); | ||
} | ||
} | ||
export const optimizedResize = (function() { | ||
@@ -98,5 +106,7 @@ const callbacks = new Map(); | ||
if (done) { | ||
return (more = false); | ||
(more = false); | ||
} | ||
callback(); | ||
else { | ||
callback(); | ||
} | ||
} | ||
@@ -103,0 +113,0 @@ running = false; |
{ | ||
"name": "react-flexr", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "React flexbox grid made simple.", | ||
@@ -17,26 +17,26 @@ "main": "dist", | ||
"devDependencies": { | ||
"babel-cli": "^6.11.4", | ||
"babel-core": "^6.13.2", | ||
"babel-eslint": "^6.1.2", | ||
"babel-loader": "^6.2.5", | ||
"babel-plugin-add-module-exports": "^0.1.2", | ||
"babel-plugin-transform-object-rest-spread": "^6.8.0", | ||
"babel-cli": "^6.18.0", | ||
"babel-core": "^6.18.2", | ||
"babel-eslint": "^7.1.1", | ||
"babel-loader": "^6.2.8", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-transform-object-rest-spread": "^6.19.0", | ||
"babel-plugin-transform-react-constant-elements": "^6.9.1", | ||
"babel-plugin-transform-react-inline-elements": "^6.8.0", | ||
"babel-plugin-transform-runtime": "^6.12.0", | ||
"babel-preset-es2015": "^6.13.2", | ||
"babel-preset-react": "^6.11.1", | ||
"babel-preset-stage-0": "^6.3.13", | ||
"babel-register": "^6.11.6", | ||
"babel-runtime": "^6.11.6", | ||
"eslint": "^2.7.0", | ||
"eslint-plugin-react": "^4.3.0", | ||
"jsdom": "^8.0.4", | ||
"mocha": "^2.4.5", | ||
"react-addons-test-utils": "^15.3.1", | ||
"react-dom": "^15.3.1", | ||
"babel-plugin-transform-runtime": "^6.15.0", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"babel-register": "^6.18.0", | ||
"babel-runtime": "^6.18.0", | ||
"eslint": "^3.10.2", | ||
"eslint-plugin-react": "^6.7.1", | ||
"jsdom": "^9.8.3", | ||
"mocha": "^3.1.2", | ||
"react-addons-test-utils": "^15.4.0", | ||
"react-dom": "^15.4.0", | ||
"react-hot-loader": "^1.2.7", | ||
"semver": "^5.3.0", | ||
"webpack": "^1.13.2", | ||
"webpack-dev-server": "^1.15.0" | ||
"webpack": "^1.13.3", | ||
"webpack-dev-server": "^1.16.2" | ||
}, | ||
@@ -43,0 +43,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
42253
189
889