Completely updated React, fixed #11, (hopefully)
This commit is contained in:
285
goTorrentWebUI/node_modules/material-ui/Table/TablePagination.js
generated
vendored
285
goTorrentWebUI/node_modules/material-ui/Table/TablePagination.js
generated
vendored
@@ -37,14 +37,14 @@ var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _withStyles = require('../styles/withStyles');
|
||||
|
||||
var _withStyles2 = _interopRequireDefault(_withStyles);
|
||||
|
||||
var _IconButton = require('../IconButton');
|
||||
|
||||
var _IconButton2 = _interopRequireDefault(_IconButton);
|
||||
|
||||
var _Input = require('../Input');
|
||||
|
||||
var _Input2 = _interopRequireDefault(_Input);
|
||||
@@ -67,21 +67,14 @@ var _Typography = require('../Typography');
|
||||
|
||||
var _Typography2 = _interopRequireDefault(_Typography);
|
||||
|
||||
var _KeyboardArrowLeft = require('../svg-icons/KeyboardArrowLeft');
|
||||
var _TablePaginationActions = require('./TablePaginationActions');
|
||||
|
||||
var _KeyboardArrowLeft2 = _interopRequireDefault(_KeyboardArrowLeft);
|
||||
|
||||
var _KeyboardArrowRight = require('../svg-icons/KeyboardArrowRight');
|
||||
|
||||
var _KeyboardArrowRight2 = _interopRequireDefault(_KeyboardArrowRight);
|
||||
var _TablePaginationActions2 = _interopRequireDefault(_TablePaginationActions);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_Node = require('react').babelPluginFlowReactPropTypes_proptype_Node || require('prop-types').any;
|
||||
// @inheritedComponent TableCell
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_ElementType = require('react').babelPluginFlowReactPropTypes_proptype_ElementType || require('prop-types').any;
|
||||
|
||||
var styles = exports.styles = function styles(theme) {
|
||||
return {
|
||||
root: {
|
||||
@@ -102,19 +95,20 @@ var styles = exports.styles = function styles(theme) {
|
||||
flexShrink: 0
|
||||
},
|
||||
input: {
|
||||
fontSize: 'inherit'
|
||||
fontSize: 'inherit',
|
||||
flexShrink: 0
|
||||
},
|
||||
selectRoot: {
|
||||
marginRight: theme.spacing.unit * 4
|
||||
marginRight: theme.spacing.unit * 4,
|
||||
marginLeft: theme.spacing.unit,
|
||||
color: theme.palette.text.secondary
|
||||
},
|
||||
select: {
|
||||
marginLeft: theme.spacing.unit,
|
||||
width: 34,
|
||||
textAlign: 'right',
|
||||
paddingRight: 22,
|
||||
color: theme.palette.text.secondary,
|
||||
height: 32,
|
||||
lineHeight: '32px'
|
||||
paddingLeft: theme.spacing.unit,
|
||||
paddingRight: theme.spacing.unit * 2
|
||||
},
|
||||
selectIcon: {
|
||||
top: 1
|
||||
},
|
||||
actions: {
|
||||
flexShrink: 0,
|
||||
@@ -124,118 +118,24 @@ var styles = exports.styles = function styles(theme) {
|
||||
};
|
||||
};
|
||||
|
||||
var babelPluginFlowReactPropTypes_proptype_LabelDisplayedRowsArgs = {
|
||||
from: require('prop-types').number.isRequired,
|
||||
to: require('prop-types').number.isRequired,
|
||||
count: require('prop-types').number.isRequired,
|
||||
page: require('prop-types').number.isRequired
|
||||
};
|
||||
var babelPluginFlowReactPropTypes_proptype_Props = {
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: require('prop-types').object,
|
||||
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a DOM element or a component.
|
||||
*/
|
||||
component: typeof babelPluginFlowReactPropTypes_proptype_ElementType === 'function' ? babelPluginFlowReactPropTypes_proptype_ElementType : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_ElementType),
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
colSpan: require('prop-types').number,
|
||||
|
||||
/**
|
||||
* The total number of rows.
|
||||
*/
|
||||
count: require('prop-types').number.isRequired,
|
||||
|
||||
/**
|
||||
* Useful to customize the displayed rows label.
|
||||
*/
|
||||
labelDisplayedRows: require('prop-types').func,
|
||||
|
||||
/**
|
||||
* Useful to customize the rows per page label. Invoked with a `{ from, to, count, page }`
|
||||
* object.
|
||||
*/
|
||||
labelRowsPerPage: typeof babelPluginFlowReactPropTypes_proptype_Node === 'function' ? babelPluginFlowReactPropTypes_proptype_Node : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Node),
|
||||
|
||||
/**
|
||||
* Callback fired when the page is changed. Invoked with two arguments: the event and the
|
||||
* page to show.
|
||||
*/
|
||||
onChangePage: require('prop-types').func.isRequired,
|
||||
|
||||
/**
|
||||
* Callback fired when the number of rows per page is changed. Invoked with two arguments: the
|
||||
* event.
|
||||
*/
|
||||
onChangeRowsPerPage: require('prop-types').func.isRequired,
|
||||
|
||||
/**
|
||||
* The zero-based index of the current page.
|
||||
*/
|
||||
page: require('prop-types').number.isRequired,
|
||||
|
||||
/**
|
||||
* The number of rows per page.
|
||||
*/
|
||||
rowsPerPage: require('prop-types').number.isRequired,
|
||||
|
||||
/**
|
||||
* Customizes the options of the rows per page select field.
|
||||
*/
|
||||
rowsPerPageOptions: require('prop-types').arrayOf(require('prop-types').number),
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
theme: require('prop-types').object
|
||||
};
|
||||
|
||||
var _ref3 = _react2.default.createElement(_Input2.default, { disableUnderline: true });
|
||||
|
||||
var _ref4 = _react2.default.createElement(_KeyboardArrowRight2.default, null);
|
||||
|
||||
var _ref5 = _react2.default.createElement(_KeyboardArrowLeft2.default, null);
|
||||
|
||||
var _ref6 = _react2.default.createElement(_KeyboardArrowLeft2.default, null);
|
||||
|
||||
var _ref7 = _react2.default.createElement(_KeyboardArrowRight2.default, null);
|
||||
|
||||
/**
|
||||
* A `TableRow` based component for placing inside `TableFooter` for pagination.
|
||||
* A `TableCell` based component for placing inside `TableFooter` for pagination.
|
||||
*/
|
||||
|
||||
var TablePagination = function (_React$Component) {
|
||||
(0, _inherits3.default)(TablePagination, _React$Component);
|
||||
|
||||
function TablePagination() {
|
||||
var _ref;
|
||||
|
||||
var _temp, _this, _ret;
|
||||
|
||||
(0, _classCallCheck3.default)(this, TablePagination);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TablePagination.__proto__ || (0, _getPrototypeOf2.default)(TablePagination)).call.apply(_ref, [this].concat(args))), _this), _this.handleBackButtonClick = function (event) {
|
||||
_this.props.onChangePage(event, _this.props.page - 1);
|
||||
}, _this.handleNextButtonClick = function (event) {
|
||||
_this.props.onChangePage(event, _this.props.page + 1);
|
||||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
|
||||
return (0, _possibleConstructorReturn3.default)(this, (TablePagination.__proto__ || (0, _getPrototypeOf2.default)(TablePagination)).apply(this, arguments));
|
||||
}
|
||||
|
||||
(0, _createClass3.default)(TablePagination, [{
|
||||
key: 'componentWillReceiveProps',
|
||||
value: function componentWillReceiveProps(_ref2) {
|
||||
var count = _ref2.count,
|
||||
onChangePage = _ref2.onChangePage,
|
||||
rowsPerPage = _ref2.rowsPerPage;
|
||||
value: function componentWillReceiveProps(nextProps) {
|
||||
var count = nextProps.count,
|
||||
onChangePage = nextProps.onChangePage,
|
||||
rowsPerPage = nextProps.rowsPerPage;
|
||||
|
||||
var newLastPage = Math.max(0, Math.ceil(count / rowsPerPage) - 1);
|
||||
if (this.props.page > newLastPage) {
|
||||
@@ -246,25 +146,27 @@ var TablePagination = function (_React$Component) {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _props = this.props,
|
||||
Actions = _props.Actions,
|
||||
backIconButtonProps = _props.backIconButtonProps,
|
||||
classes = _props.classes,
|
||||
Component = _props.component,
|
||||
colSpanProp = _props.colSpan,
|
||||
Component = _props.component,
|
||||
count = _props.count,
|
||||
labelDisplayedRows = _props.labelDisplayedRows,
|
||||
labelRowsPerPage = _props.labelRowsPerPage,
|
||||
nextIconButtonProps = _props.nextIconButtonProps,
|
||||
onChangePage = _props.onChangePage,
|
||||
onChangeRowsPerPage = _props.onChangeRowsPerPage,
|
||||
page = _props.page,
|
||||
rowsPerPage = _props.rowsPerPage,
|
||||
rowsPerPageOptions = _props.rowsPerPageOptions,
|
||||
theme = _props.theme,
|
||||
other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'component', 'colSpan', 'count', 'labelDisplayedRows', 'labelRowsPerPage', 'onChangePage', 'onChangeRowsPerPage', 'page', 'rowsPerPage', 'rowsPerPageOptions', 'theme']);
|
||||
other = (0, _objectWithoutProperties3.default)(_props, ['Actions', 'backIconButtonProps', 'classes', 'colSpan', 'component', 'count', 'labelDisplayedRows', 'labelRowsPerPage', 'nextIconButtonProps', 'onChangePage', 'onChangeRowsPerPage', 'page', 'rowsPerPage', 'rowsPerPageOptions']);
|
||||
|
||||
|
||||
var colSpan = void 0;
|
||||
|
||||
if (Component === _TableCell2.default || Component === 'td') {
|
||||
colSpan = colSpanProp || 9001; // col-span over everything
|
||||
colSpan = colSpanProp || 1000; // col-span over everything
|
||||
}
|
||||
|
||||
return _react2.default.createElement(
|
||||
@@ -274,19 +176,25 @@ var TablePagination = function (_React$Component) {
|
||||
_Toolbar2.default,
|
||||
{ className: classes.toolbar },
|
||||
_react2.default.createElement('div', { className: classes.spacer }),
|
||||
_react2.default.createElement(
|
||||
rowsPerPageOptions.length > 1 && _react2.default.createElement(
|
||||
_Typography2.default,
|
||||
{ type: 'caption', className: classes.caption },
|
||||
{ variant: 'caption', className: classes.caption },
|
||||
labelRowsPerPage
|
||||
),
|
||||
_react2.default.createElement(
|
||||
rowsPerPageOptions.length > 1 && _react2.default.createElement(
|
||||
_Select2.default,
|
||||
{
|
||||
classes: { root: classes.selectRoot, select: classes.select },
|
||||
InputClasses: {
|
||||
root: classes.input
|
||||
classes: {
|
||||
root: classes.selectRoot,
|
||||
select: classes.select,
|
||||
icon: classes.selectIcon
|
||||
},
|
||||
input: _ref3,
|
||||
input: _react2.default.createElement(_Input2.default, {
|
||||
classes: {
|
||||
root: classes.input
|
||||
},
|
||||
disableUnderline: true
|
||||
}),
|
||||
value: rowsPerPage,
|
||||
onChange: onChangeRowsPerPage
|
||||
},
|
||||
@@ -300,7 +208,7 @@ var TablePagination = function (_React$Component) {
|
||||
),
|
||||
_react2.default.createElement(
|
||||
_Typography2.default,
|
||||
{ type: 'caption', className: classes.caption },
|
||||
{ variant: 'caption', className: classes.caption },
|
||||
labelDisplayedRows({
|
||||
from: count === 0 ? 0 : page * rowsPerPage + 1,
|
||||
to: Math.min(count, (page + 1) * rowsPerPage),
|
||||
@@ -308,23 +216,14 @@ var TablePagination = function (_React$Component) {
|
||||
page: page
|
||||
})
|
||||
),
|
||||
_react2.default.createElement(
|
||||
'div',
|
||||
{ className: classes.actions },
|
||||
_react2.default.createElement(
|
||||
_IconButton2.default,
|
||||
{ onClick: this.handleBackButtonClick, disabled: page === 0 },
|
||||
theme.direction === 'rtl' ? _ref4 : _ref5
|
||||
),
|
||||
_react2.default.createElement(
|
||||
_IconButton2.default,
|
||||
{
|
||||
onClick: this.handleNextButtonClick,
|
||||
disabled: page >= Math.ceil(count / rowsPerPage) - 1
|
||||
},
|
||||
theme.direction === 'rtl' ? _ref6 : _ref7
|
||||
)
|
||||
)
|
||||
_react2.default.createElement(Actions, {
|
||||
backIconButtonProps: backIconButtonProps,
|
||||
count: count,
|
||||
nextIconButtonProps: nextIconButtonProps,
|
||||
onChangePage: onChangePage,
|
||||
page: page,
|
||||
rowsPerPage: rowsPerPage
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -332,15 +231,85 @@ var TablePagination = function (_React$Component) {
|
||||
return TablePagination;
|
||||
}(_react2.default.Component);
|
||||
|
||||
TablePagination.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
/**
|
||||
* The component used for displaying the actions.
|
||||
* Either a string to use a DOM element or a component.
|
||||
*/
|
||||
Actions: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),
|
||||
/**
|
||||
* Properties applied to the back arrow `IconButton` component.
|
||||
*/
|
||||
backIconButtonProps: _propTypes2.default.object,
|
||||
/**
|
||||
* Useful to extend the style applied to components.
|
||||
*/
|
||||
classes: _propTypes2.default.object.isRequired,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
colSpan: _propTypes2.default.number,
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a DOM element or a component.
|
||||
*/
|
||||
component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),
|
||||
/**
|
||||
* The total number of rows.
|
||||
*/
|
||||
count: _propTypes2.default.number.isRequired,
|
||||
/**
|
||||
* Useful to customize the displayed rows label.
|
||||
*/
|
||||
labelDisplayedRows: _propTypes2.default.func,
|
||||
/**
|
||||
* Useful to customize the rows per page label. Invoked with a `{ from, to, count, page }`
|
||||
* object.
|
||||
*/
|
||||
labelRowsPerPage: _propTypes2.default.node,
|
||||
/**
|
||||
* Properties applied to the next arrow `IconButton` component.
|
||||
*/
|
||||
nextIconButtonProps: _propTypes2.default.object,
|
||||
/**
|
||||
* Callback fired when the page is changed.
|
||||
*
|
||||
* @param {object} event The event source of the callback
|
||||
* @param {number} page The page selected
|
||||
*/
|
||||
onChangePage: _propTypes2.default.func.isRequired,
|
||||
/**
|
||||
* Callback fired when the number of rows per page is changed.
|
||||
*
|
||||
* @param {object} event The event source of the callback
|
||||
*/
|
||||
onChangeRowsPerPage: _propTypes2.default.func,
|
||||
/**
|
||||
* The zero-based index of the current page.
|
||||
*/
|
||||
page: _propTypes2.default.number.isRequired,
|
||||
/**
|
||||
* The number of rows per page.
|
||||
*/
|
||||
rowsPerPage: _propTypes2.default.number.isRequired,
|
||||
/**
|
||||
* Customizes the options of the rows per page select field. If less than two options are
|
||||
* available, no select field will be displayed.
|
||||
*/
|
||||
rowsPerPageOptions: _propTypes2.default.array
|
||||
} : {};
|
||||
|
||||
TablePagination.defaultProps = {
|
||||
Actions: _TablePaginationActions2.default,
|
||||
component: _TableCell2.default,
|
||||
labelRowsPerPage: 'Rows per page:',
|
||||
labelDisplayedRows: function labelDisplayedRows(_ref8) {
|
||||
var from = _ref8.from,
|
||||
to = _ref8.to,
|
||||
count = _ref8.count;
|
||||
labelDisplayedRows: function labelDisplayedRows(_ref) {
|
||||
var from = _ref.from,
|
||||
to = _ref.to,
|
||||
count = _ref.count;
|
||||
return from + '-' + to + ' of ' + count;
|
||||
},
|
||||
labelRowsPerPage: 'Rows per page:',
|
||||
rowsPerPageOptions: [5, 10, 25]
|
||||
};
|
||||
exports.default = (0, _withStyles2.default)(styles, { withTheme: true, name: 'MuiTablePagination' })(TablePagination);
|
||||
|
||||
exports.default = (0, _withStyles2.default)(styles, { name: 'MuiTablePagination' })(TablePagination);
|
Reference in New Issue
Block a user