@ng-doc/app 22.0.0-beta.2 → 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 +173 -69
- package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs +13 -10
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-code.mjs +152 -25
- package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-command-palette.mjs +498 -0
- package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-copy-button.mjs +38 -21
- package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs +36 -29
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-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 +183 -89
- package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-kind-icon.mjs +42 -25
- package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-link.mjs +12 -9
- package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-members.mjs +30 -0
- package/fesm2022/ng-doc-app-components-members.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +61 -20
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-navbar.mjs +39 -49
- package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-header.mjs +73 -10
- package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-link.mjs +123 -31
- package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-navigation.mjs +17 -19
- package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs +56 -35
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page.mjs +168 -24
- package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-playground.mjs +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 +86 -61
- 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 +267 -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 +11 -5
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-members-filter.mjs +276 -0
- package/fesm2022/ng-doc-app-directives-members-filter.mjs.map +1 -0
- package/fesm2022/ng-doc-app-directives-route-active.mjs +34 -30
- package/fesm2022/ng-doc-app-directives-route-active.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives.mjs +1 -0
- package/fesm2022/ng-doc-app-directives.mjs.map +1 -1
- package/fesm2022/ng-doc-app-helpers.mjs +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 +69 -28
- package/styles/global.css +1125 -201
- package/styles/main.css +1125 -201
- 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-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-defaults-default-processors.mjs","sources":["../../../../libs/app/defaults/default-processors/default-processors.ts","../../../../libs/app/defaults/default-processors/ng-doc-app-defaults-default-processors.ts"],"sourcesContent":["import { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport {\n blockquoteProcessor,\n codeProcessor,\n demoPaneProcessor,\n demoProcessor,\n headingAnchorProcessor,\n iconProcessor,\n imageProcessor,\n linkProcessor,\n mermaidProcessor,\n playgroundProcessor,\n tabsProcessor,\n tooltipProcessor,\n} from '@ng-doc/app/processors/processors';\n\nexport const NG_DOC_DEFAULT_PAGE_PROCESSORS: NgDocPageProcessor[] = [\n /**\n * The order of the directives is important.\n * The higher the directive is in the list, the earlier it will be run.\n */\n linkProcessor,\n iconProcessor,\n headingAnchorProcessor,\n blockquoteProcessor,\n tooltipProcessor,\n mermaidProcessor,\n codeProcessor,\n demoProcessor,\n demoPaneProcessor,\n playgroundProcessor,\n tabsProcessor,\n imageProcessor,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ng-doc-app-defaults-default-processors.mjs","sources":["../../../../libs/app/defaults/default-processors/default-processors.ts","../../../../libs/app/defaults/default-processors/ng-doc-app-defaults-default-processors.ts"],"sourcesContent":["import { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport {\n blockquoteProcessor,\n codeProcessor,\n demoPaneProcessor,\n demoProcessor,\n headingAnchorProcessor,\n iconProcessor,\n imageProcessor,\n linkProcessor,\n membersProcessor,\n mermaidProcessor,\n playgroundProcessor,\n tabsProcessor,\n tooltipProcessor,\n} from '@ng-doc/app/processors/processors';\n\nexport const NG_DOC_DEFAULT_PAGE_PROCESSORS: NgDocPageProcessor[] = [\n /**\n * The order of the directives is important.\n * The higher the directive is in the list, the earlier it will be run.\n */\n linkProcessor,\n iconProcessor,\n headingAnchorProcessor,\n blockquoteProcessor,\n tooltipProcessor,\n mermaidProcessor,\n codeProcessor,\n demoProcessor,\n demoPaneProcessor,\n playgroundProcessor,\n tabsProcessor,\n imageProcessor,\n membersProcessor,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAiBO,MAAM,8BAA8B,GAAyB;AAClE;;;AAGG;IACH,aAAa;IACb,aAAa;IACb,sBAAsB;IACtB,mBAAmB;IACnB,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,gBAAgB;;;AClClB;;AAEG;;;;"}
|
|
@@ -3,28 +3,34 @@ import { input, inject, ElementRef, computed, Directive } from '@angular/core';
|
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
import { NgDocHighlighterService } from '@ng-doc/app/services';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Renders the given Angular HTML code, highlighted by `NgDocHighlighterService`, into its host
|
|
8
|
+
* element.
|
|
9
|
+
*/
|
|
6
10
|
class NgDocCodeHighlighterDirective {
|
|
7
11
|
constructor() {
|
|
12
|
+
/** The code to highlight. */
|
|
8
13
|
this.code = input.required({ ...(ngDevMode ? { debugName: "code" } : /* istanbul ignore next */ {}), alias: 'ngDocHighlighter' });
|
|
9
14
|
this.element = inject((ElementRef)).nativeElement;
|
|
10
15
|
this.highlighter = inject(NgDocHighlighterService);
|
|
11
16
|
this.sanitizer = inject(DomSanitizer);
|
|
17
|
+
// `highlight` reads the highlighter's `ready` signal, so the code is highlighted again once
|
|
18
|
+
// Shiki has loaded.
|
|
12
19
|
this.highlightedCode = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.highlighter.highlight(this.code())), /* @ts-ignore */
|
|
13
20
|
...(ngDevMode ? [{ debugName: "highlightedCode" }] : /* istanbul ignore next */ []));
|
|
14
21
|
}
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
16
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
22
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocCodeHighlighterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
23
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: NgDocCodeHighlighterDirective, isStandalone: true, selector: "[ngDocHighlighter]", inputs: { code: { classPropertyName: "code", publicName: "ngDocHighlighter", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "innerHTML": "highlightedCode()" } }, ngImport: i0 }); }
|
|
17
24
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocCodeHighlighterDirective, decorators: [{
|
|
19
26
|
type: Directive,
|
|
20
27
|
args: [{
|
|
21
28
|
selector: '[ngDocHighlighter]',
|
|
22
|
-
standalone: true,
|
|
23
29
|
host: {
|
|
24
30
|
'[innerHTML]': 'highlightedCode()',
|
|
25
31
|
},
|
|
26
32
|
}]
|
|
27
|
-
}],
|
|
33
|
+
}], propDecorators: { code: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngDocHighlighter", required: true }] }] } });
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-directives-code-highlighter.mjs","sources":["../../../../libs/app/directives/code-highlighter/code-highlighter.directive.ts","../../../../libs/app/directives/code-highlighter/ng-doc-app-directives-code-highlighter.ts"],"sourcesContent":["import { computed, Directive, ElementRef, inject, input, Signal } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { NgDocHighlighterService } from '@ng-doc/app/services';\n\n@Directive({\n selector: '[ngDocHighlighter]',\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-directives-code-highlighter.mjs","sources":["../../../../libs/app/directives/code-highlighter/code-highlighter.directive.ts","../../../../libs/app/directives/code-highlighter/ng-doc-app-directives-code-highlighter.ts"],"sourcesContent":["import { computed, Directive, ElementRef, inject, input, Signal } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { NgDocHighlighterService } from '@ng-doc/app/services';\n\n/**\n * Renders the given Angular HTML code, highlighted by `NgDocHighlighterService`, into its host\n * element.\n */\n@Directive({\n selector: '[ngDocHighlighter]',\n host: {\n '[innerHTML]': 'highlightedCode()',\n },\n})\nexport class NgDocCodeHighlighterDirective {\n /** The code to highlight. */\n readonly code = input.required<string>({ alias: 'ngDocHighlighter' });\n\n protected readonly element = inject(ElementRef<HTMLElement>).nativeElement;\n protected readonly highlighter = inject(NgDocHighlighterService);\n protected readonly sanitizer = inject(DomSanitizer);\n\n // `highlight` reads the highlighter's `ready` signal, so the code is highlighted again once\n // Shiki has loaded.\n protected readonly highlightedCode: Signal<SafeHtml> = computed(() =>\n this.sanitizer.bypassSecurityTrustHtml(this.highlighter.highlight(this.code())),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;;AAGG;MAOU,6BAA6B,CAAA;AAN1C,IAAA,WAAA,GAAA;;QAQW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,2EAAW,KAAK,EAAE,kBAAkB,EAAA,CAAG;QAElD,IAAA,CAAA,OAAO,GAAG,MAAM,EAAC,UAAuB,EAAC,CAAC,aAAa;AACvD,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC7C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;;;QAIhC,IAAA,CAAA,eAAe,GAAqB,QAAQ,CAAC,MAC9D,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;4FAChF;AACF,IAAA;8GAbY,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA7B,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBANzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,aAAa,EAAE,mBAAmB;AACnC,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Injector, signal, DestroyRef, NgZone, DOCUMENT, afterNextRender, untracked, createComponent, EnvironmentInjector, ApplicationRef, Directive } from '@angular/core';
|
|
3
|
+
import { NgDocShortcutsService } from '@ng-doc/app/services/shortcuts';
|
|
4
|
+
import { NgDocSelectionHostDirective, NgDocSelectionComponent } from '@ng-doc/ui-kit/components/selection';
|
|
5
|
+
|
|
6
|
+
const TAB = '[data-ng-doc-members-tab]';
|
|
7
|
+
const FILTER = 'input[data-ng-doc-members-filter]';
|
|
8
|
+
const MEMBER = '.ng-doc-member[data-group]';
|
|
9
|
+
const GROUP = '.ng-doc-members-group[data-group]';
|
|
10
|
+
const EXPAND = '.ng-doc-member-expand[aria-controls]';
|
|
11
|
+
const COUNT = '.ng-doc-members-count';
|
|
12
|
+
const EMPTY = '.ng-doc-members-empty';
|
|
13
|
+
const ALL = 'all';
|
|
14
|
+
const INHERITED = 'inherited';
|
|
15
|
+
/**
|
|
16
|
+
* Adds the member tabs, the name filter and the expandable method rows to the members table of
|
|
17
|
+
* an API page. The page renders every member, so the table reads well without it (on the server
|
|
18
|
+
* and before hydration); the directive only hides rows.
|
|
19
|
+
*
|
|
20
|
+
* It reads this markup inside its host: tab buttons with a data-ng-doc-members-tab attribute
|
|
21
|
+
* ("all", "inherited" or a group name, each with an optional .ng-doc-members-count), a text input
|
|
22
|
+
* with a data-ng-doc-members-filter attribute, group rows (.ng-doc-members-group with data-group)
|
|
23
|
+
* and member rows (.ng-doc-member with data-group, data-name and, for inherited members,
|
|
24
|
+
* data-inherited). A .ng-doc-member-expand button in a member row shows and hides the detail row
|
|
25
|
+
* its aria-controls names, and an optional .ng-doc-members-empty element shows when no member
|
|
26
|
+
* matches. F focuses the filter while single-key shortcuts are on.
|
|
27
|
+
*
|
|
28
|
+
* In the browser it inserts an `ng-doc-selection` as the first child of the row of tabs, the
|
|
29
|
+
* highlight that slides to the selected tab as in the code-block tabs. Until it is placed, the
|
|
30
|
+
* selected tab draws its own background, so the server-rendered page looks the same.
|
|
31
|
+
*/
|
|
32
|
+
class NgDocMembersFilterDirective {
|
|
33
|
+
constructor() {
|
|
34
|
+
this.host = inject(ElementRef).nativeElement;
|
|
35
|
+
// The tabs are plain HTML, so no element can carry ngDocSelectionOrigin: the directive selects
|
|
36
|
+
// the tab on the host of the highlight itself.
|
|
37
|
+
this.selectionInjector = Injector.create({
|
|
38
|
+
providers: [NgDocSelectionHostDirective],
|
|
39
|
+
parent: inject(Injector),
|
|
40
|
+
});
|
|
41
|
+
this.selection = this.selectionInjector.get(NgDocSelectionHostDirective);
|
|
42
|
+
this.selectedTab = signal(ALL, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "selectedTab" }] : /* istanbul ignore next */ []));
|
|
44
|
+
this.filterQuery = signal('', /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "filterQuery" }] : /* istanbul ignore next */ []));
|
|
46
|
+
this.ready = false;
|
|
47
|
+
/** The selected tab: "all", "inherited" or a group name. */
|
|
48
|
+
this.tab = this.selectedTab.asReadonly();
|
|
49
|
+
/** The text the member names are filtered by. */
|
|
50
|
+
this.query = this.filterQuery.asReadonly();
|
|
51
|
+
const destroyRef = inject(DestroyRef);
|
|
52
|
+
const ngZone = inject(NgZone);
|
|
53
|
+
const window = inject(DOCUMENT).defaultView;
|
|
54
|
+
const removeShortcut = inject(NgDocShortcutsService).register({
|
|
55
|
+
key: 'f',
|
|
56
|
+
handler: () => this.host.querySelector(FILTER)?.focus(),
|
|
57
|
+
});
|
|
58
|
+
destroyRef.onDestroy(removeShortcut);
|
|
59
|
+
// The markup is rendered by the page, so the directive only starts working in the browser.
|
|
60
|
+
afterNextRender(() => {
|
|
61
|
+
this.ready = true;
|
|
62
|
+
// The counts change the width of the tabs, so they are final before the highlight measures.
|
|
63
|
+
this.countTabs();
|
|
64
|
+
const highlight = this.createHighlight();
|
|
65
|
+
destroyRef.onDestroy(() => {
|
|
66
|
+
highlight?.destroy();
|
|
67
|
+
highlight?.location.nativeElement.remove();
|
|
68
|
+
});
|
|
69
|
+
const selected = this.tabs().find((tab) => tab.getAttribute('aria-selected') === 'true');
|
|
70
|
+
this.select(selected?.dataset['ngDocMembersTab'] ?? ALL);
|
|
71
|
+
// Rows of tabs that scroll inside themselves fade on the edge that still hides tabs.
|
|
72
|
+
const fade = () => this.fade();
|
|
73
|
+
const onScroll = (event) => {
|
|
74
|
+
if (event.target instanceof Element && event.target.querySelector(TAB)) {
|
|
75
|
+
this.fade();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
ngZone.runOutsideAngular(() => {
|
|
79
|
+
this.host.addEventListener('scroll', onScroll, true);
|
|
80
|
+
window?.addEventListener('resize', fade);
|
|
81
|
+
});
|
|
82
|
+
destroyRef.onDestroy(() => {
|
|
83
|
+
this.host.removeEventListener('scroll', onScroll, true);
|
|
84
|
+
window?.removeEventListener('resize', fade);
|
|
85
|
+
});
|
|
86
|
+
this.fade();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Shows the members of a tab.
|
|
91
|
+
* @param tab - "all", "inherited" or a group name.
|
|
92
|
+
*/
|
|
93
|
+
select(tab) {
|
|
94
|
+
untracked(() => {
|
|
95
|
+
this.selectedTab.set(tab);
|
|
96
|
+
const button = this.tabs().find((candidate) => candidate.dataset['ngDocMembersTab'] === tab);
|
|
97
|
+
for (const candidate of this.tabs()) {
|
|
98
|
+
candidate.setAttribute('aria-selected', String(candidate === button));
|
|
99
|
+
candidate.tabIndex = candidate === button ? 0 : -1;
|
|
100
|
+
}
|
|
101
|
+
this.selection.select(button);
|
|
102
|
+
this.apply();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Shows the members whose name contains the text.
|
|
107
|
+
* @param query - The text; case is ignored.
|
|
108
|
+
*/
|
|
109
|
+
filter(query) {
|
|
110
|
+
untracked(() => {
|
|
111
|
+
this.filterQuery.set(query);
|
|
112
|
+
const input = this.host.querySelector(FILTER);
|
|
113
|
+
if (input && input.value !== query) {
|
|
114
|
+
input.value = query;
|
|
115
|
+
}
|
|
116
|
+
this.apply();
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
onClick(event) {
|
|
120
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
121
|
+
const tab = target?.closest(TAB);
|
|
122
|
+
const expand = target?.closest(EXPAND);
|
|
123
|
+
if (tab && this.host.contains(tab) && !tab.hasAttribute('disabled')) {
|
|
124
|
+
this.select(tab.dataset['ngDocMembersTab'] ?? ALL);
|
|
125
|
+
}
|
|
126
|
+
else if (expand && this.host.contains(expand)) {
|
|
127
|
+
expand.setAttribute('aria-expanded', String(expand.getAttribute('aria-expanded') !== 'true'));
|
|
128
|
+
this.apply();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
onInput(event) {
|
|
132
|
+
if (event.target instanceof HTMLInputElement && event.target.matches(FILTER)) {
|
|
133
|
+
this.filter(event.target.value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
onKeydown(event) {
|
|
137
|
+
const tab = event.target instanceof Element ? event.target.closest(TAB) : null;
|
|
138
|
+
if (!tab) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const tabs = this.tabs().filter((button) => !button.hasAttribute('disabled'));
|
|
142
|
+
const index = tabs.indexOf(tab);
|
|
143
|
+
const next = event.key === 'ArrowRight'
|
|
144
|
+
? tabs[(index + 1) % tabs.length]
|
|
145
|
+
: event.key === 'ArrowLeft'
|
|
146
|
+
? tabs[(index - 1 + tabs.length) % tabs.length]
|
|
147
|
+
: event.key === 'Home'
|
|
148
|
+
? tabs[0]
|
|
149
|
+
: event.key === 'End'
|
|
150
|
+
? tabs[tabs.length - 1]
|
|
151
|
+
: undefined;
|
|
152
|
+
if (next) {
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
next.focus();
|
|
155
|
+
this.select(next.dataset['ngDocMembersTab'] ?? ALL);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Inserts the highlight of the selected tab into the row of tabs. It is the same component as in
|
|
160
|
+
* the code-block tabs, so it measures, follows resizes and animates the same way; the row is its
|
|
161
|
+
* offset parent, so it scrolls with the tabs.
|
|
162
|
+
*/
|
|
163
|
+
createHighlight() {
|
|
164
|
+
const row = this.tabs()[0]?.parentElement;
|
|
165
|
+
if (!row) {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
const hostElement = this.host.ownerDocument.createElement('ng-doc-selection');
|
|
169
|
+
row.prepend(hostElement);
|
|
170
|
+
const highlight = createComponent(NgDocSelectionComponent, {
|
|
171
|
+
environmentInjector: this.selectionInjector.get(EnvironmentInjector),
|
|
172
|
+
elementInjector: this.selectionInjector,
|
|
173
|
+
hostElement,
|
|
174
|
+
});
|
|
175
|
+
highlight.setInput('align', null);
|
|
176
|
+
this.selectionInjector.get(ApplicationRef).attachView(highlight.hostView);
|
|
177
|
+
return highlight;
|
|
178
|
+
}
|
|
179
|
+
tabs() {
|
|
180
|
+
return Array.from(this.host.querySelectorAll(TAB));
|
|
181
|
+
}
|
|
182
|
+
members() {
|
|
183
|
+
return Array.from(this.host.querySelectorAll(MEMBER));
|
|
184
|
+
}
|
|
185
|
+
countTabs() {
|
|
186
|
+
const members = this.members();
|
|
187
|
+
for (const button of this.tabs()) {
|
|
188
|
+
const tab = button.dataset['ngDocMembersTab'] ?? ALL;
|
|
189
|
+
const count = members.filter((member) => inTab(member, tab)).length;
|
|
190
|
+
const counter = button.querySelector(COUNT);
|
|
191
|
+
if (counter) {
|
|
192
|
+
counter.textContent = String(count);
|
|
193
|
+
}
|
|
194
|
+
button.toggleAttribute('disabled', tab !== ALL && count === 0);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
apply() {
|
|
198
|
+
if (!this.ready) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const tab = this.selectedTab();
|
|
202
|
+
const query = this.filterQuery().trim().toLowerCase();
|
|
203
|
+
const visible = new Map();
|
|
204
|
+
for (const member of this.members()) {
|
|
205
|
+
const group = member.dataset['group'] ?? '';
|
|
206
|
+
const name = (member.dataset['name'] ?? member.textContent ?? '').toLowerCase();
|
|
207
|
+
const shown = inTab(member, tab) && (!query || name.includes(query));
|
|
208
|
+
member.hidden = !shown;
|
|
209
|
+
visible.set(group, (visible.get(group) ?? 0) + (shown ? 1 : 0));
|
|
210
|
+
for (const expand of Array.from(member.querySelectorAll(EXPAND))) {
|
|
211
|
+
const detail = this.host.ownerDocument.getElementById(expand.getAttribute('aria-controls') ?? '');
|
|
212
|
+
if (detail && this.host.contains(detail)) {
|
|
213
|
+
detail.hidden = !shown || expand.getAttribute('aria-expanded') !== 'true';
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
for (const group of Array.from(this.host.querySelectorAll(GROUP))) {
|
|
218
|
+
const count = visible.get(group.dataset['group'] ?? '') ?? 0;
|
|
219
|
+
const counter = group.querySelector(COUNT);
|
|
220
|
+
group.hidden = count === 0;
|
|
221
|
+
if (counter) {
|
|
222
|
+
counter.textContent = String(count);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const empty = this.host.querySelector(EMPTY);
|
|
226
|
+
if (empty) {
|
|
227
|
+
empty.hidden = this.members().some((member) => !member.hidden);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
fade() {
|
|
231
|
+
const list = this.tabs()[0]?.parentElement;
|
|
232
|
+
if (!list) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const max = list.scrollWidth - list.clientWidth;
|
|
236
|
+
const edges = [
|
|
237
|
+
...(max > 1 && list.scrollLeft > 1 ? ['start'] : []),
|
|
238
|
+
...(max > 1 && list.scrollLeft < max - 1 ? ['end'] : []),
|
|
239
|
+
];
|
|
240
|
+
if (edges.length) {
|
|
241
|
+
list.dataset['fade'] = edges.join(' ');
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
delete list.dataset['fade'];
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMembersFilterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
248
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.1", type: NgDocMembersFilterDirective, isStandalone: true, selector: "[ngDocMembersFilter]", host: { listeners: { "click": "onClick($event)", "input": "onInput($event)", "keydown": "onKeydown($event)" } }, ngImport: i0 }); }
|
|
249
|
+
}
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMembersFilterDirective, decorators: [{
|
|
251
|
+
type: Directive,
|
|
252
|
+
args: [{
|
|
253
|
+
selector: '[ngDocMembersFilter]',
|
|
254
|
+
host: {
|
|
255
|
+
'(click)': 'onClick($event)',
|
|
256
|
+
'(input)': 'onInput($event)',
|
|
257
|
+
'(keydown)': 'onKeydown($event)',
|
|
258
|
+
},
|
|
259
|
+
}]
|
|
260
|
+
}], ctorParameters: () => [] });
|
|
261
|
+
/**
|
|
262
|
+
* Whether a member row belongs to a tab.
|
|
263
|
+
* @param member - The member row.
|
|
264
|
+
* @param tab - "all", "inherited" or a group name.
|
|
265
|
+
*/
|
|
266
|
+
function inTab(member, tab) {
|
|
267
|
+
return (tab === ALL ||
|
|
268
|
+
(tab === INHERITED ? member.hasAttribute('data-inherited') : member.dataset['group'] === tab));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Generated bundle index. Do not edit.
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
export { NgDocMembersFilterDirective };
|
|
276
|
+
//# sourceMappingURL=ng-doc-app-directives-members-filter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-directives-members-filter.mjs","sources":["../../../../libs/app/directives/members-filter/members-filter.directive.ts","../../../../libs/app/directives/members-filter/ng-doc-app-directives-members-filter.ts"],"sourcesContent":["import {\n afterNextRender,\n ApplicationRef,\n ComponentRef,\n createComponent,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n EnvironmentInjector,\n inject,\n Injector,\n NgZone,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport { NgDocShortcutsService } from '@ng-doc/app/services/shortcuts';\nimport {\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n} from '@ng-doc/ui-kit/components/selection';\n\nconst TAB = '[data-ng-doc-members-tab]';\nconst FILTER = 'input[data-ng-doc-members-filter]';\nconst MEMBER = '.ng-doc-member[data-group]';\nconst GROUP = '.ng-doc-members-group[data-group]';\nconst EXPAND = '.ng-doc-member-expand[aria-controls]';\nconst COUNT = '.ng-doc-members-count';\nconst EMPTY = '.ng-doc-members-empty';\nconst ALL = 'all';\nconst INHERITED = 'inherited';\n\n/**\n * Adds the member tabs, the name filter and the expandable method rows to the members table of\n * an API page. The page renders every member, so the table reads well without it (on the server\n * and before hydration); the directive only hides rows.\n *\n * It reads this markup inside its host: tab buttons with a data-ng-doc-members-tab attribute\n * (\"all\", \"inherited\" or a group name, each with an optional .ng-doc-members-count), a text input\n * with a data-ng-doc-members-filter attribute, group rows (.ng-doc-members-group with data-group)\n * and member rows (.ng-doc-member with data-group, data-name and, for inherited members,\n * data-inherited). A .ng-doc-member-expand button in a member row shows and hides the detail row\n * its aria-controls names, and an optional .ng-doc-members-empty element shows when no member\n * matches. F focuses the filter while single-key shortcuts are on.\n *\n * In the browser it inserts an `ng-doc-selection` as the first child of the row of tabs, the\n * highlight that slides to the selected tab as in the code-block tabs. Until it is placed, the\n * selected tab draws its own background, so the server-rendered page looks the same.\n */\n@Directive({\n selector: '[ngDocMembersFilter]',\n host: {\n '(click)': 'onClick($event)',\n '(input)': 'onInput($event)',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class NgDocMembersFilterDirective {\n private readonly host: HTMLElement = inject(ElementRef).nativeElement;\n // The tabs are plain HTML, so no element can carry ngDocSelectionOrigin: the directive selects\n // the tab on the host of the highlight itself.\n private readonly selectionInjector = Injector.create({\n providers: [NgDocSelectionHostDirective],\n parent: inject(Injector),\n });\n private readonly selection = this.selectionInjector.get(NgDocSelectionHostDirective);\n private readonly selectedTab = signal(ALL);\n private readonly filterQuery = signal('');\n private ready = false;\n\n /** The selected tab: \"all\", \"inherited\" or a group name. */\n readonly tab: Signal<string> = this.selectedTab.asReadonly();\n /** The text the member names are filtered by. */\n readonly query: Signal<string> = this.filterQuery.asReadonly();\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n const ngZone = inject(NgZone);\n const window = inject(DOCUMENT).defaultView;\n const removeShortcut = inject(NgDocShortcutsService).register({\n key: 'f',\n handler: () => this.host.querySelector<HTMLInputElement>(FILTER)?.focus(),\n });\n\n destroyRef.onDestroy(removeShortcut);\n\n // The markup is rendered by the page, so the directive only starts working in the browser.\n afterNextRender(() => {\n this.ready = true;\n // The counts change the width of the tabs, so they are final before the highlight measures.\n this.countTabs();\n\n const highlight = this.createHighlight();\n\n destroyRef.onDestroy(() => {\n highlight?.destroy();\n highlight?.location.nativeElement.remove();\n });\n\n const selected = this.tabs().find(\n (tab: HTMLElement) => tab.getAttribute('aria-selected') === 'true',\n );\n\n this.select(selected?.dataset['ngDocMembersTab'] ?? ALL);\n\n // Rows of tabs that scroll inside themselves fade on the edge that still hides tabs.\n const fade = () => this.fade();\n const onScroll = (event: Event) => {\n if (event.target instanceof Element && event.target.querySelector(TAB)) {\n this.fade();\n }\n };\n\n ngZone.runOutsideAngular(() => {\n this.host.addEventListener('scroll', onScroll, true);\n window?.addEventListener('resize', fade);\n });\n destroyRef.onDestroy(() => {\n this.host.removeEventListener('scroll', onScroll, true);\n window?.removeEventListener('resize', fade);\n });\n this.fade();\n });\n }\n\n /**\n * Shows the members of a tab.\n * @param tab - \"all\", \"inherited\" or a group name.\n */\n select(tab: string): void {\n untracked(() => {\n this.selectedTab.set(tab);\n\n const button = this.tabs().find(\n (candidate: HTMLElement) => candidate.dataset['ngDocMembersTab'] === tab,\n );\n\n for (const candidate of this.tabs()) {\n candidate.setAttribute('aria-selected', String(candidate === button));\n candidate.tabIndex = candidate === button ? 0 : -1;\n }\n\n this.selection.select(button);\n\n this.apply();\n });\n }\n\n /**\n * Shows the members whose name contains the text.\n * @param query - The text; case is ignored.\n */\n filter(query: string): void {\n untracked(() => {\n this.filterQuery.set(query);\n\n const input = this.host.querySelector<HTMLInputElement>(FILTER);\n\n if (input && input.value !== query) {\n input.value = query;\n }\n\n this.apply();\n });\n }\n\n protected onClick(event: MouseEvent): void {\n const target = event.target instanceof Element ? event.target : null;\n const tab = target?.closest<HTMLElement>(TAB);\n const expand = target?.closest<HTMLElement>(EXPAND);\n\n if (tab && this.host.contains(tab) && !tab.hasAttribute('disabled')) {\n this.select(tab.dataset['ngDocMembersTab'] ?? ALL);\n } else if (expand && this.host.contains(expand)) {\n expand.setAttribute('aria-expanded', String(expand.getAttribute('aria-expanded') !== 'true'));\n this.apply();\n }\n }\n\n protected onInput(event: Event): void {\n if (event.target instanceof HTMLInputElement && event.target.matches(FILTER)) {\n this.filter(event.target.value);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const tab = event.target instanceof Element ? event.target.closest<HTMLElement>(TAB) : null;\n\n if (!tab) {\n return;\n }\n\n const tabs = this.tabs().filter((button: HTMLElement) => !button.hasAttribute('disabled'));\n const index = tabs.indexOf(tab);\n const next =\n event.key === 'ArrowRight'\n ? tabs[(index + 1) % tabs.length]\n : event.key === 'ArrowLeft'\n ? tabs[(index - 1 + tabs.length) % tabs.length]\n : event.key === 'Home'\n ? tabs[0]\n : event.key === 'End'\n ? tabs[tabs.length - 1]\n : undefined;\n\n if (next) {\n event.preventDefault();\n next.focus();\n this.select(next.dataset['ngDocMembersTab'] ?? ALL);\n }\n }\n\n /**\n * Inserts the highlight of the selected tab into the row of tabs. It is the same component as in\n * the code-block tabs, so it measures, follows resizes and animates the same way; the row is its\n * offset parent, so it scrolls with the tabs.\n */\n private createHighlight(): ComponentRef<NgDocSelectionComponent> | undefined {\n const row = this.tabs()[0]?.parentElement;\n\n if (!row) {\n return undefined;\n }\n\n const hostElement = this.host.ownerDocument.createElement('ng-doc-selection');\n\n row.prepend(hostElement);\n\n const highlight = createComponent(NgDocSelectionComponent, {\n environmentInjector: this.selectionInjector.get(EnvironmentInjector),\n elementInjector: this.selectionInjector,\n hostElement,\n });\n\n highlight.setInput('align', null);\n this.selectionInjector.get(ApplicationRef).attachView(highlight.hostView);\n\n return highlight;\n }\n\n private tabs(): HTMLElement[] {\n return Array.from(this.host.querySelectorAll<HTMLElement>(TAB));\n }\n\n private members(): HTMLElement[] {\n return Array.from(this.host.querySelectorAll<HTMLElement>(MEMBER));\n }\n\n private countTabs(): void {\n const members = this.members();\n\n for (const button of this.tabs()) {\n const tab = button.dataset['ngDocMembersTab'] ?? ALL;\n const count = members.filter((member: HTMLElement) => inTab(member, tab)).length;\n const counter = button.querySelector(COUNT);\n\n if (counter) {\n counter.textContent = String(count);\n }\n\n button.toggleAttribute('disabled', tab !== ALL && count === 0);\n }\n }\n\n private apply(): void {\n if (!this.ready) {\n return;\n }\n\n const tab = this.selectedTab();\n const query = this.filterQuery().trim().toLowerCase();\n const visible = new Map<string, number>();\n\n for (const member of this.members()) {\n const group = member.dataset['group'] ?? '';\n const name = (member.dataset['name'] ?? member.textContent ?? '').toLowerCase();\n const shown = inTab(member, tab) && (!query || name.includes(query));\n\n member.hidden = !shown;\n visible.set(group, (visible.get(group) ?? 0) + (shown ? 1 : 0));\n\n for (const expand of Array.from(member.querySelectorAll<HTMLElement>(EXPAND))) {\n const detail = this.host.ownerDocument.getElementById(\n expand.getAttribute('aria-controls') ?? '',\n );\n\n if (detail && this.host.contains(detail)) {\n detail.hidden = !shown || expand.getAttribute('aria-expanded') !== 'true';\n }\n }\n }\n\n for (const group of Array.from(this.host.querySelectorAll<HTMLElement>(GROUP))) {\n const count = visible.get(group.dataset['group'] ?? '') ?? 0;\n const counter = group.querySelector(COUNT);\n\n group.hidden = count === 0;\n\n if (counter) {\n counter.textContent = String(count);\n }\n }\n\n const empty = this.host.querySelector<HTMLElement>(EMPTY);\n\n if (empty) {\n empty.hidden = this.members().some((member: HTMLElement) => !member.hidden);\n }\n }\n\n private fade(): void {\n const list = this.tabs()[0]?.parentElement;\n\n if (!list) {\n return;\n }\n\n const max = list.scrollWidth - list.clientWidth;\n const edges = [\n ...(max > 1 && list.scrollLeft > 1 ? ['start'] : []),\n ...(max > 1 && list.scrollLeft < max - 1 ? ['end'] : []),\n ];\n\n if (edges.length) {\n list.dataset['fade'] = edges.join(' ');\n } else {\n delete list.dataset['fade'];\n }\n }\n}\n\n/**\n * Whether a member row belongs to a tab.\n * @param member - The member row.\n * @param tab - \"all\", \"inherited\" or a group name.\n */\nfunction inTab(member: HTMLElement, tab: string): boolean {\n return (\n tab === ALL ||\n (tab === INHERITED ? member.hasAttribute('data-inherited') : member.dataset['group'] === tab)\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAuBA,MAAM,GAAG,GAAG,2BAA2B;AACvC,MAAM,MAAM,GAAG,mCAAmC;AAClD,MAAM,MAAM,GAAG,4BAA4B;AAC3C,MAAM,KAAK,GAAG,mCAAmC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EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBARvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA;AACF,iBAAA;;AAmRD;;;;AAIG;AACH,SAAS,KAAK,CAAC,MAAmB,EAAE,GAAW,EAAA;IAC7C,QACE,GAAG,KAAK,GAAG;SACV,GAAG,KAAK,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC;AAEjG;;ACtVA;;AAEG;;;;"}
|
|
@@ -1,48 +1,52 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Router, NavigationEnd } from '@angular/router';
|
|
2
|
+
import { input, inject, computed, Directive } from '@angular/core';
|
|
3
|
+
import { Router, isActive } from '@angular/router';
|
|
5
4
|
import { asArray } from '@ng-doc/core/helpers/as-array';
|
|
6
|
-
import { filter, map, distinctUntilChanged } from 'rxjs/operators';
|
|
7
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Adds classes to its host element while the router URL matches a link.
|
|
8
|
+
*
|
|
9
|
+
* ```html
|
|
10
|
+
* <a [ngDocRouteActive]="'/docs/getting-started'" activeClass="active">Getting started</a>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
8
13
|
class NgDocRouteActiveDirective {
|
|
9
14
|
constructor() {
|
|
10
|
-
|
|
11
|
-
this.
|
|
12
|
-
|
|
15
|
+
/** The link to match against the router URL. */
|
|
16
|
+
this.link = input('', { ...(ngDevMode ? { debugName: "link" } : /* istanbul ignore next */ {}), alias: 'ngDocRouteActive' });
|
|
17
|
+
/** Class or classes to add while the link is active. */
|
|
18
|
+
this.activeClass = input([], /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "activeClass" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** How the link is matched against the router URL. */
|
|
21
|
+
this.matchOptions = input({
|
|
13
22
|
fragment: 'exact',
|
|
14
23
|
paths: 'subset',
|
|
15
24
|
queryParams: 'exact',
|
|
16
25
|
matrixParams: 'exact',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
router.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
26
|
+
}, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "matchOptions" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.router = inject(Router);
|
|
29
|
+
// One router signal per link and options; it follows the URL the router has committed.
|
|
30
|
+
this.active = computed(() => isActive(this.link(), this.router, this.matchOptions()), /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Whether the link is active. */
|
|
33
|
+
this.isActive = computed(() => this.active()(), /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
35
|
+
this.classes = computed(() => (this.isActive() ? asArray(this.activeClass()) : []), /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
28
37
|
}
|
|
29
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
30
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocRouteActiveDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: NgDocRouteActiveDirective, isStandalone: true, selector: "[ngDocRouteActive]", inputs: { link: { classPropertyName: "link", publicName: "ngDocRouteActive", isSignal: true, isRequired: false, transformFunction: null }, activeClass: { classPropertyName: "activeClass", publicName: "activeClass", isSignal: true, isRequired: false, transformFunction: null }, matchOptions: { classPropertyName: "matchOptions", publicName: "matchOptions", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 }); }
|
|
31
40
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocRouteActiveDirective, decorators: [{
|
|
33
42
|
type: Directive,
|
|
34
43
|
args: [{
|
|
35
44
|
selector: '[ngDocRouteActive]',
|
|
36
|
-
|
|
45
|
+
host: {
|
|
46
|
+
'[class]': 'classes()',
|
|
47
|
+
},
|
|
37
48
|
}]
|
|
38
|
-
}],
|
|
39
|
-
type: Input,
|
|
40
|
-
args: ['ngDocRouteActive']
|
|
41
|
-
}], activeClass: [{
|
|
42
|
-
type: Input
|
|
43
|
-
}], matchOptions: [{
|
|
44
|
-
type: Input
|
|
45
|
-
}] } });
|
|
49
|
+
}], propDecorators: { link: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngDocRouteActive", required: false }] }], activeClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeClass", required: false }] }], matchOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "matchOptions", required: false }] }] } });
|
|
46
50
|
|
|
47
51
|
/**
|
|
48
52
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-directives-route-active.mjs","sources":["../../../../libs/app/directives/route-active/route-active.directive.ts","../../../../libs/app/directives/route-active/ng-doc-app-directives-route-active.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ng-doc-app-directives-route-active.mjs","sources":["../../../../libs/app/directives/route-active/route-active.directive.ts","../../../../libs/app/directives/route-active/ng-doc-app-directives-route-active.ts"],"sourcesContent":["import { computed, Directive, inject, input } from '@angular/core';\nimport { isActive, IsActiveMatchOptions, Router } from '@angular/router';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\n\n/**\n * Adds classes to its host element while the router URL matches a link.\n *\n * ```html\n * <a [ngDocRouteActive]=\"'/docs/getting-started'\" activeClass=\"active\">Getting started</a>\n * ```\n */\n@Directive({\n selector: '[ngDocRouteActive]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class NgDocRouteActiveDirective {\n /** The link to match against the router URL. */\n readonly link = input<string>('', { alias: 'ngDocRouteActive' });\n\n /** Class or classes to add while the link is active. */\n readonly activeClass = input<string | string[]>([]);\n\n /** How the link is matched against the router URL. */\n readonly matchOptions = input<IsActiveMatchOptions>({\n fragment: 'exact',\n paths: 'subset',\n queryParams: 'exact',\n matrixParams: 'exact',\n });\n\n private readonly router = inject(Router);\n\n // One router signal per link and options; it follows the URL the router has committed.\n private readonly active = computed(() => isActive(this.link(), this.router, this.matchOptions()));\n\n /** Whether the link is active. */\n readonly isActive = computed(() => this.active()());\n\n protected readonly classes = computed(() => (this.isActive() ? asArray(this.activeClass()) : []));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;;;;;AAMG;MAOU,yB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,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,YAAA,EAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBANrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-directives.mjs","sources":["../../../../libs/app/directives/ng-doc-app-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ng-doc-app-directives.mjs","sources":["../../../../libs/app/directives/ng-doc-app-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;AAEG"}
|