-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_api_api-list_module_ts.1827e2338e85fa62.js.map
1 lines (1 loc) · 17.1 KB
/
src_app_custom-elements_api_api-list_module_ts.1827e2338e85fa62.js.map
1
{"version":3,"file":"src_app_custom-elements_api_api-list_module_ts.1827e2338e85fa62.js","mappings":"wSA2BO,IAAMA,EAAU,UAAAC,EAAjB,MAAOD,EAYT,YAAIE,GACA,OAAIC,KAAKC,YACLD,KAAKC,WAAY,EACjBD,KAAKE,gBAGLF,KAAKG,UAAUC,UAAUL,GACrBC,KAAKK,OAAOC,IAAI,iCAIjBN,KAAKG,UAAUI,QAClBC,KAAIT,IACAA,EAASU,QAAQC,IACbA,EAAQC,aACdD,EAAQE,OACVF,EAAQE,MAAMC,MAAMC,GAA2B,eAAnBA,EAAKC,UAA0B,EACtD,GAGb,CAEAC,YAAoBC,EAA0BZ,GAA1BL,KAAAiB,OAA0BjB,KAAAK,SAjCtCL,KAAAkB,QAAUC,KAAyB,OACnCnB,KAAAoB,mBAAqB,gBACrBpB,KAAAC,WAAY,EACZD,KAAAqB,UAAY,IAAIC,IAChBtB,KAAAuB,gBAAkB,IAAIC,IAA4B,GAClDxB,KAAAG,UAAYH,KAAKuB,gBAAgBhB,QAAKkB,KAAUzB,KAAKqB,WA4BE,CAE/DK,cACI1B,KAAKqB,UAAUM,MACnB,CASAzB,cAAc0B,GAEV,MAAMC,EAAM7B,KAAKkB,SAAWU,GAAO5B,KAAKoB,oBACxCpB,KAAKiB,KACAa,IAAkBD,GAClBtB,QACGkB,KAAUzB,KAAKqB,YAAS,EACxBb,KAAI,IAAMR,KAAKK,OAAOC,IAAI,yBAAyBuB,OAEtDzB,UACGL,GAAYC,KAAKuB,gBAAgBI,KAAK5B,GACrCgC,IAEG,MAAA/B,KAAKK,OAAO2B,MAAMD,GACZA,GAGtB,WAhESlC,0CAAUoC,MAAAC,MAAAD,MAAAE,KAAA,4BAAVtC,EAAUuC,QAAVvC,EAAUwC,YAA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5CnE,QAEAA,MAAA,kBAAYA,MAAA,kBAAAkE,GAAA,OAAUD,EAAAzB,UAAA0B,EAAAC,OAAwB,GAK9CnE,QAEAA,MAAA,UAAAA,CAAyB,SACGA,MAAA,YAAMA,QAChCA,MAAA,eAAoCA,MAAA,iBAAAkE,GAAA,OAASD,EAAA7B,SAAA8B,EAAAE,OAAAzC,MAA6B,GAA1E3B,YAIJA,MAAA,eACEA,MAAA,EAAAqE,EAAA,+BAaFrE,eAjCcA,cAAA,UAAAiE,EAAAvC,MAAA1B,CAAiB,WAAAiE,EAAAhD,KAAjBjB,CAAiB,iBAOjBA,cAAA,UAAAiE,EAAArC,SAAA5B,CAAoB,WAAAiE,EAAAjD,OAApBhB,CAAoB,uBAAAiE,EAAAhD,KAAAU,OAaP3B,MAAA,GAAAA,MAAA,UAAAA,MAAA,KAAAiE,EAAAnC,wECKdZ,CAAgB,KCfhBoD,EAAa,UAAAC,EAApB,MAAOD,EALbvF,cAMIhB,KAAAyG,uBAAoCtD,YAD3BoD,yCAAa,0BAAbA,iCAFE,CAAC1G,GAAW6G,QAAA,CAFbC,KAAcC,IAAcC,QAI7BN,CAAa","names":["ApiService","_ApiService","sections","this","firstTime","fetchSections","_sections","subscribe","logger","log","pipe","tap","forEach","section","deprecated","items","every","item","stability","constructor","http","apiBase","DOC_CONTENT_URL_PREFIX","apiListJsonDefault","onDestroy","Subject","sectionsSubject","ReplaySubject","takeUntil","ngOnDestroy","next","src","url","get","err","error","i0","i1","i2","factory","ɵfac","section_r2","path","title","item_r7","docType","ApiListComponent_div_9_ul_2_ng_container_1_Template","ApiListComponent_div_9_h2_1_Template","ApiListComponent_div_9_ul_2_Template","length","SearchCriteria","query","status","type","ApiListComponent","_ApiListComponent","apiService","locationService","showStatusMenu","showTypeMenu","criteriaSubject","searchCriteria","types","value","statuses","ngOnInit","filteredSections","combineLatest","map","criteria","filterSection","initializeSearchCriteria","setQuery","setSearchCriteria","toLowerCase","trim","setStatus","toggleStatusMenu","setType","toggleTypeMenu","filter","matchesType","matchesStatus","securityRisk","matchesQuery","name","indexOf","search","q","queryEl","nativeElement","find","x","setLocationSearch","setSearch","undefined","Object","assign","selectors","viewQuery","rf","ctx","$event","option","target","ApiListComponent_div_9_Template","ApiListModule","_ApiListModule","customElementComponent","imports","CommonModule","SharedModule","HttpClientModule"],"sourceRoot":"webpack:///","sources":["./src/app/custom-elements/api/api.service.ts","./src/app/custom-elements/api/api-list.component.html","./src/app/custom-elements/api/api-list.component.ts","./src/app/custom-elements/api/api-list.module.ts"],"sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\n\nimport { ReplaySubject, Subject } from 'rxjs';\nimport { takeUntil, tap } from 'rxjs/operators';\n\nimport { Logger } from 'app/shared/logger.service';\nimport { DOC_CONTENT_URL_PREFIX } from 'app/documents/document.service';\n\nexport interface ApiItem {\n name: string;\n title: string;\n path: string;\n docType: string;\n stability: string;\n securityRisk: boolean;\n}\n\nexport interface ApiSection {\n path: string;\n name: string;\n title: string;\n deprecated: boolean;\n items: ApiItem[] | null;\n}\n\n@Injectable()\nexport class ApiService implements OnDestroy {\n private apiBase = DOC_CONTENT_URL_PREFIX + 'api/';\n private apiListJsonDefault = 'api-list.json';\n private firstTime = true;\n private onDestroy = new Subject<void>();\n private sectionsSubject = new ReplaySubject<ApiSection[]>(1);\n private _sections = this.sectionsSubject.pipe(takeUntil(this.onDestroy));\n\n /**\n * Return a cached observable of API sections from a JSON file.\n * API sections is an array of Angular top modules and metadata about their API documents (items).\n */\n get sections() {\n if (this.firstTime) {\n this.firstTime = false;\n this.fetchSections(); // TODO: get URL for fetchSections by configuration?\n\n // makes sectionsSubject hot; subscribe ensures stays alive (always refCount > 0);\n this._sections.subscribe(sections =>\n this.logger.log('ApiService got API sections')\n );\n }\n\n return this._sections.pipe(\n tap(sections => {\n sections.forEach(section => {\n section.deprecated =\n !!section.items &&\n section.items.every(item => item.stability === 'deprecated');\n });\n })\n );\n }\n\n constructor(private http: HttpClient, private logger: Logger) {}\n\n ngOnDestroy() {\n this.onDestroy.next();\n }\n\n /**\n * Fetch API sections from a JSON file.\n * API sections is an array of Angular top modules and metadata about their API documents (items).\n * Updates `sections` observable\n *\n * @param {string} [src] - Name of the api list JSON file\n */\n fetchSections(src?: string) {\n // TODO: get URL by configuration?\n const url = this.apiBase + (src || this.apiListJsonDefault);\n this.http\n .get<ApiSection[]>(url)\n .pipe(\n takeUntil(this.onDestroy),\n tap(() => this.logger.log(`Got API sections from ${url}`))\n )\n .subscribe(\n sections => this.sectionsSubject.next(sections),\n (err: HttpErrorResponse) => {\n // TODO: handle error\n this.logger.error(err);\n throw err; // rethrow for now.\n }\n );\n }\n}\n","<div class=\"l-flex-wrap api-filter\">\n\n <aio-select (change)=\"setType($event.option)\"\n [options]=\"types\"\n [selected]=\"type\"\n [showSymbol]=\"true\"\n label=\"Type:\">\n </aio-select>\n\n <aio-select (change)=\"setStatus($event.option)\"\n [options]=\"statuses\"\n [selected]=\"status\"\n [disabled]=\"type.value === 'package'\"\n label=\"Status:\">\n </aio-select>\n\n <div class=\"form-search\">\n <i class=\"material-icons\">search</i>\n <input #filter placeholder=\"Filter\" (input)=\"setQuery($event.target.value)\">\n </div>\n</div>\n\n<article class=\"api-list-container l-content-small docs-content\">\n <div *ngFor=\"let section of filteredSections | async\" >\n <h2 *ngIf=\"section.items\"><a [href]=\"section.path\" [class.deprecated-api-item]=\"section.deprecated\">@ngrx/{{section.title}}</a></h2>\n <ul class=\"api-list\" *ngIf=\"section.items?.length\">\n <ng-container *ngFor=\"let item of section.items\">\n <li class=\"api-item\">\n <a [href]=\"item.path\" [class.deprecated-api-item]=\"item.stability === 'deprecated'\">\n <span class=\"symbol {{item.docType}}\"></span>\n {{item.title}}\n </a>\n </li>\n </ng-container>\n </ul>\n </div>\n</article>\n","/*\n* API List & Filter Component\n*\n* A page that displays a formatted list of the public Angular API entities.\n* Clicking on a list item triggers navigation to the corresponding API entity document.\n* Can add/remove API entity links based on filter settings.\n*/\n\nimport { Component, ElementRef, OnInit, ViewChild } from '@angular/core';\n\nimport { combineLatest, Observable, ReplaySubject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { LocationService } from 'app/shared/location.service';\nimport { ApiSection, ApiService } from './api.service';\n\nimport { Option } from 'app/shared/select/select.component';\n\nclass SearchCriteria {\n query? = '';\n status? = 'all';\n type? = 'all';\n}\n\n@Component({\n selector: 'aio-api-list',\n templateUrl: './api-list.component.html',\n})\nexport class ApiListComponent implements OnInit {\n filteredSections: Observable<ApiSection[]>;\n\n showStatusMenu = false;\n showTypeMenu = false;\n\n private criteriaSubject = new ReplaySubject<SearchCriteria>(1);\n private searchCriteria = new SearchCriteria();\n\n status: Option;\n type: Option;\n\n // API types\n types: Option[] = [\n { value: 'all', title: 'All' },\n { value: 'class', title: 'Class' },\n { value: 'const', title: 'Const' },\n { value: 'decorator', title: 'Decorator' },\n { value: 'directive', title: 'Directive' },\n { value: 'enum', title: 'Enum' },\n { value: 'function', title: 'Function' },\n { value: 'interface', title: 'Interface' },\n { value: 'pipe', title: 'Pipe' },\n { value: 'ngmodule', title: 'NgModule' },\n { value: 'type-alias', title: 'Type alias' },\n { value: 'package', title: 'Package' },\n ];\n\n statuses: Option[] = [\n { value: 'all', title: 'All' },\n { value: 'stable', title: 'Stable' },\n { value: 'deprecated', title: 'Deprecated' },\n { value: 'security-risk', title: 'Security Risk' },\n ];\n\n @ViewChild('filter', { static: true }) queryEl: ElementRef;\n\n constructor(\n private apiService: ApiService,\n private locationService: LocationService\n ) {}\n\n ngOnInit() {\n this.filteredSections = combineLatest([\n this.apiService.sections,\n this.criteriaSubject\n ]).pipe(\n map(([sections, criteria]) => {\n return sections.map(section => ({\n ...section,\n items: this.filterSection(section, criteria),\n }));\n })\n );\n\n this.initializeSearchCriteria();\n }\n\n // TODO: may need to debounce as the original did\n // although there shouldn't be any perf consequences if we don't\n setQuery(query: string) {\n this.setSearchCriteria({ query: (query || '').toLowerCase().trim() });\n }\n\n setStatus(status: Option) {\n this.toggleStatusMenu();\n this.status = status;\n this.setSearchCriteria({ status: status.value });\n }\n\n setType(type: Option) {\n this.toggleTypeMenu();\n this.type = type;\n this.setSearchCriteria({ type: type.value });\n }\n\n toggleStatusMenu() {\n this.showStatusMenu = !this.showStatusMenu;\n }\n\n toggleTypeMenu() {\n this.showTypeMenu = !this.showTypeMenu;\n }\n\n /// ///// Private //////////\n\n private filterSection(\n section: ApiSection,\n { query, status, type }: SearchCriteria\n ) {\n const items = section.items!.filter(item => {\n return matchesType() && matchesStatus() && matchesQuery();\n\n function matchesQuery() {\n return (\n !query ||\n section.name.indexOf(query) !== -1 ||\n item.name.indexOf(query) !== -1\n );\n }\n\n function matchesStatus() {\n return (\n status === 'all' ||\n status === item.stability ||\n (status === 'security-risk' && item.securityRisk)\n );\n }\n\n function matchesType() {\n return type === 'all' || type === item.docType;\n }\n });\n\n // If there are no items we still return an empty array if the section name matches and the type is 'package'\n return items.length\n ? items\n : type === 'package' && (!query || section.name.indexOf(query) !== -1)\n ? []\n : null;\n }\n\n // Get initial search criteria from URL search params\n private initializeSearchCriteria() {\n const { query, status, type } = this.locationService.search();\n\n const q = (query || '').toLowerCase();\n // Hack: can't bind to query because input cursor always forced to end-of-line.\n this.queryEl.nativeElement.value = q;\n\n this.status =\n this.statuses.find(x => x.value === status) || this.statuses[0];\n this.type = this.types.find(x => x.value === type) || this.types[0];\n\n this.searchCriteria = {\n query: q,\n status: this.status.value,\n type: this.type.value,\n };\n\n this.criteriaSubject.next(this.searchCriteria);\n }\n\n private setLocationSearch() {\n const { query, status, type } = this.searchCriteria;\n const params = {\n query: query ? query : undefined,\n status: status !== 'all' ? status : undefined,\n type: type !== 'all' ? type : undefined,\n };\n\n this.locationService.setSearch('API Search', params);\n }\n\n private setSearchCriteria(criteria: SearchCriteria) {\n this.criteriaSubject.next(Object.assign(this.searchCriteria, criteria));\n this.setLocationSearch();\n }\n}\n","import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { SharedModule } from '../../shared/shared.module';\nimport { ApiListComponent } from './api-list.component';\nimport { ApiService } from './api.service';\nimport { WithCustomElementComponent } from '../element-registry';\n\n@NgModule({\n imports: [CommonModule, SharedModule, HttpClientModule],\n declarations: [ApiListComponent],\n providers: [ApiService],\n})\nexport class ApiListModule implements WithCustomElementComponent {\n customElementComponent: Type<any> = ApiListComponent;\n}\n"],"x_google_ignoreList":[]}