Completely updated React, fixed #11, (hopefully)
This commit is contained in:
36
goTorrentWebUI/node_modules/material-ui/styles/createBreakpoints.js
generated
vendored
36
goTorrentWebUI/node_modules/material-ui/styles/createBreakpoints.js
generated
vendored
@@ -17,8 +17,6 @@ exports.default = createBreakpoints;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Breakpoint = require('prop-types').oneOf(['xs', 'sm', 'md', 'lg', 'xl']);
|
||||
|
||||
// Sorted ASC by size. That's important.
|
||||
// It can't be configured as it's used statically for propTypes.
|
||||
var keys = exports.keys = ['xs', 'sm', 'md', 'lg', 'xl'];
|
||||
@@ -27,7 +25,7 @@ var keys = exports.keys = ['xs', 'sm', 'md', 'lg', 'xl'];
|
||||
function createBreakpoints(breakpoints) {
|
||||
var _breakpoints$values = breakpoints.values,
|
||||
values = _breakpoints$values === undefined ? {
|
||||
xs: 360,
|
||||
xs: 0,
|
||||
sm: 600,
|
||||
md: 960,
|
||||
lg: 1280,
|
||||
@@ -41,32 +39,34 @@ function createBreakpoints(breakpoints) {
|
||||
|
||||
|
||||
function up(key) {
|
||||
var value = void 0;
|
||||
// min-width of xs starts at 0
|
||||
if (key === 'xs') {
|
||||
value = 0;
|
||||
} else {
|
||||
value = values[key] || key;
|
||||
}
|
||||
var value = typeof values[key] === 'number' ? values[key] : key;
|
||||
return '@media (min-width:' + value + unit + ')';
|
||||
}
|
||||
|
||||
function down(key) {
|
||||
var value = values[key] || key;
|
||||
var endIndex = keys.indexOf(key) + 1;
|
||||
var upperbound = values[keys[endIndex]];
|
||||
|
||||
if (endIndex === keys.length) {
|
||||
// xl down applies to all sizes
|
||||
return up('xs');
|
||||
}
|
||||
|
||||
var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key;
|
||||
return '@media (max-width:' + (value - step / 100) + unit + ')';
|
||||
}
|
||||
|
||||
function between(start, end) {
|
||||
var startIndex = keys.indexOf(start);
|
||||
var endIndex = keys.indexOf(end);
|
||||
return '@media (min-width:' + values[keys[startIndex]] + unit + ') and ' + ('(max-width:' + (values[keys[endIndex + 1]] - step / 100) + unit + ')');
|
||||
var endIndex = keys.indexOf(end) + 1;
|
||||
|
||||
if (endIndex === keys.length) {
|
||||
return up(start);
|
||||
}
|
||||
|
||||
return '@media (min-width:' + values[start] + unit + ') and ' + ('(max-width:' + (values[keys[endIndex]] - step / 100) + unit + ')');
|
||||
}
|
||||
|
||||
function only(key) {
|
||||
var keyIndex = keys.indexOf(key);
|
||||
if (keyIndex === keys.length - 1) {
|
||||
return up(key);
|
||||
}
|
||||
return between(key, key);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user