Completely updated React, fixed #11, (hopefully)
This commit is contained in:
77
goTorrentWebUI/node_modules/material-ui/Table/TableHead.js.flow
generated
vendored
77
goTorrentWebUI/node_modules/material-ui/Table/TableHead.js.flow
generated
vendored
@@ -1,49 +1,7 @@
|
||||
// @flow
|
||||
|
||||
import React from 'react';
|
||||
import type { ElementType, Node } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import withStyles from '../styles/withStyles';
|
||||
|
||||
export const styles = (theme: Object) => ({
|
||||
root: {
|
||||
fontSize: theme.typography.pxToRem(12),
|
||||
fontWeight: theme.typography.fontWeightMedium,
|
||||
color: theme.palette.text.secondary,
|
||||
},
|
||||
});
|
||||
|
||||
type ProvidedProps = {
|
||||
classes: Object,
|
||||
component: ElementType,
|
||||
};
|
||||
|
||||
export type Props = {
|
||||
/**
|
||||
* The content of the component, normally `TableRow`.
|
||||
*/
|
||||
children?: Node,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes?: Object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className?: string,
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a DOM element or a component.
|
||||
*/
|
||||
component?: ElementType,
|
||||
};
|
||||
|
||||
class TableHead extends React.Component<ProvidedProps & Props> {
|
||||
static defaultProps = {
|
||||
component: 'thead',
|
||||
};
|
||||
|
||||
class TableHead extends React.Component {
|
||||
getChildContext() {
|
||||
// eslint-disable-line class-methods-use-this
|
||||
return {
|
||||
@@ -54,25 +12,30 @@ class TableHead extends React.Component<ProvidedProps & Props> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
classes,
|
||||
className: classNameProp,
|
||||
children,
|
||||
component: ComponentProp,
|
||||
...other
|
||||
} = this.props;
|
||||
const className = classNames(classes.root, classNameProp);
|
||||
const { component: Component, ...other } = this.props;
|
||||
|
||||
return (
|
||||
<ComponentProp className={className} {...other}>
|
||||
{children}
|
||||
</ComponentProp>
|
||||
);
|
||||
return <Component {...other} />;
|
||||
}
|
||||
}
|
||||
|
||||
TableHead.propTypes = {
|
||||
/**
|
||||
* The content of the component, normally `TableRow`.
|
||||
*/
|
||||
children: PropTypes.node.isRequired,
|
||||
/**
|
||||
* 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]),
|
||||
};
|
||||
|
||||
TableHead.defaultProps = {
|
||||
component: 'thead',
|
||||
};
|
||||
|
||||
TableHead.childContextTypes = {
|
||||
table: PropTypes.object,
|
||||
};
|
||||
|
||||
export default withStyles(styles, { name: 'MuiTableHead' })(TableHead);
|
||||
export default TableHead;
|
||||
|
Reference in New Issue
Block a user