@atlaskit/dynamic-table
Version:
A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.
41 lines (39 loc) • 2.34 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
var _excluded = ["isRanking", "refHeight", "refWidth"];
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
import React from 'react';
import withDimensions from '../../hoc/with-dimensions';
import { inlineStylesIfRanking } from '../../internal/inline-styles-if-ranking';
import HeadCell from '../table-head-cell';
// eslint-disable-next-line @repo/internal/react/no-class-components
var RankableTableHeadCellComponent = /*#__PURE__*/function (_React$Component) {
function RankableTableHeadCellComponent() {
_classCallCheck(this, RankableTableHeadCellComponent);
return _callSuper(this, RankableTableHeadCellComponent, arguments);
}
_inherits(RankableTableHeadCellComponent, _React$Component);
return _createClass(RankableTableHeadCellComponent, [{
key: "render",
value: function render() {
var _this$props = this.props,
isRanking = _this$props.isRanking,
refHeight = _this$props.refHeight,
refWidth = _this$props.refWidth,
restProps = _objectWithoutProperties(_this$props, _excluded);
var inlineStyles = inlineStylesIfRanking(isRanking, refWidth);
return /*#__PURE__*/React.createElement(HeadCell, _extends({
inlineStyles: inlineStyles
}, restProps));
}
}]);
}(React.Component);
var RankableTableHeadCell = withDimensions(RankableTableHeadCellComponent);
// eslint-disable-next-line @repo/internal/react/require-jsdoc
export default RankableTableHeadCell;