@ng-doc/app 22.0.0-beta.2 → 22.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -29
- package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs +363 -0
- package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs.map +1 -0
- package/fesm2022/ng-doc-app-classes-content-controller.mjs +299 -0
- package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -0
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +51 -35
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes.mjs +2 -0
- package/fesm2022/ng-doc-app-classes.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-api-list.mjs +173 -69
- package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs +13 -10
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-code.mjs +152 -25
- package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-command-palette.mjs +498 -0
- package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-copy-button.mjs +38 -21
- package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs +36 -29
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-frame.mjs +96 -0
- package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-demo-pane.mjs +39 -36
- package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo.mjs +175 -44
- package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +12 -9
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +79 -0
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs +54 -21
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-image-viewer.mjs +183 -89
- package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-kind-icon.mjs +42 -25
- package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-link.mjs +12 -9
- package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-members.mjs +30 -0
- package/fesm2022/ng-doc-app-components-members.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +61 -20
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-navbar.mjs +39 -49
- package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-header.mjs +73 -10
- package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-link.mjs +123 -31
- package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-navigation.mjs +17 -19
- package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs +56 -35
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page.mjs +168 -24
- package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-playground.mjs +477 -286
- package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-root.mjs +48 -31
- package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search-result.mjs +22 -21
- package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search.mjs +64 -33
- package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-sidebar.mjs +86 -61
- package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-tabs.mjs +35 -11
- package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs +33 -21
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-toc.mjs +267 -90
- package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components.mjs +4 -1
- package/fesm2022/ng-doc-app-components.mjs.map +1 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs +2 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-demo-app.mjs +176 -0
- package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -0
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs +11 -5
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-members-filter.mjs +276 -0
- package/fesm2022/ng-doc-app-directives-members-filter.mjs.map +1 -0
- package/fesm2022/ng-doc-app-directives-route-active.mjs +34 -30
- package/fesm2022/ng-doc-app-directives-route-active.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives.mjs +1 -0
- package/fesm2022/ng-doc-app-directives.mjs.map +1 -1
- package/fesm2022/ng-doc-app-helpers.mjs +307 -2
- package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs +6 -4
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-extract-value.mjs +6 -4
- package/fesm2022/ng-doc-app-pipes-extract-value.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs +7 -4
- package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs +8 -5
- package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-page-processor.mjs +86 -23
- package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs +26 -25
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors.mjs +42 -10
- package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +31 -2
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-title.mjs +129 -0
- package/fesm2022/ng-doc-app-providers-title.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers.mjs +1 -0
- package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +122 -0
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-content-state.mjs +57 -0
- package/fesm2022/ng-doc-app-services-content-state.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-fullscreen-route.mjs +74 -0
- package/fesm2022/ng-doc-app-services-fullscreen-route.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-highlighter.mjs +90 -17
- package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-route-preloader.mjs +384 -0
- package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-shortcuts.mjs +214 -0
- package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-sidebar.mjs +59 -25
- package/fesm2022/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-store.mjs +8 -8
- package/fesm2022/ng-doc-app-services-store.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-theme.mjs +32 -12
- package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services.mjs +143 -0
- package/fesm2022/ng-doc-app-services.mjs.map +1 -1
- package/fesm2022/ng-doc-app-tokens.mjs +7 -28
- package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs +18 -9
- package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs +12 -9
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs +12 -9
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +59 -18
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/package.json +82 -28
- package/styles/global.css +1128 -201
- package/styles/main.css +1128 -201
- package/styles/themes/dark.css +88 -56
- package/types/ng-doc-app-classes-content-anchor-controller.d.ts +54 -0
- package/types/ng-doc-app-classes-content-controller.d.ts +94 -0
- package/types/ng-doc-app-classes-default-search-engine.d.ts +9 -1
- package/types/ng-doc-app-classes-root-page.d.ts +14 -1
- package/types/ng-doc-app-classes-search-engine.d.ts +5 -0
- package/types/ng-doc-app-classes.d.ts +2 -0
- package/types/ng-doc-app-components-api-list.d.ts +69 -20
- package/types/ng-doc-app-components-breadcrumb.d.ts +8 -3
- package/types/ng-doc-app-components-code.d.ts +46 -12
- package/types/ng-doc-app-components-command-palette.d.ts +147 -0
- package/types/ng-doc-app-components-copy-button.d.ts +18 -6
- package/types/ng-doc-app-components-demo-displayer.d.ts +23 -10
- package/types/ng-doc-app-components-demo-frame.d.ts +48 -0
- package/types/ng-doc-app-components-demo-pane.d.ts +19 -15
- package/types/ng-doc-app-components-demo.d.ts +80 -15
- package/types/ng-doc-app-components-fullscreen-button.d.ts +4 -2
- package/types/ng-doc-app-components-fullscreen-toggle.d.ts +24 -0
- package/types/ng-doc-app-components-heading-anchor.d.ts +26 -7
- package/types/ng-doc-app-components-image-viewer.d.ts +71 -7
- package/types/ng-doc-app-components-kind-icon.d.ts +28 -7
- package/types/ng-doc-app-components-link.d.ts +6 -2
- package/types/ng-doc-app-components-members.d.ts +13 -0
- package/types/ng-doc-app-components-mermaid-viewer.d.ts +21 -6
- package/types/ng-doc-app-components-navbar.d.ts +25 -15
- package/types/ng-doc-app-components-page-header.d.ts +28 -4
- package/types/ng-doc-app-components-page-link.d.ts +34 -15
- package/types/ng-doc-app-components-page-navigation.d.ts +10 -5
- package/types/ng-doc-app-components-page-wrapper.d.ts +35 -11
- package/types/ng-doc-app-components-page.d.ts +57 -6
- package/types/ng-doc-app-components-playground.d.ts +167 -78
- package/types/ng-doc-app-components-root.d.ts +28 -7
- package/types/ng-doc-app-components-search-result.d.ts +14 -6
- package/types/ng-doc-app-components-search.d.ts +19 -7
- package/types/ng-doc-app-components-tabs.d.ts +24 -5
- package/types/ng-doc-app-components-theme-toggle.d.ts +18 -5
- package/types/ng-doc-app-components-toc.d.ts +76 -29
- package/types/ng-doc-app-components.d.ts +4 -1
- package/types/ng-doc-app-demo-app.d.ts +89 -0
- package/types/ng-doc-app-directives-code-highlighter.d.ts +8 -4
- package/types/ng-doc-app-directives-members-filter.d.ts +61 -0
- package/types/ng-doc-app-directives-route-active.d.ts +21 -7
- package/types/ng-doc-app-directives.d.ts +1 -0
- package/types/ng-doc-app-helpers.d.ts +142 -3
- package/types/ng-doc-app-interfaces.d.ts +62 -31
- package/types/ng-doc-app-pipes-decode-uri-component.d.ts +3 -0
- package/types/ng-doc-app-pipes-extract-value.d.ts +3 -0
- package/types/ng-doc-app-pipes-filter-by-text.d.ts +4 -0
- package/types/ng-doc-app-pipes-sanitize-html.d.ts +4 -2
- package/types/ng-doc-app-processors-page-processor.d.ts +39 -10
- package/types/ng-doc-app-processors-processors-tooltip.d.ts +11 -10
- package/types/ng-doc-app-processors-processors.d.ts +10 -1
- package/types/ng-doc-app-providers-ng-doc-app.d.ts +18 -1
- package/types/ng-doc-app-providers-title.d.ts +59 -0
- package/types/ng-doc-app-providers.d.ts +1 -0
- package/types/ng-doc-app-services-content-scroll-intent.d.ts +52 -0
- package/types/ng-doc-app-services-content-state.d.ts +40 -0
- package/types/ng-doc-app-services-fullscreen-route.d.ts +35 -0
- package/types/ng-doc-app-services-highlighter.d.ts +47 -5
- package/types/ng-doc-app-services-route-preloader.d.ts +121 -0
- package/types/ng-doc-app-services-shortcuts.d.ts +96 -0
- package/types/ng-doc-app-services-sidebar.d.ts +24 -4
- package/types/ng-doc-app-services-store.d.ts +24 -1
- package/types/ng-doc-app-services-theme.d.ts +19 -3
- package/types/ng-doc-app-services.d.ts +77 -0
- package/types/ng-doc-app-tokens.d.ts +10 -30
- package/types/ng-doc-app-type-controls-boolean-control.d.ts +11 -6
- package/types/ng-doc-app-type-controls-number-control.d.ts +5 -3
- package/types/ng-doc-app-type-controls-string-control.d.ts +5 -3
- package/types/ng-doc-app-type-controls-type-alias-control.d.ts +35 -6
- package/fesm2022/ng-doc-app-components-search-dialog.mjs +0 -78
- package/fesm2022/ng-doc-app-components-search-dialog.mjs.map +0 -1
- package/types/ng-doc-app-components-search-dialog.d.ts +0 -28
|
@@ -1,95 +1,120 @@
|
|
|
1
1
|
import { Location, NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, booleanAttribute, linkedSignal, inject, ChangeDetectionStrategy, Component, computed } from '@angular/core';
|
|
4
4
|
import { NG_DOC_CONTEXT } from '@ng-doc/app/tokens';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { NgDocExpanderComponent, NgDocExecutePipe, NgDocBindPipe } from '@ng-doc/ui-kit';
|
|
6
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
+
import { Router, NavigationEnd, RouterLinkActive, RouterLink } from '@angular/router';
|
|
7
8
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
8
|
-
import {
|
|
9
|
+
import { filter } from 'rxjs/operators';
|
|
9
10
|
|
|
11
|
+
let nextId = 0;
|
|
12
|
+
/**
|
|
13
|
+
* A category of the sidebar: a header row that expands and collapses the pages below it.
|
|
14
|
+
*
|
|
15
|
+
* An expandable category opens by itself when the reader navigates to one of its pages.
|
|
16
|
+
*/
|
|
10
17
|
class NgDocSidebarCategoryComponent {
|
|
11
18
|
constructor() {
|
|
12
|
-
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
19
|
+
/** The category. */
|
|
20
|
+
this.category = input.required(/* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "category" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/** Whether the category sits at the top level of the sidebar. */
|
|
23
|
+
this.isRoot = input(false, { ...(ngDevMode ? { debugName: "isRoot" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
24
|
+
/** The pages and categories inside the category. */
|
|
25
|
+
this.content = input('', /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** Whether the reader can collapse the category. A category that cannot is always open. */
|
|
28
|
+
this.expandable = input(true, { ...(ngDevMode ? { debugName: "expandable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
29
|
+
/** Whether the category starts open. */
|
|
30
|
+
this.expanded = input(true, { ...(ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
31
|
+
/** Whether the category is open: it starts from `expanded` and follows the reader. */
|
|
32
|
+
this.isExpanded = linkedSignal(() => this.expanded() || !this.expandable(), /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "isExpanded" }] : /* istanbul ignore next */ []));
|
|
34
|
+
/** Id of the element that holds the pages, for the header's `aria-controls`. */
|
|
35
|
+
this.childrenId = `ng-doc-sidebar-category-${nextId++}`;
|
|
36
|
+
const router = inject(Router);
|
|
37
|
+
router.events
|
|
38
|
+
.pipe(filter((event) => event instanceof NavigationEnd), takeUntilDestroyed())
|
|
39
|
+
.subscribe(() => {
|
|
40
|
+
const route = this.category().route ?? '';
|
|
41
|
+
if (router.url.includes(route)) {
|
|
20
42
|
this.expand();
|
|
21
43
|
}
|
|
22
44
|
});
|
|
23
45
|
}
|
|
46
|
+
/** Opens the category if it is open, or closes it otherwise. */
|
|
24
47
|
toggle() {
|
|
25
|
-
this.
|
|
48
|
+
this.isExpanded() ? this.collapse() : this.expand();
|
|
26
49
|
}
|
|
50
|
+
/** Opens the category. */
|
|
27
51
|
expand() {
|
|
28
|
-
if (this.
|
|
29
|
-
this.
|
|
30
|
-
this.changeDetectorRef.markForCheck();
|
|
52
|
+
if (this.expandable()) {
|
|
53
|
+
this.isExpanded.set(true);
|
|
31
54
|
}
|
|
32
55
|
}
|
|
56
|
+
/** Closes the category, unless it cannot be collapsed. */
|
|
33
57
|
collapse() {
|
|
34
|
-
if (this.
|
|
35
|
-
this.
|
|
36
|
-
this.changeDetectorRef.markForCheck();
|
|
58
|
+
if (this.expandable()) {
|
|
59
|
+
this.isExpanded.set(false);
|
|
37
60
|
}
|
|
38
61
|
}
|
|
39
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
40
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
62
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
63
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocSidebarCategoryComponent, isStandalone: true, selector: "ng-doc-sidebar-category", inputs: { category: { classPropertyName: "category", publicName: "category", isSignal: true, isRequired: true, transformFunction: null }, isRoot: { classPropertyName: "isRoot", publicName: "isRoot", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, expandable: { classPropertyName: "expandable", publicName: "expandable", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-ng-doc-is-root": "isRoot()", "attr.data-ng-doc-expandable": "expandable()", "attr.data-ng-doc-expanded": "isExpanded()" } }, ngImport: i0, template: "@if (expandable()) {\n <button\n type=\"button\"\n class=\"ng-doc-sidebar-category-button\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"childrenId\"\n (click)=\"toggle()\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n <svg\n class=\"ng-doc-sidebar-category-chevron\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n} @else {\n <div class=\"ng-doc-sidebar-category-button\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n </div>\n}\n<ng-doc-expander [expanded]=\"isExpanded()\" [content]=\"contentTemplate\" collapseMod=\"hide\" />\n<ng-template #contentTemplate>\n <!-- The content comes through a template, so the child components keep their state. -->\n <div class=\"ng-doc-sidebar-category-children\" [id]=\"childrenId\">\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;--ng-doc-sidebar-category-indent: calc(var(--ng-doc-sidebar-item-indent) + var(--ng-doc-space-3))}.ng-doc-sidebar-category-button{display:flex;align-items:center;gap:var(--ng-doc-space-2);width:100%;min-height:32px;padding:var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-space-2) var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-sidebar-item-indent);border:0;border-radius:var(--ng-doc-radius-md);background:none;color:var(--ng-doc-heading-color);font:inherit;font-weight:600;text-align:left}button.ng-doc-sidebar-category-button{cursor:pointer;transition:background var(--ng-doc-transition)}button.ng-doc-sidebar-category-button:hover{background:var(--ng-doc-hover-background)}button.ng-doc-sidebar-category-button:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ng-doc-primary)}.ng-doc-sidebar-category-title{min-width:0;overflow-wrap:anywhere}.ng-doc-sidebar-category-chevron{flex:none;margin-left:auto;color:var(--ng-doc-text-muted);transform:rotate(-90deg);transition:transform var(--ng-doc-transition) var(--ng-doc-easing)}[aria-expanded=true]>.ng-doc-sidebar-category-chevron{transform:none}.ng-doc-sidebar-category-children{display:grid;gap:1px;padding-top:2px;--ng-doc-sidebar-item-indent: var(--ng-doc-sidebar-category-indent)}@media(prefers-reduced-motion:reduce){.ng-doc-sidebar-category-chevron{transition:none}}\n"], dependencies: [{ kind: "component", type: NgDocExpanderComponent, selector: "ng-doc-expander", inputs: ["expanded", "content", "collapseMod"], outputs: ["expandedChange"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
41
64
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarCategoryComponent, decorators: [{
|
|
43
66
|
type: Component,
|
|
44
|
-
args: [{ selector: 'ng-doc-sidebar-category', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
NgDocRotatorDirective,
|
|
51
|
-
NgDocExpanderComponent,
|
|
52
|
-
PolymorpheusOutlet,
|
|
53
|
-
], template: "<div class=\"ng-doc-sidebar-category-wrapper\">\n <button class=\"ng-doc-sidebar-category-button\" (click)=\"toggle()\">\n <div class=\"ng-doc-sidebar-category\" [ngDocRouteActive]=\"category.route\" activeClass=\"active\">\n @if (!expandable) {\n <ng-doc-dot></ng-doc-dot>\n }\n <span ng-doc-text>\n @if (category.expandable) {\n <ng-doc-icon icon=\"chevron-right\" [ngDocRotator]=\"expanded\" ngDocTextLeft> </ng-doc-icon>\n }\n {{ category.title }}\n </span>\n </div>\n <!--\t\t<div ng-doc-text color=\"muted\" size=\"small\">Some description</div>-->\n </button>\n <ng-doc-expander [expanded]=\"expanded\" [content]=\"contentTemplate\" collapseMod=\"hide\" />\n <ng-template #contentTemplate>\n <div class=\"ng-doc-sidebar-category-children\">\n <!--We wrap content via ng-template to save state of the child components -->\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n </div>\n </ng-template>\n</div>\n", styles: [":host{display:flex;flex-direction:column;--ng-doc-sidebar-category-indent: calc( var(--ng-doc-sidebar-item-indent) + calc(var(--ng-doc-base-gutter) * 2) );--ng-doc-icon-color: var(--ng-doc-text)}:host[data-ng-doc-expandable=false] .ng-doc-sidebar-category-button{padding:var(--ng-doc-sidebar-vetical-padding) var(--ng-doc-base-gutter) var(--ng-doc-sidebar-vetical-padding) var(--ng-doc-sidebar-item-indent)}:host[data-ng-doc-expandable=true] .ng-doc-sidebar-category-button{padding:var(--ng-doc-sidebar-vetical-padding) var(--ng-doc-base-gutter) var(--ng-doc-sidebar-vetical-padding) var(--ng-doc-sidebar-item-indent);cursor:pointer;border-radius:var(--ng-doc-base-gutter)}:host[data-ng-doc-expandable=true] .ng-doc-sidebar-category-button:hover{background-color:var(--ng-doc-base-1)}:host .ng-doc-sidebar-category-button{display:flex;flex-direction:column;border:unset;background-color:unset;width:100%}:host .ng-doc-sidebar-category-button .ng-doc-sidebar-category{display:flex;align-items:center;--ng-doc-dot-background: var(--ng-doc-base-4);--ng-doc-text: var(--ng-doc-heading-color)}:host .ng-doc-sidebar-category-button .ng-doc-sidebar-category ng-doc-dot{margin-right:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-sidebar-category-button .ng-doc-sidebar-category.active{--ng-doc-font-weight: 600;--ng-doc-dot-background: var(--ng-doc-primary)}:host .ng-doc-sidebar-category-button span[ng-doc-text]{flex-shrink:0;margin-right:var(--ng-doc-base-gutter)}:host .ng-doc-sidebar-category-children{padding-bottom:calc(var(--ng-doc-base-gutter) * 2);--ng-doc-sidebar-item-indent: var(--ng-doc-sidebar-category-indent)}\n"] }]
|
|
54
|
-
}], ctorParameters: () => [], propDecorators: { category: [{
|
|
55
|
-
type: Input,
|
|
56
|
-
args: [{ required: true }]
|
|
57
|
-
}], isRoot: [{
|
|
58
|
-
type: Input
|
|
59
|
-
}, {
|
|
60
|
-
type: HostBinding,
|
|
61
|
-
args: ['attr.data-ng-doc-is-root']
|
|
62
|
-
}], content: [{
|
|
63
|
-
type: Input
|
|
64
|
-
}], expandable: [{
|
|
65
|
-
type: Input
|
|
66
|
-
}, {
|
|
67
|
-
type: HostBinding,
|
|
68
|
-
args: ['attr.data-ng-doc-expandable']
|
|
69
|
-
}], expanded: [{
|
|
70
|
-
type: Input
|
|
71
|
-
}] } });
|
|
67
|
+
args: [{ selector: 'ng-doc-sidebar-category', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocExpanderComponent, PolymorpheusOutlet], host: {
|
|
68
|
+
'[attr.data-ng-doc-is-root]': 'isRoot()',
|
|
69
|
+
'[attr.data-ng-doc-expandable]': 'expandable()',
|
|
70
|
+
'[attr.data-ng-doc-expanded]': 'isExpanded()',
|
|
71
|
+
}, template: "@if (expandable()) {\n <button\n type=\"button\"\n class=\"ng-doc-sidebar-category-button\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"childrenId\"\n (click)=\"toggle()\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n <svg\n class=\"ng-doc-sidebar-category-chevron\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n} @else {\n <div class=\"ng-doc-sidebar-category-button\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n </div>\n}\n<ng-doc-expander [expanded]=\"isExpanded()\" [content]=\"contentTemplate\" collapseMod=\"hide\" />\n<ng-template #contentTemplate>\n <!-- The content comes through a template, so the child components keep their state. -->\n <div class=\"ng-doc-sidebar-category-children\" [id]=\"childrenId\">\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;--ng-doc-sidebar-category-indent: calc(var(--ng-doc-sidebar-item-indent) + var(--ng-doc-space-3))}.ng-doc-sidebar-category-button{display:flex;align-items:center;gap:var(--ng-doc-space-2);width:100%;min-height:32px;padding:var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-space-2) var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-sidebar-item-indent);border:0;border-radius:var(--ng-doc-radius-md);background:none;color:var(--ng-doc-heading-color);font:inherit;font-weight:600;text-align:left}button.ng-doc-sidebar-category-button{cursor:pointer;transition:background var(--ng-doc-transition)}button.ng-doc-sidebar-category-button:hover{background:var(--ng-doc-hover-background)}button.ng-doc-sidebar-category-button:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ng-doc-primary)}.ng-doc-sidebar-category-title{min-width:0;overflow-wrap:anywhere}.ng-doc-sidebar-category-chevron{flex:none;margin-left:auto;color:var(--ng-doc-text-muted);transform:rotate(-90deg);transition:transform var(--ng-doc-transition) var(--ng-doc-easing)}[aria-expanded=true]>.ng-doc-sidebar-category-chevron{transform:none}.ng-doc-sidebar-category-children{display:grid;gap:1px;padding-top:2px;--ng-doc-sidebar-item-indent: var(--ng-doc-sidebar-category-indent)}@media(prefers-reduced-motion:reduce){.ng-doc-sidebar-category-chevron{transition:none}}\n"] }]
|
|
72
|
+
}], ctorParameters: () => [], propDecorators: { category: [{ type: i0.Input, args: [{ isSignal: true, alias: "category", required: true }] }], isRoot: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRoot", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], expandable: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandable", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }] } });
|
|
72
73
|
|
|
74
|
+
/**
|
|
75
|
+
* A page link in the sidebar, with the status badges of the page.
|
|
76
|
+
*/
|
|
73
77
|
class NgDocSidebarItemComponent {
|
|
74
78
|
constructor() {
|
|
79
|
+
/** The page. */
|
|
75
80
|
this.item = input.required(/* @ts-ignore */
|
|
76
81
|
...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
82
|
+
/** Whether the page sits at the top level of the sidebar, beside the categories. */
|
|
83
|
+
this.isRoot = input(false, { ...(ngDevMode ? { debugName: "isRoot" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
84
|
+
/**
|
|
85
|
+
* The badges of the page: one per JSDoc status tag, in the tag's colour (green without one)
|
|
86
|
+
* and with its text in sentence case.
|
|
87
|
+
*/
|
|
77
88
|
this.statuses = computed(() => {
|
|
78
89
|
const statuses = this.item().metadata?.tags['status'] ?? [];
|
|
79
90
|
return statuses.map((status) => {
|
|
80
|
-
|
|
81
|
-
|
|
91
|
+
// The tag reads `:<colour> <text>`; a tag without the colour is all text.
|
|
92
|
+
const [type, text = ''] = status.startsWith(':')
|
|
93
|
+
? status.slice(1).split(/\s+(.+)/)
|
|
94
|
+
: ['', status];
|
|
95
|
+
return { type: (type || 'success'), text: sentenceCase(text) };
|
|
82
96
|
});
|
|
83
97
|
}, /* @ts-ignore */
|
|
84
98
|
...(ngDevMode ? [{ debugName: "statuses" }] : /* istanbul ignore next */ []));
|
|
85
99
|
}
|
|
86
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
87
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocSidebarItemComponent, isStandalone: true, selector: "ng-doc-sidebar-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, isRoot: { classPropertyName: "isRoot", publicName: "isRoot", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-ng-doc-is-root": "isRoot()" } }, ngImport: i0, template: "<a\n class=\"ng-doc-sidebar-link\"\n [routerLink]=\"[item().route]\"\n routerLinkActive=\"active\"\n ariaCurrentWhenActive=\"page\">\n <span class=\"ng-doc-sidebar-link-title\">{{ item().title }}</span>\n @for (status of statuses(); track $index) {\n <span class=\"ng-doc-sidebar-status\" [attr.data-ng-doc-color]=\"status.type\">{{\n status.text\n }}</span>\n }\n</a>\n", styles: [":host{display:block}.ng-doc-sidebar-link{display:flex;align-items:center;gap:var(--ng-doc-space-2);min-height:32px;padding:var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-space-2) var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-sidebar-item-indent);border-radius:var(--ng-doc-radius-md);color:var(--ng-doc-text);font-weight:400;text-decoration:none;transition:background var(--ng-doc-transition),color var(--ng-doc-transition)}.ng-doc-sidebar-link:hover{background:var(--ng-doc-hover-background);color:var(--ng-doc-heading-color)}.ng-doc-sidebar-link.active{background:var(--ng-doc-primary-soft);color:var(--ng-doc-primary-strong);font-weight:600}.ng-doc-sidebar-link:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ng-doc-primary)}:host([data-ng-doc-is-root=true]) .ng-doc-sidebar-link:not(.active){color:var(--ng-doc-heading-color);font-weight:600}.ng-doc-sidebar-link-title{min-width:0;overflow-wrap:anywhere}.ng-doc-sidebar-status{--_status-hue: var(--ng-doc-success);display:inline-flex;flex:none;align-items:center;height:18px;margin-left:auto;padding:0 6px;border-radius:var(--ng-doc-radius-full);color:color-mix(in oklab,var(--_status-hue) var(--ng-doc-mix-strong),var(--ng-doc-heading-color));background:color-mix(in oklab,var(--_status-hue) var(--ng-doc-mix-chip),var(--ng-doc-background));font-size:11px;line-height:1;font-weight:500;white-space:nowrap}.ng-doc-sidebar-status+.ng-doc-sidebar-status{margin-left:var(--ng-doc-space-1)}.ng-doc-sidebar-status[data-ng-doc-color=primary]{--_status-hue: var(--ng-doc-primary)}.ng-doc-sidebar-status[data-ng-doc-color=info]{--_status-hue: var(--ng-doc-info)}.ng-doc-sidebar-status[data-ng-doc-color=warning]{--_status-hue: var(--ng-doc-warning)}.ng-doc-sidebar-status[data-ng-doc-color=alert]{--_status-hue: var(--ng-doc-alert)}\n"], dependencies: [{ kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
88
102
|
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarItemComponent, decorators: [{
|
|
90
104
|
type: Component,
|
|
91
|
-
args: [{ selector: 'ng-doc-sidebar-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLinkActive, RouterLink
|
|
92
|
-
|
|
105
|
+
args: [{ selector: 'ng-doc-sidebar-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLinkActive, RouterLink], host: {
|
|
106
|
+
'[attr.data-ng-doc-is-root]': 'isRoot()',
|
|
107
|
+
}, template: "<a\n class=\"ng-doc-sidebar-link\"\n [routerLink]=\"[item().route]\"\n routerLinkActive=\"active\"\n ariaCurrentWhenActive=\"page\">\n <span class=\"ng-doc-sidebar-link-title\">{{ item().title }}</span>\n @for (status of statuses(); track $index) {\n <span class=\"ng-doc-sidebar-status\" [attr.data-ng-doc-color]=\"status.type\">{{\n status.text\n }}</span>\n }\n</a>\n", styles: [":host{display:block}.ng-doc-sidebar-link{display:flex;align-items:center;gap:var(--ng-doc-space-2);min-height:32px;padding:var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-space-2) var(--ng-doc-sidebar-vertical-padding, var(--ng-doc-sidebar-vetical-padding)) var(--ng-doc-sidebar-item-indent);border-radius:var(--ng-doc-radius-md);color:var(--ng-doc-text);font-weight:400;text-decoration:none;transition:background var(--ng-doc-transition),color var(--ng-doc-transition)}.ng-doc-sidebar-link:hover{background:var(--ng-doc-hover-background);color:var(--ng-doc-heading-color)}.ng-doc-sidebar-link.active{background:var(--ng-doc-primary-soft);color:var(--ng-doc-primary-strong);font-weight:600}.ng-doc-sidebar-link:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ng-doc-primary)}:host([data-ng-doc-is-root=true]) .ng-doc-sidebar-link:not(.active){color:var(--ng-doc-heading-color);font-weight:600}.ng-doc-sidebar-link-title{min-width:0;overflow-wrap:anywhere}.ng-doc-sidebar-status{--_status-hue: var(--ng-doc-success);display:inline-flex;flex:none;align-items:center;height:18px;margin-left:auto;padding:0 6px;border-radius:var(--ng-doc-radius-full);color:color-mix(in oklab,var(--_status-hue) var(--ng-doc-mix-strong),var(--ng-doc-heading-color));background:color-mix(in oklab,var(--_status-hue) var(--ng-doc-mix-chip),var(--ng-doc-background));font-size:11px;line-height:1;font-weight:500;white-space:nowrap}.ng-doc-sidebar-status+.ng-doc-sidebar-status{margin-left:var(--ng-doc-space-1)}.ng-doc-sidebar-status[data-ng-doc-color=primary]{--_status-hue: var(--ng-doc-primary)}.ng-doc-sidebar-status[data-ng-doc-color=info]{--_status-hue: var(--ng-doc-info)}.ng-doc-sidebar-status[data-ng-doc-color=warning]{--_status-hue: var(--ng-doc-warning)}.ng-doc-sidebar-status[data-ng-doc-color=alert]{--_status-hue: var(--ng-doc-alert)}\n"] }]
|
|
108
|
+
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], isRoot: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRoot", required: false }] }] } });
|
|
109
|
+
/**
|
|
110
|
+
* Writes a badge text in sentence case ("NEW STYLES" becomes "New styles").
|
|
111
|
+
* @param text - The text of the status tag.
|
|
112
|
+
* @returns The text in sentence case.
|
|
113
|
+
*/
|
|
114
|
+
function sentenceCase(text) {
|
|
115
|
+
const lower = text.trim().toLowerCase();
|
|
116
|
+
return lower.charAt(0).toUpperCase() + lower.slice(1);
|
|
117
|
+
}
|
|
93
118
|
|
|
94
119
|
class NgDocSidebarComponent {
|
|
95
120
|
constructor() {
|
|
@@ -102,10 +127,10 @@ class NgDocSidebarComponent {
|
|
|
102
127
|
matchRoute(route) {
|
|
103
128
|
return this.location.path().includes(route ?? '', 0);
|
|
104
129
|
}
|
|
105
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
106
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
131
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocSidebarComponent, isStandalone: true, selector: "ng-doc-sidebar", ngImport: i0, template: "<nav class=\"ng-doc-side-bar-wrapper\" aria-label=\"Documentation\">\n @for (item of getNavigation | bind: this | execute; track item) {\n <ng-container\n *ngTemplateOutlet=\"sidebarTemplate; context: { item: item, root: true }\"></ng-container>\n }\n\n <ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n @if (item.children?.length) {\n @if (!item.hidden) {\n <ng-doc-sidebar-category\n [category]=\"item\"\n [expandable]=\"!!item?.expandable\"\n [expanded]=\"\n !!item?.expanded || !item?.expandable || (matchRoute | bind: this | execute: item.route)\n \"\n [isRoot]=\"!!root\"\n [content]=\"categoryContent\">\n </ng-doc-sidebar-category>\n }\n <ng-template #categoryContent>\n @for (child of getNavigation | bind: this | execute: item; track child) {\n <ng-container\n *ngTemplateOutlet=\"\n sidebarTemplate;\n context: { item: child, root: false }\n \"></ng-container>\n }\n </ng-template>\n } @else {\n @if (!item.hidden) {\n <ng-doc-sidebar-item [item]=\"item\" [isRoot]=\"!!root\"></ng-doc-sidebar-item>\n }\n }\n </ng-template>\n</nav>\n", styles: [":host{display:block;height:calc(100vh - var(--ng-doc-navbar-height));width:100%;overflow:hidden;background:var(--ng-doc-sidebar-background);border-right:1px solid var(--ng-doc-border-color);box-shadow:var(--ng-doc-sidebar-shadow);font-family:var(--ng-doc-font-family);font-size:var(--ng-doc-text-sm-size);line-height:20px;--ng-doc-sidebar-item-indent: var(--ng-doc-space-2)}.ng-doc-side-bar-wrapper{position:relative;overflow:auto;max-height:100%;padding:calc(var(--ng-doc-sidebar-padding) + var(--ng-doc-space-1)) calc(var(--ng-doc-sidebar-horizontal-padding) / 2) calc(var(--ng-doc-sidebar-padding) * 2.5)}.ng-doc-side-bar-wrapper>*+*,ng-doc-sidebar-category+ng-doc-sidebar-category{margin-top:2px}.ng-doc-side-bar-wrapper ng-doc-sidebar-category[data-ng-doc-expanded=true]+*,.ng-doc-side-bar-wrapper *+ng-doc-sidebar-category[data-ng-doc-expanded=true]{margin-top:var(--ng-doc-space-2)}.ng-doc-side-bar-wrapper ng-doc-sidebar-category ng-doc-sidebar-item+ng-doc-sidebar-item{margin-top:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgDocSidebarCategoryComponent, selector: "ng-doc-sidebar-category", inputs: ["category", "isRoot", "content", "expandable", "expanded"] }, { kind: "component", type: NgDocSidebarItemComponent, selector: "ng-doc-sidebar-item", inputs: ["item", "isRoot"] }, { kind: "pipe", type: NgDocExecutePipe, name: "execute" }, { kind: "pipe", type: NgDocBindPipe, name: "bind" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
107
132
|
}
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarComponent, decorators: [{
|
|
109
134
|
type: Component,
|
|
110
135
|
args: [{ selector: 'ng-doc-sidebar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
111
136
|
NgTemplateOutlet,
|
|
@@ -113,7 +138,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
113
138
|
NgDocSidebarItemComponent,
|
|
114
139
|
NgDocExecutePipe,
|
|
115
140
|
NgDocBindPipe,
|
|
116
|
-
], template: "<
|
|
141
|
+
], template: "<nav class=\"ng-doc-side-bar-wrapper\" aria-label=\"Documentation\">\n @for (item of getNavigation | bind: this | execute; track item) {\n <ng-container\n *ngTemplateOutlet=\"sidebarTemplate; context: { item: item, root: true }\"></ng-container>\n }\n\n <ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n @if (item.children?.length) {\n @if (!item.hidden) {\n <ng-doc-sidebar-category\n [category]=\"item\"\n [expandable]=\"!!item?.expandable\"\n [expanded]=\"\n !!item?.expanded || !item?.expandable || (matchRoute | bind: this | execute: item.route)\n \"\n [isRoot]=\"!!root\"\n [content]=\"categoryContent\">\n </ng-doc-sidebar-category>\n }\n <ng-template #categoryContent>\n @for (child of getNavigation | bind: this | execute: item; track child) {\n <ng-container\n *ngTemplateOutlet=\"\n sidebarTemplate;\n context: { item: child, root: false }\n \"></ng-container>\n }\n </ng-template>\n } @else {\n @if (!item.hidden) {\n <ng-doc-sidebar-item [item]=\"item\" [isRoot]=\"!!root\"></ng-doc-sidebar-item>\n }\n }\n </ng-template>\n</nav>\n", styles: [":host{display:block;height:calc(100vh - var(--ng-doc-navbar-height));width:100%;overflow:hidden;background:var(--ng-doc-sidebar-background);border-right:1px solid var(--ng-doc-border-color);box-shadow:var(--ng-doc-sidebar-shadow);font-family:var(--ng-doc-font-family);font-size:var(--ng-doc-text-sm-size);line-height:20px;--ng-doc-sidebar-item-indent: var(--ng-doc-space-2)}.ng-doc-side-bar-wrapper{position:relative;overflow:auto;max-height:100%;padding:calc(var(--ng-doc-sidebar-padding) + var(--ng-doc-space-1)) calc(var(--ng-doc-sidebar-horizontal-padding) / 2) calc(var(--ng-doc-sidebar-padding) * 2.5)}.ng-doc-side-bar-wrapper>*+*,ng-doc-sidebar-category+ng-doc-sidebar-category{margin-top:2px}.ng-doc-side-bar-wrapper ng-doc-sidebar-category[data-ng-doc-expanded=true]+*,.ng-doc-side-bar-wrapper *+ng-doc-sidebar-category[data-ng-doc-expanded=true]{margin-top:var(--ng-doc-space-2)}.ng-doc-side-bar-wrapper ng-doc-sidebar-category ng-doc-sidebar-item+ng-doc-sidebar-item{margin-top:0}\n"] }]
|
|
117
142
|
}] });
|
|
118
143
|
|
|
119
144
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-sidebar.mjs","sources":["../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.ts","../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.html","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.ts","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.html","../../../../libs/app/components/sidebar/sidebar.component.ts","../../../../libs/app/components/sidebar/sidebar.component.html","../../../../libs/app/components/sidebar/ng-doc-app-components-sidebar.ts"],"sourcesContent":["import { Location } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostBinding,\n inject,\n Input,\n} from '@angular/core';\nimport { NgDocRouteActiveDirective } from '@ng-doc/app/directives/route-active';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport {\n NgDocContent,\n NgDocDotComponent,\n NgDocExpanderComponent,\n NgDocIconComponent,\n NgDocRotatorDirective,\n NgDocTextComponent,\n NgDocTextLeftDirective,\n} from '@ng-doc/ui-kit';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n@Component({\n selector: 'ng-doc-sidebar-category',\n templateUrl: './sidebar-category.component.html',\n styleUrls: ['./sidebar-category.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocRouteActiveDirective,\n NgDocDotComponent,\n NgDocTextComponent,\n NgDocIconComponent,\n NgDocTextLeftDirective,\n NgDocRotatorDirective,\n NgDocExpanderComponent,\n PolymorpheusOutlet,\n ],\n})\nexport class NgDocSidebarCategoryComponent {\n @Input({ required: true })\n category!: NgDocNavigation;\n\n @Input()\n @HostBinding('attr.data-ng-doc-is-root')\n isRoot: boolean = false;\n\n @Input()\n content: NgDocContent = '';\n\n @Input()\n @HostBinding('attr.data-ng-doc-expandable')\n expandable: boolean = true;\n\n @Input()\n expanded: boolean = true;\n\n protected readonly location = inject(Location);\n protected readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n constructor() {\n this.location.onUrlChange(() => {\n if (this.location.path().includes(this.category.route ?? '', 0)) {\n this.expand();\n }\n });\n }\n\n toggle(): void {\n this.expanded ? this.collapse() : this.expand();\n }\n\n expand(): void {\n if (this.category?.expandable) {\n this.expanded = true;\n this.changeDetectorRef.markForCheck();\n }\n }\n\n collapse(): void {\n if (this.category?.expandable) {\n this.expanded = false;\n this.changeDetectorRef.markForCheck();\n }\n }\n}\n","<div class=\"ng-doc-sidebar-category-wrapper\">\n <button class=\"ng-doc-sidebar-category-button\" (click)=\"toggle()\">\n <div class=\"ng-doc-sidebar-category\" [ngDocRouteActive]=\"category.route\" activeClass=\"active\">\n @if (!expandable) {\n <ng-doc-dot></ng-doc-dot>\n }\n <span ng-doc-text>\n @if (category.expandable) {\n <ng-doc-icon icon=\"chevron-right\" [ngDocRotator]=\"expanded\" ngDocTextLeft> </ng-doc-icon>\n }\n {{ category.title }}\n </span>\n </div>\n <!--\t\t<div ng-doc-text color=\"muted\" size=\"small\">Some description</div>-->\n </button>\n <ng-doc-expander [expanded]=\"expanded\" [content]=\"contentTemplate\" collapseMod=\"hide\" />\n <ng-template #contentTemplate>\n <div class=\"ng-doc-sidebar-category-children\">\n <!--We wrap content via ng-template to save state of the child components -->\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n </div>\n </ng-template>\n</div>\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport {\n NgDocColor,\n NgDocDotComponent,\n NgDocTagComponent,\n NgDocTextComponent,\n} from '@ng-doc/ui-kit';\n\n@Component({\n selector: 'ng-doc-sidebar-item',\n templateUrl: './sidebar-item.component.html',\n styleUrls: ['./sidebar-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLinkActive, RouterLink, NgDocDotComponent, NgDocTextComponent, NgDocTagComponent],\n})\nexport class NgDocSidebarItemComponent {\n item = input.required<NgDocNavigation>();\n statuses = computed(() => {\n const statuses = this.item().metadata?.tags['status'] ?? [];\n\n return statuses.map((status) => {\n const [type, text] = status.split(/\\s+(.+)/);\n\n return { type: type.replace(/^:/, '') as NgDocColor, text };\n });\n });\n}\n","<a class=\"ng-doc-sidebar-link\" [routerLink]=\"[item().route]\" routerLinkActive=\"active\">\n <ng-doc-dot></ng-doc-dot>\n <span ng-doc-text [absoluteContent]=\"true\">\n {{ item().title }}\n @for (status of statuses(); track status) {\n <ng-doc-tag size=\"small\" [color]=\"status.type || 'success'\" mod=\"light\">{{\n status.text\n }}</ng-doc-tag>\n }\n </span>\n</a>\n","import { Location, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NG_DOC_CONTEXT } from '@ng-doc/app/tokens';\nimport { NgDocBindPipe, NgDocExecutePipe } from '@ng-doc/ui-kit';\n\nimport { NgDocSidebarCategoryComponent } from './sidebar-category/sidebar-category.component';\nimport { NgDocSidebarItemComponent } from './sidebar-item/sidebar-item.component';\n\n@Component({\n selector: 'ng-doc-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgTemplateOutlet,\n NgDocSidebarCategoryComponent,\n NgDocSidebarItemComponent,\n NgDocExecutePipe,\n NgDocBindPipe,\n ],\n})\nexport class NgDocSidebarComponent {\n protected readonly location = inject(Location);\n protected readonly context = inject(NG_DOC_CONTEXT);\n\n getNavigation(nav?: NgDocNavigation): NgDocNavigation[] {\n return nav ? nav.children ?? [] : this.context.navigation;\n }\n\n matchRoute(route: string): boolean {\n return this.location.path().includes(route ?? '', 0);\n }\n}\n","<div class=\"ng-doc-side-bar-wrapper\">\n @for (item of getNavigation | bind: this | execute; track item) {\n <ng-container\n *ngTemplateOutlet=\"sidebarTemplate; context: { item: item, root: true }\"></ng-container>\n }\n\n <ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n @if (item.children?.length) {\n @if (!item.hidden) {\n <ng-doc-sidebar-category\n [category]=\"item\"\n [expandable]=\"!!item?.expandable\"\n [expanded]=\"\n !!item?.expanded || !item?.expandable || (matchRoute | bind: this | execute: item.route)\n \"\n [isRoot]=\"!!root\"\n [content]=\"categoryContent\">\n </ng-doc-sidebar-category>\n }\n <ng-template #categoryContent>\n @for (child of getNavigation | bind: this | execute: item; track child) {\n <ng-container\n *ngTemplateOutlet=\"\n sidebarTemplate;\n context: { item: child, root: false }\n \"></ng-container>\n }\n </ng-template>\n } @else {\n @if (!item.hidden) {\n <ng-doc-sidebar-item [item]=\"item\"></ng-doc-sidebar-item>\n }\n }\n </ng-template>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAsCa,6BAA6B,CAAA;AAqBxC,IAAA,WA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,EAAA,QAAA,EAAA,SAAA,EAAA,YAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC7B,yBAAyB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACzB,gBAAgB,EAAA,IAAA,EAAA,SAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAChB,aAAa,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAGJ,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,gBAAgB;wBAChB,6BAA6B;wBAC7B,yBAAyB;wBACzB,gBAAgB;wBAChB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,wsCAAA,EAAA,MAAA,EAAA,CAAA,icAAA,CAAA,EAAA;;;AEpBH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-sidebar.mjs","sources":["../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.ts","../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.html","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.ts","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.html","../../../../libs/app/components/sidebar/sidebar.component.ts","../../../../libs/app/components/sidebar/sidebar.component.html","../../../../libs/app/components/sidebar/ng-doc-app-components-sidebar.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n linkedSignal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NgDocContent, NgDocExpanderComponent } from '@ng-doc/ui-kit';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\nimport { filter } from 'rxjs/operators';\n\nlet nextId = 0;\n\n/**\n * A category of the sidebar: a header row that expands and collapses the pages below it.\n *\n * An expandable category opens by itself when the reader navigates to one of its pages.\n */\n@Component({\n selector: 'ng-doc-sidebar-category',\n templateUrl: './sidebar-category.component.html',\n styleUrls: ['./sidebar-category.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocExpanderComponent, PolymorpheusOutlet],\n host: {\n '[attr.data-ng-doc-is-root]': 'isRoot()',\n '[attr.data-ng-doc-expandable]': 'expandable()',\n '[attr.data-ng-doc-expanded]': 'isExpanded()',\n },\n})\nexport class NgDocSidebarCategoryComponent {\n /** The category. */\n readonly category = input.required<NgDocNavigation>();\n\n /** Whether the category sits at the top level of the sidebar. */\n readonly isRoot = input<boolean, unknown>(false, { transform: booleanAttribute });\n\n /** The pages and categories inside the category. */\n readonly content = input<NgDocContent>('');\n\n /** Whether the reader can collapse the category. A category that cannot is always open. */\n readonly expandable = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /** Whether the category starts open. */\n readonly expanded = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /** Whether the category is open: it starts from `expanded` and follows the reader. */\n readonly isExpanded = linkedSignal(() => this.expanded() || !this.expandable());\n\n /** Id of the element that holds the pages, for the header's `aria-controls`. */\n protected readonly childrenId = `ng-doc-sidebar-category-${nextId++}`;\n\n constructor() {\n const router = inject(Router);\n\n router.events\n .pipe(\n filter((event) => event instanceof NavigationEnd),\n takeUntilDestroyed(),\n )\n .subscribe(() => {\n const route: string = this.category().route ?? '';\n\n if (router.url.includes(route)) {\n this.expand();\n }\n });\n }\n\n /** Opens the category if it is open, or closes it otherwise. */\n toggle(): void {\n this.isExpanded() ? this.collapse() : this.expand();\n }\n\n /** Opens the category. */\n expand(): void {\n if (this.expandable()) {\n this.isExpanded.set(true);\n }\n }\n\n /** Closes the category, unless it cannot be collapsed. */\n collapse(): void {\n if (this.expandable()) {\n this.isExpanded.set(false);\n }\n }\n}\n","@if (expandable()) {\n <button\n type=\"button\"\n class=\"ng-doc-sidebar-category-button\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"childrenId\"\n (click)=\"toggle()\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n <svg\n class=\"ng-doc-sidebar-category-chevron\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n} @else {\n <div class=\"ng-doc-sidebar-category-button\">\n <span class=\"ng-doc-sidebar-category-title\">{{ category().title }}</span>\n </div>\n}\n<ng-doc-expander [expanded]=\"isExpanded()\" [content]=\"contentTemplate\" collapseMod=\"hide\" />\n<ng-template #contentTemplate>\n <!-- The content comes through a template, so the child components keep their state. -->\n <div class=\"ng-doc-sidebar-category-children\" [id]=\"childrenId\">\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n </div>\n</ng-template>\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n} from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NgDocColor } from '@ng-doc/ui-kit';\n\n/** A status badge of a sidebar item, from the page's JSDoc status tag. */\nexport interface NgDocSidebarItemStatus {\n /** Colour of the badge. */\n type: NgDocColor;\n /** Text of the badge, in sentence case. */\n text: string;\n}\n\n/**\n * A page link in the sidebar, with the status badges of the page.\n */\n@Component({\n selector: 'ng-doc-sidebar-item',\n templateUrl: './sidebar-item.component.html',\n styleUrls: ['./sidebar-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLinkActive, RouterLink],\n host: {\n '[attr.data-ng-doc-is-root]': 'isRoot()',\n },\n})\nexport class NgDocSidebarItemComponent {\n /** The page. */\n readonly item = input.required<NgDocNavigation>();\n\n /** Whether the page sits at the top level of the sidebar, beside the categories. */\n readonly isRoot = input<boolean, unknown>(false, { transform: booleanAttribute });\n\n /**\n * The badges of the page: one per JSDoc status tag, in the tag's colour (green without one)\n * and with its text in sentence case.\n */\n readonly statuses = computed<NgDocSidebarItemStatus[]>(() => {\n const statuses: string[] = this.item().metadata?.tags['status'] ?? [];\n\n return statuses.map((status: string) => {\n // The tag reads `:<colour> <text>`; a tag without the colour is all text.\n const [type, text = ''] = status.startsWith(':')\n ? status.slice(1).split(/\\s+(.+)/)\n : ['', status];\n\n return { type: (type || 'success') as NgDocColor, text: sentenceCase(text) };\n });\n });\n}\n\n/**\n * Writes a badge text in sentence case (\"NEW STYLES\" becomes \"New styles\").\n * @param text - The text of the status tag.\n * @returns The text in sentence case.\n */\nfunction sentenceCase(text: string): string {\n const lower: string = text.trim().toLowerCase();\n\n return lower.charAt(0).toUpperCase() + lower.slice(1);\n}\n","<a\n class=\"ng-doc-sidebar-link\"\n [routerLink]=\"[item().route]\"\n routerLinkActive=\"active\"\n ariaCurrentWhenActive=\"page\">\n <span class=\"ng-doc-sidebar-link-title\">{{ item().title }}</span>\n @for (status of statuses(); track $index) {\n <span class=\"ng-doc-sidebar-status\" [attr.data-ng-doc-color]=\"status.type\">{{\n status.text\n }}</span>\n }\n</a>\n","import { Location, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NG_DOC_CONTEXT } from '@ng-doc/app/tokens';\nimport { NgDocBindPipe, NgDocExecutePipe } from '@ng-doc/ui-kit';\n\nimport { NgDocSidebarCategoryComponent } from './sidebar-category/sidebar-category.component';\nimport { NgDocSidebarItemComponent } from './sidebar-item/sidebar-item.component';\n\n@Component({\n selector: 'ng-doc-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgTemplateOutlet,\n NgDocSidebarCategoryComponent,\n NgDocSidebarItemComponent,\n NgDocExecutePipe,\n NgDocBindPipe,\n ],\n})\nexport class NgDocSidebarComponent {\n protected readonly location = inject(Location);\n protected readonly context = inject(NG_DOC_CONTEXT);\n\n getNavigation(nav?: NgDocNavigation): NgDocNavigation[] {\n return nav ? nav.children ?? [] : this.context.navigation;\n }\n\n matchRoute(route: string): boolean {\n return this.location.path().includes(route ?? '', 0);\n }\n}\n","<nav class=\"ng-doc-side-bar-wrapper\" aria-label=\"Documentation\">\n @for (item of getNavigation | bind: this | execute; track item) {\n <ng-container\n *ngTemplateOutlet=\"sidebarTemplate; context: { item: item, root: true }\"></ng-container>\n }\n\n <ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n @if (item.children?.length) {\n @if (!item.hidden) {\n <ng-doc-sidebar-category\n [category]=\"item\"\n [expandable]=\"!!item?.expandable\"\n [expanded]=\"\n !!item?.expanded || !item?.expandable || (matchRoute | bind: this | execute: item.route)\n \"\n [isRoot]=\"!!root\"\n [content]=\"categoryContent\">\n </ng-doc-sidebar-category>\n }\n <ng-template #categoryContent>\n @for (child of getNavigation | bind: this | execute: item; track child) {\n <ng-container\n *ngTemplateOutlet=\"\n sidebarTemplate;\n context: { item: child, root: false }\n \"></ng-container>\n }\n </ng-template>\n } @else {\n @if (!item.hidden) {\n <ng-doc-sidebar-item [item]=\"item\" [isRoot]=\"!!root\"></ng-doc-sidebar-item>\n }\n }\n </ng-template>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAeA,IAAI,MAAM,GAAG,CAAC;AAEd;;;;AAIG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EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,gBAAgB;wBAChB,6BAA6B;wBAC7B,yBAAyB;wBACzB,gBAAgB;wBAChB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,yvCAAA,EAAA,MAAA,EAAA,CAAA,m+BAAA,CAAA,EAAA;;;AEpBH;;AAEG;;;;"}
|
|
@@ -1,26 +1,50 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NgDocTabGroupComponent, NgDocTabComponent, NgDocIconComponent, NgDocExecutePipe } from '@ng-doc/ui-kit';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Tabs of a page: grouped code blocks, or any content that Markdown wraps in
|
|
7
|
+
* `<ng-doc-tab group="…" name="…">` elements.
|
|
8
|
+
*/
|
|
5
9
|
class NgDocTabsComponent {
|
|
6
10
|
constructor() {
|
|
7
|
-
|
|
11
|
+
/** The tabs; their content is moved into the open panel. */
|
|
12
|
+
this.tabs = input([], /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
14
|
+
/** Index of the tab that opens first: the one marked active, or the first. */
|
|
15
|
+
this.activeIndex = computed(() => Math.max(this.tabs().findIndex((tab) => tab.active), 0), /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
17
|
+
/**
|
|
18
|
+
* Whether the tabs hold page content rather than a code group. A code group has one code block
|
|
19
|
+
* per tab and is drawn as one framed code surface; content tabs are only a tab bar over their
|
|
20
|
+
* content, so a framed demo or code block inside them doesn't sit in a second frame.
|
|
21
|
+
*/
|
|
22
|
+
this.contentTabs = computed(() => this.tabs().some((tab) => tab.content.childElementCount !== 1 ||
|
|
23
|
+
!tab.content.firstElementChild?.matches('ng-doc-code, pre')), /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "contentTabs" }] : /* istanbul ignore next */ []));
|
|
8
25
|
}
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
// The tabs processor leaves the contents on the page until every processor has run on them;
|
|
28
|
+
// only the open tab's content is shown, in the panel.
|
|
29
|
+
this.tabs().forEach((tab) => tab.content.remove());
|
|
11
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Moves a tab's content into its panel.
|
|
33
|
+
* @param element - Content of the tab.
|
|
34
|
+
* @param parent - The panel element.
|
|
35
|
+
*/
|
|
12
36
|
appendElement(element, parent) {
|
|
13
37
|
parent.appendChild(element);
|
|
14
38
|
}
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
40
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocTabsComponent, isStandalone: true, selector: "ng-doc-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ng-doc-content-tabs": "contentTabs()" } }, ngImport: i0, template: "<ng-doc-tab-group [openedTab]=\"activeIndex()\" [appearance]=\"contentTabs() ? 'plain' : 'framed'\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element [class.ng-doc-tabs-content]=\"contentTabs()\">\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n", styles: [":host{display:block;margin:var(--ng-doc-tabs-margin)}:host(:not(.ng-doc-content-tabs)){border-radius:var(--ng-doc-tabs-border-radius);border:var(--ng-doc-tabs-border, 1px solid var(--ng-doc-border-color));overflow:hidden;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-background: var(--ng-doc-code-background);--ng-doc-tab-group-header-background: var(--ng-doc-code-background);--ng-doc-tab-group-tabs-background: var(--ng-doc-code-header-background, transparent)}.ng-doc-tabs-content ::ng-deep>*>:first-child{margin-top:0}.ng-doc-tabs-content ::ng-deep>*>:last-child{margin-bottom:0}\n"], dependencies: [{ kind: "component", type: NgDocTabGroupComponent, selector: "ng-doc-tab-group", inputs: ["appearance", "openedTab"] }, { kind: "component", type: NgDocTabComponent, selector: "ng-doc-tab, a[ng-doc-tab]", inputs: ["label", "id", "content"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "pipe", type: NgDocExecutePipe, name: "execute" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
17
41
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTabsComponent, decorators: [{
|
|
19
43
|
type: Component,
|
|
20
|
-
args: [{ selector: 'ng-doc-tabs', imports: [NgDocTabGroupComponent, NgDocTabComponent, NgDocExecutePipe, NgDocIconComponent], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
args: [{ selector: 'ng-doc-tabs', imports: [NgDocTabGroupComponent, NgDocTabComponent, NgDocExecutePipe, NgDocIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
45
|
+
'[class.ng-doc-content-tabs]': 'contentTabs()',
|
|
46
|
+
}, template: "<ng-doc-tab-group [openedTab]=\"activeIndex()\" [appearance]=\"contentTabs() ? 'plain' : 'framed'\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element [class.ng-doc-tabs-content]=\"contentTabs()\">\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n", styles: [":host{display:block;margin:var(--ng-doc-tabs-margin)}:host(:not(.ng-doc-content-tabs)){border-radius:var(--ng-doc-tabs-border-radius);border:var(--ng-doc-tabs-border, 1px solid var(--ng-doc-border-color));overflow:hidden;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-background: var(--ng-doc-code-background);--ng-doc-tab-group-header-background: var(--ng-doc-code-background);--ng-doc-tab-group-tabs-background: var(--ng-doc-code-header-background, transparent)}.ng-doc-tabs-content ::ng-deep>*>:first-child{margin-top:0}.ng-doc-tabs-content ::ng-deep>*>:last-child{margin-bottom:0}\n"] }]
|
|
47
|
+
}], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }] } });
|
|
24
48
|
|
|
25
49
|
/**
|
|
26
50
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-tabs.mjs","sources":["../../../../libs/app/components/tabs/tabs.component.ts","../../../../libs/app/components/tabs/tabs.component.html","../../../../libs/app/components/tabs/ng-doc-app-components-tabs.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-tabs.mjs","sources":["../../../../libs/app/components/tabs/tabs.component.ts","../../../../libs/app/components/tabs/tabs.component.html","../../../../libs/app/components/tabs/ng-doc-app-components-tabs.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, OnInit, Signal } from '@angular/core';\nimport { NgDocTab } from '@ng-doc/app/interfaces';\nimport {\n NgDocExecutePipe,\n NgDocIconComponent,\n NgDocTabComponent,\n NgDocTabGroupComponent,\n} from '@ng-doc/ui-kit';\n\n/**\n * Tabs of a page: grouped code blocks, or any content that Markdown wraps in\n * `<ng-doc-tab group=\"…\" name=\"…\">` elements.\n */\n@Component({\n selector: 'ng-doc-tabs',\n imports: [NgDocTabGroupComponent, NgDocTabComponent, NgDocExecutePipe, NgDocIconComponent],\n templateUrl: './tabs.component.html',\n styleUrls: ['./tabs.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.ng-doc-content-tabs]': 'contentTabs()',\n },\n})\nexport class NgDocTabsComponent implements OnInit {\n /** The tabs; their content is moved into the open panel. */\n readonly tabs = input<NgDocTab[]>([]);\n\n /** Index of the tab that opens first: the one marked active, or the first. */\n protected readonly activeIndex: Signal<number> = computed(() =>\n Math.max(\n this.tabs().findIndex((tab: NgDocTab) => tab.active),\n 0,\n ),\n );\n\n /**\n * Whether the tabs hold page content rather than a code group. A code group has one code block\n * per tab and is drawn as one framed code surface; content tabs are only a tab bar over their\n * content, so a framed demo or code block inside them doesn't sit in a second frame.\n */\n protected readonly contentTabs: Signal<boolean> = computed(() =>\n this.tabs().some(\n (tab: NgDocTab) =>\n tab.content.childElementCount !== 1 ||\n !tab.content.firstElementChild?.matches('ng-doc-code, pre'),\n ),\n );\n\n ngOnInit(): void {\n // The tabs processor leaves the contents on the page until every processor has run on them;\n // only the open tab's content is shown, in the panel.\n this.tabs().forEach((tab: NgDocTab) => tab.content.remove());\n }\n\n /**\n * Moves a tab's content into its panel.\n * @param element - Content of the tab.\n * @param parent - The panel element.\n */\n appendElement(element: Element, parent: Element): void {\n parent.appendChild(element);\n }\n}\n","<ng-doc-tab-group [openedTab]=\"activeIndex()\" [appearance]=\"contentTabs() ? 'plain' : 'framed'\">\n @for (tab of tabs(); track tab; let i = $index) {\n <ng-doc-tab [label]=\"label\" [content]=\"content\" [id]=\"i\">\n <ng-template #label>\n @if (tab.icon) {\n <ng-doc-icon [customIcon]=\"tab.icon\"></ng-doc-icon>\n }\n {{ tab.title }}\n </ng-template>\n <ng-template #content>\n <div #element [class.ng-doc-tabs-content]=\"contentTabs()\">\n {{ appendElement | execute: tab.content : element }}\n </div>\n </ng-template>\n </ng-doc-tab>\n }\n</ng-doc-tab-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AASA;;;AAGG;MAWU,kBAAkB,CAAA;AAV/B,IAAA,WAAA,GAAA;;QAYW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAa,EAAE;iFAAC;;AAGlB,QAAA,IAAA,CAAA,WAAW,GAAmB,QAAQ,CAAC,MACxD,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,GAAa,KAAK,GAAG,CAAC,MAAM,CAAC,EACpD,CAAC,CACF;wFACF;AAED;;;;AAIG;QACgB,IAAA,CAAA,WAAW,GAAoB,QAAQ,CAAC,MACzD,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CACd,CAAC,GAAa,KACZ,GAAG,CAAC,OAAO,CAAC,iBAAiB,KAAK,CAAC;YACnC,CAAC,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAC9D;wFACF;AAgBF,IAAA;IAdC,QAAQ,GAAA;;;AAGN,QAAA,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,GAAa,KAAK,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;IAC9D;AAEA;;;;AAI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sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EAAA,eAAA,EAGzE,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,6BAA6B,EAAE,eAAe;AAC/C,qBAAA,EAAA,QAAA,EAAA,0oBAAA,EAAA,MAAA,EAAA,CAAA,koBAAA,CAAA,EAAA;;;AErBH;;AAEG;;;;"}
|
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
2
|
+
import { inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NgDocThemeService } from '@ng-doc/app/services/theme';
|
|
4
|
-
import { NgDocButtonIconComponent, NgDocTooltipDirective
|
|
4
|
+
import { NgDocButtonIconComponent, NgDocTooltipDirective } from '@ng-doc/ui-kit';
|
|
5
5
|
|
|
6
|
+
const THEMES = [
|
|
7
|
+
{ name: 'Auto', theme: 'auto' },
|
|
8
|
+
{ name: 'Light', theme: null },
|
|
9
|
+
{ name: 'Dark', theme: 'dark' },
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Button that switches the theme in turn: Auto (follows the system), Light and Dark.
|
|
13
|
+
*
|
|
14
|
+
* It shows the current theme and follows theme changes made elsewhere through the theme service.
|
|
15
|
+
*/
|
|
6
16
|
class NgDocThemeToggleComponent {
|
|
7
17
|
constructor() {
|
|
8
|
-
this.themes = [
|
|
9
|
-
{ name: 'Auto', theme: 'auto' },
|
|
10
|
-
{ name: 'Light', theme: null },
|
|
11
|
-
{ name: 'Dark', theme: 'dark' },
|
|
12
|
-
];
|
|
13
|
-
this.documentElement = inject(DOCUMENT).documentElement;
|
|
14
18
|
this.themeService = inject(NgDocThemeService);
|
|
19
|
+
/**
|
|
20
|
+
* The current theme. A custom theme id counts as Auto, because the toggle does not offer it.
|
|
21
|
+
*/
|
|
22
|
+
this.currentTheme = computed(() => {
|
|
23
|
+
const theme = this.themeService.theme();
|
|
24
|
+
return THEMES.find(({ theme: t }) => t === theme) ?? THEMES[0];
|
|
25
|
+
}, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "currentTheme" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/**
|
|
28
|
+
* The theme the next press switches to.
|
|
29
|
+
*/
|
|
30
|
+
this.nextTheme = computed(() => THEMES[(THEMES.indexOf(this.currentTheme()) + 1) % THEMES.length], /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "nextTheme" }] : /* istanbul ignore next */ []));
|
|
15
32
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
get nextTheme() {
|
|
21
|
-
const index = this.themes.findIndex(({ theme }) => theme === this.currentTheme.theme);
|
|
22
|
-
return this.themes[(index + 1) % this.themes.length];
|
|
23
|
-
}
|
|
33
|
+
/**
|
|
34
|
+
* Switches to the next theme.
|
|
35
|
+
*/
|
|
24
36
|
toggleTheme() {
|
|
25
|
-
const { theme } = this.nextTheme;
|
|
37
|
+
const { theme } = this.nextTheme();
|
|
26
38
|
this.themeService.set(theme ?? undefined);
|
|
27
39
|
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocThemeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
41
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocThemeToggleComponent, isStandalone: true, selector: "ng-doc-theme-toggle", ngImport: i0, template: "<button\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n [attr.aria-label]=\"currentTheme().name + ' theme. Switch to ' + nextTheme().name.toLowerCase()\"\n [ngDocTooltip]=\"currentTheme().name + ' theme'\"\n (click)=\"toggleTheme()\">\n @switch (currentTheme().name) {\n @case ('Light') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path\n d=\"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </svg>\n }\n @case ('Dark') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\" />\n </svg>\n }\n @default {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 0 0 18z\" fill=\"currentColor\" />\n </svg>\n }\n }\n</button>\n", styles: [":host{display:inline-flex;flex:none}\n"], dependencies: [{ kind: "component", type: NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon], button[ng-doc-button-icon-raised], a[ng-doc-button-icon-raised], button[ng-doc-button-icon-transparent], a[ng-doc-button-icon-transparent]", inputs: ["size", "rounded"] }, { kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
30
42
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocThemeToggleComponent, decorators: [{
|
|
32
44
|
type: Component,
|
|
33
|
-
args: [{ selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocButtonIconComponent, NgDocTooltipDirective
|
|
45
|
+
args: [{ selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocButtonIconComponent, NgDocTooltipDirective], template: "<button\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n [attr.aria-label]=\"currentTheme().name + ' theme. Switch to ' + nextTheme().name.toLowerCase()\"\n [ngDocTooltip]=\"currentTheme().name + ' theme'\"\n (click)=\"toggleTheme()\">\n @switch (currentTheme().name) {\n @case ('Light') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path\n d=\"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </svg>\n }\n @case ('Dark') {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\" />\n </svg>\n }\n @default {\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 0 0 18z\" fill=\"currentColor\" />\n </svg>\n }\n }\n</button>\n", styles: [":host{display:inline-flex;flex:none}\n"] }]
|
|
34
46
|
}] });
|
|
35
47
|
|
|
36
48
|
/**
|