react-flexigrid
Version:
A React table component designed to allow presenting millions of rows of data.
47 lines (39 loc) • 1.53 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 FlexiGridShadowLeft = function (_React$Component) {
_inherits(FlexiGridShadowLeft, _React$Component);
function FlexiGridShadowLeft() {
_classCallCheck(this, FlexiGridShadowLeft);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
FlexiGridShadowLeft.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return !shallowEqual(this.props, nextProps);
};
FlexiGridShadowLeft.prototype.render = function render() {
if (this.props.display) {
var className = classNames(this.props.prefixCls + '-shadow', 'left', {
visible: this.props.visible
});
var style = {
height: this.props.height,
left: this.props.left
};
return React.createElement('div', { className: className, style: style });
}
return null;
};
return FlexiGridShadowLeft;
}(React.Component);
FlexiGridShadowLeft.propTypes = {
prefixCls: PropTypes.string.isRequired,
visible: PropTypes.bool.isRequired,
display: PropTypes.bool.isRequired,
height: PropTypes.number.isRequired,
left: PropTypes.number.isRequired
};
export default FlexiGridShadowLeft;