@ng-doc/app 22.0.0-beta.1 → 22.0.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 +178 -68
- 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-pane.mjs +39 -36
- package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo.mjs +129 -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 +187 -91
- 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 +69 -24
- 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 +392 -263
- 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 +90 -63
- package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-tabs.mjs +18 -12
- 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 +268 -90
- package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components.mjs +3 -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-directives-code-highlighter.mjs +14 -7
- 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 +285 -1
- 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 +12 -1
- 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-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 +83 -14
- package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-route-preloader.mjs +360 -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 +22 -16
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/package.json +74 -32
- package/styles/global.css +1129 -205
- package/styles/main.css +1129 -205
- package/styles/themes/dark.css +78 -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 +6 -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-pane.d.ts +19 -15
- package/types/ng-doc-app-components-demo.d.ts +62 -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 +146 -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 +13 -4
- 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 +3 -1
- 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 +124 -3
- package/types/ng-doc-app-interfaces.d.ts +48 -28
- 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 +5 -1
- package/types/ng-doc-app-providers-ng-doc-app.d.ts +17 -0
- package/types/ng-doc-app-providers-playground-demo.d.ts +1 -1
- package/types/ng-doc-app-providers-type-control.d.ts +2 -2
- 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 +40 -5
- package/types/ng-doc-app-services-route-preloader.d.ts +109 -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 +13 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-search-result.mjs","sources":["../../../../libs/app/components/search-result/search-result.component.ts","../../../../libs/app/components/search-result/search-result.component.html","../../../../libs/app/components/search-result/ng-doc-app-components-search-result.ts"],"sourcesContent":["import { KeyValuePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-search-result.mjs","sources":["../../../../libs/app/components/search-result/search-result.component.ts","../../../../libs/app/components/search-result/search-result.component.html","../../../../libs/app/components/search-result/ng-doc-app-components-search-result.ts"],"sourcesContent":["import { KeyValuePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, Signal } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { NgDocKindIconComponent } from '@ng-doc/app/components/kind-icon';\nimport { NgDocPageInfo } from '@ng-doc/core/interfaces';\nimport { NgDocTextComponent, NgDocTooltipDirective } from '@ng-doc/ui-kit';\n\n/**\n * A list of pages grouped by their type (guides and API).\n */\n@Component({\n selector: 'ng-doc-search-result',\n templateUrl: './search-result.component.html',\n styleUrls: ['./search-result.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocTextComponent,\n RouterLink,\n NgDocKindIconComponent,\n NgDocTooltipDirective,\n KeyValuePipe,\n ],\n})\nexport class NgDocSearchResultComponent {\n /** The pages to list. */\n readonly result = input<NgDocPageInfo[] | null>([]);\n\n /** The pages grouped by their type. */\n readonly groupedResult: Signal<Record<string, NgDocPageInfo[]>> = computed(() =>\n (this.result() ?? []).reduce(\n (grouped: Record<string, NgDocPageInfo[]>, item: NgDocPageInfo) => {\n (grouped[item.type] ??= []).push(item);\n\n return grouped;\n },\n {},\n ),\n );\n\n /**\n * Returns the heading of a group.\n * @param type - The page type of the group.\n */\n typeToLabel(type: string): string {\n switch (type) {\n case 'api':\n return 'API';\n case 'guide':\n return 'Guides';\n default:\n return 'Unknown';\n }\n }\n}\n","@if (groupedResult() | keyvalue; as results) {\n <div class=\"ng-doc-search-result-wrapper\">\n @if (results.length) {\n @for (item of results; track item) {\n <div class=\"ng-doc-search-result-category\">\n <h4 class=\"ng-doc-search-result-title\" ng-doc-text>{{ typeToLabel(item.key) }}</h4>\n <ul class=\"ng-doc-search-result-pages\">\n @for (page of item.value; track page) {\n <li class=\"ng-doc-search-result-page\">\n <a class=\"ng-doc-search-result-page-link\" [routerLink]=\"[page.route]\">\n @if (page.kind) {\n <ng-doc-kind-icon\n [kind]=\"page.kind\"\n [ngDocTooltip]=\"page.kind\"></ng-doc-kind-icon>\n }\n {{ page.title }}\n </a>\n </li>\n }\n </ul>\n </div>\n }\n } @else {\n <div ng-doc-text color=\"muted\">Nothing was found...</div>\n }\n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BACV,sBAAsB;wBACtB,qBAAqB;wBACrB,YAAY;AACb,qBAAA,EAAA,QAAA,EAAA,mgCAAA,EAAA,MAAA,EAAA,CAAA,6kCAAA,CAAA,EAAA;;;AErBH;;AAEG;;;;"}
|
|
@@ -1,53 +1,84 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { inject, signal, DOCUMENT, PLATFORM_ID, DestroyRef, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
4
|
import { NgDocSearchEngine } from '@ng-doc/app/classes';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { skip, switchMap, shareReplay } from 'rxjs/operators';
|
|
5
|
+
import { NgDocCommandPaletteComponent } from '@ng-doc/app/components/command-palette';
|
|
6
|
+
import { NgDocShortcutsService } from '@ng-doc/app/services/shortcuts';
|
|
7
|
+
import { NgDocDialogService, NgDocComponentContent, NgDocButtonIconComponent } from '@ng-doc/ui-kit';
|
|
10
8
|
|
|
9
|
+
/**
|
|
10
|
+
* The search button of the navbar. It opens the search palette on click, with Command+K
|
|
11
|
+
* (Control+K) and, while single-key shortcuts are on, with the slash key. Wide screens show a
|
|
12
|
+
* search field with the key hint; narrow screens show an icon button.
|
|
13
|
+
*/
|
|
11
14
|
class NgDocSearchComponent {
|
|
12
15
|
constructor() {
|
|
13
|
-
this.query = new BehaviorSubject('');
|
|
14
16
|
this.dialog = inject(NgDocDialogService);
|
|
15
17
|
this.searchEngine = inject(NgDocSearchEngine, { optional: true });
|
|
18
|
+
this.shortcuts = inject(NgDocShortcutsService);
|
|
19
|
+
/** The chord that opens the search, as the reader's platform labels it. */
|
|
20
|
+
this.chord = signal('⌘K', /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "chord" }] : /* istanbul ignore next */ []));
|
|
22
|
+
this.document = inject(DOCUMENT);
|
|
23
|
+
this.browser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
16
24
|
if (!this.searchEngine) {
|
|
17
25
|
throw new Error(`NgDoc: Search engine is not provided,
|
|
18
|
-
please check this article: https://ng-doc.com/docs/
|
|
26
|
+
please check this article: https://ng-doc.com/docs/get-started/installation#4-add-the-providers
|
|
19
27
|
to learn how to provide it.`);
|
|
20
28
|
}
|
|
21
|
-
|
|
29
|
+
const removeSlash = this.shortcuts.register({ key: '/', handler: () => this.open() });
|
|
30
|
+
const removeChord = this.shortcuts.register({
|
|
31
|
+
key: 'k',
|
|
32
|
+
chord: true,
|
|
33
|
+
handler: () => (this.dialogRef ? this.dialogRef.close() : this.open()),
|
|
34
|
+
});
|
|
35
|
+
inject(DestroyRef).onDestroy(() => {
|
|
36
|
+
removeSlash();
|
|
37
|
+
removeChord();
|
|
38
|
+
this.dialogRef?.close();
|
|
39
|
+
});
|
|
40
|
+
// The platform is known only in the browser; the server renders the macOS label.
|
|
41
|
+
afterNextRender(() => {
|
|
42
|
+
if (!/Mac|iPhone|iPad/i.test(this.document.defaultView?.navigator.platform ?? '')) {
|
|
43
|
+
this.chord.set('Ctrl K');
|
|
44
|
+
}
|
|
45
|
+
});
|
|
22
46
|
}
|
|
23
|
-
|
|
24
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Opens the search palette. Focus returns to the element that had it when the palette closes.
|
|
49
|
+
* @param query - The text the search field starts with.
|
|
50
|
+
*/
|
|
51
|
+
open(query = '') {
|
|
52
|
+
if (this.dialogRef || !this.browser) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const opener = this.document.activeElement;
|
|
56
|
+
const narrow = !!this.document.defaultView?.matchMedia?.('(max-width: 640px)').matches;
|
|
57
|
+
const data = { query };
|
|
58
|
+
const dialogRef = this.dialog.open(new NgDocComponentContent(NgDocCommandPaletteComponent), {
|
|
25
59
|
hasBackdrop: true,
|
|
26
|
-
backdropClass: 'ng-doc-
|
|
27
|
-
panelClass: 'ng-doc-transparent-dialog',
|
|
28
|
-
positionStrategy: this.dialog
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
60
|
+
backdropClass: 'ng-doc-command-palette-backdrop',
|
|
61
|
+
panelClass: ['ng-doc-transparent-dialog', 'ng-doc-command-palette-pane'],
|
|
62
|
+
positionStrategy: this.dialog
|
|
63
|
+
.positionStrategy()
|
|
64
|
+
.centerHorizontally()
|
|
65
|
+
.top(narrow ? '8px' : '10vh'),
|
|
66
|
+
data,
|
|
67
|
+
});
|
|
68
|
+
this.dialogRef = dialogRef;
|
|
69
|
+
dialogRef.afterClose().subscribe(() => {
|
|
70
|
+
this.dialogRef = undefined;
|
|
71
|
+
if (opener instanceof HTMLElement && opener.isConnected && opener !== this.document.body) {
|
|
72
|
+
opener.focus({ preventScroll: true });
|
|
73
|
+
}
|
|
34
74
|
});
|
|
35
75
|
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
76
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
77
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.1", type: NgDocSearchComponent, isStandalone: true, selector: "ng-doc-search", ngImport: i0, template: "<button\n class=\"ng-doc-search-field\"\n type=\"button\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'Search (' + chord() + ')'\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n (click)=\"open()\">\n <svg\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 aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\n <span class=\"ng-doc-search-placeholder\">Search docs\u2026</span>\n <kbd>{{ chord() }}</kbd>\n</button>\n<button\n class=\"ng-doc-search-button\"\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'Search (' + chord() + ')'\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n (click)=\"open()\">\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 aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\n</button>\n", styles: [":host{display:flex;align-items:center}.ng-doc-search-field{display:flex;align-items:center;gap:var(--ng-doc-space-2);width:220px;height:36px;padding:0 var(--ng-doc-space-2) 0 var(--ng-doc-space-3);border:1px solid var(--ng-doc-border-color);border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-1);color:var(--ng-doc-text-muted);font:400 var(--ng-doc-text-sm-size)/20px var(--ng-doc-font-family);text-align:left;cursor:pointer;transition:border-color var(--ng-doc-transition)}.ng-doc-search-field:hover{border-color:var(--ng-doc-border-hover-color)}.ng-doc-search-field:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}.ng-doc-search-field svg{flex:none}.ng-doc-search-field kbd{margin-left:auto;padding:0 6px;border:1px solid var(--ng-doc-kbd-border-color);border-radius:var(--ng-doc-radius-xs);background:var(--ng-doc-kbd-background);font:500 11px/18px var(--ng-doc-font-family);color:var(--ng-doc-text-muted)}.ng-doc-search-placeholder{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ng-doc-search-button{display:none!important}@media(max-width:1024px){.ng-doc-search-field{display:none}.ng-doc-search-button{display:inline-flex!important}}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
78
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSearchComponent, decorators: [{
|
|
40
80
|
type: Component,
|
|
41
|
-
args: [{ selector: 'ng-doc-search', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
42
|
-
NgDocButtonIconComponent,
|
|
43
|
-
NgDocDropdownOriginDirective,
|
|
44
|
-
NgDocIconComponent,
|
|
45
|
-
NgDocInputWrapperComponent,
|
|
46
|
-
NgDocInputStringDirective,
|
|
47
|
-
FormsModule,
|
|
48
|
-
NgDocHotkeyDirective,
|
|
49
|
-
NgDocTagComponent,
|
|
50
|
-
], template: "<ng-container\n [ngDocHotkey]=\"{ ctrlKey: false, altKey: false, shiftKey: false, code: 'Slash' }\"\n (ngDocHotkey)=\"open()\">\n <button ng-doc-button-icon size=\"large\" (click)=\"open()\" ngDocDropdownOrigin>\n <ng-doc-icon icon=\"search\" [size]=\"24\"></ng-doc-icon>\n </button>\n\n <ng-doc-input-wrapper ngDocDropdownOrigin>\n <ng-doc-icon icon=\"search\" ngDocInputWrapperLeft></ng-doc-icon>\n <input ngDocInputString readonly placeholder=\"Search...\" (click)=\"open()\" />\n <ng-doc-tag class=\"search-hotkey\" ngDocInputWrapperRight>/</ng-doc-tag>\n </ng-doc-input-wrapper>\n</ng-container>\n", styles: [":host{--ng-doc-floated-border-radius: var(--ng-doc-base-gutter);--ng-doc-input-background-color: var(--ng-doc-base-1);--ng-doc-input-border: none;--ng-doc-input-border-hover: none;--ng-doc-icon-color: var(--ng-doc-base-7)}:host ng-doc-input-wrapper{cursor:pointer}:host ng-doc-input-wrapper ng-doc-icon,:host ng-doc-input-wrapper ng-doc-tag{cursor:pointer}@media(max-width:1024px){:host ng-doc-input-wrapper{display:none}}@media(min-width:1024px){:host{width:240px}:host button[ng-doc-button-icon]{display:none}}.search-hotkey{display:flex;align-items:center;justify-content:center;width:calc(var(--ng-doc-base-gutter) * 3);height:calc(var(--ng-doc-base-gutter) * 3);margin-right:var(--ng-doc-base-gutter);--ng-doc-tag-border: 1px solid var(--ng-doc-base-6);--ng-doc-tag-color: var(--ng-doc-base-6);--ng-doc-tag-background: transparent}\n"] }]
|
|
81
|
+
args: [{ selector: 'ng-doc-search', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocButtonIconComponent], template: "<button\n class=\"ng-doc-search-field\"\n type=\"button\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'Search (' + chord() + ')'\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n (click)=\"open()\">\n <svg\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 aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\n <span class=\"ng-doc-search-placeholder\">Search docs\u2026</span>\n <kbd>{{ chord() }}</kbd>\n</button>\n<button\n class=\"ng-doc-search-button\"\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'Search (' + chord() + ')'\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n (click)=\"open()\">\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 aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\n</button>\n", styles: [":host{display:flex;align-items:center}.ng-doc-search-field{display:flex;align-items:center;gap:var(--ng-doc-space-2);width:220px;height:36px;padding:0 var(--ng-doc-space-2) 0 var(--ng-doc-space-3);border:1px solid var(--ng-doc-border-color);border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-1);color:var(--ng-doc-text-muted);font:400 var(--ng-doc-text-sm-size)/20px var(--ng-doc-font-family);text-align:left;cursor:pointer;transition:border-color var(--ng-doc-transition)}.ng-doc-search-field:hover{border-color:var(--ng-doc-border-hover-color)}.ng-doc-search-field:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}.ng-doc-search-field svg{flex:none}.ng-doc-search-field kbd{margin-left:auto;padding:0 6px;border:1px solid var(--ng-doc-kbd-border-color);border-radius:var(--ng-doc-radius-xs);background:var(--ng-doc-kbd-background);font:500 11px/18px var(--ng-doc-font-family);color:var(--ng-doc-text-muted)}.ng-doc-search-placeholder{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ng-doc-search-button{display:none!important}@media(max-width:1024px){.ng-doc-search-field{display:none}.ng-doc-search-button{display:inline-flex!important}}\n"] }]
|
|
51
82
|
}], ctorParameters: () => [] });
|
|
52
83
|
|
|
53
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-search.mjs","sources":["../../../../libs/app/components/search/search.component.ts","../../../../libs/app/components/search/search.component.html","../../../../libs/app/components/search/ng-doc-app-components-search.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-search.mjs","sources":["../../../../libs/app/components/search/search.component.ts","../../../../libs/app/components/search/search.component.html","../../../../libs/app/components/search/ng-doc-app-components-search.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n DOCUMENT,\n inject,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { NgDocSearchEngine } from '@ng-doc/app/classes';\nimport {\n NgDocCommandPaletteComponent,\n NgDocCommandPaletteData,\n} from '@ng-doc/app/components/command-palette';\nimport { NgDocShortcutsService } from '@ng-doc/app/services/shortcuts';\nimport {\n NgDocButtonIconComponent,\n NgDocComponentContent,\n NgDocDialogService,\n} from '@ng-doc/ui-kit';\nimport { NgDocOverlayRef } from '@ng-doc/ui-kit/classes';\n\n/**\n * The search button of the navbar. It opens the search palette on click, with Command+K\n * (Control+K) and, while single-key shortcuts are on, with the slash key. Wide screens show a\n * search field with the key hint; narrow screens show an icon button.\n */\n@Component({\n selector: 'ng-doc-search',\n templateUrl: './search.component.html',\n styleUrls: ['./search.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocButtonIconComponent],\n})\nexport class NgDocSearchComponent {\n protected readonly dialog = inject(NgDocDialogService);\n protected readonly searchEngine = inject(NgDocSearchEngine, { optional: true });\n protected readonly shortcuts = inject(NgDocShortcutsService);\n /** The chord that opens the search, as the reader's platform labels it. */\n protected readonly chord = signal('⌘K');\n\n private readonly document = inject(DOCUMENT);\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID));\n private dialogRef?: NgDocOverlayRef;\n\n constructor() {\n if (!this.searchEngine) {\n throw new Error(`NgDoc: Search engine is not provided,\n\t\t\tplease check this article: https://ng-doc.com/docs/get-started/installation#4-add-the-providers\n\t\t\tto learn how to provide it.`);\n }\n\n const removeSlash = this.shortcuts.register({ key: '/', handler: () => this.open() });\n const removeChord = this.shortcuts.register({\n key: 'k',\n chord: true,\n handler: () => (this.dialogRef ? this.dialogRef.close() : this.open()),\n });\n\n inject(DestroyRef).onDestroy(() => {\n removeSlash();\n removeChord();\n this.dialogRef?.close();\n });\n\n // The platform is known only in the browser; the server renders the macOS label.\n afterNextRender(() => {\n if (!/Mac|iPhone|iPad/i.test(this.document.defaultView?.navigator.platform ?? '')) {\n this.chord.set('Ctrl K');\n }\n });\n }\n\n /**\n * Opens the search palette. Focus returns to the element that had it when the palette closes.\n * @param query - The text the search field starts with.\n */\n open(query: string = ''): void {\n if (this.dialogRef || !this.browser) {\n return;\n }\n\n const opener = this.document.activeElement;\n const narrow = !!this.document.defaultView?.matchMedia?.('(max-width: 640px)').matches;\n const data: NgDocCommandPaletteData = { query };\n const dialogRef = this.dialog.open(new NgDocComponentContent(NgDocCommandPaletteComponent), {\n hasBackdrop: true,\n backdropClass: 'ng-doc-command-palette-backdrop',\n panelClass: ['ng-doc-transparent-dialog', 'ng-doc-command-palette-pane'],\n positionStrategy: this.dialog\n .positionStrategy()\n .centerHorizontally()\n .top(narrow ? '8px' : '10vh'),\n data,\n });\n\n this.dialogRef = dialogRef;\n dialogRef.afterClose().subscribe(() => {\n this.dialogRef = undefined;\n\n if (opener instanceof HTMLElement && opener.isConnected && opener !== this.document.body) {\n opener.focus({ preventScroll: true });\n }\n });\n }\n}\n","<button\n class=\"ng-doc-search-field\"\n type=\"button\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'Search (' + chord() + ')'\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n (click)=\"open()\">\n <svg\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 aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\n <span class=\"ng-doc-search-placeholder\">Search docs…</span>\n <kbd>{{ chord() }}</kbd>\n</button>\n<button\n class=\"ng-doc-search-button\"\n type=\"button\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'Search (' + chord() + ')'\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n (click)=\"open()\">\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 aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.5-3.5\" />\n </svg>\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAwBA;;;;AAIG;MAQU,oBAAoB,CAAA;AAW/B,IAAA,WAAA,GAAA;AAVmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACnC,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5D,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC;;QAEzC,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,IAAI;kFAAC;AAEtB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC3B,IAAA,CAAA,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAI/D,QAAA,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,CAAA;;AAES,8BAAA,CAAA,CAAC;QAC5B;QAEA,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;AACrF,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;AAC1C,YAAA,GAAG,EAAE,GAAG;AACR,YAAA,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC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
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: "
|
|
40
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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: "
|
|
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() {
|
|
75
|
-
|
|
79
|
+
/** The page. */
|
|
80
|
+
this.item = input.required(/* @ts-ignore */
|
|
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
|
+
*/
|
|
76
88
|
this.statuses = computed(() => {
|
|
77
89
|
const statuses = this.item().metadata?.tags['status'] ?? [];
|
|
78
90
|
return statuses.map((status) => {
|
|
79
|
-
|
|
80
|
-
|
|
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) };
|
|
81
96
|
});
|
|
82
|
-
},
|
|
97
|
+
}, /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "statuses" }] : /* istanbul ignore next */ []));
|
|
83
99
|
}
|
|
84
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
85
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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 }); }
|
|
86
102
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarItemComponent, decorators: [{
|
|
88
104
|
type: Component,
|
|
89
|
-
args: [{ selector: 'ng-doc-sidebar-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLinkActive, RouterLink
|
|
90
|
-
|
|
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
|
+
}
|
|
91
118
|
|
|
92
119
|
class NgDocSidebarComponent {
|
|
93
120
|
constructor() {
|
|
@@ -100,10 +127,10 @@ class NgDocSidebarComponent {
|
|
|
100
127
|
matchRoute(route) {
|
|
101
128
|
return this.location.path().includes(route ?? '', 0);
|
|
102
129
|
}
|
|
103
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
104
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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 }); }
|
|
105
132
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidebarComponent, decorators: [{
|
|
107
134
|
type: Component,
|
|
108
135
|
args: [{ selector: 'ng-doc-sidebar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
109
136
|
NgTemplateOutlet,
|
|
@@ -111,7 +138,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
111
138
|
NgDocSidebarItemComponent,
|
|
112
139
|
NgDocExecutePipe,
|
|
113
140
|
NgDocBindPipe,
|
|
114
|
-
], 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"] }]
|
|
115
142
|
}] });
|
|
116
143
|
|
|
117
144
|
/**
|