text: (window.webpackJsonp=window.webpackJsonp||[]).push([[81],{1540:function(e,t,a){"use strict";a.r(t);var n=a(24),i=a.n(n),l=a(25),r=a.n(l),s=a(22),o=a.n(s),u=a(26),c=a.n(u),f=a(27),d=a.n(f),p=a(16),m=a.n(p),g=a(6),h=a.n(g),v=a(0),b=a.n(v),E=a(31),y=a(14),N=function(e,t,a){return{type:"FETCH_HOUSING_FILES",filters:e,sorts:t,pagination:a}},C=function(){return{type:"CLEAR_HOUSING_FILES"}},F=function(e){return{type:"SET_FILTER_HOUSING_FILE_DATE",createdAt:e}},P=function(e){return{type:"SET_FILTER_HOUSING_FILE_ADDRESS",address:e}},k=function(e){return{type:"SET_FILTER_HOUSING_FILE_FULL_NAME",fullName:e}},L=function(e){return{type:"SET_FILTER_HOUSING_FILE_BUILDING_TYPE",buildingTypeId:e}},_=function(e){return{type:"SET_FILTER_HOUSING_FILE_ENERGY_LABEL",energyLabelId:e}},S=function(){return{type:"CLEAR_FILTER_HOUSING_FILES"}},R=function(e){return{type:"SET_HOUSING_FILES_PAGINATION",pagination:e}},D=a(200),w=a.n(D),T=a(149),I=a(150),H=a(202),O=a(744),A=Object(E.b)(null,(function(e){return{setHousingFilesSortsFilter:function(t,a){e(function(e,t){return{type:"SET_HOUSING_FILES_SORTS_FILTER",field:e,order:t}}(t,a))}}}))((function(e){var t=function(t,a){e.setHousingFilesSortsFilter(t,a),setTimeout((function(){e.refreshHousingFilesData()}),100)};return b.a.createElement("tr",{className:"thead-title"},b.a.createElement(O.a,{sortColumn:"createdAt",title:"Datum",width:"20%",setSorts:t}),b.a.createElement(O.a,{sortColumn:"address",title:"Adres",width:"20%",setSorts:t}),b.a.createElement(O.a,{sortColumn:"fullName",title:"Contact",width:"10%",setSorts:t}),b.a.createElement(O.a,{sortColumn:"buildingType",title:"Type woning",width:"30%",setSorts:t}),b.a.createElement(O.a,{sortColumn:"energyLabel",title:"Energielabel",width:"15%",setSorts:t}),b.a.createElement("th",{width:"5%"}))})),x=a(7),M=a.n(x),j=a(752),B=Object(E.b)((function(e){return{filters:e.housingFiles.filters,energyLabels:e.systemData.energyLabels,buildingTypes:e.systemData.buildingTypes}}),(function(e){return Object(y.b)({setFilterBuildingType:L,clearFilterHousingFiles:S,setFilterFullName:k,setFilterHousingFileAddress:P,setFilterHousingFileEnergyLabel:_,setHousingFileDateFilter:F},e)}))((function(e){return b.a.createElement("tr",{className:"thead-filter"},b.a.createElement(j.a,{value:e.filters.createdAt.data&&e.filters.createdAt.data,onChangeAction:function(t){void 0===t?e.setHousingFileDateFilter(""):e.setHousingFileDateFilter(M()(t).format("Y-MM-DD"))}}),b.a.createElement("th",null,b.a.createElement("input",{type:"text",className:"form-control input-sm",value:e.filters.address.data,onChange:function(t){e.setFilterHousingFileAddress(t.target.value),setTimeout((function(){e.onSubmitFilter()}),100)}})),b.a.createElement("th",null,b.a.createElement("input",{type:"text",className:"form-control input-sm",value:e.filters.fullName.data,onChange:function(t){e.setFilterFullName(t.target.value)}})),b.a.createElement("th",null,b.a.createElement("select",{className:"form-control input-sm",value:e.filters.buildingTypeId.data,onChange:function(t){e.setFilterBuildingType(t.target.value),setTimeout((function(){e.onSubmitFilter()}),100)}},b.a.createElement("option",null),e.buildingTypes.map((function(e){return b.a.createElement("option",{key:e.id,value:e.id},e.name)})))),b.a.createElement("th",null,b.a.createElement("select",{className:"form-control input-sm",value:e.filters.energyLabelId.data,onChange:function(t){e.setFilterHousingFileEnergyLabel(t.target.value),setTimeout((function(){e.onSubmitFilter()}),100)}},b.a.createElement("option",null),e.energyLabels.map((function(e){return b.a.createElement("option",{key:e.id,value:e.id},e.name)})))),b.a.createElement("th",null))})),U=a(4);function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,n=m()(e);if(t){var i=m()(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return d()(this,a)}}var q=function(e){c()(a,e);var t=G(a);function a(e){var n;return i()(this,a),(n=t.call(this,e)).state={showActionButtons:!1,highlightRow:""},n}return r()(a,[{key:"onRowEnter",value:function(){this.setState({showActionButtons:!0,highlightRow:"highlight-row"})}},{key:"onRowLeave",value:function(){this.setState({showActionButtons:!1,highlightRow:""})}},{key:"openItem",value:function(e){U.f.push("/woningdossier/".concat(e))}},{key:"render",value:function(){var e=this,t=this.props,a=t.id,n=t.fullName,i=t.createdAt,l=t.fullAddress,r=t.buildingType,s=t.energyLabel;return b.a.createElement("tr",{className:this.state.highlightRow,onDoubleClick:function(){return e.openItem(a)},onMouseEnter:function(){return e.onRowEnter()},onMouseLeave:function(){return e.onRowLeave()}},b.a.createElement("td",null,M()(i).format("DD-MM-Y")),b.a.createElement("td",null,l),b.a.createElement("td",null,n),b.a.createElement("td",null,r||""),b.a.createElement("td",null,s||""),b.a.createElement("td",null,this.state.showActionButtons?b.a.createElement("a",{role:"button",onClick:function(){return e.openItem(a)}},b.a.createElement("span",{className:"glyphicon glyphicon-pencil mybtn-success"})," "):""))}}]),a}(v.Component),K=a(741);function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,n=m()(e);if(t){var i=m()(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return d()(this,a)}}var Y=function(e){c()(a,e);var t=W(a);function a(e){var n;return i()(this,a),n=t.call(this,e),h()(o()(n),"handleKeyUp",(function(e){13===e.keyCode&&n.props.onSubmitFilter()})),n}return r()(a,[{key:"render",value:function(){var e=this,t=this.props.housingFiles,a=t.data,n=void 0===a?[]:a,i=t.meta,l=void 0===i?{}:i,r="",s=!0;return this.props.hasError?r="Fout bij het ophalen van woningdossiers.":this.props.isLoading?r="Gegevens aan het laden.":0===n.length?r="Geen woningdossiers gevonden!":s=!1,b.a.createElement("form",{onKeyUp:this.handleKeyUp},b.a.createElement(T.a,null,b.a.createElement(I.a,null,b.a.createElement(A,{refreshHousingFilesData:function(){return e.props.refreshHousingFilesData()}}),b.a.createElement(B,{onSubmitFilter:this.props.onSubmitFilter})),b.a.createElement(H.a,null,s?b.a.createElement("tr",null,b.a.createElement("td",{colSpan:6},r)):n.map((function(e){return b.a.createElement(q,w()({key:e.id},e))})))),b.a.createElement("div",{className:"col-md-4 col-md-offset-4"},b.a.createElement(K.a,{onPageChangeAction:this.props.handlePageClick,totalRecords:l.total,initialPage:this.props.housingFilesPagination.page})))}}]),a}(v.Component),V=Object(E.b)((function(e){return{isLoading:e.loadingData.isLoading,hasError:e.loadingData.hasError}}))(Y),J=a(704),z=Object(E.b)((function(e){return{housingFiles:e.housingFiles.list}}),null)((function(e){var t=e.housingFiles.meta,a=void 0===t?{}:t;return b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-md-4"},b.a.createElement("div",{className:"btn-group",role:"group"},b.a.createElement(J.a,{iconName:"glyphicon-refresh",onClickAction:e.resetHousingFileFilters}))),b.a.createElement("div",{className:"col-md-4"},b.a.createElement("h3",{className:"text-center table-title"},"Woningdossiers")),b.a.createElement("div",{className:"col-md-4"},b.a.createElement("div",{className:"pull-right"},"Resultaten: ",a.total||0)))})),Q=a(748),X=a(702),Z=a(703);function $(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,n=m()(e);if(t){var i=m()(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return d()(this,a)}}var ee=function(e){c()(a,e);var t=$(a);function a(e){var n;return i()(this,a),n=t.call(this,e),h()(o()(n),"fetchHousingFilesData",(function(){setTimeout((function(){var e=Object(Q.a)(n.props.housingFilesFilters),t=n.props.housingFilesSorts,a={limit:20,offset:n.props.housingFilesPagination.offset};n.props.fetchHousingFiles(e,t,a)}),100)})),h()(o()(n),"resetHousingFileFilters",(function(){n.props.clearFilterHousingFiles(),n.fetchHousingFilesData()})),n.handlePageClick=n.handlePageClick.bind(o()(n)),n}return r()(a,[{key:"componentDidMount",value:function(){this.fetchHousingFilesData()}},{key:"componentWillUnmount",value:function(){this.props.clearHousingFiles()}},{key:"onSubmitFilter",value:function(){var e=this;Object(Q.a)(this.props.housingFilesFilters),this.props.housingFilesSorts;this.props.setHousingFilesPagination({page:0,offset:0}),setTimeout((function(){e.fetchHousingFilesData()}),100)}},{key:"handlePageClick",value:function(e){var t=this,a=e.selected,n=Math.ceil(20*a);this.props.setHousingFilesPagination({page:a,offset:n}),setTimeout((function(){t.fetchHousingFilesData()}),100)}},{key:"render",value:function(){var e=this;return b.a.createElement(X.a,null,b.a.createElement(Z.a,null,b.a.createElement("div",{className:"col-md-12 margin-10-top"},b.a.createElement(z,{resetHousingFileFilters:function(){return e.resetHousingFileFilters()}})),b.a.createElement("div",{className:"col-md-12 margin-10-top"},b.a.createElement(V,{housingFiles:this.props.housingFiles,housingFilesPagination:this.props.housingFilesPagination,onSubmitFilter:function(){return e.onSubmitFilter()},refreshHousingFilesData:function(){return e.fetchHousingFilesData()},handlePageClick:this.handlePageClick}))))}}]),a}(v.Component);t.default=Object(E.b)((function(e){return{housingFiles:e.housingFiles.list,housingFilesFilters:e.housingFiles.filters,housingFilesSorts:e.housingFiles.sorts,housingFilesPagination:e.housingFiles.pagination}}),(function(e){return Object(y.b)({fetchHousingFiles:N,clearHousingFiles:C,setHousingFilesPagination:R,clearFilterHousingFiles:S},e)}))(ee)},702:function(e,t,a){"use strict";var n=a(0),i=a.n(n),l=a(8),r=a.n(l),s=function(e){var t=e.children,a=e.className,n=e.onMouseEnter,l=e.onMouseLeave;return i.a.createElement("div",{className:"panel panel-default ".concat(a),onMouseEnter:n,onMouseLeave:l},t)};s.defaultProps={className:"",onMouseEnter:function(){},onMouseLeave:function(){}},s.propTypes={className:r.a.string,onMouseEnter:r.a.func,onMouseLeave:r.a.func},t.a=s},703:function(e,t,a){"use strict";var n=a(0),i=a.n(n),l=a(8),r=a.n(l),s=function(e){var t=e.className,a=e.children;return i.a.createElement("div",{className:"panel-body ".concat(t)},a)};s.defaultProps={className:""},s.propTypes={className:r.a.string},t.a=s},704:function(e,t,a){"use strict";var n=a(0),i=a.n(n),l=a(8),r=a.n(l),s=function(e){var t=e.buttonClassName,a=e.iconName,n=e.onClickAction,l=e.title,r=e.disabled;return i.a.createElement("button",{type:"button",className:"btn ".concat(t),onClick:n,disabled:r,title:l},i.a.createElement("span",{className:"glyphicon ".concat(a)}))};s.defaultProps={buttonClassName:"btn-success btn-sm",title:"",disabled:!1},s.propTypes={buttonClassName:r.a.string,iconName:r.a.string.isRequired,onClickAction:r.a.func,title:r.a.string,disabled:r.a.bool},t.a=s},741:function(e,t,a){"use strict";var n=a(0),i=a.n(n),l=a(8),r=a.n(l),s=a(742),o=a.n(s),u=function(e){var t=e.onPageChangeAction,a=e.initialPage,n=e.recordsPerPage,l=e.totalRecords;return i.a.createElement(o.a,{onPageChange:t,pageCount:Math.ceil(l/n)||1,pageRangeDisplayed:5,marginPagesDisplayed:2,breakLabel:i.a.createElement("a",null,"..."),breakClassName:"break-me",containerClassName:"pagination",activeClassName:"active",previousLabel:i.a.createElement("span",{"aria-hidden":"true"},"«"),nextLabel:i.a.createElement("span",{"aria-hidden":"true"},"»"),initialPage:a||0,forcePage:a,disableInitialCallback:!0})};u.defaultProps={recordsPerPage:20},u.propTypes={initialPage:r.a.number.isRequired,recordsPerPage:r.a.number,totalRecords:r.a.number,onPageChangeAction:r.a.func.isRequired},t.a=u},742:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=a(745),l=(n=i)&&n.__esModule?n:{default:n};t.default=l.default},744:function(e,t,a){"use strict";var n=a(0),i=a.n(n),l=a(8),r=a.n(l),s=function(e){var t=e.RowClassName,a=e.setSorts,n=e.sortColumn,l=e.title,r=e.width;return i.a.createElement("th",{className:t,width:r},l,i.a.createElement("span",{className:"glyphicon glyphicon-arrow-down pull-right small",role:"button",onClick:a.bind(void 0,n,"ASC")}),i.a.createElement("span",{className:"glyphicon glyphicon-arrow-up pull-right small",role:"button",onClick:a.bind(void 0,n,"DESC")}))};s.defaultProps={RowClassName:""},s.propTypes={setSorts:r.a.func.isRequired,sortColumn:r.a.string.isRequired,title:r.a.string.isRequired,width:r.a.string.isRequired,RowClassName:r.a.string},t.a=s},745:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=a(0),l=u(i),r=u(a(8)),s=u(a(746)),o=u(a(747));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.handlePreviousPage=function(e){var t=a.state.selected;e.preventDefault?e.preventDefault():e.returnValue=!1,t>0&&a.handlePageSelected(t-1,e)},a.handleNextPage=function(e){var t=a.state.selected,n=a.props.pageCount;e.preventDefault?e.preventDefault():e.returnValue=!1,t<n-1&&a.handlePageSelected(t+1,e)},a.handlePageSelected=function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1,a.state.selected!==e&&(a.setState({selected:e}),a.callCallback(e))},a.callCallback=function(e){void 0!==a.props.onPageChange&&"function"==typeof a.props.onPageChange&&a.props.onPageChange({selected:e})},a.pagination=function(){var e=[],t=a.props,n=t.pageRangeDisplayed,i=t.pageCount,r=t.marginPagesDisplayed,s=t.breakLabel,u=t.breakClassName,c=a.state.selected;if(i<=n)for(var f=0;f<i;f++)e.push(a.getPageElement(f));else{var d=n/2,p=n-d;c>i-n/2?d=n-(p=i-c):c<n/2&&(p=n-(d=c));var m=void 0,g=void 0,h=void 0,v=function(e){return a.getPageElement(e)};for(m=0;m<i;m++)(g=m+1)<=r||g>i-r||m>=c-d&&m<=c+p?e.push(v(m)):s&&e[e.length-1]!==h&&(h=l.default.createElement(o.default,{key:m,breakLabel:s,breakClassName:u}),e.push(h))}return e},a.state={selected:e.initialPage?e.initialPage:e.forcePage?e.forcePage:0},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.initialPage,a=e.disableInitialCallback;void 0===t||a||this.callCallback(t)}},{key:"componentWillReceiveProps",value:function(e){void 0!==e.forcePage&&this.props.forcePage!==e.forcePage&&this.setState({selected:e.forcePage})}},{key:"hrefBuilder",value:function(e){var t=this.props,a=t.hrefBuilder,n=t.pageCount;if(a&&e!==this.state.selected&&e>=0&&e<n)return a(e+1)}},{key:"getPageElement",value:function(e){var t=this.state.selected,a=this.props,n=a.pageClassName,i=a.pageLinkClassName,r=a.activeClassName,o=a.activeLinkClassName,u=a.extraAriaContext;return l.default.createElement(s.default,{key:e,onClick:this.handlePageSelected.bind(null,e),selected:t===e,pageClassName:n,pageLinkClassName:i,activeClassName:r,activeLinkClassName:o,extraAriaContext:u,href:this.hrefBuilder(e),page:e+1})}},{key:"render",value:function(){var e=this.props,t=e.disabledClassName,a=e.previousClassName,n=e.nextClassName,i=e.pageCount,r=e.containerClassName,s=e.previousLinkClassName,o=e.previousLabel,u=e.nextLinkClassName,c=e.nextLabel,f=this.state.selected,d=a+(0===f?" "+t:""),p=n+(f===i-1?" "+t:"");return l.default.createElement("ul",{className:r},l.default.createElement("li",{className:d},l.default.createElement("a",{onClick:this.handlePreviousPage,className:s,href:this.hrefBuilder(f-1),tabIndex:"0",role:"button",onKeyPress:this.handlePreviousPage},o)),this.pagination(),l.default.createElement("li",{className:p},l.default.createElement("a",{onClick:this.handleNextPage,className:u,href:this.hrefBuilder(f+1),tabIndex:"0",role:"button",onKeyPress:this.handleNextPage},c)))}}]),t}(i.Component);c.propTypes={pageCount:r.default.number.isRequired,pageRangeDisplayed:r.default.number.isRequired,marginPagesDisplayed:r.default.number.isRequired,previousLabel:r.default.node,nextLabel:r.default.node,breakLabel:r.default.node,hrefBuilder:r.default.func,onPageChange:r.default.func,initialPage:r.default.number,forcePage:r.default.number,disableInitialCallback:r.default.bool,containerClassName:r.default.string,pageClassName:r.default.string,pageLinkClassName:r.default.string,activeClassName:r.default.string,activeLinkClassName:r.default.string,previousClassName:r.default.string,nextClassName:r.default.string,previousLinkClassName:r.default.string,nextLinkClassName:r.default.string,disabledClassName:r.default.string,breakClassName:r.default.string},c.defaultProps={pageCount:10,pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousClassName:"previous",nextClassName:"next",previousLabel:"Previous",nextLabel:"Next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1},t.default=c},746:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=a(0),l=(n=i)&&n.__esModule?n:{default:n};t.default=function(e){var t=e.pageClassName,a=e.pageLinkClassName,n=e.onClick,i=e.href,r="Page "+e.page+(e.extraAriaContext?" "+e.extraAriaContext:""),s=null;return e.selected&&(s="page",r="Page "+e.page+" is your current page",t=void 0!==t?t+" "+e.activeClassName:e.activeClassName,void 0!==a?(a=a,void 0!==e.activeLinkClassName&&(a=a+" "+e.activeLinkClassName)):a=e.activeLinkClassName),l.default.createElement("li",{className:t},l.default.createElement("a",{onClick:n,role:"button",className:a,href:i,tabIndex:"0","aria-label":r,"aria-current":s,onKeyPress:n},e.page))}},747:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=a(0),l=(n=i)&&n.__esModule?n:{default:n};t.default=function(e){var t=e.breakLabel,a=e.breakClassName||"break";return l.default.createElement("li",{className:a},t)}},748:function(e,t,a){"use strict";t.a=function(e){var t=[];for(var a in e)""!==e[a].data&&t.push(e[a]);return t}},752:function(e,t,a){"use strict";var n=a(0),i=a.n(n),l=a(8),r=a.n(l),s=a(724),o=a.n(s),u=a(725),c=a.n(u),f=a(7),d=a.n(f);d.a.locale("nl");var p=function(e){var t=e.className,a=e.value,n=e.onChangeAction,l=e.placeholder,r=a?d()(a).format("L"):"";return i.a.createElement("th",{className:"DayPicker-overflow ".concat(t)},i.a.createElement(o.a,{value:r,onDayChange:n,formatDate:u.formatDate,parseDate:u.parseDate,dayPickerProps:{showWeekNumbers:!0,locale:"nl",firstDayOfWeek:1,localeUtils:c.a},inputProps:{className:"form-control input-sm",placeholder:l},placeholder:""}))};p.defaultProps={className:"",value:null,placeholder:""},p.propTypes={className:r.a.string,value:r.a.oneOfType([r.a.string,r.a.object]),onChangeAction:r.a.func,placeholder:r.a.string},t.a=p}}]);