-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_toc_toc_module_ts.bdebce87ae2ce760.js.map
1 lines (1 loc) · 9.11 KB
/
src_app_custom-elements_toc_toc_module_ts.bdebce87ae2ce760.js.map
1
{"version":3,"file":"src_app_custom-elements_toc_toc_module_ts.bdebce87ae2ce760.js","mappings":"+TAEEA,MAAA,WACEA,MAAA,gBACFA,iDAEAA,MAAA,cAA4DA,MAAA,mBAAAA,MAAAC,GAAA,MAAAC,EAAAF,MAAA,UAASA,MAAAE,EAAAC,QAAO,GAAM,GAKhFH,MAAA,gBACAA,MAAA,gBACFA,iCAHEA,MAAA,gBAAAI,EAAAC,aAE+DL,MAAA,GAAAA,MAAA,YAAAI,EAAAC,uCAK7DL,MAAA,cAEEA,MAAA,UACFA,iEAFEA,MAAAM,EAAAC,OAAsBP,MAAA,mCAAAQ,EAAAC,MAAAC,GAAAF,EAAAG,WAAAX,CAAoE,SAAAU,IAAAF,EAAAI,aAD/EZ,MAAA,QAAAM,EAAAO,OAERb,MAAA,GAAAA,MAAA,OAAAM,EAAAQ,KAAAd,OAAiB,YAAAM,EAAAS,QAAAf,iCAHxBA,MAAA,GACEA,MAAA,EAAAgB,EAAA,cAIFhB,6CAJsCA,cAAA,oBAAAiB,EAAAR,MAAA,OAAAH,EAAAC,gDAOxCP,MAAA,eAA4DA,MAAA,mBAAAA,MAAAkB,GAAA,MAAAC,EAAAnB,MAAA,UAASA,MAAAmB,EAAAhB,SAAQ,GAK7EH,iCAJiDA,MAAA,YAAAoB,EAAAf,aAG/CL,MAAA,gBAAAoB,EAAAf,uCA5BJL,MAAA,WAEEA,MAAA,EAAAqB,EAAA,YAAArB,CAEM,EAAAsB,EAAA,gBAWNtB,MAAA,UACEA,MAAA,EAAAuB,EAAA,sBAMFvB,QAEAA,MAAA,EAAAwB,EAAA,gBAMFxB,8BA9BwDA,MAAA,YAAAyB,EAAApB,aAEhDL,cAAA,0BAAAyB,EAAAhB,MAIGT,cAAA,8BAAA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AGpEN,EAAEO,WAAcL,EAAMG,IAAMD,EAAMC,IAAQL,EAAEQ,aAAe,IAI/E,CAEAC,cACIvC,KAAKE,UAAUsC,MACnB,CAEAtE,OAAOuE,GAAY,GACfzC,KAAK5B,aAAe4B,KAAK5B,YACrBqE,GAAazC,KAAK5B,aAClB4B,KAAK0C,OAEb,CAEAA,QACI1C,KAAKH,cAAc8C,aACvB,WA5ESjD,0CAAY3B,MAAA6E,KAAA7E,mBAAA8E,KAAA,0BAAZnD,EAAYoD,UAAA,cAAAC,UAAA,SAAAC,EAAAC,MAAA,EAAAD,6iCDdzBjF,MAAA,EAAAmF,EAAA,kBAAMnF,MAAA,gBAAAkF,EAAAzE,uDCcOkB,CAAY,KCJZyD,EAAS,UAAAC,EAAhB,MAAOD,EAJbvD,cAKII,KAAAqD,uBAAoC3D,YAD3ByD,yCAAS,0BAATA,gCAHCG,KAAcC,QAGfJ,CAAS","names":["i0","_r6","ctx_r5","toggle","ctx_r2","isCollapsed","toc_r7","level","ctx_r9","type","i_r8","primaryMax","activeIndex","title","href","content","TocComponent_div_0_ng_container_4_li_1_Template","ctx_r3","_r13","ctx_r12","ctx_r4","TocComponent_div_0_div_1_Template","TocComponent_div_0_button_2_Template","TocComponent_div_0_ng_container_4_Template","TocComponent_div_0_button_5_Template","ctx_r0","tocList","TocComponent","_TocComponent","constructor","scrollService","elementRef","tocService","this","isEmbedded","onDestroy","Subject","nativeElement","className","indexOf","ngOnInit","pipe","takeUntil","subscribe","itemCount","count","array","fn","reduce","result","item","ngAfterViewInit","combineLatest","activeItemIndex","subscribeOn","asap","items","changes","startWith","index","length","e","toArray","p","offsetParent","eRect","getBoundingClientRect","pRect","top","bottom","scrollTop","clientHeight","ngOnDestroy","next","canScroll","toTop","scrollToTop","i1","i2","selectors","viewQuery","rf","ctx","TocComponent_div_0_Template","TocModule","_TocModule","customElementComponent","CommonModule","MatIconModule"],"sourceRoot":"webpack:///","sources":["./src/app/custom-elements/toc/toc.component.html","./src/app/custom-elements/toc/toc.component.ts","./src/app/custom-elements/toc/toc.module.ts"],"sourcesContent":["<div *ngIf=\"type !== 'None'\" class=\"toc-inner no-print\" [class.collapsed]=\"isCollapsed\">\n\n <div *ngIf=\"type === 'EmbeddedSimple'\" class=\"toc-heading embedded\">\n Contents\n </div>\n\n <button *ngIf=\"type === 'EmbeddedExpandable'\" type=\"button\" (click)=\"toggle(false)\"\n class=\"toc-heading embedded secondary\"\n title=\"Expand/collapse contents\"\n aria-label=\"Expand/collapse contents\"\n [attr.aria-pressed]=\"!isCollapsed\">\n Contents\n <mat-icon class=\"rotating-icon\" svgIcon=\"keyboard_arrow_right\" [class.collapsed]=\"isCollapsed\"></mat-icon>\n </button>\n\n <ul class=\"toc-list\" [class.embedded]=\"type !== 'Floating'\">\n <ng-container *ngFor=\"let toc of tocList; let i = index\">\n <li #tocItem title=\"{{toc.title}}\" *ngIf=\"type === 'Floating' || toc.level !== 'h1'\"\n class=\"{{toc.level}}\" [class.secondary]=\"type === 'EmbeddedExpandable' && i >= primaryMax\" [class.active]=\"i === activeIndex\">\n <a [href]=\"toc.href\" [innerHTML]=\"toc.content\"></a>\n </li>\n </ng-container>\n </ul>\n\n <button *ngIf=\"type === 'EmbeddedExpandable'\" type=\"button\" (click)=\"toggle()\"\n class=\"toc-more-items embedded material-icons\" [class.collapsed]=\"isCollapsed\"\n title=\"Expand/collapse contents\"\n aria-label=\"Expand/collapse contents\"\n [attr.aria-pressed]=\"!isCollapsed\">\n </button>\n</div>\n","import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core';\nimport { asapScheduler as asap, combineLatest, Subject } from 'rxjs';\nimport { startWith, subscribeOn, takeUntil } from 'rxjs/operators';\n\nimport { ScrollService } from 'app/shared/scroll.service';\nimport { TocItem, TocService } from 'app/shared/toc.service';\n\ntype TocType = 'None' | 'Floating' | 'EmbeddedSimple' | 'EmbeddedExpandable';\n\n@Component({\n selector: 'aio-toc',\n templateUrl: 'toc.component.html',\n styles: []\n})\nexport class TocComponent implements OnInit, AfterViewInit, OnDestroy {\n\n activeIndex: number | null = null;\n type: TocType = 'None';\n isCollapsed = true;\n isEmbedded = false;\n @ViewChildren('tocItem') private items: QueryList<ElementRef>;\n private onDestroy = new Subject<void>();\n private primaryMax = 4;\n tocList: TocItem[];\n\n constructor(\n private scrollService: ScrollService,\n elementRef: ElementRef,\n private tocService: TocService) {\n this.isEmbedded = elementRef.nativeElement.className.indexOf('embedded') !== -1;\n }\n\n ngOnInit() {\n this.tocService.tocList\n .pipe(takeUntil(this.onDestroy))\n .subscribe(tocList => {\n this.tocList = tocList;\n const itemCount = count(this.tocList, item => item.level !== 'h1');\n\n this.type = (itemCount > 0) ?\n this.isEmbedded ?\n (itemCount > this.primaryMax) ?\n 'EmbeddedExpandable' :\n 'EmbeddedSimple' :\n 'Floating' :\n 'None';\n });\n }\n\n ngAfterViewInit() {\n if (!this.isEmbedded) {\n // We use the `asap` scheduler because updates to `activeItemIndex` are triggered by DOM changes,\n // which, in turn, are caused by the rendering that happened due to a ChangeDetection.\n // Without asap, we would be updating the model while still in a ChangeDetection handler, which is disallowed by Angular.\n combineLatest([this.tocService.activeItemIndex.pipe(subscribeOn(asap)), this.items.changes.pipe(startWith(this.items))])\n .pipe(takeUntil(this.onDestroy))\n .subscribe(([index, items]) => {\n this.activeIndex = index;\n if (index === null || index >= items.length) {\n return;\n }\n\n const e = items.toArray()[index].nativeElement;\n const p = e.offsetParent;\n\n const eRect = e.getBoundingClientRect();\n const pRect = p.getBoundingClientRect();\n\n const isInViewport = (eRect.top >= pRect.top) && (eRect.bottom <= pRect.bottom);\n\n if (!isInViewport) {\n p.scrollTop += (eRect.top - pRect.top) - (p.clientHeight / 2);\n }\n });\n }\n }\n\n ngOnDestroy() {\n this.onDestroy.next();\n }\n\n toggle(canScroll = true) {\n this.isCollapsed = !this.isCollapsed;\n if (canScroll && this.isCollapsed) {\n this.toTop();\n }\n }\n\n toTop() {\n this.scrollService.scrollToTop();\n }\n}\n\nfunction count<T>(array: T[], fn: (item: T) => boolean) {\n return array.reduce((result, item) => fn(item) ? result + 1 : result, 0);\n}\n","import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { WithCustomElementComponent } from '../element-registry';\nimport { TocComponent } from './toc.component';\n\n@NgModule({\n imports: [CommonModule, MatIconModule],\n declarations: [TocComponent],\n})\nexport class TocModule implements WithCustomElementComponent {\n customElementComponent: Type<any> = TocComponent;\n}\n"],"x_google_ignoreList":[]}