react-grid-system
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -19,4 +19,4 @@ 'use strict'; | ||
if (typeof width !== 'number') return undefined; | ||
var colWidth = (0, _utils.normalizeColumnWidth)(width); | ||
return 100 / gridColumns * colWidth + '%'; | ||
var normalizedWidth = Math.max(0, Math.min(gridColumns, width)); | ||
return 100 / gridColumns * normalizedWidth + '%'; | ||
}; | ||
@@ -23,0 +23,0 @@ |
@@ -44,6 +44,2 @@ 'use strict'; | ||
return screenClass; | ||
}; | ||
var normalizeColumnWidth = exports.normalizeColumnWidth = function normalizeColumnWidth(width) { | ||
return Math.max(0, Math.min(12, width)); | ||
}; |
{ | ||
"name": "react-grid-system", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "A no CSS Bootstrap-like responsive grid system for React.", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -1,2 +0,2 @@ | ||
import { defaultGutterWidth, normalizeColumnWidth, screenClasses, defaultGridColumns } from '../../utils'; | ||
import { defaultGutterWidth, screenClasses, defaultGridColumns } from '../../utils'; | ||
@@ -7,4 +7,4 @@ const hasWidth = widths => Object.keys(widths).reduce((acc, cur) => acc || widths[cur], false); | ||
if (typeof width !== 'number') return undefined; | ||
const colWidth = normalizeColumnWidth(width); | ||
return `${(100 / gridColumns) * colWidth}%`; | ||
const normalizedWidth = Math.max(0, Math.min(gridColumns, width)); | ||
return `${(100 / gridColumns) * normalizedWidth}%`; | ||
}; | ||
@@ -11,0 +11,0 @@ |
@@ -37,3 +37,1 @@ /* global window */ | ||
}; | ||
export const normalizeColumnWidth = width => Math.max(0, Math.min(12, width)); |
72937
1633