UNPKG

angular-t9n

Version:
1 lines 4.93 kB
import'./chunk-CVZYzvpd.js';import {F as Ft,R as Rt}from'./chunk-CyoIu4Ye.js';import {J,I as It}from'./chunk-BVUXkDrv.js';import {g,aS as W,F,K,aV as t,B as Ba,aX as ja,e as en,h as hn,u as un,aL as Ie,Y as Yt,m as mt,aM as yt,aN as wt,M as Mt,x as xT,L as Ls,E as EC,b as xC,J as Jl,t as pb,aO as td,W as Wb,aP as nd,d as bg,f as fy,O as OC,C as gb,P as Pm,aY as bb,o as Lm,p as sw,c as Ym,z as cw,aZ as Ih,a_ as wh}from'./main-XWPOM5LO.js';import {V as Ve,B as Be$1,v as ve,X}from'./chunk-VgysnmPQ.js';import {J as Jt,B as Be,V,x as xt}from'./chunk-Cfbj5Ou5.js';import {I}from'./chunk-C9OKxrz_.js';import'./chunk-Ce3BBnKT.js';import {M as Mn,E as En,A as An,L as Le,C as Cn,V as Vn,K as Kt,X as Xt}from'./chunk-BaYJwvwh.js';import'./chunk-C1Idjiqb.js';import'./chunk-C2N3F-hv.js';import'./chunk-DvU4UsWB.js';function Ne(m,ue){if(m&1){let e=bb();Ls(0,"form",9)(1,"mat-form-field")(2,"mat-label"),Wb(3,1),Jl(),Lm(4,"input",11),sw(),Jl(),Ls(5,"mat-form-field")(6,"mat-label"),Wb(7,2),Jl(),Lm(8,"input",12),sw(),Jl(),Ls(9,"mat-form-field")(10,"mat-label"),Wb(11,3),Jl(),Lm(12,"textarea",13),sw(),Ls(13,"button",14),Ym("click",function(){let n=Ih(e);return wh(n.get("target").setValue(n.get("source").value))}),Ls(14,"mat-icon"),EC(15,"file_copy"),Jl()()(),Ls(16,"mat-form-field")(17,"mat-label"),Wb(18,4),Jl(),Lm(19,"textarea",15),sw(),Jl(),Ls(20,"mat-form-field")(21,"mat-label"),EC(22,"State"),Jl(),Ls(23,"mat-select",16)(24,"mat-option",17),Wb(25,5),Jl(),Ls(26,"mat-option",18),Wb(27,6),Jl(),Ls(28,"mat-option",19),Wb(29,7),Jl(),Ls(30,"mat-option",20),Wb(31,8),Jl()(),sw(),Jl()();}m&2&&(Pm("formGroup",ue),bg(4),cw(),bg(4),cw(),bg(4),cw(),bg(7),cw(),bg(4),cw());}var je=(()=>{class m{constructor(){this._translationTargetService=g(I),this._route=g(W),this._formBuilder=g(Mn),this._destroy=new F,this.params=this._route.params.pipe(K(n=>{var l=n,{unitId:e}=l,o=t(l,["unitId"]);return o})),this.unit=this._route.paramMap.pipe(Ba(e=>this._translationTargetService.unit(e.get("unitId"))),ja()),this.form=this.unit.pipe(K(e=>this._createForm(e)));}ngOnDestroy(){this._destroy.next(),this._destroy.complete();}_createForm(e){let o=this._formBuilder.group({description:[{value:e.description||"-",disabled:true}],meaning:[{value:e.meaning||"-",disabled:true}],source:[{value:e.source,disabled:true}],target:e.target,state:e.state});return this._translationTargetService.updateUnitOnChange(e,o.controls,this._destroy),o.controls.target.markAsTouched(),o}static{this.\u0275fac=function(o){return new(o||m)};}static{this.\u0275cmp=en({type:m,selectors:[["t9n-unit"]],decls:11,vars:9,consts:()=>{let e;e=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`;let o;o=$localize`:␟0402e27466ecbf3a502912d95a52f797ef54e34a␟7154699141836462400:Copy source to target`;let n;n=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let l;l=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let g;g=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let E;E=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let C;C=$localize`:␟53647666ac3abdac9ad0cbc0564cc8a2ead09c04␟2937311350146031865:Initial`;let S;S=$localize`:␟2d5820ffb1bf91459a6048abaef0dbb811b343cc␟5706198276541510303:Translated`;let I;I=$localize`:␟a4a1911975d1421d0a019e902c93e29f540ada91␟4467880638322247833:Reviewed`;let P;return P=$localize`:␟5233e7292acd46d01dfa207d4921e4a723110ed2␟4609200447119745819:Final`,[e,n,l,g,E,C,S,I,P,[3,"formGroup"],["mat-raised-button","","color","primary","routerLink","../..",3,"queryParams"],["matInput","","formControlName","description"],["matInput","","formControlName","meaning"],["matInput","","formControlName","source","cdkTextareaAutosize",""],["type","button","mat-icon-button","","matSuffix","","matTooltip",o,3,"click"],["matInput","","formControlName","target","cdkTextareaAutosize",""],["formControlName","state"],["value","initial"],["value","translated"],["value","reviewed"],["value","final"]]},template:function(o,n){if(o&1&&(Ls(0,"h2"),EC(1),xC(2,"async"),Jl(),pb(3,Ne,32,1,"form",9),xC(4,"async"),Ls(5,"a",10),xC(6,"async"),Ls(7,"mat-icon"),EC(8,"keyboard_backspace"),Jl(),td(9),Wb(10,0),nd(),Jl()),o&2){let l;bg(),fy(OC(2,3,n.unit)?.id),bg(2),gb((l=OC(4,5,n.form))?3:-1,l),bg(2),Pm("queryParams",OC(6,7,n.params));}},dependencies:[En,An,Le,Cn,Vn,Kt,Xt,Jt,Be,V,xt,Ve,Be$1,ve,X,hn,un,Ie,Yt,mt,yt,wt,Ft,Rt,J,It,Mt,xT],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem 1.5rem}form[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{flex:1 1 100%}@media(min-width:960px){form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{margin-right:1rem;flex:0 0 calc(50% - 1rem)}}a[_ngcontent-%COMP%]{display:inline-flex;align-items:center}"]});}}return m})();export{je as UnitComponent};