-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrc_app_custom-elements_resource_resource-list_module_ts.b6932405de802000.js
2 lines (2 loc) · 3.61 KB
/
src_app_custom-elements_resource_resource-list_module_ts.b6932405de802000.js
1
2
"use strict";(self.webpackChunksite=self.webpackChunksite||[]).push([["src_app_custom-elements_resource_resource-list_module_ts"],{5364:(Y,a,i)=>{i.r(a),i.d(a,{ResourceListModule:()=>L});var u=i(5056),t=i(4896),C=i(5608),g=i(8072),p=i(604),f=i(7808),h=i(1332);const y=f.y2+"resources.json";let l=(()=>{class e{constructor(o){this.http=o,this.categories=this.getCategories()}getCategories(){const o=this.http.get(y).pipe((0,p.k)(c=>function v(e){return Object.keys(e).map(r=>{const o=e[r];return{id:n(r),title:r,order:o.order,subCategories:b(o.subCategories,r)}}).sort(d)}(c))),s=(0,C.W)(o,{connector:()=>new g.O,resetOnDisconnect:!1});return s.connect(),s}static#t=this.\u0275fac=function(s){return new(s||e)(t.CoB(h.KK))};static#e=this.\u0275prov=t.wxM({token:e,factory:e.\u0275fac})}return e})();function b(e,r){return Object.keys(e).map(o=>{const s=e[o];return{id:n(o),title:o,order:s.order,resources:F(s.resources,o,r)}}).sort(d)}function F(e,r,o){return Object.keys(e).map(s=>{const c=e[s];return c.category=o,c.subCategory=r,c.id=n(s),c}).sort(m)}function d(e,r){return e.order===r.order?m(e,r):e.order>r.order?1:-1}function m(e,r){return e.title.toUpperCase()>r.title.toUpperCase()?1:-1}function n(e){return e.toLowerCase().replace(/\s+/g,"-")}var O=i(5460);function G(e,r){if(1&e){const o=t.KQA();t.I0R(0,"button",5),t.qCj("click",function(){const $=t.usT(o).$implicit,E=t.GaO();return t.CGJ(E.selectCategory($.id))}),t.OEk(1),t.C$Y()}if(2&e){const o=r.$implicit,s=t.GaO();t.eAK("selected",o.id==s.selectedCategory.id),t.yG2(),t.cNF(o.title)}}function R(e,r){if(1&e&&(t.I0R(0,"div")(1,"div",7)(2,"a",8)(3,"h3",9),t.OEk(4),t.C$Y(),t.I0R(5,"p",10),t.OEk(6),t.C$Y()()()()),2&e){const o=r.$implicit;t.yG2(2),t.E7m("href",o.url,t.K6U),t.yG2(2),t.cNF(o.titleCn||o.title),t.yG2(2),t.cNF(o.descCn||o.desc||"\u65e0\u63cf\u8ff0")}}function k(e,r){if(1&e&&(t.I0R(0,"div")(1,"h2",6),t.OEk(2),t.C$Y(),t.yuY(3,R,7,3,"div",4),t.C$Y()),2&e){const o=r.$implicit;t.yG2(),t._6D("id",o.id),t.yG2(),t.cNF(o.title),t.yG2(),t.E7m("ngForOf",o.resources)}}let I=(()=>{class e{constructor(o,s){this.resourceService=o,this.locationService=s}ngOnInit(){const o=this.locationService.search().category||"";this.resourceService.categories.subscribe(s=>{this.categories=s,this.selectCategory(o)})}selectCategory(o){o=o.toLowerCase(),this.selectedCategory=this.categories.find(s=>s.id.toLowerCase()===o)||this.categories[0],this.locationService.setSearch("",{category:this.selectedCategory.id})}static#t=this.\u0275fac=function(s){return new(s||e)(t.GI1(l),t.GI1(O.z))};static#e=this.\u0275cmp=t.In1({type:e,selectors:[["aio-resource-list"]],decls:5,vars:2,consts:[[1,"center-layout"],[1,"flex-center","group-buttons"],["class","button mat-button filter-button",3,"selected","click",4,"ngFor","ngForOf"],[1,"showcase"],[4,"ngFor","ngForOf"],[1,"button","mat-button","filter-button",3,"click"],[1,"subcategory-title",3,"id"],[1,"resource-item"],["rel","noopener","target","_blank",1,"resource-row-link",3,"href"],[1,"resource-name"],[1,"resource-description"]],template:function(s,c){1&s&&(t.I0R(0,"div",0)(1,"div",1),t.yuY(2,G,2,3,"button",2),t.C$Y(),t.I0R(3,"div",3),t.yuY(4,k,4,3,"div",4),t.C$Y()()),2&s&&(t.yG2(2),t.E7m("ngForOf",c.categories),t.yG2(2),t.E7m("ngForOf",null==c.selectedCategory?null:c.selectedCategory.subCategories))},dependencies:[u.ay],encapsulation:2})}return e})(),L=(()=>{class e{constructor(){this.customElementComponent=I}static#t=this.\u0275fac=function(s){return new(s||e)};static#e=this.\u0275mod=t.a4G({type:e});static#o=this.\u0275inj=t.s3X({providers:[l],imports:[u.MD]})}return e})()}}]);
//# sourceMappingURL=src_app_custom-elements_resource_resource-list_module_ts.b6932405de802000.js.map