/*! For license information please see 55.b5167c43.chunk.js.LICENSE.txt */ (this["webpackJsonpsimpro-web"]=this["webpackJsonpsimpro-web"]||[]).push([[55],{1597:function(e,t,n){"use strict";var r=n(730),a=n(721),o=n(601),c=n(723),l=n(184),i=n(185),s=n(188),u=n(187),d=n(186),f=n(2),p=n.n(f),h=n(1099),m=n.n(h),g=n(1100),v=n.n(g),y=n(1101),b=n.n(y),w=n(1102),E=n.n(w),S=n(793),O=n(788),j=n(789),A=n(813),x=n(814),k=n(760),T=n(790),C=n(990),R=n(772),N=n(773),P=n(779),L=n(791),M=n(780),F=n(777),I=(n(940),n(1103)),_=n.n(I),D=n(1034),G=n.n(D),J=n(904),B=n(1902),Y=(n(1598),n(654)),V=n.n(Y),W=n(594),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 A()}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(j([])));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 j(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:j(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(P.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(M.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:_.a,width:20,height:20}))),p.a.createElement(B.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},1598:function(e,t,n){},2270:function(e,t,n){"use strict";n.r(t);var r=n(184),a=n(185),o=n(187),c=n(186),l=n(2),i=n.n(l),s=n(1597),u=[{id:0,name:"Item name 0",price:2100},{id:1,name:"Item name 1",price:2101},{id:2,name:"Item name 2",price:2102},{id:3,name:"Item name 3",price:2103}],d=function(e){Object(o.a)(n,e);var t=Object(c.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){return i.a.createElement("div",null,i.a.createElement(s.a,{title:"Base Layers",data:u}))}}]),n}(l.Component);t.default=d},561:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},643: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