-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsrc_app_custom-elements_toc_toc_module_ts.667dbb6f46186580.js
2 lines (2 loc) · 4.54 KB
/
src_app_custom-elements_toc_toc_module_ts.667dbb6f46186580.js
1
2
"use strict";(self.webpackChunksite=self.webpackChunksite||[]).push([["src_app_custom-elements_toc_toc_module_ts"],{2786:(S,r,s)=>{s.r(r),s.d(r,{TocModule:()=>J});var a=s(4666),m=s(1014),f=s(253),g=s(6562),x=s(3888),u=s(8951),h=s(4317),v=s(4874),t=s(2560),b=s(9026),T=s(6308);const y=["tocItem"];function C(o,i){1&o&&(t.TgZ(0,"div",7),t._uU(1," \u76ee\u5f55 "),t.qZA())}function E(o,i){if(1&o){const e=t.EpF();t.TgZ(0,"button",8),t.NdJ("click",function(){t.CHM(e);const c=t.oxw(2);return t.KtG(c.toggle(!1))}),t._uU(1," \u76ee\u5f55 "),t._UZ(2,"mat-icon",9),t.qZA()}if(2&o){const e=t.oxw(2);t.uIk("aria-pressed",!e.isCollapsed),t.xp6(2),t.ekj("collapsed",e.isCollapsed)}}function I(o,i){if(1&o&&(t.TgZ(0,"li",11,12),t._UZ(2,"a",13),t.qZA()),2&o){const e=t.oxw(),n=e.$implicit,c=e.index,l=t.oxw(2);t.Tol(n.level),t.ekj("secondary","EmbeddedExpandable"===l.type&&c>=l.primaryMax)("active",c===l.activeIndex),t.s9C("title",n.title),t.xp6(2),t.Q6J("href",n.href,t.LSH)("innerHTML",n.content,t.oJD)}}function _(o,i){if(1&o&&(t.ynx(0),t.YNc(1,I,3,10,"li",10),t.BQk()),2&o){const e=i.$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("ngIf","Floating"===n.type||"h1"!==e.level)}}function Z(o,i){if(1&o){const e=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(e);const c=t.oxw(2);return t.KtG(c.toggle())}),t.qZA()}if(2&o){const e=t.oxw(2);t.ekj("collapsed",e.isCollapsed),t.uIk("aria-pressed",!e.isCollapsed)}}function F(o,i){if(1&o&&(t.TgZ(0,"div",1),t.YNc(1,C,2,0,"div",2),t.YNc(2,E,3,3,"button",3),t.TgZ(3,"ul",4),t.YNc(4,_,2,1,"ng-container",5),t.qZA(),t.YNc(5,Z,1,3,"button",6),t.qZA()),2&o){const e=t.oxw();t.ekj("collapsed",e.isCollapsed),t.xp6(1),t.Q6J("ngIf","EmbeddedSimple"===e.type),t.xp6(1),t.Q6J("ngIf","EmbeddedExpandable"===e.type),t.xp6(1),t.ekj("embedded","Floating"!==e.type),t.xp6(1),t.Q6J("ngForOf",e.tocList),t.xp6(1),t.Q6J("ngIf","EmbeddedExpandable"===e.type)}}let M=(()=>{class o{constructor(e,n,c){this.scrollService=e,this.tocService=c,this.activeIndex=null,this.type="None",this.isCollapsed=!0,this.isEmbedded=!1,this.onDestroy=new f.x,this.primaryMax=4,this.isEmbedded=-1!==n.nativeElement.className.indexOf("embedded")}ngOnInit(){this.tocService.tocList.pipe((0,u.R)(this.onDestroy)).subscribe(e=>{this.tocList=e;const n=function N(o,i){return o.reduce((e,n)=>i(n)?e+1:e,0)}(this.tocList,c=>"h1"!==c.level);this.type=n>0?this.isEmbedded?n>this.primaryMax?"EmbeddedExpandable":"EmbeddedSimple":"Floating":"None"})}ngAfterViewInit(){this.isEmbedded||(0,g.a)([this.tocService.activeItemIndex.pipe((0,h.R)(x.E)),this.items.changes.pipe((0,v.O)(this.items))]).pipe((0,u.R)(this.onDestroy)).subscribe(([e,n])=>{if(this.activeIndex=e,null===e||e>=n.length)return;const c=n.toArray()[e].nativeElement,l=c.offsetParent,d=c.getBoundingClientRect(),p=l.getBoundingClientRect();d.top>=p.top&&d.bottom<=p.bottom||(l.scrollTop+=d.top-p.top-l.clientHeight/2)})}ngOnDestroy(){this.onDestroy.next()}toggle(e=!0){this.isCollapsed=!this.isCollapsed,e&&this.isCollapsed&&this.toTop()}toTop(){this.scrollService.scrollToTop()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(b.a),t.Y36(t.SBq),t.Y36(T.I))},o.\u0275cmp=t.Xpm({type:o,selectors:[["aio-toc"]],viewQuery:function(e,n){if(1&e&&t.Gf(y,5),2&e){let c;t.iGM(c=t.CRH())&&(n.items=c)}},decls:1,vars:1,consts:[["class","toc-inner no-print",3,"collapsed",4,"ngIf"],[1,"toc-inner","no-print"],["class","toc-heading embedded",4,"ngIf"],["type","button","class","toc-heading embedded secondary","title","Expand/collapse contents","aria-label","Expand/collapse contents",3,"click",4,"ngIf"],[1,"toc-list"],[4,"ngFor","ngForOf"],["type","button","class","toc-more-items embedded material-icons","title","Expand/collapse contents","aria-label","Expand/collapse contents",3,"collapsed","click",4,"ngIf"],[1,"toc-heading","embedded"],["type","button","title","Expand/collapse contents","aria-label","Expand/collapse contents",1,"toc-heading","embedded","secondary",3,"click"],["svgIcon","keyboard_arrow_right",1,"rotating-icon"],[3,"title","class","secondary","active",4,"ngIf"],[3,"title"],["tocItem",""],[3,"href","innerHTML"],["type","button","title","Expand/collapse contents","aria-label","Expand/collapse contents",1,"toc-more-items","embedded","material-icons",3,"click"]],template:function(e,n){1&e&&t.YNc(0,F,6,8,"div",0),2&e&&t.Q6J("ngIf","None"!==n.type)},dependencies:[a.sg,a.O5,m.Hw],encapsulation:2}),o})(),J=(()=>{class o{constructor(){this.customElementComponent=M}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[a.ez,m.Ps]}),o})()}}]);
//# sourceMappingURL=src_app_custom-elements_toc_toc_module_ts.667dbb6f46186580.js.map