"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=exports.propTypes=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_objectSpread2=_interopRequireDefault(require("@babel/runtime/helpers/objectSpread")),_react=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_classnames=_interopRequireDefault(require("classnames")),_componentHelper=require("../../shared/component-helper"),renderProps={render_content:null},propTypes={style:_propTypes.default.string,style_type:_propTypes.default.string,spacing:_propTypes.default.string,class:_propTypes.default.string,className:_propTypes.default.string,children:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.func,_propTypes.default.node]),render_content:_propTypes.default.func};exports.propTypes=propTypes;var defaultProps=(0,_objectSpread2.default)({style:null,style_type:"mint-green-12",class:null,className:null,children:null},renderProps);exports.defaultProps=defaultProps;var Section=function(e){function i(){return(0,_classCallCheck2.default)(this,i),(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(i).apply(this,arguments))}return(0,_inherits2.default)(i,e),(0,_createClass2.default)(i,[{key:"render",value:function(){var e=this.props,t=e.style,r=e.style_type,p=e.spacing,s=e.className,n=e.class,o=(0,_objectWithoutProperties2.default)(e,["style","style_type","spacing","className","class"]),l=i.getContent(this.props),a=(0,_objectSpread2.default)({className:(0,_classnames.default)("dnb-section","dnb-section--".concat("string"==typeof t?t:r),((0,_componentHelper.isTrue)(p)||p)&&"dnb-section--spacing".concat(/true|false/.test(String(p))?"":"-"+p),s,n)},o);return(0,_componentHelper.validateDOMAttributes)(this.props,a),_react.default.createElement("section",a,l)}}],[{key:"enableWebComponent",value:function(){(0,_componentHelper.registerElement)(i.tagName,i,defaultProps)}},{key:"getContent",value:function(e){return e.text?e.text:("function"==typeof e.render_content&&e.render_content(e),(0,_componentHelper.processChildren)(e))}}]),i}(_react.PureComponent);exports.default=Section,(0,_defineProperty2.default)(Section,"tagName","dnb-section"),(0,_defineProperty2.default)(Section,"defaultProps",defaultProps),Section.propTypes="production"!==process.env.NODE_ENV?propTypes:{};
//# sourceMappingURL=Section.js.map
