UNPKG

angular-t9n

Version:

A translation tool for Angular i18n

2 lines (1 loc) 5.07 kB
import"./chunk-NJIOGT5G.js";import"./chunk-A5TA67TA.js";import{a as ce,b as fe}from"./chunk-QA3CUK4L.js";import{d as ne,g as _e}from"./chunk-DOXYGUBM.js";import{a as j,b as q}from"./chunk-GKXKJW7N.js";import{a as me,b as de,c as se,d as Te}from"./chunk-PPUOYFLG.js";import"./chunk-3RK6DDJD.js";import{a as oe,d as ae,g as re,j as le}from"./chunk-WVL5UBM6.js";import{a as H,b as J}from"./chunk-YO72B5SH.js";import{a as B,b as D,c as V}from"./chunk-MFCYHQDO.js";import{a as pe}from"./chunk-MPLUJE7X.js";import"./chunk-WUN63NIA.js";import{d as z,g as w}from"./chunk-6DDCRX73.js";import{b as K,e as Q,f as W,j as Y,m as Z,n as ee,q as te,r as ie}from"./chunk-TOPF3UHX.js";import"./chunk-FK6IRHWX.js";import"./chunk-4NKRI2IB.js";import"./chunk-NRGBO6B5.js";import"./chunk-XUIN44YA.js";import{Ab as M,Bb as E,Db as L,Hb as o,Ib as X,Ic as k,Kc as F,Q as G,Ta as d,U,Xb as T,Yb as x,cb as h,da as c,dc as p,ec as u,g as $,hb as v,ia as b,ja as y,q as N,wb as f,xb as n,yb as t,zb as s}from"./chunk-IRWV2DJQ.js";import{c as O}from"./chunk-4CLCTAJ7.js";function ue(m,r){if(m&1){let g=L();M(0),n(1,"form",11)(2,"mat-form-field")(3,"mat-label"),o(4,1),t(),s(5,"input",12),t(),n(6,"mat-form-field")(7,"mat-label"),o(8,2),t(),s(9,"input",13),t(),n(10,"mat-form-field")(11,"mat-label"),o(12,3),t(),s(13,"textarea",14),n(14,"button",15),X("click",function(){let i=b(g).ngIf;return y(i.get("target").setValue(i.get("source").value))}),n(15,"mat-icon"),T(16,"file_copy"),t()()(),n(17,"mat-form-field")(18,"mat-label"),o(19,4),t(),s(20,"textarea",16),t(),n(21,"mat-form-field")(22,"mat-label"),T(23,"State"),t(),n(24,"mat-select",17)(25,"mat-option",18),o(26,5),t(),n(27,"mat-option",19),o(28,6),t(),n(29,"mat-option",20),o(30,7),t(),n(31,"mat-option",21),o(32,8),t()()()(),E()}if(m&2){let g=r.ngIf;d(),f("formGroup",g)}}var Ve=(()=>{let r=class r{constructor(){this._translationTargetService=c(pe),this._route=c(z),this._formBuilder=c(te),this._destroy=new $,this.params=this._route.params.pipe(N(l=>{var _=l,{unitId:e}=_,i=O(_,["unitId"]);return i})),this.unit=this._route.paramMap.pipe(U(e=>this._translationTargetService.unit(e.get("unitId"))),G()),this.form=this.unit.pipe(N(e=>this._createForm(e)))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}_createForm(e){let i=this._formBuilder.group({description:[{value:e.description||"-",disabled:!0}],meaning:[{value:e.meaning||"-",disabled:!0}],source:[{value:e.source,disabled:!0}],target:e.target,state:e.state});return this._translationTargetService.updateUnitOnChange(e,i.controls,this._destroy),i.controls.target.markAsTouched(),i}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=h({type:r,selectors:[["t9n-unit"]],decls:11,vars:9,consts:()=>{let e;e=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`;let i;i=$localize`:␟0402e27466ecbf3a502912d95a52f797ef54e34a␟7154699141836462400:Copy source to target`;let l;l=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let _;_=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let S;S=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let C;C=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let I;I=$localize`:␟53647666ac3abdac9ad0cbc0564cc8a2ead09c04␟2937311350146031865:Initial`;let P;P=$localize`:␟2d5820ffb1bf91459a6048abaef0dbb811b343cc␟5706198276541510303:Translated`;let A;A=$localize`:␟a4a1911975d1421d0a019e902c93e29f540ada91␟4467880638322247833:Reviewed`;let R;return R=$localize`:␟5233e7292acd46d01dfa207d4921e4a723110ed2␟4609200447119745819:Final`,[e,l,_,S,C,I,P,A,R,[4,"ngIf"],["mat-raised-button","","color","primary","routerLink","../..",3,"queryParams"],[3,"formGroup"],["matInput","","formControlName","description"],["matInput","","formControlName","meaning"],["matInput","","formControlName","source","cdkTextareaAutosize",""],["type","button","mat-icon-button","","matSuffix","","matTooltip",i,3,"click"],["matInput","","formControlName","target","cdkTextareaAutosize",""],["formControlName","state"],["value","initial"],["value","translated"],["value","reviewed"],["value","final"]]},template:function(i,l){if(i&1&&(n(0,"h2"),T(1),p(2,"async"),t(),v(3,ue,33,1,"ng-container",9),p(4,"async"),n(5,"a",10),p(6,"async"),n(7,"mat-icon"),T(8,"keyboard_backspace"),t(),M(9),o(10,0),E(),t()),i&2){let _;d(),x((_=u(2,3,l.unit))==null?null:_.id),d(2),f("ngIf",u(4,5,l.form)),d(2),f("queryParams",u(6,7,l.params))}},dependencies:[k,ie,Y,K,Q,W,Z,ee,le,re,oe,ae,Te,se,me,de,V,D,B,J,H,q,j,fe,ce,ne,_e,w,F],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});let m=r;return m})();export{Ve as UnitComponent};