UNPKG

react-flexigrid

Version:

A React table component designed to allow presenting millions of rows of data.

48 lines (39 loc) 1.55 kB
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 FlexiGridShadowBottom = function (_React$Component) { _inherits(FlexiGridShadowBottom, _React$Component); function FlexiGridShadowBottom() { _classCallCheck(this, FlexiGridShadowBottom); return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); } FlexiGridShadowBottom.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { return !shallowEqual(this.props, nextProps); }; FlexiGridShadowBottom.prototype.render = function render() { if (this.props.display) { var className = classNames(this.props.prefixCls + '-shadow', 'bottom', { visible: this.props.visible }); var style = { width: this.props.width, bottom: this.props.bottom }; return React.createElement('div', { className: className, style: style }); } return null; }; return FlexiGridShadowBottom; }(React.Component); FlexiGridShadowBottom.propTypes = { prefixCls: PropTypes.string.isRequired, display: PropTypes.bool.isRequired, visible: PropTypes.bool.isRequired, bottom: PropTypes.number.isRequired, width: PropTypes.number.isRequired }; export default FlexiGridShadowBottom;