UNPKG

angular-t9n

Version:
3 lines (2 loc) 7.53 kB
import{a as ne}from"./chunk-B75QZTIT.js";import{a as Pe}from"./chunk-CEPTD2R3.js";import{a as ee,b as te}from"./chunk-TCB7CPXY.js";import{a as _e,b as ae,c as re,d as le,e as de,f as ce,g as Se,h as me,i as Oe,j as pe,k as Re,l as se,m as Ce,n as Ee}from"./chunk-34LVLGVL.js";import{a as ie,b as oe}from"./chunk-27GPMXRH.js";import{a as W,b as Y,c as Z}from"./chunk-MFJLYQLJ.js";import{c as J,e as K,f as Q}from"./chunk-PTK3D5EO.js";import"./chunk-QTUSJNUZ.js";import"./chunk-DK3NDEDW.js";import"./chunk-MLPE3OCH.js";import"./chunk-RVNPJH6Y.js";import{$ as E,Bb as p,Cb as R,Cc as q,Eb as F,Ib as d,Jb as M,Kb as V,L,P as A,Qa as _,S as G,Yb as l,Zb as m,_b as h,bb as z,bc as g,e as w,ea as X,ec as P,fa as k,fc as u,gb as O,o as f,pb as B,qb as j,ub as s,vb as n,wb as i,xb as N}from"./chunk-KWXDDR2S.js";import{c as x}from"./chunk-4CLCTAJ7.js";var ue=()=>["distance","id","description","meaning","source","action"];function Ne(e,o){if(e&1&&(n(0,"dl")(1,"dt"),d(2,2),i(),n(3,"dd"),l(4),i(),n(5,"dt"),d(6,3),i(),n(7,"dd"),l(8),i(),n(9,"dt"),d(10,4),i(),n(11,"dd",30),l(12),i(),n(13,"dt"),d(14,5),i(),n(15,"dd",31),l(16),i()()),e&2){let t=o;_(4),m(t.description||"-"),_(4),m(t.meaning||"-"),_(4),m(t.source),_(4),m(t._embedded.locales.join(", "))}}function fe(e,o){e&1&&(n(0,"th",32),d(1,6),i())}function Ae(e,o){if(e&1&&(n(0,"td",33),l(1),i()),e&2){let t=o.$implicit;_(),h(" ",t.distance," ")}}function Me(e,o){e&1&&(n(0,"th",34),d(1,7),i())}function he(e,o){if(e&1&&(n(0,"td",35),l(1),i()),e&2){let t=o.$implicit;s("matTooltip",t.locations==null?null:t.locations.join(` `))("matTooltipDisabled",!(t.locations!=null&&t.locations.length)),_(),h(" ",t.id," ")}}function ge(e,o){e&1&&(n(0,"th",34),d(1,8),i())}function Te(e,o){if(e&1&&(n(0,"td",36),l(1),i()),e&2){let t=o.$implicit;_(),m(t.description)}}function He(e,o){e&1&&(n(0,"th",34),d(1,9),i())}function Ue(e,o){if(e&1&&(n(0,"td",36),l(1),i()),e&2){let t=o.$implicit;_(),m(t.meaning)}}function $e(e,o){e&1&&(n(0,"th",34),d(1,10),i())}function be(e,o){if(e&1&&(n(0,"td",36),l(1),i()),e&2){let t=o.$implicit;_(),m(t.source)}}function De(e,o){e&1&&N(0,"th",37)}function Ie(e,o){if(e&1){let t=F();n(0,"td",36)(1,"button",38),M("click",function(){let c=X(t).$implicit,S=V();return k(S.migrate(c))}),n(2,"mat-icon"),l(3,"input"),i()()()}}function ye(e,o){e&1&&N(0,"tr",39)}function ve(e,o){e&1&&N(0,"tr",40)}var nt=(()=>{class e{constructor(){this._sourceOrphanService=E(Pe),this._route=E(J),this._router=E(K),this._snackbar=E(ne),this._destroy=new w,this.params=this._route.params.pipe(f(c=>{var S=c,{orphanId:t}=S,a=x(S,["orphanId"]);return a})),this.orphan=this._route.paramMap.pipe(A(t=>this._sourceOrphanService.orphan(t.get("orphanId"))),G(t=>this._orphan=t),L()),this.similar=this.orphan.pipe(f(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(A(()=>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=z({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 C;C=$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 D;D=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let I;I=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let y;y=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let v;return v=$localize`:␟ed06ba25f8b8effadedaa466355f5b85b0041712␟7936624992717622100:Migrate translation and state to this unit and remove this orphan.`,[c,S,C,T,H,U,$,b,D,I,y,[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&&(n(0,"h2"),l(1),P(2,"async"),i(),B(3,Ne,17,4,"dl"),P(4,"async"),n(5,"div",11)(6,"table",12),P(7,"async"),p(8,13),O(9,fe,2,0,"th",14)(10,Ae,2,1,"td",15),R(),p(11,16),O(12,Me,2,0,"th",17)(13,he,2,3,"td",18),R(),p(14,19),O(15,ge,2,0,"th",17)(16,Te,2,1,"td",20),R(),p(17,21),O(18,He,2,0,"th",17)(19,Ue,2,1,"td",20),R(),p(20,22),O(21,$e,2,0,"th",17)(22,be,2,1,"td",20),R(),p(23,23),O(24,De,1,0,"th",24)(25,Ie,4,0,"td",20),R(),O(26,ye,1,0,"tr",25)(27,ve,1,0,"tr",26),i()(),n(28,"div",27)(29,"a",28),P(30,"async"),n(31,"mat-icon"),l(32,"keyboard_backspace"),i(),p(33),d(34,0),R(),i(),n(35,"button",29),M("click",function(){return c.delete()}),d(36,1),i()()),a&2){let S,C;_(),m((S=u(2,7,c.orphan))==null?null:S.id),_(2),j((C=u(4,9,c.orphan))?3:-1,C),_(3),s("dataSource",u(7,11,c.similar)),_(20),s("matHeaderRowDef",g(15,ue))("matHeaderRowDefSticky",!0),_(),s("matRowDefColumns",g(16,ue)),_(2),s("queryParams",u(30,13,c.params))}},dependencies:[Ee,le,ce,pe,Se,de,Re,me,Oe,se,Ce,re,_e,ae,oe,ie,Z,Y,W,te,ee,Q,q],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}"],changeDetection:0})}}return e})();export{nt as SourceOrphanComponent};