Security upgrades
This commit is contained in:
46
node_modules/@material-ui/system/esm/borders.js
generated
vendored
Normal file
46
node_modules/@material-ui/system/esm/borders.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
|
||||
function getBorder(value) {
|
||||
if (typeof value !== 'number') {
|
||||
return value;
|
||||
}
|
||||
|
||||
return "".concat(value, "px solid");
|
||||
}
|
||||
|
||||
export var border = style({
|
||||
prop: 'border',
|
||||
themeKey: 'borders',
|
||||
transform: getBorder
|
||||
});
|
||||
export var borderTop = style({
|
||||
prop: 'borderTop',
|
||||
themeKey: 'borders',
|
||||
transform: getBorder
|
||||
});
|
||||
export var borderRight = style({
|
||||
prop: 'borderRight',
|
||||
themeKey: 'borders',
|
||||
transform: getBorder
|
||||
});
|
||||
export var borderBottom = style({
|
||||
prop: 'borderBottom',
|
||||
themeKey: 'borders',
|
||||
transform: getBorder
|
||||
});
|
||||
export var borderLeft = style({
|
||||
prop: 'borderLeft',
|
||||
themeKey: 'borders',
|
||||
transform: getBorder
|
||||
});
|
||||
export var borderColor = style({
|
||||
prop: 'borderColor',
|
||||
themeKey: 'palette'
|
||||
});
|
||||
export var borderRadius = style({
|
||||
prop: 'borderRadius',
|
||||
themeKey: 'shape'
|
||||
});
|
||||
var borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderRadius);
|
||||
export default borders;
|
||||
79
node_modules/@material-ui/system/esm/breakpoints.js
generated
vendored
Normal file
79
node_modules/@material-ui/system/esm/breakpoints.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||
import PropTypes from 'prop-types';
|
||||
import merge from './merge'; // The breakpoint **start** at this value.
|
||||
// For instance with the first breakpoint xs: [xs, sm[.
|
||||
|
||||
var values = {
|
||||
xs: 0,
|
||||
sm: 600,
|
||||
md: 960,
|
||||
lg: 1280,
|
||||
xl: 1920
|
||||
};
|
||||
var defaultBreakpoints = {
|
||||
// Sorted ASC by size. That's important.
|
||||
// It can't be configured as it's used statically for propTypes.
|
||||
keys: ['xs', 'sm', 'md', 'lg', 'xl'],
|
||||
up: function up(key) {
|
||||
return "@media (min-width:".concat(values[key], "px)");
|
||||
}
|
||||
};
|
||||
export function handleBreakpoints(props, propValue, styleFromPropValue) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!props.theme) {
|
||||
console.error('Material-UI: You are calling a style function without a theme value.');
|
||||
}
|
||||
}
|
||||
|
||||
if (Array.isArray(propValue)) {
|
||||
var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
|
||||
return propValue.reduce(function (acc, item, index) {
|
||||
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
if (_typeof(propValue) === 'object') {
|
||||
var _themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
|
||||
|
||||
return Object.keys(propValue).reduce(function (acc, breakpoint) {
|
||||
acc[_themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
var output = styleFromPropValue(propValue);
|
||||
return output;
|
||||
}
|
||||
|
||||
function breakpoints(styleFunction) {
|
||||
var newStyleFunction = function newStyleFunction(props) {
|
||||
var base = styleFunction(props);
|
||||
var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
|
||||
var extended = themeBreakpoints.keys.reduce(function (acc, key) {
|
||||
if (props[key]) {
|
||||
acc = acc || {};
|
||||
acc[themeBreakpoints.up(key)] = styleFunction(_extends({
|
||||
theme: props.theme
|
||||
}, props[key]));
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, null);
|
||||
return merge(base, extended);
|
||||
};
|
||||
|
||||
newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends(_extends({}, styleFunction.propTypes), {}, {
|
||||
xs: PropTypes.object,
|
||||
sm: PropTypes.object,
|
||||
md: PropTypes.object,
|
||||
lg: PropTypes.object,
|
||||
xl: PropTypes.object
|
||||
}) : {};
|
||||
newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl'].concat(_toConsumableArray(styleFunction.filterProps));
|
||||
return newStyleFunction;
|
||||
}
|
||||
|
||||
export default breakpoints;
|
||||
45
node_modules/@material-ui/system/esm/compose.js
generated
vendored
Normal file
45
node_modules/@material-ui/system/esm/compose.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import merge from './merge';
|
||||
|
||||
function compose() {
|
||||
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
styles[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
var fn = function fn(props) {
|
||||
return styles.reduce(function (acc, style) {
|
||||
var output = style(props);
|
||||
|
||||
if (output) {
|
||||
return merge(acc, output);
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
}; // Alternative approach that doesn't yield any performance gain.
|
||||
// const handlers = styles.reduce((acc, style) => {
|
||||
// style.filterProps.forEach(prop => {
|
||||
// acc[prop] = style;
|
||||
// });
|
||||
// return acc;
|
||||
// }, {});
|
||||
// const fn = props => {
|
||||
// return Object.keys(props).reduce((acc, prop) => {
|
||||
// if (handlers[prop]) {
|
||||
// return merge(acc, handlers[prop](props));
|
||||
// }
|
||||
// return acc;
|
||||
// }, {});
|
||||
// };
|
||||
|
||||
|
||||
fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce(function (acc, style) {
|
||||
return _extends(acc, style.propTypes);
|
||||
}, {}) : {};
|
||||
fn.filterProps = styles.reduce(function (acc, style) {
|
||||
return acc.concat(style.filterProps);
|
||||
}, []);
|
||||
return fn;
|
||||
}
|
||||
|
||||
export default compose;
|
||||
36
node_modules/@material-ui/system/esm/css.js
generated
vendored
Normal file
36
node_modules/@material-ui/system/esm/css.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import PropTypes from 'prop-types';
|
||||
import merge from './merge';
|
||||
|
||||
function omit(input, fields) {
|
||||
var output = {};
|
||||
Object.keys(input).forEach(function (prop) {
|
||||
if (fields.indexOf(prop) === -1) {
|
||||
output[prop] = input[prop];
|
||||
}
|
||||
});
|
||||
return output;
|
||||
}
|
||||
|
||||
function css(styleFunction) {
|
||||
var newStyleFunction = function newStyleFunction(props) {
|
||||
var output = styleFunction(props);
|
||||
|
||||
if (props.css) {
|
||||
return _extends(_extends({}, merge(output, styleFunction(_extends({
|
||||
theme: props.theme
|
||||
}, props.css)))), omit(props.css, [styleFunction.filterProps]));
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends(_extends({}, styleFunction.propTypes), {}, {
|
||||
css: PropTypes.object
|
||||
}) : {};
|
||||
newStyleFunction.filterProps = ['css'].concat(_toConsumableArray(styleFunction.filterProps));
|
||||
return newStyleFunction;
|
||||
}
|
||||
|
||||
export default css;
|
||||
29
node_modules/@material-ui/system/esm/display.js
generated
vendored
Normal file
29
node_modules/@material-ui/system/esm/display.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
export var displayPrint = style({
|
||||
prop: 'displayPrint',
|
||||
cssProperty: false,
|
||||
transform: function transform(value) {
|
||||
return {
|
||||
'@media print': {
|
||||
display: value
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
export var displayRaw = style({
|
||||
prop: 'display'
|
||||
});
|
||||
export var overflow = style({
|
||||
prop: 'overflow'
|
||||
});
|
||||
export var textOverflow = style({
|
||||
prop: 'textOverflow'
|
||||
});
|
||||
export var visibility = style({
|
||||
prop: 'visibility'
|
||||
});
|
||||
export var whiteSpace = style({
|
||||
prop: 'whiteSpace'
|
||||
});
|
||||
export default compose(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);
|
||||
43
node_modules/@material-ui/system/esm/flexbox.js
generated
vendored
Normal file
43
node_modules/@material-ui/system/esm/flexbox.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
export var flexBasis = style({
|
||||
prop: 'flexBasis'
|
||||
});
|
||||
export var flexDirection = style({
|
||||
prop: 'flexDirection'
|
||||
});
|
||||
export var flexWrap = style({
|
||||
prop: 'flexWrap'
|
||||
});
|
||||
export var justifyContent = style({
|
||||
prop: 'justifyContent'
|
||||
});
|
||||
export var alignItems = style({
|
||||
prop: 'alignItems'
|
||||
});
|
||||
export var alignContent = style({
|
||||
prop: 'alignContent'
|
||||
});
|
||||
export var order = style({
|
||||
prop: 'order'
|
||||
});
|
||||
export var flex = style({
|
||||
prop: 'flex'
|
||||
});
|
||||
export var flexGrow = style({
|
||||
prop: 'flexGrow'
|
||||
});
|
||||
export var flexShrink = style({
|
||||
prop: 'flexShrink'
|
||||
});
|
||||
export var alignSelf = style({
|
||||
prop: 'alignSelf'
|
||||
});
|
||||
export var justifyItems = style({
|
||||
prop: 'justifyItems'
|
||||
});
|
||||
export var justifySelf = style({
|
||||
prop: 'justifySelf'
|
||||
});
|
||||
var flexbox = compose(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);
|
||||
export default flexbox;
|
||||
40
node_modules/@material-ui/system/esm/grid.js
generated
vendored
Normal file
40
node_modules/@material-ui/system/esm/grid.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
export var gridGap = style({
|
||||
prop: 'gridGap'
|
||||
});
|
||||
export var gridColumnGap = style({
|
||||
prop: 'gridColumnGap'
|
||||
});
|
||||
export var gridRowGap = style({
|
||||
prop: 'gridRowGap'
|
||||
});
|
||||
export var gridColumn = style({
|
||||
prop: 'gridColumn'
|
||||
});
|
||||
export var gridRow = style({
|
||||
prop: 'gridRow'
|
||||
});
|
||||
export var gridAutoFlow = style({
|
||||
prop: 'gridAutoFlow'
|
||||
});
|
||||
export var gridAutoColumns = style({
|
||||
prop: 'gridAutoColumns'
|
||||
});
|
||||
export var gridAutoRows = style({
|
||||
prop: 'gridAutoRows'
|
||||
});
|
||||
export var gridTemplateColumns = style({
|
||||
prop: 'gridTemplateColumns'
|
||||
});
|
||||
export var gridTemplateRows = style({
|
||||
prop: 'gridTemplateRows'
|
||||
});
|
||||
export var gridTemplateAreas = style({
|
||||
prop: 'gridTemplateAreas'
|
||||
});
|
||||
export var gridArea = style({
|
||||
prop: 'gridArea'
|
||||
});
|
||||
var grid = compose(gridGap, gridColumnGap, gridRowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
||||
export default grid;
|
||||
27
node_modules/@material-ui/system/esm/index.js
generated
vendored
Normal file
27
node_modules/@material-ui/system/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/** @license Material-UI v4.9.14
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export { default as borders } from './borders';
|
||||
export * from './borders';
|
||||
export { default as breakpoints } from './breakpoints';
|
||||
export { default as compose } from './compose';
|
||||
export { default as css } from './css';
|
||||
export { default as display } from './display';
|
||||
export { default as flexbox } from './flexbox';
|
||||
export * from './flexbox';
|
||||
export { default as grid } from './grid';
|
||||
export * from './grid';
|
||||
export { default as palette } from './palette';
|
||||
export * from './palette';
|
||||
export { default as positions } from './positions';
|
||||
export * from './positions';
|
||||
export { default as shadows } from './shadows';
|
||||
export { default as sizing } from './sizing';
|
||||
export * from './sizing';
|
||||
export { default as spacing } from './spacing';
|
||||
export * from './spacing';
|
||||
export { default as style } from './style';
|
||||
export { default as typography } from './typography';
|
||||
export * from './typography';
|
||||
10
node_modules/@material-ui/system/esm/memoize.js
generated
vendored
Normal file
10
node_modules/@material-ui/system/esm/memoize.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export default function memoize(fn) {
|
||||
var cache = {};
|
||||
return function (arg) {
|
||||
if (cache[arg] === undefined) {
|
||||
cache[arg] = fn(arg);
|
||||
}
|
||||
|
||||
return cache[arg];
|
||||
};
|
||||
}
|
||||
14
node_modules/@material-ui/system/esm/merge.js
generated
vendored
Normal file
14
node_modules/@material-ui/system/esm/merge.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { deepmerge } from '@material-ui/utils';
|
||||
|
||||
function merge(acc, item) {
|
||||
if (!item) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
return deepmerge(acc, item, {
|
||||
clone: false // No need to clone deep, it's way faster.
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
export default merge;
|
||||
13
node_modules/@material-ui/system/esm/palette.js
generated
vendored
Normal file
13
node_modules/@material-ui/system/esm/palette.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
export var color = style({
|
||||
prop: 'color',
|
||||
themeKey: 'palette'
|
||||
});
|
||||
export var bgcolor = style({
|
||||
prop: 'bgcolor',
|
||||
cssProperty: 'backgroundColor',
|
||||
themeKey: 'palette'
|
||||
});
|
||||
var palette = compose(color, bgcolor);
|
||||
export default palette;
|
||||
22
node_modules/@material-ui/system/esm/positions.js
generated
vendored
Normal file
22
node_modules/@material-ui/system/esm/positions.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
export var position = style({
|
||||
prop: 'position'
|
||||
});
|
||||
export var zIndex = style({
|
||||
prop: 'zIndex',
|
||||
themeKey: 'zIndex'
|
||||
});
|
||||
export var top = style({
|
||||
prop: 'top'
|
||||
});
|
||||
export var right = style({
|
||||
prop: 'right'
|
||||
});
|
||||
export var bottom = style({
|
||||
prop: 'bottom'
|
||||
});
|
||||
export var left = style({
|
||||
prop: 'left'
|
||||
});
|
||||
export default compose(position, zIndex, top, right, bottom, left);
|
||||
3
node_modules/@material-ui/system/esm/responsivePropType.js
generated
vendored
Normal file
3
node_modules/@material-ui/system/esm/responsivePropType.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import PropTypes from 'prop-types';
|
||||
var responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
|
||||
export default responsivePropType;
|
||||
6
node_modules/@material-ui/system/esm/shadows.js
generated
vendored
Normal file
6
node_modules/@material-ui/system/esm/shadows.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import style from './style';
|
||||
var boxShadow = style({
|
||||
prop: 'boxShadow',
|
||||
themeKey: 'shadows'
|
||||
});
|
||||
export default boxShadow;
|
||||
46
node_modules/@material-ui/system/esm/sizing.js
generated
vendored
Normal file
46
node_modules/@material-ui/system/esm/sizing.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
|
||||
function transform(value) {
|
||||
return value <= 1 ? "".concat(value * 100, "%") : value;
|
||||
}
|
||||
|
||||
export var width = style({
|
||||
prop: 'width',
|
||||
transform: transform
|
||||
});
|
||||
export var maxWidth = style({
|
||||
prop: 'maxWidth',
|
||||
transform: transform
|
||||
});
|
||||
export var minWidth = style({
|
||||
prop: 'minWidth',
|
||||
transform: transform
|
||||
});
|
||||
export var height = style({
|
||||
prop: 'height',
|
||||
transform: transform
|
||||
});
|
||||
export var maxHeight = style({
|
||||
prop: 'maxHeight',
|
||||
transform: transform
|
||||
});
|
||||
export var minHeight = style({
|
||||
prop: 'minHeight',
|
||||
transform: transform
|
||||
});
|
||||
export var sizeWidth = style({
|
||||
prop: 'size',
|
||||
cssProperty: 'width',
|
||||
transform: transform
|
||||
});
|
||||
export var sizeHeight = style({
|
||||
prop: 'size',
|
||||
cssProperty: 'height',
|
||||
transform: transform
|
||||
});
|
||||
export var boxSizing = style({
|
||||
prop: 'boxSizing'
|
||||
});
|
||||
var sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
||||
export default sizing;
|
||||
139
node_modules/@material-ui/system/esm/spacing.js
generated
vendored
Normal file
139
node_modules/@material-ui/system/esm/spacing.js
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
||||
import responsivePropType from './responsivePropType';
|
||||
import { handleBreakpoints } from './breakpoints';
|
||||
import merge from './merge';
|
||||
import memoize from './memoize';
|
||||
var properties = {
|
||||
m: 'margin',
|
||||
p: 'padding'
|
||||
};
|
||||
var directions = {
|
||||
t: 'Top',
|
||||
r: 'Right',
|
||||
b: 'Bottom',
|
||||
l: 'Left',
|
||||
x: ['Left', 'Right'],
|
||||
y: ['Top', 'Bottom']
|
||||
};
|
||||
var aliases = {
|
||||
marginX: 'mx',
|
||||
marginY: 'my',
|
||||
paddingX: 'px',
|
||||
paddingY: 'py'
|
||||
}; // memoize() impact:
|
||||
// From 300,000 ops/sec
|
||||
// To 350,000 ops/sec
|
||||
|
||||
var getCssProperties = memoize(function (prop) {
|
||||
// It's not a shorthand notation.
|
||||
if (prop.length > 2) {
|
||||
if (aliases[prop]) {
|
||||
prop = aliases[prop];
|
||||
} else {
|
||||
return [prop];
|
||||
}
|
||||
}
|
||||
|
||||
var _prop$split = prop.split(''),
|
||||
_prop$split2 = _slicedToArray(_prop$split, 2),
|
||||
a = _prop$split2[0],
|
||||
b = _prop$split2[1];
|
||||
|
||||
var property = properties[a];
|
||||
var direction = directions[b] || '';
|
||||
return Array.isArray(direction) ? direction.map(function (dir) {
|
||||
return property + dir;
|
||||
}) : [property + direction];
|
||||
});
|
||||
var spacingKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY'];
|
||||
export function createUnarySpacing(theme) {
|
||||
var themeSpacing = theme.spacing || 8;
|
||||
|
||||
if (typeof themeSpacing === 'number') {
|
||||
return function (abs) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (typeof abs !== 'number') {
|
||||
console.error("Material-UI: Expected spacing argument to be a number, got ".concat(abs, "."));
|
||||
}
|
||||
}
|
||||
|
||||
return themeSpacing * abs;
|
||||
};
|
||||
}
|
||||
|
||||
if (Array.isArray(themeSpacing)) {
|
||||
return function (abs) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (abs > themeSpacing.length - 1) {
|
||||
console.error(["Material-UI: The value provided (".concat(abs, ") overflows."), "The supported values are: ".concat(JSON.stringify(themeSpacing), "."), "".concat(abs, " > ").concat(themeSpacing.length - 1, ", you need to add the missing values.")].join('\n'));
|
||||
}
|
||||
}
|
||||
|
||||
return themeSpacing[abs];
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof themeSpacing === 'function') {
|
||||
return themeSpacing;
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error(["Material-UI: The `theme.spacing` value (".concat(themeSpacing, ") is invalid."), 'It should be a number, an array or a function.'].join('\n'));
|
||||
}
|
||||
|
||||
return function () {
|
||||
return undefined;
|
||||
};
|
||||
}
|
||||
|
||||
function getValue(transformer, propValue) {
|
||||
if (typeof propValue === 'string') {
|
||||
return propValue;
|
||||
}
|
||||
|
||||
var abs = Math.abs(propValue);
|
||||
var transformed = transformer(abs);
|
||||
|
||||
if (propValue >= 0) {
|
||||
return transformed;
|
||||
}
|
||||
|
||||
if (typeof transformed === 'number') {
|
||||
return -transformed;
|
||||
}
|
||||
|
||||
return "-".concat(transformed);
|
||||
}
|
||||
|
||||
function getStyleFromPropValue(cssProperties, transformer) {
|
||||
return function (propValue) {
|
||||
return cssProperties.reduce(function (acc, cssProperty) {
|
||||
acc[cssProperty] = getValue(transformer, propValue);
|
||||
return acc;
|
||||
}, {});
|
||||
};
|
||||
}
|
||||
|
||||
function spacing(props) {
|
||||
var theme = props.theme;
|
||||
var transformer = createUnarySpacing(theme);
|
||||
return Object.keys(props).map(function (prop) {
|
||||
// Using a hash computation over an array iteration could be faster, but with only 28 items,
|
||||
// it's doesn't worth the bundle size.
|
||||
if (spacingKeys.indexOf(prop) === -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var cssProperties = getCssProperties(prop);
|
||||
var styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
||||
var propValue = props[prop];
|
||||
return handleBreakpoints(props, propValue, styleFromPropValue);
|
||||
}).reduce(merge, {});
|
||||
}
|
||||
|
||||
spacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce(function (obj, key) {
|
||||
obj[key] = responsivePropType;
|
||||
return obj;
|
||||
}, {}) : {};
|
||||
spacing.filterProps = spacingKeys;
|
||||
export default spacing;
|
||||
61
node_modules/@material-ui/system/esm/style.js
generated
vendored
Normal file
61
node_modules/@material-ui/system/esm/style.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||
import responsivePropType from './responsivePropType';
|
||||
import { handleBreakpoints } from './breakpoints';
|
||||
|
||||
function getPath(obj, path) {
|
||||
if (!path || typeof path !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return path.split('.').reduce(function (acc, item) {
|
||||
return acc && acc[item] ? acc[item] : null;
|
||||
}, obj);
|
||||
}
|
||||
|
||||
function style(options) {
|
||||
var prop = options.prop,
|
||||
_options$cssProperty = options.cssProperty,
|
||||
cssProperty = _options$cssProperty === void 0 ? options.prop : _options$cssProperty,
|
||||
themeKey = options.themeKey,
|
||||
transform = options.transform;
|
||||
|
||||
var fn = function fn(props) {
|
||||
if (props[prop] == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var propValue = props[prop];
|
||||
var theme = props.theme;
|
||||
var themeMapping = getPath(theme, themeKey) || {};
|
||||
|
||||
var styleFromPropValue = function styleFromPropValue(propValueFinal) {
|
||||
var value;
|
||||
|
||||
if (typeof themeMapping === 'function') {
|
||||
value = themeMapping(propValueFinal);
|
||||
} else if (Array.isArray(themeMapping)) {
|
||||
value = themeMapping[propValueFinal] || propValueFinal;
|
||||
} else {
|
||||
value = getPath(themeMapping, propValueFinal) || propValueFinal;
|
||||
|
||||
if (transform) {
|
||||
value = transform(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (cssProperty === false) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return _defineProperty({}, cssProperty, value);
|
||||
};
|
||||
|
||||
return handleBreakpoints(props, propValue, styleFromPropValue);
|
||||
};
|
||||
|
||||
fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};
|
||||
fn.filterProps = [prop];
|
||||
return fn;
|
||||
}
|
||||
|
||||
export default style;
|
||||
29
node_modules/@material-ui/system/esm/typography.js
generated
vendored
Normal file
29
node_modules/@material-ui/system/esm/typography.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import style from './style';
|
||||
import compose from './compose';
|
||||
export var fontFamily = style({
|
||||
prop: 'fontFamily',
|
||||
themeKey: 'typography'
|
||||
});
|
||||
export var fontSize = style({
|
||||
prop: 'fontSize',
|
||||
themeKey: 'typography'
|
||||
});
|
||||
export var fontStyle = style({
|
||||
prop: 'fontStyle',
|
||||
themeKey: 'typography'
|
||||
});
|
||||
export var fontWeight = style({
|
||||
prop: 'fontWeight',
|
||||
themeKey: 'typography'
|
||||
});
|
||||
export var letterSpacing = style({
|
||||
prop: 'letterSpacing'
|
||||
});
|
||||
export var lineHeight = style({
|
||||
prop: 'lineHeight'
|
||||
});
|
||||
export var textAlign = style({
|
||||
prop: 'textAlign'
|
||||
});
|
||||
var typography = compose(fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign);
|
||||
export default typography;
|
||||
Reference in New Issue
Block a user