angular-docs-cn/aio/dist/contributor-contributor-lis...

2 lines
5.3 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{fPy6:function(t,n,e){"use strict";e.r(n),e.d(n,"ContributorListModule",function(){return I});var o=e("ofXK"),c=e("NFeN"),r=e("fXoL"),i=e("lJxs"),s=e("qZ0a"),u=e("jn67"),a=e("tk/3");const b=u.a+"contributors.json",p=["Angular","Collaborators","GDE"];let l=(()=>{class t{constructor(t){this.http=t,this.contributors=this.getContributors()}getContributors(){const t=this.http.get(b).pipe(Object(i.a)(t=>{const n={};return Object.keys(t).forEach(e=>{const o=t[e];o.groups.forEach(t=>{(n[t]||(n[t]=[])).push(o)})}),n}),Object(i.a)(t=>Object.keys(t).map(n=>{const e=p.indexOf(n);return{name:n,order:-1===e?p.length:e,contributors:t[n].sort(f)}}).sort(d)),Object(s.a)());return t.connect(),t}}return t.\u0275fac=function(n){return new(n||t)(r.Xb(a.a))},t.\u0275prov=r.Kb({token:t,factory:t.\u0275fac}),t})();function f(t,n){return t.name.toUpperCase()>n.name.toUpperCase()?1:-1}function d(t,n){return t.order===n.order?t.name>n.name?1:-1:t.order>n.order?1:-1}var g=e("/lUL");function m(t,n){1&t&&(r.Tb(0,"a",7),r.Ac(1," View Bio "),r.Sb())}function k(t,n){if(1&t&&(r.Tb(0,"a",8),r.ac("click",function(t){return t.stopPropagation()}),r.Pb(1,"mat-icon",9),r.Sb()),2&t){const t=r.ec();r.lc("href","https://twitter.com/",t.person.twitter,"",r.uc)}}function h(t,n){if(1&t&&(r.Tb(0,"a",8),r.ac("click",function(t){return t.stopPropagation()}),r.Tb(1,"mat-icon",10),r.Ac(2,"link"),r.Sb(),r.Sb()),2&t){const t=r.ec();r.kc("href",t.person.website,r.uc)}}function C(t,n){if(1&t){const t=r.Ub();r.Tb(0,"div",11),r.ac("click",function(){r.sc(t);const n=r.ec();return n.flipCard(n.person)})("keyup.enter",function(){r.sc(t);const n=r.ec();return n.flipCard(n.person)}),r.Tb(1,"h3"),r.Ac(2),r.Sb(),r.Tb(3,"p",12),r.Ac(4),r.Sb(),r.Sb()}if(2&t){const t=r.ec();r.Cb(2),r.Bc(t.person.name),r.Cb(2),r.Bc(t.person.bio)}}const v=function(t){return{flipped:t}};let S=(()=>{class t{constructor(){this.noPicture="_no-one.png",this.pictureBase=u.a+"images/bios/"}flipCard(t){t.isFlipped=!t.isFlipped}}return t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=r.Ib({type:t,selectors:[["aio-contributor"]],inputs:{person:"person"},decls:10,vars:10,consts:[[1,"contributor-card",3,"ngClass"],[1,"card-front",3,"click","keyup.enter"],[1,"contributor-image"],[1,"contributor-info"],["mat-button","","class","info-item",4,"ngIf"],["mat-icon-button","","class","info-item icon","target","_blank",3,"href","click",4,"ngIf"],["class","card-back",3,"click","keyup.enter",4,"ngIf"],["mat-button","",1,"info-item"],["mat-icon-button","","target","_blank",1,"info-item","icon",3,"href","click"],["svgIcon","logos:twitter"],[1,"link-icon"],[1,"card-back",3,"click","keyup.enter"],[1,"contributor-bio"]],template:function(t,n){1&t&&(r.Tb(0,"div",0),r.Tb(1,"div",1),r.ac("click",function(){return n.flipCard(n.person)})("keyup.enter",function(){return n.flipCard(n.person)}),r.Tb(2,"h3"),r.Ac(3),r.Sb(),r.Tb(4,"div",2),r.Tb(5,"div",3),r.zc(6,m,2,0,"a",4),r.zc(7,k,2,1,"a",5),r.zc(8,h,3,1,"a",5),r.Sb(),r.Sb(),r.Sb(),r.zc(9,C,5,2,"div",6),r.Sb()),2&t&&(r.jc("ngClass",r.mc(8,v,n.person.isFlipped)),r.Cb(3),r.Bc(n.person.name),r.Cb(1),r.wc("background-image","url("+n.pictureBase+(n.person.picture||n.noPicture)+")"),r.Cb(2),r.jc("ngIf",n.person.bio),r.Cb(1),r.jc("ngIf",n.person.twitter),r.Cb(1),r.jc("ngIf",n.person.website),r.Cb(1),r.jc("ngIf",n.person.isFlipped))},directives:[o.i,o.k,c.a],encapsulation:2}),t})();function w(t,n){if(1&t){const t=r.Ub();r.Tb(0,"a",3),r.ac("click",function(){r.sc(t);const e=n.$implicit;return r.ec().selectGroup(e)})("keyup.enter",function(){r.sc(t);const e=n.$implicit;return r.ec().selectGroup(e)}),r.Ac(1),r.Sb()}if(2&t){const t=n.$implicit,e=r.ec();r.Gb("selected",t==e.selectedGroup.name),r.Cb(1),r.Bc(t)}}function j(t,n){1&t&&r.Pb(0,"aio-contributor",7),2&t&&r.jc("person",n.$implicit)}function y(t,n){if(1&t&&(r.Tb(0,"section",4),r.Tb(1,"div",5),r.zc(2,j,1,1,"aio-contributor",6),r.Sb(),r.Sb()),2&t){const t=r.ec();r.Cb(2),r.jc("ngForOf",t.selectedGroup.contributors)}}let T=(()=>{class t{constructor(t,n){this.contributorService=t,this.locationService=n}ngOnInit(){const t=this.locationService.search().group||"";this.contributorService.contributors.subscribe(n=>{this.groups=n,this.groupNames=n.map(t=>t.name),this.selectGroup(t)})}selectGroup(t){t=t.toLowerCase(),this.selectedGroup=this.groups.find(n=>n.name.toLowerCase()===t)||this.groups[0],this.locationService.setSearch("",{group:this.selectedGroup.name})}}return t.\u0275fac=function(n){return new(n||t)(r.Ob(l),r.Ob(g.a))},t.\u0275cmp=r.Ib({type:t,selectors:[["aio-contributor-list"]],decls:3,vars:2,consts:[[1,"flex-center","group-buttons"],["class","button mat-button filter-button",3,"selected","click","keyup.enter",4,"ngFor","ngForOf"],["class","grid-fluid",4,"ngIf"],[1,"button","mat-button","filter-button",3,"click","keyup.enter"],[1,"grid-fluid"],[1,"contributor-group"],[3,"person",4,"ngFor","ngForOf"],[3,"person"]],template:function(t,n){1&t&&(r.Tb(0,"div",0),r.zc(1,w,2,3,"a",1),r.Sb(),r.zc(2,y,3,1,"section",2)),2&t&&(r.Cb(1),r.jc("ngForOf",n.groupNames),r.Cb(1),r.jc("ngIf",n.selectedGroup))},directives:[o.j,o.k,S],encapsulation:2}),t})(),I=(()=>{class t{constructor(){this.customElementComponent=T}}return t.\u0275mod=r.Mb({type:t}),t.\u0275inj=r.Lb({factory:function(n){return new(n||t)},providers:[l],imports:[[o.c,c.b]]}),t})()}}]);
//# sourceMappingURL=contributor-contributor-list-module-es2015.c8325875e1dc65af0dc6.js.map