@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,38 +1,55 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Words the kind chips show for declaration kinds whose name is not already a readable word.
|
|
6
|
+
* Other kinds (and value types) are shown as they are.
|
|
7
|
+
*/
|
|
8
|
+
const NG_DOC_KIND_LABELS = {
|
|
9
|
+
TypeAlias: 'Type alias',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The label a kind chip shows for a kind.
|
|
13
|
+
* @param kind - Declaration kind (for example `Class` or `TypeAlias`) or value type (`string`).
|
|
14
|
+
* @returns The word to show, for example "Type alias".
|
|
15
|
+
*/
|
|
16
|
+
function ngDocKindLabel(kind) {
|
|
17
|
+
return NG_DOC_KIND_LABELS[kind] ?? kind;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A word chip for a declaration kind (`Class`, `Component`, `Type alias`, ...) or a value type
|
|
21
|
+
* (`string`, `boolean`, ...), coloured by the kind.
|
|
22
|
+
*/
|
|
4
23
|
class NgDocKindIconComponent {
|
|
5
24
|
constructor() {
|
|
6
|
-
|
|
7
|
-
this.
|
|
8
|
-
|
|
25
|
+
/** Declaration kind or value type. */
|
|
26
|
+
this.kind = input('', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "kind" }] : /* istanbul ignore next */ []));
|
|
28
|
+
/** Whether `kind` is a declaration kind or a value type; it selects the colours. */
|
|
29
|
+
this.type = input('declaration', /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/** `small` is the compact chip; `medium` the regular one. */
|
|
32
|
+
this.size = input('small', /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
34
|
+
/** The word the chip shows. */
|
|
35
|
+
this.label = computed(() => ngDocKindLabel(this.kind()), /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
9
37
|
}
|
|
10
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
11
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocKindIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.1", type: NgDocKindIconComponent, isStandalone: true, selector: "ng-doc-kind-icon", inputs: { kind: { classPropertyName: "kind", publicName: "kind", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-ng-doc-kind": "kind()", "attr.data-ng-doc-type": "type()", "attr.data-ng-doc-size": "size()" } }, ngImport: i0, template: '{{ label() }}', isInline: true, styles: [":host{display:inline-flex;align-items:center;flex:none;height:20px;padding:0 7px;border-radius:var(--ng-doc-radius-sm);font-family:var(--ng-doc-font-family);font-size:11.5px;font-weight:600;line-height:1;white-space:nowrap;color:color-mix(in oklab,var(--ng-doc-kind-icon-background, var(--ng-doc-hue-neutral)) var(--ng-doc-mix-strong),var(--ng-doc-heading-color));background:color-mix(in oklab,var(--ng-doc-kind-icon-background, var(--ng-doc-hue-neutral)) var(--ng-doc-kind-icon-background-opacity, var(--ng-doc-mix-chip)),var(--ng-doc-background));box-shadow:inset 0 0 0 1px color-mix(in oklab,var(--ng-doc-kind-icon-background, var(--ng-doc-hue-neutral)) 24%,transparent)}:host[data-ng-doc-size=small]{height:18px;padding:0 5px;font-size:10.5px}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Class]{--ng-doc-kind-icon-background: var(--ng-doc-class-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Interface]{--ng-doc-kind-icon-background: var(--ng-doc-interface-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Enum]{--ng-doc-kind-icon-background: var(--ng-doc-enum-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Variable]{--ng-doc-kind-icon-background: var(--ng-doc-variable-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Function]{--ng-doc-kind-icon-background: var(--ng-doc-function-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=TypeAlias]{--ng-doc-kind-icon-background: var(--ng-doc-type-alias-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Component]{--ng-doc-kind-icon-background: var(--ng-doc-component-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Directive]{--ng-doc-kind-icon-background: var(--ng-doc-directive-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Injectable]{--ng-doc-kind-icon-background: var(--ng-doc-injectable-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Pipe]{--ng-doc-kind-icon-background: var(--ng-doc-pipe-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=NgModule]{--ng-doc-kind-icon-background: var(--ng-doc-ng-module-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=ng-doc-tag-selector]{--ng-doc-kind-icon-background: var(--ng-doc-selector-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=string]{--ng-doc-kind-icon-background: var(--ng-doc-string-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=number]{--ng-doc-kind-icon-background: var(--ng-doc-number-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=boolean]{--ng-doc-kind-icon-background: var(--ng-doc-boolean-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=null]{--ng-doc-kind-icon-background: var(--ng-doc-null-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=undefined]{--ng-doc-kind-icon-background: var(--ng-doc-undefined-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=object]{--ng-doc-kind-icon-background: var(--ng-doc-object-background)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12
40
|
}
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocKindIconComponent, decorators: [{
|
|
14
42
|
type: Component,
|
|
15
|
-
args: [{ selector: 'ng-doc-kind-icon', template: '{{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}], type: [{
|
|
22
|
-
type: Input
|
|
23
|
-
}, {
|
|
24
|
-
type: HostBinding,
|
|
25
|
-
args: ['attr.data-ng-doc-type']
|
|
26
|
-
}], size: [{
|
|
27
|
-
type: Input
|
|
28
|
-
}, {
|
|
29
|
-
type: HostBinding,
|
|
30
|
-
args: ['attr.data-ng-doc-size']
|
|
31
|
-
}] } });
|
|
43
|
+
args: [{ selector: 'ng-doc-kind-icon', template: '{{ label() }}', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
44
|
+
'[attr.data-ng-doc-kind]': 'kind()',
|
|
45
|
+
'[attr.data-ng-doc-type]': 'type()',
|
|
46
|
+
'[attr.data-ng-doc-size]': 'size()',
|
|
47
|
+
}, styles: [":host{display:inline-flex;align-items:center;flex:none;height:20px;padding:0 7px;border-radius:var(--ng-doc-radius-sm);font-family:var(--ng-doc-font-family);font-size:11.5px;font-weight:600;line-height:1;white-space:nowrap;color:color-mix(in oklab,var(--ng-doc-kind-icon-background, var(--ng-doc-hue-neutral)) var(--ng-doc-mix-strong),var(--ng-doc-heading-color));background:color-mix(in oklab,var(--ng-doc-kind-icon-background, var(--ng-doc-hue-neutral)) var(--ng-doc-kind-icon-background-opacity, var(--ng-doc-mix-chip)),var(--ng-doc-background));box-shadow:inset 0 0 0 1px color-mix(in oklab,var(--ng-doc-kind-icon-background, var(--ng-doc-hue-neutral)) 24%,transparent)}:host[data-ng-doc-size=small]{height:18px;padding:0 5px;font-size:10.5px}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Class]{--ng-doc-kind-icon-background: var(--ng-doc-class-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Interface]{--ng-doc-kind-icon-background: var(--ng-doc-interface-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Enum]{--ng-doc-kind-icon-background: var(--ng-doc-enum-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Variable]{--ng-doc-kind-icon-background: var(--ng-doc-variable-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Function]{--ng-doc-kind-icon-background: var(--ng-doc-function-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=TypeAlias]{--ng-doc-kind-icon-background: var(--ng-doc-type-alias-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Component]{--ng-doc-kind-icon-background: var(--ng-doc-component-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Directive]{--ng-doc-kind-icon-background: var(--ng-doc-directive-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Injectable]{--ng-doc-kind-icon-background: var(--ng-doc-injectable-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=Pipe]{--ng-doc-kind-icon-background: var(--ng-doc-pipe-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=NgModule]{--ng-doc-kind-icon-background: var(--ng-doc-ng-module-decorator-background)}:host[data-ng-doc-type=declaration][data-ng-doc-kind=ng-doc-tag-selector]{--ng-doc-kind-icon-background: var(--ng-doc-selector-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=string]{--ng-doc-kind-icon-background: var(--ng-doc-string-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=number]{--ng-doc-kind-icon-background: var(--ng-doc-number-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=boolean]{--ng-doc-kind-icon-background: var(--ng-doc-boolean-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=null]{--ng-doc-kind-icon-background: var(--ng-doc-null-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=undefined]{--ng-doc-kind-icon-background: var(--ng-doc-undefined-background)}:host[data-ng-doc-type=type][data-ng-doc-kind=object]{--ng-doc-kind-icon-background: var(--ng-doc-object-background)}\n"] }]
|
|
48
|
+
}], propDecorators: { kind: [{ type: i0.Input, args: [{ isSignal: true, alias: "kind", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
32
49
|
|
|
33
50
|
/**
|
|
34
51
|
* Generated bundle index. Do not edit.
|
|
35
52
|
*/
|
|
36
53
|
|
|
37
|
-
export { NgDocKindIconComponent };
|
|
54
|
+
export { NG_DOC_KIND_LABELS, NgDocKindIconComponent, ngDocKindLabel };
|
|
38
55
|
//# sourceMappingURL=ng-doc-app-components-kind-icon.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-kind-icon.mjs","sources":["../../../../libs/app/components/kind-icon/kind-icon.component.ts","../../../../libs/app/components/kind-icon/ng-doc-app-components-kind-icon.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-kind-icon.mjs","sources":["../../../../libs/app/components/kind-icon/kind-icon.component.ts","../../../../libs/app/components/kind-icon/ng-doc-app-components-kind-icon.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, Signal } from '@angular/core';\n\n/**\n * Words the kind chips show for declaration kinds whose name is not already a readable word.\n * Other kinds (and value types) are shown as they are.\n */\nexport const NG_DOC_KIND_LABELS: Readonly<Record<string, string>> = {\n TypeAlias: 'Type alias',\n};\n\n/**\n * The label a kind chip shows for a kind.\n * @param kind - Declaration kind (for example `Class` or `TypeAlias`) or value type (`string`).\n * @returns The word to show, for example \"Type alias\".\n */\nexport function ngDocKindLabel(kind: string): string {\n return NG_DOC_KIND_LABELS[kind] ?? kind;\n}\n\n/**\n * A word chip for a declaration kind (`Class`, `Component`, `Type alias`, ...) or a value type\n * (`string`, `boolean`, ...), coloured by the kind.\n */\n@Component({\n selector: 'ng-doc-kind-icon',\n template: '{{ label() }}',\n styleUrls: ['./kind-icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-ng-doc-kind]': 'kind()',\n '[attr.data-ng-doc-type]': 'type()',\n '[attr.data-ng-doc-size]': 'size()',\n },\n})\nexport class NgDocKindIconComponent {\n /** Declaration kind or value type. */\n readonly kind = input<string>('');\n\n /** Whether `kind` is a declaration kind or a value type; it selects the colours. */\n readonly type = input<'declaration' | 'type'>('declaration');\n\n /** `small` is the compact chip; `medium` the regular one. */\n readonly size = input<'small' | 'medium'>('small');\n\n /** The word the chip shows. */\n protected readonly label: Signal<string> = computed(() => ngDocKindLabel(this.kind()));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;AAGG;AACI,MAAM,kBAAkB,GAAqC;AAClE,IAAA,SAAS,EAAE,YAAY;;AAGzB;;;;AAIG;AACG,SAAU,cAAc,CAAC,IAAY,EAAA;AACzC,IAAA,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,IAAI;AACzC;AAEA;;;AAGG;MAYU,sBAAsB,CAAA;AAXnC,IAAA,WAAA,GAAA;;QAaW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE;iFAAC;;QAGxB,IAAA,CAAA,IAAI,GAAG,KAAK,CAAyB,aAAa;iFAAC;;QAGnD,IAAA,CAAA,IAAI,GAAG,KAAK,CAAqB,OAAO;iFAAC;;AAG/B,QAAA,IAAA,CAAA,KAAK,GAAmB,QAAQ,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;kFAAC;AACvF,IAAA;8GAZY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,0jBATvB,eAAe,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,s+FAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FASd,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,YAClB,eAAe,EAAA,eAAA,EAER,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,yBAAyB,EAAE,QAAQ;AACnC,wBAAA,yBAAyB,EAAE,QAAQ;AACnC,wBAAA,yBAAyB,EAAE,QAAQ;AACpC,qBAAA,EAAA,MAAA,EAAA,CAAA,s+FAAA,CAAA,EAAA;;;AChCH;;AAEG;;;;"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { RouterLink } from '@angular/router';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Router link to a path of the application.
|
|
7
|
+
*/
|
|
5
8
|
class NgDocLinkComponent {
|
|
6
9
|
constructor() {
|
|
7
|
-
|
|
10
|
+
/** The path to link to. */
|
|
11
|
+
this.path = input('', /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []));
|
|
8
13
|
}
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
10
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.1", type: NgDocLinkComponent, isStandalone: true, selector: "ng-doc-link", inputs: { path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<a [routerLink]=\"[path()]\">\n <ng-content></ng-content>\n</a>\n", styles: [""], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11
16
|
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocLinkComponent, decorators: [{
|
|
13
18
|
type: Component,
|
|
14
|
-
args: [{ selector: 'ng-doc-link', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink], template: "<a [routerLink]=\"[path]\">\n
|
|
15
|
-
}], propDecorators: { path: [{
|
|
16
|
-
type: Input
|
|
17
|
-
}] } });
|
|
19
|
+
args: [{ selector: 'ng-doc-link', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink], template: "<a [routerLink]=\"[path()]\">\n <ng-content></ng-content>\n</a>\n" }]
|
|
20
|
+
}], propDecorators: { path: [{ type: i0.Input, args: [{ isSignal: true, alias: "path", required: false }] }] } });
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-link.mjs","sources":["../../../../libs/app/components/link/link.component.ts","../../../../libs/app/components/link/link.component.html","../../../../libs/app/components/link/ng-doc-app-components-link.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-link.mjs","sources":["../../../../libs/app/components/link/link.component.ts","../../../../libs/app/components/link/link.component.html","../../../../libs/app/components/link/ng-doc-app-components-link.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\n\n/**\n * Router link to a path of the application.\n */\n@Component({\n selector: 'ng-doc-link',\n templateUrl: './link.component.html',\n styleUrls: ['./link.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLink],\n})\nexport class NgDocLinkComponent {\n /** The path to link to. */\n readonly path = input<string>('');\n}\n","<a [routerLink]=\"[path()]\">\n <ng-content></ng-content>\n</a>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;AAEG;MAQU,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;;QASW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE;iFAAC;AAClC,IAAA;8GAHY,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECb/B,oEAGA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDQY,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAET,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,mBAGN,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,UAAU,CAAC,EAAA,QAAA,EAAA,oEAAA,EAAA;;;AEXvB;;AAEG;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@ng-doc/app/directives/members-filter';
|
|
4
|
+
import { NgDocMembersFilterDirective } from '@ng-doc/app/directives/members-filter';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The members table of an API page in the symbol view. The builder renders its tabs, filter and
|
|
8
|
+
* rows as the component's content, and the component adds the member filter to them.
|
|
9
|
+
*/
|
|
10
|
+
class NgDocMembersComponent {
|
|
11
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMembersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.1", type: NgDocMembersComponent, isStandalone: true, selector: "ng-doc-members", host: { classAttribute: "ng-doc-members" }, hostDirectives: [{ directive: i1.NgDocMembersFilterDirective }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMembersComponent, decorators: [{
|
|
15
|
+
type: Component,
|
|
16
|
+
args: [{
|
|
17
|
+
selector: 'ng-doc-members',
|
|
18
|
+
template: '<ng-content></ng-content>',
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
hostDirectives: [NgDocMembersFilterDirective],
|
|
21
|
+
host: { class: 'ng-doc-members' },
|
|
22
|
+
}]
|
|
23
|
+
}] });
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Generated bundle index. Do not edit.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export { NgDocMembersComponent };
|
|
30
|
+
//# sourceMappingURL=ng-doc-app-components-members.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-members.mjs","sources":["../../../../libs/app/components/members/members.component.ts","../../../../libs/app/components/members/ng-doc-app-components-members.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { NgDocMembersFilterDirective } from '@ng-doc/app/directives/members-filter';\n\n/**\n * The members table of an API page in the symbol view. The builder renders its tabs, filter and\n * rows as the component's content, and the component adds the member filter to them.\n */\n@Component({\n selector: 'ng-doc-members',\n template: '<ng-content></ng-content>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [NgDocMembersFilterDirective],\n host: { class: 'ng-doc-members' },\n})\nexport class NgDocMembersComponent {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;AAGG;MAQU,qBAAqB,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,uLALtB,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAK1B,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,cAAc,EAAE,CAAC,2BAA2B,CAAC;AAC7C,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE;AAClC,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,57 +1,102 @@
|
|
|
1
|
-
import { isPlatformBrowser } from '@angular/common';
|
|
1
|
+
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, signal, inject,
|
|
3
|
+
import { input, signal, inject, PLATFORM_ID, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
5
|
import { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';
|
|
5
6
|
import { NgDocThemeService } from '@ng-doc/app/services/theme';
|
|
6
7
|
import { NG_DOC_MERMAID } from '@ng-doc/app/tokens';
|
|
7
8
|
import { NgDocMagnifierComponent, MagnifierControllerComponent, NgDocSpinnerComponent } from '@ng-doc/ui-kit';
|
|
8
9
|
|
|
9
10
|
let id = 0;
|
|
11
|
+
/** The init directive that renders one graph with Mermaid's dark theme. */
|
|
12
|
+
const DARK_THEME_DIRECTIVE = '%%{init: {"theme": "dark"}}%%\n';
|
|
13
|
+
/**
|
|
14
|
+
* Renders a Mermaid graph in a zoomable, pannable viewer. The graph is rendered in the browser
|
|
15
|
+
* only, again when it changes and when the theme changes.
|
|
16
|
+
*
|
|
17
|
+
* In the dark theme (or `auto` with a dark OS theme) the graph uses Mermaid's dark theme, unless
|
|
18
|
+
* the graph or `provideMermaid` chooses a theme of its own.
|
|
19
|
+
*/
|
|
10
20
|
class NgDocMermaidViewerComponent {
|
|
11
21
|
constructor() {
|
|
12
|
-
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
this.
|
|
16
|
-
|
|
17
|
-
this.
|
|
22
|
+
/** Source of the Mermaid graph. */
|
|
23
|
+
this.graph = input.required(/* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "graph" }] : /* istanbul ignore next */ []));
|
|
25
|
+
this.html = signal('', /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "html" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.pending = signal(true, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []));
|
|
29
|
+
this.error = signal(null, /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
18
31
|
this.id = `ng-doc-mermaid-viewer-${id++}`;
|
|
32
|
+
// Renders are asynchronous: only the result of the latest one is shown.
|
|
33
|
+
this.renderId = 0;
|
|
34
|
+
this.document = inject(DOCUMENT);
|
|
35
|
+
this.themeService = inject(NgDocThemeService);
|
|
19
36
|
const mermaid = inject(NG_DOC_MERMAID, { optional: true });
|
|
20
37
|
if (!mermaid) {
|
|
21
38
|
throw new Error('Mermaid is not provided. Make sure that you provided mermaid using "provideMermaid" function.');
|
|
22
39
|
}
|
|
23
40
|
this.mermaid = mermaid;
|
|
24
|
-
inject(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
42
|
+
effect(() => {
|
|
43
|
+
const graph = this.graph();
|
|
44
|
+
untracked(() => void this.render(graph));
|
|
45
|
+
});
|
|
46
|
+
this.themeService
|
|
47
|
+
.themeChanges()
|
|
48
|
+
.pipe(takeUntilDestroyed())
|
|
49
|
+
.subscribe(() => void this.render(untracked(this.graph)));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Adds Mermaid's dark theme to the graph when the page is dark. A graph with front matter or an
|
|
54
|
+
* init directive, and a theme set in `provideMermaid`, are left as they are.
|
|
55
|
+
* @param graph - The graph source.
|
|
56
|
+
* @returns The graph to render.
|
|
57
|
+
*/
|
|
58
|
+
themed(graph) {
|
|
59
|
+
const theme = this.themeService.currentTheme;
|
|
60
|
+
const dark = theme === 'dark' ||
|
|
61
|
+
(theme === 'auto' &&
|
|
62
|
+
!!this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)').matches);
|
|
63
|
+
const configuredTheme = this.mermaid.mermaidAPI?.getSiteConfig?.().theme;
|
|
64
|
+
const ownTheme = /^\s*---/.test(graph) || /%%\{\s*init/.test(graph);
|
|
65
|
+
return dark && !ownTheme && (!configuredTheme || configuredTheme === 'default')
|
|
66
|
+
? DARK_THEME_DIRECTIVE + graph
|
|
67
|
+
: graph;
|
|
30
68
|
}
|
|
31
|
-
async
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
69
|
+
async render(graph) {
|
|
70
|
+
const renderId = ++this.renderId;
|
|
71
|
+
try {
|
|
72
|
+
const { svg } = await this.mermaid.render(this.id, this.themed(graph));
|
|
73
|
+
if (renderId === this.renderId) {
|
|
35
74
|
this.html.set(svg);
|
|
36
|
-
this.
|
|
75
|
+
this.error.set(null);
|
|
37
76
|
}
|
|
38
|
-
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
if (renderId === this.renderId) {
|
|
39
80
|
this.error.set(error);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
if (renderId === this.renderId) {
|
|
40
85
|
this.pending.set(false);
|
|
41
86
|
}
|
|
42
87
|
}
|
|
43
88
|
}
|
|
44
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
45
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMermaidViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
90
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocMermaidViewerComponent, isStandalone: true, selector: "ng-doc-mermaid-viewer", inputs: { graph: { classPropertyName: "graph", publicName: "graph", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n", styles: [":host{position:relative;display:block;border:var(--ng-doc-mermaid-viewer-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-mermaid-viewer-margin, var(--ng-doc-page-block-margin));background:var(--ng-doc-mermaid-viewer-background, var(--ng-doc-code-background));border-radius:var(--ng-doc-mermaid-viewer-border-radius, var(--ng-doc-radius-lg));overflow:hidden;min-height:150px}:host ng-doc-magnifier-controller{position:absolute;bottom:var(--ng-doc-space-4);right:var(--ng-doc-space-4);opacity:0;transition:opacity var(--ng-doc-transition)}@media(prefers-reduced-motion:reduce){:host ng-doc-magnifier-controller{transition:none}}@media(hover:none){:host ng-doc-magnifier-controller{opacity:1}}:host:hover ng-doc-magnifier-controller,:host:focus-within ng-doc-magnifier-controller{opacity:1}:host .ng-doc-mermaid-container{display:flex;justify-content:center;align-items:center;padding:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-preloader{display:flex;justify-content:center;align-items:center;width:100%;height:120px}:host .ng-doc-mermaid-error{display:flex;justify-content:center;align-items:center;height:120px;color:var(--ng-doc-alert)}\n"], dependencies: [{ kind: "component", type: NgDocMagnifierComponent, selector: "ng-doc-magnifier" }, { kind: "component", type: MagnifierControllerComponent, selector: "ng-doc-magnifier-controller", inputs: ["magnifier"] }, { kind: "component", type: NgDocSpinnerComponent, selector: "ng-doc-spinner", inputs: ["size"] }, { kind: "pipe", type: NgDocSanitizeHtmlPipe, name: "ngDocSanitizeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
46
91
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMermaidViewerComponent, decorators: [{
|
|
48
93
|
type: Component,
|
|
49
94
|
args: [{ selector: 'ng-doc-mermaid-viewer', imports: [
|
|
50
95
|
NgDocMagnifierComponent,
|
|
51
96
|
MagnifierControllerComponent,
|
|
52
97
|
NgDocSanitizeHtmlPipe,
|
|
53
98
|
NgDocSpinnerComponent,
|
|
54
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n", styles: [":host{position:relative;display:block;border:var(--ng-doc-mermaid-viewer-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-mermaid-viewer-margin, var(--ng-doc-page-block-margin));background:var(--ng-doc-mermaid-viewer-background, var(--ng-doc-
|
|
99
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n", styles: [":host{position:relative;display:block;border:var(--ng-doc-mermaid-viewer-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-mermaid-viewer-margin, var(--ng-doc-page-block-margin));background:var(--ng-doc-mermaid-viewer-background, var(--ng-doc-code-background));border-radius:var(--ng-doc-mermaid-viewer-border-radius, var(--ng-doc-radius-lg));overflow:hidden;min-height:150px}:host ng-doc-magnifier-controller{position:absolute;bottom:var(--ng-doc-space-4);right:var(--ng-doc-space-4);opacity:0;transition:opacity var(--ng-doc-transition)}@media(prefers-reduced-motion:reduce){:host ng-doc-magnifier-controller{transition:none}}@media(hover:none){:host ng-doc-magnifier-controller{opacity:1}}:host:hover ng-doc-magnifier-controller,:host:focus-within ng-doc-magnifier-controller{opacity:1}:host .ng-doc-mermaid-container{display:flex;justify-content:center;align-items:center;padding:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-preloader{display:flex;justify-content:center;align-items:center;width:100%;height:120px}:host .ng-doc-mermaid-error{display:flex;justify-content:center;align-items:center;height:120px;color:var(--ng-doc-alert)}\n"] }]
|
|
55
100
|
}], ctorParameters: () => [], propDecorators: { graph: [{ type: i0.Input, args: [{ isSignal: true, alias: "graph", required: true }] }] } });
|
|
56
101
|
|
|
57
102
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-mermaid-viewer.mjs","sources":["../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.ts","../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.html","../../../../libs/app/components/mermaid-viewer/ng-doc-app-components-mermaid-viewer.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-mermaid-viewer.mjs","sources":["../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.ts","../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.html","../../../../libs/app/components/mermaid-viewer/ng-doc-app-components-mermaid-viewer.ts"],"sourcesContent":["import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n PLATFORM_ID,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';\nimport { NgDocThemeService } from '@ng-doc/app/services/theme';\nimport { NG_DOC_MERMAID } from '@ng-doc/app/tokens';\nimport {\n MagnifierControllerComponent,\n NgDocMagnifierComponent,\n NgDocSpinnerComponent,\n} from '@ng-doc/ui-kit';\nimport type { Mermaid } from 'mermaid';\n\nlet id = 0;\n\n/** The init directive that renders one graph with Mermaid's dark theme. */\nconst DARK_THEME_DIRECTIVE = '%%{init: {\"theme\": \"dark\"}}%%\\n';\n\n/**\n * Renders a Mermaid graph in a zoomable, pannable viewer. The graph is rendered in the browser\n * only, again when it changes and when the theme changes.\n *\n * In the dark theme (or `auto` with a dark OS theme) the graph uses Mermaid's dark theme, unless\n * the graph or `provideMermaid` chooses a theme of its own.\n */\n@Component({\n selector: 'ng-doc-mermaid-viewer',\n imports: [\n NgDocMagnifierComponent,\n MagnifierControllerComponent,\n NgDocSanitizeHtmlPipe,\n NgDocSpinnerComponent,\n ],\n templateUrl: './mermaid-viewer.component.html',\n styleUrl: './mermaid-viewer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocMermaidViewerComponent {\n /** Source of the Mermaid graph. */\n readonly graph = input.required<string>();\n\n protected readonly html = signal('');\n protected readonly pending = signal(true);\n protected readonly error = signal<Error | null>(null);\n protected readonly mermaid: Mermaid;\n\n protected readonly id = `ng-doc-mermaid-viewer-${id++}`;\n\n // Renders are asynchronous: only the result of the latest one is shown.\n private renderId = 0;\n\n private readonly document = inject(DOCUMENT);\n private readonly themeService = inject(NgDocThemeService);\n\n constructor() {\n const mermaid = inject(NG_DOC_MERMAID, { optional: true });\n\n if (!mermaid) {\n throw new Error(\n 'Mermaid is not provided. Make sure that you provided mermaid using \"provideMermaid\" function.',\n );\n }\n\n this.mermaid = mermaid;\n\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n effect(() => {\n const graph: string = this.graph();\n\n untracked(() => void this.render(graph));\n });\n\n this.themeService\n .themeChanges()\n .pipe(takeUntilDestroyed())\n .subscribe(() => void this.render(untracked(this.graph)));\n }\n }\n\n /**\n * Adds Mermaid's dark theme to the graph when the page is dark. A graph with front matter or an\n * init directive, and a theme set in `provideMermaid`, are left as they are.\n * @param graph - The graph source.\n * @returns The graph to render.\n */\n private themed(graph: string): string {\n const theme = this.themeService.currentTheme;\n const dark =\n theme === 'dark' ||\n (theme === 'auto' &&\n !!this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)').matches);\n const configuredTheme = this.mermaid.mermaidAPI?.getSiteConfig?.().theme;\n const ownTheme = /^\\s*---/.test(graph) || /%%\\{\\s*init/.test(graph);\n\n return dark && !ownTheme && (!configuredTheme || configuredTheme === 'default')\n ? DARK_THEME_DIRECTIVE + graph\n : graph;\n }\n\n private async render(graph: string): Promise<void> {\n const renderId: number = ++this.renderId;\n\n try {\n const { svg } = await this.mermaid.render(this.id, this.themed(graph));\n\n if (renderId === this.renderId) {\n this.html.set(svg);\n this.error.set(null);\n }\n } catch (error: unknown) {\n if (renderId === this.renderId) {\n this.error.set(error as Error);\n }\n } finally {\n if (renderId === this.renderId) {\n this.pending.set(false);\n }\n }\n }\n}\n","@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1,71 +1,61 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { inject, input, booleanAttribute, viewChild, ElementRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
3
|
import { NgDocSearchComponent } from '@ng-doc/app/components/search';
|
|
5
|
-
import { NgDocSidebarService } from '@ng-doc/app/services';
|
|
6
|
-
import {
|
|
7
|
-
import { WA_WINDOW } from '@ng-web-apis/common';
|
|
8
|
-
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
9
|
-
import { combineLatest, fromEvent } from 'rxjs';
|
|
10
|
-
import { map, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
4
|
+
import { NgDocSidebarService } from '@ng-doc/app/services/sidebar';
|
|
5
|
+
import { NgDocButtonIconComponent } from '@ng-doc/ui-kit';
|
|
11
6
|
|
|
12
7
|
/**
|
|
13
|
-
* Navbar
|
|
8
|
+
* Navbar of the NgDoc application: the header bar above the sidebar and the page.
|
|
9
|
+
*
|
|
10
|
+
* It lays out, from left to right: the menu button (only where the sidebar is an overlay), the
|
|
11
|
+
* content marked with `ngDocNavbarLeft` (for example the logo), the content marked with
|
|
12
|
+
* `ngDocNavbarCenter` (for example the section links, hidden at 1024px and below), the search, and
|
|
13
|
+
* the content marked with `ngDocNavbarRight` (for example the theme toggle).
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <ng-doc-navbar>
|
|
17
|
+
* <a ngDocNavbarLeft routerLink="/">My library</a>
|
|
18
|
+
* <nav ngDocNavbarCenter aria-label="Primary"><a routerLink="/docs">Guides</a></nav>
|
|
19
|
+
* <ng-doc-theme-toggle ngDocNavbarRight />
|
|
20
|
+
* </ng-doc-navbar>
|
|
21
|
+
* ```
|
|
14
22
|
*/
|
|
15
23
|
class NgDocNavbarComponent {
|
|
16
24
|
constructor() {
|
|
17
|
-
this.window = inject(WA_WINDOW);
|
|
18
|
-
this.ngZone = inject(NgZone);
|
|
19
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
20
25
|
this.sidebarService = inject(NgDocSidebarService);
|
|
21
26
|
/**
|
|
22
27
|
* Show search input
|
|
23
28
|
*/
|
|
24
|
-
this.search = true;
|
|
29
|
+
this.search = input(true, { ...(ngDevMode ? { debugName: "search" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
25
30
|
/**
|
|
26
|
-
* Show
|
|
31
|
+
* Show the menu button that opens the sidebar where it is an overlay (900px and below).
|
|
27
32
|
*/
|
|
28
|
-
this.hamburger = true;
|
|
33
|
+
this.hamburger = input(true, { ...(ngDevMode ? { debugName: "hamburger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
29
34
|
/**
|
|
30
35
|
* Use glass effect for navbar
|
|
31
36
|
*/
|
|
32
|
-
this.glassEffect = true;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.pipe(map(([scrolled, isExpanded]) => scrolled || (isExpanded && this.sidebarService.isMobile)), takeUntilDestroyed(destroyRef))
|
|
44
|
-
.subscribe((hasShadow) => {
|
|
45
|
-
this.hasBorder = hasShadow;
|
|
46
|
-
this.changeDetectorRef.markForCheck();
|
|
47
|
-
});
|
|
48
|
-
});
|
|
37
|
+
this.glassEffect = input(true, { ...(ngDevMode ? { debugName: "glassEffect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
38
|
+
this.menuButton = viewChild('menuButton', { ...(ngDevMode ? { debugName: "menuButton" } : /* istanbul ignore next */ {}), read: (ElementRef) });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Closes the sidebar overlay and moves focus back to the menu button that opened it.
|
|
42
|
+
*/
|
|
43
|
+
closeSidebar() {
|
|
44
|
+
if (this.sidebarService.expandedState() && this.sidebarService.isMobile) {
|
|
45
|
+
this.sidebarService.hide();
|
|
46
|
+
this.menuButton()?.nativeElement.focus();
|
|
47
|
+
}
|
|
49
48
|
}
|
|
50
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
51
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocNavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocNavbarComponent, isStandalone: true, selector: "ng-doc-navbar", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, hamburger: { classPropertyName: "hamburger", publicName: "hamburger", isSignal: true, isRequired: false, transformFunction: null }, glassEffect: { classPropertyName: "glassEffect", publicName: "glassEffect", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:keydown.escape": "closeSidebar()" }, properties: { "attr.data-glass-effect": "glassEffect()" } }, viewQueries: [{ propertyName: "menuButton", first: true, predicate: ["menuButton"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div class=\"ng-doc-navbar-container\">\n @if (hamburger()) {\n <button\n type=\"button\"\n class=\"ng-doc-menu\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-controls=\"ng-doc-sidenav\"\n [attr.aria-expanded]=\"sidebarService.expandedState()\"\n [attr.aria-label]=\"sidebarService.expandedState() ? 'Close navigation' : 'Open navigation'\"\n (click)=\"sidebarService.toggle()\"\n #menuButton>\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 <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n </button>\n }\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-center\">\n <ng-content select=\"[ngDocNavbarCenter]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search()) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;justify-content:center;height:100%;background:color-mix(in srgb,var(--ng-doc-navbar-background) 82%,transparent);backdrop-filter:saturate(1.4) blur(12px);border-bottom:var(--ng-doc-navbar-border);--ng-doc-button-color: var(--ng-doc-text-muted);--ng-doc-button-hover-color: var(--ng-doc-heading-color);--ng-doc-button-active-color: var(--ng-doc-heading-color);--ng-doc-button-hover-background: var(--ng-doc-hover-background)}:host[data-glass-effect=false]{background:var(--ng-doc-navbar-background);backdrop-filter:none}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host{background:var(--ng-doc-navbar-background)}}.ng-doc-navbar-container{display:flex;align-items:center;gap:var(--ng-doc-space-4);width:100%;max-width:var(--ng-doc-app-max-width);height:100%;padding:0 var(--ng-doc-navbar-horizontal-padding)}.ng-doc-navbar-left,.ng-doc-navbar-center,.ng-doc-navbar-right{display:flex;align-items:center;gap:var(--ng-doc-space-4);min-width:0}.ng-doc-navbar-left{flex:none;max-width:var(--ng-doc-navbar-left-width)}.ng-doc-navbar-center{margin-left:auto}.ng-doc-navbar-right ng-doc-search{margin-left:var(--ng-doc-space-6)}@media(max-width:1024px){.ng-doc-navbar-right ng-doc-search{margin-left:0}}.ng-doc-menu{display:none;margin-left:calc(var(--ng-doc-space-2) * -1)}@media(max-width:1024px){.ng-doc-navbar-center{display:none}.ng-doc-navbar-right{margin-left:auto}}@media(max-width:900px){.ng-doc-menu{display:inline-flex}}@media(max-width:640px){.ng-doc-navbar-container{padding:0 var(--ng-doc-space-4)}}\n"], dependencies: [{ kind: "component", type: NgDocSearchComponent, selector: "ng-doc-search" }, { 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 }); }
|
|
52
51
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocNavbarComponent, decorators: [{
|
|
54
53
|
type: Component,
|
|
55
|
-
args: [{ selector: 'ng-doc-navbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}], glassEffect: [{
|
|
61
|
-
type: Input
|
|
62
|
-
}, {
|
|
63
|
-
type: HostBinding,
|
|
64
|
-
args: ['attr.data-glass-effect']
|
|
65
|
-
}], hasBorder: [{
|
|
66
|
-
type: HostBinding,
|
|
67
|
-
args: ['class.has-border']
|
|
68
|
-
}] } });
|
|
54
|
+
args: [{ selector: 'ng-doc-navbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocSearchComponent, NgDocButtonIconComponent], host: {
|
|
55
|
+
'[attr.data-glass-effect]': 'glassEffect()',
|
|
56
|
+
'(document:keydown.escape)': 'closeSidebar()',
|
|
57
|
+
}, template: "<div class=\"ng-doc-navbar-container\">\n @if (hamburger()) {\n <button\n type=\"button\"\n class=\"ng-doc-menu\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-controls=\"ng-doc-sidenav\"\n [attr.aria-expanded]=\"sidebarService.expandedState()\"\n [attr.aria-label]=\"sidebarService.expandedState() ? 'Close navigation' : 'Open navigation'\"\n (click)=\"sidebarService.toggle()\"\n #menuButton>\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 <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n </button>\n }\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-center\">\n <ng-content select=\"[ngDocNavbarCenter]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search()) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;justify-content:center;height:100%;background:color-mix(in srgb,var(--ng-doc-navbar-background) 82%,transparent);backdrop-filter:saturate(1.4) blur(12px);border-bottom:var(--ng-doc-navbar-border);--ng-doc-button-color: var(--ng-doc-text-muted);--ng-doc-button-hover-color: var(--ng-doc-heading-color);--ng-doc-button-active-color: var(--ng-doc-heading-color);--ng-doc-button-hover-background: var(--ng-doc-hover-background)}:host[data-glass-effect=false]{background:var(--ng-doc-navbar-background);backdrop-filter:none}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host{background:var(--ng-doc-navbar-background)}}.ng-doc-navbar-container{display:flex;align-items:center;gap:var(--ng-doc-space-4);width:100%;max-width:var(--ng-doc-app-max-width);height:100%;padding:0 var(--ng-doc-navbar-horizontal-padding)}.ng-doc-navbar-left,.ng-doc-navbar-center,.ng-doc-navbar-right{display:flex;align-items:center;gap:var(--ng-doc-space-4);min-width:0}.ng-doc-navbar-left{flex:none;max-width:var(--ng-doc-navbar-left-width)}.ng-doc-navbar-center{margin-left:auto}.ng-doc-navbar-right ng-doc-search{margin-left:var(--ng-doc-space-6)}@media(max-width:1024px){.ng-doc-navbar-right ng-doc-search{margin-left:0}}.ng-doc-menu{display:none;margin-left:calc(var(--ng-doc-space-2) * -1)}@media(max-width:1024px){.ng-doc-navbar-center{display:none}.ng-doc-navbar-right{margin-left:auto}}@media(max-width:900px){.ng-doc-menu{display:inline-flex}}@media(max-width:640px){.ng-doc-navbar-container{padding:0 var(--ng-doc-space-4)}}\n"] }]
|
|
58
|
+
}], propDecorators: { search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], hamburger: [{ type: i0.Input, args: [{ isSignal: true, alias: "hamburger", required: false }] }], glassEffect: [{ type: i0.Input, args: [{ isSignal: true, alias: "glassEffect", required: false }] }], menuButton: [{ type: i0.ViewChild, args: ['menuButton', { ...{ read: (ElementRef) }, isSignal: true }] }] } });
|
|
69
59
|
|
|
70
60
|
/**
|
|
71
61
|
* Generated bundle index. Do not edit.
|