@adins/ucsearch 2.11.19 → 2.11.21
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/adins-ucsearch.metadata.json +1 -1
- package/bundles/adins-ucsearch.umd.js +10 -11
- 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 +11 -12
- package/esm5/lib/ucsearch.component.js +11 -12
- package/fesm2015/adins-ucsearch.js +10 -11
- package/fesm2015/adins-ucsearch.js.map +1 -1
- package/fesm5/adins-ucsearch.js +10 -11
- package/fesm5/adins-ucsearch.js.map +1 -1
- package/package.json +1 -1
|
@@ -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/common"),require("@angular/forms"),require("ngx-currency"),require("@ngx-translate/core"),require("@adins/uc-show-errors"),require("@adins/uc-directive-upper-case"),require("@angular/core")):"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/common","@angular/forms","ngx-currency","@ngx-translate/core","@adins/uc-show-errors","@adins/uc-directive-upper-case","@angular/core"],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.common,e.ng.forms,e.ngxCurrency,e.core,e.ucShowErrors,e.ucDirectiveUpperCase,e.ng.core)}(this,function(e,t,n,i,o,r,a,s,l,f,u,c,p,d,m,h){"use strict";var y=(g.decorators=[{type:h.Injectable,args:[{providedIn:"root"}]}],g.ctorParameters=function(){return[]},g.ngInjectableDef=h.defineInjectable({factory:function(){return new g},token:g,providedIn:"root"}),g);function g(){}var q=(v.RestrictionBetween="Between",v.RestrictionLike="Like",v.RestrictionEq="Eq",v.RestrictionNeq="NEQ",v.RestrictionGt="GT",v.RestrictionGte="GTE",v.RestrictionLt="LT",v.RestrictionLte="LTE",v.RestrictionIn="IN",v.RestrictionNotIn="NotIn",v.RestrictionOr="Or",v.RestrictionOrNeq="OrNeq",v.RestrictionIsNull="ISNULL",v.RestrictionIsNotNull="ISNOTNULL",v.RestrictionGTE="GTE",v.RestrictionLTE="LTE",v.showData="10,50,100",v.JoinTypeInner="INNER",v.JoinTypeLeft="LEFT",v);function v(){}var b=function j(){this.baseUrl="",this.apiPath="",this.requestObj=new Object,this.leftColumnToJoin="",this.rightColumnToJoin="",this.joinType=q.JoinTypeInner},I=function A(){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 N(){this.low=0,this.high=0,this.DataType="Text",this.isCriteriaDataTable=!1},w=function P(){this.includeCount=!0,this.includeData=!0,this.isLoading=!0,this.queryString="",this.rowVersion="",this.integrationObj=new b,this.joinType=q.JoinTypeInner},x=(F.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)},F.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")},F.decorators=[{type:h.Injectable}],F.ctorParameters=function(){return[]},F);function F(){}var T=(E.EXP_TYPE_PDF=0,E.EXP_TYPE_XLS=1,E.EXP_TYPE_XLSX=2,E.EXP_TYPE_DOC=3,E.EXP_TYPE_DOCX=4,E);function E(){}var C=function V(){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"},k=(Object.defineProperty(M.prototype,"content",{set:function(e){e&&(this.searchForm=e)},enumerable:!0,configurable:!0}),M.prototype.changeState=function(){this.currentState="initial"===this.currentState?"final":"initial",this.isHidden=!1===this.isHidden},M.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()},M.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))),"dropdownSearch"==t.component[e].type&&(t.component[e].ddsType==undefined||"all"==t.component[e].ddsType?(t.component[e].value="all",t.component[e].descr="All"):"one"==t.component[e].ddsType&&(t.component[e].value="one",t.component[e].descr="Select One")),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(h.readonly=t.component[e].readonly,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 p=f.formatDate(l,"yyyy-MM-dd","en-US");t.component[e].value=p}if((h.readonly=!1)&&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)})},M.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},M.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()},M.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 l=0;l<a;l++)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},M.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()},M.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},M.prototype.getJSON=function(e){return this.http.get(e)},M.prototype.postJSON=function(e,t){return void 0===t&&(t=null),this.http.post(e,t)},M.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)},M.prototype.reset=function(){this.searchForm.resetForm({ExportType:this.ExportTypeList[0].key}),this.initiateForm()},M.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)}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=-1,d=0;d<this.countForm;d++){var m=new D;"dropdownSearch"==this.configuration.component[d].type?p+=3:p++;var h=this.myForm.nativeElement[p];if(m.DataType=h.getAttribute("data-type"),l=null!=h.getAttribute("query-in")&&"true"==h.getAttribute("query-in"),""!=h.value)if("SELECT"==h.nodeName){var f=h.options,y=f[f.selectedIndex].value.trim();if("one"==y){u=!0;var g=h.getAttribute("label");this.toastr.warning("Please select "+g);break}if(""!=h.getAttribute("data-crit-datatable")&&null!=h.getAttribute("data-crit-datatable")&&(m.isCriteriaDataTable=h.getAttribute("data-crit-datatable")),"taskDefinitionKey"==this.configuration.component[d].type||"processKey"==this.configuration.component[d].type)continue;if("claim"==this.configuration.component[d].type)m.propName=h.getAttribute("data-name"),m.restriction=y,m.value=null,s.push(m);else if("all"!=y&&"one"!=y)m.restriction=q.RestrictionEq,""!=h.name?m.propName=h.name:m.propName=h.getAttribute("data-name"),m.value=y,s.push(m);else if("all"==y&&1==l&&0!=h.options.length){var v=new Array;for(c=0;c<h.options.length;c++)0!=c&&v.push(h.options[c].value);0!=v.length&&(m.restriction=q.RestrictionIn,""!=h.name?m.propName=h.name:m.propName=h.getAttribute("data-name"),m.listValue=v,s.push(m))}}else""!=h.name?m.propName=h.name:m.propName=h.getAttribute("data-name"),m.value=h.value.trim(),h.value.includes("%")?m.restriction=q.RestrictionLike:""!=h.getAttribute("data-restriction")&&null!=h.getAttribute("data-restriction")?(m.restriction=h.getAttribute("data-restriction"),"numeric"==h.getAttribute("data-type")&&(m.value=parseFloat(h.value.replace(/,/g,"")).toString()),"LIKE"==m.restriction.toUpperCase()&&(m.value="%"+h.value.trim()+"%",m.restriction=q.RestrictionLike)):m.restriction=q.RestrictionEq,""!=h.getAttribute("data-crit-datatable")&&null!=h.getAttribute("data-crit-datatable")&&(m.isCriteriaDataTable=h.getAttribute("data-crit-datatable")),s.push(m)}if(!u){if(null!=r&&r!=undefined){if(0!=r.length)for(d=0;d<r.length;d++)s.push(r[d]);else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(d=0;d<this.searchInput.addCritInput.length;d++)s.push(this.searchInput.addCritInput[d])}else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(d=0;d<this.searchInput.addCritInput.length;d++)s.push(this.searchInput.addCritInput[d]);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),o.reqGetAllData.emit(a),e})}},M.prototype.GenerateReport=function(){this.genRpt.emit({ExportType:this.ExportType,ElRef:this.myForm})},M.prototype.lessThanFour=function(){return!(3<this.countForm)},M.prototype.resolveObject=function(t,e,n){var i=this;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)})),t.affectedFilter&&1==t.itemsUrl.length&&i.onChangeEvent(t.itemsUrl[0].Key,t)})},M.prototype.transformAmount=function(e){this.formattedAmount=parseFloat(e.target.value).toLocaleString("en"),e.target.value=this.formattedAmount},M.prototype.transformToDecimal=function(e){e.target.value=parseFloat(e.target.value.toString().replace(/,/g,""))},M.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)})},M.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=q.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 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)}},M.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)},M.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},M.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)},M.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},M.prototype.selectedOption=function(e,t){t.descr=e.Value,t.isListHide=!0},M.decorators=[{type:h.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.data-numericpair="{{question.numericPair}}"\r\n attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\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 [readonly]="question.readonly" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}"\r\n attr.data-datepickerpair="{{question.datepickerPair}}"\r\n 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\'}}"\r\n (focusout)="question.restriction != undefined && 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\r\n *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}}"\r\n 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 :\r\n question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf="question.type==\'dropdownSearch\'">\r\n <div class="dds-display-item"\r\n [hidden]="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1">\r\n <input type="text" class="form-control search-form-control dds-input"\r\n name="{{\'ddsValue\'+question.name}}" [(ngModel)]="question.descr" readonly\r\n (click)="question.isListHide = !question.isListHide; question.searchText=\'\'">\r\n </div>\r\n <label\r\n *ngIf="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1">{{!question.isFromURL\r\n ? question.items[0].value :\r\n question.itemsUrl[0].Value}}</label>\r\n <div class="dds-list-container" [hidden]="question.isListHide">\r\n <input type="text" class="form-control search-form-control"\r\n name="{{\'searchText\'+question.name}}" [(ngModel)]="question.searchText"\r\n [placeholder]="question.placeholder">\r\n <div class="dds-items-container">\r\n <select class="full-width" name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" [(ngModel)]="question.value"\r\n [required]="question.isRequired" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.label="{{question.label}}"\r\n attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\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 size="{{question?.size == undefined ? question?.size : 10}}">\r\n <option (click)="selectedOption({Key:\'one\',Value:\'Select One\'},question)"\r\n *ngIf="question.ddsType == \'one\' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="one">\r\n Select One</option>\r\n <option (click)="selectedOption({Key:\'all\',Value:\'All\'},question)"\r\n *ngIf="(question?.ddsType == undefined || question.ddsType == \'all\') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="all">All</option>\r\n \x3c!-- <option *ngFor="let item of question?.items | textSearch : question.searchText; let i=index" [value]="item?.key" (click)="selectedOption(item,question)">\r\n {{item?.value}}\r\n </option> --\x3e\r\n <option\r\n *ngFor="let item of !question.isFromURL ? (question?.items | textSearch : question.searchText) : question?.itemsUrl | textSearch : question.searchText"\r\n (click)="selectedOption(item,question)" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\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}}"\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\r\n 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:[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}.dds-input{background-color:#fff;text-transform:uppercase}.dds-display-item:after{content:'\\e929';font-family:feather;font-size:1rem;display:inline-block;position:absolute;right:5px;top:5px;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.dds-list-container{position:absolute;width:100%;z-index:9}"]}]}],M.ctorParameters=function(){return[{type:t.HttpClient},{type:x},{type:h.Renderer2},{type:undefined,decorators:[{type:h.Inject,args:[n.DOCUMENT]}]},{type:a.ToastrService},{type:s.CookieService},{type:f.DatePipe},{type:h.ElementRef}]},M.propDecorators={content:[{type:h.ViewChild,args:["enjiForm"]}],myForm:[{type:h.ViewChild,args:["formIdSearch"]}],searchInput:[{type:h.Input}],pageSize:[{type:h.Input}],isReport:[{type:h.Input}],result:[{type:h.Output}],genRpt:[{type:h.Output}],reqGetAllData:[{type:h.Output}]},M);function M(e,t,n,i,r,o,a,s){this.http=e,this.excelService=t,this._renderer2=n,this._document=i,this.toastr=r,this.cookieService=o,this.datePipe=a,this.elemRef=s,this.searchInput=new I,this.pageSize=10,this.isReport=!1,this.result=new h.EventEmitter,this.genRpt=new h.EventEmitter,this.reqGetAllData=new h.EventEmitter,this.ExportTypeList=[{key:T.EXP_TYPE_PDF,value:"PDF"},{key:T.EXP_TYPE_XLS,value:"Excel 2003"},{key:T.EXP_TYPE_XLSX,value:"Excel 2007"},{key:T.EXP_TYPE_DOC,value:"Document"},{key:T.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.readonly=!1,this.currentState="initial",this.countForm=0,this.formattedAmount="",this.amount=0}var L=(O.prototype.transform=function(e,t){return t?e.filter(function(e){return!(!e.Value||"string"!=typeof e.Value)&&-1<e.Value.toLowerCase().indexOf(t.toLowerCase())}):e},O.decorators=[{type:h.Pipe,args:[{name:"textSearch"}]}],O);function O(){}var S={align:"right",allowNegative:!1,allowZero:!0,decimal:".",precision:2,prefix:"",suffix:"",thousands:",",nullable:!1,inputMode:c.CurrencyMaskInputMode.NATURAL},U=(R.decorators=[{type:h.NgModule,args:[{declarations:[k,L],imports:[f.CommonModule,u.FormsModule,d.UcShowErrorsModule,m.UcDirectiveUpperCaseModule,c.NgxCurrencyModule.forRoot(S),p.TranslateModule.forChild()],exports:[k]}]}],R);function R(){}e.UCSearchService=y,e.UCSearchComponent=k,e.customCurrencyMaskConfig=S,e.UCSearchModule=U,e.ɵb=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/common"),require("@angular/forms"),require("ngx-currency"),require("@ngx-translate/core"),require("@adins/uc-show-errors"),require("@adins/uc-directive-upper-case"),require("@angular/core")):"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/common","@angular/forms","ngx-currency","@ngx-translate/core","@adins/uc-show-errors","@adins/uc-directive-upper-case","@angular/core"],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.common,e.ng.forms,e.ngxCurrency,e.core,e.ucShowErrors,e.ucDirectiveUpperCase,e.ng.core)}(this,function(e,t,n,i,o,r,a,s,u,f,l,c,p,d,m,h){"use strict";var y=(g.decorators=[{type:h.Injectable,args:[{providedIn:"root"}]}],g.ctorParameters=function(){return[]},g.ngInjectableDef=h.defineInjectable({factory:function(){return new g},token:g,providedIn:"root"}),g);function g(){}var q=(v.RestrictionBetween="Between",v.RestrictionLike="Like",v.RestrictionEq="Eq",v.RestrictionNeq="NEQ",v.RestrictionGt="GT",v.RestrictionGte="GTE",v.RestrictionLt="LT",v.RestrictionLte="LTE",v.RestrictionIn="IN",v.RestrictionNotIn="NotIn",v.RestrictionOr="Or",v.RestrictionOrNeq="OrNeq",v.RestrictionIsNull="ISNULL",v.RestrictionIsNotNull="ISNOTNULL",v.RestrictionGTE="GTE",v.RestrictionLTE="LTE",v.showData="10,50,100",v.JoinTypeInner="INNER",v.JoinTypeLeft="LEFT",v);function v(){}var b=function j(){this.baseUrl="",this.apiPath="",this.requestObj=new Object,this.leftColumnToJoin="",this.rightColumnToJoin="",this.joinType=q.JoinTypeInner},I=function A(){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 N(){this.low=0,this.high=0,this.DataType="Text",this.isCriteriaDataTable=!1},x=function P(){this.includeCount=!0,this.includeData=!0,this.isLoading=!0,this.queryString="",this.rowVersion="",this.integrationObj=new b,this.joinType=q.JoinTypeInner},w=(F.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)},F.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")},F.decorators=[{type:h.Injectable}],F.ctorParameters=function(){return[]},F);function F(){}var T=(E.EXP_TYPE_PDF=0,E.EXP_TYPE_XLS=1,E.EXP_TYPE_XLSX=2,E.EXP_TYPE_DOC=3,E.EXP_TYPE_DOCX=4,E);function E(){}var C=function V(){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"},k=(Object.defineProperty(M.prototype,"content",{set:function(e){e&&(this.searchForm=e)},enumerable:!0,configurable:!0}),M.prototype.changeState=function(){this.currentState="initial"===this.currentState?"final":"initial",this.isHidden=!1===this.isHidden},M.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()},M.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 x,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(h.readonly=t.component[e].readonly,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((h.readonly=!1)&&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)})},M.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},M.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()},M.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},M.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()},M.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},M.prototype.getJSON=function(e){return this.http.get(e)},M.prototype.postJSON=function(e,t){return void 0===t&&(t=null),this.http.post(e,t)},M.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)},M.prototype.reset=function(){this.searchForm.resetForm({ExportType:this.ExportTypeList[0].key}),this.initiateForm()},M.prototype.search=function(e,n,t,i,r){var o=this;void 0===r&&(r=new Array);var a=new x,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=-1,d=0;d<this.countForm;d++){var m=new D;"dropdownSearch"==this.configuration.component[d].type?p+=3:p++;var h=this.myForm.nativeElement[p];if(m.DataType=h.getAttribute("data-type"),u=null!=h.getAttribute("query-in")&&"true"==h.getAttribute("query-in"),""!=h.value)if("SELECT"==h.nodeName){var f=h.options,y=f[f.selectedIndex].value.trim();if("one"==y){l=!0;var g=h.getAttribute("label");this.toastr.warning("Please select "+g);break}if(""!=h.getAttribute("data-crit-datatable")&&null!=h.getAttribute("data-crit-datatable")&&(m.isCriteriaDataTable=h.getAttribute("data-crit-datatable")),"taskDefinitionKey"==this.configuration.component[d].type||"processKey"==this.configuration.component[d].type)continue;if("claim"==this.configuration.component[d].type)m.propName=h.getAttribute("data-name"),m.restriction=y,m.value=null,s.push(m);else if("all"!=y&&"one"!=y)m.restriction=q.RestrictionEq,""!=h.name?m.propName=h.name:m.propName=h.getAttribute("data-name"),m.value=y,s.push(m);else if("all"==y&&1==u&&0!=h.options.length){var v=new Array;for(c=0;c<h.options.length;c++)0!=c&&v.push(h.options[c].value);0!=v.length&&(m.restriction=q.RestrictionIn,""!=h.name?m.propName=h.name:m.propName=h.getAttribute("data-name"),m.listValue=v,s.push(m))}}else""!=h.name?m.propName=h.name:m.propName=h.getAttribute("data-name"),m.value=h.value.trim(),h.value.includes("%")?m.restriction=q.RestrictionLike:""!=h.getAttribute("data-restriction")&&null!=h.getAttribute("data-restriction")?(m.restriction=h.getAttribute("data-restriction"),"numeric"==h.getAttribute("data-type")&&(m.value=parseFloat(h.value.replace(/,/g,"")).toString()),"LIKE"==m.restriction.toUpperCase()&&(m.value="%"+h.value.trim()+"%",m.restriction=q.RestrictionLike)):m.restriction=q.RestrictionEq,""!=h.getAttribute("data-crit-datatable")&&null!=h.getAttribute("data-crit-datatable")&&(m.isCriteriaDataTable=h.getAttribute("data-crit-datatable")),s.push(m)}if(!l){if(null!=r&&r!=undefined){if(0!=r.length)for(d=0;d<r.length;d++)s.push(r[d]);else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(d=0;d<this.searchInput.addCritInput.length;d++)s.push(this.searchInput.addCritInput[d])}else if(null!=this.searchInput.addCritInput||this.searchInput.addCritInput!=undefined)for(d=0;d<this.searchInput.addCritInput.length;d++)s.push(this.searchInput.addCritInput[d]);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),o.reqGetAllData.emit(a),e})}},M.prototype.GenerateReport=function(){this.genRpt.emit({ExportType:this.ExportType,ElRef:this.myForm})},M.prototype.lessThanFour=function(){return!(3<this.countForm)},M.prototype.resolveObject=function(t,e,n){var i=this;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)})),t.affectedFilter&&1==t.itemsUrl.length&&i.onChangeEvent(t.itemsUrl[0].Key,t)})},M.prototype.transformAmount=function(e){this.formattedAmount=parseFloat(e.target.value).toLocaleString("en"),e.target.value=this.formattedAmount},M.prototype.transformToDecimal=function(e){e.target.value=parseFloat(e.target.value.toString().replace(/,/g,""))},M.prototype.exportAsXLSX=function(){var t=this,e=new x;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)})},M.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 x,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=q.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)}},M.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)},M.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},M.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)},M.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},M.prototype.selectedOption=function(e,t){t.descr=e.Value,t.isListHide=!0},M.decorators=[{type:h.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.data-numericpair="{{question.numericPair}}"\r\n attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\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 [readonly]="question.readonly" attr.data-type="{{question.datatype}}"\r\n attr.data-name="{{question.name}}"\r\n attr.data-datepickerpair="{{question.datepickerPair}}"\r\n 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\'}}"\r\n (focusout)="question.restriction != undefined && 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\r\n *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}}"\r\n 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 :\r\n question.itemsUrl[0].Value}}</label>\r\n </div>\r\n <div *ngIf="question.type==\'dropdownSearch\'">\r\n <div class="dds-display-item"\r\n [hidden]="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1">\r\n <input type="text" class="form-control search-form-control dds-input"\r\n name="{{\'ddsValue\'+question.name}}" [(ngModel)]="question.descr" readonly\r\n (click)="question.isListHide = !question.isListHide; question.searchText=\'\'">\r\n </div>\r\n <label\r\n *ngIf="!question.isFromURL ? question?.items?.length == 1 : question?.itemsUrl?.length == 1">{{!question.isFromURL\r\n ? question.items[0].Value :\r\n question.itemsUrl[0].Value}}</label>\r\n <div class="dds-list-container" [hidden]="question.isListHide">\r\n <input type="text" class="form-control search-form-control"\r\n name="{{\'searchText\'+question.name}}" [(ngModel)]="question.searchText"\r\n [placeholder]="question.placeholder">\r\n <div class="dds-items-container">\r\n <select class="full-width" name="{{question.name}}"\r\n attr.data-required="{{question.isRequired}}" [(ngModel)]="question.value"\r\n [required]="question.isRequired" attr.query-in="{{question.isQueryIn}}"\r\n attr.data-type="{{question.datatype}}" attr.data-name="{{question.name}}"\r\n attr.label="{{question.label}}"\r\n attr.data-crit-datatable="{{question.isCriteriaDataTable}}"\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 size="{{question?.size == undefined ? question?.size : 10}}">\r\n <option (click)="selectedOption({Key:\'one\',Value:\'Select One\'},question)"\r\n *ngIf="question.ddsType == \'one\' && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="one">\r\n Select One</option>\r\n <option (click)="selectedOption({Key:\'all\',Value:\'All\'},question)"\r\n *ngIf="(question?.ddsType == undefined || question.ddsType == \'all\') && (!question.isFromURL ? question?.items?.length != 1 : question?.itemsUrl?.length != 1)"\r\n value="all">All</option>\r\n \x3c!-- <option *ngFor="let item of question?.items | textSearch : question.searchText; let i=index" [value]="item?.key" (click)="selectedOption(item,question)">\r\n {{item?.value}}\r\n </option> --\x3e\r\n <option\r\n *ngFor="let item of !question.isFromURL ? (question?.items | textSearch : question.searchText) : question?.itemsUrl | textSearch : question.searchText"\r\n (click)="selectedOption(item,question)" value="{{item.Key}}">\r\n {{item.Value}}\r\n </option>\r\n </select>\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}}"\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\r\n 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:[w,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}.dds-input{background-color:#fff;text-transform:uppercase}.dds-display-item:after{content:'\\e929';font-family:feather;font-size:1rem;display:inline-block;position:absolute;right:5px;top:5px;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.dds-list-container{position:absolute;width:100%;z-index:9}"]}]}],M.ctorParameters=function(){return[{type:t.HttpClient},{type:w},{type:h.Renderer2},{type:undefined,decorators:[{type:h.Inject,args:[n.DOCUMENT]}]},{type:a.ToastrService},{type:s.CookieService},{type:f.DatePipe},{type:h.ElementRef}]},M.propDecorators={content:[{type:h.ViewChild,args:["enjiForm"]}],myForm:[{type:h.ViewChild,args:["formIdSearch"]}],searchInput:[{type:h.Input}],pageSize:[{type:h.Input}],isReport:[{type:h.Input}],result:[{type:h.Output}],genRpt:[{type:h.Output}],reqGetAllData:[{type:h.Output}]},M);function M(e,t,n,i,r,o,a,s){this.http=e,this.excelService=t,this._renderer2=n,this._document=i,this.toastr=r,this.cookieService=o,this.datePipe=a,this.elemRef=s,this.searchInput=new I,this.pageSize=10,this.isReport=!1,this.result=new h.EventEmitter,this.genRpt=new h.EventEmitter,this.reqGetAllData=new h.EventEmitter,this.ExportTypeList=[{key:T.EXP_TYPE_PDF,value:"PDF"},{key:T.EXP_TYPE_XLS,value:"Excel 2003"},{key:T.EXP_TYPE_XLSX,value:"Excel 2007"},{key:T.EXP_TYPE_DOC,value:"Document"},{key:T.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.readonly=!1,this.currentState="initial",this.countForm=0,this.formattedAmount="",this.amount=0}var L=(O.prototype.transform=function(e,t){return t?e.filter(function(e){return!(!e.Value||"string"!=typeof e.Value)&&-1<e.Value.toLowerCase().indexOf(t.toLowerCase())}):e},O.decorators=[{type:h.Pipe,args:[{name:"textSearch"}]}],O);function O(){}var S={align:"right",allowNegative:!1,allowZero:!0,decimal:".",precision:2,prefix:"",suffix:"",thousands:",",nullable:!1,inputMode:c.CurrencyMaskInputMode.NATURAL},U=(R.decorators=[{type:h.NgModule,args:[{declarations:[k,L],imports:[f.CommonModule,l.FormsModule,d.UcShowErrorsModule,m.UcDirectiveUpperCaseModule,c.NgxCurrencyModule.forRoot(S),p.TranslateModule.forChild()],exports:[k]}]}],R);function R(){}e.UCSearchService=y,e.UCSearchComponent=k,e.customCurrencyMaskConfig=S,e.UCSearchModule=U,e.ɵb=L,e.ɵa=w,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=adins-ucsearch.umd.min.js.map
|