Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -1,9 +1,6 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
@@ -18,19 +15,21 @@ export const styles = theme => ({
},
verticalAlign: 'middle'
},
head: {
typeHead: {
height: 56
},
footer: {
typeFooter: {
height: 56
},
selected: {
backgroundColor: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.04)' // grey[100]
: 'rgba(255, 255, 255, 0.08)'
},
hover: {
'&:hover': {
background: theme.palette.background.contentFrame
backgroundColor: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.07)' // grey[200]
: 'rgba(255, 255, 255, 0.14)'
}
},
selected: {
background: theme.palette.background.appBar
}
});
@@ -42,32 +41,55 @@ function TableRow(props, context) {
const {
classes,
className: classNameProp,
children,
component: Component,
hover,
selected
} = props,
other = _objectWithoutProperties(props, ['classes', 'className', 'children', 'component', 'hover', 'selected']);
other = _objectWithoutProperties(props, ['classes', 'className', 'component', 'hover', 'selected']);
const { table } = context;
const className = classNames(classes.root, {
[classes.head]: table && table.head,
[classes.footer]: table && table.footer,
[classes.typeHead]: table && table.head,
[classes.typeFooter]: table && table.footer,
[classes.hover]: table && hover,
[classes.selected]: table && selected
}, classNameProp);
return React.createElement(
Component,
_extends({ className: className }, other),
children
);
return React.createElement(Component, _extends({ className: className }, other));
}
TableRow.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* Should be valid `<tr>` children such as `TableCell`.
*/
children: PropTypes.node,
/**
* Useful to extend the style applied to components.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
*/
component: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
/**
* If `true`, the table row will shade on hover.
*/
hover: PropTypes.bool,
/**
* If `true`, the table row will have the selected shading.
*/
selected: PropTypes.bool
} : {};
TableRow.defaultProps = {
component: 'tr',
hover: false,
selected: false,
component: 'tr'
selected: false
};
TableRow.contextTypes = {