@adins/ucsearch 2.3.2 → 2.3.4
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.
- package/README.md +6 -0
- package/bundles/adins-ucsearch.umd.js +6 -0
- package/bundles/adins-ucsearch.umd.js.map +1 -1
- package/bundles/adins-ucsearch.umd.min.js +1 -1
- package/bundles/adins-ucsearch.umd.min.js.map +1 -1
- package/esm2015/lib/ucsearch.component.js +7 -1
- package/esm5/lib/ucsearch.component.js +7 -1
- package/fesm2015/adins-ucsearch.js +6 -0
- package/fesm2015/adins-ucsearch.js.map +1 -1
- package/fesm5/adins-ucsearch.js +6 -0
- package/fesm5/adins-ucsearch.js.map +1 -1
- package/package.json +2 -2
|
@@ -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,u,l,f,c,p,d,m,h){"use strict";var y=(g.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],g.ctorParameters=function(){return[]},g.ngInjectableDef=l.defineInjectable({factory:function(){return new g},token:g,providedIn:"root"}),g);function g(){}var v=(q.RestrictionBetween="Between",q.RestrictionLike="Like",q.RestrictionEq="Eq",q.RestrictionNeq="NEQ",q.RestrictionGt="GT",q.RestrictionGte="GTE",q.RestrictionLt="LT",q.RestrictionLte="LTE",q.RestrictionIn="IN",q.RestrictionNotIn="NotIn",q.RestrictionOr="Or",q.RestrictionOrNeq="OrNeq",q.RestrictionIsNull="ISNULL",q.RestrictionIsNotNull="ISNOTNULL",q.RestrictionGTE="GTE",q.RestrictionLTE="LTE",q.showData="10,50,100",q.JoinTypeInner="INNER",q.JoinTypeLeft="LEFT",q);function q(){}var b=function U(){this.baseUrl="",this.apiPath="",this.requestObj=new Object,this.leftColumnToJoin="",this.rightColumnToJoin="",this.joinType=v.JoinTypeInner},I=function R(){this._url="",this.enviromentUrl="",this.title="",this.apiQryPaging="",this.arrCritObj=null,this.addCritInput=new Array,this.listEnvironments=new Array,this.whereValue=new Array,this.fromValue=new Array,this.switchValue=new Array,this.integrationObj=new b,this.isJoinExAPI=!1},D=function j(){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=v.JoinTypeInner},F=(x.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)},x.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")},x.decorators=[{type:l.Injectable}],x.ctorParameters=function(){return[]},x);function x(){}var E=(T.EXP_TYPE_PDF=0,T.EXP_TYPE_XLS=1,T.EXP_TYPE_XLSX=2,T.EXP_TYPE_DOC=3,T.EXP_TYPE_DOCX=4,T);function T(){}var C=function N(){this.DictOfMonth={},this.ListOfMonth=new Array,this.DictOfMonth={},this.ListOfMonth.push({key:1,value:"January"}),this.DictOfMonth[1]="January",this.ListOfMonth.push({key:2,value:"February"}),this.DictOfMonth[2]="February",this.ListOfMonth.push({key:3,value:"March"}),this.DictOfMonth[3]="March",this.ListOfMonth.push({key:4,value:"April"}),this.DictOfMonth[4]="April",this.ListOfMonth.push({key:5,value:"May"}),this.DictOfMonth[5]="May",this.ListOfMonth.push({key:6,value:"June"}),this.DictOfMonth[6]="June",this.ListOfMonth.push({key:7,value:"July"}),this.DictOfMonth[7]="July",this.ListOfMonth.push({key:8,value:"August"}),this.DictOfMonth[8]="August",this.ListOfMonth.push({key:9,value:"September"}),this.DictOfMonth[9]="September",this.ListOfMonth.push({key:10,value:"October"}),this.DictOfMonth[10]="October",this.ListOfMonth.push({key:11,value:"November"}),this.DictOfMonth[11]="November",this.ListOfMonth.push({key:12,value:"December"}),this.DictOfMonth[12]="December"},M=(Object.defineProperty(k.prototype,"content",{set:function(e){e&&(this.searchForm=e)},enumerable:!0,configurable:!0}),k.prototype.changeState=function(){this.currentState="initial"===this.currentState?"final":"initial",this.isHidden=!1===this.isHidden},k.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()},k.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 D;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.listEnvironments!=undefined&&0!=h.searchInput.listEnvironments.length){for(var 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&&(t.component[e].dtmType.includes("month")&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.setDefaultValueMonth(t.component[e].value)),t.component[e].items=h.setMonthDDL(t.component[e].dtmType)),t.component[e].dtmType.includes("year")&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.setDefaultValueYear(t.component[e].value)),t.component[e].items=h.setYearDDL(t.component[e].dtmType))),t.component[e].value||(t.component[e].value="","all"==t.component[e].ddlType&&(t.component[e].value="all"),"one"==t.component[e].ddlType&&(t.component[e].value="one")),"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),u=new Date;if("-"==s){var l=t.component[e].value.split("-",2),c=parseInt(l[1]);a.setDate(a.getDate()-c)}else"+"==s&&(l=t.component[e].value.split("+",2),c=parseInt(l[1]),a.setDate(a.getDate()+c));u=a;var p=f.formatDate(u,"yyyy-MM-dd","en-US");t.component[e].value=p}if(t.component[e].restriction!=undefined&&""!=t.component[e].restriction)if("GT"==t.component[e].restriction.toUpperCase()){var d=new Date(h.datePipe.transform(t.component[e].minDate,"yyyy-MM-dd"));d.setDate(d.getDate()+1),t.component[e].minDate=d}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)})},k.prototype.SetRoleOfficeCodes=function(e){var t=this.cookieService.get("UserAccess"),n=JSON.parse(this.DecryptString(t,"AdInsFOU12345678")).RoleCode,i=new Array;i.push(n);var r=this.myForm.nativeElement[e].options,o=r[r.selectedIndex].value.trim();if(1==this.configuration.component[e].itemsUrl.length||"all"==this.configuration.component[e].ddlType&&"all"==o)for(var a=0;a<this.configuration.component[e].itemsUrl.length;a++){var s=this.configuration.component[e].itemsUrl[a];i.push(s.Key),i.push(n+"-"+s.Key)}else i.push(o),i.push(n+"-"+o);this.searchInput.integrationObj.requestObj.OfficeRoleCodes=i},k.prototype.setDefaultValueMonth=function(e){var t=new Date(this.BusinessDt),n=e.charAt(2),i=e.split(n,2),r=parseInt(i[1]);return r||(r=1),"-"==n?t.setMonth(t.getMonth()-r):"+"==n&&t.setMonth(t.getMonth()+r),t.getMonth()},k.prototype.setMonthDDL=function(e){var t,n=e.match("[\\/+][-]|[-][\\/+]|\\/+|-"),i=this.BusinessDt.getMonth(),r=this.BusinessDt.getMonth(),o=n[0],a=parseInt(e.substring(n.index+n[0].length));if(12<=a)return this.ListOfMonth.ListOfMonth;if(("+-"==o||"-+"==o)&&6<=a)return this.ListOfMonth.ListOfMonth;var s=this.ListOfMonth.DictOfMonth;t.push({key:i,value:s[i]});for(var u=0;u<a;u++)o.includes("-")&&(0==--i&&(i=12),t.push({key:i,value:s[i]})),o.includes("+")&&(13==++r&&(r=1),t.push({key:r,value:s[r]}));return t.sort(function(e,t){return e.key-t.key}),t},k.prototype.setDefaultValueYear=function(e){var t=new Date(this.BusinessDt),n=e.charAt(2),i=e.split(n,2),r=parseInt(i[1]);return r||(r=1),"-"==n?t.setFullYear(t.getFullYear()-r):"+"==n&&t.setFullYear(t.getFullYear()+r),t.getFullYear()},k.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},k.prototype.getJSON=function(e){return this.http.get(e)},k.prototype.postJSON=function(e,t){return void 0===t&&(t=null),this.http.post(e,t)},k.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)},k.prototype.reset=function(){this.searchForm.resetForm(),this.ExportType=this.ExportTypeList[0].key,this.initiateForm()},k.prototype.search=function(e,n,t,i,r){var o=this;void 0===r&&(r=new Array);var a=new w,s=new Array,u=!1,l=!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)}if(this.searchInput.fromValue!=undefined&&0!=this.searchInput.fromValue.length)for(this.configuration.querystring.fromQuery=new Array,c=0;c<this.searchInput.fromValue.length;c++)this.configuration.querystring.fromQuery.push(this.searchInput.fromValue[c].value);a.pageNo=n,a.rowPerPage=t,a.orderBy=i,a.queryString=this.configuration.querystring;for(var p=0;p<this.countForm;p++){var d=new D,m=this.myForm.nativeElement[p];if(d.DataType=m.getAttribute("data-type"),u=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){l=!0;var y=m.getAttribute("label");this.toastr.warning("Please select "+y);break}if(""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(d.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),"taskDefinitionKey"==this.configuration.component[p].type||"processKey"==this.configuration.component[p].type||"officeRoleCodes"==this.configuration.component[p].type)continue;if("claim"==this.configuration.component[p].type)d.propName=m.getAttribute("data-name"),d.restriction=f,d.value=null,s.push(d);else if("all"!=f&&"one"!=f)d.restriction=v.RestrictionEq,""!=m.name?d.propName=m.name:d.propName=m.getAttribute("data-name"),d.value=f,s.push(d);else if("all"==f&&1==u&&0!=m.options.length){var g=new Array;for(c=0;c<m.options.length;c++)0!=c&&g.push(m.options[c].value);0!=g.length&&(d.restriction=v.RestrictionIn,""!=m.name?d.propName=m.name:d.propName=m.getAttribute("data-name"),d.listValue=g,s.push(d))}}else""!=m.name?d.propName=m.name:d.propName=m.getAttribute("data-name"),d.value=m.value.trim(),m.value.includes("%")?d.restriction=v.RestrictionLike:""!=m.getAttribute("data-restriction")&&null!=m.getAttribute("data-restriction")?(d.restriction=m.getAttribute("data-restriction"),"numeric"==m.getAttribute("data-type")&&(d.value=parseFloat(m.value.replace(/,/g,"")).toString()),"LIKE"==d.restriction.toUpperCase()&&(d.value="%"+m.value.trim()+"%",d.restriction=v.RestrictionLike)):d.restriction=v.RestrictionEq,""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(d.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),s.push(d)}if(!l){if(null!=r&&r!=undefined){if(0!=r.length)for(p=0;p<r.length;p++)s.push(r[p]);else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(p=0;p<this.searchInput.addCritInput.length;p++)s.push(this.searchInput.addCritInput[p])}else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(p=0;p<this.searchInput.addCritInput.length;p++)s.push(this.searchInput.addCritInput[p]);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})}},k.prototype.GenerateReport=function(){this.genRpt.emit({ExportType:this.ExportType,ElRef:this.myForm})},k.prototype.lessThanFour=function(){return!(3<this.countForm)},k.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)}))})},k.prototype.transformAmount=function(e){this.formattedAmount=parseFloat(e.target.value).toLocaleString("en"),e.target.value=this.formattedAmount},k.prototype.transformToDecimal=function(e){e.target.value=parseFloat(e.target.value.toString().replace(/,/g,""))},k.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)})},k.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 D;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=v.RestrictionEq,a.push(s)}if(o.criteria=a,n[r].path!=undefined&&""!=n[r].path)if(this.searchInput.listEnvironments!=undefined&&0!=this.searchInput.listEnvironments.length){for(var u=0;u<this.searchInput.listEnvironments.length;u++)if(n[r].environment==this.searchInput.listEnvironments[u].environment){n[r].fullpath=this.searchInput.listEnvironments[u].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)}},k.prototype.SetProcessKey=function(e,t){var n=this.myForm.nativeElement[e].options,i=n[n.selectedIndex].value.trim();i&&(this.searchInput.integrationObj.requestObj[t]=i)},k.prototype.switchCase=function(i){for(var r=!1,e=function(t){var e=o.searchInput.switchValue.findIndex(function(e){return e.property==i.conditions[t].property});if("EQ"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(o.searchInput.switchValue[e].value!=i.conditions[t].value)return r=!1,"break";r=!0}else{var n=localStorage.getItem("Username");if(o.searchInput.switchValue[e].value!=n)return r=!1,"break";r=!0}else if("NEQ"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(o.searchInput.switchValue[e].value==i.conditions[t].value)return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),o.searchInput.switchValue[e].value==n)return r=!1,"break";r=!0}else if("GT"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value>i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value>n))return r=!1,"break";r=!0}else if("GTE"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value>=i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value>=n))return r=!1,"break";r=!0}else if("LT"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value<i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value<n))return r=!1,"break";r=!0}else if("LTE"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value<=i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value<=n))return r=!1,"break";r=!0}},o=this,t=0;t<i.conditions.length&&"break"!==e(t);t++);return r},k.prototype.DecryptString=function(e,t){if(t==undefined||""==t.trim()||e==undefined||""==e.trim())return e;var n=u.enc.Utf8.parse(t),i=u.lib.WordArray.create([0,0,0,0]);return u.AES.decrypt(e,n,{iv:i}).toString(u.enc.Utf8)},k.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},k.decorators=[{type:l.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"\r\n [ngModel]="question.value" [required]="question.isRequired" name="{{question.name}}"\r\n 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}}"\r\n 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"\r\n [ngModel]="question.value" [required]="question.isRequired" name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}" value="{{question.value}}"\r\n 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"\r\n [ngModel]="question.value" [required]="question.isRequired" name="{{question.name+[i]}}"\r\n attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n (keyup.enter)="searchClick()" attr.data-restriction="{{question.restriction}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n 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}}"\r\n (keyup.enter)="searchClick()" 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}"\r\n 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}}"\r\n (keyup.enter)="searchClick()" 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}"\r\n 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="{{question.isTime ? \'datetime-local\' : \'date\'}}" id="{{question.id}}"\r\n class="form-control search-form-control btn-lookup" name="{{question.name+[i]}}"\r\n [ngModel]="question.value" [required]="question.isRequired"\r\n attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\r\n (keyup.enter)="searchClick()" attr.data-restriction="{{question.restriction}}"\r\n attr.label="{{question.label}}" min="{{question.minDate | date:\'yyyy-MM-dd\'}}"\r\n 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 == \'processKey\' || 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"\r\n attr.query-in="{{question.isQueryIn}}" attr.data-type="{{question.datatype}}"\r\n attr.label="{{question.label}}" [hidden]="question?.itemsUrl?.length == 1"\r\n (change)="(question.type == \'taskDefinitionKey\' || question.type == \'processKey\') ? SetProcessKey(i,question.wfKeyFilter) : 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 <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [(ngModel)]="question.value" [required]="question.isRequired"\r\n class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.label="{{question.label}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\r\n [hidden]="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1"\r\n (change)="question.isEvent ? onChangeEvent($event.target.value, question) : \'\'"\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\r\n *ngIf="question.ddlType == \'one\' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="one">\r\n Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="all">All</option>\r\n <option *ngFor="let item of !question.isFromURL ? question?.items : question?.itemsUrl"\r\n value="{{!question.isFromURL ? item.key : item.Key}}">\r\n {{!question.isFromURL ? item.value : item.Value}}\r\n </option>\r\n </select>\r\n <label\r\n *ngIf="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1">{{!question.isFromURL\r\n ? question.items[0].value : question.itemsUrl[0].Value}}</label>\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}}"\r\n attr.data-name="{{\'Assignee\'}}" [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" value="one">Select\r\n 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\'"\r\n [control]="enjiForm.form.controls[question.name]" [submit]="enjiForm.submitted">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf="question.type==\'datepicker\'"\r\n [control]="enjiForm.form.controls[question.name+[i]]" [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> <span translate>Export Excel</span>\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> <span translate>Reset</span>\r\n </button>\r\n <button *ngIf="(isReport == undefined || !isReport)" type="submit"\r\n class="btn btn-raised btn-primary" #UCSearchClick>\r\n <i class="fa fa-search"></i> <span translate>Search</span>\r\n </button>\r\n <button *ngIf="(isReport != undefined && isReport)" type="button" (click)="GenerateReport()"\r\n class="btn btn-raised btn-primary">\r\n <i class="fa ft-download"></i> <span translate>Generate Report</span>\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:[F,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}"]}]}],k.ctorParameters=function(){return[{type:t.HttpClient},{type:F},{type:l.Renderer2},{type:undefined,decorators:[{type:l.Inject,args:[n.DOCUMENT]}]},{type:a.ToastrService},{type:s.CookieService},{type:f.DatePipe}]},k.propDecorators={content:[{type:l.ViewChild,args:["enjiForm"]}],myForm:[{type:l.ViewChild,args:["formIdSearch"]}],searchInput:[{type:l.Input}],pageSize:[{type:l.Input}],isReport:[{type:l.Input}],result:[{type:l.Output}],genRpt:[{type:l.Output}]},k);function k(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 l.EventEmitter,this.genRpt=new l.EventEmitter,this.ExportTypeList=[{key:E.EXP_TYPE_PDF,value:"PDF"},{key:E.EXP_TYPE_XLS,value:"Excel 2003"},{key:E.EXP_TYPE_XLSX,value:"Excel 2007"},{key:E.EXP_TYPE_DOC,value:"Document"},{key:E.EXP_TYPE_DOCX,value:"Document XML"}],this.ListOfMonth=new C,this.ListOfYear=new Array,this.ClaimList=[{Key:v.RestrictionIsNotNull,Value:"CLAIMED"},{Key:v.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 L={align:"right",allowNegative:!1,allowZero:!0,decimal:".",precision:2,prefix:"",suffix:"",thousands:",",nullable:!1,inputMode:p.CurrencyMaskInputMode.NATURAL},O=(S.decorators=[{type:l.NgModule,args:[{declarations:[M],imports:[f.CommonModule,c.FormsModule,m.UcShowErrorsModule,h.UcDirectiveUpperCaseModule,p.NgxCurrencyModule.forRoot(L),d.TranslateModule.forChild()],exports:[M]}]}],S);function S(){}e.UCSearchService=y,e.UCSearchComponent=M,e.customCurrencyMaskConfig=L,e.UCSearchModule=O,e.ɵa=F,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,u,l,f,c,p,d,m,h){"use strict";var g=(y.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],y.ctorParameters=function(){return[]},y.ngInjectableDef=l.defineInjectable({factory:function(){return new y},token:y,providedIn:"root"}),y);function y(){}var v=(q.RestrictionBetween="Between",q.RestrictionLike="Like",q.RestrictionEq="Eq",q.RestrictionNeq="NEQ",q.RestrictionGt="GT",q.RestrictionGte="GTE",q.RestrictionLt="LT",q.RestrictionLte="LTE",q.RestrictionIn="IN",q.RestrictionNotIn="NotIn",q.RestrictionOr="Or",q.RestrictionOrNeq="OrNeq",q.RestrictionIsNull="ISNULL",q.RestrictionIsNotNull="ISNOTNULL",q.RestrictionGTE="GTE",q.RestrictionLTE="LTE",q.showData="10,50,100",q.JoinTypeInner="INNER",q.JoinTypeLeft="LEFT",q);function q(){}var b=function U(){this.baseUrl="",this.apiPath="",this.requestObj=new Object,this.leftColumnToJoin="",this.rightColumnToJoin="",this.joinType=v.JoinTypeInner},I=function R(){this._url="",this.enviromentUrl="",this.title="",this.apiQryPaging="",this.arrCritObj=null,this.addCritInput=new Array,this.listEnvironments=new Array,this.whereValue=new Array,this.fromValue=new Array,this.switchValue=new Array,this.integrationObj=new b,this.isJoinExAPI=!1},D=function j(){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=v.JoinTypeInner},F=(x.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)},x.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")},x.decorators=[{type:l.Injectable}],x.ctorParameters=function(){return[]},x);function x(){}var E=(T.EXP_TYPE_PDF=0,T.EXP_TYPE_XLS=1,T.EXP_TYPE_XLSX=2,T.EXP_TYPE_DOC=3,T.EXP_TYPE_DOCX=4,T);function T(){}var C=function N(){this.DictOfMonth={},this.ListOfMonth=new Array,this.DictOfMonth={},this.ListOfMonth.push({key:1,value:"January"}),this.DictOfMonth[1]="January",this.ListOfMonth.push({key:2,value:"February"}),this.DictOfMonth[2]="February",this.ListOfMonth.push({key:3,value:"March"}),this.DictOfMonth[3]="March",this.ListOfMonth.push({key:4,value:"April"}),this.DictOfMonth[4]="April",this.ListOfMonth.push({key:5,value:"May"}),this.DictOfMonth[5]="May",this.ListOfMonth.push({key:6,value:"June"}),this.DictOfMonth[6]="June",this.ListOfMonth.push({key:7,value:"July"}),this.DictOfMonth[7]="July",this.ListOfMonth.push({key:8,value:"August"}),this.DictOfMonth[8]="August",this.ListOfMonth.push({key:9,value:"September"}),this.DictOfMonth[9]="September",this.ListOfMonth.push({key:10,value:"October"}),this.DictOfMonth[10]="October",this.ListOfMonth.push({key:11,value:"November"}),this.DictOfMonth[11]="November",this.ListOfMonth.push({key:12,value:"December"}),this.DictOfMonth[12]="December"},M=(Object.defineProperty(k.prototype,"content",{set:function(e){e&&(this.searchForm=e)},enumerable:!0,configurable:!0}),k.prototype.changeState=function(){this.currentState="initial"===this.currentState?"final":"initial",this.isHidden=!1===this.isHidden},k.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()},k.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 D;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.listEnvironments!=undefined&&0!=h.searchInput.listEnvironments.length){for(var 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&&(t.component[e].dtmType.includes("month")&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.setDefaultValueMonth(t.component[e].value)),t.component[e].items=h.setMonthDDL(t.component[e].dtmType)),t.component[e].dtmType.includes("year")&&(t.component[e].value!=undefined&&t.component[e].value.includes("BD")&&(t.component[e].value=h.setDefaultValueYear(t.component[e].value)),t.component[e].items=h.setYearDDL(t.component[e].dtmType))),t.component[e].value||(t.component[e].value="","all"==t.component[e].ddlType&&(t.component[e].value="all"),"one"==t.component[e].ddlType&&(t.component[e].value="one")),"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),u=new Date;if("-"==s){var l=t.component[e].value.split("-",2),c=parseInt(l[1]);a.setDate(a.getDate()-c)}else"+"==s&&(l=t.component[e].value.split("+",2),c=parseInt(l[1]),a.setDate(a.getDate()+c));u=a;var p=f.formatDate(u,"yyyy-MM-dd","en-US");t.component[e].value=p}if(t.component[e].restriction!=undefined&&""!=t.component[e].restriction)if("GT"==t.component[e].restriction.toUpperCase()){var d=new Date(h.datePipe.transform(t.component[e].minDate,"yyyy-MM-dd"));d.setDate(d.getDate()+1),t.component[e].minDate=d}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++)console.log(h.configuration.component[e].name+" : "+h.configuration.component[e].itemsUrl.length+" , "+t.component[e].isEvent),1==t.component[e].isEvent&&1==h.configuration.component[e].itemsUrl.length&&(console.log("timeout"),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)})},k.prototype.SetRoleOfficeCodes=function(e){var t=this.cookieService.get("UserAccess"),n=JSON.parse(this.DecryptString(t,"AdInsFOU12345678")).RoleCode,i=new Array;i.push(n);var r=this.myForm.nativeElement[e].options,o=r[r.selectedIndex].value.trim();if(1==this.configuration.component[e].itemsUrl.length||"all"==this.configuration.component[e].ddlType&&"all"==o)for(var a=0;a<this.configuration.component[e].itemsUrl.length;a++){var s=this.configuration.component[e].itemsUrl[a];i.push(s.Key),i.push(n+"-"+s.Key)}else i.push(o),i.push(n+"-"+o);this.searchInput.integrationObj.requestObj.OfficeRoleCodes=i},k.prototype.setDefaultValueMonth=function(e){var t=new Date(this.BusinessDt),n=e.charAt(2),i=e.split(n,2),r=parseInt(i[1]);return r||(r=1),"-"==n?t.setMonth(t.getMonth()-r):"+"==n&&t.setMonth(t.getMonth()+r),t.getMonth()},k.prototype.setMonthDDL=function(e){var t,n=e.match("[\\/+][-]|[-][\\/+]|\\/+|-"),i=this.BusinessDt.getMonth(),r=this.BusinessDt.getMonth(),o=n[0],a=parseInt(e.substring(n.index+n[0].length));if(12<=a)return this.ListOfMonth.ListOfMonth;if(("+-"==o||"-+"==o)&&6<=a)return this.ListOfMonth.ListOfMonth;var s=this.ListOfMonth.DictOfMonth;t.push({key:i,value:s[i]});for(var u=0;u<a;u++)o.includes("-")&&(0==--i&&(i=12),t.push({key:i,value:s[i]})),o.includes("+")&&(13==++r&&(r=1),t.push({key:r,value:s[r]}));return t.sort(function(e,t){return e.key-t.key}),t},k.prototype.setDefaultValueYear=function(e){var t=new Date(this.BusinessDt),n=e.charAt(2),i=e.split(n,2),r=parseInt(i[1]);return r||(r=1),"-"==n?t.setFullYear(t.getFullYear()-r):"+"==n&&t.setFullYear(t.getFullYear()+r),t.getFullYear()},k.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},k.prototype.getJSON=function(e){return this.http.get(e)},k.prototype.postJSON=function(e,t){return void 0===t&&(t=null),this.http.post(e,t)},k.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)},k.prototype.reset=function(){this.searchForm.resetForm(),this.ExportType=this.ExportTypeList[0].key,this.initiateForm()},k.prototype.search=function(e,n,t,i,r){var o=this;void 0===r&&(r=new Array);var a=new w,s=new Array,u=!1,l=!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)}if(this.searchInput.fromValue!=undefined&&0!=this.searchInput.fromValue.length)for(this.configuration.querystring.fromQuery=new Array,c=0;c<this.searchInput.fromValue.length;c++)this.configuration.querystring.fromQuery.push(this.searchInput.fromValue[c].value);a.pageNo=n,a.rowPerPage=t,a.orderBy=i,a.queryString=this.configuration.querystring;for(var p=0;p<this.countForm;p++){var d=new D,m=this.myForm.nativeElement[p];if(d.DataType=m.getAttribute("data-type"),u=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){l=!0;var g=m.getAttribute("label");this.toastr.warning("Please select "+g);break}if(""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(d.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),"taskDefinitionKey"==this.configuration.component[p].type||"processKey"==this.configuration.component[p].type||"officeRoleCodes"==this.configuration.component[p].type)continue;if("claim"==this.configuration.component[p].type)d.propName=m.getAttribute("data-name"),d.restriction=f,d.value=null,s.push(d);else if("all"!=f&&"one"!=f)d.restriction=v.RestrictionEq,""!=m.name?d.propName=m.name:d.propName=m.getAttribute("data-name"),d.value=f,s.push(d);else if("all"==f&&1==u&&0!=m.options.length){var y=new Array;for(c=0;c<m.options.length;c++)0!=c&&y.push(m.options[c].value);0!=y.length&&(d.restriction=v.RestrictionIn,""!=m.name?d.propName=m.name:d.propName=m.getAttribute("data-name"),d.listValue=y,s.push(d))}}else""!=m.name?d.propName=m.name:d.propName=m.getAttribute("data-name"),d.value=m.value.trim(),m.value.includes("%")?d.restriction=v.RestrictionLike:""!=m.getAttribute("data-restriction")&&null!=m.getAttribute("data-restriction")?(d.restriction=m.getAttribute("data-restriction"),"numeric"==m.getAttribute("data-type")&&(d.value=parseFloat(m.value.replace(/,/g,"")).toString()),"LIKE"==d.restriction.toUpperCase()&&(d.value="%"+m.value.trim()+"%",d.restriction=v.RestrictionLike)):d.restriction=v.RestrictionEq,""!=m.getAttribute("data-crit-datatable")&&null!=m.getAttribute("data-crit-datatable")&&(d.isCriteriaDataTable=m.getAttribute("data-crit-datatable")),s.push(d)}if(!l){if(null!=r&&r!=undefined){if(0!=r.length)for(p=0;p<r.length;p++)s.push(r[p]);else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(p=0;p<this.searchInput.addCritInput.length;p++)s.push(this.searchInput.addCritInput[p])}else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(p=0;p<this.searchInput.addCritInput.length;p++)s.push(this.searchInput.addCritInput[p]);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})}},k.prototype.GenerateReport=function(){this.genRpt.emit({ExportType:this.ExportType,ElRef:this.myForm})},k.prototype.lessThanFour=function(){return!(3<this.countForm)},k.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)}))})},k.prototype.transformAmount=function(e){this.formattedAmount=parseFloat(e.target.value).toLocaleString("en"),e.target.value=this.formattedAmount},k.prototype.transformToDecimal=function(e){e.target.value=parseFloat(e.target.value.toString().replace(/,/g,""))},k.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)})},k.prototype.onChangeEvent=function(e,t){for(var n=this.configuration.component,i=0;i<t.affectedFilter.length;i++){console.log("affected filter: "+t.affectedFilter[i]);for(var r=0;r<n.length;r++)if(n[r].name==t.affectedFilter[i]){console.log("jsonComp name: "+n[r].name+" ,affFilter : "+t.affectedFilter[i]);var o=new w,a=new Array;if("all"!=e&&"one"!=e){var s=new D;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=v.RestrictionEq,console.log("data type: "+s.DataType+", propname: "+s.propName+", value: "+s.value+", restriction: "+s.restriction),a.push(s)}if(o.criteria=a,n[r].path!=undefined&&""!=n[r].path)if(this.searchInput.listEnvironments!=undefined&&0!=this.searchInput.listEnvironments.length){for(var u=0;u<this.searchInput.listEnvironments.length;u++)if(n[r].environment==this.searchInput.listEnvironments[u].environment){n[r].fullpath=this.searchInput.listEnvironments[u].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)}}},k.prototype.SetProcessKey=function(e,t){var n=this.myForm.nativeElement[e].options,i=n[n.selectedIndex].value.trim();i&&(this.searchInput.integrationObj.requestObj[t]=i)},k.prototype.switchCase=function(i){for(var r=!1,e=function(t){var e=o.searchInput.switchValue.findIndex(function(e){return e.property==i.conditions[t].property});if("EQ"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(o.searchInput.switchValue[e].value!=i.conditions[t].value)return r=!1,"break";r=!0}else{var n=localStorage.getItem("Username");if(o.searchInput.switchValue[e].value!=n)return r=!1,"break";r=!0}else if("NEQ"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(o.searchInput.switchValue[e].value==i.conditions[t].value)return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),o.searchInput.switchValue[e].value==n)return r=!1,"break";r=!0}else if("GT"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value>i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value>n))return r=!1,"break";r=!0}else if("GTE"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value>=i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value>=n))return r=!1,"break";r=!0}else if("LT"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value<i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value<n))return r=!1,"break";r=!0}else if("LTE"==i.conditions[t].restriction)if(1!=i.conditions[t].isUser){if(!(o.searchInput.switchValue[e].value<=i.conditions[t].value))return r=!1,"break";r=!0}else{if(n=localStorage.getItem("Username"),!(o.searchInput.switchValue[e].value<=n))return r=!1,"break";r=!0}},o=this,t=0;t<i.conditions.length&&"break"!==e(t);t++);return r},k.prototype.DecryptString=function(e,t){if(t==undefined||""==t.trim()||e==undefined||""==e.trim())return e;var n=u.enc.Utf8.parse(t),i=u.lib.WordArray.create([0,0,0,0]);return u.AES.decrypt(e,n,{iv:i}).toString(u.enc.Utf8)},k.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},k.decorators=[{type:l.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"\r\n [ngModel]="question.value" [required]="question.isRequired" name="{{question.name}}"\r\n 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}}"\r\n 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"\r\n [ngModel]="question.value" [required]="question.isRequired" name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}" value="{{question.value}}"\r\n 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"\r\n [ngModel]="question.value" [required]="question.isRequired" name="{{question.name+[i]}}"\r\n attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n (keyup.enter)="searchClick()" attr.data-restriction="{{question.restriction}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n 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}}"\r\n (keyup.enter)="searchClick()" 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}"\r\n 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}}"\r\n (keyup.enter)="searchClick()" 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}"\r\n 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="{{question.isTime ? \'datetime-local\' : \'date\'}}" id="{{question.id}}"\r\n class="form-control search-form-control btn-lookup" name="{{question.name+[i]}}"\r\n [ngModel]="question.value" [required]="question.isRequired"\r\n attr.data-required="{{question.isRequired}}" value="{{question.value}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\r\n (keyup.enter)="searchClick()" attr.data-restriction="{{question.restriction}}"\r\n attr.label="{{question.label}}" min="{{question.minDate | date:\'yyyy-MM-dd\'}}"\r\n 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 == \'processKey\' || 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"\r\n attr.query-in="{{question.isQueryIn}}" attr.data-type="{{question.datatype}}"\r\n attr.label="{{question.label}}" [hidden]="question?.itemsUrl?.length == 1"\r\n (change)="(question.type == \'taskDefinitionKey\' || question.type == \'processKey\') ? SetProcessKey(i,question.wfKeyFilter) : 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 <select name="{{question.name}}" attr.data-required="{{question.isRequired}}"\r\n [(ngModel)]="question.value" [required]="question.isRequired"\r\n class="form-control search-form-control" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.label="{{question.label}}" attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\r\n [hidden]="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1"\r\n (change)="question.isEvent ? onChangeEvent($event.target.value, question) : \'\'"\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\r\n *ngIf="question.ddlType == \'one\' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="one">\r\n Select One</option>\r\n <option\r\n *ngIf="(question?.ddlType == undefined || question.ddlType == \'all\') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="all">All</option>\r\n <option *ngFor="let item of !question.isFromURL ? question?.items : question?.itemsUrl"\r\n value="{{!question.isFromURL ? item.key : item.Key}}">\r\n {{!question.isFromURL ? item.value : item.Value}}\r\n </option>\r\n </select>\r\n <label\r\n *ngIf="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1">{{!question.isFromURL\r\n ? question.items[0].value : question.itemsUrl[0].Value}}</label>\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}}"\r\n attr.data-name="{{\'Assignee\'}}" [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" value="one">Select\r\n 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\'"\r\n [control]="enjiForm.form.controls[question.name]" [submit]="enjiForm.submitted">\r\n </lib-uc-show-errors>\r\n <lib-uc-show-errors *ngIf="question.type==\'datepicker\'"\r\n [control]="enjiForm.form.controls[question.name+[i]]" [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> <span translate>Export Excel</span>\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> <span translate>Reset</span>\r\n </button>\r\n <button *ngIf="(isReport == undefined || !isReport)" type="submit"\r\n class="btn btn-raised btn-primary" #UCSearchClick>\r\n <i class="fa fa-search"></i> <span translate>Search</span>\r\n </button>\r\n <button *ngIf="(isReport != undefined && isReport)" type="button" (click)="GenerateReport()"\r\n class="btn btn-raised btn-primary">\r\n <i class="fa ft-download"></i> <span translate>Generate Report</span>\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:[F,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}"]}]}],k.ctorParameters=function(){return[{type:t.HttpClient},{type:F},{type:l.Renderer2},{type:undefined,decorators:[{type:l.Inject,args:[n.DOCUMENT]}]},{type:a.ToastrService},{type:s.CookieService},{type:f.DatePipe}]},k.propDecorators={content:[{type:l.ViewChild,args:["enjiForm"]}],myForm:[{type:l.ViewChild,args:["formIdSearch"]}],searchInput:[{type:l.Input}],pageSize:[{type:l.Input}],isReport:[{type:l.Input}],result:[{type:l.Output}],genRpt:[{type:l.Output}]},k);function k(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 l.EventEmitter,this.genRpt=new l.EventEmitter,this.ExportTypeList=[{key:E.EXP_TYPE_PDF,value:"PDF"},{key:E.EXP_TYPE_XLS,value:"Excel 2003"},{key:E.EXP_TYPE_XLSX,value:"Excel 2007"},{key:E.EXP_TYPE_DOC,value:"Document"},{key:E.EXP_TYPE_DOCX,value:"Document XML"}],this.ListOfMonth=new C,this.ListOfYear=new Array,this.ClaimList=[{Key:v.RestrictionIsNotNull,Value:"CLAIMED"},{Key:v.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 L={align:"right",allowNegative:!1,allowZero:!0,decimal:".",precision:2,prefix:"",suffix:"",thousands:",",nullable:!1,inputMode:p.CurrencyMaskInputMode.NATURAL},O=(S.decorators=[{type:l.NgModule,args:[{declarations:[M],imports:[f.CommonModule,c.FormsModule,m.UcShowErrorsModule,h.UcDirectiveUpperCaseModule,p.NgxCurrencyModule.forRoot(L),d.TranslateModule.forChild()],exports:[M]}]}],S);function S(){}e.UCSearchService=g,e.UCSearchComponent=M,e.customCurrencyMaskConfig=L,e.UCSearchModule=O,e.ɵa=F,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=adins-ucsearch.umd.min.js.map
|