Files
kapp/580.a17088ccd9f7e32c.js
T
2026-05-21 11:19:10 -03:00

1 line
8.6 KiB
JavaScript

(self.webpackChunkapp=self.webpackChunkapp||[]).push([[580],{70580:(w,m,a)=>{a.r(m),a.d(m,{EventFirstLicensePlatePageModule:()=>x});var f=a(61380),h=a(69270),e=a(45449),s=a(24006),c=a(47898),E=a(90944),P=a(90603),T=a(70079),C=a(99826);function _(t,o){if(1&t&&(e.\u0275\u0275elementStart(0,"div",15),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&t){const i=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.message," ")}}function L(t,o){if(1&t&&(e.\u0275\u0275elementStart(0,"div",13),e.\u0275\u0275template(1,_,2,1,"div",14),e.\u0275\u0275elementEnd()),2&t){const i=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.getFieldInputValidationErrors("licensePlateOne"))}}const u=function(){return{mask:"0000000",len:7}};function I(t,o){1&t&&(e.\u0275\u0275elementStart(0,"div",6),e.\u0275\u0275element(1,"input",16),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("brmasker",e.\u0275\u0275pureFunction0(4,u))("placeholder",e.\u0275\u0275pipeBind1(2,2,"PG_CREATE_LICENCEPLATE_TWO_STEP_INPUT")))}function O(t,o){if(1&t&&(e.\u0275\u0275elementStart(0,"div",15),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&t){const i=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",i.message," ")}}function S(t,o){if(1&t&&(e.\u0275\u0275elementStart(0,"div",13),e.\u0275\u0275template(1,O,2,1,"div",14),e.\u0275\u0275elementEnd()),2&t){const i=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",i.getFieldInputValidationErrors("licensePlateTwo"))}}const F=[{path:"",component:(()=>{class t{constructor(i,l,d,N,A,M){this.formBuilder=i,this.notificatorService=l,this.navigationService=d,this.createLogisticEventService=N,this.commonService=A,this.translateConfigService=M,this.eventLicensePlaceOneFormErrors=[],this.onSubmit=()=>{this.cleanValidationErrors();const n=this.commonService.clearString(this.eventLicensePlateOneForm.controls.licensePlateOne.value),r=this.commonService.clearString(this.eventLicensePlateOneForm.controls.licensePlateTwo.value),p=this.validateInput({licensePlateOne:n,licensePlateTwo:r});if(p.length){this.setValidationErrors(p);const g={title:this.translateConfigService.translate("TOAST_INVALID_DATA_TITLE"),message:this.translateConfigService.translate("TOAST_INVALID_DATA_NESSAGE"),type:"error"};this.notificatorService.notify(g)}else{const g=n.toUpperCase();if(this.createLogisticEventService.setLicensePlateOne(g),this.hasCart){const y=r.toUpperCase();this.createLogisticEventService.setLicensePlateTwo(y)}this.navigationService.forward(["/logistic-events/create/event-options"])}},this.validateInput=n=>{const r=[],v=this.validateLicensePlateOneInput(n);if(v&&r.push(v),this.hasCart){const p=this.validateLicensePlateTwoInput(n);p&&r.push(p)}return r},this.validateLicensePlateOneInput=n=>{const r=new RegExp("^[A-Za-z0-9]{7}$");return!n.licensePlateOne||n.licensePlateOne.length<1?{message:this.translateConfigService.translate("PG_CREATE_LICENCEPLATE_ONE_STEP_ISNEED_PLATE"),field:"licensePlateOne"}:r.test(n.licensePlateOne)?null:{message:this.translateConfigService.translate("PG_CREATE_LICENCEPLATE_STEP_INPUT_EMPTY"),field:"licensePlateOne"}},this.validateLicensePlateTwoInput=n=>{const r=new RegExp("^[A-Za-z0-9]{7}$");return!n.licensePlateTwo||n.licensePlateTwo.length<1?{message:this.translateConfigService.translate("PG_CREATE_LICENCEPLATE_TWO_STEP_ISNEED_PLATE"),field:"licensePlateTwo"}:r.test(n.licensePlateTwo)?null:{message:this.translateConfigService.translate("PG_CREATE_LICENCEPLATE_STEP_INPUT_EMPTY"),field:"licensePlateTwo"}},this.goOneStepBack=()=>{this.cleanValidationErrors(),this.navigationService.back(["/logistic-events/create/event-transport-type"])},this.setValidationErrors=n=>{console.log("setValidationErrors:",n),this.eventLicensePlaceOneFormErrors=n},this.cleanValidationErrors=()=>{this.eventLicensePlaceOneFormErrors=[]},this.thereIsFieldInputValidationErrors=n=>this.eventLicensePlaceOneFormErrors.find(r=>r.field===n),this.getFieldInputValidationErrors=n=>this.eventLicensePlaceOneFormErrors.filter(r=>r.field===n),this.eventLicensePlateOneForm=this.formBuilder.group({licensePlateOne:[this.createLogisticEventService.getLicensePlateOne()],licensePlateTwo:[this.createLogisticEventService.getLicensePlateTwo()]})}ionViewDidEnter(){this.hasCart=this.createLogisticEventService.getHasCart()}}return t.\u0275fac=function(i){return new(i||t)(e.\u0275\u0275directiveInject(s.UntypedFormBuilder),e.\u0275\u0275directiveInject(c.V6),e.\u0275\u0275directiveInject(c.f5),e.\u0275\u0275directiveInject(c.V),e.\u0275\u0275directiveInject(c.v_),e.\u0275\u0275directiveInject(c.wK))},t.\u0275cmp=e.\u0275\u0275defineComponent({type:t,selectors:[["app-event-first-license-plate"]],decls:23,vars:18,consts:[[1,"centralized-content"],[1,"page-title"],[1,"title"],[1,"ion-margin-vertical"],[3,"formGroup","ngSubmit"],[1,"input-holder"],[1,"input"],["type","text","formControlName","licensePlateOne",3,"brmasker","placeholder"],["class","errors",4,"ngIf"],["class","input",4,"ngIf"],[1,"button-holder"],["type","button",1,"back",3,"click"],["type","submit",3,"click"],[1,"errors"],["class","error",4,"ngFor","ngForOf"],[1,"error"],["type","text","formControlName","licensePlateTwo",3,"brmasker","placeholder"]],template:function(i,l){1&i&&(e.\u0275\u0275elementStart(0,"ion-content")(1,"div",0)(2,"div",1)(3,"div",2),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(6,"ion-row")(7,"ion-col",3)(8,"form",4),e.\u0275\u0275listener("ngSubmit",function(){return l.onSubmit()}),e.\u0275\u0275elementStart(9,"div",5)(10,"div",6),e.\u0275\u0275element(11,"input",7),e.\u0275\u0275pipe(12,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(13,L,2,1,"div",8),e.\u0275\u0275template(14,I,3,5,"div",9),e.\u0275\u0275template(15,S,2,1,"div",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",10)(17,"button",11),e.\u0275\u0275listener("click",function(){return l.goOneStepBack()}),e.\u0275\u0275text(18),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"button",12),e.\u0275\u0275listener("click",function(){return l.onSubmit()}),e.\u0275\u0275text(21),e.\u0275\u0275pipe(22,"translate"),e.\u0275\u0275elementEnd()()()()()()()),2&i&&(e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(5,9,"PG_CREATE_LICENCEPLATE_STEP_TEXT_TITLE")),e.\u0275\u0275advance(4),e.\u0275\u0275property("formGroup",l.eventLicensePlateOneForm),e.\u0275\u0275advance(3),e.\u0275\u0275property("brmasker",e.\u0275\u0275pureFunction0(17,u))("placeholder",e.\u0275\u0275pipeBind1(12,11,"PG_CREATE_LICENCEPLATE_ONE_STEP_INPUT")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",l.thereIsFieldInputValidationErrors("licensePlateOne")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",l.hasCart),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",l.thereIsFieldInputValidationErrors("licensePlateTwo")),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(19,13,"BTN_BACK")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(22,15,"BTN_NEXT")))},dependencies:[E.NgForOf,E.NgIf,P.IonCol,P.IonContent,P.IonRow,s.\u0275NgNoValidate,s.DefaultValueAccessor,s.NgControlStatus,s.NgControlStatusGroup,s.FormGroupDirective,s.FormControlName,T.bS,C.X$],styles:["ion-toolbar[_ngcontent-%COMP%]{font-family:Nunito,sans-serif}ion-toolbar[_ngcontent-%COMP%] ion-img[_ngcontent-%COMP%]{height:25px;width:25px}ion-toolbar[_ngcontent-%COMP%] ion-title[_ngcontent-%COMP%]{letter-spacing:1px}.centralized-content[_ngcontent-%COMP%]{height:calc(100vh - 56px);display:flex;justify-content:flex-start;flex-direction:column}.centralized-content[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-transform:uppercase;text-align:center}.centralized-content[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{text-transform:initial!important}.centralized-content[_ngcontent-%COMP%] .errors[_ngcontent-%COMP%]{width:80%;margin:12px 10% 0;color:#f0181b;text-align:center}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%]{margin-top:32px;margin-bottom:32px}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:700;text-align:center}.centralized-content[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%] .sub-title[_ngcontent-%COMP%]{text-align:center;color:#656768;font-size:.9em;margin-top:4px}"]}),t})()}];let x=(()=>{class t{}return t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=e.\u0275\u0275defineNgModule({type:t}),t.\u0275inj=e.\u0275\u0275defineInjector({imports:[h.I,f.RouterModule.forChild(F)]}),t})()}}]);