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