-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_api_api-list_module_ts.1827e2338e85fa62.js
2 lines (2 loc) · 6.12 KB
/
src_app_custom-elements_api_api-list_module_ts.1827e2338e85fa62.js
1
2
"use strict";(self.webpackChunksite=self.webpackChunksite||[]).push([["src_app_custom-elements_api_api-list_module_ts"],{2443:(k,h,o)=>{o.r(h),o.d(h,{ApiListModule:()=>Y});var u=o(3267),m=o(2008),S=o(1455),y=o(1080),g=o(1416),C=o(2068),t=o(5460),A=o(3441),f=o(5896),v=o(8788),L=o(4788),T=o(7724);let d=(()=>{var s;class l{get sections(){return this.firstTime&&(this.firstTime=!1,this.fetchSections(),this._sections.subscribe(e=>this.logger.log("ApiService got API sections"))),this._sections.pipe((0,f.y)(e=>{e.forEach(i=>{i.deprecated=!!i.items&&i.items.every(n=>"deprecated"===n.stability)})}))}constructor(e,i){this.http=e,this.logger=i,this.apiBase=L.mm+"api/",this.apiListJsonDefault="api-list.json",this.firstTime=!0,this.onDestroy=new A.E,this.sectionsSubject=new y.o(1),this._sections=this.sectionsSubject.pipe((0,v.a)(this.onDestroy))}ngOnDestroy(){this.onDestroy.next()}fetchSections(e){const i=this.apiBase+(e||this.apiListJsonDefault);this.http.get(i).pipe((0,v.a)(this.onDestroy),(0,f.y)(()=>this.logger.log(`Got API sections from ${i}`))).subscribe(n=>this.sectionsSubject.next(n),n=>{throw this.logger.error(n),n})}}return(s=l).\u0275fac=function(e){return new(e||s)(t.CoB(m.KK),t.CoB(T.Y))},s.\u0275prov=t.wxM({token:s,factory:s.\u0275fac}),l})();var I=o(5360),E=o(4988);const G=["filter"];function M(s,l){if(1&s&&(t.I0R(0,"h2")(1,"a",11),t.OEk(2),t.C$Y()()),2&s){const a=t.GaO().$implicit;t.yG2(),t.eAK("deprecated-api-item",a.deprecated),t.E7m("href",a.path,t.K6U),t.yG2(),t.oRS("@ngrx/",a.title,"")}}function j(s,l){if(1&s&&(t.SAx(0),t.I0R(1,"li",13)(2,"a",11),t.wR5(3,"span"),t.OEk(4),t.C$Y()(),t.k70()),2&s){const a=l.$implicit;t.yG2(2),t.eAK("deprecated-api-item","deprecated"===a.stability),t.E7m("href",a.path,t.K6U),t.yG2(),t.uQ9("symbol ",a.docType,""),t.yG2(),t.oRS(" ",a.title," ")}}function R(s,l){if(1&s&&(t.I0R(0,"ul",12),t.yuY(1,j,5,7,"ng-container",8),t.C$Y()),2&s){const a=t.GaO().$implicit;t.yG2(),t.E7m("ngForOf",a.items)}}function $(s,l){if(1&s&&(t.I0R(0,"div"),t.yuY(1,M,3,4,"h2",9)(2,R,2,1,"ul",10),t.C$Y()),2&s){const a=l.$implicit;t.yG2(),t.E7m("ngIf",a.items),t.yG2(),t.E7m("ngIf",null==a.items?null:a.items.length)}}class b{constructor(){this.query="",this.status="all",this.type="all"}}let O=(()=>{var s;class l{constructor(e,i){this.apiService=e,this.locationService=i,this.showStatusMenu=!1,this.showTypeMenu=!1,this.criteriaSubject=new y.o(1),this.searchCriteria=new b,this.types=[{value:"all",title:"All"},{value:"class",title:"Class"},{value:"const",title:"Const"},{value:"decorator",title:"Decorator"},{value:"directive",title:"Directive"},{value:"enum",title:"Enum"},{value:"function",title:"Function"},{value:"interface",title:"Interface"},{value:"pipe",title:"Pipe"},{value:"ngmodule",title:"NgModule"},{value:"type-alias",title:"Type alias"},{value:"package",title:"Package"}],this.statuses=[{value:"all",title:"All"},{value:"stable",title:"Stable"},{value:"deprecated",title:"Deprecated"},{value:"security-risk",title:"Security Risk"}]}ngOnInit(){this.filteredSections=(0,g.E)([this.apiService.sections,this.criteriaSubject]).pipe((0,C.k)(([e,i])=>e.map(n=>({...n,items:this.filterSection(n,i)})))),this.initializeSearchCriteria()}setQuery(e){this.setSearchCriteria({query:(e||"").toLowerCase().trim()})}setStatus(e){this.toggleStatusMenu(),this.status=e,this.setSearchCriteria({status:e.value})}setType(e){this.toggleTypeMenu(),this.type=e,this.setSearchCriteria({type:e.value})}toggleStatusMenu(){this.showStatusMenu=!this.showStatusMenu}toggleTypeMenu(){this.showTypeMenu=!this.showTypeMenu}filterSection(e,{query:i,status:n,type:r}){const c=e.items.filter(p=>function F(){return"all"===r||r===p.docType}()&&function w(){return"all"===n||n===p.stability||"security-risk"===n&&p.securityRisk}()&&function D(){return!i||-1!==e.name.indexOf(i)||-1!==p.name.indexOf(i)}());return c.length?c:"package"!==r||i&&-1===e.name.indexOf(i)?null:[]}initializeSearchCriteria(){const{query:e,status:i,type:n}=this.locationService.search(),r=(e||"").toLowerCase();this.queryEl.nativeElement.value=r,this.status=this.statuses.find(c=>c.value===i)||this.statuses[0],this.type=this.types.find(c=>c.value===n)||this.types[0],this.searchCriteria={query:r,status:this.status.value,type:this.type.value},this.criteriaSubject.next(this.searchCriteria)}setLocationSearch(){const{query:e,status:i,type:n}=this.searchCriteria;this.locationService.setSearch("API Search",{query:e||void 0,status:"all"!==i?i:void 0,type:"all"!==n?n:void 0})}setSearchCriteria(e){this.criteriaSubject.next(Object.assign(this.searchCriteria,e)),this.setLocationSearch()}}return(s=l).\u0275fac=function(e){return new(e||s)(t.GI1(d),t.GI1(I.z))},s.\u0275cmp=t.In1({type:s,selectors:[["aio-api-list"]],viewQuery:function(e,i){if(1&e&&t.CC$(G,7),2&e){let n;t.wto(n=t.Gqi())&&(i.queryEl=n.first)}},decls:11,vars:9,consts:[[1,"l-flex-wrap","api-filter"],["label","Type:",3,"options","selected","showSymbol","change"],["label","Status:",3,"options","selected","disabled","change"],[1,"form-search"],[1,"material-icons"],["placeholder","Filter",3,"input"],["filter",""],[1,"api-list-container","l-content-small","docs-content"],[4,"ngFor","ngForOf"],[4,"ngIf"],["class","api-list",4,"ngIf"],[3,"href"],[1,"api-list"],[1,"api-item"]],template:function(e,i){1&e&&(t.I0R(0,"div",0)(1,"aio-select",1),t.qCj("change",function(r){return i.setType(r.option)}),t.C$Y(),t.I0R(2,"aio-select",2),t.qCj("change",function(r){return i.setStatus(r.option)}),t.C$Y(),t.I0R(3,"div",3)(4,"i",4),t.OEk(5,"search"),t.C$Y(),t.I0R(6,"input",5,6),t.qCj("input",function(r){return i.setQuery(r.target.value)}),t.C$Y()()(),t.I0R(8,"article",7),t.yuY(9,$,3,2,"div",8),t.wVc(10,"async"),t.C$Y()),2&e&&(t.yG2(),t.E7m("options",i.types)("selected",i.type)("showSymbol",!0),t.yG2(),t.E7m("options",i.statuses)("selected",i.status)("disabled","package"===i.type.value),t.yG2(7),t.E7m("ngForOf",t.kDX(10,7,i.filteredSections)))},dependencies:[u.ay,u.u_,E.Y,u.a],encapsulation:2}),l})(),Y=(()=>{var s;class l{constructor(){this.customElementComponent=O}}return(s=l).\u0275fac=function(e){return new(e||s)},s.\u0275mod=t.a4G({type:s}),s.\u0275inj=t.s3X({providers:[d],imports:[u.MD,S.k,m.SU]}),l})()}}]);
//# sourceMappingURL=src_app_custom-elements_api_api-list_module_ts.1827e2338e85fa62.js.map