UNPKG

angular-t9n

Version:

A translation tool for Angular i18n

3 lines (2 loc) 9.11 kB
import{a as Se,b as Ee,c as xe,d as be}from"./chunk-N7P3G5O7.js";import{a as fe,b as pe}from"./chunk-G5LABWWD.js";import{a as Z,b as ee}from"./chunk-ZOA5KTCR.js";import{a as Te,b as de,c as ce,d as se}from"./chunk-IC7VJKW2.js";import{g as _e,h as me}from"./chunk-CE7MWEFF.js";import{a as Ae,b as Ce,c as ue,d as Re,e as ge,f as Ne,g as Me,h as Pe,i as Le,j as $e,k as he,l as Oe,m as Ge,n as Ie}from"./chunk-5X2CMPER.js";import{a as te,b as ne}from"./chunk-2GFTPPRY.js";import{d as W,e as Y}from"./chunk-3UMPV344.js";import{a as ve}from"./chunk-IQUQLZUX.js";import{d as q,f as V,g as J}from"./chunk-JCOG3QZD.js";import{b as ie,e as oe,i as g,l as ae,q as re,r as le}from"./chunk-IIDNLDIX.js";import"./chunk-SWXDJEZV.js";import"./chunk-IZB6ZOII.js";import"./chunk-OHHIBRCV.js";import{Db as i,Dc as B,Eb as o,Fb as s,Fc as U,Gb as d,Hb as c,Ob as T,Rb as p,Td as K,Wd as Q,Ya as a,Za as E,ac as S,bc as u,cc as F,eb as X,ec as A,g as w,gc as H,hc as k,ic as j,pb as z,sb as _,ub as l}from"./chunk-XN5ZPBP6.js";import{a as y,b as D}from"./chunk-4CLCTAJ7.js";var R=class extends be{constructor(n,t,r,f){super(t,r,f),this._translationTargetService=n,this._destroy=new w}_fetchData(n,t,r){return this._destroy.next(),this._translationTargetService.units({page:n.pageIndex,entriesPerPage:n.pageSize,sort:t,filter:r.value})}_mapPaginationResponse(n){return n._embedded.entries.map(t=>{let r=D(y({},t),{target:new g(t.target),state:new g({value:t.state,disabled:!t.target})});return this._translationTargetService.updateUnitOnChange(t,r,this._destroy),r.target.markAsTouched(),r})}disconnect(){this._destroy.next()}};var ye=()=>["id","description","meaning","source","target","state","action"],De=()=>["id-filter","description-filter","meaning-filter","source-filter","target-filter","state-filter","action"],we=()=>[25,50,100,250],Xe=(e,n)=>["./unit",e,n];function ze(e,n){e&1&&(i(0,"th",36),T(1,0),o())}function Fe(e,n){if(e&1&&(i(0,"td",37),S(1),o()),e&2){let t=n.$implicit;l("matTooltip",t.locations==null?null:t.locations.join(` `))("matTooltipDisabled",!(t.locations!=null&&t.locations.length)),a(),F(" ",t.id," ")}}function He(e,n){e&1&&(i(0,"th",36),T(1,1),o())}function ke(e,n){if(e&1&&(i(0,"td",38),S(1),o()),e&2){let t=n.$implicit;a(),u(t.description)}}function je(e,n){e&1&&(i(0,"th",36),T(1,2),o())}function Be(e,n){if(e&1&&(i(0,"td",38),S(1),o()),e&2){let t=n.$implicit;a(),u(t.meaning)}}function Ue(e,n){e&1&&(i(0,"th",36),T(1,3),o())}function qe(e,n){if(e&1&&(i(0,"td",38),S(1),o()),e&2){let t=n.$implicit;a(),u(t.source)}}function Ve(e,n){e&1&&(i(0,"th",36),T(1,4),o())}function Je(e,n){if(e&1&&(i(0,"td",38)(1,"mat-form-field"),s(2,"textarea",39),o()()),e&2){let t=n.$implicit;a(2),l("formControl",t.target)}}function Ke(e,n){e&1&&(i(0,"th",36),T(1,5),o())}function Qe(e,n){e&1&&(i(0,"mat-option",45),T(1,9),o())}function We(e,n){if(e&1&&(i(0,"td",38)(1,"mat-form-field")(2,"mat-select",40),_(3,Qe,2,0,"mat-option",41),i(4,"mat-option",42),T(5,6),o(),i(6,"mat-option",43),T(7,7),o(),i(8,"mat-option",44),T(9,8),o()()()()),e&2){let t=n.$implicit;a(2),l("formControl",t.state),a(),l("ngIf",t.state.value==="initial")}}function Ye(e,n){e&1&&s(0,"th",46)}function Ze(e,n){if(e&1&&(i(0,"td",38)(1,"a",47),k(2,"async"),i(3,"mat-icon"),S(4,"edit"),o()()()),e&2){let t=n.$implicit,r=p();a(),l("routerLink",H(3,Xe,t.id,j(2,1,r.queryParams)))}}function et(e,n){if(e&1&&(i(0,"th",46)(1,"mat-form-field"),s(2,"input",48),o()()),e&2){let t=p();a(2),l("formControl",t.filter.get("id"))}}function tt(e,n){if(e&1&&(i(0,"th",46)(1,"mat-form-field"),s(2,"input",48),o()()),e&2){let t=p();a(2),l("formControl",t.filter.get("description"))}}function nt(e,n){if(e&1&&(i(0,"th",46)(1,"mat-form-field"),s(2,"input",48),o()()),e&2){let t=p();a(2),l("formControl",t.filter.get("meaning"))}}function it(e,n){if(e&1&&(i(0,"th",46)(1,"mat-form-field"),s(2,"input",48),o()()),e&2){let t=p();a(2),l("formControl",t.filter.get("source"))}}function ot(e,n){if(e&1&&(i(0,"th",46)(1,"mat-form-field"),s(2,"input",48),o()()),e&2){let t=p();a(2),l("formControl",t.filter.get("target"))}}function at(e,n){if(e&1&&(i(0,"th",46)(1,"mat-form-field")(2,"mat-select",40),s(3,"mat-option",49),i(4,"mat-option",45),T(5,10),o(),i(6,"mat-option",42),T(7,11),o(),i(8,"mat-option",43),T(9,12),o(),i(10,"mat-option",44),T(11,13),o()()()()),e&2){let t=p();a(2),l("formControl",t.filter.get("state"))}}function rt(e,n){e&1&&s(0,"tr",50)}function lt(e,n){e&1&&s(0,"tr",50)}function _t(e,n){e&1&&s(0,"tr",51)}var Qt=(()=>{class e extends xe{constructor(t,r,f,C){super(r,f,C.group({id:"",description:"",meaning:"",source:"",target:"",state:""})),this._translationTargetService=t}ngOnInit(){super.ngOnInit(),this.dataSource=new R(this._translationTargetService,this.paginator,this.sort,this.filter)}static{this.\u0275fac=function(r){return new(r||e)(E(ve),E(q),E(V),E(re))}}static{this.\u0275cmp=X({type:e,selectors:[["t9n-translate"]],features:[z],decls:39,vars:13,consts:()=>{let t;t=$localize`:␟5fe967bfa986c1e4978f115840ee7d868c985401␟3504796391691650968:Translation units`;let r;r=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let f;f=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let C;C=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let N;N=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let M;M=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let P;P=$localize`:␟873b72903b1858a9cd6c8967521030b4d7d1435b␟5911214550882917183:State`;let L;L=$localize`:␟2d5820ffb1bf91459a6048abaef0dbb811b343cc␟5706198276541510303:Translated`;let $;$=$localize`:␟a4a1911975d1421d0a019e902c93e29f540ada91␟4467880638322247833:Reviewed`;let h;h=$localize`:␟5233e7292acd46d01dfa207d4921e4a723110ed2␟4609200447119745819:Final`;let O;O=$localize`:␟53647666ac3abdac9ad0cbc0564cc8a2ead09c04␟2937311350146031865:Initial`;let G;G=$localize`:␟8ffafcd86cec5320fa7c805a4bc0ea5eaba008be␟7825860436592606655:Edit unit`;let I;I=$localize`:␟53647666ac3abdac9ad0cbc0564cc8a2ead09c04␟2937311350146031865:Initial`;let x;x=$localize`:␟2d5820ffb1bf91459a6048abaef0dbb811b343cc␟5706198276541510303:Translated`;let b;b=$localize`:␟a4a1911975d1421d0a019e902c93e29f540ada91␟4467880638322247833:Reviewed`;let v;return v=$localize`:␟5233e7292acd46d01dfa207d4921e4a723110ed2␟4609200447119745819:Final`,[r,f,C,N,M,P,L,$,h,O,I,x,b,v,[1,"mat-elevation-z8"],["mat-table","","matSort","","aria-label",t,3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled",4,"matCellDef"],["matColumnDef","description"],["mat-cell","",4,"matCellDef"],["matColumnDef","meaning"],["matColumnDef","source"],["matColumnDef","target"],["matColumnDef","state"],["matColumnDef","action"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","id-filter"],["matColumnDef","description-filter"],["matColumnDef","meaning-filter"],["matColumnDef","source-filter"],["matColumnDef","target-filter"],["matColumnDef","state-filter"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[3,"pageSize","pageIndex","pageSizeOptions"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["matInput","","cdkTextareaAutosize","","placeholder","Translation",3,"formControl"],[3,"formControl"],["value","initial",4,"ngIf"],["value","translated"],["value","reviewed"],["value","final"],["value","initial"],["mat-header-cell",""],["mat-icon-button","","matTooltip",G,3,"routerLink"],["matInput","","placeholder","Filter",3,"formControl"],["value",""],["mat-header-row",""],["mat-row",""]]},template:function(r,f){r&1&&(i(0,"div",14)(1,"table",15),d(2,16),_(3,ze,2,0,"th",17)(4,Fe,2,3,"td",18),c(),d(5,19),_(6,He,2,0,"th",17)(7,ke,2,1,"td",20),c(),d(8,21),_(9,je,2,0,"th",17)(10,Be,2,1,"td",20),c(),d(11,22),_(12,Ue,2,0,"th",17)(13,qe,2,1,"td",20),c(),d(14,23),_(15,Ve,2,0,"th",17)(16,Je,3,1,"td",20),c(),d(17,24),_(18,Ke,2,0,"th",17)(19,We,10,2,"td",20),c(),d(20,25),_(21,Ye,1,0,"th",26)(22,Ze,5,6,"td",20),c(),d(23,27),_(24,et,3,1,"th",26),c(),d(25,28),_(26,tt,3,1,"th",26),c(),d(27,29),_(28,nt,3,1,"th",26),c(),d(29,30),_(30,it,3,1,"th",26),c(),d(31,31),_(32,ot,3,1,"th",26),c(),d(33,32),_(34,at,12,1,"th",26),c(),_(35,rt,1,0,"tr",33)(36,lt,1,0,"tr",33)(37,_t,1,0,"tr",34),o(),s(38,"mat-paginator",35),o()),r&2&&(a(),l("dataSource",f.dataSource),a(34),l("matHeaderRowDef",A(9,ye))("matHeaderRowDefSticky",!0),a(),l("matHeaderRowDef",A(10,De))("matHeaderRowDefSticky",!0),a(),l("matRowDefColumns",A(11,ye)),a(),l("pageSize",f.pageSize)("pageIndex",f.pageIndex)("pageSizeOptions",A(12,we)))},dependencies:[Ie,Re,Ne,$e,Me,ge,he,Pe,Le,Oe,Ge,ue,Ae,Ce,ne,te,me,_e,se,ce,Te,de,le,ie,oe,ae,pe,fe,K,B,Q,Y,W,J,ee,Z,Ee,Se,U],encapsulation:2,changeDetection:0})}}return e})();export{Qt as TranslateComponent};