-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_toc_toc_module_ts.bdebce87ae2ce760.js
2 lines (2 loc) · 4.54 KB
/
src_app_custom-elements_toc_toc_module_ts.bdebce87ae2ce760.js
1
2
"use strict";(self.webpackChunksite=self.webpackChunksite||[]).push([["src_app_custom-elements_toc_toc_module_ts"],{2848:(S,m,s)=>{s.r(m),s.d(m,{TocModule:()=>A});var a=s(3267),u=s(3700),v=s(3441),y=s(1416),h=s(9944),f=s(8788),C=s(4396),g=s(9248),t=s(5460),b=s(4528),E=s(1492);const T=["tocItem"];function x(e,c){1&e&&(t.I0R(0,"div",7),t.OEk(1," Contents "),t.C$Y())}function I(e,c){if(1&e){const n=t.KQA();t.I0R(0,"button",8),t.qCj("click",function(){t.usT(n);const i=t.GaO(2);return t.CGJ(i.toggle(!1))}),t.OEk(1," Contents "),t.wR5(2,"mat-icon",9),t.C$Y()}if(2&e){const n=t.GaO(2);t.e48("aria-pressed",!n.isCollapsed),t.yG2(2),t.eAK("collapsed",n.isCollapsed)}}function G(e,c){if(1&e&&(t.I0R(0,"li",11,12),t.wR5(2,"a",13),t.C$Y()),2&e){const n=t.GaO(),o=n.$implicit,i=n.index,l=t.GaO(2);t.m8U(o.level),t.eAK("secondary","EmbeddedExpandable"===l.type&&i>=l.primaryMax)("active",i===l.activeIndex),t._6D("title",o.title),t.yG2(2),t.E7m("href",o.href,t.K6U)("innerHTML",o.content,t.E3n)}}function _(e,c){if(1&e&&(t.SAx(0),t.yuY(1,G,3,10,"li",10),t.k70()),2&e){const n=c.$implicit,o=t.GaO(2);t.yG2(),t.E7m("ngIf","Floating"===o.type||"h1"!==n.level)}}function O(e,c){if(1&e){const n=t.KQA();t.I0R(0,"button",14),t.qCj("click",function(){t.usT(n);const i=t.GaO(2);return t.CGJ(i.toggle())}),t.C$Y()}if(2&e){const n=t.GaO(2);t.eAK("collapsed",n.isCollapsed),t.e48("aria-pressed",!n.isCollapsed)}}function M(e,c){if(1&e&&(t.I0R(0,"div",1),t.yuY(1,x,2,0,"div",2)(2,I,3,3,"button",3),t.I0R(3,"ul",4),t.yuY(4,_,2,1,"ng-container",5),t.C$Y(),t.yuY(5,O,1,3,"button",6),t.C$Y()),2&e){const n=t.GaO();t.eAK("collapsed",n.isCollapsed),t.yG2(),t.E7m("ngIf","EmbeddedSimple"===n.type),t.yG2(),t.E7m("ngIf","EmbeddedExpandable"===n.type),t.yG2(),t.eAK("embedded","Floating"!==n.type),t.yG2(),t.E7m("ngForOf",n.tocList),t.yG2(),t.E7m("ngIf","EmbeddedExpandable"===n.type)}}let R=(()=>{var e;class c{constructor(o,i,l){this.scrollService=o,this.tocService=l,this.activeIndex=null,this.type="None",this.isCollapsed=!0,this.isEmbedded=!1,this.onDestroy=new v.E,this.primaryMax=4,this.isEmbedded=-1!==i.nativeElement.className.indexOf("embedded")}ngOnInit(){this.tocService.tocList.pipe((0,f.a)(this.onDestroy)).subscribe(o=>{this.tocList=o;const i=function Y(e,c){return e.reduce((n,o)=>c(o)?n+1:n,0)}(this.tocList,l=>"h1"!==l.level);this.type=i>0?this.isEmbedded?i>this.primaryMax?"EmbeddedExpandable":"EmbeddedSimple":"Floating":"None"})}ngAfterViewInit(){this.isEmbedded||(0,y.E)([this.tocService.activeItemIndex.pipe((0,C.y)(h.u)),this.items.changes.pipe((0,g.W)(this.items))]).pipe((0,f.a)(this.onDestroy)).subscribe(([o,i])=>{if(this.activeIndex=o,null===o||o>=i.length)return;const l=i.toArray()[o].nativeElement,d=l.offsetParent,p=l.getBoundingClientRect(),r=d.getBoundingClientRect();p.top>=r.top&&p.bottom<=r.bottom||(d.scrollTop+=p.top-r.top-d.clientHeight/2)})}ngOnDestroy(){this.onDestroy.next()}toggle(o=!0){this.isCollapsed=!this.isCollapsed,o&&this.isCollapsed&&this.toTop()}toTop(){this.scrollService.scrollToTop()}}return(e=c).\u0275fac=function(o){return new(o||e)(t.GI1(b.w),t.GI1(t.GMv),t.GI1(E.c))},e.\u0275cmp=t.In1({type:e,selectors:[["aio-toc"]],viewQuery:function(o,i){if(1&o&&t.CC$(T,5),2&o){let l;t.wto(l=t.Gqi())&&(i.items=l)}},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(o,i){1&o&&t.yuY(0,M,6,8,"div",0),2&o&&t.E7m("ngIf","None"!==i.type)},dependencies:[a.ay,a.u_,u.qL],encapsulation:2}),c})(),A=(()=>{var e;class c{constructor(){this.customElementComponent=R}}return(e=c).\u0275fac=function(o){return new(o||e)},e.\u0275mod=t.a4G({type:e}),e.\u0275inj=t.s3X({imports:[a.MD,u.oB]}),c})()}}]);
//# sourceMappingURL=src_app_custom-elements_toc_toc_module_ts.bdebce87ae2ce760.js.map