"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 _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")),_componentHelper=require("../../shared/component-helper"),_Button=_interopRequireDefault(require("../../components/button/Button")),renderProps={render_left_content:null,render_right_content:null},propTypes={prev_href:_propTypes.default.string,next_href:_propTypes.default.string,prev_text:_propTypes.default.string,next_text:_propTypes.default.string,prev_title:_propTypes.default.string,next_title:_propTypes.default.string,class:_propTypes.default.string,className:_propTypes.default.string,children:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.node,_propTypes.default.func]),render_left_content:_propTypes.default.func,render_right_content:_propTypes.default.func};exports.propTypes=propTypes;var defaultProps=(0,_objectSpread2.default)({prev_href:null,next_href:null,prev_text:"Back",next_text:"Next",prev_title:"Go back",next_title:"Go next",class:null,className:null,children:null},renderProps);exports.defaultProps=defaultProps;var SummaryTable=function(e){function c(){return(0,_classCallCheck2.default)(this,c),(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(c).apply(this,arguments))}return(0,_inherits2.default)(c,e),(0,_createClass2.default)(c,[{key:"render",value:function(){var e=this.props,t=e.prev_href,r=e.next_href,n=e.prev_text,a=e.next_text,l=e.prev_title,p=e.next_title,u=e.className,o=e.class,s=c.getLeftContent(this.props),i=c.getRightContent(this.props),_={className:"dnb-summary-table ".concat(u||o||"")};return(0,_componentHelper.validateDOMAttributes)(this.props,_),_react.default.createElement("div",_,_react.default.createElement("div",{className:"dnb-width-limit"},_react.default.createElement("div",{className:"dnb-summary-table__inner"},s&&_react.default.createElement("div",{className:"dnb-summary-table__left"},s)||_react.default.createElement("div",{className:"dnb-summary-table__left"},t&&_react.default.createElement("div",{className:"dnb-summary-table__item"},_react.default.createElement(_Button.default,{type:"button",text:n,title:l,variant:"secondary",icon_position:"left",icon:"chevron_left",href:t})),r&&_react.default.createElement("div",{className:"dnb-summary-table__item"},_react.default.createElement(_Button.default,{text:a,title:p,variant:"primary",icon:"chevron_right",href:r}))),i&&_react.default.createElement("div",{className:"dnb-summary-table__right"},i))))}}],[{key:"enableWebComponent",value:function(){(0,_componentHelper.registerElement)(c.tagName,c,defaultProps)}},{key:"getLeftContent",value:function(e){return"function"==typeof e.render_left_content?e.render_left_content(e):null}},{key:"getRightContent",value:function(e){return"function"==typeof e.render_right_content?e.render_right_content(e):(0,_componentHelper.processChildren)(e)}}]),c}(_react.PureComponent);exports.default=SummaryTable,(0,_defineProperty2.default)(SummaryTable,"tagName","dnb-summary-table"),(0,_defineProperty2.default)(SummaryTable,"defaultProps",defaultProps),SummaryTable.propTypes="production"!==process.env.NODE_ENV?propTypes:{};
//# sourceMappingURL=SummaryTable.js.map
