UNPKG

@atlaskit/dynamic-table

Version:

A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.

52 lines 2.6 kB
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"; import _defineProperty from "@babel/runtime/helpers/defineProperty"; 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 Spinner from '@atlaskit/spinner/spinner'; import { Container } from '../styled/container'; import { ContentsContainer } from '../styled/contents-container'; import { SpinnerContainer } from '../styled/spinner-container'; // eslint-disable-next-line @repo/internal/react/no-class-components var LoadingContainer = /*#__PURE__*/function (_React$Component) { function LoadingContainer() { _classCallCheck(this, LoadingContainer); return _callSuper(this, LoadingContainer, arguments); } _inherits(LoadingContainer, _React$Component); return _createClass(LoadingContainer, [{ key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, isLoading = _this$props.isLoading, spinnerSize = _this$props.spinnerSize, contentsOpacity = _this$props.contentsOpacity, testId = _this$props.testId, loadingLabel = _this$props.loadingLabel; return /*#__PURE__*/React.createElement(Container, { testId: testId }, !isLoading ? children : /*#__PURE__*/React.createElement(ContentsContainer, { contentsOpacity: contentsOpacity, testId: testId }, children), isLoading && /*#__PURE__*/React.createElement(SpinnerContainer, { testId: testId }, /*#__PURE__*/React.createElement(Spinner, { size: spinnerSize, testId: testId && "".concat(testId, "--loadingSpinner"), label: loadingLabel }))); } }]); }(React.Component); _defineProperty(LoadingContainer, "defaultProps", { isLoading: true, spinnerSize: 'large', contentsOpacity: 0.22, loadingLabel: 'Loading table' }); export { LoadingContainer as default };