-
Notifications
You must be signed in to change notification settings - Fork 1
/
api-api-list-module-ngfactory-es2015.622670732f2286faadcc.js
2 lines (2 loc) · 8.24 KB
/
api-api-list-module-ngfactory-es2015.622670732f2286faadcc.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"/CO3":function(t,l,e){"use strict";e.r(l);var n=e("8Y7J"),i=e("jtHE"),s=e("itXk"),u=e("lJxs");class a{constructor(){this.query="",this.status="all",this.type="all"}}class c{constructor(t,l){this.apiService=t,this.locationService=l,this.showStatusMenu=!1,this.showTypeMenu=!1,this.criteriaSubject=new i.a(1),this.searchCriteria=new a,this.types=[{value:"all",title:"\u5168\u90e8"},{value:"class",title:"\u7c7b"},{value:"const",title:"\u5e38\u91cf"},{value:"decorator",title:"\u88c5\u9970\u5668"},{value:"directive",title:"\u6307\u4ee4"},{value:"enum",title:"\u679a\u4e3e"},{value:"function",title:"\u51fd\u6570"},{value:"interface",title:"\u63a5\u53e3"},{value:"pipe",title:"\u7ba1\u9053"},{value:"ngmodule",title:"NgModule"},{value:"type-alias",title:"\u7c7b\u578b\u522b\u540d"},{value:"package",title:"\u5305"}],this.statuses=[{value:"all",title:"\u5168\u90e8"},{value:"deprecated",title:"\u5f03\u7528"},{value:"security-risk",title:"\u5b89\u5168\u98ce\u9669"}]}ngOnInit(){this.filteredSections=Object(s.a)(this.apiService.sections,this.criteriaSubject).pipe(Object(u.a)(t=>({sections:t[0],criteria:t[1]})),Object(u.a)(t=>t.sections.map(l=>Object.assign({},l,{items:this.filterSection(l,t.criteria)})))),this.initializeSearchCriteria()}setQuery(t){this.setSearchCriteria({query:(t||"").toLowerCase().trim()})}setStatus(t){this.toggleStatusMenu(),this.status=t,this.setSearchCriteria({status:t.value})}setType(t){this.toggleTypeMenu(),this.type=t,this.setSearchCriteria({type:t.value})}toggleStatusMenu(){this.showStatusMenu=!this.showStatusMenu}toggleTypeMenu(){this.showTypeMenu=!this.showTypeMenu}filterSection(t,{query:l,status:e,type:n}){const i=t.items.filter(i=>("all"===n||n===i.docType)&&("all"===e||e===i.stability||"security-risk"===e&&i.securityRisk)&&(!l||-1!==t.name.indexOf(l)||-1!==i.name.indexOf(l)));return i.length?i:"package"!==n||l&&-1===t.name.indexOf(l)?null:[]}initializeSearchCriteria(){const{query:t,status:l,type:e}=this.locationService.search(),n=(t||"").toLowerCase();this.queryEl.nativeElement.value=n,this.status=this.statuses.find(t=>t.value===l)||this.statuses[0],this.type=this.types.find(t=>t.value===e)||this.types[0],this.searchCriteria={query:n,status:this.status.value,type:this.type.value},this.criteriaSubject.next(this.searchCriteria)}setLocationSearch(){const{query:t,status:l,type:e}=this.searchCriteria;this.locationService.setSearch("API \u641c\u7d22",{query:t||void 0,status:"all"!==l?l:void 0,type:"all"!==e?e:void 0})}setSearchCriteria(t){this.criteriaSubject.next(Object.assign(this.searchCriteria,t)),this.setLocationSearch()}}class o{constructor(){this.customElementComponent=c}}var r=e("SVse"),p=e("1nbL"),h=e("x4lQ"),b=e("XNiG"),d=e("1G5W"),f=e("vkgz"),m=e("jn67");class y{constructor(t,l){this.http=t,this.logger=l,this.apiBase=m.b+"api/",this.apiListJsonDefault="api-list.json",this.firstTime=!0,this.onDestroy=new b.a,this.sectionsSubject=new i.a(1),this._sections=this.sectionsSubject.pipe(Object(d.a)(this.onDestroy))}get sections(){return this.firstTime&&(this.firstTime=!1,this.fetchSections(),this._sections.subscribe(t=>this.logger.log("ApiService got API sections"))),this._sections.pipe(Object(f.a)(t=>{t.forEach(t=>{t.deprecated=!!t.items&&t.items.every(t=>"deprecated"===t.stability)})}))}ngOnDestroy(){this.onDestroy.next()}fetchSections(t){const l=this.apiBase+(t||this.apiListJsonDefault);this.http.get(l).pipe(Object(d.a)(this.onDestroy),Object(f.a)(()=>this.logger.log(`Got API sections from ${l}`))).subscribe(t=>this.sectionsSubject.next(t),t=>{throw this.logger.error(t),t})}}var g=e("/lUL"),v=n.nb({encapsulation:2,styles:[],data:{}});function x(t){return n.Hb(0,[(t()(),n.pb(0,0,null,null,2,"h2",[],null,null,null,null,null)),(t()(),n.pb(1,0,null,null,1,"a",[],[[8,"href",4],[2,"deprecated-api-item",null]],null,null,null,null)),(t()(),n.Fb(2,null,["",""]))],null,function(t,l){t(l,1,0,l.parent.context.$implicit.path,l.parent.context.$implicit.deprecated),t(l,2,0,l.parent.context.$implicit.title)})}function S(t){return n.Hb(0,[(t()(),n.pb(0,0,null,null,4,null,null,null,null,null,null,null)),(t()(),n.pb(1,0,null,null,3,"li",[["class","api-item"]],null,null,null,null,null)),(t()(),n.pb(2,0,null,null,2,"a",[],[[8,"href",4],[2,"deprecated-api-item",null]],null,null,null,null)),(t()(),n.pb(3,0,null,null,0,"span",[],[[8,"className",0]],null,null,null,null)),(t()(),n.Fb(4,null,[" "," "]))],null,function(t,l){t(l,2,0,l.context.$implicit.path,"deprecated"===l.context.$implicit.stability),t(l,3,0,n.rb(1,"symbol ",l.context.$implicit.docType,"")),t(l,4,0,l.context.$implicit.title)})}function w(t){return n.Hb(0,[(t()(),n.pb(0,0,null,null,2,"ul",[["class","api-list"]],null,null,null,null,null)),(t()(),n.fb(16777216,null,null,1,null,S)),n.ob(2,278528,null,0,r.j,[n.P,n.M,n.r],{ngForOf:[0,"ngForOf"]},null)],function(t,l){t(l,2,0,l.parent.context.$implicit.items)},null)}function k(t){return n.Hb(0,[(t()(),n.pb(0,0,null,null,4,"div",[],null,null,null,null,null)),(t()(),n.fb(16777216,null,null,1,null,x)),n.ob(2,16384,null,0,r.k,[n.P,n.M],{ngIf:[0,"ngIf"]},null),(t()(),n.fb(16777216,null,null,1,null,w)),n.ob(4,16384,null,0,r.k,[n.P,n.M],{ngIf:[0,"ngIf"]},null)],function(t,l){t(l,2,0,l.context.$implicit.items),t(l,4,0,null==l.context.$implicit.items?null:l.context.$implicit.items.length)},null)}function j(t){return n.Hb(0,[n.Db(402653184,1,{queryEl:0}),(t()(),n.pb(1,0,null,null,8,"div",[["class","l-flex-wrap api-filter"]],null,null,null,null,null)),(t()(),n.pb(2,0,null,null,1,"aio-select",[["label","\u7c7b\u578b\uff1a"]],null,[[null,"change"],["document","click"],["document","keydown.escape"]],function(t,l,e){var i=!0,s=t.component;return"document:click"===l&&(i=!1!==n.zb(t,3).onClick(e.target)&&i),"document:keydown.escape"===l&&(i=!1!==n.zb(t,3).onKeyDown()&&i),"change"===l&&(i=!1!==s.setType(e.option)&&i),i},p.b,p.a)),n.ob(3,114688,null,0,h.a,[n.k],{selected:[0,"selected"],options:[1,"options"],showSymbol:[2,"showSymbol"],label:[3,"label"]},{change:"change"}),(t()(),n.pb(4,0,null,null,1,"aio-select",[["label","\u72b6\u6001\uff1a"]],null,[[null,"change"],["document","click"],["document","keydown.escape"]],function(t,l,e){var i=!0,s=t.component;return"document:click"===l&&(i=!1!==n.zb(t,5).onClick(e.target)&&i),"document:keydown.escape"===l&&(i=!1!==n.zb(t,5).onKeyDown()&&i),"change"===l&&(i=!1!==s.setStatus(e.option)&&i),i},p.b,p.a)),n.ob(5,114688,null,0,h.a,[n.k],{selected:[0,"selected"],options:[1,"options"],label:[2,"label"],disabled:[3,"disabled"]},{change:"change"}),(t()(),n.pb(6,0,null,null,3,"div",[["class","form-search"]],null,null,null,null,null)),(t()(),n.pb(7,0,[[1,0],["filter",1]],null,0,"input",[["placeholder","\u8fc7\u6ee4"]],null,[[null,"input"]],function(t,l,e){var n=!0;return"input"===l&&(n=!1!==t.component.setQuery(e.target.value)&&n),n},null,null)),(t()(),n.pb(8,0,null,null,1,"i",[["class","material-icons"]],null,null,null,null,null)),(t()(),n.Fb(-1,null,["search"])),(t()(),n.pb(10,0,null,null,3,"article",[["class","api-list-container l-content-small docs-content"]],null,null,null,null,null)),(t()(),n.fb(16777216,null,null,2,null,k)),n.ob(12,278528,null,0,r.j,[n.P,n.M,n.r],{ngForOf:[0,"ngForOf"]},null),n.Ab(131072,r.b,[n.h])],function(t,l){var e=l.component;t(l,3,0,e.type,e.types,!0,"\u7c7b\u578b\uff1a"),t(l,5,0,e.status,e.statuses,"\u72b6\u6001\uff1a","package"===e.type.value),t(l,12,0,n.Gb(l,12,0,n.zb(l,13).transform(e.filteredSections)))},null)}function O(t){return n.Hb(0,[(t()(),n.pb(0,0,null,null,1,"aio-api-list",[],null,null,null,j,v)),n.ob(1,114688,null,0,c,[y,g.a],null,null)],function(t,l){t(l,1,0)},null)}var C=n.lb("aio-api-list",c,O,{},{},[]),M=e("IheW"),T=e("vHPH"),$=e("PCNd");e.d(l,"ApiListModuleNgFactory",function(){return q});var q=n.mb(o,[],function(t){return n.wb([n.xb(512,n.j,n.ab,[[8,[C]],[3,n.j],n.w]),n.xb(4608,r.m,r.l,[n.t,[2,r.B]]),n.xb(4608,M.h,M.n,[r.d,n.A,M.l]),n.xb(4608,M.o,M.o,[M.h,M.m]),n.xb(5120,M.a,function(t){return[t]},[M.o]),n.xb(4608,M.k,M.k,[]),n.xb(6144,M.i,null,[M.k]),n.xb(4608,M.g,M.g,[M.i]),n.xb(6144,M.b,null,[M.g]),n.xb(4608,M.f,M.j,[M.b,n.q]),n.xb(4608,M.c,M.c,[M.f]),n.xb(135680,y,y,[M.c,T.a]),n.xb(1073742336,r.c,r.c,[]),n.xb(1073742336,$.a,$.a,[]),n.xb(1073742336,M.e,M.e,[]),n.xb(1073742336,M.d,M.d,[]),n.xb(1073742336,o,o,[]),n.xb(256,M.l,"XSRF-TOKEN",[]),n.xb(256,M.m,"X-XSRF-TOKEN",[])])})}}]);
//# sourceMappingURL=api-api-list-module-ngfactory-es2015.622670732f2286faadcc.js.map