Completely updated React, fixed #11, (hopefully)
This commit is contained in:
75
goTorrentWebUI/node_modules/material-ui/Table/Table.js.flow
generated
vendored
75
goTorrentWebUI/node_modules/material-ui/Table/Table.js.flow
generated
vendored
@@ -1,12 +1,9 @@
|
||||
// @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) => ({
|
||||
export const styles = theme => ({
|
||||
root: {
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
width: '100%',
|
||||
@@ -16,36 +13,7 @@ export const styles = (theme: Object) => ({
|
||||
},
|
||||
});
|
||||
|
||||
type ProvidedProps = {
|
||||
classes: Object,
|
||||
component: ElementType,
|
||||
};
|
||||
|
||||
export type Props = {
|
||||
/**
|
||||
* The content of the table, normally `TableHeader` and `TableBody`.
|
||||
*/
|
||||
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 Table extends React.Component<ProvidedProps & Props> {
|
||||
static defaultProps = {
|
||||
component: 'table',
|
||||
};
|
||||
|
||||
class Table extends React.Component {
|
||||
getChildContext() {
|
||||
// eslint-disable-line class-methods-use-this
|
||||
return {
|
||||
@@ -54,23 +22,36 @@ class Table extends React.Component<ProvidedProps & Props> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
classes,
|
||||
className: classNameProp,
|
||||
children,
|
||||
component: ComponentProp,
|
||||
...other
|
||||
} = this.props;
|
||||
const className = classNames(classes.root, classNameProp);
|
||||
const { classes, className: classNameProp, component: Component, ...other } = this.props;
|
||||
|
||||
return (
|
||||
<ComponentProp className={className} {...other}>
|
||||
{children}
|
||||
</ComponentProp>
|
||||
);
|
||||
return <Component className={classNames(classes.root, classNameProp)} {...other} />;
|
||||
}
|
||||
}
|
||||
|
||||
Table.propTypes = {
|
||||
/**
|
||||
* The content of the table, normally `TableHeader` and `TableBody`.
|
||||
*/
|
||||
children: PropTypes.node.isRequired,
|
||||
/**
|
||||
* 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]),
|
||||
};
|
||||
|
||||
Table.defaultProps = {
|
||||
component: 'table',
|
||||
};
|
||||
|
||||
Table.childContextTypes = {
|
||||
table: PropTypes.object,
|
||||
};
|
||||
|
Reference in New Issue
Block a user