UNPKG

angular-t9n

Version:
2 lines 7.46 kB
import {g,aS as W,aT as ue$1,aU as Mt,F,K,aV as t,B as Ba,aW as Va,aX as ja,e as en,Y as Yt,m as mt,h as hn,u as un,aL as Ie$1,aM as yt,aN as wt,M as Mt$1,x as xT,L as Ls,E as EC,b as xC,J as Jl,t as pb,aO as td,ad as xm,aP as nd,W as Wb,c as Ym,d as bg,f as fy,O as OC,C as gb,P as Pm,aK as SC,aQ as id,o as Lm,aY as bb,aZ as Ih,aE as Zb,a_ as wh}from'./main-XWPOM5LO.js';import {S}from'./chunk-XuDY5ztv.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'./chunk-C1Idjiqb.js';import'./chunk-C2N3F-hv.js';import'./chunk-DvU4UsWB.js';var Ne=()=>["distance","id","description","meaning","source","action"];function fe(e,o){if(e&1&&(Ls(0,"dl")(1,"dt"),Wb(2,2),Jl(),Ls(3,"dd"),EC(4),Jl(),Ls(5,"dt"),Wb(6,3),Jl(),Ls(7,"dd"),EC(8),Jl(),Ls(9,"dt"),Wb(10,4),Jl(),Ls(11,"dd",30),EC(12),Jl(),Ls(13,"dt"),Wb(14,5),Jl(),Ls(15,"dd",31),EC(16),Jl()()),e&2){let t=o;bg(4),fy(t.description||"-"),bg(4),fy(t.meaning||"-"),bg(4),fy(t.source),bg(4),fy(t._embedded.locales.join(", "));}}function ue(e,o){e&1&&(Ls(0,"th",32),Wb(1,6),Jl());}function Ae(e,o){if(e&1&&(Ls(0,"td",33),EC(1),Jl()),e&2){let t=o.$implicit;bg(),id(" ",t.distance," ");}}function Me(e,o){e&1&&(Ls(0,"th",34),Wb(1,7),Jl());}function he(e,o){if(e&1&&(Ls(0,"td",35),EC(1),Jl()),e&2){let t=o.$implicit;Pm("matTooltip",t.locations==null?null:t.locations.join(` `))("matTooltipDisabled",!t.locations?.length),bg(),id(" ",t.id," ");}}function ge(e,o){e&1&&(Ls(0,"th",34),Wb(1,8),Jl());}function Te(e,o){if(e&1&&(Ls(0,"td",36),EC(1),Jl()),e&2){let t=o.$implicit;bg(),fy(t.description);}}function He(e,o){e&1&&(Ls(0,"th",34),Wb(1,9),Jl());}function Ue(e,o){if(e&1&&(Ls(0,"td",36),EC(1),Jl()),e&2){let t=o.$implicit;bg(),fy(t.meaning);}}function $e(e,o){e&1&&(Ls(0,"th",34),Wb(1,10),Jl());}function be(e,o){if(e&1&&(Ls(0,"td",36),EC(1),Jl()),e&2){let t=o.$implicit;bg(),fy(t.source);}}function Ie(e,o){e&1&&Lm(0,"th",37);}function ye(e,o){if(e&1){let t=bb();Ls(0,"td",36)(1,"button",38),Ym("click",function(){let c=Ih(t).$implicit,S=Zb();return wh(S.migrate(c))}),Ls(2,"mat-icon"),EC(3,"input"),Jl()()();}}function De(e,o){e&1&&Lm(0,"tr",39);}function ve(e,o){e&1&&Lm(0,"tr",40);}var nt=(()=>{class e{constructor(){this._sourceOrphanService=g(S),this._route=g(W),this._router=g(ue$1),this._snackbar=g(Mt),this._destroy=new F,this.params=this._route.params.pipe(K(c=>{var S=c,{orphanId:t$1}=S,a=t(S,["orphanId"]);return a})),this.orphan=this._route.paramMap.pipe(Ba(t=>this._sourceOrphanService.orphan(t.get("orphanId"))),Va(t=>this._orphan=t),ja()),this.similar=this.orphan.pipe(K(t=>t._embedded.similar));}ngOnDestroy(){this._destroy.next(),this._destroy.complete();}migrate(t){this.orphan&&this._orphanAction(this._sourceOrphanService.migrateOrphan(this._orphan,t),`Migrated orphan ${this._orphan.id} to unit ${t.id}`);}delete(){this.orphan&&this._orphanAction(this._sourceOrphanService.deleteOrphan(this._orphan),`Deleted orphan ${this._orphan.id}`);}_orphanAction(t,a){t.pipe(Ba(()=>this._router.navigate([".."],{relativeTo:this._route}))).subscribe(()=>this._snackbar.open(a,void 0,{duration:2500}));}static{this.\u0275fac=function(a){return new(a||e)};}static{this.\u0275cmp=en({type:e,selectors:[["t9n-source-orphan"]],decls:37,vars:17,consts:()=>{let t;t=$localize`:␟a4c8dd97ad35918071742dd1be55f3959bff306a␟6470405644971425740:Distance according to the levenshtein comparison`;let a;a=$localize`:␟a4c8dd97ad35918071742dd1be55f3959bff306a␟6470405644971425740:Distance according to the levenshtein comparison`;let c;c=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`;let S;S=$localize`:␟53150cdcaa3fc290a4f4018e446e44b998f1f155␟5246620794703463867: Delete orphan `;let g;g=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let T;T=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let H;H=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let U;U=$localize`:␟2dafad4f27d4a3856002fe0ecf2e074cd79da428␟3620242059178560709:Occurs in Targets`;let $;$=$localize`:␟33f0509c876e1399d92a9d1882ce38e6f4245ce3␟2590415407309830681: Distance `;let b;b=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let I;I=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let y;y=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let D;D=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let v;return v=$localize`:␟ed06ba25f8b8effadedaa466355f5b85b0041712␟7936624992717622100:Migrate translation and state to this unit and remove this orphan.`,[c,S,g,T,H,U,$,b,I,y,D,[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label","Similar units",3,"dataSource"],["matColumnDef","distance"],["mat-header-cell","","matTooltip",t,4,"matHeaderCellDef"],["mat-cell","","matTooltip",a,4,"matCellDef"],["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","action"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"actions"],["mat-raised-button","","color","primary","routerLink","..",3,"queryParams"],["type","button","mat-raised-button","","color","warn",3,"click"],[1,"source"],[1,"target"],["mat-header-cell","","matTooltip",t],["mat-cell","","matTooltip",a],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["mat-header-cell",""],["type","button","mat-icon-button","","matTooltip",v,3,"click"],["mat-header-row",""],["mat-row",""]]},template:function(a,c){if(a&1&&(Ls(0,"h2"),EC(1),xC(2,"async"),Jl(),pb(3,fe,17,4,"dl"),xC(4,"async"),Ls(5,"div",11)(6,"table",12),xC(7,"async"),td(8,13),xm(9,ue,2,0,"th",14)(10,Ae,2,1,"td",15),nd(),td(11,16),xm(12,Me,2,0,"th",17)(13,he,2,3,"td",18),nd(),td(14,19),xm(15,ge,2,0,"th",17)(16,Te,2,1,"td",20),nd(),td(17,21),xm(18,He,2,0,"th",17)(19,Ue,2,1,"td",20),nd(),td(20,22),xm(21,$e,2,0,"th",17)(22,be,2,1,"td",20),nd(),td(23,23),xm(24,Ie,1,0,"th",24)(25,ye,4,0,"td",20),nd(),xm(26,De,1,0,"tr",25)(27,ve,1,0,"tr",26),Jl()(),Ls(28,"div",27)(29,"a",28),xC(30,"async"),Ls(31,"mat-icon"),EC(32,"keyboard_backspace"),Jl(),td(33),Wb(34,0),nd(),Jl(),Ls(35,"button",29),Ym("click",function(){return c.delete()}),Wb(36,1),Jl()()),a&2){let S;bg(),fy(OC(2,7,c.orphan)?.id),bg(2),gb((S=OC(4,9,c.orphan))?3:-1,S),bg(3),Pm("dataSource",OC(7,11,c.similar)),bg(20),Pm("matHeaderRowDef",SC(15,Ne))("matHeaderRowDefSticky",true),bg(),Pm("matRowDefColumns",SC(16,Ne)),bg(2),Pm("queryParams",OC(30,13,c.params));}},dependencies:[Vi,Ii,Ai,zi,Hi,Ni,Li,Pi,Bi,ji,Ui,wi,bt,gi,Yt,mt,hn,un,Ie$1,yt,wt,Mt$1,xT],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem 1.5rem}.source[_ngcontent-%COMP%], .target[_ngcontent-%COMP%]{white-space:pre-wrap}table[_ngcontent-%COMP%]{margin-bottom:1rem}.actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"]});}}return e})();export{nt as SourceOrphanComponent};