UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

50 lines 2.49 kB
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; const _excluded = ["displayName", "title", "hash", "selected", "disabled", "className"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { spacingPropTypes, createSpacingClasses } from '../space/SpacingHelper'; import ContentWrapper from './TabsContentWrapper'; export default class CustomContent extends React.PureComponent { render() { const _this$props = this.props, { displayName, title, hash, selected, disabled, className } = _this$props, rest = _objectWithoutProperties(_this$props, _excluded); if (this.props.id) { return React.createElement(ContentWrapper, rest); } return React.createElement("div", { className: classnames('dnb-tabs__content__inner', createSpacingClasses(rest), className) }, this.props.children); } } _defineProperty(CustomContent, "defaultProps", { displayName: 'CustomContent', title: null, hash: null, selected: null, disabled: null, children: null, className: null }); process.env.NODE_ENV !== "production" ? CustomContent.propTypes = _objectSpread(_objectSpread({ displayName: PropTypes.string, title: PropTypes.oneOfType([PropTypes.object, PropTypes.node, PropTypes.func]), hash: PropTypes.string, selected: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]), disabled: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]) }, spacingPropTypes), {}, { children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), className: PropTypes.string }) : void 0; //# sourceMappingURL=TabsCustomContent.js.map