-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_resource_resource-list_module_ts.9f52e801cc116855.js.map
1 lines (1 loc) · 9.41 KB
/
src_app_custom-elements_resource_resource-list_module_ts.9f52e801cc116855.js.map
1
{"version":3,"file":"src_app_custom-elements_resource_resource-list_module_ts.9f52e801cc116855.js","mappings":"wPASA,MAAMA,EAAgBC,KAAqB,iBAGpC,IAAMC,EAAe,UAAAC,EAAtB,MAAOD,EAGTE,YAAoBC,GAAAC,KAAAD,OAChBC,KAAKC,WAAaD,KAAKE,eAC3B,CAEQA,gBAEJ,MAAMD,EAAaD,KAAKD,KAAKI,IAAST,GAAeU,QACjDC,KAAIC,GAUhB,SAASC,EAAaC,GAClB,OAAOC,OAAOC,KAAKF,GAAcH,IAAIM,IACjC,MAAMC,EAAMJ,EAAaG,GACzB,MAAO,CACHE,GAAIC,EAAOH,GACXI,MAAOJ,EACPK,MAAOJ,EAAII,MACXC,cAAeC,EAAgBN,EAAIK,cAAeN,MAGrDQ,KAAKC,EACd,CArBwBb,CAAaD,KAAK,EAC9Be,QAGHpB,SAAiDqB,UAC3CrB,CACX,WAhBSL,0CAAe2B,MAAAC,MAAA,4BAAf5B,EAAe6B,QAAf7B,EAAe8B,YAAf9B,CAAe,KAkC5B,SAASsB,EAAgBS,EAAsBhB,GAC3C,OAAOF,OAAOC,KAAKiB,GAAiBtB,IAAIuB,IACpC,MAAMC,EAAMF,EAAgBC,GAC5B,MAAO,CACHf,GAAIC,EAAOc,GACXb,MAAOa,EACPZ,MAAOa,EAAIb,MACXc,UAAWC,EAAYF,EAAIC,UAAWF,EAAQjB,MAGjDQ,KAAKC,EACd,CAGA,SAASW,EAAYC,EAAmBJ,EAAgBjB,GACpD,OAAOF,OAAOC,KAAKsB,GAAc3B,IAAI4B,IACjC,MAAMC,EAAMF,EAAaC,GACzBC,SAAIC,SAAWxB,EACfuB,EAAIE,YAAcR,EAClBM,EAAIrB,GAAKC,EAAOmB,GACTC,IAENf,KAAKkB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AWA,EAASG,SAASf,QAAQ,OAAQ,GACtD,CAEAgB,KAAK9C,GACD,OAAOZ,KAAKsD,SAAW,IAAM1C,EAAIC,EACrC,CAEA8C,WAGI3D,KAAKuD,gBAAgBtD,WAAW2D,UAAUC,GAAQ7D,KAAKC,WAAa4D,EACxE,CAGAC,SAASC,GACL/D,KAAKwD,UAAYO,IAASA,EAAOC,WAAaD,EAAOE,KAAKD,YAAc,CAC5E,WAzBSZ,0CAAqB7B,MAAAC,MAAAD,MAAA2C,GAAA,0BAArBd,EAAqBe,UAAA,wBAAAC,aAAA,SAAAC,EAAAC,GAAA,EAAAD,qCAArBC,EAAAR,SAAAS,EAAAR,OAAuB,KAAAxC,saDVpCA,MAAA,UAAAA,CAAiC,WAE3BA,MAAA,EAAAiD,EAAA,aAwBFjD,iBAxB6CA,MAAA,GAAAA,MAAA,UAAA+C,EAAArE,yDCQpCmD,CAAqB,KCCrBqB,EAAkB,UAAAC,EAAzB,MAAOD,EALb3E,cAMIE,KAAA2E,uBAAoCvB,YAD3BqB,yCAAkB,0BAAlBA,iCAFE,CAAC7E,GAAgBgF,QAAA,CAFlBC,QAIDJ,CAAkB","names":["resourcesPath","CONTENT_URL_PREFIX","ResourceService","_ResourceService","constructor","http","this","categories","getCategories","get","pipe","map","data","mkCategories","categoryJson","Object","keys","catKey","cat","id","makeId","title","order","subCategories","mkSubCategories","sort","compareCats","publishLast","connect","i0","i1","factory","ɵfac","subCategoryJson","subKey","sub","resources","mkResources","resourceJson","resKey","res","category","subCategory","compareTitles","l","r","toUpperCase","toLowerCase","replace","resource_r5","url","desc","ResourceListComponent_div_2_div_6_div_4_div_1_Template","rev","ResourceListComponent_div_2_div_6_div_4_Template","subCategory_r3","ResourceListComponent_div_2_div_6_Template","category_r1","ResourceListComponent","_ResourceListComponent","location","resourceService","scrollPos","pathname","href","ngOnInit","subscribe","cats","onScroll","target","scrollTop","body","i2","selectors","hostBindings","rf","ctx","$event","ResourceListComponent_div_2_Template","ResourceListModule","_ResourceListModule","customElementComponent","imports","CommonModule"],"sourceRoot":"webpack:///","sources":["./src/app/custom-elements/resource/resource.service.ts","./src/app/custom-elements/resource/resource-list.component.html","./src/app/custom-elements/resource/resource-list.component.ts","./src/app/custom-elements/resource/resource-list.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { ConnectableObservable, Observable } from 'rxjs';\nimport { map, publishLast } from 'rxjs/operators';\n\nimport { Category, Resource, SubCategory } from './resource.model';\nimport { CONTENT_URL_PREFIX } from 'app/documents/document.service';\n\nconst resourcesPath = CONTENT_URL_PREFIX + 'resources.json';\n\n@Injectable()\nexport class ResourceService {\n categories: Observable<Category[]>;\n\n constructor(private http: HttpClient) {\n this.categories = this.getCategories();\n }\n\n private getCategories(): Observable<Category[]> {\n\n const categories = this.http.get<any>(resourcesPath).pipe(\n map(data => mkCategories(data)),\n publishLast(),\n );\n\n (categories as ConnectableObservable<Category[]>).connect();\n return categories;\n }\n}\n\n// Extract sorted Category[] from resource JSON data\nfunction mkCategories(categoryJson: any): Category[] {\n return Object.keys(categoryJson).map(catKey => {\n const cat = categoryJson[catKey];\n return {\n id: makeId(catKey),\n title: catKey,\n order: cat.order,\n subCategories: mkSubCategories(cat.subCategories, catKey)\n } as Category;\n })\n .sort(compareCats);\n}\n\n// Extract sorted SubCategory[] from JSON category data\nfunction mkSubCategories(subCategoryJson: any, catKey: string): SubCategory[] {\n return Object.keys(subCategoryJson).map(subKey => {\n const sub = subCategoryJson[subKey];\n return {\n id: makeId(subKey),\n title: subKey,\n order: sub.order,\n resources: mkResources(sub.resources, subKey, catKey)\n } as SubCategory;\n })\n .sort(compareCats);\n}\n\n// Extract sorted Resource[] from JSON subcategory data\nfunction mkResources(resourceJson: any, subKey: string, catKey: string): Resource[] {\n return Object.keys(resourceJson).map(resKey => {\n const res = resourceJson[resKey];\n res.category = catKey;\n res.subCategory = subKey;\n res.id = makeId(resKey);\n return res as Resource;\n })\n .sort(compareTitles);\n}\n\nfunction compareCats(l: Category | SubCategory, r: Category | SubCategory) {\n return l.order === r.order ? compareTitles(l, r) : l.order > r.order ? 1 : -1;\n}\n\nfunction compareTitles(l: {title: string}, r: {title: string}) {\n return l.title.toUpperCase() > r.title.toUpperCase() ? 1 : -1;\n}\n\nfunction makeId(title: string) {\n return title.toLowerCase().replace(/\\s+/g, '-');\n}\n","<div class=\"resources-container\">\n <div class=\"l-flex--column\">\n <div class=\"showcase\" *ngFor=\"let category of categories\">\n <header class=\"c-resource-header\">\n <a class=\"h-anchor-offset\" id=\"{{category.id}}\"></a>\n <h2>{{category.title}}</h2>\n </header>\n\n <div class=\"shadow-1\">\n <div *ngFor=\"let subCategory of category.subCategories\">\n <a class=\"h-anchor-offset\" id=\"{{subCategory.id}}\"></a>\n <h3 class=\"subcategory-title\">{{subCategory.title}}</h3>\n\n <div *ngFor=\"let resource of subCategory.resources\">\n <div class=\"c-resource\" *ngIf=\"resource.rev\">\n <a class=\"l-flex--column resource-row-link\" target=\"_blank\" [href]=\"resource.url\">\n <div>\n <h4>{{resource.title}}</h4>\n <p class=\"resource-description\">{{resource.desc || 'No Description'}}</p>\n </div>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n","import { Component, HostListener, OnInit } from '@angular/core';\nimport { PlatformLocation } from '@angular/common';\n\nimport { Category } from './resource.model';\nimport { ResourceService } from './resource.service';\n\n@Component({\n selector: 'aio-resource-list',\n templateUrl: 'resource-list.component.html'\n})\nexport class ResourceListComponent implements OnInit {\n\n categories: Category[];\n location: string;\n scrollPos = 0;\n\n constructor(\n location: PlatformLocation,\n private resourceService: ResourceService) {\n this.location = location.pathname.replace(/^\\/+/, '');\n }\n\n href(cat: {id: string}) {\n return this.location + '#' + cat.id;\n }\n\n ngOnInit() {\n // Not using async pipe because cats appear twice in template\n // No need to unsubscribe because categories observable completes.\n this.resourceService.categories.subscribe(cats => this.categories = cats);\n }\n\n @HostListener('window:scroll', ['$event.target'])\n onScroll(target: any) {\n this.scrollPos = target ? target.scrollTop || target.body.scrollTop || 0 : 0;\n }\n}\n","import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ResourceListComponent } from './resource-list.component';\nimport { ResourceService } from './resource.service';\nimport { WithCustomElementComponent } from '../element-registry';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [ResourceListComponent],\n providers: [ResourceService],\n})\nexport class ResourceListModule implements WithCustomElementComponent {\n customElementComponent: Type<any> = ResourceListComponent;\n}\n"],"x_google_ignoreList":[]}