/*! For license information please see 7.273fddee.chunk.js.LICENSE.txt */ (this["webpackJsonpsimpro-web"]=this["webpackJsonpsimpro-web"]||[]).push([[7],{1682:function(e,t,n){"use strict";var r=n(745),a=n(737),o=n(607),c=n(733),l=n(184),i=n(185),s=n(188),u=n(186),d=n(187),f=n(2),p=n.n(f),h=n(1169),m=n.n(h),g=n(1170),v=n.n(g),y=n(1171),b=n.n(y),w=n(1172),E=n.n(w),S=n(817),O=n(814),A=n(815),j=n(827),x=n(828),T=n(783),k=n(816),C=n(757),R=n(792),N=n(793),M=n(806),L=n(819),P=n(807),F=n(812),_=(n(971),n(1173)),D=n.n(_),I=n(1082),G=n.n(I),J=n(938),Y=n(1934),B=(n(2128),n(665)),V=n.n(B),W=n(597),z=n.n(W);function H(){H=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(x){l=function(e,t,n){return e[t]=n}}function i(e,t,n,r){var a=t&&t.prototype instanceof d?t:d,o=Object.create(a.prototype),c=new O(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return j()}for(n.method=a,n.arg=o;;){var c=n.delegate;if(c){var l=w(c,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var i=s(e,t,n);if("normal"===i.type){if(r=n.done?"completed":"suspendedYield",i.arg===u)continue;return{value:i.arg,done:n.done}}"throw"===i.type&&(r="completed",n.method="throw",n.arg=i.arg)}}}(e,n,c),o}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(x){return{type:"throw",arg:x}}}e.wrap=i;var u={};function d(){}function f(){}function p(){}var h={};l(h,a,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(A([])));g&&g!==t&&n.call(g,a)&&(h=g);var v=p.prototype=d.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(a,o){function c(){return new t((function(r,c){!function r(a,o,c,l){var i=s(e[a],e,o);if("throw"!==i.type){var u=i.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,c,l)}),(function(e){r("throw",e,c,l)})):t.resolve(d).then((function(e){u.value=e,c(u)}),(function(e){return r("throw",e,c,l)}))}l(i.arg)}(a,o,r,c)}))}return r=r?r.then(c,c):c()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--a){var o=this.tryEntries[a],c=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),i=n.call(o,"finallyLoc");if(l&&i){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}var U=[{dataField:"id",text:"Id"}],Z=g.Search.SearchBar,$=g.CSVExport.ExportCSVButton,q=function(e){Object(u.a)(n,e);var t=Object(d.a)(n);function n(e){var i;Object(l.a)(this,n);var u=e.columns.reduce((function(e,t){return e[t.dataField]=t.state,e}),{});return(i=t.call(this,e)).getDataTable=function(){fetch(i.props.urlParamGet,{method:"POST",header:JSON.stringify({"Content-Type":"application/json"})}).then((function(e){return e.json()})).then((function(e){if("Success"===e.code_message){for(var t=[],n=0;n0)for(var n in e[0])t.push({dataField:n,text:n,sort:!0});this.setState({columns:0!==e.length?t:U,data:e})}},{key:"addNewData",value:function(){alert("add new data")}},{key:"render",value:function(){var e=this,t=this.state,n=t.columns,r=t.data,a=t.selectedRows,o=t.selectRow,c=t.editCellMode,l=t.alert,i=t.messageAlert,s=t.alertWarning,u=(t.deleteData,t.successAlert),d=t.dangerAlert;return p.a.createElement("div",{className:"animated fadeIn"},p.a.createElement(V.a,{show:l,success:u,danger:d,title:i,onConfirm:function(){return e.setState({alert:!1,successAlert:!1,dangerAlert:!1})}},i),p.a.createElement(V.a,{show:s,warning:!0,showCancel:!0,confirmBtnText:"Yes, delete it!",confirmBtnBsStyle:"danger",title:"Are you sure?",onConfirm:function(){return e.deleteFunction("delete")},onCancel:function(){return e.deleteFunction("cancel")},focusCancelBtn:!0},"This ",this.props.title," will be deleted"),p.a.createElement(R.a,null,p.a.createElement(N.a,{xl:12},p.a.createElement(M.a,null,p.a.createElement(L.a,null,p.a.createElement(R.a,null,p.a.createElement(N.a,{xl:6,xs:6},p.a.createElement("i",{className:"fa fa-align-justify"}),"Master ",void 0!==this.props.title?this.props.title:"DataTable"),p.a.createElement(N.a,{xl:6,xs:6},p.a.createElement("div",{className:"add-button-container"},p.a.createElement(C.a,{color:"primary",size:"sm",outline:!0,onClick:this.openModalAdd},p.a.createElement(F.Icon,{icon:G.a,width:15,height:15})," Add New Data"),this.modalAdd())))),p.a.createElement(P.a,null,0===r.length?p.a.createElement("div",null,"No result found"):p.a.createElement("div",null,p.a.createElement(v.a,{keyField:"id",data:r,columns:n,search:!0,exportCSV:!0},(function(t){return p.a.createElement("div",null,p.a.createElement(R.a,null,p.a.createElement(N.a,{xl:6,xs:6},p.a.createElement("div",{className:"search-bar-wrapper"},p.a.createElement(Z,t.searchProps))),p.a.createElement(N.a,{xl:6,xs:6},p.a.createElement("div",{className:"table-option-button-group pull-right"},p.a.createElement(R.a,null,p.a.createElement("div",{style:{paddingRight:5},className:"switch-button-upper clearfix"},p.a.createElement("small",null,p.a.createElement("b",null,"Edit")),p.a.createElement("br",null),p.a.createElement(J.l,{className:"float-right",variant:"pill",label:!0,color:"success",size:"sm",onChange:function(){return e.toggleEditCell()},checked:c})),p.a.createElement("div",{className:"clearfix"},a.length>0&&!c&&p.a.createElement(C.a,{onClick:function(){return e.setState({alertWarning:!0})},size:"sm",outline:!0,color:"danger"},p.a.createElement("i",{className:"cil-trash"})),p.a.createElement($,t.csvProps,p.a.createElement(C.a,{color:"success",size:"sm",outline:!0,id:"exportCSVTooltip"},p.a.createElement(F.Icon,{icon:D.a,width:20,height:20}))),p.a.createElement(Y.a,{placement:"top",target:"exportCSVTooltip"},"Export CSV")))))),p.a.createElement("div",{className:"table-wrapper"},c?p.a.createElement(m.a,Object.assign({},t.baseProps,{bootstrap4:!0,keyField:"id",hover:!0,pagination:b()(),noDataIndication:"No results found",selectRow:o,cellEdit:E()({mode:"click",blurToSave:!0,timeToCloseMessage:2500,errorMessage:"",afterSaveCell:function(t,n,r,a){return e.updateFunction(t,n,r,a)}})})):p.a.createElement(m.a,Object.assign({},t.baseProps,{bootstrap4:!0,keyField:"id",hover:!0,pagination:b()(),noDataIndication:"No results found",selectRow:o}))))}))))))))}}]),n}(f.Component);t.a=q},2128:function(e,t,n){},650:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n