/*! For license information please see 54.8883c6e3.chunk.js.LICENSE.txt */ (this["webpackJsonpsimpro-web"]=this["webpackJsonpsimpro-web"]||[]).push([[54],{1638:function(e,t,n){"use strict";var r=n(736),o=n(723),a=n(604),i=n(726),c=n(184),s=n(185),l=n(188),u=n(186),d=n(187),f=n(2),p=n.n(f),h=n(1127),m=n.n(h),v=n(1128),g=n.n(v),y=n(1129),b=n.n(y),w=n(1130),E=n.n(w),O=n(813),j=n(807),S=n(808),x=n(826),A=n(827),L=n(774),_=n(809),C=n(1013),T=n(785),k=n(786),R=n(789),N=n(810),P=n(790),M=n(788),F=(n(955),n(1131)),I=n.n(F),D=n(1057),G=n.n(D),J=n(919),B=n(1979),W=(n(1639),n(662)),Y=n.n(W),V=n(596),z=n.n(V);function U(){U=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(A){c=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),i=new j(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return x()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,n);if(c){if(c===u)continue;return c}}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 s=l(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=s;var u={};function d(){}function f(){}function p(){}var h={};c(h,o,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==t&&n.call(v,o)&&(h=v);var g=p.prototype=d.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(o,a){function i(){return new t((function(r,i){!function r(o,a,i,c){var s=l(e[o],e,a);if("throw"!==s.type){var u=s.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(d).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(s.arg)}(o,a,r,i)}))}return r=r?r.then(i,i):i()}}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=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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 o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}var H=[{dataField:"id",text:"Id"}],K=v.Search.SearchBar,Z=v.CSVExport.ExportCSVButton,$=function(e){Object(u.a)(n,e);var t=Object(d.a)(n);function n(e){var s;Object(c.a)(this,n);var u=e.columns.reduce((function(e,t){return e[t.dataField]=t.state,e}),{});return(s=t.call(this,e)).getDataTable=function(){fetch(s.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:H,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,o=t.selectedRows,a=t.selectRow,i=t.editCellMode,c=t.alert,s=t.messageAlert,l=t.alertWarning,u=(t.deleteData,t.successAlert),d=t.dangerAlert;return p.a.createElement("div",{className:"animated fadeIn"},p.a.createElement(Y.a,{show:c,success:u,danger:d,title:s,onConfirm:function(){return e.setState({alert:!1,successAlert:!1,dangerAlert:!1})}},s),p.a.createElement(Y.a,{show:l,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(T.a,null,p.a.createElement(k.a,{xl:12},p.a.createElement(R.a,null,p.a.createElement(N.a,null,p.a.createElement(T.a,null,p.a.createElement(k.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(k.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(M.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(g.a,{keyField:"id",data:r,columns:n,search:!0,exportCSV:!0},(function(t){return p.a.createElement("div",null,p.a.createElement(T.a,null,p.a.createElement(k.a,{xl:6,xs:6},p.a.createElement("div",{className:"search-bar-wrapper"},p.a.createElement(K,t.searchProps))),p.a.createElement(k.a,{xl:6,xs:6},p.a.createElement("div",{className:"table-option-button-group pull-right"},p.a.createElement(T.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:i})),p.a.createElement("div",{className:"clearfix"},o.length>0&&!i&&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(Z,t.csvProps,p.a.createElement(C.a,{color:"success",size:"sm",outline:!0,id:"exportCSVTooltip"},p.a.createElement(M.Icon,{icon:I.a,width:20,height:20}))),p.a.createElement(B.a,{placement:"top",target:"exportCSVTooltip"},"Export CSV")))))),p.a.createElement("div",{className:"table-wrapper"},i?p.a.createElement(m.a,Object.assign({},t.baseProps,{bootstrap4:!0,keyField:"id",hover:!0,pagination:b()(),noDataIndication:"No results found",selectRow:a,cellEdit:E()({mode:"click",blurToSave:!0,timeToCloseMessage:2500,errorMessage:"",afterSaveCell:function(t,n,r,o){return e.updateFunction(t,n,r,o)}})})):p.a.createElement(m.a,Object.assign({},t.baseProps,{bootstrap4:!0,keyField:"id",hover:!0,pagination:b()(),noDataIndication:"No results found",selectRow:a}))))}))))))))}}]),n}(f.Component);t.a=$},1639:function(e,t,n){},2497:function(e,t,n){"use strict";n.r(t);var r=n(184),o=n(185),a=n(186),i=n(187),c=n(2),s=n.n(c),l=n(1638),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(a.a)(n,e);var t=Object(i.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){return s.a.createElement("div",null,s.a.createElement(l.a,{title:"Base Layers",data:u}))}}]),n}(c.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}))},646: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);n0&&i.length>o&&!i.warned){i.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=i.length,c=s,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"===typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var s=o[e];if(void 0===s)return!1;if("function"===typeof s)a(s,this,t);else{var l=s.length,u=v(s,l);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){i=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},c.prototype.listeners=function(e){return h(this,e,!0)},c.prototype.rawListeners=function(e){return h(this,e,!1)},c.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},c.prototype.listenerCount=m,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}]);