ng-implementation/angular18/dist/easy-angular/290.c6d31198e7723f1a.js
2025-10-15 11:17:29 +02:00

1 line
No EOL
3.9 KiB
JavaScript

"use strict";(self.webpackChunkEasyAngular=self.webpackChunkEasyAngular||[]).push([[290],{6290:(I,i,a)=>{a.r(i),a.d(i,{LoginComponent:()=>b});var l=a(467),m=a(177),o=a(9417),_=a(4550),d=a(9664),E=a(2767),e=a(4438),f=a(1315),v=a(6825);const u=t=>({"is-invalid":t});function R(t,p){1&t&&(e.j41(0,"div",18),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"FIELD_REQUIRED")," "))}function h(t,p){1&t&&(e.j41(0,"div",18),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"FIELD_EMAIL")," "))}function g(t,p){1&t&&(e.j41(0,"div",18),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"FIELD_REQUIRED")," "))}let b=(()=>{class t{constructor(n,s,r){this.router=n,this.storeService=s,this.appService=r,this.appName=E.c.appName,this.initFormGroup()}initFormGroup(){this.formGroup=new o.gE({email:new o.MJ({value:"",disabled:!1},{validators:[o.k0.required,o.k0.email],nonNullable:!0}),password:new o.MJ({value:"",disabled:!1},{validators:[o.k0.required],nonNullable:!0})})}onClickSubmit(){var n=this;return(0,l.A)(function*(){yield n.authenticate()})()}authenticate(){var n=this;return(0,l.A)(function*(){n.storeService.isLoading.set(!0);const s=n.formGroup.controls.email.getRawValue(),r=n.formGroup.controls.password.getRawValue(),c=yield n.appService.authenticate(s,r);n.storeService.isLoading.set(!1),c&&n.router.navigate(["/home"])})()}static#e=this.\u0275fac=function(s){return new(s||t)(e.rXU(_.Ix),e.rXU(f.n),e.rXU(v.d))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["app-login"]],standalone:!0,features:[e.aNF],decls:34,vars:30,consts:[[1,"text-center","text-primary","mb-4"],[1,"h2","fw-normal","mb-0"],[1,"h1","fw-bold","text-uppercase"],[1,"fw-normal","text-black"],[1,"d-flex","justify-content-center"],[1,"wrapper"],[3,"ngSubmit","formGroup"],[1,"mb-3"],["for","email",1,"form-label","text-start","w-100"],["type","email","id","email","formControlName","email",1,"form-control",3,"ngClass"],["class","invalid-feedback",4,"ngIf"],["for","password",1,"form-label","text-start","w-100"],["type","password","id","password","formControlName","password",1,"form-control",3,"ngClass"],[1,"text-end","mb-3"],["routerLink","/auth/forgot-password",1,""],[1,"text-center"],["type","submit",1,"btn","btn-primary","mb-3","px-5",3,"disabled"],[1,"px-4","d-block"],[1,"invalid-feedback"]],template:function(s,r){1&s&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",2),e.EFF(5),e.k0s(),e.j41(6,"div",3),e.EFF(7),e.nI1(8,"translate"),e.k0s()(),e.j41(9,"div",4)(10,"div",5)(11,"form",6),e.bIt("ngSubmit",function(){return r.onClickSubmit()}),e.j41(12,"div",7)(13,"label",8),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.nrm(16,"input",9),e.DNE(17,R,3,3,"div",10)(18,h,3,3,"div",10),e.k0s(),e.j41(19,"div",7)(20,"label",11),e.EFF(21),e.nI1(22,"translate"),e.k0s(),e.nrm(23,"input",12),e.DNE(24,g,3,3,"div",10),e.k0s(),e.j41(25,"div",13)(26,"a",14),e.EFF(27),e.nI1(28,"translate"),e.k0s()(),e.j41(29,"div",15)(30,"button",16)(31,"span",17),e.EFF(32),e.nI1(33,"translate"),e.k0s()()()()()()),2&s&&(e.R7$(2),e.JRh(e.bMT(3,14,"WELCOME_TO")),e.R7$(3),e.JRh(r.appName),e.R7$(2),e.JRh(e.bMT(8,16,"PROJECT_DESC")),e.R7$(4),e.Y8G("formGroup",r.formGroup),e.R7$(3),e.JRh(e.bMT(15,18,"EMAIL")),e.R7$(2),e.Y8G("ngClass",e.eq3(26,u,r.formGroup.controls.email.errors&&r.formGroup.controls.email.touched)),e.R7$(),e.Y8G("ngIf",r.formGroup.controls.email.hasError("required")),e.R7$(),e.Y8G("ngIf",r.formGroup.controls.email.hasError("email")),e.R7$(3),e.JRh(e.bMT(22,20,"PASSWORD")),e.R7$(2),e.Y8G("ngClass",e.eq3(28,u,r.formGroup.controls.password.errors&&r.formGroup.controls.password.touched)),e.R7$(),e.Y8G("ngIf",r.formGroup.controls.password.hasError("required")),e.R7$(3),e.JRh(e.bMT(28,22,"FORGOT_YOUR_PWD")),e.R7$(3),e.Y8G("disabled",!r.formGroup.valid),e.R7$(2),e.JRh(e.bMT(33,24,"SIGN_IN")))},dependencies:[o.YN,o.qT,o.me,o.BC,o.cb,o.X1,o.j4,o.JD,m.YU,m.bT,_.Wk,d.h,d.D9],styles:[".wrapper[_ngcontent-%COMP%]{max-width:350px;width:100%}"]})}return t})()}}]);