otus-localization
Version:
A translation tool for Angular i18n(angular-t9n)
1 lines • 5.3 kB
JavaScript
;(self.webpackChunkotus_translation=self.webpackChunkotus_translation||[]).push([[39],{7125:(p,S,e)=>{e.d(S,{C:()=>g});var N=e(9862);function g(t){let a=new N.LE;return t.page&&(a=a.set("page",t.page.toString())),t.entriesPerPage&&(a=a.set("entriesPerPage",t.entriesPerPage.toString())),t.sort&&t.sort.active&&t.sort.direction&&(a=a.set("sort",`${"desc"===t.sort.direction?"!":""}${t.sort.active}`)),t.filter&&(a=Object.keys(t.filter).filter(s=>t.filter[s]).reduce((s,l)=>s.set(l,t.filter[l]),a)),a}},7559:(p,S,e)=>{e.r(S),e.d(S,{UnitComponent:()=>Z});var N=e(6263),g=e(6814),t=e(6223),a=e(2296),s=e(3680),l=e(5683),C=e(617),R=e(4516),A=e(8525),d=e(2596),U=e(1896),D=e(8645),P=e(7398),G=e(4664),L=e(3020),$=e(2511),_=e(5879);function v(E,I){1&E&&(_.TgZ(0,"mat-option",21),_.SDv(1,22),_.qZA())}function K(E,I){if(1&E){const n=_.EpF();_.ynx(0),_.TgZ(1,"form",3)(2,"mat-form-field")(3,"mat-label"),_.SDv(4,4),_.qZA(),_._UZ(5,"input",5),_.qZA(),_.TgZ(6,"mat-form-field")(7,"mat-label"),_.SDv(8,6),_.qZA(),_._UZ(9,"input",7),_.qZA(),_.TgZ(10,"mat-form-field")(11,"mat-label"),_.SDv(12,8),_.qZA(),_._UZ(13,"textarea",9),_.TgZ(14,"button",10),_.NdJ("click",function(){const T=_.CHM(n).ngIf;return _.KtG(T.get("target").setValue(T.get("source").value))}),_.TgZ(15,"mat-icon"),_._uU(16,"file_copy"),_.qZA()()(),_.TgZ(17,"mat-form-field")(18,"mat-label"),_.SDv(19,11),_.qZA(),_._UZ(20,"textarea",12),_.qZA(),_.TgZ(21,"mat-form-field")(22,"mat-label"),_._uU(23,"State"),_.qZA(),_.TgZ(24,"mat-select",13),_.YNc(25,v,2,0,"mat-option",14),_.TgZ(26,"mat-option",15),_.SDv(27,16),_.qZA(),_.TgZ(28,"mat-option",17),_.SDv(29,18),_.qZA(),_.TgZ(30,"mat-option",19),_.SDv(31,20),_.qZA()()()(),_.BQk()}if(2&E){const n=I.ngIf;_.xp6(1),_.Q6J("formGroup",n),_.xp6(24),_.Q6J("ngIf","initial"===n.get("state").value)}}let Z=(()=>{class E{constructor(n,o,i){this._translationTargetService=n,this._route=o,this._formBuilder=i,this._destroy=new D.x,this.params=this._route.params.pipe((0,P.U)(({unitId:T,...O})=>O)),this.unit=this._route.paramMap.pipe((0,G.w)(T=>this._translationTargetService.unit(T.get("unitId"))),(0,L.B)()),this.form=this.unit.pipe((0,P.U)(T=>this._createForm(T)))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}_createForm(n){const o=this._formBuilder.group({description:[{value:n.description||"-",disabled:!0}],meaning:[{value:n.meaning||"-",disabled:!0}],source:[{value:n.source,disabled:!0}],target:n.target,state:[{value:n.state,disabled:!n.target}]});return this._translationTargetService.updateUnitOnChange(n,o.controls,this._destroy),o.controls.target.markAsTouched(),o}static{this.\u0275fac=function(o){return new(o||E)(_.Y36($.V),_.Y36(U.gz),_.Y36(t.QS))}}static{this.\u0275cmp=_.Xpm({type:E,selectors:[["t9n-unit"]],standalone:!0,features:[_.jDz],decls:11,vars:9,consts:function(){let n,o,i,T,O,c,f,M,m,u;return n=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`,o=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`,i=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`,T=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`,O=$localize`:␟0402e27466ecbf3a502912d95a52f797ef54e34a␟7154699141836462400:Copy source to target`,c=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`,f=$localize`:␟2d5820ffb1bf91459a6048abaef0dbb811b343cc␟5706198276541510303:Translated`,M=$localize`:␟a4a1911975d1421d0a019e902c93e29f540ada91␟4467880638322247833:Reviewed`,m=$localize`:␟5233e7292acd46d01dfa207d4921e4a723110ed2␟4609200447119745819:Final`,u=$localize`:␟53647666ac3abdac9ad0cbc0564cc8a2ead09c04␟2937311350146031865:Initial`,[[4,"ngIf"],["mat-raised-button","","color","primary","routerLink","../..",3,"queryParams"],n,[3,"formGroup"],o,["matInput","","formControlName","description"],i,["matInput","","formControlName","meaning"],T,["matInput","","formControlName","source","cdkTextareaAutosize",""],["type","button","mat-icon-button","","matSuffix","","matTooltip",O,3,"click"],c,["matInput","","formControlName","target","cdkTextareaAutosize",""],["formControlName","state"],["value","initial",4,"ngIf"],["value","translated"],f,["value","reviewed"],M,["value","final"],m,["value","initial"],u]},template:function(o,i){if(1&o&&(_.TgZ(0,"h2"),_._uU(1),_.ALo(2,"async"),_.qZA(),_.YNc(3,K,32,2,"ng-container",0),_.ALo(4,"async"),_.TgZ(5,"a",1),_.ALo(6,"async"),_.TgZ(7,"mat-icon"),_._uU(8,"keyboard_backspace"),_.qZA(),_.ynx(9),_.SDv(10,2),_.BQk(),_.qZA()),2&o){let T;_.xp6(1),_.Oqu(null==(T=_.lcZ(2,3,i.unit))?null:T.id),_.xp6(2),_.Q6J("ngIf",_.lcZ(4,5,i.form)),_.xp6(2),_.Q6J("queryParams",_.lcZ(6,7,i.params))}},dependencies:[g.O5,t.UX,t._Y,t.Fj,t.JJ,t.JL,t.sg,t.u,l.lN,l.KE,l.hX,l.R9,R.c,R.Nt,N.IC,N.Ky,a.ot,a.zs,a.RK,d.AV,d.gM,C.Ps,C.Hw,A.LD,A.gD,s.ey,s.Ng,U.rH,g.Ov],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}"],changeDetection:0})}}return E})()}}]);