-
Notifications
You must be signed in to change notification settings - Fork 23
/
src_app_custom-elements_api_api-list_module_ts-es5.d9c36aa3d5321c3f76ac.js
2 lines (2 loc) · 7.28 KB
/
src_app_custom-elements_api_api-list_module_ts-es5.d9c36aa3d5321c3f76ac.js
1
2
!function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}(self.webpackChunkangular_cn=self.webpackChunkangular_cn||[]).push([["src_app_custom-elements_api_api-list_module_ts"],{4705:function(e,n,s){"use strict";s.r(n),s.d(n,{ApiListModule:function(){return C}});var a=s(1116),r=s(2693),u=s(5425),c=s(6605),o=s(1305),l=s(9996),h=s(5366),p=s(5959),f=s(5416),v=s(4019),y=s(1374),g=s(9474),d=function(){var e=function(){function e(i,n){t(this,e),this.http=i,this.logger=n,this.apiBase=y.Yp+"api/",this.apiListJsonDefault="api-list.json",this.firstTime=!0,this.onDestroy=new p.xQ,this.sectionsSubject=new c.t(1),this._sections=this.sectionsSubject.pipe((0,f.R)(this.onDestroy))}return i(e,[{key:"sections",get:function(){var t=this;return this.firstTime&&(this.firstTime=!1,this.fetchSections(),this._sections.subscribe(function(e){return t.logger.log("ApiService got API ".concat(e.length," section(s)"))})),this._sections.pipe((0,v.b)(function(t){t.forEach(function(t){t.deprecated=!!t.items&&t.items.every(function(t){return"deprecated"===t.stability})})}))}},{key:"ngOnDestroy",value:function(){this.onDestroy.next()}},{key:"fetchSections",value:function(t){var e=this,i=this.apiBase+(t||this.apiListJsonDefault);this.http.get(i).pipe((0,f.R)(this.onDestroy),(0,v.b)(function(){return e.logger.log("Got API sections from ".concat(i))})).subscribe(function(t){return e.sectionsSubject.next(t)},function(t){throw e.logger.error(t),t})}}]),e}();return e.\u0275fac=function(t){return new(t||e)(h.LFG(r.eN),h.LFG(g.Y))},e.\u0275prov=h.Yz7({token:e,factory:e.\u0275fac}),e}(),m=s(2981),S=s(3732),b=["filter"];function k(t,e){if(1&t&&(h.TgZ(0,"h2"),h.TgZ(1,"a",11),h._uU(2),h.qZA(),h.qZA()),2&t){var i=h.oxw().$implicit;h.xp6(1),h.ekj("deprecated-api-item",i.deprecated),h.Q6J("href",i.path,h.LSH),h.xp6(1),h.Oqu(i.title)}}function Z(t,e){if(1&t&&(h.ynx(0),h.TgZ(1,"li",13),h.TgZ(2,"a",11),h._UZ(3,"span"),h._uU(4),h.qZA(),h.qZA(),h.BQk()),2&t){var i=e.$implicit;h.xp6(2),h.ekj("deprecated-api-item","deprecated"===i.stability),h.Q6J("href",i.path,h.LSH),h.xp6(1),h.Gre("symbol ",i.docType,""),h.xp6(1),h.hij(" ",i.title," ")}}function w(t,e){if(1&t&&(h.TgZ(0,"ul",12),h.YNc(1,Z,5,7,"ng-container",8),h.qZA()),2&t){var i=h.oxw().$implicit;h.xp6(1),h.Q6J("ngForOf",i.items)}}function T(t,e){if(1&t&&(h.TgZ(0,"div"),h.YNc(1,k,3,4,"h2",9),h.YNc(2,w,2,1,"ul",10),h.qZA()),2&t){var i=e.$implicit;h.xp6(1),h.Q6J("ngIf",i.items),h.xp6(1),h.Q6J("ngIf",i.items&&i.items.length)}}var q,x=function e(){t(this,e),this.query="",this.status="all",this.type="all"},A=function(){var e=function(){function e(i,n){t(this,e),this.apiService=i,this.locationService=n,this.showStatusMenu=!1,this.showTypeMenu=!1,this.criteriaSubject=new c.t(1),this.searchCriteria=new x,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:"stable",title:"\u7a33\u5b9a"},{value:"deprecated",title:"\u5f03\u7528"},{value:"security-risk",title:"\u5b89\u5168\u98ce\u9669"}]}return i(e,[{key:"ngOnInit",value:function(){var t=this;this.filteredSections=(0,o.aj)([this.apiService.sections,this.criteriaSubject]).pipe((0,l.U)(function(t){return{sections:t[0],criteria:t[1]}}),(0,l.U)(function(e){return e.sections.map(function(i){return Object.assign(Object.assign({},i),{items:t.filterSection(i,e.criteria)})})})),this.initializeSearchCriteria()}},{key:"setQuery",value:function(t){this.setSearchCriteria({query:(t||"").toLowerCase().trim()})}},{key:"setStatus",value:function(t){this.toggleStatusMenu(),this.status=t,this.setSearchCriteria({status:t.value})}},{key:"setType",value:function(t){this.toggleTypeMenu(),this.type=t,this.setSearchCriteria({type:t.value})}},{key:"toggleStatusMenu",value:function(){this.showStatusMenu=!this.showStatusMenu}},{key:"toggleTypeMenu",value:function(){this.showTypeMenu=!this.showTypeMenu}},{key:"filterSection",value:function(t,e){var i=e.query,n=e.status,s=e.type,a=!i||-1!==t.name.indexOf(i),r=(t.items||[]).filter(function(t){return function(t){return"all"===s||s===t.docType}(t)&&function(t){return"all"===n||n===t.stability||"security-risk"===n&&t.securityRisk}(t)&&function(t){return a||-1!==t.name.indexOf(i)}(t)});return r.length?r:a&&"package"===s?[]:null}},{key:"initializeSearchCriteria",value:function(){var t=this.locationService.search(),e=t.query,i=t.status,n=t.type,s=(e||"").toLowerCase();this.queryEl.nativeElement.value=s,this.status=this.statuses.find(function(t){return t.value===i})||this.statuses[0],this.type=this.types.find(function(t){return t.value===n})||this.types[0],this.searchCriteria={query:s,status:this.status.value,type:this.type.value},this.criteriaSubject.next(this.searchCriteria)}},{key:"setLocationSearch",value:function(){var t=this.searchCriteria,e=t.query,i=t.status,n=t.type;this.locationService.setSearch("API \u641c\u7d22",{query:e||void 0,status:"all"!==i?i:void 0,type:"all"!==n?n:void 0})}},{key:"setSearchCriteria",value:function(t){this.criteriaSubject.next(Object.assign(this.searchCriteria,t)),this.setLocationSearch()}}]),e}();return e.\u0275fac=function(t){return new(t||e)(h.Y36(d),h.Y36(m.a))},e.\u0275cmp=h.Xpm({type:e,selectors:[["aio-api-list"]],viewQuery:function(t,e){var i;(1&t&&h.Gf(b,7),2&t)&&(h.iGM(i=h.CRH())&&(e.queryEl=i.first))},decls:11,vars:9,consts:[[1,"l-flex-wrap","api-filter"],["label","\u7c7b\u578b\uff1a",3,"options","selected","showSymbol","change"],["label","\u72b6\u6001\uff1a",3,"options","selected","disabled","change"],[1,"form-search"],["placeholder","\u8fc7\u6ee4","aria-label","Filter Search",3,"input"],["filter",""],[1,"material-icons"],[1,"api-list-container"],[4,"ngFor","ngForOf"],[4,"ngIf"],["class","api-list",4,"ngIf"],[3,"href"],[1,"api-list"],[1,"api-item"]],template:function(t,e){1&t&&(h.TgZ(0,"div",0),h.TgZ(1,"aio-select",1),h.NdJ("change",function(t){return e.setType(t.option)}),h.qZA(),h.TgZ(2,"aio-select",2),h.NdJ("change",function(t){return e.setStatus(t.option)}),h.qZA(),h.TgZ(3,"div",3),h.TgZ(4,"input",4,5),h.NdJ("input",function(t){return e.setQuery(t.target.value)}),h.qZA(),h.TgZ(6,"i",6),h._uU(7,"search"),h.qZA(),h.qZA(),h.qZA(),h.TgZ(8,"article",7),h.YNc(9,T,3,2,"div",8),h.ALo(10,"async"),h.qZA()),2&t&&(h.xp6(1),h.Q6J("options",e.types)("selected",e.type)("showSymbol",!0),h.xp6(1),h.Q6J("options",e.statuses)("selected",e.status)("disabled","package"===e.type.value),h.xp6(7),h.Q6J("ngForOf",h.lcZ(10,7,e.filteredSections)))},directives:[S.H,a.sg,a.O5],pipes:[a.Ov],encapsulation:2}),e}(),C=((q=function e(){t(this,e),this.customElementComponent=A}).\u0275fac=function(t){return new(t||q)},q.\u0275mod=h.oAB({type:q}),q.\u0275inj=h.cJS({providers:[d],imports:[[a.ez,u.m,r.JF]]}),q)}}])}();
//# sourceMappingURL=src_app_custom-elements_api_api-list_module_ts-es5.d9c36aa3d5321c3f76ac.js.map