react-flexigrid
Version:
A React table component designed to allow presenting millions of rows of data.
46 lines (39 loc) • 1.54 kB
JavaScript
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { shallowEqual } from './utils';
var FlexiGridShadowRight = function (_React$Component) {
_inherits(FlexiGridShadowRight, _React$Component);
function FlexiGridShadowRight() {
_classCallCheck(this, FlexiGridShadowRight);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
FlexiGridShadowRight.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return !shallowEqual(this.props, nextProps);
};
FlexiGridShadowRight.prototype.render = function render() {
if (this.props.display) {
var className = classNames(this.props.prefixCls + '-shadow', 'right', {
visible: this.props.visible
});
var style = {
height: this.props.height,
right: this.props.right
};
return React.createElement('div', { className: className, style: style });
}
return null;
};
return FlexiGridShadowRight;
}(React.Component);
FlexiGridShadowRight.propTypes = {
prefixCls: PropTypes.string.isRequired,
visible: PropTypes.bool.isRequired,
display: PropTypes.bool.isRequired,
height: PropTypes.number.isRequired,
right: PropTypes.number.isRequired
};
export default FlexiGridShadowRight;