1import{a as ke}from"./chunk-VPNROYMA.js";import{a as Ae}from"./chunk-PMPKRBM5.js";import"./chunk-X3FLNVX7.js";import{a as Ve}from"./chunk-ZXHCXM7E.js";import{a as qe}from"./chunk-UIQITXG6.js";import"./chunk-GWNYURDA.js";import"./chunk-ZNGVFA7A.js";import"./chunk-PZF3IKF7.js";import{a as He}from"./chunk-FRBCSWNS.js";import"./chunk-EUDZ3OBS.js";import"./chunk-FA7Z5M7G.js";import{a as w}from"./chunk-HAS275M6.js";import"./chunk-XVKDIWLH.js";import"./chunk-HH4C6W2H.js";import{d as Y}from"./chunk-A3BML6VH.js";import{n as X}from"./chunk-VM5OC7EY.js";import"./chunk-KLC6KV4U.js";import"./chunk-73RWI3QX.js";import"./chunk-2OTXUOOB.js";import"./chunk-5EZFF3RR.js";import"./chunk-DJGKYIDP.js";import{a as Re}from"./chunk-FM4YUUAU.js";import{a as ge,b as Se}from"./chunk-EIFDYJRO.js";import{e as ye,f as be,g as xe,h as we,i as Ee,j as Te,k as Me,l as Le,m as De,n as Be,p as Ie}from"./chunk-YCZHRI3R.js";import{a as Fe}from"./chunk-A6VWUFA5.js";import"./chunk-SABFTKYI.js";import"./chunk-C5Z7LZ75.js";import"./chunk-5JCK5AHP.js";import"./chunk-JGLZKJX4.js";import{f as Ce}from"./chunk-DDQIHVOV.js";import"./chunk-JO2FI6H5.js";import{c as _e,e as B,h as ve}from"./chunk-REZTMBVK.js";import"./chunk-CSLXO2TK.js";import{b as $,c as O,d as D,u as Q}from"./chunk-7R5JBG5O.js";import"./chunk-AJAJFYAL.js";import"./chunk-Q4WNEHHE.js";import"./chunk-Q5AZYPK7.js";import"./chunk-ZHEVVJCK.js";import"./chunk-JNYYNB56.js";import{a as ce,b as de}from"./chunk-JQWJTO3J.js";import{a as ue,b as he,e as fe}from"./chunk-Q2762QK7.js";import"./chunk-LLSWYBYW.js";import"./chunk-K7QAXN6Z.js";import{e as z}from"./chunk-XI7OEVLD.js";import{Ca as P,Da as U,Fa as W,Ha as G,Ja as J,Ka as K,Na as se,Oa as pe,ya as j}from"./chunk-HJ22JSJV.js";import{n as V,r as N}from"./chunk-5ALDQSIV.js";import{B as re,C as me,b as Z,g as ee,h as te,m as ae,n as ie,o as ne,r as oe,z as le}from"./chunk-DZXPISIV.js";import{Ac as l,Bb as p,Bd as H,Ca as C,Cc as f,Ec as T,Fc as M,Gc as L,Kc as x,Nb as q,Xb as u,Yb as n,Zb as o,_b as h,cc as c,dc as d,fc as b,gb as m,ia as R,ic as _,lc as A,pb as v,qa as S,ra as y,vb as k,wa as F,x as I}from"./chunk-TUX6BVKC.js";import"./chunk-JGDRNPQP.js";var E=class{constructor(){this.employeeId=0,this.leaveTypeId=null,this.type=0,this.amount=0,this.available=0,this.remarks=""}};var ze=()=>[37],je=()=>[10,20,50],Pe=()=>[];function Ue(e,i){e&1&&(n(0,"th",45),l(1," Action "),o())}function We(e,i){if(e&1){let t=b();n(0,"td",46)(1,"button",47),_("click",function(){let a=S(t).$implicit,r=A();return y(r.enable(a))}),h(2,"mat-icon",48),o()()}}function Ge(e,i){e&1&&(n(0,"th",49),l(1,"Amount"),o())}function Je(e,i){if(e&1){let t=b();n(0,"td",46)(1,"div",50)(2,"mat-form-field",51)(3,"input",52),L("ngModelChange",function(a){let r=S(t).$implicit;return M(r.amount,a)||(r.amount=a),y(a)}),o()()()()}if(e&2){let t=i.$implicit;m(3),T("ngModel",t.amount),u("placeholder","")("disabled",!t.isAmount)}}function Ke(e,i){e&1&&(n(0,"th",53),l(1,"New Balance"),o())}function Qe(e,i){if(e&1){let t=b();n(0,"td",46)(1,"div",54)(2,"app-dropdown",55),_("selected",function(a){let r=S(t).$implicit;return y(r.type=a)}),o()()()}if(e&2){let t=i.$implicit;m(2),u("isFix",!0)("disabled",!t.isType)("useControl",!1)("multiple",!1)("all",!1)("value",t.type)("options",x(8,Pe))("type",82)}}function Xe(e,i){e&1&&(n(0,"th",56),l(1," Remarks "),o())}function Ye(e,i){if(e&1){let t=b();n(0,"td",46)(1,"div",50)(2,"mat-form-field",57)(3,"input",58),L("ngModelChange",function(a){let r=S(t).$implicit;return M(r.remarks,a)||(r.remarks=a),y(a)}),o()()()()}if(e&2){let t=i.$implicit;m(3),T("ngModel",t.remarks),u("placeholder","")("disabled",!t.isRemarks)}}function Ze(e,i){e&1&&(n(0,"th",59),l(1," Employee "),o())}function et(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.employee," ")}}function tt(e,i){e&1&&(n(0,"th",59),l(1," Leave Type "),o())}function at(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.leaveType," ")}}function it(e,i){e&1&&(n(0,"th",59),l(1," Earned "),o())}function nt(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.earned," ")}}function ot(e,i){e&1&&(n(0,"th",59),l(1," Carry Forward "),o())}function lt(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.carried," ")}}function rt(e,i){e&1&&(n(0,"th",59),l(1," Carry Forward "),h(2,"br"),l(3," Expiration Date "),o())}function mt(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.carryExpiration," ")}}function st(e,i){e&1&&(n(0,"th",59),l(1," Expired "),h(2,"br"),l(3," Carry Forward "),o())}function pt(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.expired," ")}}function ct(e,i){e&1&&(n(0,"th",59),l(1,"Leave Used "),o())}function dt(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.used," ")}}function ut(e,i){e&1&&(n(0,"th",59),l(1," Pending Approval "),o())}function ht(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.pendingApproval," ")}}
1function ft(e,i){e&1&&(n(0,"th",59),l(1," Pending Schedule "),o())}function _t(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.pendingSchedule," ")}}function vt(e,i){e&1&&(n(0,"th",59),l(1," Available Balance "),o())}function Ct(e,i){if(e&1&&(n(0,"td",60),l(1),o()),e&2){let t=i.$implicit;m(),f(" ",t.available," ")}}function gt(e,i){e&1&&h(0,"tr",61)}function St(e,i){e&1&&h(0,"tr",62)}var Ne=(()=>{class e{constructor(t,s,a,r,g,$e,Oe){this.fb=t,this.leaveService=s,this.masterService=a,this.route=r,this.router=g,this.message=$e,this.coreService=Oe,this.destroyRef=R(F),this.dropdownFixRequest=new B,this.leavetyperequest=new B,this.dropdownOptions=new ve,this.pipe=new H("en-US"),this.field_count=0,this.resultHierarchy=new _e,this.dataSource=C([]),this.isLoadingResults=C(!0),this.totalRows=C(0),this.request=new Re,this.displayedColumns=["action","amount","type","remarks","employeeId","leaveTypeId","earned","carried","carryExpiration","expired","used","pendingApproval","pendingSchedule","available"],this.isSave=C(!1),this.isFormFieldEnabled=C(!0),this.showsub=!1}ngOnInit(){this.id=this.route.snapshot.paramMap.get("id"),this.leavebalanceform=this.fb.group(new E),this.isFormFieldEnabled.set(!1),I({leavetype:this.coreService.getCoreDropdown(1017,this.leavetyperequest)}).pipe(w(this.destroyRef)).subscribe({next:t=>{this.dropdownOptions.Leavecategory=t.leavetype.payload},error:t=>{console.error(t)},complete:()=>{}})}enable(t){this.showsub=!0,t.isRemarks=!0,t.isType=!0,t.isAmount=!0}sample(t){}handleUploadEvent(){this.router.navigate(["detail/upload"])}Search(t){var s=this.leavebalanceform.value.leaveTypeId.toString();this.request.SearchColumn=[],this.leavebalanceform.markAllAsTouched(),this.leavebalanceform.valid&&(this.request.SearchColumn=[],this.leavebalanceform.value.leaveTypeId.forEac
1h(a=>{this.request.SearchColumn.push({key:"leaveTypeId",value:a+"",type:2})}),this.resultHierarchy.Search.length>0&&this.resultHierarchy.Search.forEach(a=>{a.Value.forEach(r=>{this.request.SearchColumn.push({key:a.Key,value:r+"",type:a.Type})})}),this.dropdownFixRequest.id.push({dropdownID:0,dropdownTypeID:82}),t?this.coreService.exportAll(this.request,"12662","1"):this.loadData())}loadData(){this.request.Order="EmployeeId",this.isLoadingResults.set(!0),this.leaveService.getLeaveBalanceTable(this.request).pipe(w(this.destroyRef)).subscribe({next:t=>{if(t.statusCode==200){console.log(t.payload.data);let s=t.payload.data;s.forEach(a=>{a.isAmount=!1,a.isType=!1,a.isRemarks=!1,a.type=0}),this.dataSource.set(s),this.totalRows.set(t.payload.totalRows),this.isLoadingResults.set(!1)}else console.log(t.stackTrace),console.log(t.message),this.isLoadingResults.set(!1)},error:t=>{console.error(t),this.isLoadingResults.set(!1)}})}handlePageEvent(t){this.request.Start=t.pageIndex,this.request.Length=t.pageSize,this.loadData()}submit(){let t=this.message.open($);var s=this.dataSource().filter(a=>a.amount!==0&&a.type!==0);t.afterClosed().subscribe(a=>{a=="confirmed"&&(this.isSave.set(!0),this.leaveService.postLeaveBalance(s).pipe(w(this.destroyRef)).subscribe({next:r=>{r.statusCode==200?(this.message.open(O),this.isSave.set(!1),this.router.navigate(["/detail/leave-balance"]),this.loadData()):(this.message.open(D),console.log(r.stackTrace),console.log(r.message))},error:r=>{this.isSave.set(!1),this.message.open(D),console.error(r)}}))})}static{this.\u0275fac=function(s){return new(s||e)(v(le),v(ke),v(Fe),v(V),v(N),v(Q),v(Ce))}}static{this.\u0275cmp=k({type:e,selectors:[["app-leave-balance"]],decls:67,vars:23,consts:[[1,"flex","flex-col","flex-auto","min-w-0"],[1,"flex-auto","sm:p-2","w-full","min-w-0","sm:absolute","sm:inset-0","sm:overflow-auto","text-md"],[1,"body-card"],[1,"pt-5"],["title","Leave Balance",3,"submitTap","sub","back"],[1,"flex","flex-wrap"],[1,"h-13","mr-3"],[3,"multiple","all","notincludetag","resultHierarchy"],[1,"h-13","mr-3",3,"formGroup"],[3,"selected","useControl","all","multiple","control","options","type"],[1,"flex","space-x-2"],["mat-flat-button","","color","primary","matTooltip","Search",1,"w-[10px]",3,"click"],["matSuffix","","svgIcon","mat_outline:search",1,"mb-2"],["mat-flat-button","","color","primary","matTooltip","Upload",1,"w-[10px]",3,"click"],["matSuffix","","svgIcon","mat_outline:upload",1,"mb-2"],["type","button","mat-flat-button","","color","primary","matTooltip","Export",1,"w-[10px]",3,"click"],["svgIcon","mat_outline:download",1,"mb-2"],[1,"mt-5","mb-5"],["tabindex","0",1,"example-container","mat-elevation-z0","z-10"],["mat-table","",1,"border",3,"dataSource"],["matColumnDef","action"],["class","pl-10","mat-header-cell","",4,"matHeaderCellDef"],["class","","mat-cell","",4,"matCellDef"],["matColumnDef","amount"],["class","pl-8","mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","type"],["class","pl-15","mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","remarks"],["class","pl-[20px]","mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","employeeId"],["class","","mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","class","h-10",4,"matCellDef"],["matColumnDef","leaveTypeId"],["matColumnDef","earned"],["matColumnDef","carried"],["class","h-10","mat-cell","",4,"matCellDef"],["matColumnDef","carryExpiration"],["matColumnDef","expired"],["matColumnDef","used"],["matColumnDef","pendingApproval"],["matColumnDef","pendingSchedule"],["matColumnDef","available"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",1,"paganation",3,"page","length","pageSize","pageIndex","pageSizeOptions"],["mat-header-cell","",1,"pl-10"],["mat-cell","",1,""],["color","primary","mat-button","",3,"click"],["svgIcon","heroicons_outline:pencil-square",1,"mb-2"],["mat-header-cell","",1,"pl-8"],[1,"h-13","mt-1"],["appearance","outline",1,"w-20"],["matInput","","type","number",1,"amount-label",3,"ngModelChange","ngModel","placeholder","disabled"],["mat-header-cell","",1,"pl-15"],[1,"h-13","mt-1","w-50"],["label","New Balance",3,"selected","isFix","disabled","useControl","multiple","all","value","o
1ptions","type"],["mat-header-cell","",1,"pl-[20px]"],["appearance","outline",1,"w-50"],["matInput","","type","text",1,"remarks-label",3,"ngModelChange","ngModel","placeholder","disabled"],["mat-header-cell","",1,""],["mat-cell","",1,"h-10"],["mat-header-row",""],["mat-row",""]],template:function(s,a){s&1&&(n(0,"div",0)(1,"div",1)(2,"mat-card",2)(3,"mat-card-title",3)(4,"app-card-title",4),_("submitTap",function(){return a.submit()}),o()(),h(5,"br"),n(6,"div",5)(7,"div",6),h(8,"app-employee-hierarchy",7),o(),n(9,"form",8)(10,"app-dropdown-custom",9),_("selected",function(g){return a.sample(g)}),o()(),n(11,"div",10)(12,"button",11),_("click",function(){return a.Search(!1)}),h(13,"mat-icon",12),o(),n(14,"button",13),_("click",function(){return a.handleUploadEvent()}),h(15,"mat-icon",14),o(),n(16,"button",15),_("click",function(){return a.Search(!0)}),h(17,"mat-icon",16),o()()(),n(18,"div",17),h(19,"mat-divider"),o(),n(20,"section",18)(21,"table",19),c(22,20),p(23,Ue,2,0,"th",21)(24,We,3,0,"td",22),d(),c(25,23),p(26,Ge,2,0,"th",24)(27,Je,4,3,"td",22),d(),c(28,25),p(29,Ke,2,0,"th",26)(30,Qe,3,9,"td",22),d(),c(31,27),p(32,Xe,2,0,"th",28)(33,Ye,4,3,"td",22),d(),c(34,29),p(35,Ze,2,0,"th",30)(36,et,2,1,"td",31),d(),c(37,32),p(38,tt,2,0,"th",30)(39,at,2,1,"td",31),d(),c(40,33),p(41,it,2,0,"th",30)(42,nt,2,1,"td",31),d(),c(43,34),p(44,ot,2,0,"th",30)(45,lt,2,1,"td",35),d(),c(46,36),p(47,rt,4,0,"th",30)(48,mt,2,1,"td",35),d(),c(49,37),p(50,st,4,0,"th",30)(51,pt,2,1,"td",35),d(),c(52,38),p(53,ct,2,0,"th",30)(54,dt,2,1,"td",31),d(),c(55,39),p(56,ut,2,0,"th",30)(57,ht,2,1,"td",31),d(),c(58,40),p(59,ft,2,0,"th",30)(60,_t,2,1,"td",31),d(),c(61,41),p(62,vt,2,0,"th",30)(63,Ct,2,1,"td",35),d(),p(64,gt,1,0,"tr",42)(65,St,1,0,"tr",43),o()(),n(66,"mat-paginator",44),_("page",function(g){return a.handlePageEvent(g)}),o()()()()),s&2&&(m(4),u("sub",a.showsub)("back",!1),m(4),u("multiple",!0)("all",!0)("notincludetag",x(21,ze))("resultHierarchy",a.resultHierarchy),m(),u("formGroup",a.leavebalanceform),m(),u("useControl",!0)("all",!0)("multiple",!0)("control",a.leavebalanceform.get("leaveTypeId"))("options",a.dropdownOptions.Leavecategory)("type",1017),m(11),u("dataSource",a.dataSource()),m(43),u("matHeaderRowDef",a.displayedColumns),m(),u("matRowDefColumns",a.displayedColumns),m(),u("length",a.totalRows())("pageSize",a.request.Length)("pageIndex",a.request.Start)("pageSizeOptions",x(22,je)),q("disabled",a.isLoadingResults()?!0:null))},dependencies:[me,ie,Z,ne,ee,te,oe,re,ae,U,P,j,pe,se,fe,ue,he,He,qe,Ae,K,J,de,ce,Ie,ye,xe,Me,we,be,Le,Ee,Te,De,Be,Se,ge,G,W,z,Ve,Y],styles:[`.body-card{position:relative;height:100%;padding-top:1px}.example-container{position:absolute;inset:120px 15px 80px;max-height:100%;overflow:auto}.paganation{position:absolute;left:0;right:0;bottom:0}.table-header{z-index:1}tr.mat-header-row{height:35px}tr.mat-row{height:22px;font-size:small}.mat-cell{align-items:center;text-align:center}.mdc-data-table__table{white-space:nowrap!important} 2`],encapsulation:2,data:{animation:X},changeDetection:0})}}return e})();var da=[{path:"leave-balance",redirectTo:"leave-balance/",pathMatch:"full"},{path:"leave-balance",component:Ne}];export{da as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.