UNPKG

angular-t9n

Version:
2 lines 9.19 kB
import'./chunk-CVZYzvpd.js';import {J as Jt,j as jt,k,u as ut}from'./chunk-DdfFxTDG.js';import {F as Ft,R as Rt}from'./chunk-CyoIu4Ye.js';import {J,I as It}from'./chunk-BVUXkDrv.js';import {g,aa as al,e as en,Y as Yt,m as mt,h as hn,aL as Ie,M as Mt,aM as yt,aN as wt,x as xT,ac as Zl,L as Ls,aO as td,ad as xm,aP as nd,J as Jl,o as Lm,d as bg,P as Pm,aK as SC,F,s,r,W as Wb,E as EC,aQ as id,f as fy,p as sw,z as cw,b as xC,aE as Zb,aR as NC,O as OC}from'./main-XWPOM5LO.js';import {V as Ve$1,B as Be$2,v as ve$1,X}from'./chunk-VgysnmPQ.js';import {J as Jt$1,B as Be$1}from'./chunk-Cfbj5Ou5.js';import {V as Vi,I as Ii,A as Ai,z as zi,H as Hi,N as Ni,L as Li,P as Pi,B as Bi,j as ji,U as Ui,w as wi,b as bt,g as gi}from'./chunk-BC8OLdk0.js';import {I}from'./chunk-C9OKxrz_.js';import'./chunk-Ce3BBnKT.js';import {M as Mn,E as En,L as Le,C as Cn,z as zt,b as bn}from'./chunk-BaYJwvwh.js';import'./chunk-C1Idjiqb.js';import'./chunk-C2N3F-hv.js';import'./chunk-DvU4UsWB.js';var R=class extends ut{constructor(n,t,r,f){super(t,r,f),this._translationTargetService=n,this._destroy=new F;}_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$1=s(r({},t),{target:new bn(t.target),state:new bn(t.state)});return this._translationTargetService.updateUnitOnChange(t,r$1,this._destroy),r$1.target.markAsTouched(),r$1})}disconnect(){this._destroy.next();}};var De=()=>["id","description","meaning","source","target","state","action"],ve=()=>["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&&(Ls(0,"th",36),Wb(1,0),Jl());}function Fe(e,n){if(e&1&&(Ls(0,"td",37),EC(1),Jl()),e&2){let t=n.$implicit;Pm("matTooltip",t.locations==null?null:t.locations.join(` `))("matTooltipDisabled",!t.locations?.length),bg(),id(" ",t.id," ");}}function He(e,n){e&1&&(Ls(0,"th",36),Wb(1,1),Jl());}function ke(e,n){if(e&1&&(Ls(0,"td",38),EC(1),Jl()),e&2){let t=n.$implicit;bg(),fy(t.description);}}function Be(e,n){e&1&&(Ls(0,"th",36),Wb(1,2),Jl());}function je(e,n){if(e&1&&(Ls(0,"td",38),EC(1),Jl()),e&2){let t=n.$implicit;bg(),fy(t.meaning);}}function Ue(e,n){e&1&&(Ls(0,"th",36),Wb(1,3),Jl());}function qe(e,n){if(e&1&&(Ls(0,"td",38),EC(1),Jl()),e&2){let t=n.$implicit;bg(),fy(t.source);}}function Ve(e,n){e&1&&(Ls(0,"th",36),Wb(1,4),Jl());}function Je(e,n){if(e&1&&(Ls(0,"td",38)(1,"mat-form-field"),Lm(2,"textarea",39),sw(),Jl()()),e&2){let t=n.$implicit;bg(2),Pm("formControl",t.target),cw();}}function Ke(e,n){e&1&&(Ls(0,"th",36),Wb(1,5),Jl());}function Qe(e,n){if(e&1&&(Ls(0,"td",38)(1,"mat-form-field")(2,"mat-select",40)(3,"mat-option",41),Wb(4,6),Jl(),Ls(5,"mat-option",42),Wb(6,7),Jl(),Ls(7,"mat-option",43),Wb(8,8),Jl(),Ls(9,"mat-option",44),Wb(10,9),Jl()(),sw(),Jl()()),e&2){let t=n.$implicit;bg(2),Pm("formControl",t.state),cw();}}function We(e,n){e&1&&Lm(0,"th",45);}function Ye(e,n){if(e&1&&(Ls(0,"td",38)(1,"a",46),xC(2,"async"),Ls(3,"mat-icon"),EC(4,"edit"),Jl()()()),e&2){let t=n.$implicit,r=Zb();bg(),Pm("routerLink",NC(3,Xe,t.id,OC(2,1,r.queryParams)));}}function Ze(e,n){if(e&1&&(Ls(0,"th",45)(1,"mat-form-field"),Lm(2,"input",47),sw(),Jl()()),e&2){let t=Zb();bg(2),Pm("formControl",t.filter.get("id")),cw();}}function et(e,n){if(e&1&&(Ls(0,"th",45)(1,"mat-form-field"),Lm(2,"input",47),sw(),Jl()()),e&2){let t=Zb();bg(2),Pm("formControl",t.filter.get("description")),cw();}}function tt(e,n){if(e&1&&(Ls(0,"th",45)(1,"mat-form-field"),Lm(2,"input",47),sw(),Jl()()),e&2){let t=Zb();bg(2),Pm("formControl",t.filter.get("meaning")),cw();}}function nt(e,n){if(e&1&&(Ls(0,"th",45)(1,"mat-form-field"),Lm(2,"input",47),sw(),Jl()()),e&2){let t=Zb();bg(2),Pm("formControl",t.filter.get("source")),cw();}}function it(e,n){if(e&1&&(Ls(0,"th",45)(1,"mat-form-field"),Lm(2,"input",47),sw(),Jl()()),e&2){let t=Zb();bg(2),Pm("formControl",t.filter.get("target")),cw();}}function ot(e,n){if(e&1&&(Ls(0,"th",45)(1,"mat-form-field")(2,"mat-select",40),Lm(3,"mat-option",48),Ls(4,"mat-option",41),Wb(5,10),Jl(),Ls(6,"mat-option",42),Wb(7,11),Jl(),Ls(8,"mat-option",43),Wb(9,12),Jl(),Ls(10,"mat-option",44),Wb(11,13),Jl()(),sw(),Jl()()),e&2){let t=Zb();bg(2),Pm("formControl",t.filter.get("state")),cw();}}function at(e,n){e&1&&Lm(0,"tr",49);}function rt(e,n){e&1&&Lm(0,"tr",49);}function lt(e,n){e&1&&Lm(0,"tr",50);}var qt=(()=>{class e extends Jt{constructor(){super(...arguments),this._translationTargetService=g(I),this.filter=g(Mn).group({id:"",description:"",meaning:"",source:"",target:"",state:""});}ngOnInit(){super.ngOnInit(),this.dataSource=new R(this._translationTargetService,this.paginator,this.sort,this.filter);}static{this.\u0275fac=(()=>{let t;return function(f){return (t||(t=al(e)))(f||e)}})();}static{this.\u0275cmp=en({type:e,selectors:[["t9n-translate"]],features:[Zl],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 M;M=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let P;P=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let L;L=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let $;$=$localize`:␟873b72903b1858a9cd6c8967521030b4d7d1435b␟5911214550882917183:State`;let h;h=$localize`:␟53647666ac3abdac9ad0cbc0564cc8a2ead09c04␟2937311350146031865:Initial`;let O;O=$localize`:␟2d5820ffb1bf91459a6048abaef0dbb811b343cc␟5706198276541510303:Translated`;let G;G=$localize`:␟a4a1911975d1421d0a019e902c93e29f540ada91␟4467880638322247833:Reviewed`;let x;x=$localize`:␟5233e7292acd46d01dfa207d4921e4a723110ed2␟4609200447119745819:Final`;let I;I=$localize`:␟8ffafcd86cec5320fa7c805a4bc0ea5eaba008be␟7825860436592606655:Edit unit`;let b;b=$localize`:␟53647666ac3abdac9ad0cbc0564cc8a2ead09c04␟2937311350146031865:Initial`;let y;y=$localize`:␟2d5820ffb1bf91459a6048abaef0dbb811b343cc␟5706198276541510303:Translated`;let D;D=$localize`:␟a4a1911975d1421d0a019e902c93e29f540ada91␟4467880638322247833:Reviewed`;let v;return v=$localize`:␟5233e7292acd46d01dfa207d4921e4a723110ed2␟4609200447119745819:Final`,[r,f,M,P,L,$,h,O,G,x,b,y,D,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"],["value","translated"],["value","reviewed"],["value","final"],["mat-header-cell",""],["mat-icon-button","","matTooltip",I,3,"routerLink"],["matInput","","placeholder","Filter",3,"formControl"],["value",""],["mat-header-row",""],["mat-row",""]]},template:function(r,f){r&1&&(Ls(0,"div",14)(1,"table",15),td(2,16),xm(3,ze,2,0,"th",17)(4,Fe,2,3,"td",18),nd(),td(5,19),xm(6,He,2,0,"th",17)(7,ke,2,1,"td",20),nd(),td(8,21),xm(9,Be,2,0,"th",17)(10,je,2,1,"td",20),nd(),td(11,22),xm(12,Ue,2,0,"th",17)(13,qe,2,1,"td",20),nd(),td(14,23),xm(15,Ve,2,0,"th",17)(16,Je,3,1,"td",20),nd(),td(17,24),xm(18,Ke,2,0,"th",17)(19,Qe,11,1,"td",20),nd(),td(20,25),xm(21,We,1,0,"th",26)(22,Ye,5,6,"td",20),nd(),td(23,27),xm(24,Ze,3,1,"th",26),nd(),td(25,28),xm(26,et,3,1,"th",26),nd(),td(27,29),xm(28,tt,3,1,"th",26),nd(),td(29,30),xm(30,nt,3,1,"th",26),nd(),td(31,31),xm(32,it,3,1,"th",26),nd(),td(33,32),xm(34,ot,12,1,"th",26),nd(),xm(35,at,1,0,"tr",33)(36,rt,1,0,"tr",33)(37,lt,1,0,"tr",34),Jl(),Lm(38,"mat-paginator",35),Jl()),r&2&&(bg(),Pm("dataSource",f.dataSource),bg(34),Pm("matHeaderRowDef",SC(9,De))("matHeaderRowDefSticky",true),bg(),Pm("matHeaderRowDef",SC(10,ve))("matHeaderRowDefSticky",true),bg(),Pm("matRowDefColumns",SC(11,De)),bg(),Pm("pageSize",f.pageSize)("pageIndex",f.pageIndex)("pageSizeOptions",SC(12,we)));},dependencies:[Vi,Ii,Ai,zi,Hi,Ni,Li,Pi,Bi,ji,Ui,wi,bt,gi,Yt,mt,Jt$1,Be$1,Ve$1,Be$2,ve$1,X,En,Le,Cn,zt,Ft,Rt,J,It,hn,Ie,Mt,yt,wt,jt,k,xT],encapsulation:2});}}return e})();export{qt as TranslateComponent};