-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_api_api-list_module_ts.348fbe8534d1ffbc.js.map
1 lines (1 loc) · 15 KB
/
src_app_custom-elements_api_api-list_module_ts.348fbe8534d1ffbc.js.map
1
{"version":3,"mappings":"sSA2BO,IAAMA,EAAb,MAAM,QA+BJC,YAAoBC,EAA0BC,GAA1BC,YAA0BA,cA7BtCA,aAAUC,KAAyB,OACnCD,wBAAqB,gBACrBA,gBAAY,EACZA,eAAY,IAAIE,IAChBF,qBAAkB,IAAIG,IAA4B,GAClDH,eAAYA,KAAKI,gBAAgBC,MAAKC,OAAUN,KAAKO,YAMzDC,eAEF,OAAIR,KAAKS,YACPT,KAAKS,WAAY,EACjBT,KAAKU,gBAGLV,KAAKW,UAAUC,UAAUJ,GAAYR,KAAKD,OAAOc,IAAI,sBAAsBL,EAASM,uBAG/Ed,KAAKW,UAAUN,MAAKU,OAAIP,IAC7BA,EAASQ,QAAQC,IACfA,EAAQC,aAAeD,EAAQE,OAC3BF,EAAQE,MAAMC,MAAMC,GAA2B,eAAnBA,EAAKC,gBAO3CC,cACEvB,KAAKO,UAAUiB,OAUjBd,cAAce,GAEZ,MAAMC,EAAM1B,KAAK2B,SAAWF,GAAOzB,KAAK4B,oBACxC5B,KAAKF,KAAK+B,IAAkBH,GACzBrB,QACCC,KAAUN,KAAKO,YACfQ,OAAI,IAAMf,KAAKD,OAAOc,IAAI,yBAAyBa,OAEpDd,UACCJ,GAAYR,KAAKI,gBAAgBoB,KAAKhB,GACrCsB,IAEC,WAAK/B,OAAOgC,MAAMD,GACZA,kDAzDHlC,GAAUoC,mDAAVpC,EAAUqC,QAAVrC,EAAU,YAAVA,GAAb,sECHIoC,cAA0BA,gBAA0EA,SAAiBA,QAAIA,wCAAtEA,mDAAtBA,2BAAuEA,kDAElGA,SACEA,iBACEA,gBACEA,gBACAA,SACFA,QACFA,QACFA,kCAL0BA,iEAAnBA,2BACKA,uCACNA,0DALRA,iBACEA,gCAQFA,wCAR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AKgF,eAOnChF,KAAKoC,gBAAgB8C,UAAU,mBANhB,CACb/B,MAAQA,QAAgBgC,EACxB3B,OAAmB,QAAXA,EAAmBA,OAAS2B,EACpCxB,KAAmB,QAAXA,EAAmBA,OAASwB,IAMhC/B,kBAAkBN,GACxB9C,KAAK2C,gBAAgBnB,KAAKuB,OAAOqC,OAAOpF,KAAKgF,eAAgBlC,IAC7D9C,KAAKiF,kEAzII/C,GAAgBF,8CAAhBE,EAAgBmD,imBD5B7BrD,iBAEEA,wBAAYA,kCAAUsD,sBAKtBtD,QAEAA,wBAAYA,kCAAUsD,wBAKtBtD,QAEAA,iBACEA,qBAAgCA,iCAASsD,6BAAzCtD,QACAA,eAA0BA,kBAAMA,QAClCA,QACFA,QAEAA,qBACEA,yCAaFA,eAjCcA,kCAAiB,kBAAjBA,CAAiB,iBAOjBA,qCAAoB,oBAApBA,CAAoB,qCAaPA,qHCKdE,GAAb,GCfaqD,EAAb,MAAM,QALN1F,cAMEG,4BAAoCkC,gDADzBqD,6DAFA,CAAE3F,GAAY4F,SAFhB,CAAEC,KAAcC,IAAcC,SAI5BJ,GAAb","names":["ApiService","constructor","http","logger","this","DOC_CONTENT_URL_PREFIX","Subject","ReplaySubject","sectionsSubject","pipe","takeUntil","onDestroy","sections","firstTime","fetchSections","_sections","subscribe","log","length","tap","forEach","section","deprecated","items","every","item","stability","ngOnDestroy","next","src","url","apiBase","apiListJsonDefault","get","err","error","i0","factory","ApiListComponent","apiService","locationService","SearchCriteria","value","title","ngOnInit","filteredSections","combineLatest","criteriaSubject","map","results","criteria","Object","filterSection","initializeSearchCriteria","setQuery","query","setSearchCriteria","toLowerCase","trim","setStatus","status","toggleStatusMenu","setType","type","toggleTypeMenu","showStatusMenu","showTypeMenu","sectionNameMatches","name","indexOf","filter","docType","matchesType","securityRisk","matchesStatus","matchesQuery","search","q","queryEl","nativeElement","statuses","find","x","types","searchCriteria","setLocationSearch","setSearch","undefined","assign","selectors","ctx","ApiListModule","imports","CommonModule","SharedModule","HttpClientModule"],"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\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\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 => this.logger.log(`ApiService got API ${sections.length} section(s)`));\n }\n\n return this._sections.pipe(tap(sections => {\n sections.forEach(section => {\n section.deprecated = !!section.items &&\n section.items.every(item => item.stability === 'deprecated');\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 [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.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=\"类型:\">\n </aio-select>\n\n <aio-select (change)=\"setStatus($event.option)\"\n [options]=\"statuses\"\n [selected]=\"status\"\n [disabled]=\"type.value === 'package'\"\n label=\"状态:\">\n </aio-select>\n\n <div class=\"form-search\">\n <input #filter placeholder=\"过滤\" (input)=\"setQuery($any($event.target).value)\" aria-label=\"Filter Search\">\n <i class=\"material-icons\">search</i>\n </div>\n</div>\n\n<article class=\"api-list-container\">\n <div *ngFor=\"let section of filteredSections | async\" >\n <h2 *ngIf=\"section.items\"><a [href]=\"section.path\" [class.deprecated-api-item]=\"section.deprecated\">{{section.title}}</a></h2>\n <ul class=\"api-list\" *ngIf=\"section.items && 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';\n\nimport { LocationService } from 'app/shared/location.service';\nimport { ApiItem, ApiSection, ApiService } from './api.service';\n\nimport { Option } from 'app/shared/select/select.component';\nimport { map } from 'rxjs/operators';\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\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: '全部' },\n { value: 'class', title: '类' },\n { value: 'const', title: '常量'},\n { value: 'decorator', title: '装饰器' },\n { value: 'directive', title: '指令' },\n { value: 'element', title: 'Element'},\n { value: 'enum', title: '枚举' },\n { value: 'function', title: '函数' },\n { value: 'interface', title: '接口' },\n { value: 'package', title: 'Package'},\n { value: 'pipe', title: '管道'},\n { value: 'ngmodule', title: 'NgModule'},\n { value: 'type-alias', title: '类型别名' },\n ];\n\n statuses: Option[] = [\n { value: 'all', title: '全部' },\n { value: 'stable', title: '稳定'},\n { value: 'deprecated', title: '弃用' },\n { value: 'security-risk', title: '安全风险' }\n ];\n\n @ViewChild('filter', { static: true }) queryEl: ElementRef;\n\n constructor(\n private apiService: ApiService,\n private locationService: LocationService) { }\n\n ngOnInit() {\n this.filteredSections =\n combineLatest([\n this.apiService.sections,\n this.criteriaSubject,\n ]).pipe(\n map( results => ({ sections: results[0], criteria: results[1]})),\n map( results => (\n results.sections\n .map(section => ({ ...section, items: this.filterSection(section, results.criteria) }))\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(section: ApiSection, { query, status, type }: SearchCriteria) {\n const sectionNameMatches = !query || section.name.indexOf(query) !== -1;\n\n const matchesQuery = (item: ApiItem) =>\n sectionNameMatches || item.name.indexOf(query) !== -1;\n const matchesStatus = (item: ApiItem) =>\n status === 'all' || status === item.stability || (status === 'security-risk' && item.securityRisk);\n const matchesType = (item: ApiItem) =>\n type === 'all' || type === item.docType;\n\n const items: ApiItem[] = (section.items || []).filter(item =>\n matchesType(item) && matchesStatus(item) && matchesQuery(item));\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 ? items : (sectionNameMatches && type === 'package') ? [] : 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 = 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 搜索', params);\n }\n\n private setSearchCriteria(criteria: Partial<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"],"sourceRoot":"webpack:///","file":"src_app_custom-elements_api_api-list_module_ts.348fbe8534d1ffbc.js"}