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