@adins/ucsearch 2.2.43 → 2.2.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common/http"),require("@angular/platform-browser"),require("file-saver"),require("xlsx"),require("@angular/animations"),require("ngx-toastr"),require("ngx-cookie"),require("crypto-js"),require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-currency"),require("@ngx-translate/core"),require("@adins/uc-show-errors"),require("@adins/uc-directive-upper-case")):"function"==typeof define&&define.amd?define("@adins/ucsearch",["exports","@angular/common/http","@angular/platform-browser","file-saver","xlsx","@angular/animations","ngx-toastr","ngx-cookie","crypto-js","@angular/core","@angular/common","@angular/forms","ngx-currency","@ngx-translate/core","@adins/uc-show-errors","@adins/uc-directive-upper-case"],t):t((e.adins=e.adins||{},e.adins.ucsearch={}),e.ng.common.http,e.ng.platformBrowser,e.FileSaver,e.XLSX,e.ng.animations,e.ngxToastr,e.ngxCookie,e.CryptoJS,e.ng.core,e.ng.common,e.ng.forms,e.ngxCurrency,e.core,e.ucShowErrors,e.ucDirectiveUpperCase)}(this,function(e,t,n,i,o,r,a,s,l,u,f,c,d,p,m,h){"use strict";var g=(v.decorators=[{type:u.Injectable,args:[{providedIn:"root"}]}],v.ctorParameters=function(){return[]},v.ngInjectableDef=u.defineInjectable({factory:function(){return new v},token:v,providedIn:"root"}),v);function v(){}var q=(y.RestrictionBetween="Between",y.RestrictionLike="Like",y.RestrictionEq="Eq",y.RestrictionNeq="NEQ",y.RestrictionGt="GT",y.RestrictionGte="GTE",y.RestrictionLt="LT",y.RestrictionLte="LTE",y.RestrictionIn="IN",y.RestrictionNotIn="NotIn",y.RestrictionOr="Or",y.RestrictionOrNeq="OrNeq",y.RestrictionIsNull="ISNULL",y.RestrictionIsNotNull="ISNOTNULL",y.RestrictionGTE="GTE",y.RestrictionLTE="LTE",y.showData="10,50,100",y.JoinTypeInner="INNER",y.JoinTypeLeft="LEFT",y);function y(){}var b=function R(){this.baseUrl="",this.apiPath="",this.requestObj=new Object,this.leftColumnToJoin="",this.rightColumnToJoin="",this.joinType=q.JoinTypeInner},I=function O(){this._url="",this.enviromentUrl="",this.title="",this.apiQryPaging="",this.arrCritObj=null,this.addCritInput=new Array,this.ddlEnvironments=new Array,this.listEnvironments=new Array,this.whereValue=new Array,this.switchValue=new Array,this.integrationObj=new b,this.isJoinExAPI=!1},E=function M(){this.low=0,this.high=0,this.DataType="Text",this.isCriteriaDataTable=!1},w=function A(){this.includeCount=!0,this.includeData=!0,this.isLoading=!0,this.queryString="",this.rowVersion="",this.integrationObj=new b,this.joinType=q.JoinTypeInner},x=(T.prototype.exportAsExcelFile=function(e,t){var n=o.utils.json_to_sheet(e);console.log("worksheet",n);var i={Sheets:{data:n},SheetNames:["data"]},r=o.write(i,{bookType:"xlsx",type:"array"});this.saveAsExcelFile(r,t)},T.prototype.saveAsExcelFile=function(e,t){var n=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});i.saveAs(n,t+"_export_"+(new Date).getTime()+".xlsx")},T.decorators=[{type:u.Injectable}],T.ctorParameters=function(){return[]},T);function T(){}var F=(D.EXP_TYPE_PDF=0,D.EXP_TYPE_XLS=1,D.EXP_TYPE_XLSX=2,D.EXP_TYPE_DOC=3,D.EXP_TYPE_DOCX=4,D);function D(){}var C=function N(){this.ListOfMonth=new Array,this.ListOfMonth.push({key:1,value:"January"}),this.ListOfMonth.push({key:2,value:"February"}),this.ListOfMonth.push({key:3,value:"March"}),this.ListOfMonth.push({key:4,value:"April"}),this.ListOfMonth.push({key:5,value:"May"}),this.ListOfMonth.push({key:6,value:"June"}),this.ListOfMonth.push({key:7,value:"July"}),this.ListOfMonth.push({key:8,value:"August"}),this.ListOfMonth.push({key:9,value:"September"}),this.ListOfMonth.push({key:10,value:"October"}),this.ListOfMonth.push({key:11,value:"November"}),this.ListOfMonth.push({key:12,value:"December"})},k=(Object.defineProperty(S.prototype,"content",{set:function(e){e&&(this.searchForm=e)},enumerable:!0,configurable:!0}),S.prototype.changeState=function(){this.currentState="initial"===this.currentState?"final":"initial",this.isHidden=!1===this.isHidden},S.prototype.ngOnInit=function(){console.log("ucsearch"),this.apiUrl=this.searchInput.enviromentUrl+this.searchInput.apiQryPaging,this.arrCrit=this.searchInput.arrCritObj;var e=this._renderer2.createElement("script");e.text='\n $(document).ready(function(){\n $("#flip").click(function(){\n $("#panel").slideToggle("slow");\n });\n });\n ',this._renderer2.appendChild(this._document.body,e);var t=this.cookieService.get("BusinessDateRaw");this.BisDt=this.DecryptString(t,"AdInsFOU12345678"),this.BusinessDt=new Date(this.BisDt),this.initiateForm()},S.prototype.initiateForm=function(){var h=this;this.getJSON(this.searchInput._url).subscribe(function(t){h.configuration=t,h.exportData=t.exportExcel,t.exportTypeList!=undefined&&0!=t.exportTypeList.length&&(h.ExportTypeList=t.exportTypeList,h.ExportType=h.ExportTypeList[0].key),h.countForm=t.component.length,h.isDataLoaded=!0,h.searchInput.title!=undefined&&""!=h.searchInput.title&&(h.configuration.title=h.searchInput.title);for(var e=0;e<h.countForm;e++){if(1==t.component[e].isFromURL){var n=new w,i=new Array,r=new E;if(r.DataType="text",r.propName=t.component[e].criteriaPropName,r.value=t.component[e].criteriaPropValue,r.restriction="eq",i.push(r),n.criteria=i,n[t.component[e].criteriaPropName]=t.component[e].criteriaPropValue,t.component[e].path!=undefined&&""!=t.component[e].path)if(h.searchInput.ddlEnvironments!=undefined&&0!=h.searchInput.ddlEnvironments.length){for(var o=0;o<h.searchInput.ddlEnvironments.length;o++)if(t.component[e].name==h.searchInput.ddlEnvironments[o].name){t.component[e].fullpath=h.searchInput.ddlEnvironments[o].environment+t.component[e].path;break}}else if(h.searchInput.listEnvironments!=undefined&&0!=h.searchInput.listEnvironments.length){for(o=0;o<h.searchInput.listEnvironments.length;o++)if(t.component[e].environment==h.searchInput.listEnvironments[o].environment){t.component[e].fullpath=h.searchInput.listEnvironments[o].url+t.component[e].path;break}}else t.component[e].fullpath=t.component[e].url;else t.component[e].fullpath=t.component[e].url;h.resolveObject(t.component[e],t.component[e].fullpath,n)}if("numeric"==t.component[e].type&&(t.component[e].value=parseFloat(t.component[e].value).toLocaleString("en")),"dropdown"==t.component[e].type&&t.component[e].dtmType!=undefined&&("month"==t.component[e].dtmType&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.BusinessDt.getMonth()+1),t.component[e].items=h.ListOfMonth.ListOfMonth),t.component[e].dtmType.includes("year")&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.BusinessDt.getFullYear()),t.component[e].items=h.setYearDDL(t.component[e].dtmType))),"datepicker"==t.component[e].type){if(t.component[e].value.includes("BD")){var a=new Date;null!=h.BisDt&&(a=new Date(h.BisDt));var s=t.component[e].value.charAt(2),l=new Date;if("-"==s){var u=t.component[e].value.split("-",2),c=parseInt(u[1]);a.setDate(a.getDate()-c)}else"+"==s&&(u=t.component[e].value.split("+",2),c=parseInt(u[1]),a.setDate(a.getDate()+c));l=a;var d=f.formatDate(l,"yyyy-MM-dd","en-US");t.component[e].value=d}if(t.component[e].restriction!=undefined&&""!=t.component[e].restriction)if("GT"==t.component[e].restriction.toUpperCase()){var p=new Date(h.datePipe.transform(t.component[e].minDate,"yyyy-MM-dd"));p.setDate(p.getDate()+1),t.component[e].minDate=p}else if("LT"==t.component[e].restriction.toUpperCase()){var m=new Date(h.datePipe.transform(t.component[e].maxDate,"yyyy-MM-dd"));m.setDate(m.getDate()-1),t.component[e].maxDate=m}}}setTimeout(function(){for(var e=0;e<h.countForm;e++)1==t.component[e].isEvent&&1==h.configuration.component[e].itemsUrl.length&&h.onChangeEvent(t.component[e].itemsUrl[0].Key,t.component[e]),"officeRoleCodes"==t.component[e].type&&0<h.configuration.component[e].itemsUrl.length&&h.SetRoleOfficeCodes(e)},1e3)})},S.prototype.SetRoleOfficeCodes=function(e){var t=this.cookieService.get("RoleCode"),n=this.DecryptString(t,"AdInsFOU12345678"),i=new Array;if(i.push(n),1==this.configuration.component[e].itemsUrl.length&&"all"==this.configuration.component[e].ddlType)for(var r=0;r<this.configuration.component[e].itemsUrl.length;r++){var o=this.configuration.component[e].itemsUrl[r];i.push(o.Key),i.push(n+"-"+o.Key)}else{var a=this.myForm.nativeElement[e].options,s=a[a.selectedIndex].value.trim();i.push(s),i.push(n+"-"+s)}this.searchInput.integrationObj.requestObj.OfficeRoleCodes=i},S.prototype.setYearDDL=function(e){this.ListOfYear=new Array;var t=e.match("[\\/+][-]|[-][\\/+]|\\/+|-"),n=this.BusinessDt.getFullYear(),i=this.BusinessDt.getFullYear(),r=parseInt(e.substring(t.index+t[0].length));this.ListOfYear.push({key:this.BusinessDt.getFullYear(),value:this.BusinessDt.getFullYear().toString()});for(var o=0;o<r;o++)"-+"==t[0]||"+-"==t[0]?(n--,i++,this.ListOfYear.push({key:n,value:n.toString()},{key:i,value:i.toString()})):"-"==t[0]?(n--,this.ListOfYear.push({key:n,value:n.toString()})):"+"==t[0]&&(i++,this.ListOfYear.push({key:i,value:i.toString()}));return this.ListOfYear.sort(function(e,t){return e.key-t.key}),this.ListOfYear},S.prototype.getJSON=function(e){return this.http.get(e)},S.prototype.postJSON=function(e,t){return void 0===t&&(t=null),this.http.post(e,t)},S.prototype.searchClick=function(){var e=null;null!=this.configuration.orderby&&(e={key:this.configuration.orderby.key,value:this.configuration.orderby.value}),this.pageNow=1,this.search(this.apiUrl,this.pageNow,this.pageSize,e,this.arrCrit)},S.prototype.reset=function(){this.searchForm.resetForm(),this.ExportType=this.ExportTypeList[0].key,this.initiateForm()},S.prototype.search=function(e,n,t,i,r){var o=this;void 0===r&&(r=new Array);var a=new w,s=new Array,l=!1,u=!1;if(this.searchInput.whereValue!=undefined&&0!=this.searchInput.whereValue.length){this.configuration.querystring.whereQuery=new Array;for(var c=0;c<this.searchInput.whereValue.length;c++)this.configuration.querystring.whereQuery.push(this.searchInput.whereValue[c].value)}a.pageNo=n,a.rowPerPage=t,a.orderBy=i,a.queryString=this.configuration.querystring;for(var d=0;d<this.countForm;d++){var p=new E,m=this.myForm.nativeElement[d];if(p.DataType=m.getAttribute("data-type"),l=null!=m.getAttribute("query-in")&&"true"==m.getAttribute("query-in"),""!=m.value)if("SELECT"==m.nodeName){var h=m.options,f=h[h.selectedIndex].value.trim();if("one"==f){u=!0;var g=m.getAttribute("label");this.toastr.warning("Please select "+g);break}if("claim"==this.configuration.component[d].type)p.propName=m.getAttribute("data-name"),p.restriction=f,p.value=null,""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(p.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),s.push(p);else if("all"!=f&&"one"!=f)p.restriction=q.RestrictionEq,""!=m.name?p.propName=m.name:p.propName=m.getAttribute("ng-reflect-name"),p.value=f,s.push(p);else if("all"==f&&1==l&&0!=m.options.length){var v=new Array;for(c=0;c<m.options.length;c++)0!=c&&v.push(m.options[c].value);0!=v.length&&(p.restriction=q.RestrictionIn,""!=m.name?p.propName=m.name:p.propName=m.getAttribute("ng-reflect-name"),p.listValue=v,s.push(p))}}else""!=m.name?p.propName=m.name:p.propName=m.getAttribute("data-name"),p.value=m.value.trim(),m.value.includes("%")?p.restriction=q.RestrictionLike:""!=m.getAttribute("data-restriction")&&null!=m.getAttribute("data-restriction")?(p.restriction=m.getAttribute("data-restriction"),"numeric"==m.getAttribute("data-type")&&(p.value=parseFloat(m.value.replace(/,/g,"")).toString()),"LIKE"==p.restriction.toUpperCase()&&(p.value="%"+m.value.trim()+"%",p.restriction=q.RestrictionLike)):p.restriction=q.RestrictionEq,""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(p.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),s.push(p)}if(!u){if(null!=r&&r!=undefined){if(0!=r.length)for(var y=0;y<r.length;y++)s.push(r[y]);else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(y=0;y<this.searchInput.addCritInput.length;y++)s.push(this.searchInput.addCritInput[y])}else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(y=0;y<this.searchInput.addCritInput.length;y++)s.push(this.searchInput.addCritInput[y]);a.criteria=s,this.searchInput.isJoinExAPI?a.integrationObj=this.searchInput.integrationObj:a.integrationObj=null,this.http.post(e,a).subscribe(function(e){var t={response:e,pageNow:n};return console.log(t),o.result.emit(t),e})}},S.prototype.GenerateReport=function(){this.genRpt.emit({ExportType:this.ExportType,ElRef:this.myForm})},S.prototype.lessThanFour=function(){return!(3<this.countForm)},S.prototype.resolveObject=function(t,e,n){void 0===n&&(n=null),this.postJSON(e,n).subscribe(function(e){t.itemsUrl=new Array,t.itemsUrl=e.ReturnObject,t.exclude!=undefined&&""!=t.exclude&&(t.itemsUrl=t.itemsUrl.filter(function(e){return!t.exclude.includes(e.Key)}))})},S.prototype.transformAmount=function(e){this.formattedAmount=parseFloat(e.target.value).toLocaleString("en"),e.target.value=this.formattedAmount},S.prototype.transformToDecimal=function(e){e.target.value=parseFloat(e.target.value.toString().replace(/,/g,""))},S.prototype.exportAsXLSX=function(){var t=this,e=new w;e.pageNo=1,e.rowPerPage=9999,e.orderBy=null,e.criteria=[],e.queryString=this.configuration.querystring,this.searchInput.isJoinExAPI?e.integrationObj=this.searchInput.integrationObj:e.integrationObj=null,this.http.post(this.apiUrl,e).subscribe(function(e){t.ExcelData=e.Data,t.excelService.exportAsExcelFile(t.ExcelData,"sample")},function(e){console.log(e)})},S.prototype.onChangeEvent=function(e,t){for(var n=this.configuration.component,i=0;i<t.affectedFilter.length;i++)for(var r=0;r<n.length;r++)if(n[r].name==t.affectedFilter[i]){var o=new w,a=new Array;if("all"!=e&&"one"!=e){var s=new E;s.DataType=t.datatype,t.filterPropName!=undefined||""!=t.filterPropName?(o[t.filterPropName]=e,s.propName=t.filterPropName):(s.propName=t.name,o[t.name]=e),s.value=e,s.restriction=q.RestrictionEq,a.push(s)}if(o.criteria=a,n[r].path!=undefined&&""!=n[r].path)if(this.searchInput.ddlEnvironments!=undefined&&0!=this.searchInput.ddlEnvironments.length){for(var l=0;l<this.searchInput.ddlEnvironments.length;l++)if(n[r].name==this.searchInput.ddlEnvironments[l].name){n[r].fullpath=this.searchInput.ddlEnvironments[l].environment+n[r].path;break}}else if(this.searchInput.listEnvironments!=undefined&&0!=this.searchInput.listEnvironments.length){for(l=0;l<this.searchInput.listEnvironments.length;l++)if(n[r].environment==this.searchInput.listEnvironments[l].environment){n[r].fullpath=this.searchInput.listEnvironments[l].url+n[r].path;break}}else n[r].fullpath=n[r].url;else n[r].fullpath=n[r].url;this.resolveObject(n[r],n[r].fullpath,o)}},S.prototype.SetProcessKey=function(e){console.log(e);var t=this.myForm.nativeElement[e].options,n=t[t.selectedIndex].value.trim();if(n){var i=this.configuration.component[e].itemsUrl.find(function(e){return e.Key==n});this.searchInput.integrationObj.requestObj.TaskDefinitionKey=n,this.searchInput.integrationObj.requestObj.ProcessKey=i}},S.prototype.switchCase=function(t){for(var e=!1,n=0;n<t.conditions.length;n++){var i=this.searchInput.switchValue.findIndex(function(e){return e.property==t.conditions[n].property});if("EQ"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(this.searchInput.switchValue[i].value!=t.conditions[n].value){e=!1;break}e=!0}else{var r=localStorage.getItem("Username");if(this.searchInput.switchValue[i].value!=r){e=!1;break}e=!0}else if("NEQ"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(this.searchInput.switchValue[i].value==t.conditions[n].value){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),this.searchInput.switchValue[i].value==r){e=!1;break}e=!0}else if("GT"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value>t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value>r)){e=!1;break}e=!0}else if("GTE"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value>=t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value>=r)){e=!1;break}e=!0}else if("LT"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value<t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value<r)){e=!1;break}e=!0}else if("LTE"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value<=t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value<=r)){e=!1;break}e=!0}}return e},S.prototype.DecryptString=function(e,t){if(t==undefined||""==t.trim()||e==undefined||""==e.trim())return e;var n=l.enc.Utf8.parse(t),i=l.lib.WordArray.create([0,0,0,0]);return l.AES.decrypt(e,n,{iv:i}).toString(l.enc.Utf8)},S.prototype.checkInputDate=function(t){var e,n,i,r=new Array,o=this.configuration.component.find(function(e){return e.name==t.name&&"GTE"==e.restriction.toUpperCase()})==undefined?this.configuration.component.find(function(e){return e.name==t.name&&"GT"==e.restriction.toUpperCase()}):this.configuration.component.find(function(e){return e.name==t.name&&"GTE"==e.restriction.toUpperCase()});o!=undefined&&(e=""==this.myForm.nativeElement[o.id].min?null:new Date(this.myForm.nativeElement[o.id].min),i=o.label.split(">",2),null!=e&&("GT"==o.restriction.toUpperCase()?(e.setDate(e.getDate()-1),r.push(" must be greater than ")):"GTE"==o.restriction.toUpperCase()&&r.push(" must be greater than or equals to ")));var a=this.configuration.component.find(function(e){return e.name==t.name&&"LTE"==e.restriction.toUpperCase()})==undefined?this.configuration.component.find(function(e){return e.name==t.name&&"LT"==e.restriction.toUpperCase()}):this.configuration.component.find(function(e){return e.name==t.name&&"LTE"==e.restriction.toUpperCase()});a!=undefined&&(n=""==this.myForm.nativeElement[a.id].max?null:new Date(this.myForm.nativeElement[a.id].max),i=a.label.split("<",2),null!=n&&("LT"==a.restriction.toUpperCase()?(n.setDate(n.getDate()+1),r.push(" must be less than ")):"LTE"==a.restriction.toUpperCase()&&r.push(" must be less than or equals to "))),null!=e&&null==n&&new Date(this.myForm.nativeElement[o.id].value)<e?(this.toastr.warning(i[0]+r[0]+f.formatDate(e,"dd MMMM yyyy","en-US")+"."),this.dateWrong=!0):null!=n&&null==e&&new Date(this.myForm.nativeElement[a.id].value)>n?(this.toastr.warning(i[0]+r[0]+f.formatDate(n,"dd MMMM yyyy","en-US")+"."),this.dateWrong=!0):null!=e&&null!=n&&(new Date(this.myForm.nativeElement[a.id].value)>n||new Date(this.myForm.nativeElement[o.id].value)<e)?(this.toastr.warning(i[0]+r[0]+f.formatDate(e,"dd MMMM yyyy","en-US")+" and"+r[1]+f.formatDate(n,"dd MMMM yyyy","en-US")+"."),this.dateWrong=!0):this.dateWrong=!1},S.decorators=[{type:u.Component,args:[{selector:"lib-UCSearch",template:'\x3c!-- Basic form layout section start --\x3e\r\n<section id="horizontal-form-layouts">\r\n <div class="row text-left">\r\n <div class="col-md-12">\r\n <div class="card">\r\n <div class="pl-3 mb-2 mt-2" *ngIf="configuration?.title != undefined && configuration?.title != \'\'">\r\n <h4 class="card-title ucSearch-title" translate>{{configuration.title}}</h4>\r\n </div>\r\n <div class="card-body">\r\n <div class="px-3">\r\n <form class="form form-horizontal" id="formSearch" #formIdSearch #enjiForm="ngForm"\r\n (ngSubmit)="enjiForm.valid && searchClick()">\r\n <div class="form-body">\r\n <h4 class="form-section font-weight-bold">\r\n <div (click)="changeState()" class="btn no-padding cursor-pointer flip">\r\n <i class="fa" style="font-size: 15px; margin: 0px 0px 5px -15px;"\r\n [ngClass]="isHidden ? \'fa-chevron-right\' : \'fa-chevron-down\'"></i>\r\n </div>\r\n <span\r\n *ngIf="configuration?.sectionTitle != undefined && configuration?.sectionTitle != \'\'; then inputSectionTitle else defaultSectionTitle"></span>\r\n <ng-template #inputSectionTitle>\r\n {{configuration?.sectionTitle}}\r\n </ng-template>\r\n <ng-template #defaultSectionTitle>\r\n Paging\r\n </ng-template>\r\n </h4>\r\n \x3c!-- Ini Digunakan untuk Generate Dynamic Component --\x3e\r\n \x3c!-- [hidden]="isHidden" --\x3e\r\n <div class="panel-active" [@changeDivSize]=currentState>\r\n <div class="row">\r\n <div class="col-md-6 form-group" *ngFor="let question of configuration?.component; let i = index">\r\n <div class="col-md-12">\r\n <div class="row">\r\n <label class="col-md-5 no-padding" for="{{question.id}}"\r\n [ngClass]="{\'adins-required-label\': (question.isRequired || (question?.ddlType != undefined && question.ddlType == \'one\'))}"\r\n translate>{{question.label}}</label>\r\n <div class="col-md-7 no-padding">\r\n <div *ngIf="question.type==\'textbox\'">\r\n <input type="text" id="{{question.id}}" class="form-control search-form-control" [ngModel]="question.value"\r\n [required]="question.isRequired" name="{{question.name}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\r\n attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n (keyup.enter)="searchClick()" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}" attr.data-restriction="{{question.restriction}}" attr.label="{{question.label}}"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n </div>\r\n <div *ngIf="question.type==\'textarea\'">\r\n <textarea type="text" id="{{question.id}}" class="form-control search-form-control" [ngModel]="question.value"\r\n [required]="question.isRequired" name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n value="{{question.value}}" attr.label="{{question.label}}"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }"></textarea>\r\n </div>\r\n <div *ngIf="question.type==\'numeric\'">\r\n <input type="number" id="{{question.id}}" (focus)="transformToDecimal($event)"\r\n (blur)="transformAmount($event)" class="form-control search-form-control" [ngModel]="question.value"\r\n [required]="question.isRequired" name="{{question.name+[i]}}" attr.data-required="{{question.isRequired}}"\r\n value="{{question.value}}" (keyup.enter)="searchClick()"\r\n attr.data-restriction="{{question.restriction}}" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}" attr.label="{{question.label}}"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name+[i]]?.touched || enjiForm.form.controls[question.name+[i]]?.dirty) && enjiForm.form.controls[question.name+[i]]?.invalid }">\r\n </div>\r\n <div *ngIf="question.type==\'currency\'">\r\n <div *ngIf="question?.isCustom != undefined && question?.isCustom">\r\n <input type="" id="{{question.id}}" class="form-control search-form-control"\r\n [required]="question.isRequired" name="{{question.name}}" (keyup.enter)="searchClick()"\r\n attr.data-restriction="{{question.restriction}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" currencyMask [ngModel]="question.value"\r\n [(ngModel)]="question.value" [ngModelOptions]="{standalone: true}" attr.label="{{question.label}}"\r\n [options]="{ thousands: question.thousands, decimal: question.decimal, align: question.align, allowNegative: question.allowNegative, allowZero: question.allowZero, precision: question.precision, nullable: question.nullable }"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n </div>\r\n <div *ngIf="question?.isCustom == undefined || !question?.isCustom">\r\n <input type="text" id="{{question.id}}" class="form-control search-form-control"\r\n [required]="question.isRequired" name="{{question.name}}" (keyup.enter)="searchClick()"\r\n attr.data-restriction="{{question.restriction}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" currencyMask [ngModel]="question.value"\r\n [(ngModel)]="question.value" [ngModelOptions]="{standalone: true}" attr.label="{{question.label}}"\r\n [options]="{ thousands: \',\', decimal: \'.\', align: \'right\', allowNegative: false, allowZero:true, precision: 2, nullable: false }"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n </div>\r\n </div>\r\n\r\n \x3c!-- End Hardcode Lookup didalem--\x3e\r\n <div *ngIf="question.type==\'datepicker\'">\r\n <input type="date" id="{{question.id}}"\r\n class="form-control search-form-control btn-lookup" name="{{question.name+[i]}}" [ngModel]="question.value"\r\n [required]="question.isRequired" attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n (keyup.enter)="searchClick()" attr.data-restriction="{{question.restriction}}" attr.label="{{question.label}}"\r\n min="{{question.minDate | date:\'yyyy-MM-dd\'}}" max="{{question.maxDate | date:\'yyyy-MM-dd\'}}" (focusout)="checkInputDate(question)"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name+[i]]?.touched || enjiForm.form.controls[question.name+[i]]?.dirty) && enjiForm.form.controls[question.name+[i]]?.invalid }">\r\n </div>\r\n <div *ngIf="question.type == \'taskDefinitionKey\' || question.type == \'officeRoleCodes\'">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.label="{{question.label}}"\r\n [hidden]="question?.itemsUrl.length == 1" (change)="question.type == \'taskDefinitionKey\' ? SetProcessKey(i) : SetRoleOfficeCodes(i)"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.itemsUrl.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.itemsUrl.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.itemsUrl" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.itemsUrl.length == 1">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf="question.type==\'dropdown\'">\r\n \x3c!-- Ini kalau datanya tidak di load dari URL --\x3e\r\n <div *ngIf="!question.isFromURL">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}" attr.label="{{question.label}}"\r\n [hidden]="question?.items.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.items.length != 1" value="one">\r\n Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.items.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.items" value="{{item.key}}">\r\n {{item.value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.items.length == 1">{{question.items[0].value}}</label>\r\n </div>\r\n \x3c!-- Ini kalau datanya di load dari URL --\x3e\r\n <div *ngIf="question.isFromURL">\r\n <div *ngIf="question.isEvent">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}" attr.label="{{question.label}}"\r\n (change)="onChangeEvent($event.target.value, question)"\r\n [hidden]="question?.itemsUrl.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.itemsUrl.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.itemsUrl.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.itemsUrl" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.itemsUrl.length == 1">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf="!question.isEvent">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.label="{{question.label}}"\r\n [hidden]="question?.itemsUrl.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.itemsUrl.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.itemsUrl.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.itemsUrl" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.itemsUrl.length == 1">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf="question.type==\'claim\'">\r\n <select name="{{\'claim\'+[i]}}" class="form-control search-form-control"\r\n attr.data-type="{{\'text\'}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}" attr.data-name="{{\'Assignee\'}}"\r\n [hidden]="ClaimList.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[\'claim\'+[i]]?.touched || enjiForm.form.controls[\'claim\'+[i]]?.dirty) && enjiForm.form.controls[\'claim\'+[i]]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && ClaimList.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && ClaimList.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of ClaimList" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n </div>\r\n <lib-uc-show-errors *ngIf="question.type!=\'datepicker\'" [control]="enjiForm.form.controls[question.name]"\r\n [submit]="enjiForm.submitted">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf="question.type==\'datepicker\'" [control]="enjiForm.form.controls[question.name+[i]]"\r\n [submit]="enjiForm.submitted">\r\n </lib-uc-show-errors>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-6 form-group" *ngIf="(isReport != undefined && isReport)">\r\n <div class="col-md-12">\r\n <div class="row">\r\n <label class="col-md-5 no-padding" translate>Report Type</label>\r\n <div class="col-md-7 no-padding">\r\n <select name="ExportType" [(ngModel)]="ExportType" class="form-control search-form-control"\r\n attr.data-type="text">\r\n <option *ngFor="let item of ExportTypeList" [value]="item.key">{{item.value}}</option>\r\n </select>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-12 no-padding">\r\n <div class="form-actions right">\r\n <button *ngIf="exportData == true" type="button" (click)="exportAsXLSX()"\r\n class="btn btn-raised btn-success mr-1" translate>\r\n <i class="fa ft-download"></i> Export Excel\r\n </button>\r\n <button type="button" (click)="reset()" class="btn btn-raised btn-warning mr-1" translate>\r\n <i class="fa fa-times"></i> Reset\r\n </button>\r\n <button *ngIf="(isReport == undefined || !isReport)" type="submit"\r\n class="btn btn-raised btn-primary" #UCSearchClick translate>\r\n <i class="fa fa-search"></i> Search\r\n </button>\r\n <button *ngIf="(isReport != undefined && isReport)" type="button" (click)="GenerateReport()"\r\n class="btn btn-raised btn-primary" translate>\r\n <i class="fa ft-download"></i> Generate Report\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n<br>\r\n\x3c!-- // Basic form layout section end --\x3e',providers:[x,f.DatePipe],animations:[r.trigger("changeDivSize",[r.state("initial",r.style({height:"*",opacity:"1"})),r.state("final",r.style({height:"0px",opacity:"0",overflow:"hidden"})),r.transition("initial=>final",r.animate("300ms")),r.transition("final=>initial",r.animate("300ms"))])],styles:[".ucSearch-title{margin:3px}"]}]}],S.ctorParameters=function(){return[{type:t.HttpClient},{type:x},{type:u.Renderer2},{type:undefined,decorators:[{type:u.Inject,args:[n.DOCUMENT]}]},{type:a.ToastrService},{type:s.CookieService},{type:f.DatePipe}]},S.propDecorators={content:[{type:u.ViewChild,args:["enjiForm"]}],myForm:[{type:u.ViewChild,args:["formIdSearch"]}],searchInput:[{type:u.Input}],pageSize:[{type:u.Input}],isReport:[{type:u.Input}],result:[{type:u.Output}],genRpt:[{type:u.Output}]},S);function S(e,t,n,i,r,o,a){this.http=e,this.excelService=t,this._renderer2=n,this._document=i,this.toastr=r,this.cookieService=o,this.datePipe=a,this.searchInput=new I,this.pageSize=10,this.isReport=!1,this.result=new u.EventEmitter,this.genRpt=new u.EventEmitter,this.ExportTypeList=[{key:F.EXP_TYPE_PDF,value:"PDF"},{key:F.EXP_TYPE_XLS,value:"Excel 2003"},{key:F.EXP_TYPE_XLSX,value:"Excel 2007"},{key:F.EXP_TYPE_DOC,value:"Document"},{key:F.EXP_TYPE_DOCX,value:"Document XML"}],this.ListOfMonth=new C,this.ListOfYear=new Array,this.ClaimList=[{Key:q.RestrictionIsNotNull,Value:"CLAIMED"},{Key:q.RestrictionIsNull,Value:"UNCLAIMED"}],this.ExportType=0,this.pageNow=1,this.isDataLoaded=!1,this.isHidden=!1,this.BusinessDt=new Date,this.dateWrong=!1,this.currentState="initial",this.countForm=0,this.formattedAmount="",this.amount=0}var U={align:"right",allowNegative:!1,allowZero:!0,decimal:".",precision:2,prefix:"",suffix:"",thousands:",",nullable:!1,inputMode:d.CurrencyMaskInputMode.NATURAL},L=(j.decorators=[{type:u.NgModule,args:[{declarations:[k],imports:[f.CommonModule,c.FormsModule,m.UcShowErrorsModule,h.UcDirectiveUpperCaseModule,d.NgxCurrencyModule.forRoot(U),p.TranslateModule.forChild()],exports:[k]}]}],j);function j(){}e.UCSearchService=g,e.UCSearchComponent=k,e.customCurrencyMaskConfig=U,e.UCSearchModule=L,e.ɵa=x,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common/http"),require("@angular/platform-browser"),require("file-saver"),require("xlsx"),require("@angular/animations"),require("ngx-toastr"),require("ngx-cookie"),require("crypto-js"),require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-currency"),require("@ngx-translate/core"),require("@adins/uc-show-errors"),require("@adins/uc-directive-upper-case")):"function"==typeof define&&define.amd?define("@adins/ucsearch",["exports","@angular/common/http","@angular/platform-browser","file-saver","xlsx","@angular/animations","ngx-toastr","ngx-cookie","crypto-js","@angular/core","@angular/common","@angular/forms","ngx-currency","@ngx-translate/core","@adins/uc-show-errors","@adins/uc-directive-upper-case"],t):t((e.adins=e.adins||{},e.adins.ucsearch={}),e.ng.common.http,e.ng.platformBrowser,e.FileSaver,e.XLSX,e.ng.animations,e.ngxToastr,e.ngxCookie,e.CryptoJS,e.ng.core,e.ng.common,e.ng.forms,e.ngxCurrency,e.core,e.ucShowErrors,e.ucDirectiveUpperCase)}(this,function(e,t,n,i,o,r,a,s,l,u,f,c,d,p,m,h){"use strict";var g=(v.decorators=[{type:u.Injectable,args:[{providedIn:"root"}]}],v.ctorParameters=function(){return[]},v.ngInjectableDef=u.defineInjectable({factory:function(){return new v},token:v,providedIn:"root"}),v);function v(){}var q=(y.RestrictionBetween="Between",y.RestrictionLike="Like",y.RestrictionEq="Eq",y.RestrictionNeq="NEQ",y.RestrictionGt="GT",y.RestrictionGte="GTE",y.RestrictionLt="LT",y.RestrictionLte="LTE",y.RestrictionIn="IN",y.RestrictionNotIn="NotIn",y.RestrictionOr="Or",y.RestrictionOrNeq="OrNeq",y.RestrictionIsNull="ISNULL",y.RestrictionIsNotNull="ISNOTNULL",y.RestrictionGTE="GTE",y.RestrictionLTE="LTE",y.showData="10,50,100",y.JoinTypeInner="INNER",y.JoinTypeLeft="LEFT",y);function y(){}var b=function O(){this.baseUrl="",this.apiPath="",this.requestObj=new Object,this.leftColumnToJoin="",this.rightColumnToJoin="",this.joinType=q.JoinTypeInner},I=function R(){this._url="",this.enviromentUrl="",this.title="",this.apiQryPaging="",this.arrCritObj=null,this.addCritInput=new Array,this.ddlEnvironments=new Array,this.listEnvironments=new Array,this.whereValue=new Array,this.switchValue=new Array,this.integrationObj=new b,this.isJoinExAPI=!1},E=function M(){this.low=0,this.high=0,this.DataType="Text",this.isCriteriaDataTable=!1},w=function A(){this.includeCount=!0,this.includeData=!0,this.isLoading=!0,this.queryString="",this.rowVersion="",this.integrationObj=new b,this.joinType=q.JoinTypeInner},x=(T.prototype.exportAsExcelFile=function(e,t){var n=o.utils.json_to_sheet(e);console.log("worksheet",n);var i={Sheets:{data:n},SheetNames:["data"]},r=o.write(i,{bookType:"xlsx",type:"array"});this.saveAsExcelFile(r,t)},T.prototype.saveAsExcelFile=function(e,t){var n=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});i.saveAs(n,t+"_export_"+(new Date).getTime()+".xlsx")},T.decorators=[{type:u.Injectable}],T.ctorParameters=function(){return[]},T);function T(){}var F=(D.EXP_TYPE_PDF=0,D.EXP_TYPE_XLS=1,D.EXP_TYPE_XLSX=2,D.EXP_TYPE_DOC=3,D.EXP_TYPE_DOCX=4,D);function D(){}var C=function N(){this.ListOfMonth=new Array,this.ListOfMonth.push({key:1,value:"January"}),this.ListOfMonth.push({key:2,value:"February"}),this.ListOfMonth.push({key:3,value:"March"}),this.ListOfMonth.push({key:4,value:"April"}),this.ListOfMonth.push({key:5,value:"May"}),this.ListOfMonth.push({key:6,value:"June"}),this.ListOfMonth.push({key:7,value:"July"}),this.ListOfMonth.push({key:8,value:"August"}),this.ListOfMonth.push({key:9,value:"September"}),this.ListOfMonth.push({key:10,value:"October"}),this.ListOfMonth.push({key:11,value:"November"}),this.ListOfMonth.push({key:12,value:"December"})},k=(Object.defineProperty(S.prototype,"content",{set:function(e){e&&(this.searchForm=e)},enumerable:!0,configurable:!0}),S.prototype.changeState=function(){this.currentState="initial"===this.currentState?"final":"initial",this.isHidden=!1===this.isHidden},S.prototype.ngOnInit=function(){console.log("ucsearch"),this.apiUrl=this.searchInput.enviromentUrl+this.searchInput.apiQryPaging,this.arrCrit=this.searchInput.arrCritObj;var e=this._renderer2.createElement("script");e.text='\n $(document).ready(function(){\n $("#flip").click(function(){\n $("#panel").slideToggle("slow");\n });\n });\n ',this._renderer2.appendChild(this._document.body,e);var t=this.cookieService.get("BusinessDateRaw");this.BisDt=this.DecryptString(t,"AdInsFOU12345678"),this.BusinessDt=new Date(this.BisDt),this.initiateForm()},S.prototype.initiateForm=function(){var h=this;this.getJSON(this.searchInput._url).subscribe(function(t){h.configuration=t,h.exportData=t.exportExcel,t.exportTypeList!=undefined&&0!=t.exportTypeList.length&&(h.ExportTypeList=t.exportTypeList,h.ExportType=h.ExportTypeList[0].key),h.countForm=t.component.length,h.isDataLoaded=!0,h.searchInput.title!=undefined&&""!=h.searchInput.title&&(h.configuration.title=h.searchInput.title);for(var e=0;e<h.countForm;e++){if(1==t.component[e].isFromURL){var n=new w,i=new Array,r=new E;if(r.DataType="text",r.propName=t.component[e].criteriaPropName,r.value=t.component[e].criteriaPropValue,r.restriction="eq",i.push(r),n.criteria=i,n[t.component[e].criteriaPropName]=t.component[e].criteriaPropValue,t.component[e].path!=undefined&&""!=t.component[e].path)if(h.searchInput.ddlEnvironments!=undefined&&0!=h.searchInput.ddlEnvironments.length){for(var o=0;o<h.searchInput.ddlEnvironments.length;o++)if(t.component[e].name==h.searchInput.ddlEnvironments[o].name){t.component[e].fullpath=h.searchInput.ddlEnvironments[o].environment+t.component[e].path;break}}else if(h.searchInput.listEnvironments!=undefined&&0!=h.searchInput.listEnvironments.length){for(o=0;o<h.searchInput.listEnvironments.length;o++)if(t.component[e].environment==h.searchInput.listEnvironments[o].environment){t.component[e].fullpath=h.searchInput.listEnvironments[o].url+t.component[e].path;break}}else t.component[e].fullpath=t.component[e].url;else t.component[e].fullpath=t.component[e].url;h.resolveObject(t.component[e],t.component[e].fullpath,n)}if("numeric"==t.component[e].type&&(t.component[e].value=parseFloat(t.component[e].value).toLocaleString("en")),"dropdown"==t.component[e].type&&t.component[e].dtmType!=undefined&&("month"==t.component[e].dtmType&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.BusinessDt.getMonth()+1),t.component[e].items=h.ListOfMonth.ListOfMonth),t.component[e].dtmType.includes("year")&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.BusinessDt.getFullYear()),t.component[e].items=h.setYearDDL(t.component[e].dtmType))),"datepicker"==t.component[e].type){if(t.component[e].value.includes("BD")){var a=new Date;null!=h.BisDt&&(a=new Date(h.BisDt));var s=t.component[e].value.charAt(2),l=new Date;if("-"==s){var u=t.component[e].value.split("-",2),c=parseInt(u[1]);a.setDate(a.getDate()-c)}else"+"==s&&(u=t.component[e].value.split("+",2),c=parseInt(u[1]),a.setDate(a.getDate()+c));l=a;var d=f.formatDate(l,"yyyy-MM-dd","en-US");t.component[e].value=d}if(t.component[e].restriction!=undefined&&""!=t.component[e].restriction)if("GT"==t.component[e].restriction.toUpperCase()){var p=new Date(h.datePipe.transform(t.component[e].minDate,"yyyy-MM-dd"));p.setDate(p.getDate()+1),t.component[e].minDate=p}else if("LT"==t.component[e].restriction.toUpperCase()){var m=new Date(h.datePipe.transform(t.component[e].maxDate,"yyyy-MM-dd"));m.setDate(m.getDate()-1),t.component[e].maxDate=m}}}setTimeout(function(){for(var e=0;e<h.countForm;e++)1==t.component[e].isEvent&&1==h.configuration.component[e].itemsUrl.length&&h.onChangeEvent(t.component[e].itemsUrl[0].Key,t.component[e]),"officeRoleCodes"==t.component[e].type&&0<h.configuration.component[e].itemsUrl.length&&h.SetRoleOfficeCodes(e)},1e3)})},S.prototype.SetRoleOfficeCodes=function(e){var t=this.cookieService.get("UserAccess"),n=JSON.parse(this.DecryptString(t,"AdInsFOU12345678")).RoleCode,i=new Array;if(i.push(n),1==this.configuration.component[e].itemsUrl.length&&"all"==this.configuration.component[e].ddlType)for(var r=0;r<this.configuration.component[e].itemsUrl.length;r++){var o=this.configuration.component[e].itemsUrl[r];i.push(o.Key),i.push(n+"-"+o.Key)}else{var a=this.myForm.nativeElement[e].options,s=a[a.selectedIndex].value.trim();i.push(s),i.push(n+"-"+s)}this.searchInput.integrationObj.requestObj.OfficeRoleCodes=i},S.prototype.setYearDDL=function(e){this.ListOfYear=new Array;var t=e.match("[\\/+][-]|[-][\\/+]|\\/+|-"),n=this.BusinessDt.getFullYear(),i=this.BusinessDt.getFullYear(),r=parseInt(e.substring(t.index+t[0].length));this.ListOfYear.push({key:this.BusinessDt.getFullYear(),value:this.BusinessDt.getFullYear().toString()});for(var o=0;o<r;o++)"-+"==t[0]||"+-"==t[0]?(n--,i++,this.ListOfYear.push({key:n,value:n.toString()},{key:i,value:i.toString()})):"-"==t[0]?(n--,this.ListOfYear.push({key:n,value:n.toString()})):"+"==t[0]&&(i++,this.ListOfYear.push({key:i,value:i.toString()}));return this.ListOfYear.sort(function(e,t){return e.key-t.key}),this.ListOfYear},S.prototype.getJSON=function(e){return this.http.get(e)},S.prototype.postJSON=function(e,t){return void 0===t&&(t=null),this.http.post(e,t)},S.prototype.searchClick=function(){var e=null;null!=this.configuration.orderby&&(e={key:this.configuration.orderby.key,value:this.configuration.orderby.value}),this.pageNow=1,this.search(this.apiUrl,this.pageNow,this.pageSize,e,this.arrCrit)},S.prototype.reset=function(){this.searchForm.resetForm(),this.ExportType=this.ExportTypeList[0].key,this.initiateForm()},S.prototype.search=function(e,n,t,i,r){var o=this;void 0===r&&(r=new Array);var a=new w,s=new Array,l=!1,u=!1;if(this.searchInput.whereValue!=undefined&&0!=this.searchInput.whereValue.length){this.configuration.querystring.whereQuery=new Array;for(var c=0;c<this.searchInput.whereValue.length;c++)this.configuration.querystring.whereQuery.push(this.searchInput.whereValue[c].value)}a.pageNo=n,a.rowPerPage=t,a.orderBy=i,a.queryString=this.configuration.querystring;for(var d=0;d<this.countForm;d++){var p=new E,m=this.myForm.nativeElement[d];if(p.DataType=m.getAttribute("data-type"),l=null!=m.getAttribute("query-in")&&"true"==m.getAttribute("query-in"),""!=m.value)if("SELECT"==m.nodeName){var h=m.options,f=h[h.selectedIndex].value.trim();if("one"==f){u=!0;var g=m.getAttribute("label");this.toastr.warning("Please select "+g);break}if("claim"==this.configuration.component[d].type)p.propName=m.getAttribute("data-name"),p.restriction=f,p.value=null,""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(p.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),s.push(p);else if("all"!=f&&"one"!=f)p.restriction=q.RestrictionEq,""!=m.name?p.propName=m.name:p.propName=m.getAttribute("ng-reflect-name"),p.value=f,s.push(p);else if("all"==f&&1==l&&0!=m.options.length){var v=new Array;for(c=0;c<m.options.length;c++)0!=c&&v.push(m.options[c].value);0!=v.length&&(p.restriction=q.RestrictionIn,""!=m.name?p.propName=m.name:p.propName=m.getAttribute("ng-reflect-name"),p.listValue=v,s.push(p))}}else""!=m.name?p.propName=m.name:p.propName=m.getAttribute("data-name"),p.value=m.value.trim(),m.value.includes("%")?p.restriction=q.RestrictionLike:""!=m.getAttribute("data-restriction")&&null!=m.getAttribute("data-restriction")?(p.restriction=m.getAttribute("data-restriction"),"numeric"==m.getAttribute("data-type")&&(p.value=parseFloat(m.value.replace(/,/g,"")).toString()),"LIKE"==p.restriction.toUpperCase()&&(p.value="%"+m.value.trim()+"%",p.restriction=q.RestrictionLike)):p.restriction=q.RestrictionEq,""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(p.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),s.push(p)}if(!u){if(null!=r&&r!=undefined){if(0!=r.length)for(var y=0;y<r.length;y++)s.push(r[y]);else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(y=0;y<this.searchInput.addCritInput.length;y++)s.push(this.searchInput.addCritInput[y])}else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(y=0;y<this.searchInput.addCritInput.length;y++)s.push(this.searchInput.addCritInput[y]);a.criteria=s,this.searchInput.isJoinExAPI?a.integrationObj=this.searchInput.integrationObj:a.integrationObj=null,this.http.post(e,a).subscribe(function(e){var t={response:e,pageNow:n};return console.log(t),o.result.emit(t),e})}},S.prototype.GenerateReport=function(){this.genRpt.emit({ExportType:this.ExportType,ElRef:this.myForm})},S.prototype.lessThanFour=function(){return!(3<this.countForm)},S.prototype.resolveObject=function(t,e,n){void 0===n&&(n=null),this.postJSON(e,n).subscribe(function(e){t.itemsUrl=new Array,t.itemsUrl=e.ReturnObject,t.exclude!=undefined&&""!=t.exclude&&(t.itemsUrl=t.itemsUrl.filter(function(e){return!t.exclude.includes(e.Key)}))})},S.prototype.transformAmount=function(e){this.formattedAmount=parseFloat(e.target.value).toLocaleString("en"),e.target.value=this.formattedAmount},S.prototype.transformToDecimal=function(e){e.target.value=parseFloat(e.target.value.toString().replace(/,/g,""))},S.prototype.exportAsXLSX=function(){var t=this,e=new w;e.pageNo=1,e.rowPerPage=9999,e.orderBy=null,e.criteria=[],e.queryString=this.configuration.querystring,this.searchInput.isJoinExAPI?e.integrationObj=this.searchInput.integrationObj:e.integrationObj=null,this.http.post(this.apiUrl,e).subscribe(function(e){t.ExcelData=e.Data,t.excelService.exportAsExcelFile(t.ExcelData,"sample")},function(e){console.log(e)})},S.prototype.onChangeEvent=function(e,t){for(var n=this.configuration.component,i=0;i<t.affectedFilter.length;i++)for(var r=0;r<n.length;r++)if(n[r].name==t.affectedFilter[i]){var o=new w,a=new Array;if("all"!=e&&"one"!=e){var s=new E;s.DataType=t.datatype,t.filterPropName!=undefined||""!=t.filterPropName?(o[t.filterPropName]=e,s.propName=t.filterPropName):(s.propName=t.name,o[t.name]=e),s.value=e,s.restriction=q.RestrictionEq,a.push(s)}if(o.criteria=a,n[r].path!=undefined&&""!=n[r].path)if(this.searchInput.ddlEnvironments!=undefined&&0!=this.searchInput.ddlEnvironments.length){for(var l=0;l<this.searchInput.ddlEnvironments.length;l++)if(n[r].name==this.searchInput.ddlEnvironments[l].name){n[r].fullpath=this.searchInput.ddlEnvironments[l].environment+n[r].path;break}}else if(this.searchInput.listEnvironments!=undefined&&0!=this.searchInput.listEnvironments.length){for(l=0;l<this.searchInput.listEnvironments.length;l++)if(n[r].environment==this.searchInput.listEnvironments[l].environment){n[r].fullpath=this.searchInput.listEnvironments[l].url+n[r].path;break}}else n[r].fullpath=n[r].url;else n[r].fullpath=n[r].url;this.resolveObject(n[r],n[r].fullpath,o)}},S.prototype.SetProcessKey=function(e){var t=this.myForm.nativeElement[e].options,n=t[t.selectedIndex].value.trim();n&&(this.searchInput.integrationObj.requestObj.TaskDefinitionKey=n,this.searchInput.integrationObj.requestObj.ProcessKey="")},S.prototype.switchCase=function(t){for(var e=!1,n=0;n<t.conditions.length;n++){var i=this.searchInput.switchValue.findIndex(function(e){return e.property==t.conditions[n].property});if("EQ"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(this.searchInput.switchValue[i].value!=t.conditions[n].value){e=!1;break}e=!0}else{var r=localStorage.getItem("Username");if(this.searchInput.switchValue[i].value!=r){e=!1;break}e=!0}else if("NEQ"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(this.searchInput.switchValue[i].value==t.conditions[n].value){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),this.searchInput.switchValue[i].value==r){e=!1;break}e=!0}else if("GT"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value>t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value>r)){e=!1;break}e=!0}else if("GTE"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value>=t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value>=r)){e=!1;break}e=!0}else if("LT"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value<t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value<r)){e=!1;break}e=!0}else if("LTE"==t.conditions[n].restriction)if(1!=t.conditions[n].isUser){if(!(this.searchInput.switchValue[i].value<=t.conditions[n].value)){e=!1;break}e=!0}else{if(r=localStorage.getItem("Username"),!(this.searchInput.switchValue[i].value<=r)){e=!1;break}e=!0}}return e},S.prototype.DecryptString=function(e,t){if(t==undefined||""==t.trim()||e==undefined||""==e.trim())return e;var n=l.enc.Utf8.parse(t),i=l.lib.WordArray.create([0,0,0,0]);return l.AES.decrypt(e,n,{iv:i}).toString(l.enc.Utf8)},S.prototype.checkInputDate=function(t){var e,n,i,r=new Array,o=this.configuration.component.find(function(e){return e.name==t.name&&"GTE"==e.restriction.toUpperCase()})==undefined?this.configuration.component.find(function(e){return e.name==t.name&&"GT"==e.restriction.toUpperCase()}):this.configuration.component.find(function(e){return e.name==t.name&&"GTE"==e.restriction.toUpperCase()});o!=undefined&&(e=""==this.myForm.nativeElement[o.id].min?null:new Date(this.myForm.nativeElement[o.id].min),i=o.label.split(">",2),null!=e&&("GT"==o.restriction.toUpperCase()?(e.setDate(e.getDate()-1),r.push(" must be greater than ")):"GTE"==o.restriction.toUpperCase()&&r.push(" must be greater than or equals to ")));var a=this.configuration.component.find(function(e){return e.name==t.name&&"LTE"==e.restriction.toUpperCase()})==undefined?this.configuration.component.find(function(e){return e.name==t.name&&"LT"==e.restriction.toUpperCase()}):this.configuration.component.find(function(e){return e.name==t.name&&"LTE"==e.restriction.toUpperCase()});a!=undefined&&(n=""==this.myForm.nativeElement[a.id].max?null:new Date(this.myForm.nativeElement[a.id].max),i=a.label.split("<",2),null!=n&&("LT"==a.restriction.toUpperCase()?(n.setDate(n.getDate()+1),r.push(" must be less than ")):"LTE"==a.restriction.toUpperCase()&&r.push(" must be less than or equals to "))),null!=e&&null==n&&new Date(this.myForm.nativeElement[o.id].value)<e?(this.toastr.warning(i[0]+r[0]+f.formatDate(e,"dd MMMM yyyy","en-US")+"."),this.dateWrong=!0):null!=n&&null==e&&new Date(this.myForm.nativeElement[a.id].value)>n?(this.toastr.warning(i[0]+r[0]+f.formatDate(n,"dd MMMM yyyy","en-US")+"."),this.dateWrong=!0):null!=e&&null!=n&&(new Date(this.myForm.nativeElement[a.id].value)>n||new Date(this.myForm.nativeElement[o.id].value)<e)?(this.toastr.warning(i[0]+r[0]+f.formatDate(e,"dd MMMM yyyy","en-US")+" and"+r[1]+f.formatDate(n,"dd MMMM yyyy","en-US")+"."),this.dateWrong=!0):this.dateWrong=!1},S.decorators=[{type:u.Component,args:[{selector:"lib-UCSearch",template:'\x3c!-- Basic form layout section start --\x3e\r\n<section id="horizontal-form-layouts">\r\n <div class="row text-left">\r\n <div class="col-md-12">\r\n <div class="card">\r\n <div class="pl-3 mb-2 mt-2" *ngIf="configuration?.title != undefined && configuration?.title != \'\'">\r\n <h4 class="card-title ucSearch-title" translate>{{configuration.title}}</h4>\r\n </div>\r\n <div class="card-body">\r\n <div class="px-3">\r\n <form class="form form-horizontal" id="formSearch" #formIdSearch #enjiForm="ngForm"\r\n (ngSubmit)="enjiForm.valid && searchClick()">\r\n <div class="form-body">\r\n <h4 class="form-section font-weight-bold">\r\n <div (click)="changeState()" class="btn no-padding cursor-pointer flip">\r\n <i class="fa" style="font-size: 15px; margin: 0px 0px 5px -15px;"\r\n [ngClass]="isHidden ? \'fa-chevron-right\' : \'fa-chevron-down\'"></i>\r\n </div>\r\n <span\r\n *ngIf="configuration?.sectionTitle != undefined && configuration?.sectionTitle != \'\'; then inputSectionTitle else defaultSectionTitle"></span>\r\n <ng-template #inputSectionTitle>\r\n {{configuration?.sectionTitle}}\r\n </ng-template>\r\n <ng-template #defaultSectionTitle>\r\n Paging\r\n </ng-template>\r\n </h4>\r\n \x3c!-- Ini Digunakan untuk Generate Dynamic Component --\x3e\r\n \x3c!-- [hidden]="isHidden" --\x3e\r\n <div class="panel-active" [@changeDivSize]=currentState>\r\n <div class="row">\r\n <div class="col-md-6 form-group" *ngFor="let question of configuration?.component; let i = index">\r\n <div class="col-md-12">\r\n <div class="row">\r\n <label class="col-md-5 no-padding" for="{{question.id}}"\r\n [ngClass]="{\'adins-required-label\': (question.isRequired || (question?.ddlType != undefined && question.ddlType == \'one\'))}"\r\n translate>{{question.label}}</label>\r\n <div class="col-md-7 no-padding">\r\n <div *ngIf="question.type==\'textbox\'">\r\n <input type="text" id="{{question.id}}" class="form-control search-form-control" [ngModel]="question.value"\r\n [required]="question.isRequired" name="{{question.name}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\r\n attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n (keyup.enter)="searchClick()" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}" attr.data-restriction="{{question.restriction}}" attr.label="{{question.label}}"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n </div>\r\n <div *ngIf="question.type==\'textarea\'">\r\n <textarea type="text" id="{{question.id}}" class="form-control search-form-control" [ngModel]="question.value"\r\n [required]="question.isRequired" name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n value="{{question.value}}" attr.label="{{question.label}}"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }"></textarea>\r\n </div>\r\n <div *ngIf="question.type==\'numeric\'">\r\n <input type="number" id="{{question.id}}" (focus)="transformToDecimal($event)"\r\n (blur)="transformAmount($event)" class="form-control search-form-control" [ngModel]="question.value"\r\n [required]="question.isRequired" name="{{question.name+[i]}}" attr.data-required="{{question.isRequired}}"\r\n value="{{question.value}}" (keyup.enter)="searchClick()"\r\n attr.data-restriction="{{question.restriction}}" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}" attr.label="{{question.label}}"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name+[i]]?.touched || enjiForm.form.controls[question.name+[i]]?.dirty) && enjiForm.form.controls[question.name+[i]]?.invalid }">\r\n </div>\r\n <div *ngIf="question.type==\'currency\'">\r\n <div *ngIf="question?.isCustom != undefined && question?.isCustom">\r\n <input type="" id="{{question.id}}" class="form-control search-form-control"\r\n [required]="question.isRequired" name="{{question.name}}" (keyup.enter)="searchClick()"\r\n attr.data-restriction="{{question.restriction}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" currencyMask [ngModel]="question.value"\r\n [(ngModel)]="question.value" [ngModelOptions]="{standalone: true}" attr.label="{{question.label}}"\r\n [options]="{ thousands: question.thousands, decimal: question.decimal, align: question.align, allowNegative: question.allowNegative, allowZero: question.allowZero, precision: question.precision, nullable: question.nullable }"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n </div>\r\n <div *ngIf="question?.isCustom == undefined || !question?.isCustom">\r\n <input type="text" id="{{question.id}}" class="form-control search-form-control"\r\n [required]="question.isRequired" name="{{question.name}}" (keyup.enter)="searchClick()"\r\n attr.data-restriction="{{question.restriction}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" currencyMask [ngModel]="question.value"\r\n [(ngModel)]="question.value" [ngModelOptions]="{standalone: true}" attr.label="{{question.label}}"\r\n [options]="{ thousands: \',\', decimal: \'.\', align: \'right\', allowNegative: false, allowZero:true, precision: 2, nullable: false }"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n </div>\r\n </div>\r\n\r\n \x3c!-- End Hardcode Lookup didalem--\x3e\r\n <div *ngIf="question.type==\'datepicker\'">\r\n <input type="date" id="{{question.id}}"\r\n class="form-control search-form-control btn-lookup" name="{{question.name+[i]}}" [ngModel]="question.value"\r\n [required]="question.isRequired" attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n (keyup.enter)="searchClick()" attr.data-restriction="{{question.restriction}}" attr.label="{{question.label}}"\r\n min="{{question.minDate | date:\'yyyy-MM-dd\'}}" max="{{question.maxDate | date:\'yyyy-MM-dd\'}}" (focusout)="checkInputDate(question)"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name+[i]]?.touched || enjiForm.form.controls[question.name+[i]]?.dirty) && enjiForm.form.controls[question.name+[i]]?.invalid }">\r\n </div>\r\n <div *ngIf="question.type == \'taskDefinitionKey\' || question.type == \'officeRoleCodes\'">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.label="{{question.label}}"\r\n [hidden]="question?.itemsUrl.length == 1" (change)="question.type == \'taskDefinitionKey\' ? SetProcessKey(i) : SetRoleOfficeCodes(i)"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.itemsUrl.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.itemsUrl.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.itemsUrl" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.itemsUrl.length == 1">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf="question.type==\'dropdown\'">\r\n \x3c!-- Ini kalau datanya tidak di load dari URL --\x3e\r\n <div *ngIf="!question.isFromURL">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}" attr.label="{{question.label}}"\r\n [hidden]="question?.items.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.items.length != 1" value="one">\r\n Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.items.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.items" value="{{item.key}}">\r\n {{item.value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.items.length == 1">{{question.items[0].value}}</label>\r\n </div>\r\n \x3c!-- Ini kalau datanya di load dari URL --\x3e\r\n <div *ngIf="question.isFromURL">\r\n <div *ngIf="question.isEvent">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}" attr.label="{{question.label}}"\r\n (change)="onChangeEvent($event.target.value, question)"\r\n [hidden]="question?.itemsUrl.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.itemsUrl.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.itemsUrl.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.itemsUrl" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.itemsUrl.length == 1">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf="!question.isEvent">\r\n <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [required]="question.isRequired" class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.label="{{question.label}}"\r\n [hidden]="question?.itemsUrl.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[question.name]?.touched || enjiForm.form.controls[question.name]?.dirty) && enjiForm.form.controls[question.name]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && question?.itemsUrl.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && question?.itemsUrl.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of question?.itemsUrl" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n <label *ngIf="question?.itemsUrl.length == 1">{{question.itemsUrl[0].Value}}</label>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf="question.type==\'claim\'">\r\n <select name="{{\'claim\'+[i]}}" class="form-control search-form-control"\r\n attr.data-type="{{\'text\'}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}" attr.data-name="{{\'Assignee\'}}"\r\n [hidden]="ClaimList.length == 1"\r\n [ngClass]="{ \'is-invalid\':(enjiForm.submitted || enjiForm.form.controls[\'claim\'+[i]]?.touched || enjiForm.form.controls[\'claim\'+[i]]?.dirty) && enjiForm.form.controls[\'claim\'+[i]]?.invalid }">\r\n <option *ngIf="question.ddlType == \'one\' && ClaimList.length != 1"\r\n value="one">Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && ClaimList.length != 1"\r\n value="all">All</option>\r\n <option *ngFor="let item of ClaimList" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\r\n </div>\r\n <lib-uc-show-errors *ngIf="question.type!=\'datepicker\'" [control]="enjiForm.form.controls[question.name]"\r\n [submit]="enjiForm.submitted">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf="question.type==\'datepicker\'" [control]="enjiForm.form.controls[question.name+[i]]"\r\n [submit]="enjiForm.submitted">\r\n </lib-uc-show-errors>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-6 form-group" *ngIf="(isReport != undefined && isReport)">\r\n <div class="col-md-12">\r\n <div class="row">\r\n <label class="col-md-5 no-padding" translate>Report Type</label>\r\n <div class="col-md-7 no-padding">\r\n <select name="ExportType" [(ngModel)]="ExportType" class="form-control search-form-control"\r\n attr.data-type="text">\r\n <option *ngFor="let item of ExportTypeList" [value]="item.key">{{item.value}}</option>\r\n </select>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-12 no-padding">\r\n <div class="form-actions right">\r\n <button *ngIf="exportData == true" type="button" (click)="exportAsXLSX()"\r\n class="btn btn-raised btn-success mr-1" translate>\r\n <i class="fa ft-download"></i> Export Excel\r\n </button>\r\n <button type="button" (click)="reset()" class="btn btn-raised btn-warning mr-1" translate>\r\n <i class="fa fa-times"></i> Reset\r\n </button>\r\n <button *ngIf="(isReport == undefined || !isReport)" type="submit"\r\n class="btn btn-raised btn-primary" #UCSearchClick translate>\r\n <i class="fa fa-search"></i> Search\r\n </button>\r\n <button *ngIf="(isReport != undefined && isReport)" type="button" (click)="GenerateReport()"\r\n class="btn btn-raised btn-primary" translate>\r\n <i class="fa ft-download"></i> Generate Report\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n<br>\r\n\x3c!-- // Basic form layout section end --\x3e',providers:[x,f.DatePipe],animations:[r.trigger("changeDivSize",[r.state("initial",r.style({height:"*",opacity:"1"})),r.state("final",r.style({height:"0px",opacity:"0",overflow:"hidden"})),r.transition("initial=>final",r.animate("300ms")),r.transition("final=>initial",r.animate("300ms"))])],styles:[".ucSearch-title{margin:3px}"]}]}],S.ctorParameters=function(){return[{type:t.HttpClient},{type:x},{type:u.Renderer2},{type:undefined,decorators:[{type:u.Inject,args:[n.DOCUMENT]}]},{type:a.ToastrService},{type:s.CookieService},{type:f.DatePipe}]},S.propDecorators={content:[{type:u.ViewChild,args:["enjiForm"]}],myForm:[{type:u.ViewChild,args:["formIdSearch"]}],searchInput:[{type:u.Input}],pageSize:[{type:u.Input}],isReport:[{type:u.Input}],result:[{type:u.Output}],genRpt:[{type:u.Output}]},S);function S(e,t,n,i,r,o,a){this.http=e,this.excelService=t,this._renderer2=n,this._document=i,this.toastr=r,this.cookieService=o,this.datePipe=a,this.searchInput=new I,this.pageSize=10,this.isReport=!1,this.result=new u.EventEmitter,this.genRpt=new u.EventEmitter,this.ExportTypeList=[{key:F.EXP_TYPE_PDF,value:"PDF"},{key:F.EXP_TYPE_XLS,value:"Excel 2003"},{key:F.EXP_TYPE_XLSX,value:"Excel 2007"},{key:F.EXP_TYPE_DOC,value:"Document"},{key:F.EXP_TYPE_DOCX,value:"Document XML"}],this.ListOfMonth=new C,this.ListOfYear=new Array,this.ClaimList=[{Key:q.RestrictionIsNotNull,Value:"CLAIMED"},{Key:q.RestrictionIsNull,Value:"UNCLAIMED"}],this.ExportType=0,this.pageNow=1,this.isDataLoaded=!1,this.isHidden=!1,this.BusinessDt=new Date,this.dateWrong=!1,this.currentState="initial",this.countForm=0,this.formattedAmount="",this.amount=0}var U={align:"right",allowNegative:!1,allowZero:!0,decimal:".",precision:2,prefix:"",suffix:"",thousands:",",nullable:!1,inputMode:d.CurrencyMaskInputMode.NATURAL},L=(j.decorators=[{type:u.NgModule,args:[{declarations:[k],imports:[f.CommonModule,c.FormsModule,m.UcShowErrorsModule,h.UcDirectiveUpperCaseModule,d.NgxCurrencyModule.forRoot(U),p.TranslateModule.forChild()],exports:[k]}]}],j);function j(){}e.UCSearchService=g,e.UCSearchComponent=k,e.customCurrencyMaskConfig=U,e.UCSearchModule=L,e.ɵa=x,Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=adins-ucsearch.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ng://@adins/ucsearch/lib/ucsearch.service.ts","ng://@adins/ucsearch/lib/model/AdInstConstant.ts","ng://@adins/ucsearch/lib/model/IntegrationObj.model.ts","ng://@adins/ucsearch/lib/model/InputSearchObj.Model.ts","ng://@adins/ucsearch/lib/model/CriteriaObj.model.ts","ng://@adins/ucsearch/lib/model/RequestCriteriaObj.model.ts","ng://@adins/ucsearch/lib/services/excel-service/excel-service.ts","ng://@adins/ucsearch/lib/model/KeyValueReport.model.ts","ng://@adins/ucsearch/lib/model/KeyValueUCSearch.model.ts","ng://@adins/ucsearch/lib/ucsearch.component.ts","ng://@adins/ucsearch/lib/ucsearch.module.ts"],"names":["UCSearchService","Injectable","args","providedIn","AdInsConstant","RestrictionBetween","RestrictionLike","RestrictionEq","RestrictionNeq","RestrictionGt","RestrictionGte","RestrictionLt","RestrictionLte","RestrictionIn","RestrictionNotIn","RestrictionOr","RestrictionOrNeq","RestrictionIsNull","RestrictionIsNotNull","RestrictionGTE","RestrictionLTE","showData","JoinTypeInner","JoinTypeLeft","IntegrationObj","this","baseUrl","apiPath","requestObj","Object","leftColumnToJoin","rightColumnToJoin","joinType","InputSearchObj","_url","enviromentUrl","title","apiQryPaging","arrCritObj","addCritInput","Array","ddlEnvironments","listEnvironments","whereValue","switchValue","integrationObj","isJoinExAPI","CriteriaObj","low","high","DataType","isCriteriaDataTable","RequestCriteriaObj","includeCount","includeData","isLoading","queryString","rowVersion","ExcelService","prototype","exportAsExcelFile","json","excelFileName","worksheet","XLSX.utils","json_to_sheet","console","log","workbook","Sheets","data","SheetNames","excelBuffer","XLSX.write","bookType","type","saveAsExcelFile","buffer","fileName","Blob","FileSaver.saveAs","Date","getTime","ExportTypeConstant","EXP_TYPE_PDF","EXP_TYPE_XLS","EXP_TYPE_XLSX","EXP_TYPE_DOC","EXP_TYPE_DOCX","ListKeyValueMonth","ListOfMonth","push","key","value","UCSearchComponent","defineProperty","content","searchForm","changeState","currentState","isHidden","ngOnInit","apiUrl","searchInput","arrCrit","js","_renderer2","createElement","text","appendChild","_document","body","cookieService","get","BisDt","DecryptString","BusinessDt","initiateForm","_this","getJSON","subscribe","configuration","exportData","exportExcel","exportTypeList","undefined","length","ExportTypeList","ExportType","countForm","component","isDataLoaded","i","isFromURL","request","arrayCrit","criteriaObject","propName","criteriaPropName","criteriaPropValue","restriction","criteria","path","y","name","fullpath","environment","url","resolveObject","parseFloat","toLocaleString","dtmType","includes","getMonth","items","getFullYear","setYearDDL","businessDate","operator","charAt","dateShow","tempMinus","split","numDay","parseInt","setDate","getDate","dateText","formatDate","toUpperCase","minDate","datePipe","transform","maxDate","setTimeout","j","isEvent","itemsUrl","onChangeEvent","Key","SetRoleOfficeCodes","roleCode","listOfficeRoleCodes","ddlType","index","element","ddl","myForm","nativeElement","options","selectedIndex","trim","year","ListOfYear","equation","match","toMin","toMax","minMax","substring","toString","q","sort","a","b","http","postJSON","post","searchClick","order","orderby","pageNow","search","pageSize","reset","resetForm","pageNo","rowPerPage","orderBy","addCrit","IsQueryIn","IsBreak","querystring","whereQuery","x","i_1","critObj","getAttribute","nodeName","label","toastr","warning","ddlList","listValue","replace","response","qryPaging","result","emit","GenerateReport","genRpt","ElRef","lessThanFour","obj","crit","tempData","ReturnObject","exclude","filter","transformAmount","formattedAmount","target","transformToDecimal","exportAsXLSX","ExcelData","excelService","error","optValue","afFilter","jsonComp","affectedFilter","datatype","filterPropName","SetProcessKey","idx","selectedMappingCode","find","switchCase","condList","condition","conditions","findIndex","property","isUser","username","localStorage","getItem","chipperText","chipperKey","chipperKeyArr","CryptoJS.enc","Utf8","parse","iv","CryptoJS.lib","WordArray","create","CryptoJS.AES","decrypt","checkInputDate","minDateVal","maxDateVal","errorMessage","MinComponent","id","min","MaxComponent","max","dateWrong","Component","selector","template","providers","DatePipe","animations","trigger","state","style","height","opacity","overflow","transition","animate","HttpClient","Renderer2","Inject","DOCUMENT","ToastrService","CookieService","ViewChild","Input","Output","isReport","EventEmitter","ClaimList","Value","amount","customCurrencyMaskConfig","align","allowNegative","allowZero","decimal","precision","prefix","suffix","thousands","nullable","inputMode","CurrencyMaskInputMode","NATURAL","UCSearchModule","NgModule","declarations","imports","CommonModule","FormsModule","UcShowErrorsModule","UcDirectiveUpperCaseModule","NgxCurrencyModule","forRoot","TranslateModule","forChild","exports"],"mappings":"8nCAAA,IAAAA,uBAECC,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,uJAIZ,SAAAH,KCLF,IAAAI,GACkBA,EAAAC,mBAAqB,UACrBD,EAAAE,gBAAkB,OAClBF,EAAAG,cAAgB,KAChBH,EAAAI,eAAiB,MACjBJ,EAAAK,cAAgB,KAChBL,EAAAM,eAAiB,MACjBN,EAAAO,cAAgB,KAChBP,EAAAQ,eAAiB,MACjBR,EAAAS,cAAgB,KAChBT,EAAAU,iBAAmB,QACnBV,EAAAW,cAAgB,KAChBX,EAAAY,iBAAmB,QACnBZ,EAAAa,kBAAoB,SACpBb,EAAAc,qBAAuB,YACvBd,EAAAe,eAAiB,MACjBf,EAA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\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class UCSearchService {\r\n\r\n constructor() { }\r\n}\r\n","import { formatDate } from \"@angular/common\";\r\n\r\nexport class AdInsConstant {\r\n public static RestrictionBetween = \"Between\"\r\n public static RestrictionLike = \"Like\";\r\n public static RestrictionEq = \"Eq\";\r\n public static RestrictionNeq = \"NEQ\";\r\n public static RestrictionGt = \"GT\";\r\n public static RestrictionGte = \"GTE\";\r\n public static RestrictionLt = \"LT\";\r\n public static RestrictionLte = \"LTE\";\r\n public static RestrictionIn = \"IN\";\r\n public static RestrictionNotIn = \"NotIn\";\r\n public static RestrictionOr = \"Or\"; //pastikan ada 1 criteria sebelumnya\r\n public static RestrictionOrNeq = \"OrNeq\"; //pastikan ada 1 criteria sebelumnya\r\n public static RestrictionIsNull = \"ISNULL\";\r\n public static RestrictionIsNotNull = \"ISNOTNULL\";\r\n public static RestrictionGTE = \"GTE\";\r\n public static RestrictionLTE = \"LTE\";\r\n public static showData = \"10,50,100\";\r\n public static JoinTypeInner = \"INNER\";\r\n public static JoinTypeLeft = \"LEFT\";\r\n}\r\n","import { AdInsConstant } from \"./AdInstConstant\";\r\nexport class IntegrationObj {\r\n baseUrl: string;\r\n apiPath: string;\r\n requestObj: Object;\r\n leftColumnToJoin: string;\r\n rightColumnToJoin: string;\r\n joinType: string;\r\n \r\n constructor() {\r\n this.baseUrl = \"\";\r\n this.apiPath = \"\";\r\n this.requestObj = new Object();\r\n this.leftColumnToJoin = \"\";\r\n this.rightColumnToJoin = \"\";\r\n this.joinType = AdInsConstant.JoinTypeInner;\r\n }\r\n}","import { CriteriaObj } from \"./CriteriaObj.model\";\r\nimport { IntegrationObj } from \"./IntegrationObj.model\";\r\n \r\nexport class InputSearchObj {\r\n _url: string;\r\n enviromentUrl: string;\r\n title: string;\r\n apiQryPaging: string;\r\n arrCritObj: any;\r\n addCritInput: Array<CriteriaObj>;\r\n ddlEnvironments: Array<EnviObj>;\r\n listEnvironments: Array<EnvisObj>;\r\n whereValue: Array<WhereValueObj>;\r\n switchValue: Array<SwitchValueObj>;\r\n integrationObj: IntegrationObj;\r\n isJoinExAPI: boolean;\r\n \r\n constructor() {\r\n this._url = \"\";\r\n this.enviromentUrl = \"\";\r\n this.title = \"\";\r\n this.apiQryPaging = \"\";\r\n this.arrCritObj = null;\r\n this.addCritInput = new Array<CriteriaObj>();\r\n this.ddlEnvironments = new Array<EnviObj>();\r\n this.listEnvironments = new Array<EnvisObj>();\r\n this.whereValue = new Array<WhereValueObj>();\r\n this.switchValue = new Array<SwitchValueObj>();\r\n this.integrationObj = new IntegrationObj();\r\n this.isJoinExAPI = false;\r\n }\r\n}\r\n\r\nexport class EnviObj {\r\n name: string;\r\n environment: string;\r\n\r\n constructor() {\r\n this.name = \"\";\r\n this.environment = \"\";\r\n }\r\n}\r\n\r\nexport class WhereValueObj {\r\n property: string;\r\n value: any;\r\n\r\n constructor() {\r\n this.property = \"\";\r\n }\r\n}\r\n\r\nexport class SwitchValueObj {\r\n property: string;\r\n value: any;\r\n\r\n constructor() {\r\n this.property = \"\";\r\n }\r\n}\r\n\r\nexport class EnvisObj {\r\n environment: string;\r\n url: string;\r\n\r\n constructor() {\r\n this.environment = \"\";\r\n this.url = \"\";\r\n }\r\n}","export class CriteriaObj { \r\n propName: string;\r\n restriction: string;\r\n value: string;\r\n low: number;\r\n high: number;\r\n DataType: string;\r\n listValue: Array<any>;\r\n isCriteriaDataTable: boolean;\r\n\r\n constructor() {\r\n this.low = 0;\r\n this.high = 0;\r\n this.DataType = 'Text';\r\n this.isCriteriaDataTable = false;\r\n }\r\n\r\n}","import { AdInsConstant } from \"./AdInstConstant\";\r\nimport { CriteriaObj } from \"./CriteriaObj.model\";\r\nimport { IntegrationObj } from \"./IntegrationObj.model\";\r\n \r\nexport class RequestCriteriaObj{\r\n includeCount:boolean;\r\n includeData:boolean;\r\n pageNo:number;\r\n rowPerPage:number;\r\n orderBy:any;\r\n criteria:CriteriaObj[];\r\n isLoading : boolean;\r\n queryString: any;\r\n rowVersion: any;\r\n integrationObj: IntegrationObj;\r\n joinType: string;\r\n\r\n constructor()\r\n {\r\n this.includeCount=true;\r\n this.includeData=true;\r\n this.isLoading = true;\r\n this.queryString = '';\r\n this.rowVersion = '';\r\n this.integrationObj = new IntegrationObj();\r\n this.joinType = AdInsConstant.JoinTypeInner;\r\n }\r\n}","import { Injectable } from '@angular/core';\r\nimport * as FileSaver from 'file-saver';\r\nimport * as XLSX from 'xlsx';\r\n\r\nconst EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';\r\nconst EXCEL_EXTENSION = '.xlsx';\r\n\r\n@Injectable()\r\nexport class ExcelService {\r\n\r\n constructor() { }\r\n\r\n public exportAsExcelFile(json: any[], excelFileName: string): void {\r\n \r\n const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);\r\n console.log('worksheet',worksheet);\r\n const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };\r\n const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });\r\n //const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });\r\n this.saveAsExcelFile(excelBuffer, excelFileName);\r\n }\r\n\r\n private saveAsExcelFile(buffer: any, fileName: string): void {\r\n const data: Blob = new Blob([buffer], {\r\n type: EXCEL_TYPE\r\n });\r\n FileSaver.saveAs(data, fileName + '_export_' + new Date().getTime() + EXCEL_EXTENSION);\r\n }\r\n\r\n}","export class KeyValueReportObj {\r\n key: number;\r\n value: string;\r\n\r\n constructor() {\r\n this.key = 0;\r\n this.value = \"\";\r\n }\r\n}\r\n\r\nexport class ExportTypeConstant {\r\n public static EXP_TYPE_PDF = 0;\r\n public static EXP_TYPE_XLS = 1;\r\n public static EXP_TYPE_XLSX = 2;\r\n public static EXP_TYPE_DOC = 3;\r\n public static EXP_TYPE_DOCX = 4;\r\n}","export class KeyValueUCSearchObj {\r\n key: number;\r\n value: string;\r\n\r\n constructor() {\r\n this.key = 0;\r\n this.value = \"\";\r\n }\r\n}\r\n\r\nexport class ListKeyValueMonth {\r\n ListOfMonth: Array<KeyValueUCSearchObj>;\r\n constructor() {\r\n this.ListOfMonth = new Array<KeyValueUCSearchObj>();\r\n this.ListOfMonth.push({ key: 1, value: \"January\" });\r\n this.ListOfMonth.push({ key: 2, value: \"February\" });\r\n this.ListOfMonth.push({ key: 3, value: \"March\" });\r\n this.ListOfMonth.push({ key: 4, value: \"April\" });\r\n this.ListOfMonth.push({ key: 5, value: \"May\" });\r\n this.ListOfMonth.push({ key: 6, value: \"June\" });\r\n this.ListOfMonth.push({ key: 7, value: \"July\" });\r\n this.ListOfMonth.push({ key: 8, value: \"August\" });\r\n this.ListOfMonth.push({ key: 9, value: \"September\" });\r\n this.ListOfMonth.push({ key: 10, value: \"October\" });\r\n this.ListOfMonth.push({ key: 11, value: \"November\" });\r\n this.ListOfMonth.push({ key: 12, value: \"December\" });\r\n }\r\n}","import { Component, OnInit, Input, ViewChild, ElementRef, Inject, Renderer2, EventEmitter, Output } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { FormGroup, NgForm } from '@angular/forms';\r\nimport { DatePipe, formatDate } from '@angular/common';\r\nimport { InputSearchObj } from './model/InputSearchObj.Model';\r\nimport { CriteriaObj } from './model/CriteriaObj.model';\r\nimport { RequestCriteriaObj } from './model/RequestCriteriaObj.model';\r\nimport { AdInsConstant } from './model/AdInstConstant';\r\nimport { DOCUMENT } from '@angular/platform-browser';\r\nimport { ExcelService } from './services/excel-service/excel-service';\r\nimport { trigger, transition, style, animate, state } from '@angular/animations';\r\nimport { ToastrService } from 'ngx-toastr';\r\nimport { ExportTypeConstant, KeyValueReportObj } from './model/KeyValueReport.model';\r\nimport { CookieService } from 'ngx-cookie';\r\nimport * as CryptoJS from 'crypto-js';\r\nimport { KeyValueUCSearchObj, ListKeyValueMonth } from './model/KeyValueUCSearch.model';\r\n\r\n@Component({\r\n selector: 'lib-UCSearch',\r\n templateUrl: './ucsearch.component.html',\r\n styleUrls: ['./ucsearch.component.css'],\r\n providers: [ExcelService, DatePipe],\r\n animations: [\r\n trigger('changeDivSize', [\r\n state('initial', style({\r\n height: '*',\r\n opacity: '1',\r\n })),\r\n state('final', style({\r\n height: '0px',\r\n opacity: '0',\r\n overflow: 'hidden',\r\n })),\r\n transition('initial=>final', animate('300ms')),\r\n transition('final=>initial', animate('300ms'))\r\n ]),\r\n ]\r\n})\r\nexport class UCSearchComponent implements OnInit {\r\n // trus nad, bisa ga kalo misalkan gw mau bikin\r\n // kalo login di cabang IsSelectOne: true\r\n // kalo login di HO, IsSelectOne: false\r\n @ViewChild('enjiForm') set content(content: NgForm) {\r\n if (content) { // initially setter gets called with undefined\r\n this.searchForm = content;\r\n }\r\n }\r\n\r\n @ViewChild('formIdSearch') myForm: ElementRef;\r\n @Input() searchInput: InputSearchObj = new InputSearchObj();\r\n @Input() pageSize: number = 10;\r\n @Input() isReport: boolean = false;\r\n @Output() result: EventEmitter<any> = new EventEmitter();\r\n @Output() genRpt: EventEmitter<{ ExportType: number, ElRef: ElementRef }> = new EventEmitter<{ ExportType: number, ElRef: ElementRef }>();\r\n ExportTypeList: Array<KeyValueReportObj> = [\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_PDF,\r\n value: \"PDF\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_XLS,\r\n value: \"Excel 2003\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_XLSX,\r\n value: \"Excel 2007\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_DOC,\r\n value: \"Document\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_DOCX,\r\n value: \"Document XML\"\r\n },\r\n ];\r\n ListOfMonth: ListKeyValueMonth = new ListKeyValueMonth();\r\n ListOfYear: Array<KeyValueUCSearchObj> = new Array<KeyValueUCSearchObj>();\r\n ClaimList: Array<any> = [\r\n {\r\n Key: AdInsConstant.RestrictionIsNotNull,\r\n Value: \"CLAIMED\"\r\n },\r\n {\r\n Key: AdInsConstant.RestrictionIsNull,\r\n Value: \"UNCLAIMED\"\r\n },\r\n ];\r\n\r\n ExportType: number = 0;\r\n\r\n pageNow: any = 1;\r\n configuration: any;\r\n exportData: any;\r\n ExcelData: any;\r\n isDataLoaded: boolean = false;\r\n isHidden: boolean = false;\r\n BisDt: string;\r\n BusinessDt: Date = new Date();\r\n dateWrong: boolean = false;\r\n\r\n currentState = 'initial';\r\n\r\n form: FormGroup;\r\n countForm = 0;\r\n formattedAmount = '';\r\n amount = 0;\r\n apiUrl: string;\r\n arrCrit: any;\r\n searchForm: NgForm;\r\n\r\n constructor(private http: HttpClient, private excelService: ExcelService, private _renderer2: Renderer2,\r\n @Inject(DOCUMENT) private _document, public toastr: ToastrService, private cookieService: CookieService,\r\n private datePipe: DatePipe) {\r\n }\r\n\r\n changeState() {\r\n this.currentState = this.currentState === 'initial' ? 'final' : 'initial';\r\n this.isHidden = this.isHidden === false ? true : false;\r\n }\r\n\r\n ngOnInit() {\r\n console.log(\"ucsearch\");\r\n this.apiUrl = this.searchInput.enviromentUrl + this.searchInput.apiQryPaging;\r\n this.arrCrit = this.searchInput.arrCritObj;\r\n let js = this._renderer2.createElement('script');\r\n js.text = `\r\n $(document).ready(function(){\r\n $(\"#flip\").click(function(){\r\n $(\"#panel\").slideToggle(\"slow\");\r\n });\r\n });\r\n `;\r\n this._renderer2.appendChild(this._document.body, js);\r\n\r\n let value = this.cookieService.get('BusinessDateRaw');\r\n this.BisDt = this.DecryptString(value, \"AdInsFOU12345678\");\r\n this.BusinessDt = new Date(this.BisDt);\r\n this.initiateForm();\r\n }\r\n\r\n initiateForm() {\r\n this.getJSON(this.searchInput._url).subscribe(data => {\r\n this.configuration = data;\r\n this.exportData = data.exportExcel;\r\n if (data.exportTypeList != undefined && data.exportTypeList.length != 0) {\r\n this.ExportTypeList = data.exportTypeList;\r\n this.ExportType = this.ExportTypeList[0].key;\r\n }\r\n\r\n this.countForm = data.component.length;\r\n this.isDataLoaded = true;\r\n\r\n if (this.searchInput.title != undefined && this.searchInput.title != \"\") {\r\n this.configuration.title = this.searchInput.title;\r\n }\r\n\r\n for (var i = 0; i < this.countForm; i++) {\r\n //ini kalau datanya di load dari URL\r\n if (data.component[i].isFromURL == true) {\r\n var request = new RequestCriteriaObj();\r\n var arrayCrit = new Array();\r\n var criteriaObject = new CriteriaObj();\r\n criteriaObject.DataType = \"text\";\r\n criteriaObject.propName = data.component[i].criteriaPropName;\r\n criteriaObject.value = data.component[i].criteriaPropValue;\r\n criteriaObject.restriction = \"eq\";\r\n arrayCrit.push(criteriaObject);\r\n request.criteria = arrayCrit;\r\n request[data.component[i].criteriaPropName] = data.component[i].criteriaPropValue;\r\n\r\n // Pengecekan penggunaan url atau path\r\n if (data.component[i].path != undefined && data.component[i].path != \"\") {\r\n if (this.searchInput.ddlEnvironments != undefined && this.searchInput.ddlEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.ddlEnvironments.length; y++) {\r\n if (data.component[i].name == this.searchInput.ddlEnvironments[y].name) {\r\n data.component[i].fullpath = this.searchInput.ddlEnvironments[y].environment + data.component[i].path;\r\n break;\r\n }\r\n }\r\n } else if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {\r\n if (data.component[i].environment == this.searchInput.listEnvironments[y].environment) {\r\n data.component[i].fullpath = this.searchInput.listEnvironments[y].url + data.component[i].path;\r\n break;\r\n }\r\n }\r\n } else {\r\n data.component[i].fullpath = data.component[i].url;\r\n }\r\n\r\n } else {\r\n data.component[i].fullpath = data.component[i].url;\r\n }\r\n //lempar objectnya sekalian sama urlnya, nnti di bind di dalem karena masalah di asyncnya\r\n //biar tiap function ada state2nya sendiri\r\n this.resolveObject(data.component[i], data.component[i].fullpath, request);\r\n }\r\n\r\n if (data.component[i].type == \"numeric\") {\r\n data.component[i].value = parseFloat(data.component[i].value).toLocaleString('en');\r\n }\r\n\r\n //pengecekan ddl\r\n if (data.component[i].type == \"dropdown\") {\r\n if (data.component[i].dtmType != undefined) {\r\n if (data.component[i].dtmType == \"month\") {\r\n if (data.component[i].value != undefined && data.component[i].value.includes(\"BD\")) {\r\n data.component[i].value = this.BusinessDt.getMonth() + 1;\r\n }\r\n data.component[i].items = this.ListOfMonth.ListOfMonth;\r\n }\r\n if (data.component[i].dtmType.includes(\"year\")) {\r\n if (data.component[i].value != undefined && data.component[i].value.includes(\"BD\")) {\r\n data.component[i].value = this.BusinessDt.getFullYear();\r\n }\r\n data.component[i].items = this.setYearDDL(data.component[i].dtmType);\r\n }\r\n }\r\n }\r\n\r\n //pengecekan tanggal\r\n if (data.component[i].type == \"datepicker\") {\r\n if (data.component[i].value.includes(\"BD\")) {\r\n let businessDate = new Date();\r\n if (this.BisDt != null) {\r\n businessDate = new Date(this.BisDt);\r\n }\r\n var operator = data.component[i].value.charAt(2);\r\n var dateShow = new Date();\r\n if (operator == \"-\") {\r\n var tempMinus = data.component[i].value.split(\"-\", 2);\r\n var numDay = parseInt(tempMinus[1]);\r\n businessDate.setDate(businessDate.getDate() - numDay);\r\n }\r\n else if (operator == \"+\") {\r\n var tempMinus = data.component[i].value.split(\"+\", 2);\r\n var numDay = parseInt(tempMinus[1]);\r\n businessDate.setDate(businessDate.getDate() + numDay);\r\n }\r\n dateShow = businessDate;\r\n var dateText = formatDate(dateShow, 'yyyy-MM-dd', 'en-US')\r\n data.component[i].value = dateText;\r\n }\r\n\r\n if (data.component[i].restriction != undefined && data.component[i].restriction != \"\") {\r\n if (data.component[i].restriction.toUpperCase() == \"GT\") {\r\n let minDate = new Date(this.datePipe.transform(data.component[i].minDate, 'yyyy-MM-dd'));\r\n minDate.setDate(minDate.getDate() + 1);\r\n data.component[i].minDate = minDate;\r\n } else if (data.component[i].restriction.toUpperCase() == \"LT\") {\r\n let maxDate = new Date(this.datePipe.transform(data.component[i].maxDate, 'yyyy-MM-dd'));\r\n maxDate.setDate(maxDate.getDate() - 1);\r\n data.component[i].maxDate = maxDate;\r\n }\r\n }\r\n }\r\n }\r\n\r\n setTimeout(() => {\r\n for (let j = 0; j < this.countForm; j++) {\r\n if (data.component[j].isEvent == true && this.configuration.component[j].itemsUrl.length == 1) {\r\n this.onChangeEvent(data.component[j].itemsUrl[0].Key, data.component[j]);\r\n }\r\n if (data.component[j].type == \"officeRoleCodes\" && this.configuration.component[j].itemsUrl.length > 0) {\r\n this.SetRoleOfficeCodes(j);\r\n }\r\n }\r\n }, 1000);\r\n });\r\n }\r\n\r\n SetRoleOfficeCodes(i: number) {\r\n let value: string = this.cookieService.get(\"RoleCode\");\r\n let roleCode = this.DecryptString(value, \"AdInsFOU12345678\");\r\n let listOfficeRoleCodes: Array<string> = new Array();\r\n listOfficeRoleCodes.push(roleCode);\r\n if (this.configuration.component[i].itemsUrl.length == 1 && this.configuration.component[i].ddlType == 'all') {\r\n for (let index = 0; index < this.configuration.component[i].itemsUrl.length; index++) {\r\n const element = this.configuration.component[i].itemsUrl[index];\r\n listOfficeRoleCodes.push(element.Key);\r\n listOfficeRoleCodes.push(roleCode + \"-\" + element.Key);\r\n }\r\n } else {\r\n let component = this.myForm.nativeElement[i];\r\n let ddl = component.options;\r\n let text = ddl[ddl.selectedIndex].value.trim();\r\n listOfficeRoleCodes.push(text);\r\n listOfficeRoleCodes.push(roleCode + \"-\" + text);\r\n }\r\n\r\n this.searchInput.integrationObj.requestObj[\"OfficeRoleCodes\"] = listOfficeRoleCodes;\r\n }\r\n\r\n setYearDDL(year) {\r\n this.ListOfYear = new Array<KeyValueUCSearchObj>();\r\n let equation = year.match(\"[\\\\/+][-]|[-][\\\\/+]|\\\\/+|-\");\r\n let toMin: number = this.BusinessDt.getFullYear();\r\n let toMax: number = this.BusinessDt.getFullYear();\r\n let minMax: number = parseInt(year.substring(equation.index + equation[0].length));\r\n this.ListOfYear.push({ key: this.BusinessDt.getFullYear(), value: this.BusinessDt.getFullYear().toString() });\r\n\r\n for (let q = 0; q < minMax; q++) {\r\n if (equation[0] == \"-+\" || equation[0] == \"+-\") {\r\n toMin--;\r\n toMax++;\r\n this.ListOfYear.push({ key: toMin, value: toMin.toString() }, { key: toMax, value: toMax.toString() });\r\n } else if (equation[0] == \"-\") {\r\n toMin--;\r\n this.ListOfYear.push({ key: toMin, value: toMin.toString() });\r\n } else if (equation[0] == \"+\") {\r\n toMax++;\r\n this.ListOfYear.push({ key: toMax, value: toMax.toString() });\r\n }\r\n }\r\n this.ListOfYear.sort((a, b) => {\r\n return a.key - b.key;\r\n });\r\n return this.ListOfYear;\r\n }\r\n\r\n public getJSON(url: string): Observable<any> {\r\n return this.http.get(url);\r\n }\r\n\r\n public postJSON(url: string, criteria: any = null): Observable<any> {\r\n return this.http.post(url, criteria);\r\n }\r\n\r\n searchClick() {\r\n // for(let i=0;i<this.countForm;i++){\r\n // if(this.configuration.component[i].type == \"datepicker\"){\r\n // if ((i != (this.countForm-1)) && (this.configuration.component[i].name != this.configuration.component[i+1].name)){\r\n // this.checkInputDate(this.configuration.component[i]);\r\n // }\r\n // }\r\n // }\r\n // if(this.dateWrong) return;\r\n\r\n let order = null;\r\n if (this.configuration.orderby != null) {\r\n order = {\r\n key: this.configuration.orderby.key,\r\n value: this.configuration.orderby.value\r\n }\r\n }\r\n this.pageNow = 1;\r\n this.search(this.apiUrl, this.pageNow, this.pageSize, order, this.arrCrit);\r\n }\r\n\r\n reset() {\r\n this.searchForm.resetForm();\r\n this.ExportType = this.ExportTypeList[0].key;\r\n this.initiateForm();\r\n }\r\n\r\n search(apiUrl: string, pageNo: number, rowPerPage: number, orderBy: any, addCrit: CriteriaObj[] = new Array()) {\r\n let request = new RequestCriteriaObj();\r\n let arrCrit = new Array();\r\n let IsQueryIn = false;\r\n let IsBreak = false;\r\n\r\n // Inject whereQuery for where criteria\r\n if (this.searchInput.whereValue != undefined && this.searchInput.whereValue.length != 0) {\r\n this.configuration.querystring.whereQuery = new Array<any>();\r\n for (let x = 0; x < this.searchInput.whereValue.length; x++) {\r\n this.configuration.querystring.whereQuery.push(this.searchInput.whereValue[x].value);\r\n }\r\n }\r\n request.pageNo = pageNo;\r\n request.rowPerPage = rowPerPage;\r\n request.orderBy = orderBy;\r\n request.queryString = this.configuration.querystring;\r\n\r\n for (let i = 0; i < this.countForm; i++) {\r\n let critObj = new CriteriaObj();\r\n let component = this.myForm.nativeElement[i];\r\n\r\n // // popup message if required\r\n // if (component.getAttribute('data-required') != null && component.getAttribute('data-required') == \"true\") {\r\n // let val = component.value.trim();\r\n // if (val == \"\") {\r\n // IsBreak = true;\r\n // let label = component.getAttribute('label');\r\n // this.toastr.warning(\"Please input \" + label);\r\n // break;\r\n // }\r\n // }\r\n\r\n critObj.DataType = component.getAttribute('data-type');\r\n //Ini khusus kalau dari Drop Down\r\n if (component.getAttribute('query-in') != null && component.getAttribute('query-in') == \"true\") {\r\n IsQueryIn = true;\r\n }\r\n else {\r\n IsQueryIn = false;\r\n }\r\n if (component.value != \"\") {\r\n if (component.nodeName == 'SELECT') {\r\n let ddl = component.options;\r\n let text = ddl[ddl.selectedIndex].value.trim();\r\n if (text == \"one\") {\r\n IsBreak = true;\r\n let label = component.getAttribute('label');\r\n this.toastr.warning(\"Please select \" + label);\r\n break;\r\n }\r\n\r\n if (this.configuration.component[i].type == \"claim\") {\r\n critObj.propName = component.getAttribute('data-name');\r\n critObj.restriction = text;\r\n critObj.value = null;\r\n if (component.getAttribute('data-crit-datatable') != \"\" && component.getAttribute('data-crit-datatable') != null) {\r\n critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');\r\n }\r\n arrCrit.push(critObj);\r\n } else {\r\n if (text != \"all\" && text != \"one\") {\r\n //Kalau Dari Dropdown udah pasti pake Eq\r\n critObj.restriction = AdInsConstant.RestrictionEq;\r\n if (component.name != \"\") {\r\n critObj.propName = component.name;\r\n } else {\r\n critObj.propName = component.getAttribute('ng-reflect-name');\r\n }\r\n critObj.value = text;\r\n arrCrit.push(critObj);\r\n } else if (text == \"all\" && IsQueryIn == true && component.options.length != 0) {\r\n let ddlList = new Array();\r\n for (let x = 0; x < component.options.length; x++) {\r\n if (x != 0) {\r\n ddlList.push(component.options[x].value);\r\n }\r\n }\r\n if (ddlList.length != 0) {\r\n critObj.restriction = AdInsConstant.RestrictionIn;\r\n if (component.name != \"\") {\r\n critObj.propName = component.name;\r\n } else {\r\n critObj.propName = component.getAttribute('ng-reflect-name');\r\n }\r\n critObj.listValue = ddlList;\r\n arrCrit.push(critObj);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n //Kalau ada Percent maka yang dipake nnti adalah Restrictions Like\r\n if (component.name != \"\") {\r\n critObj.propName = component.name;\r\n } else {\r\n critObj.propName = component.getAttribute('data-name');\r\n }\r\n critObj.value = component.value.trim();\r\n if (component.value.includes(\"%\")) {\r\n critObj.restriction = AdInsConstant.RestrictionLike;\r\n }\r\n //kalau componentnya Date, restrictionsnya lgsg ambil dari property JSONnya\r\n else if (component.getAttribute('data-restriction') != \"\" && component.getAttribute('data-restriction') != null) {\r\n critObj.restriction = component.getAttribute('data-restriction');\r\n if (component.getAttribute('data-type') == 'numeric') {\r\n critObj.value = parseFloat(component.value.replace(/,/g, '')).toString();\r\n }\r\n if (critObj.restriction.toUpperCase() == \"LIKE\") {\r\n critObj.value = \"%\" + component.value.trim() + \"%\";\r\n critObj.restriction = AdInsConstant.RestrictionLike\r\n }\r\n }\r\n else {\r\n critObj.restriction = AdInsConstant.RestrictionEq\r\n }\r\n if (component.getAttribute('data-crit-datatable') != \"\" && component.getAttribute('data-crit-datatable') != null) {\r\n critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');\r\n }\r\n arrCrit.push(critObj);\r\n }\r\n }\r\n }\r\n\r\n if (IsBreak) {\r\n return;\r\n }\r\n\r\n if (addCrit != null && addCrit != undefined) {\r\n if (addCrit.length != 0) {\r\n for (var i = 0; i < addCrit.length; i++) {\r\n arrCrit.push(addCrit[i]);\r\n }\r\n } else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {\r\n for (var i = 0; i < this.searchInput.addCritInput.length; i++) {\r\n arrCrit.push(this.searchInput.addCritInput[i]);\r\n }\r\n }\r\n }\r\n else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {\r\n for (var i = 0; i < this.searchInput.addCritInput.length; i++) {\r\n arrCrit.push(this.searchInput.addCritInput[i]);\r\n }\r\n }\r\n\r\n request.criteria = arrCrit;\r\n\r\n if (!this.searchInput.isJoinExAPI) {\r\n request.integrationObj = null;\r\n } else {\r\n request.integrationObj = this.searchInput.integrationObj;\r\n }\r\n\r\n this.http.post(apiUrl, request).subscribe((response) => {\r\n let qryPaging = {\r\n response: response,\r\n pageNow: pageNo\r\n }\r\n console.log(qryPaging);\r\n this.result.emit(qryPaging);\r\n return response;\r\n });\r\n }\r\n\r\n GenerateReport() {\r\n this.genRpt.emit({ ExportType: this.ExportType, ElRef: this.myForm });\r\n }\r\n\r\n lessThanFour(): boolean {\r\n if (this.countForm > 3) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n\r\n resolveObject(obj: any, url: string, crit: RequestCriteriaObj = null) {\r\n const val = this.postJSON(url, crit);\r\n val.subscribe(tempData => {\r\n obj.itemsUrl = new Array();\r\n obj.itemsUrl = tempData.ReturnObject;\r\n\r\n if(obj.exclude != undefined && obj.exclude != \"\"){\r\n obj.itemsUrl = obj.itemsUrl.filter((value) => !obj.exclude.includes(value.Key));\r\n }\r\n });\r\n }\r\n\r\n transformAmount(element: any) {\r\n this.formattedAmount = parseFloat(element.target.value).toLocaleString('en');\r\n // to show the formatted amount in the textbox.\r\n element.target.value = this.formattedAmount;\r\n }\r\n\r\n transformToDecimal(element: any) {\r\n element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));\r\n }\r\n\r\n exportAsXLSX(): void {\r\n var request = new RequestCriteriaObj();\r\n request.pageNo = 1;\r\n request.rowPerPage = 9999;\r\n request.orderBy = null;\r\n request.criteria = [];\r\n request.queryString = this.configuration.querystring;\r\n if (!this.searchInput.isJoinExAPI) {\r\n request.integrationObj = null;\r\n } else {\r\n request.integrationObj = this.searchInput.integrationObj;\r\n }\r\n\r\n this.http.post(this.apiUrl, request).subscribe(\r\n response => {\r\n this.ExcelData = response[\"Data\"];\r\n this.excelService.exportAsExcelFile(this.ExcelData, 'sample');\r\n },\r\n (error) => {\r\n console.log(error);\r\n });\r\n }\r\n\r\n onChangeEvent(optValue, afFilter) {\r\n var jsonComp = this.configuration.component;\r\n\r\n for (var i = 0; i < afFilter.affectedFilter.length; i++) {\r\n for (var j = 0; j < jsonComp.length; j++) {\r\n if (jsonComp[j].name == afFilter.affectedFilter[i]) {\r\n var request = new RequestCriteriaObj();\r\n var arrayCrit = new Array();\r\n\r\n if (optValue != \"all\" && optValue != \"one\") {\r\n var critObj = new CriteriaObj();\r\n critObj.DataType = afFilter.datatype;\r\n if (afFilter.filterPropName != undefined || afFilter.filterPropName != \"\") {\r\n request[afFilter.filterPropName] = optValue;\r\n critObj.propName = afFilter.filterPropName;\r\n } else {\r\n critObj.propName = afFilter.name;\r\n request[afFilter.name] = optValue;\r\n }\r\n critObj.value = optValue;\r\n critObj.restriction = AdInsConstant.RestrictionEq;\r\n arrayCrit.push(critObj);\r\n }\r\n request.criteria = arrayCrit;\r\n if (jsonComp[j].path != undefined && jsonComp[j].path != \"\") {\r\n if (this.searchInput.ddlEnvironments != undefined && this.searchInput.ddlEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.ddlEnvironments.length; y++) {\r\n if (jsonComp[j].name == this.searchInput.ddlEnvironments[y].name) {\r\n jsonComp[j].fullpath = this.searchInput.ddlEnvironments[y].environment + jsonComp[j].path;\r\n break;\r\n }\r\n }\r\n } else if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {\r\n if (jsonComp[j].environment == this.searchInput.listEnvironments[y].environment) {\r\n jsonComp[j].fullpath = this.searchInput.listEnvironments[y].url + jsonComp[j].path;\r\n break;\r\n }\r\n }\r\n } else {\r\n jsonComp[j].fullpath = jsonComp[j].url;\r\n }\r\n\r\n } else {\r\n jsonComp[j].fullpath = jsonComp[j].url;\r\n }\r\n this.resolveObject(jsonComp[j], jsonComp[j].fullpath, request);\r\n }\r\n }\r\n }\r\n }\r\n\r\n SetProcessKey(idx: number) {\r\n console.log(idx);\r\n let component = this.myForm.nativeElement[idx];\r\n let ddl = component.options;\r\n let text = ddl[ddl.selectedIndex].value.trim();\r\n if (text) {\r\n let selectedMappingCode: string = this.configuration.component[idx].itemsUrl.find(x => x.Key == text);\r\n this.searchInput.integrationObj.requestObj[\"TaskDefinitionKey\"] = text;\r\n this.searchInput.integrationObj.requestObj[\"ProcessKey\"] = selectedMappingCode;\r\n }\r\n }\r\n\r\n switchCase(condList) {\r\n var condition = false;\r\n\r\n for (var i = 0; i < condList.conditions.length; i++) {\r\n var idx = this.searchInput.switchValue.findIndex(x => x.property == condList.conditions[i].property);\r\n if (condList.conditions[i].restriction == \"EQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value == condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value == username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"NEQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value != condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value != username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value > condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value > username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value >= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value >= username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value < condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value < username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value <= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value <= username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return condition;\r\n\r\n }\r\n\r\n private DecryptString(chipperText: string, chipperKey: string) {\r\n if (\r\n chipperKey == undefined || chipperKey.trim() == '' ||\r\n chipperText == undefined || chipperText.trim() == ''\r\n ) return chipperText;\r\n var chipperKeyArr = CryptoJS.enc.Utf8.parse(chipperKey);\r\n var iv = CryptoJS.lib.WordArray.create([0x00, 0x00, 0x00, 0x00]);\r\n var decrypted = CryptoJS.AES.decrypt(chipperText, chipperKeyArr, { iv: iv });\r\n var plainText = decrypted.toString(CryptoJS.enc.Utf8);\r\n return plainText;\r\n }\r\n\r\n checkInputDate(component: any) {\r\n let minDateVal;\r\n let maxDateVal;\r\n let label;\r\n let errorMessage = new Array<string>();\r\n\r\n let MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"GTE\")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"GT\")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"GTE\"));\r\n if (MinComponent != undefined) {\r\n minDateVal = this.myForm.nativeElement[MinComponent.id].min == \"\" ? null : new Date(this.myForm.nativeElement[MinComponent.id].min);\r\n label = MinComponent.label.split(\">\", 2);\r\n if (minDateVal != null) {\r\n if (MinComponent.restriction.toUpperCase() == \"GT\") {\r\n minDateVal.setDate(minDateVal.getDate() - 1);\r\n errorMessage.push(\" must be greater than \");\r\n } else if (MinComponent.restriction.toUpperCase() == \"GTE\") {\r\n errorMessage.push(\" must be greater than or equals to \");\r\n }\r\n }\r\n }\r\n\r\n let MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"LTE\")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"LT\")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"LTE\"));\r\n if (MaxComponent != undefined) {\r\n maxDateVal = this.myForm.nativeElement[MaxComponent.id].max == \"\" ? null : new Date(this.myForm.nativeElement[MaxComponent.id].max);\r\n label = MaxComponent.label.split(\"<\", 2);\r\n if (maxDateVal != null) {\r\n if (MaxComponent.restriction.toUpperCase() == \"LT\") {\r\n maxDateVal.setDate(maxDateVal.getDate() + 1);\r\n errorMessage.push(\" must be less than \");\r\n } else if (MaxComponent.restriction.toUpperCase() == \"LTE\") {\r\n errorMessage.push(\" must be less than or equals to \");\r\n }\r\n }\r\n }\r\n\r\n if (minDateVal != null && maxDateVal == null && new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {\r\n this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + \".\")\r\n this.dateWrong = true;\r\n } else if (maxDateVal != null && minDateVal == null && new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal) {\r\n this.toastr.warning(label[0] + errorMessage[0] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + \".\")\r\n this.dateWrong = true;\r\n } else if (minDateVal != null && maxDateVal != null) {\r\n if (new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal || new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {\r\n this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + \" and\" + errorMessage[1] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + \".\")\r\n this.dateWrong = true;\r\n } else {\r\n this.dateWrong = false;\r\n }\r\n } else {\r\n this.dateWrong = false;\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { UCSearchComponent } from './ucsearch.component';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CurrencyMaskInputMode, NgxCurrencyModule } from 'ngx-currency';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { UcShowErrorsModule } from '@adins/uc-show-errors';\r\nimport { UcDirectiveUpperCaseModule } from '@adins/uc-directive-upper-case';\r\n\r\nexport const customCurrencyMaskConfig = { \r\n align: \"right\",\r\n allowNegative: false,\r\n allowZero: true,\r\n decimal: \".\",\r\n precision: 2,\r\n prefix: \"\",\r\n suffix: \"\",\r\n thousands: \",\",\r\n nullable: false,\r\n inputMode: CurrencyMaskInputMode.NATURAL };\r\n\r\n@NgModule({\r\n declarations: [UCSearchComponent],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n UcShowErrorsModule,\r\n UcDirectiveUpperCaseModule,\r\n NgxCurrencyModule.forRoot(customCurrencyMaskConfig),\r\n TranslateModule.forChild()\r\n ],\r\n exports: [UCSearchComponent]\r\n})\r\nexport class UCSearchModule { }\r\n"]}
1
+ {"version":3,"sources":["ng://@adins/ucsearch/lib/ucsearch.service.ts","ng://@adins/ucsearch/lib/model/AdInstConstant.ts","ng://@adins/ucsearch/lib/model/IntegrationObj.model.ts","ng://@adins/ucsearch/lib/model/InputSearchObj.Model.ts","ng://@adins/ucsearch/lib/model/CriteriaObj.model.ts","ng://@adins/ucsearch/lib/model/RequestCriteriaObj.model.ts","ng://@adins/ucsearch/lib/services/excel-service/excel-service.ts","ng://@adins/ucsearch/lib/model/KeyValueReport.model.ts","ng://@adins/ucsearch/lib/model/KeyValueUCSearch.model.ts","ng://@adins/ucsearch/lib/ucsearch.component.ts","ng://@adins/ucsearch/lib/ucsearch.module.ts"],"names":["UCSearchService","Injectable","args","providedIn","AdInsConstant","RestrictionBetween","RestrictionLike","RestrictionEq","RestrictionNeq","RestrictionGt","RestrictionGte","RestrictionLt","RestrictionLte","RestrictionIn","RestrictionNotIn","RestrictionOr","RestrictionOrNeq","RestrictionIsNull","RestrictionIsNotNull","RestrictionGTE","RestrictionLTE","showData","JoinTypeInner","JoinTypeLeft","IntegrationObj","this","baseUrl","apiPath","requestObj","Object","leftColumnToJoin","rightColumnToJoin","joinType","InputSearchObj","_url","enviromentUrl","title","apiQryPaging","arrCritObj","addCritInput","Array","ddlEnvironments","listEnvironments","whereValue","switchValue","integrationObj","isJoinExAPI","CriteriaObj","low","high","DataType","isCriteriaDataTable","RequestCriteriaObj","includeCount","includeData","isLoading","queryString","rowVersion","ExcelService","prototype","exportAsExcelFile","json","excelFileName","worksheet","XLSX.utils","json_to_sheet","console","log","workbook","Sheets","data","SheetNames","excelBuffer","XLSX.write","bookType","type","saveAsExcelFile","buffer","fileName","Blob","FileSaver.saveAs","Date","getTime","ExportTypeConstant","EXP_TYPE_PDF","EXP_TYPE_XLS","EXP_TYPE_XLSX","EXP_TYPE_DOC","EXP_TYPE_DOCX","ListKeyValueMonth","ListOfMonth","push","key","value","UCSearchComponent","defineProperty","content","searchForm","changeState","currentState","isHidden","ngOnInit","apiUrl","searchInput","arrCrit","js","_renderer2","createElement","text","appendChild","_document","body","cookieService","get","BisDt","DecryptString","BusinessDt","initiateForm","_this","getJSON","subscribe","configuration","exportData","exportExcel","exportTypeList","undefined","length","ExportTypeList","ExportType","countForm","component","isDataLoaded","i","isFromURL","request","arrayCrit","criteriaObject","propName","criteriaPropName","criteriaPropValue","restriction","criteria","path","y","name","fullpath","environment","url","resolveObject","parseFloat","toLocaleString","dtmType","includes","getMonth","items","getFullYear","setYearDDL","businessDate","operator","charAt","dateShow","tempMinus","split","numDay","parseInt","setDate","getDate","dateText","formatDate","toUpperCase","minDate","datePipe","transform","maxDate","setTimeout","j","isEvent","itemsUrl","onChangeEvent","Key","SetRoleOfficeCodes","roleCode","JSON","parse","listOfficeRoleCodes","ddlType","index","element","ddl","myForm","nativeElement","options","selectedIndex","trim","year","ListOfYear","equation","match","toMin","toMax","minMax","substring","toString","q","sort","a","b","http","postJSON","post","searchClick","order","orderby","pageNow","search","pageSize","reset","resetForm","pageNo","rowPerPage","orderBy","addCrit","IsQueryIn","IsBreak","querystring","whereQuery","x","i_1","critObj","getAttribute","nodeName","label","toastr","warning","ddlList","listValue","replace","response","qryPaging","result","emit","GenerateReport","genRpt","ElRef","lessThanFour","obj","crit","tempData","ReturnObject","exclude","filter","transformAmount","formattedAmount","target","transformToDecimal","exportAsXLSX","ExcelData","excelService","error","optValue","afFilter","jsonComp","affectedFilter","datatype","filterPropName","SetProcessKey","idx","switchCase","condList","condition","conditions","findIndex","property","isUser","username","localStorage","getItem","chipperText","chipperKey","chipperKeyArr","CryptoJS.enc","Utf8","iv","CryptoJS.lib","WordArray","create","CryptoJS.AES","decrypt","checkInputDate","minDateVal","maxDateVal","errorMessage","MinComponent","find","id","min","MaxComponent","max","dateWrong","Component","selector","template","providers","DatePipe","animations","trigger","state","style","height","opacity","overflow","transition","animate","HttpClient","Renderer2","Inject","DOCUMENT","ToastrService","CookieService","ViewChild","Input","Output","isReport","EventEmitter","ClaimList","Value","amount","customCurrencyMaskConfig","align","allowNegative","allowZero","decimal","precision","prefix","suffix","thousands","nullable","inputMode","CurrencyMaskInputMode","NATURAL","UCSearchModule","NgModule","declarations","imports","CommonModule","FormsModule","UcShowErrorsModule","UcDirectiveUpperCaseModule","NgxCurrencyModule","forRoot","TranslateModule","forChild","exports"],"mappings":"8nCAAA,IAAAA,uBAECC,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,uJAIZ,SAAAH,KCLF,IAAAI,GACkBA,EAAAC,mBAAqB,UACrBD,EAAAE,gBAAkB,OAClBF,EAAAG,cAAgB,KAChBH,EAAAI,eAAiB,MACjBJ,EAAAK,cAAgB,KAChBL,EAAAM,eAAiB,MACjBN,EAAAO,cAAgB,KAChBP,EAAAQ,eAAiB,MACjBR,EAAAS,cAAgB,KAChBT,EAAAU,iBAAmB,QACnBV,EAAAW,cAAgB,KAChBX,EAAAY,iBAAmB,QACnBZ,EAAAa,kBAAoB,SACpBb,EAAAc,qBAAuB,YACvBd,EAAAe,eAAiB,MACjBf,EAAAgB,eAAiB,MACjBhB,EAAAiB,SAAW,YACXjB,EAAAkB,cAAgB,QAChBlB,EAAAmB,aAAe,OACjCnB,GApBA,SAAAA,KCDA,IAAAoB,EAQI,SAAAA,IACIC,KAAKC,QAAU,GACfD,KAAKE,QAAU,GACfF,KAAKG,WAAa,IAAIC,OACtBJ,KAAKK,iBAAmB,GACxBL,KAAKM,kBAAoB,GACzBN,KAAKO,SAAW5B,EAAckB,eCZtCW,EAcI,SAAAA,IACIR,KAAKS,KAAO,GACZT,KAAKU,cAAgB,GACrBV,KAAKW,MAAQ,GACbX,KAAKY,aAAe,GACpBZ,KAAKa,WAAa,KAClBb,KAAKc,aAAe,IAAIC,MACxBf,KAAKgB,gBAAkB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S,KAAAuG,WAAqB,EAErBvG,KAAA4L,QAAe,EAIf5L,KAAA0G,cAAwB,EACxB1G,KAAA2E,UAAoB,EAEpB3E,KAAA2F,WAAmB,IAAInC,KACvBxD,KAAAiR,WAAqB,EAErBjR,KAAA0E,aAAe,UAGf1E,KAAAwG,UAAY,EACZxG,KAAAmO,gBAAkB,GAClBnO,KAAA6S,OAAS,EClGX,IAAaC,EAA2B,CACtCC,MAAO,QACPC,eAAe,EACfC,WAAW,EACXC,QAAS,IACTC,UAAW,EACXC,OAAQ,GACRC,OAAQ,GACRC,UAAW,IACXC,UAAU,EACVC,UAAWC,EAAAA,sBAAsBC,SAEnCC,uBAACC,EAAAA,SAAQnV,KAAA,CAAC,CACRoV,aAAc,CAACxP,GACfyP,QAAS,CACPC,EAAAA,aACAC,EAAAA,YACAC,EAAAA,mBACAC,EAAAA,2BACAC,EAAAA,kBAAkBC,QAAQtB,GAC1BuB,EAAAA,gBAAgBC,YAElBC,QAAS,CAAClQ,OAEkBsP,GAZ9B,SAAAA","sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class UCSearchService {\r\n\r\n constructor() { }\r\n}\r\n","import { formatDate } from \"@angular/common\";\r\n\r\nexport class AdInsConstant {\r\n public static RestrictionBetween = \"Between\"\r\n public static RestrictionLike = \"Like\";\r\n public static RestrictionEq = \"Eq\";\r\n public static RestrictionNeq = \"NEQ\";\r\n public static RestrictionGt = \"GT\";\r\n public static RestrictionGte = \"GTE\";\r\n public static RestrictionLt = \"LT\";\r\n public static RestrictionLte = \"LTE\";\r\n public static RestrictionIn = \"IN\";\r\n public static RestrictionNotIn = \"NotIn\";\r\n public static RestrictionOr = \"Or\"; //pastikan ada 1 criteria sebelumnya\r\n public static RestrictionOrNeq = \"OrNeq\"; //pastikan ada 1 criteria sebelumnya\r\n public static RestrictionIsNull = \"ISNULL\";\r\n public static RestrictionIsNotNull = \"ISNOTNULL\";\r\n public static RestrictionGTE = \"GTE\";\r\n public static RestrictionLTE = \"LTE\";\r\n public static showData = \"10,50,100\";\r\n public static JoinTypeInner = \"INNER\";\r\n public static JoinTypeLeft = \"LEFT\";\r\n}\r\n","import { AdInsConstant } from \"./AdInstConstant\";\r\nexport class IntegrationObj {\r\n baseUrl: string;\r\n apiPath: string;\r\n requestObj: Object;\r\n leftColumnToJoin: string;\r\n rightColumnToJoin: string;\r\n joinType: string;\r\n \r\n constructor() {\r\n this.baseUrl = \"\";\r\n this.apiPath = \"\";\r\n this.requestObj = new Object();\r\n this.leftColumnToJoin = \"\";\r\n this.rightColumnToJoin = \"\";\r\n this.joinType = AdInsConstant.JoinTypeInner;\r\n }\r\n}","import { CriteriaObj } from \"./CriteriaObj.model\";\r\nimport { IntegrationObj } from \"./IntegrationObj.model\";\r\n \r\nexport class InputSearchObj {\r\n _url: string;\r\n enviromentUrl: string;\r\n title: string;\r\n apiQryPaging: string;\r\n arrCritObj: any;\r\n addCritInput: Array<CriteriaObj>;\r\n ddlEnvironments: Array<EnviObj>;\r\n listEnvironments: Array<EnvisObj>;\r\n whereValue: Array<WhereValueObj>;\r\n switchValue: Array<SwitchValueObj>;\r\n integrationObj: IntegrationObj;\r\n isJoinExAPI: boolean;\r\n \r\n constructor() {\r\n this._url = \"\";\r\n this.enviromentUrl = \"\";\r\n this.title = \"\";\r\n this.apiQryPaging = \"\";\r\n this.arrCritObj = null;\r\n this.addCritInput = new Array<CriteriaObj>();\r\n this.ddlEnvironments = new Array<EnviObj>();\r\n this.listEnvironments = new Array<EnvisObj>();\r\n this.whereValue = new Array<WhereValueObj>();\r\n this.switchValue = new Array<SwitchValueObj>();\r\n this.integrationObj = new IntegrationObj();\r\n this.isJoinExAPI = false;\r\n }\r\n}\r\n\r\nexport class EnviObj {\r\n name: string;\r\n environment: string;\r\n\r\n constructor() {\r\n this.name = \"\";\r\n this.environment = \"\";\r\n }\r\n}\r\n\r\nexport class WhereValueObj {\r\n property: string;\r\n value: any;\r\n\r\n constructor() {\r\n this.property = \"\";\r\n }\r\n}\r\n\r\nexport class SwitchValueObj {\r\n property: string;\r\n value: any;\r\n\r\n constructor() {\r\n this.property = \"\";\r\n }\r\n}\r\n\r\nexport class EnvisObj {\r\n environment: string;\r\n url: string;\r\n\r\n constructor() {\r\n this.environment = \"\";\r\n this.url = \"\";\r\n }\r\n}","export class CriteriaObj { \r\n propName: string;\r\n restriction: string;\r\n value: string;\r\n low: number;\r\n high: number;\r\n DataType: string;\r\n listValue: Array<any>;\r\n isCriteriaDataTable: boolean;\r\n\r\n constructor() {\r\n this.low = 0;\r\n this.high = 0;\r\n this.DataType = 'Text';\r\n this.isCriteriaDataTable = false;\r\n }\r\n\r\n}","import { AdInsConstant } from \"./AdInstConstant\";\r\nimport { CriteriaObj } from \"./CriteriaObj.model\";\r\nimport { IntegrationObj } from \"./IntegrationObj.model\";\r\n \r\nexport class RequestCriteriaObj{\r\n includeCount:boolean;\r\n includeData:boolean;\r\n pageNo:number;\r\n rowPerPage:number;\r\n orderBy:any;\r\n criteria:CriteriaObj[];\r\n isLoading : boolean;\r\n queryString: any;\r\n rowVersion: any;\r\n integrationObj: IntegrationObj;\r\n joinType: string;\r\n\r\n constructor()\r\n {\r\n this.includeCount=true;\r\n this.includeData=true;\r\n this.isLoading = true;\r\n this.queryString = '';\r\n this.rowVersion = '';\r\n this.integrationObj = new IntegrationObj();\r\n this.joinType = AdInsConstant.JoinTypeInner;\r\n }\r\n}","import { Injectable } from '@angular/core';\r\nimport * as FileSaver from 'file-saver';\r\nimport * as XLSX from 'xlsx';\r\n\r\nconst EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';\r\nconst EXCEL_EXTENSION = '.xlsx';\r\n\r\n@Injectable()\r\nexport class ExcelService {\r\n\r\n constructor() { }\r\n\r\n public exportAsExcelFile(json: any[], excelFileName: string): void {\r\n \r\n const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);\r\n console.log('worksheet',worksheet);\r\n const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };\r\n const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });\r\n //const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });\r\n this.saveAsExcelFile(excelBuffer, excelFileName);\r\n }\r\n\r\n private saveAsExcelFile(buffer: any, fileName: string): void {\r\n const data: Blob = new Blob([buffer], {\r\n type: EXCEL_TYPE\r\n });\r\n FileSaver.saveAs(data, fileName + '_export_' + new Date().getTime() + EXCEL_EXTENSION);\r\n }\r\n\r\n}","export class KeyValueReportObj {\r\n key: number;\r\n value: string;\r\n\r\n constructor() {\r\n this.key = 0;\r\n this.value = \"\";\r\n }\r\n}\r\n\r\nexport class ExportTypeConstant {\r\n public static EXP_TYPE_PDF = 0;\r\n public static EXP_TYPE_XLS = 1;\r\n public static EXP_TYPE_XLSX = 2;\r\n public static EXP_TYPE_DOC = 3;\r\n public static EXP_TYPE_DOCX = 4;\r\n}","export class KeyValueUCSearchObj {\r\n key: number;\r\n value: string;\r\n\r\n constructor() {\r\n this.key = 0;\r\n this.value = \"\";\r\n }\r\n}\r\n\r\nexport class ListKeyValueMonth {\r\n ListOfMonth: Array<KeyValueUCSearchObj>;\r\n constructor() {\r\n this.ListOfMonth = new Array<KeyValueUCSearchObj>();\r\n this.ListOfMonth.push({ key: 1, value: \"January\" });\r\n this.ListOfMonth.push({ key: 2, value: \"February\" });\r\n this.ListOfMonth.push({ key: 3, value: \"March\" });\r\n this.ListOfMonth.push({ key: 4, value: \"April\" });\r\n this.ListOfMonth.push({ key: 5, value: \"May\" });\r\n this.ListOfMonth.push({ key: 6, value: \"June\" });\r\n this.ListOfMonth.push({ key: 7, value: \"July\" });\r\n this.ListOfMonth.push({ key: 8, value: \"August\" });\r\n this.ListOfMonth.push({ key: 9, value: \"September\" });\r\n this.ListOfMonth.push({ key: 10, value: \"October\" });\r\n this.ListOfMonth.push({ key: 11, value: \"November\" });\r\n this.ListOfMonth.push({ key: 12, value: \"December\" });\r\n }\r\n}","import { Component, OnInit, Input, ViewChild, ElementRef, Inject, Renderer2, EventEmitter, Output } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { FormGroup, NgForm } from '@angular/forms';\r\nimport { DatePipe, formatDate } from '@angular/common';\r\nimport { InputSearchObj } from './model/InputSearchObj.Model';\r\nimport { CriteriaObj } from './model/CriteriaObj.model';\r\nimport { RequestCriteriaObj } from './model/RequestCriteriaObj.model';\r\nimport { AdInsConstant } from './model/AdInstConstant';\r\nimport { DOCUMENT } from '@angular/platform-browser';\r\nimport { ExcelService } from './services/excel-service/excel-service';\r\nimport { trigger, transition, style, animate, state } from '@angular/animations';\r\nimport { ToastrService } from 'ngx-toastr';\r\nimport { ExportTypeConstant, KeyValueReportObj } from './model/KeyValueReport.model';\r\nimport { CookieService } from 'ngx-cookie';\r\nimport * as CryptoJS from 'crypto-js';\r\nimport { KeyValueUCSearchObj, ListKeyValueMonth } from './model/KeyValueUCSearch.model';\r\n\r\n@Component({\r\n selector: 'lib-UCSearch',\r\n templateUrl: './ucsearch.component.html',\r\n styleUrls: ['./ucsearch.component.css'],\r\n providers: [ExcelService, DatePipe],\r\n animations: [\r\n trigger('changeDivSize', [\r\n state('initial', style({\r\n height: '*',\r\n opacity: '1',\r\n })),\r\n state('final', style({\r\n height: '0px',\r\n opacity: '0',\r\n overflow: 'hidden',\r\n })),\r\n transition('initial=>final', animate('300ms')),\r\n transition('final=>initial', animate('300ms'))\r\n ]),\r\n ]\r\n})\r\nexport class UCSearchComponent implements OnInit {\r\n // trus nad, bisa ga kalo misalkan gw mau bikin\r\n // kalo login di cabang IsSelectOne: true\r\n // kalo login di HO, IsSelectOne: false\r\n @ViewChild('enjiForm') set content(content: NgForm) {\r\n if (content) { // initially setter gets called with undefined\r\n this.searchForm = content;\r\n }\r\n }\r\n\r\n @ViewChild('formIdSearch') myForm: ElementRef;\r\n @Input() searchInput: InputSearchObj = new InputSearchObj();\r\n @Input() pageSize: number = 10;\r\n @Input() isReport: boolean = false;\r\n @Output() result: EventEmitter<any> = new EventEmitter();\r\n @Output() genRpt: EventEmitter<{ ExportType: number, ElRef: ElementRef }> = new EventEmitter<{ ExportType: number, ElRef: ElementRef }>();\r\n ExportTypeList: Array<KeyValueReportObj> = [\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_PDF,\r\n value: \"PDF\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_XLS,\r\n value: \"Excel 2003\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_XLSX,\r\n value: \"Excel 2007\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_DOC,\r\n value: \"Document\"\r\n },\r\n {\r\n key: ExportTypeConstant.EXP_TYPE_DOCX,\r\n value: \"Document XML\"\r\n },\r\n ];\r\n ListOfMonth: ListKeyValueMonth = new ListKeyValueMonth();\r\n ListOfYear: Array<KeyValueUCSearchObj> = new Array<KeyValueUCSearchObj>();\r\n ClaimList: Array<any> = [\r\n {\r\n Key: AdInsConstant.RestrictionIsNotNull,\r\n Value: \"CLAIMED\"\r\n },\r\n {\r\n Key: AdInsConstant.RestrictionIsNull,\r\n Value: \"UNCLAIMED\"\r\n },\r\n ];\r\n\r\n ExportType: number = 0;\r\n\r\n pageNow: any = 1;\r\n configuration: any;\r\n exportData: any;\r\n ExcelData: any;\r\n isDataLoaded: boolean = false;\r\n isHidden: boolean = false;\r\n BisDt: string;\r\n BusinessDt: Date = new Date();\r\n dateWrong: boolean = false;\r\n\r\n currentState = 'initial';\r\n\r\n form: FormGroup;\r\n countForm = 0;\r\n formattedAmount = '';\r\n amount = 0;\r\n apiUrl: string;\r\n arrCrit: any;\r\n searchForm: NgForm;\r\n\r\n constructor(private http: HttpClient, private excelService: ExcelService, private _renderer2: Renderer2,\r\n @Inject(DOCUMENT) private _document, public toastr: ToastrService, private cookieService: CookieService,\r\n private datePipe: DatePipe) {\r\n }\r\n\r\n changeState() {\r\n this.currentState = this.currentState === 'initial' ? 'final' : 'initial';\r\n this.isHidden = this.isHidden === false ? true : false;\r\n }\r\n\r\n ngOnInit() {\r\n console.log(\"ucsearch\");\r\n this.apiUrl = this.searchInput.enviromentUrl + this.searchInput.apiQryPaging;\r\n this.arrCrit = this.searchInput.arrCritObj;\r\n let js = this._renderer2.createElement('script');\r\n js.text = `\r\n $(document).ready(function(){\r\n $(\"#flip\").click(function(){\r\n $(\"#panel\").slideToggle(\"slow\");\r\n });\r\n });\r\n `;\r\n this._renderer2.appendChild(this._document.body, js);\r\n\r\n let value = this.cookieService.get('BusinessDateRaw');\r\n this.BisDt = this.DecryptString(value, \"AdInsFOU12345678\");\r\n this.BusinessDt = new Date(this.BisDt);\r\n this.initiateForm();\r\n }\r\n\r\n initiateForm() {\r\n this.getJSON(this.searchInput._url).subscribe(data => {\r\n this.configuration = data;\r\n this.exportData = data.exportExcel;\r\n if (data.exportTypeList != undefined && data.exportTypeList.length != 0) {\r\n this.ExportTypeList = data.exportTypeList;\r\n this.ExportType = this.ExportTypeList[0].key;\r\n }\r\n\r\n this.countForm = data.component.length;\r\n this.isDataLoaded = true;\r\n\r\n if (this.searchInput.title != undefined && this.searchInput.title != \"\") {\r\n this.configuration.title = this.searchInput.title;\r\n }\r\n\r\n for (var i = 0; i < this.countForm; i++) {\r\n //ini kalau datanya di load dari URL\r\n if (data.component[i].isFromURL == true) {\r\n var request = new RequestCriteriaObj();\r\n var arrayCrit = new Array();\r\n var criteriaObject = new CriteriaObj();\r\n criteriaObject.DataType = \"text\";\r\n criteriaObject.propName = data.component[i].criteriaPropName;\r\n criteriaObject.value = data.component[i].criteriaPropValue;\r\n criteriaObject.restriction = \"eq\";\r\n arrayCrit.push(criteriaObject);\r\n request.criteria = arrayCrit;\r\n request[data.component[i].criteriaPropName] = data.component[i].criteriaPropValue;\r\n\r\n // Pengecekan penggunaan url atau path\r\n if (data.component[i].path != undefined && data.component[i].path != \"\") {\r\n if (this.searchInput.ddlEnvironments != undefined && this.searchInput.ddlEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.ddlEnvironments.length; y++) {\r\n if (data.component[i].name == this.searchInput.ddlEnvironments[y].name) {\r\n data.component[i].fullpath = this.searchInput.ddlEnvironments[y].environment + data.component[i].path;\r\n break;\r\n }\r\n }\r\n } else if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {\r\n if (data.component[i].environment == this.searchInput.listEnvironments[y].environment) {\r\n data.component[i].fullpath = this.searchInput.listEnvironments[y].url + data.component[i].path;\r\n break;\r\n }\r\n }\r\n } else {\r\n data.component[i].fullpath = data.component[i].url;\r\n }\r\n\r\n } else {\r\n data.component[i].fullpath = data.component[i].url;\r\n }\r\n //lempar objectnya sekalian sama urlnya, nnti di bind di dalem karena masalah di asyncnya\r\n //biar tiap function ada state2nya sendiri\r\n this.resolveObject(data.component[i], data.component[i].fullpath, request);\r\n }\r\n\r\n if (data.component[i].type == \"numeric\") {\r\n data.component[i].value = parseFloat(data.component[i].value).toLocaleString('en');\r\n }\r\n\r\n //pengecekan ddl\r\n if (data.component[i].type == \"dropdown\") {\r\n if (data.component[i].dtmType != undefined) {\r\n if (data.component[i].dtmType == \"month\") {\r\n if (data.component[i].value != undefined && data.component[i].value.includes(\"BD\")) {\r\n data.component[i].value = this.BusinessDt.getMonth() + 1;\r\n }\r\n data.component[i].items = this.ListOfMonth.ListOfMonth;\r\n }\r\n if (data.component[i].dtmType.includes(\"year\")) {\r\n if (data.component[i].value != undefined && data.component[i].value.includes(\"BD\")) {\r\n data.component[i].value = this.BusinessDt.getFullYear();\r\n }\r\n data.component[i].items = this.setYearDDL(data.component[i].dtmType);\r\n }\r\n }\r\n }\r\n\r\n //pengecekan tanggal\r\n if (data.component[i].type == \"datepicker\") {\r\n if (data.component[i].value.includes(\"BD\")) {\r\n let businessDate = new Date();\r\n if (this.BisDt != null) {\r\n businessDate = new Date(this.BisDt);\r\n }\r\n var operator = data.component[i].value.charAt(2);\r\n var dateShow = new Date();\r\n if (operator == \"-\") {\r\n var tempMinus = data.component[i].value.split(\"-\", 2);\r\n var numDay = parseInt(tempMinus[1]);\r\n businessDate.setDate(businessDate.getDate() - numDay);\r\n }\r\n else if (operator == \"+\") {\r\n var tempMinus = data.component[i].value.split(\"+\", 2);\r\n var numDay = parseInt(tempMinus[1]);\r\n businessDate.setDate(businessDate.getDate() + numDay);\r\n }\r\n dateShow = businessDate;\r\n var dateText = formatDate(dateShow, 'yyyy-MM-dd', 'en-US')\r\n data.component[i].value = dateText;\r\n }\r\n\r\n if (data.component[i].restriction != undefined && data.component[i].restriction != \"\") {\r\n if (data.component[i].restriction.toUpperCase() == \"GT\") {\r\n let minDate = new Date(this.datePipe.transform(data.component[i].minDate, 'yyyy-MM-dd'));\r\n minDate.setDate(minDate.getDate() + 1);\r\n data.component[i].minDate = minDate;\r\n } else if (data.component[i].restriction.toUpperCase() == \"LT\") {\r\n let maxDate = new Date(this.datePipe.transform(data.component[i].maxDate, 'yyyy-MM-dd'));\r\n maxDate.setDate(maxDate.getDate() - 1);\r\n data.component[i].maxDate = maxDate;\r\n }\r\n }\r\n }\r\n }\r\n\r\n setTimeout(() => {\r\n for (let j = 0; j < this.countForm; j++) {\r\n if (data.component[j].isEvent == true && this.configuration.component[j].itemsUrl.length == 1) {\r\n this.onChangeEvent(data.component[j].itemsUrl[0].Key, data.component[j]);\r\n }\r\n if (data.component[j].type == \"officeRoleCodes\" && this.configuration.component[j].itemsUrl.length > 0) {\r\n this.SetRoleOfficeCodes(j);\r\n }\r\n }\r\n }, 1000);\r\n });\r\n }\r\n\r\n SetRoleOfficeCodes(i: number) {\r\n let value: string = this.cookieService.get(\"UserAccess\");\r\n let userAccess: string = JSON.parse(this.DecryptString(value, \"AdInsFOU12345678\"));\r\n let roleCode: string = userAccess[\"RoleCode\"];\r\n let listOfficeRoleCodes: Array<string> = new Array();\r\n listOfficeRoleCodes.push(roleCode);\r\n if (this.configuration.component[i].itemsUrl.length == 1 && this.configuration.component[i].ddlType == 'all') {\r\n for (let index = 0; index < this.configuration.component[i].itemsUrl.length; index++) {\r\n const element = this.configuration.component[i].itemsUrl[index];\r\n listOfficeRoleCodes.push(element.Key);\r\n listOfficeRoleCodes.push(roleCode + \"-\" + element.Key);\r\n }\r\n } else {\r\n let component = this.myForm.nativeElement[i];\r\n let ddl = component.options;\r\n let text = ddl[ddl.selectedIndex].value.trim();\r\n listOfficeRoleCodes.push(text);\r\n listOfficeRoleCodes.push(roleCode + \"-\" + text);\r\n }\r\n\r\n this.searchInput.integrationObj.requestObj[\"OfficeRoleCodes\"] = listOfficeRoleCodes;\r\n }\r\n\r\n setYearDDL(year) {\r\n this.ListOfYear = new Array<KeyValueUCSearchObj>();\r\n let equation = year.match(\"[\\\\/+][-]|[-][\\\\/+]|\\\\/+|-\");\r\n let toMin: number = this.BusinessDt.getFullYear();\r\n let toMax: number = this.BusinessDt.getFullYear();\r\n let minMax: number = parseInt(year.substring(equation.index + equation[0].length));\r\n this.ListOfYear.push({ key: this.BusinessDt.getFullYear(), value: this.BusinessDt.getFullYear().toString() });\r\n\r\n for (let q = 0; q < minMax; q++) {\r\n if (equation[0] == \"-+\" || equation[0] == \"+-\") {\r\n toMin--;\r\n toMax++;\r\n this.ListOfYear.push({ key: toMin, value: toMin.toString() }, { key: toMax, value: toMax.toString() });\r\n } else if (equation[0] == \"-\") {\r\n toMin--;\r\n this.ListOfYear.push({ key: toMin, value: toMin.toString() });\r\n } else if (equation[0] == \"+\") {\r\n toMax++;\r\n this.ListOfYear.push({ key: toMax, value: toMax.toString() });\r\n }\r\n }\r\n this.ListOfYear.sort((a, b) => {\r\n return a.key - b.key;\r\n });\r\n return this.ListOfYear;\r\n }\r\n\r\n public getJSON(url: string): Observable<any> {\r\n return this.http.get(url);\r\n }\r\n\r\n public postJSON(url: string, criteria: any = null): Observable<any> {\r\n return this.http.post(url, criteria);\r\n }\r\n\r\n searchClick() {\r\n // for(let i=0;i<this.countForm;i++){\r\n // if(this.configuration.component[i].type == \"datepicker\"){\r\n // if ((i != (this.countForm-1)) && (this.configuration.component[i].name != this.configuration.component[i+1].name)){\r\n // this.checkInputDate(this.configuration.component[i]);\r\n // }\r\n // }\r\n // }\r\n // if(this.dateWrong) return;\r\n\r\n let order = null;\r\n if (this.configuration.orderby != null) {\r\n order = {\r\n key: this.configuration.orderby.key,\r\n value: this.configuration.orderby.value\r\n }\r\n }\r\n this.pageNow = 1;\r\n this.search(this.apiUrl, this.pageNow, this.pageSize, order, this.arrCrit);\r\n }\r\n\r\n reset() {\r\n this.searchForm.resetForm();\r\n this.ExportType = this.ExportTypeList[0].key;\r\n this.initiateForm();\r\n }\r\n\r\n search(apiUrl: string, pageNo: number, rowPerPage: number, orderBy: any, addCrit: CriteriaObj[] = new Array()) {\r\n let request = new RequestCriteriaObj();\r\n let arrCrit = new Array();\r\n let IsQueryIn = false;\r\n let IsBreak = false;\r\n\r\n // Inject whereQuery for where criteria\r\n if (this.searchInput.whereValue != undefined && this.searchInput.whereValue.length != 0) {\r\n this.configuration.querystring.whereQuery = new Array<any>();\r\n for (let x = 0; x < this.searchInput.whereValue.length; x++) {\r\n this.configuration.querystring.whereQuery.push(this.searchInput.whereValue[x].value);\r\n }\r\n }\r\n request.pageNo = pageNo;\r\n request.rowPerPage = rowPerPage;\r\n request.orderBy = orderBy;\r\n request.queryString = this.configuration.querystring;\r\n\r\n for (let i = 0; i < this.countForm; i++) {\r\n let critObj = new CriteriaObj();\r\n let component = this.myForm.nativeElement[i];\r\n\r\n // // popup message if required\r\n // if (component.getAttribute('data-required') != null && component.getAttribute('data-required') == \"true\") {\r\n // let val = component.value.trim();\r\n // if (val == \"\") {\r\n // IsBreak = true;\r\n // let label = component.getAttribute('label');\r\n // this.toastr.warning(\"Please input \" + label);\r\n // break;\r\n // }\r\n // }\r\n\r\n critObj.DataType = component.getAttribute('data-type');\r\n //Ini khusus kalau dari Drop Down\r\n if (component.getAttribute('query-in') != null && component.getAttribute('query-in') == \"true\") {\r\n IsQueryIn = true;\r\n }\r\n else {\r\n IsQueryIn = false;\r\n }\r\n if (component.value != \"\") {\r\n if (component.nodeName == 'SELECT') {\r\n let ddl = component.options;\r\n let text = ddl[ddl.selectedIndex].value.trim();\r\n if (text == \"one\") {\r\n IsBreak = true;\r\n let label = component.getAttribute('label');\r\n this.toastr.warning(\"Please select \" + label);\r\n break;\r\n }\r\n\r\n if (this.configuration.component[i].type == \"claim\") {\r\n critObj.propName = component.getAttribute('data-name');\r\n critObj.restriction = text;\r\n critObj.value = null;\r\n if (component.getAttribute('data-crit-datatable') != \"\" && component.getAttribute('data-crit-datatable') != null) {\r\n critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');\r\n }\r\n arrCrit.push(critObj);\r\n } else {\r\n if (text != \"all\" && text != \"one\") {\r\n //Kalau Dari Dropdown udah pasti pake Eq\r\n critObj.restriction = AdInsConstant.RestrictionEq;\r\n if (component.name != \"\") {\r\n critObj.propName = component.name;\r\n } else {\r\n critObj.propName = component.getAttribute('ng-reflect-name');\r\n }\r\n critObj.value = text;\r\n arrCrit.push(critObj);\r\n } else if (text == \"all\" && IsQueryIn == true && component.options.length != 0) {\r\n let ddlList = new Array();\r\n for (let x = 0; x < component.options.length; x++) {\r\n if (x != 0) {\r\n ddlList.push(component.options[x].value);\r\n }\r\n }\r\n if (ddlList.length != 0) {\r\n critObj.restriction = AdInsConstant.RestrictionIn;\r\n if (component.name != \"\") {\r\n critObj.propName = component.name;\r\n } else {\r\n critObj.propName = component.getAttribute('ng-reflect-name');\r\n }\r\n critObj.listValue = ddlList;\r\n arrCrit.push(critObj);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n //Kalau ada Percent maka yang dipake nnti adalah Restrictions Like\r\n if (component.name != \"\") {\r\n critObj.propName = component.name;\r\n } else {\r\n critObj.propName = component.getAttribute('data-name');\r\n }\r\n critObj.value = component.value.trim();\r\n if (component.value.includes(\"%\")) {\r\n critObj.restriction = AdInsConstant.RestrictionLike;\r\n }\r\n //kalau componentnya Date, restrictionsnya lgsg ambil dari property JSONnya\r\n else if (component.getAttribute('data-restriction') != \"\" && component.getAttribute('data-restriction') != null) {\r\n critObj.restriction = component.getAttribute('data-restriction');\r\n if (component.getAttribute('data-type') == 'numeric') {\r\n critObj.value = parseFloat(component.value.replace(/,/g, '')).toString();\r\n }\r\n if (critObj.restriction.toUpperCase() == \"LIKE\") {\r\n critObj.value = \"%\" + component.value.trim() + \"%\";\r\n critObj.restriction = AdInsConstant.RestrictionLike\r\n }\r\n }\r\n else {\r\n critObj.restriction = AdInsConstant.RestrictionEq\r\n }\r\n if (component.getAttribute('data-crit-datatable') != \"\" && component.getAttribute('data-crit-datatable') != null) {\r\n critObj.isCriteriaDataTable = component.getAttribute('data-crit-datatable');\r\n }\r\n arrCrit.push(critObj);\r\n }\r\n }\r\n }\r\n\r\n if (IsBreak) {\r\n return;\r\n }\r\n\r\n if (addCrit != null && addCrit != undefined) {\r\n if (addCrit.length != 0) {\r\n for (var i = 0; i < addCrit.length; i++) {\r\n arrCrit.push(addCrit[i]);\r\n }\r\n } else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {\r\n for (var i = 0; i < this.searchInput.addCritInput.length; i++) {\r\n arrCrit.push(this.searchInput.addCritInput[i]);\r\n }\r\n }\r\n }\r\n else if (this.searchInput.addCritInput != null || this.searchInput.addCritInput != undefined) {\r\n for (var i = 0; i < this.searchInput.addCritInput.length; i++) {\r\n arrCrit.push(this.searchInput.addCritInput[i]);\r\n }\r\n }\r\n\r\n request.criteria = arrCrit;\r\n\r\n if (!this.searchInput.isJoinExAPI) {\r\n request.integrationObj = null;\r\n } else {\r\n request.integrationObj = this.searchInput.integrationObj;\r\n }\r\n\r\n this.http.post(apiUrl, request).subscribe((response) => {\r\n let qryPaging = {\r\n response: response,\r\n pageNow: pageNo\r\n }\r\n console.log(qryPaging);\r\n this.result.emit(qryPaging);\r\n return response;\r\n });\r\n }\r\n\r\n GenerateReport() {\r\n this.genRpt.emit({ ExportType: this.ExportType, ElRef: this.myForm });\r\n }\r\n\r\n lessThanFour(): boolean {\r\n if (this.countForm > 3) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n\r\n resolveObject(obj: any, url: string, crit: RequestCriteriaObj = null) {\r\n const val = this.postJSON(url, crit);\r\n val.subscribe(tempData => {\r\n obj.itemsUrl = new Array();\r\n obj.itemsUrl = tempData.ReturnObject;\r\n\r\n if(obj.exclude != undefined && obj.exclude != \"\"){\r\n obj.itemsUrl = obj.itemsUrl.filter((value) => !obj.exclude.includes(value.Key));\r\n }\r\n });\r\n }\r\n\r\n transformAmount(element: any) {\r\n this.formattedAmount = parseFloat(element.target.value).toLocaleString('en');\r\n // to show the formatted amount in the textbox.\r\n element.target.value = this.formattedAmount;\r\n }\r\n\r\n transformToDecimal(element: any) {\r\n element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));\r\n }\r\n\r\n exportAsXLSX(): void {\r\n var request = new RequestCriteriaObj();\r\n request.pageNo = 1;\r\n request.rowPerPage = 9999;\r\n request.orderBy = null;\r\n request.criteria = [];\r\n request.queryString = this.configuration.querystring;\r\n if (!this.searchInput.isJoinExAPI) {\r\n request.integrationObj = null;\r\n } else {\r\n request.integrationObj = this.searchInput.integrationObj;\r\n }\r\n\r\n this.http.post(this.apiUrl, request).subscribe(\r\n response => {\r\n this.ExcelData = response[\"Data\"];\r\n this.excelService.exportAsExcelFile(this.ExcelData, 'sample');\r\n },\r\n (error) => {\r\n console.log(error);\r\n });\r\n }\r\n\r\n onChangeEvent(optValue, afFilter) {\r\n var jsonComp = this.configuration.component;\r\n\r\n for (var i = 0; i < afFilter.affectedFilter.length; i++) {\r\n for (var j = 0; j < jsonComp.length; j++) {\r\n if (jsonComp[j].name == afFilter.affectedFilter[i]) {\r\n var request = new RequestCriteriaObj();\r\n var arrayCrit = new Array();\r\n\r\n if (optValue != \"all\" && optValue != \"one\") {\r\n var critObj = new CriteriaObj();\r\n critObj.DataType = afFilter.datatype;\r\n if (afFilter.filterPropName != undefined || afFilter.filterPropName != \"\") {\r\n request[afFilter.filterPropName] = optValue;\r\n critObj.propName = afFilter.filterPropName;\r\n } else {\r\n critObj.propName = afFilter.name;\r\n request[afFilter.name] = optValue;\r\n }\r\n critObj.value = optValue;\r\n critObj.restriction = AdInsConstant.RestrictionEq;\r\n arrayCrit.push(critObj);\r\n }\r\n request.criteria = arrayCrit;\r\n if (jsonComp[j].path != undefined && jsonComp[j].path != \"\") {\r\n if (this.searchInput.ddlEnvironments != undefined && this.searchInput.ddlEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.ddlEnvironments.length; y++) {\r\n if (jsonComp[j].name == this.searchInput.ddlEnvironments[y].name) {\r\n jsonComp[j].fullpath = this.searchInput.ddlEnvironments[y].environment + jsonComp[j].path;\r\n break;\r\n }\r\n }\r\n } else if (this.searchInput.listEnvironments != undefined && this.searchInput.listEnvironments.length != 0) {\r\n for (let y = 0; y < this.searchInput.listEnvironments.length; y++) {\r\n if (jsonComp[j].environment == this.searchInput.listEnvironments[y].environment) {\r\n jsonComp[j].fullpath = this.searchInput.listEnvironments[y].url + jsonComp[j].path;\r\n break;\r\n }\r\n }\r\n } else {\r\n jsonComp[j].fullpath = jsonComp[j].url;\r\n }\r\n\r\n } else {\r\n jsonComp[j].fullpath = jsonComp[j].url;\r\n }\r\n this.resolveObject(jsonComp[j], jsonComp[j].fullpath, request);\r\n }\r\n }\r\n }\r\n }\r\n\r\n SetProcessKey(idx: number) {\r\n let component = this.myForm.nativeElement[idx];\r\n let ddl = component.options;\r\n let text = ddl[ddl.selectedIndex].value.trim();\r\n if (text) {\r\n this.searchInput.integrationObj.requestObj[\"TaskDefinitionKey\"] = text;\r\n this.searchInput.integrationObj.requestObj[\"ProcessKey\"] = \"\";\r\n }\r\n }\r\n\r\n switchCase(condList) {\r\n var condition = false;\r\n\r\n for (var i = 0; i < condList.conditions.length; i++) {\r\n var idx = this.searchInput.switchValue.findIndex(x => x.property == condList.conditions[i].property);\r\n if (condList.conditions[i].restriction == \"EQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value == condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value == username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"NEQ\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value != condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value != username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value > condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value > username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"GTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value >= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value >= username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LT\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value < condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value < username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n } else if (condList.conditions[i].restriction == \"LTE\") {\r\n if (condList.conditions[i].isUser != true) {\r\n if (this.searchInput.switchValue[idx].value <= condList.conditions[i].value) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n } else {\r\n var username = localStorage.getItem(\"Username\");\r\n if (this.searchInput.switchValue[idx].value <= username) {\r\n condition = true;\r\n } else {\r\n condition = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return condition;\r\n\r\n }\r\n\r\n private DecryptString(chipperText: string, chipperKey: string) {\r\n if (\r\n chipperKey == undefined || chipperKey.trim() == '' ||\r\n chipperText == undefined || chipperText.trim() == ''\r\n ) return chipperText;\r\n var chipperKeyArr = CryptoJS.enc.Utf8.parse(chipperKey);\r\n var iv = CryptoJS.lib.WordArray.create([0x00, 0x00, 0x00, 0x00]);\r\n var decrypted = CryptoJS.AES.decrypt(chipperText, chipperKeyArr, { iv: iv });\r\n var plainText = decrypted.toString(CryptoJS.enc.Utf8);\r\n return plainText;\r\n }\r\n\r\n checkInputDate(component: any) {\r\n let minDateVal;\r\n let maxDateVal;\r\n let label;\r\n let errorMessage = new Array<string>();\r\n\r\n let MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"GTE\")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"GT\")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"GTE\"));\r\n if (MinComponent != undefined) {\r\n minDateVal = this.myForm.nativeElement[MinComponent.id].min == \"\" ? null : new Date(this.myForm.nativeElement[MinComponent.id].min);\r\n label = MinComponent.label.split(\">\", 2);\r\n if (minDateVal != null) {\r\n if (MinComponent.restriction.toUpperCase() == \"GT\") {\r\n minDateVal.setDate(minDateVal.getDate() - 1);\r\n errorMessage.push(\" must be greater than \");\r\n } else if (MinComponent.restriction.toUpperCase() == \"GTE\") {\r\n errorMessage.push(\" must be greater than or equals to \");\r\n }\r\n }\r\n }\r\n\r\n let MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"LTE\")) == undefined ? this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"LT\")) : this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == \"LTE\"));\r\n if (MaxComponent != undefined) {\r\n maxDateVal = this.myForm.nativeElement[MaxComponent.id].max == \"\" ? null : new Date(this.myForm.nativeElement[MaxComponent.id].max);\r\n label = MaxComponent.label.split(\"<\", 2);\r\n if (maxDateVal != null) {\r\n if (MaxComponent.restriction.toUpperCase() == \"LT\") {\r\n maxDateVal.setDate(maxDateVal.getDate() + 1);\r\n errorMessage.push(\" must be less than \");\r\n } else if (MaxComponent.restriction.toUpperCase() == \"LTE\") {\r\n errorMessage.push(\" must be less than or equals to \");\r\n }\r\n }\r\n }\r\n\r\n if (minDateVal != null && maxDateVal == null && new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {\r\n this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + \".\")\r\n this.dateWrong = true;\r\n } else if (maxDateVal != null && minDateVal == null && new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal) {\r\n this.toastr.warning(label[0] + errorMessage[0] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + \".\")\r\n this.dateWrong = true;\r\n } else if (minDateVal != null && maxDateVal != null) {\r\n if (new Date(this.myForm.nativeElement[MaxComponent.id].value) > maxDateVal || new Date(this.myForm.nativeElement[MinComponent.id].value) < minDateVal) {\r\n this.toastr.warning(label[0] + errorMessage[0] + formatDate(minDateVal, 'dd MMMM yyyy', 'en-US') + \" and\" + errorMessage[1] + formatDate(maxDateVal, 'dd MMMM yyyy', 'en-US') + \".\")\r\n this.dateWrong = true;\r\n } else {\r\n this.dateWrong = false;\r\n }\r\n } else {\r\n this.dateWrong = false;\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { UCSearchComponent } from './ucsearch.component';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CurrencyMaskInputMode, NgxCurrencyModule } from 'ngx-currency';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { UcShowErrorsModule } from '@adins/uc-show-errors';\r\nimport { UcDirectiveUpperCaseModule } from '@adins/uc-directive-upper-case';\r\n\r\nexport const customCurrencyMaskConfig = { \r\n align: \"right\",\r\n allowNegative: false,\r\n allowZero: true,\r\n decimal: \".\",\r\n precision: 2,\r\n prefix: \"\",\r\n suffix: \"\",\r\n thousands: \",\",\r\n nullable: false,\r\n inputMode: CurrencyMaskInputMode.NATURAL };\r\n\r\n@NgModule({\r\n declarations: [UCSearchComponent],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n UcShowErrorsModule,\r\n UcDirectiveUpperCaseModule,\r\n NgxCurrencyModule.forRoot(customCurrencyMaskConfig),\r\n TranslateModule.forChild()\r\n ],\r\n exports: [UCSearchComponent]\r\n})\r\nexport class UCSearchModule { }\r\n"]}