@ng-doc/ui-kit 22.0.0 → 22.2.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/LICENSE +21 -0
- package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs +17 -9
- package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-combobox.mjs +4 -3
- package/fesm2022/ng-doc-ui-kit-components-combobox.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-pane.mjs +4 -2
- package/fesm2022/ng-doc-ui-kit-components-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs +2 -2
- package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs +11 -3
- package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-texts.mjs +35 -0
- package/fesm2022/ng-doc-ui-kit-texts.mjs.map +1 -0
- package/fesm2022/ng-doc-ui-kit.mjs +1 -0
- package/fesm2022/ng-doc-ui-kit.mjs.map +1 -1
- package/package.json +6 -2
- package/types/ng-doc-ui-kit-components-blockquote.d.ts +1 -0
- package/types/ng-doc-ui-kit-components-combobox.d.ts +1 -1
- package/types/ng-doc-ui-kit-components-pane.d.ts +2 -0
- package/types/ng-doc-ui-kit-components-tab-group.d.ts +6 -1
- package/types/ng-doc-ui-kit-texts.d.ts +58 -0
- package/types/ng-doc-ui-kit.d.ts +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Aleksandr Skoropad
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NgDocIconComponent } from '@ng-doc/ui-kit/components/icon';
|
|
4
|
+
import { NG_DOC_UI_KIT_TEXTS } from '@ng-doc/ui-kit/texts';
|
|
4
5
|
|
|
5
|
-
/** The icon
|
|
6
|
-
const
|
|
7
|
-
note:
|
|
8
|
-
warning:
|
|
9
|
-
alert:
|
|
10
|
-
success:
|
|
6
|
+
/** The icon of each built-in callout type; its title is in `NgDocBlockquoteTexts`. */
|
|
7
|
+
const BLOCKQUOTE_ICONS = {
|
|
8
|
+
note: 'info',
|
|
9
|
+
warning: 'alert-triangle',
|
|
10
|
+
alert: 'alert-circle',
|
|
11
|
+
success: 'check',
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* A callout. A Markdown blockquote whose first word is a bold type name, such as Note, renders
|
|
@@ -28,11 +29,18 @@ class NgDocBlockquoteComponent {
|
|
|
28
29
|
/** A title that replaces the type title, for example "Deprecated". */
|
|
29
30
|
this.label = input(undefined, /* @ts-ignore */
|
|
30
31
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this.texts = inject(NG_DOC_UI_KIT_TEXTS).blockquote;
|
|
31
33
|
/** The icon that is shown, if any. */
|
|
32
|
-
this.iconName = computed(() => this.icon() ||
|
|
34
|
+
this.iconName = computed(() => this.icon() || BLOCKQUOTE_ICONS[this.type()], /* @ts-ignore */
|
|
33
35
|
...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
|
|
34
36
|
/** The title that is shown, if any. */
|
|
35
|
-
this.title = computed(() =>
|
|
37
|
+
this.title = computed(() => {
|
|
38
|
+
const type = this.type();
|
|
39
|
+
return (this.label() ||
|
|
40
|
+
(this.icon() || !BLOCKQUOTE_ICONS[type]
|
|
41
|
+
? undefined
|
|
42
|
+
: this.texts[type]));
|
|
43
|
+
}, /* @ts-ignore */
|
|
36
44
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
37
45
|
}
|
|
38
46
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocBlockquoteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-blockquote.mjs","sources":["../../../../libs/ui-kit/components/blockquote/blockquote.component.ts","../../../../libs/ui-kit/components/blockquote/blockquote.component.html","../../../../libs/ui-kit/components/blockquote/ng-doc-ui-kit-components-blockquote.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, Signal } from '@angular/core';\nimport { NgDocIconComponent } from '@ng-doc/ui-kit/components/icon';\nimport { NgDocBlockquoteType } from '@ng-doc/ui-kit/types';\n\n/** The icon
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-blockquote.mjs","sources":["../../../../libs/ui-kit/components/blockquote/blockquote.component.ts","../../../../libs/ui-kit/components/blockquote/blockquote.component.html","../../../../libs/ui-kit/components/blockquote/ng-doc-ui-kit-components-blockquote.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input, Signal } from '@angular/core';\nimport { NgDocIconComponent } from '@ng-doc/ui-kit/components/icon';\nimport { NG_DOC_UI_KIT_TEXTS, NgDocBlockquoteTexts } from '@ng-doc/ui-kit/texts';\nimport { NgDocBlockquoteType } from '@ng-doc/ui-kit/types';\n\n/** The icon of each built-in callout type; its title is in `NgDocBlockquoteTexts`. */\nconst BLOCKQUOTE_ICONS: Partial<Record<NgDocBlockquoteType, string>> = {\n note: 'info',\n warning: 'alert-triangle',\n alert: 'alert-circle',\n success: 'check',\n};\n\n/**\n * A callout. A Markdown blockquote whose first word is a bold type name, such as Note, renders\n * as this component.\n *\n * The `note`, `warning`, `alert` and `success` types show their icon and their name as a title\n * (\"Note\", \"Warning\", ...). A callout with a custom `icon` shows no type title, only its `label`\n * when it has one. The `default` type has neither an icon nor a title.\n */\n@Component({\n selector: 'blockquote[ng-doc-blockquote]',\n templateUrl: './blockquote.component.html',\n styleUrls: ['./blockquote.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocIconComponent],\n host: {\n '[attr.data-ng-doc-type]': 'type()',\n '[attr.data-ng-doc-has-icon]': 'iconName() ? \"\" : null',\n },\n})\nexport class NgDocBlockquoteComponent {\n /** Callout type; it selects the colour, the icon and the title. */\n readonly type = input<NgDocBlockquoteType>('default');\n\n /** Name of an icon that replaces the type's icon; the type title is not shown then. */\n readonly icon = input<string | undefined>(undefined);\n\n /** A title that replaces the type title, for example \"Deprecated\". */\n readonly label = input<string | undefined>(undefined);\n\n private readonly texts: NgDocBlockquoteTexts = inject(NG_DOC_UI_KIT_TEXTS).blockquote;\n\n /** The icon that is shown, if any. */\n protected readonly iconName: Signal<string | undefined> = computed(\n () => this.icon() || BLOCKQUOTE_ICONS[this.type()],\n );\n\n /** The title that is shown, if any. */\n protected readonly title: Signal<string | undefined> = computed(() => {\n const type: NgDocBlockquoteType = this.type();\n\n return (\n this.label() ||\n (this.icon() || !BLOCKQUOTE_ICONS[type]\n ? undefined\n : this.texts[type as keyof NgDocBlockquoteTexts])\n );\n });\n}\n","@if (iconName(); as iconName) {\n <div class=\"ng-doc-blockquote-icon\" aria-hidden=\"true\">\n <ng-doc-icon [icon]=\"iconName\" size=\"24\"></ng-doc-icon>\n </div>\n}\n<div class=\"ng-doc-blockquote\">\n @if (title(); as title) {\n <span class=\"ng-doc-blockquote-title\">{{ title }}</span>\n }\n <ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAKA;AACA,MAAM,gBAAgB,GAAiD;AACrE,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,gBAAgB;AACzB,IAAA,KAAK,EAAE,cAAc;AACrB,IAAA,OAAO,EAAE,OAAO;CACjB;AAED;;;;;;;AAOG;MAYU,wBAAwB,CAAA;AAXrC,IAAA,WAAA,GAAA;;QAaW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAsB,SAAS;iFAAC;;QAG5C,IAAA,CAAA,IAAI,GAAG,KAAK,CAAqB,SAAS;iFAAC;;QAG3C,IAAA,CAAA,KAAK,GAAG,KAAK,CAAqB,SAAS;kFAAC;AAEpC,QAAA,IAAA,CAAA,KAAK,GAAyB,MAAM,CAAC,mBAAmB,CAAC,CAAC,UAAU;;AAGlE,QAAA,IAAA,CAAA,QAAQ,GAA+B,QAAQ,CAChE,MAAM,IAAI,CAAC,IAAI,EAAE,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;qFACnD;;AAGk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EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,YAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAMjB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAXpC,SAAS;+BACE,+BAA+B,EAAA,eAAA,EAGxB,uBAAuB,CAAC,MAAM,WACtC,CAAC,kBAAkB,CAAC,EAAA,IAAA,EACvB;AACJ,wBAAA,yBAAyB,EAAE,QAAQ;AACnC,wBAAA,6BAA6B,EAAE,wBAAwB;AACxD,qBAAA,EAAA,QAAA,EAAA,0VAAA,EAAA,MAAA,EAAA,CAAA,+qEAAA,CAAA,EAAA;;;AE9BH;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, contentChild, TemplateRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { input, inject, contentChild, TemplateRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { NgDocComboboxHostComponent } from '@ng-doc/ui-kit/cdk/combobox-host';
|
|
5
5
|
import { NgDocListHost } from '@ng-doc/ui-kit/classes/list-host';
|
|
6
6
|
import { NgDocClearControlComponent } from '@ng-doc/ui-kit/components/clear-control';
|
|
@@ -10,6 +10,7 @@ import { NgDocInputWrapperComponent } from '@ng-doc/ui-kit/components/input-wrap
|
|
|
10
10
|
import { NgDocDataDirective } from '@ng-doc/ui-kit/directives/data';
|
|
11
11
|
import { NgDocFocusCatcherDirective } from '@ng-doc/ui-kit/directives/focus-catcher';
|
|
12
12
|
import { NgDocInputStringDirective } from '@ng-doc/ui-kit/directives/input-string';
|
|
13
|
+
import { NG_DOC_UI_KIT_TEXTS } from '@ng-doc/ui-kit/texts';
|
|
13
14
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
14
15
|
import { DIControl, provideHostControl } from 'di-controls';
|
|
15
16
|
|
|
@@ -23,8 +24,8 @@ class NgDocComboboxComponent extends DIControl {
|
|
|
23
24
|
/** Whether the text field is read-only: the value is picked from the list only. */
|
|
24
25
|
this.readonly = input(false, /* @ts-ignore */
|
|
25
26
|
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
26
|
-
/** Placeholder of the text field. */
|
|
27
|
-
this.placeholder = input(
|
|
27
|
+
/** Placeholder of the text field. Defaults to the `combobox.placeholder` text. */
|
|
28
|
+
this.placeholder = input(inject(NG_DOC_UI_KIT_TEXTS).combobox.placeholder, /* @ts-ignore */
|
|
28
29
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
29
30
|
/** Whether the clear button is shown. */
|
|
30
31
|
this.clearButton = input(true, /* @ts-ignore */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-combobox.mjs","sources":["../../../../libs/ui-kit/components/combobox/combobox.component.ts","../../../../libs/ui-kit/components/combobox/combobox.component.html","../../../../libs/ui-kit/components/combobox/ng-doc-ui-kit-components-combobox.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n input,\n TemplateRef,\n} from '@angular/core';\nimport { NgDocComboboxHostComponent } from '@ng-doc/ui-kit/cdk/combobox-host';\nimport { NgDocListHost } from '@ng-doc/ui-kit/classes/list-host';\nimport { NgDocClearControlComponent } from '@ng-doc/ui-kit/components/clear-control';\nimport { NgDocDropdownComponent } from '@ng-doc/ui-kit/components/dropdown';\nimport { NgDocIconComponent } from '@ng-doc/ui-kit/components/icon';\nimport { NgDocInputWrapperComponent } from '@ng-doc/ui-kit/components/input-wrapper';\nimport { NgDocDataDirective } from '@ng-doc/ui-kit/directives/data';\nimport { NgDocFocusCatcherDirective } from '@ng-doc/ui-kit/directives/focus-catcher';\nimport { NgDocInputStringDirective } from '@ng-doc/ui-kit/directives/input-string';\nimport { NgDocContextWithImplicit } from '@ng-doc/ui-kit/interfaces';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\nimport { DIControl, provideHostControl } from 'di-controls';\n\n/**\n * A select with an optional text field. Its options are an `ng-doc-list` in a template marked\n * with the `ngDocData` directive.\n */\n@Component({\n selector: 'ng-doc-combobox',\n templateUrl: './combobox.component.html',\n styleUrls: ['./combobox.component.scss'],\n providers: [\n provideHostControl(NgDocComboboxComponent),\n {\n provide: NgDocListHost,\n useExisting: NgDocComboboxComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocComboboxHostComponent,\n NgDocInputWrapperComponent,\n NgDocFocusCatcherDirective,\n NgDocInputStringDirective,\n PolymorpheusOutlet,\n NgDocClearControlComponent,\n NgDocDropdownComponent,\n NgDocIconComponent,\n NgTemplateOutlet,\n ],\n})\nexport class NgDocComboboxComponent<T> extends DIControl<T> implements NgDocListHost {\n /** Whether the text field is read-only: the value is picked from the list only. */\n readonly readonly = input<boolean>(false);\n\n /** Placeholder of the text field. */\n readonly placeholder = input<string>(
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-combobox.mjs","sources":["../../../../libs/ui-kit/components/combobox/combobox.component.ts","../../../../libs/ui-kit/components/combobox/combobox.component.html","../../../../libs/ui-kit/components/combobox/ng-doc-ui-kit-components-combobox.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n inject,\n input,\n TemplateRef,\n} from '@angular/core';\nimport { NgDocComboboxHostComponent } from '@ng-doc/ui-kit/cdk/combobox-host';\nimport { NgDocListHost } from '@ng-doc/ui-kit/classes/list-host';\nimport { NgDocClearControlComponent } from '@ng-doc/ui-kit/components/clear-control';\nimport { NgDocDropdownComponent } from '@ng-doc/ui-kit/components/dropdown';\nimport { NgDocIconComponent } from '@ng-doc/ui-kit/components/icon';\nimport { NgDocInputWrapperComponent } from '@ng-doc/ui-kit/components/input-wrapper';\nimport { NgDocDataDirective } from '@ng-doc/ui-kit/directives/data';\nimport { NgDocFocusCatcherDirective } from '@ng-doc/ui-kit/directives/focus-catcher';\nimport { NgDocInputStringDirective } from '@ng-doc/ui-kit/directives/input-string';\nimport { NgDocContextWithImplicit } from '@ng-doc/ui-kit/interfaces';\nimport { NG_DOC_UI_KIT_TEXTS } from '@ng-doc/ui-kit/texts';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\nimport { DIControl, provideHostControl } from 'di-controls';\n\n/**\n * A select with an optional text field. Its options are an `ng-doc-list` in a template marked\n * with the `ngDocData` directive.\n */\n@Component({\n selector: 'ng-doc-combobox',\n templateUrl: './combobox.component.html',\n styleUrls: ['./combobox.component.scss'],\n providers: [\n provideHostControl(NgDocComboboxComponent),\n {\n provide: NgDocListHost,\n useExisting: NgDocComboboxComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocComboboxHostComponent,\n NgDocInputWrapperComponent,\n NgDocFocusCatcherDirective,\n NgDocInputStringDirective,\n PolymorpheusOutlet,\n NgDocClearControlComponent,\n NgDocDropdownComponent,\n NgDocIconComponent,\n NgTemplateOutlet,\n ],\n})\nexport class NgDocComboboxComponent<T> extends DIControl<T> implements NgDocListHost {\n /** Whether the text field is read-only: the value is picked from the list only. */\n readonly readonly = input<boolean>(false);\n\n /** Placeholder of the text field. Defaults to the `combobox.placeholder` text. */\n readonly placeholder = input<string>(inject(NG_DOC_UI_KIT_TEXTS).combobox.placeholder);\n\n /** Whether the clear button is shown. */\n readonly clearButton = input<boolean>(true);\n\n /** Content shown at the right of the field. */\n readonly rightContent = input<NgDocContent>('');\n\n /** Content that shows the value while the field is not being edited. */\n readonly valueContent = input<NgDocContent<NgDocContextWithImplicit<T | null>>>('');\n\n /** The template of the options, marked with the `ngDocData` directive. */\n readonly data = contentChild(NgDocDataDirective, { read: TemplateRef });\n\n constructor() {\n super();\n }\n\n get listHostOrigin(): HTMLElement {\n return this.elementRef.nativeElement;\n }\n}\n","<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent() : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly()\" [placeholder]=\"placeholder()\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent()\"></ng-container>\n @if (clearButton()) {\n <ng-doc-clear-control></ng-doc-clear-control>\n }\n @if (readonly()) {\n <ng-doc-icon\n class=\"ng-doc-combobox-chevron\"\n icon=\"chevron-right\"\n aria-hidden=\"true\"></ng-doc-icon>\n }\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data() ?? null\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwBA;;;AAGG;AAyBG,MAAO,sBAA0B,SAAQ,SAAY,CAAA;AAmBzD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;QAlBA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK;qFAAC;;QAGhC,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,MAAM,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,WAAW;wFAAC;;QAG7E,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,IAAI;wFAAC;;QAGlC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAe,EAAE;yFAAC;;QAGtC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAmD,EAAE;yFAAC;;QAG1E,IAAA,CAAA,IAAI,GAAG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A,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,kBAAkB,CAAA,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErExE;;AAEG;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, inject, DOCUMENT, ElementRef, NgZone, input, viewChild, signal, DestroyRef, afterRenderEffect, untracked, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { NG_DOC_UI_KIT_TEXTS } from '@ng-doc/ui-kit/texts';
|
|
4
5
|
import { fromEvent, merge } from 'rxjs';
|
|
5
6
|
import { tap, map, pairwise, switchMap, takeUntil, take, filter, debounceTime } from 'rxjs/operators';
|
|
6
7
|
|
|
@@ -34,6 +35,7 @@ const KEYBOARD_STEP = 0.1;
|
|
|
34
35
|
*/
|
|
35
36
|
class NgDocPaneComponent {
|
|
36
37
|
constructor() {
|
|
38
|
+
this.texts = inject(NG_DOC_UI_KIT_TEXTS).pane;
|
|
37
39
|
this.document = inject(DOCUMENT);
|
|
38
40
|
this.elementRef = inject(ElementRef);
|
|
39
41
|
this.ngZone = inject(NgZone);
|
|
@@ -118,13 +120,13 @@ class NgDocPaneComponent {
|
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
121
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.1", type: NgDocPaneComponent, isStandalone: true, selector: "ng-doc-pane", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-ng-doc-dragging": "dragging()" } }, viewQueries: [{ propertyName: "resizer", first: true, predicate: ["resizer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ng-doc-pane-back\" [style.width]=\"width()\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneBack]\"></ng-content>\n </div>\n</div>\n<div\n class=\"ng-doc-pane-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-
|
|
123
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.1", type: NgDocPaneComponent, isStandalone: true, selector: "ng-doc-pane", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-ng-doc-dragging": "dragging()" } }, viewQueries: [{ propertyName: "resizer", first: true, predicate: ["resizer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ng-doc-pane-back\" [style.width]=\"width()\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneBack]\"></ng-content>\n </div>\n</div>\n<div\n class=\"ng-doc-pane-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"texts.resizer\"\n [attr.aria-valuenow]=\"valueNow()\"\n tabindex=\"0\"\n (keydown)=\"onKeydown($event)\"\n #resizer></div>\n<div class=\"ng-doc-pane-front\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneFront]\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;width:100%;border-radius:var(--ng-doc-pane-border-radius, var(--ng-doc-base-gutter));border:var(--ng-doc-pane-border, 1px solid var(--ng-doc-border-color));overflow:hidden}:host[data-ng-doc-dragging=false] .ng-doc-pane-back{transition:var(--ng-doc-transition) width}:host .ng-doc-pane-front{position:relative;display:flex;width:100%;background-color:var(--ng-doc-pane-front-background, var(--ng-doc-pane-background, var(--ng-doc-base-1)));overflow:hidden;border-top-right-radius:var(--ng-doc-base-gutter);border-bottom-right-radius:var(--ng-doc-base-gutter);border:var(--ng-doc-pane-front-border, var(--ng-doc-pane-border))}:host .ng-doc-pane-back{position:relative;display:flex;flex-shrink:0;width:100%;background-color:var(--ng-doc-pane-back-background, var(--ng-doc-pane-background, var(--ng-doc-base-1)));overflow:hidden;border-top-left-radius:var(--ng-doc-base-gutter);border-bottom-left-radius:var(--ng-doc-base-gutter);border:var(--ng-doc-pane-back-border, var(--ng-doc-pane-border))}:host .ng-doc-pane-resizer{position:relative;flex-shrink:0;transform:translateZ(0);background-color:var(--ng-doc-base-3);width:16px;display:block;cursor:ew-resize}:host .ng-doc-pane-resizer:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ng-doc-focus-ring-color)}:host .ng-doc-pane-resizer:after{content:\"\";display:flex;background:var(--ng-doc-base-10);border-radius:50px;position:absolute;width:4px;height:20%;top:50%;left:50%;transform:translateY(-50%) translate(-50%);opacity:1;transition:var(--ng-doc-transition) height}:host .ng-doc-pane-content{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:100%;height:100%;min-width:var(--ng-doc-pane-content-min-width, 200px)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
122
124
|
}
|
|
123
125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocPaneComponent, decorators: [{
|
|
124
126
|
type: Component,
|
|
125
127
|
args: [{ selector: 'ng-doc-pane', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
126
128
|
'[attr.data-ng-doc-dragging]': 'dragging()',
|
|
127
|
-
}, template: "<div class=\"ng-doc-pane-back\" [style.width]=\"width()\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneBack]\"></ng-content>\n </div>\n</div>\n<div\n class=\"ng-doc-pane-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-
|
|
129
|
+
}, template: "<div class=\"ng-doc-pane-back\" [style.width]=\"width()\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneBack]\"></ng-content>\n </div>\n</div>\n<div\n class=\"ng-doc-pane-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"texts.resizer\"\n [attr.aria-valuenow]=\"valueNow()\"\n tabindex=\"0\"\n (keydown)=\"onKeydown($event)\"\n #resizer></div>\n<div class=\"ng-doc-pane-front\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneFront]\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;width:100%;border-radius:var(--ng-doc-pane-border-radius, var(--ng-doc-base-gutter));border:var(--ng-doc-pane-border, 1px solid var(--ng-doc-border-color));overflow:hidden}:host[data-ng-doc-dragging=false] .ng-doc-pane-back{transition:var(--ng-doc-transition) width}:host .ng-doc-pane-front{position:relative;display:flex;width:100%;background-color:var(--ng-doc-pane-front-background, var(--ng-doc-pane-background, var(--ng-doc-base-1)));overflow:hidden;border-top-right-radius:var(--ng-doc-base-gutter);border-bottom-right-radius:var(--ng-doc-base-gutter);border:var(--ng-doc-pane-front-border, var(--ng-doc-pane-border))}:host .ng-doc-pane-back{position:relative;display:flex;flex-shrink:0;width:100%;background-color:var(--ng-doc-pane-back-background, var(--ng-doc-pane-background, var(--ng-doc-base-1)));overflow:hidden;border-top-left-radius:var(--ng-doc-base-gutter);border-bottom-left-radius:var(--ng-doc-base-gutter);border:var(--ng-doc-pane-back-border, var(--ng-doc-pane-border))}:host .ng-doc-pane-resizer{position:relative;flex-shrink:0;transform:translateZ(0);background-color:var(--ng-doc-base-3);width:16px;display:block;cursor:ew-resize}:host .ng-doc-pane-resizer:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ng-doc-focus-ring-color)}:host .ng-doc-pane-resizer:after{content:\"\";display:flex;background:var(--ng-doc-base-10);border-radius:50px;position:absolute;width:4px;height:20%;top:50%;left:50%;transform:translateY(-50%) translate(-50%);opacity:1;transition:var(--ng-doc-transition) height}:host .ng-doc-pane-content{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:100%;height:100%;min-width:var(--ng-doc-pane-content-min-width, 200px)}\n"] }]
|
|
128
130
|
}], ctorParameters: () => [], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], resizer: [{ type: i0.ViewChild, args: ['resizer', { isSignal: true }] }] } });
|
|
129
131
|
|
|
130
132
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-pane.mjs","sources":["../../../../libs/ui-kit/components/pane/pane.component.ts","../../../../libs/ui-kit/components/pane/pane.component.html","../../../../libs/ui-kit/components/pane/ng-doc-ui-kit-components-pane.ts"],"sourcesContent":["import {\n afterNextRender,\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n NgZone,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, merge, Observable } from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n pairwise,\n switchMap,\n take,\n takeUntil,\n tap,\n} from 'rxjs/operators';\n\n/** Marks the content in front of an `ng-doc-pane` (the right side). */\n@Directive({\n selector: '[ngDocPaneFront]',\n})\nexport class NgDocPaneFrontDirective {}\n\n/** Marks the content behind an `ng-doc-pane` (the left side, revealed by dragging). */\n@Directive({\n selector: '[ngDocPaneBack]',\n})\nexport class NgDocPaneBackDirective {}\n\n/** The share of the pane a keyboard step moves the resizer by. */\nconst KEYBOARD_STEP = 0.1;\n\n/**\n * Two panes side by side with a resizer between them. Drag the resizer, click it or use the\n * arrow keys on it to reveal the back pane; Enter or Space toggles it.\n */\n@Component({\n selector: 'ng-doc-pane',\n templateUrl: './pane.component.html',\n styleUrls: ['./pane.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-ng-doc-dragging]': 'dragging()',\n },\n})\nexport class NgDocPaneComponent {\n private readonly document = inject<Document>(DOCUMENT);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly ngZone = inject(NgZone);\n\n /** Whether the back pane is revealed. */\n readonly expanded = input<boolean>(false);\n\n /** The resizer between the panes. */\n readonly resizer = viewChild.required<ElementRef<HTMLElement>>('resizer');\n\n /** Width of the back pane, as a CSS length. */\n readonly width = signal<string>('0px');\n\n /** Share of the pane the back pane takes, in percent, for assistive technology. */\n protected readonly valueNow = signal<number>(0);\n\n /** Whether the resizer is being dragged. */\n protected readonly dragging = signal<boolean>(false);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // Opens or closes the back pane when `expanded` changes; it measures, so it runs after render.\n afterRenderEffect({\n write: () => {\n const expanded: boolean = this.expanded();\n\n untracked(() => {\n const width: number = this.elementRef.nativeElement.offsetWidth;\n\n this.addDelta(expanded ? width : -width);\n });\n },\n });\n\n // Pointer and resize events arrive often; they are handled outside the Angular zone, and the\n // signals they write schedule the render.\n afterNextRender(() =>\n this.ngZone.runOutsideAngular(() => {\n const resizer: HTMLElement = this.resizer().nativeElement;\n const mouseDown$ = fromEvent(resizer, 'mousedown').pipe(tap(() => this.dragging.set(true)));\n const mouseUp$ = fromEvent(this.document, 'mouseup').pipe(\n tap(() => this.dragging.set(false)),\n );\n const mouseMove$ = (fromEvent(this.document, 'mousemove') as Observable<MouseEvent>).pipe(\n map((event: MouseEvent) => event.clientX),\n pairwise(),\n map(([prev, next]: [number, number]) => next - prev),\n );\n\n mouseDown$\n .pipe(\n switchMap(() =>\n merge(\n mouseMove$.pipe(takeUntil(mouseUp$)),\n mouseUp$.pipe(\n map(() => null),\n takeUntil(mouseMove$),\n take(1),\n ),\n ),\n ),\n filter((delta: number | null) => delta !== 0),\n takeUntilDestroyed(destroyRef),\n )\n .subscribe((delta: number | null) =>\n delta === null ? this.toggle() : this.addDelta(delta),\n );\n\n fromEvent(this.document.defaultView ?? window, 'resize')\n .pipe(debounceTime(100), takeUntilDestroyed(destroyRef))\n .subscribe(() => this.addDelta(0));\n }),\n );\n }\n\n /** Reveals the back pane when it is mostly hidden, and hides it otherwise. */\n toggle(): void {\n untracked(() => {\n const width: number = this.elementRef.nativeElement.offsetWidth;\n\n this.addDelta(this.resizer().nativeElement.offsetLeft < width / 2 ? width : -width);\n });\n }\n\n /**\n * Moves the resizer with the keyboard.\n * @param event - The key press on the resizer.\n */\n protected onKeydown(event: KeyboardEvent): void {\n const step: number = this.elementRef.nativeElement.offsetWidth * KEYBOARD_STEP;\n const width: number = this.elementRef.nativeElement.offsetWidth;\n const delta: number | undefined = {\n ArrowRight: step,\n ArrowLeft: -step,\n Home: -width,\n End: width,\n }[event.key];\n\n if (delta !== undefined) {\n event.preventDefault();\n this.addDelta(delta);\n } else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.toggle();\n }\n }\n\n private addDelta(delta: number): void {\n const host: HTMLElement = this.elementRef.nativeElement;\n const resizer: HTMLElement | undefined = this.resizer()?.nativeElement;\n\n if (resizer) {\n const maxWidth: number = host.offsetWidth - resizer.offsetWidth;\n const width: number = Math.min(maxWidth, Math.max(0, resizer.offsetLeft + delta));\n\n this.width.set(`${width}px`);\n this.valueNow.set(maxWidth > 0 ? Math.round((width / maxWidth) * 100) : 0);\n }\n }\n}\n","<div class=\"ng-doc-pane-back\" [style.width]=\"width()\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneBack]\"></ng-content>\n </div>\n</div>\n<div\n class=\"ng-doc-pane-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize the panes\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"valueNow()\"\n tabindex=\"0\"\n (keydown)=\"onKeydown($event)\"\n #resizer></div>\n<div class=\"ng-doc-pane-front\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneFront]\"></ng-content>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA6BA;MAIa,uBAAuB,CAAA;8GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2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AA;;2FDoCa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAT9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,eAAA,EAGN,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,6BAA6B,EAAE,YAAY;AAC5C,qBAAA,EAAA,QAAA,EAAA,wmBAAA,EAAA,MAAA,EAAA,CAAA,+sDAAA,CAAA,EAAA;+LAW8D,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElE1E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-pane.mjs","sources":["../../../../libs/ui-kit/components/pane/pane.component.ts","../../../../libs/ui-kit/components/pane/pane.component.html","../../../../libs/ui-kit/components/pane/ng-doc-ui-kit-components-pane.ts"],"sourcesContent":["import {\n afterNextRender,\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n NgZone,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NG_DOC_UI_KIT_TEXTS, NgDocPaneTexts } from '@ng-doc/ui-kit/texts';\nimport { fromEvent, merge, Observable } from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n pairwise,\n switchMap,\n take,\n takeUntil,\n tap,\n} from 'rxjs/operators';\n\n/** Marks the content in front of an `ng-doc-pane` (the right side). */\n@Directive({\n selector: '[ngDocPaneFront]',\n})\nexport class NgDocPaneFrontDirective {}\n\n/** Marks the content behind an `ng-doc-pane` (the left side, revealed by dragging). */\n@Directive({\n selector: '[ngDocPaneBack]',\n})\nexport class NgDocPaneBackDirective {}\n\n/** The share of the pane a keyboard step moves the resizer by. */\nconst KEYBOARD_STEP = 0.1;\n\n/**\n * Two panes side by side with a resizer between them. Drag the resizer, click it or use the\n * arrow keys on it to reveal the back pane; Enter or Space toggles it.\n */\n@Component({\n selector: 'ng-doc-pane',\n templateUrl: './pane.component.html',\n styleUrls: ['./pane.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-ng-doc-dragging]': 'dragging()',\n },\n})\nexport class NgDocPaneComponent {\n protected readonly texts: NgDocPaneTexts = inject(NG_DOC_UI_KIT_TEXTS).pane;\n\n private readonly document = inject<Document>(DOCUMENT);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly ngZone = inject(NgZone);\n\n /** Whether the back pane is revealed. */\n readonly expanded = input<boolean>(false);\n\n /** The resizer between the panes. */\n readonly resizer = viewChild.required<ElementRef<HTMLElement>>('resizer');\n\n /** Width of the back pane, as a CSS length. */\n readonly width = signal<string>('0px');\n\n /** Share of the pane the back pane takes, in percent, for assistive technology. */\n protected readonly valueNow = signal<number>(0);\n\n /** Whether the resizer is being dragged. */\n protected readonly dragging = signal<boolean>(false);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // Opens or closes the back pane when `expanded` changes; it measures, so it runs after render.\n afterRenderEffect({\n write: () => {\n const expanded: boolean = this.expanded();\n\n untracked(() => {\n const width: number = this.elementRef.nativeElement.offsetWidth;\n\n this.addDelta(expanded ? width : -width);\n });\n },\n });\n\n // Pointer and resize events arrive often; they are handled outside the Angular zone, and the\n // signals they write schedule the render.\n afterNextRender(() =>\n this.ngZone.runOutsideAngular(() => {\n const resizer: HTMLElement = this.resizer().nativeElement;\n const mouseDown$ = fromEvent(resizer, 'mousedown').pipe(tap(() => this.dragging.set(true)));\n const mouseUp$ = fromEvent(this.document, 'mouseup').pipe(\n tap(() => this.dragging.set(false)),\n );\n const mouseMove$ = (fromEvent(this.document, 'mousemove') as Observable<MouseEvent>).pipe(\n map((event: MouseEvent) => event.clientX),\n pairwise(),\n map(([prev, next]: [number, number]) => next - prev),\n );\n\n mouseDown$\n .pipe(\n switchMap(() =>\n merge(\n mouseMove$.pipe(takeUntil(mouseUp$)),\n mouseUp$.pipe(\n map(() => null),\n takeUntil(mouseMove$),\n take(1),\n ),\n ),\n ),\n filter((delta: number | null) => delta !== 0),\n takeUntilDestroyed(destroyRef),\n )\n .subscribe((delta: number | null) =>\n delta === null ? this.toggle() : this.addDelta(delta),\n );\n\n fromEvent(this.document.defaultView ?? window, 'resize')\n .pipe(debounceTime(100), takeUntilDestroyed(destroyRef))\n .subscribe(() => this.addDelta(0));\n }),\n );\n }\n\n /** Reveals the back pane when it is mostly hidden, and hides it otherwise. */\n toggle(): void {\n untracked(() => {\n const width: number = this.elementRef.nativeElement.offsetWidth;\n\n this.addDelta(this.resizer().nativeElement.offsetLeft < width / 2 ? width : -width);\n });\n }\n\n /**\n * Moves the resizer with the keyboard.\n * @param event - The key press on the resizer.\n */\n protected onKeydown(event: KeyboardEvent): void {\n const step: number = this.elementRef.nativeElement.offsetWidth * KEYBOARD_STEP;\n const width: number = this.elementRef.nativeElement.offsetWidth;\n const delta: number | undefined = {\n ArrowRight: step,\n ArrowLeft: -step,\n Home: -width,\n End: width,\n }[event.key];\n\n if (delta !== undefined) {\n event.preventDefault();\n this.addDelta(delta);\n } else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.toggle();\n }\n }\n\n private addDelta(delta: number): void {\n const host: HTMLElement = this.elementRef.nativeElement;\n const resizer: HTMLElement | undefined = this.resizer()?.nativeElement;\n\n if (resizer) {\n const maxWidth: number = host.offsetWidth - resizer.offsetWidth;\n const width: number = Math.min(maxWidth, Math.max(0, resizer.offsetLeft + delta));\n\n this.width.set(`${width}px`);\n this.valueNow.set(maxWidth > 0 ? Math.round((width / maxWidth) * 100) : 0);\n }\n }\n}\n","<div class=\"ng-doc-pane-back\" [style.width]=\"width()\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneBack]\"></ng-content>\n </div>\n</div>\n<div\n class=\"ng-doc-pane-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"texts.resizer\"\n [attr.aria-valuenow]=\"valueNow()\"\n tabindex=\"0\"\n (keydown)=\"onKeydown($event)\"\n #resizer></div>\n<div class=\"ng-doc-pane-front\">\n <div class=\"ng-doc-pane-content\">\n <ng-content select=\"[ngDocPaneFront]\"></ng-content>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA8BA;MAIa,uBAAuB,CAAA;8GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC7B,iBAAA;;AAGD;MAIa,sBAAsB,CAAA;8GAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC5B,iBAAA;;AAGD;AACA,MAAM,aAAa,GAAG,GAAG;AAEzB;;;AAGG;MAUU,kBAAkB,CAAA;AAsB7B,IAAA,WAAA,GAAA;AArBmB,QAAA,IAAA,CAAA,KAAK,GAAmB,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAA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,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,EAAG,KAAK,CAAA,EAAA,CAAI,CAAC;AAC5B,YAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5E;IACF;8GA1HW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,6YC1D/B,4mBAqBA,EAAA,MAAA,EAAA,CAAA,+sDAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDqCa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAT9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,eAAA,EAGN,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,6BAA6B,EAAE,YAAY;AAC5C,qBAAA,EAAA,QAAA,EAAA,4mBAAA,EAAA,MAAA,EAAA,CAAA,+sDAAA,CAAA,EAAA;+LAa8D,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErE1E;;AAEG;;;;"}
|
|
@@ -31,14 +31,14 @@ class NgDocSidenavComponent {
|
|
|
31
31
|
this.closeEvent = output();
|
|
32
32
|
}
|
|
33
33
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
34
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocSidenavComponent, isStandalone: true, selector: "ng-doc-sidenav", inputs: { sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEvent: "closeEvent" }, host: { properties: { "attr.data-ng-doc-sidebar": "!!sidebar()", "attr.data-ng-doc-opened": "opened()" } }, ngImport: i0, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-navbar-height);width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:900px){:host .ng-doc-sidenav{left:calc(var(--ng-doc-sidenav-width) * -1);max-width:100%;visibility:hidden;transition:left var(--ng-doc-transition),visibility var(--ng-doc-transition)}:host[data-ng-doc-opened=true] .ng-doc-sidenav{left:0;visibility:visible;--ng-doc-sidebar-shadow: var(--ng-doc-shadow-lg)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}@media(prefers-reduced-motion:reduce){:host .ng-doc-sidenav,:host .ng-doc-sidenav-content{transition:none}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
34
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocSidenavComponent, isStandalone: true, selector: "ng-doc-sidenav", inputs: { sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEvent: "closeEvent" }, host: { properties: { "attr.data-ng-doc-sidebar": "!!sidebar()", "attr.data-ng-doc-opened": "opened()" } }, ngImport: i0, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-sidenav-top, var(--ng-doc-navbar-height));width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:900px){:host .ng-doc-sidenav{left:calc(var(--ng-doc-sidenav-width) * -1);max-width:100%;visibility:hidden;transition:left var(--ng-doc-transition),visibility var(--ng-doc-transition)}:host[data-ng-doc-opened=true] .ng-doc-sidenav{left:0;visibility:visible;--ng-doc-sidebar-shadow: var(--ng-doc-shadow-lg)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}@media(prefers-reduced-motion:reduce){:host .ng-doc-sidenav,:host .ng-doc-sidenav-content{transition:none}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
35
35
|
}
|
|
36
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSidenavComponent, decorators: [{
|
|
37
37
|
type: Component,
|
|
38
38
|
args: [{ selector: 'ng-doc-sidenav', changeDetection: ChangeDetectionStrategy.OnPush, imports: [PolymorpheusOutlet], host: {
|
|
39
39
|
'[attr.data-ng-doc-sidebar]': '!!sidebar()',
|
|
40
40
|
'[attr.data-ng-doc-opened]': 'opened()',
|
|
41
|
-
}, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-navbar-height);width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:900px){:host .ng-doc-sidenav{left:calc(var(--ng-doc-sidenav-width) * -1);max-width:100%;visibility:hidden;transition:left var(--ng-doc-transition),visibility var(--ng-doc-transition)}:host[data-ng-doc-opened=true] .ng-doc-sidenav{left:0;visibility:visible;--ng-doc-sidebar-shadow: var(--ng-doc-shadow-lg)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}@media(prefers-reduced-motion:reduce){:host .ng-doc-sidenav,:host .ng-doc-sidenav-content{transition:none}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
41
|
+
}, template: "<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{width:100%}:host[data-ng-doc-sidebar=false] .ng-doc-sidenav-content{margin-left:0;width:100%}:host .ng-doc-sidenav-wrapper{position:relative;display:flex;width:100%}:host .ng-doc-sidenav{position:fixed;top:var(--ng-doc-sidenav-top, var(--ng-doc-navbar-height));width:var(--ng-doc-sidenav-width);flex-shrink:0;z-index:10;transition:left var(--ng-doc-transition)}:host .ng-doc-sidenav-content{margin-left:var(--ng-doc-sidenav-width);width:calc(100% - var(--ng-doc-sidenav-width));padding:var(--ng-doc-sidenav-content-padding);transition:margin-left var(--ng-doc-transition)}:host .ng-doc-backdrop:not(nothing){background:color-mix(in srgb,rgba(0,0,0,.2) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host .ng-doc-backdrop{background-color:#0003}}:host .ng-doc-backdropnothing{background-color:#0003}:host .ng-doc-backdrop{position:fixed!important;left:0;top:0;width:100%;height:100%;z-index:9}@media(max-width:900px){:host .ng-doc-sidenav{left:calc(var(--ng-doc-sidenav-width) * -1);max-width:100%;visibility:hidden;transition:left var(--ng-doc-transition),visibility var(--ng-doc-transition)}:host[data-ng-doc-opened=true] .ng-doc-sidenav{left:0;visibility:visible;--ng-doc-sidebar-shadow: var(--ng-doc-shadow-lg)}:host .ng-doc-sidenav-content{margin-left:0;width:100%}}@media(prefers-reduced-motion:reduce){:host .ng-doc-sidenav,:host .ng-doc-sidenav-content{transition:none}}:host .backdrop-enter{animation:ng-doc-backdrop-fade-in var(--ng-doc-transition) forwards}@keyframes ng-doc-backdrop-fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
42
42
|
}], propDecorators: { sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: false }] }], opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], closeEvent: [{ type: i0.Output, args: ["closeEvent"] }] } });
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-sidenav.mjs","sources":["../../../../libs/ui-kit/components/sidenav/sidenav.component.ts","../../../../libs/ui-kit/components/sidenav/sidenav.component.html","../../../../libs/ui-kit/components/sidenav/ng-doc-ui-kit-components-sidenav.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n/**\n * Layout with a side panel next to the projected content.\n *\n * At 900px and below the side panel becomes an overlay that slides in from the left; `opened`\n * shows it and `closeEvent` asks the owner to hide it. The panel has the id `ng-doc-sidenav`, so a\n * toggle button can point `aria-controls` at it.\n */\n@Component({\n selector: 'ng-doc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [PolymorpheusOutlet],\n host: {\n '[attr.data-ng-doc-sidebar]': '!!sidebar()',\n '[attr.data-ng-doc-opened]': 'opened()',\n },\n})\nexport class NgDocSidenavComponent {\n /**\n * Content of the sidenav.\n */\n readonly sidebar = input<NgDocContent>('');\n\n /**\n * Indicates whether the sidenav is opened or not.\n * This is used to trigger the animation.\n */\n readonly opened = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Indicates whether the sidenav has a backdrop or not.\n */\n readonly hasBackdrop = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Emits when the backdrop is clicked, so the owner can close the sidenav.\n */\n readonly closeEvent = output<void>();\n}\n","<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;;;AAMG;MAYU,qBAAqB,CAAA;AAXlC,IAAA,WAAA,GAAA;AAYE;;AAEG;QACM,IAAA,CAAA,OAAO,GAAG,KAAK,CAAe,EAAE;oFAAC;AAE1C;;;AAGG;QACM,IAAA,CAAA,MAAM,GAAG,KAAK,CAAmB,IAAI,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEhF;;AAEG;QACM,IAAA,CAAA,WAAW,GAAG,KAAK,CAAmB,IAAI,mFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAErF;;AAEG;QACM,IAAA,CAAA,UAAU,GAAG,MAAM,EAAQ;AACrC,IAAA;8GArBY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,0BAAA,EAAA,aAAA,EAAA,yBAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtBlC,waAYA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-sidenav.mjs","sources":["../../../../libs/ui-kit/components/sidenav/sidenav.component.ts","../../../../libs/ui-kit/components/sidenav/sidenav.component.html","../../../../libs/ui-kit/components/sidenav/ng-doc-ui-kit-components-sidenav.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n/**\n * Layout with a side panel next to the projected content.\n *\n * At 900px and below the side panel becomes an overlay that slides in from the left; `opened`\n * shows it and `closeEvent` asks the owner to hide it. The panel has the id `ng-doc-sidenav`, so a\n * toggle button can point `aria-controls` at it.\n */\n@Component({\n selector: 'ng-doc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [PolymorpheusOutlet],\n host: {\n '[attr.data-ng-doc-sidebar]': '!!sidebar()',\n '[attr.data-ng-doc-opened]': 'opened()',\n },\n})\nexport class NgDocSidenavComponent {\n /**\n * Content of the sidenav.\n */\n readonly sidebar = input<NgDocContent>('');\n\n /**\n * Indicates whether the sidenav is opened or not.\n * This is used to trigger the animation.\n */\n readonly opened = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Indicates whether the sidenav has a backdrop or not.\n */\n readonly hasBackdrop = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Emits when the backdrop is clicked, so the owner can close the sidenav.\n */\n readonly closeEvent = output<void>();\n}\n","<div class=\"ng-doc-sidenav-wrapper\">\n <div class=\"ng-doc-sidenav\" id=\"ng-doc-sidenav\">\n <ng-container *polymorpheusOutlet=\"sidebar()\"></ng-container>\n </div>\n <div class=\"ng-doc-sidenav-content\">\n @if (opened() && hasBackdrop()) {\n <div class=\"ng-doc-backdrop\" animate.enter=\"backdrop-enter\" (click)=\"closeEvent.emit()\"></div>\n }\n\n <ng-content></ng-content>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;;;AAMG;MAYU,qBAAqB,CAAA;AAXlC,IAAA,WAAA,GAAA;AAYE;;AAEG;QACM,IAAA,CAAA,OAAO,GAAG,KAAK,CAAe,EAAE;oFAAC;AAE1C;;;AAGG;QACM,IAAA,CAAA,MAAM,GAAG,KAAK,CAAmB,IAAI,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEhF;;AAEG;QACM,IAAA,CAAA,WAAW,GAAG,KAAK,CAAmB,IAAI,mFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAErF;;AAEG;QACM,IAAA,CAAA,UAAU,GAAG,MAAM,EAAQ;AACrC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AAkB,CAAC,EAAA,IAAA,EACvB;AACJ,wBAAA,4BAA4B,EAAE,aAAa;AAC3C,wBAAA,2BAA2B,EAAE,UAAU;AACxC,qBAAA,EAAA,QAAA,EAAA,waAAA,EAAA,MAAA,EAAA,CAAA,4kDAAA,CAAA,EAAA;;;AEpBH;;AAEG;;;;"}
|
|
@@ -32,6 +32,12 @@ let nextId = 0;
|
|
|
32
32
|
*/
|
|
33
33
|
class NgDocTabGroupComponent {
|
|
34
34
|
constructor() {
|
|
35
|
+
/**
|
|
36
|
+
* `framed` draws the header bar and the panel as one surface; `plain` draws only the tabs over
|
|
37
|
+
* a line, and the panel takes no frame or background of its own, for content that has its own.
|
|
38
|
+
*/
|
|
39
|
+
this.appearance = input('framed', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
35
41
|
/** Id of the tab to open; the first tab opens when it is not set or matches no tab. */
|
|
36
42
|
this.openedTab = input(undefined, /* @ts-ignore */
|
|
37
43
|
...(ngDevMode ? [{ debugName: "openedTab" }] : /* istanbul ignore next */ []));
|
|
@@ -92,7 +98,7 @@ class NgDocTabGroupComponent {
|
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTabGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
95
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocTabGroupComponent, isStandalone: true, selector: "ng-doc-tab-group", inputs: { openedTab: { classPropertyName: "openedTab", publicName: "openedTab", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "tabs", predicate: NgDocTabComponent, isSignal: true }], viewQueries: [{ propertyName: "tabElements", predicate: ["headerTab"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ng-doc-tabs-header\">\n <div class=\"ng-doc-tabs-wrapper\" role=\"tablist\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-tab\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"tab === selectedTab()\"\n [attr.aria-controls]=\"idPrefix + '-panel'\"\n [attr.tabindex]=\"tab === selectedTab() ? 0 : -1\"\n [class.selected]=\"tab === selectedTab()\"\n [ngDocSelectionOrigin]=\"tab === selectedTab()\"\n (click)=\"selectTab(tab)\"\n (keydown)=\"onKeydown($event)\"\n #headerTab>\n <span class=\"ng-doc-tab-text\">\n <ng-container *polymorpheusOutlet=\"tab.label() as text; context: {}\">{{\n text\n }}</ng-container>\n </span>\n </button>\n }\n </div>\n</div>\n\n<div\n class=\"ng-doc-body-wrapper\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel'\"\n [attr.aria-labelledby]=\"selectedIndex() >= 0 ? idPrefix + '-tab-' + selectedIndex() : null\">\n <div *polymorpheusOutlet=\"selectedTab()?.content() ?? '' as text; context: {}\">\n {{ text }}\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;background:var(--ng-doc-tab-group-header-background, var(--ng-doc-tab-group-background));border-radius:var(--ng-doc-tab-group-border-radius);border:var(--ng-doc-tab-group-border);overflow:hidden}:host .ng-doc-tabs-header{display:flex;align-items:center;flex-shrink:0;min-height:var(--ng-doc-code-header-height, 40px);padding:var(--ng-doc-space-1) var(--ng-doc-space-2);background:var(--ng-doc-tab-group-tabs-background, transparent);border-bottom:1px solid var(--ng-doc-border-color)}:host .ng-doc-tabs-wrapper{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);position:relative;display:inline-flex;gap:2px;max-width:100%;padding:3px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);overflow-x:auto;scrollbar-width:none}:host ng-doc-selection{border-radius:var(--ng-doc-radius-sm);background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}:host .ng-doc-tab{position:relative;display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:0;border-radius:var(--ng-doc-radius-sm);background:none;font:inherit;font-size:13px;font-weight:500;line-height:18px;color:var(--ng-doc-text-muted);white-space:nowrap;cursor:pointer}:host .ng-doc-tab:hover{color:var(--ng-doc-heading-color)}:host .ng-doc-tab:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}:host .ng-doc-tab.selected{color:var(--ng-doc-heading-color)}:host .ng-doc-tab .ng-doc-tab-text{display:inline-flex;align-items:center;gap:6px}:host ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}:host .ng-doc-body-wrapper{position:relative;background-color:var(--ng-doc-tab-group-background);height:100%;overflow:hidden}:host-context([data-theme=dark]) ng-doc-selection,:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}@media(prefers-color-scheme:dark){:host-context([data-theme=auto]) ng-doc-selection,:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: NgDocSelectionComponent, selector: "ng-doc-selection", inputs: ["align"] }, { kind: "directive", type: NgDocSelectionHostDirective, selector: "[ngDocSelectionHost]" }, { kind: "directive", type: NgDocSelectionOriginDirective, selector: "[ngDocSelectionOrigin]", inputs: ["ngDocSelectionOrigin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocTabGroupComponent, isStandalone: true, selector: "ng-doc-tab-group", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, openedTab: { classPropertyName: "openedTab", publicName: "openedTab", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ng-doc-tab-group-plain": "appearance() === 'plain'" } }, queries: [{ propertyName: "tabs", predicate: NgDocTabComponent, isSignal: true }], viewQueries: [{ propertyName: "tabElements", predicate: ["headerTab"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ng-doc-tabs-header\">\n <div class=\"ng-doc-tabs-wrapper\" role=\"tablist\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-tab\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"tab === selectedTab()\"\n [attr.aria-controls]=\"idPrefix + '-panel'\"\n [attr.tabindex]=\"tab === selectedTab() ? 0 : -1\"\n [class.selected]=\"tab === selectedTab()\"\n [ngDocSelectionOrigin]=\"tab === selectedTab()\"\n (click)=\"selectTab(tab)\"\n (keydown)=\"onKeydown($event)\"\n #headerTab>\n <span class=\"ng-doc-tab-text\">\n <ng-container *polymorpheusOutlet=\"tab.label() as text; context: {}\">{{\n text\n }}</ng-container>\n </span>\n </button>\n }\n </div>\n</div>\n\n<div\n class=\"ng-doc-body-wrapper\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel'\"\n [attr.aria-labelledby]=\"selectedIndex() >= 0 ? idPrefix + '-tab-' + selectedIndex() : null\">\n <div *polymorpheusOutlet=\"selectedTab()?.content() ?? '' as text; context: {}\">\n {{ text }}\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;background:var(--ng-doc-tab-group-header-background, var(--ng-doc-tab-group-background));border-radius:var(--ng-doc-tab-group-border-radius);border:var(--ng-doc-tab-group-border);overflow:hidden}:host .ng-doc-tabs-header{display:flex;align-items:center;flex-shrink:0;min-height:var(--ng-doc-code-header-height, 40px);padding:var(--ng-doc-space-1) var(--ng-doc-space-2);background:var(--ng-doc-tab-group-tabs-background, transparent);border-bottom:1px solid var(--ng-doc-border-color)}:host .ng-doc-tabs-wrapper{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);position:relative;display:inline-flex;gap:2px;max-width:100%;padding:3px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);overflow-x:auto;scrollbar-width:none}:host ng-doc-selection{border-radius:var(--ng-doc-radius-sm);background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}:host .ng-doc-tab{position:relative;display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:0;border-radius:var(--ng-doc-radius-sm);background:none;font:inherit;font-size:13px;font-weight:500;line-height:18px;color:var(--ng-doc-text-muted);white-space:nowrap;cursor:pointer}:host .ng-doc-tab:hover{color:var(--ng-doc-heading-color)}:host .ng-doc-tab:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}:host .ng-doc-tab.selected{color:var(--ng-doc-heading-color)}:host .ng-doc-tab .ng-doc-tab-text{display:inline-flex;align-items:center;gap:6px}:host ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}:host .ng-doc-body-wrapper{position:relative;background-color:var(--ng-doc-tab-group-background);height:100%;overflow:hidden}:host-context([data-theme=dark]) ng-doc-selection,:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}@media(prefers-color-scheme:dark){:host-context([data-theme=auto]) ng-doc-selection,:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}}:host(.ng-doc-tab-group-plain){border:none;border-radius:0;background:transparent;overflow:visible}:host(.ng-doc-tab-group-plain)>.ng-doc-tabs-header{padding:0 0 var(--ng-doc-space-2);background:transparent}:host(.ng-doc-tab-group-plain)>.ng-doc-body-wrapper{padding-top:var(--ng-doc-space-4);background:transparent;overflow:visible}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: NgDocSelectionComponent, selector: "ng-doc-selection", inputs: ["align"] }, { kind: "directive", type: NgDocSelectionHostDirective, selector: "[ngDocSelectionHost]" }, { kind: "directive", type: NgDocSelectionOriginDirective, selector: "[ngDocSelectionOrigin]", inputs: ["ngDocSelectionOrigin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
96
102
|
}
|
|
97
103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTabGroupComponent, decorators: [{
|
|
98
104
|
type: Component,
|
|
@@ -101,8 +107,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
101
107
|
NgDocSelectionComponent,
|
|
102
108
|
NgDocSelectionHostDirective,
|
|
103
109
|
NgDocSelectionOriginDirective,
|
|
104
|
-
],
|
|
105
|
-
|
|
110
|
+
], host: {
|
|
111
|
+
'[class.ng-doc-tab-group-plain]': "appearance() === 'plain'",
|
|
112
|
+
}, template: "<div class=\"ng-doc-tabs-header\">\n <div class=\"ng-doc-tabs-wrapper\" role=\"tablist\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-tab\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"tab === selectedTab()\"\n [attr.aria-controls]=\"idPrefix + '-panel'\"\n [attr.tabindex]=\"tab === selectedTab() ? 0 : -1\"\n [class.selected]=\"tab === selectedTab()\"\n [ngDocSelectionOrigin]=\"tab === selectedTab()\"\n (click)=\"selectTab(tab)\"\n (keydown)=\"onKeydown($event)\"\n #headerTab>\n <span class=\"ng-doc-tab-text\">\n <ng-container *polymorpheusOutlet=\"tab.label() as text; context: {}\">{{\n text\n }}</ng-container>\n </span>\n </button>\n }\n </div>\n</div>\n\n<div\n class=\"ng-doc-body-wrapper\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel'\"\n [attr.aria-labelledby]=\"selectedIndex() >= 0 ? idPrefix + '-tab-' + selectedIndex() : null\">\n <div *polymorpheusOutlet=\"selectedTab()?.content() ?? '' as text; context: {}\">\n {{ text }}\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;background:var(--ng-doc-tab-group-header-background, var(--ng-doc-tab-group-background));border-radius:var(--ng-doc-tab-group-border-radius);border:var(--ng-doc-tab-group-border);overflow:hidden}:host .ng-doc-tabs-header{display:flex;align-items:center;flex-shrink:0;min-height:var(--ng-doc-code-header-height, 40px);padding:var(--ng-doc-space-1) var(--ng-doc-space-2);background:var(--ng-doc-tab-group-tabs-background, transparent);border-bottom:1px solid var(--ng-doc-border-color)}:host .ng-doc-tabs-wrapper{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);position:relative;display:inline-flex;gap:2px;max-width:100%;padding:3px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);overflow-x:auto;scrollbar-width:none}:host ng-doc-selection{border-radius:var(--ng-doc-radius-sm);background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}:host .ng-doc-tab{position:relative;display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:0;border-radius:var(--ng-doc-radius-sm);background:none;font:inherit;font-size:13px;font-weight:500;line-height:18px;color:var(--ng-doc-text-muted);white-space:nowrap;cursor:pointer}:host .ng-doc-tab:hover{color:var(--ng-doc-heading-color)}:host .ng-doc-tab:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}:host .ng-doc-tab.selected{color:var(--ng-doc-heading-color)}:host .ng-doc-tab .ng-doc-tab-text{display:inline-flex;align-items:center;gap:6px}:host ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}:host .ng-doc-body-wrapper{position:relative;background-color:var(--ng-doc-tab-group-background);height:100%;overflow:hidden}:host-context([data-theme=dark]) ng-doc-selection,:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}@media(prefers-color-scheme:dark){:host-context([data-theme=auto]) ng-doc-selection,:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~.ng-doc-tab.selected{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}}:host(.ng-doc-tab-group-plain){border:none;border-radius:0;background:transparent;overflow:visible}:host(.ng-doc-tab-group-plain)>.ng-doc-tabs-header{padding:0 0 var(--ng-doc-space-2);background:transparent}:host(.ng-doc-tab-group-plain)>.ng-doc-body-wrapper{padding-top:var(--ng-doc-space-4);background:transparent;overflow:visible}\n"] }]
|
|
113
|
+
}], propDecorators: { appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], openedTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "openedTab", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NgDocTabComponent), { isSignal: true }] }], tabElements: [{ type: i0.ViewChildren, args: ['headerTab', { isSignal: true }] }] } });
|
|
106
114
|
|
|
107
115
|
/**
|
|
108
116
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-tab-group.mjs","sources":["../../../../libs/ui-kit/components/tab-group/tab/tab.component.ts","../../../../libs/ui-kit/components/tab-group/tab-group.component.ts","../../../../libs/ui-kit/components/tab-group/tab-group.component.html","../../../../libs/ui-kit/components/tab-group/ng-doc-ui-kit-components-tab-group.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\n\n/** One tab of an `ng-doc-tab-group`: its label, its id and the content of its panel. */\n@Component({\n selector: 'ng-doc-tab, a[ng-doc-tab]',\n template: '',\n styleUrls: ['./tab.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocTabComponent<T> {\n /** Label of the tab: a string or a template. */\n readonly label = input<NgDocContent>('');\n\n /** Id the group's `openedTab` refers to. */\n readonly id = input<T | number>(0);\n\n /** Content of the tab's panel. */\n readonly content = input<NgDocContent>('');\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n ElementRef,\n input,\n linkedSignal,\n Signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport {\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n} from '@ng-doc/ui-kit/components/selection';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\nimport { NgDocTabComponent } from './tab/tab.component';\n\nlet nextId = 0;\n\n/**\n * Tabs as a segmented control over one panel. It follows the WAI-ARIA tabs pattern: the arrow keys,\n * Home and End move between the tabs and select them. The highlight of the open tab slides to\n * the newly opened one.\n */\n@Component({\n selector: 'ng-doc-tab-group',\n templateUrl: './tab-group.component.html',\n styleUrls: ['./tab-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n PolymorpheusOutlet,\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n ],\n})\nexport class NgDocTabGroupComponent<T = number> {\n /** Id of the tab to open; the first tab opens when it is not set or matches no tab. */\n readonly openedTab = input<T | undefined>(undefined);\n\n /** The tabs of the group. */\n readonly tabs: Signal<ReadonlyArray<NgDocTabComponent<T>>> =\n contentChildren<NgDocTabComponent<T>>(NgDocTabComponent);\n\n /** Header buttons of the tabs, in order. */\n readonly tabElements: Signal<ReadonlyArray<ElementRef<HTMLElement>>> =\n viewChildren<ElementRef<HTMLElement>>('headerTab');\n\n /**\n * The open tab. It follows `openedTab` and the tab list; a tab the user selects stays open as\n * long as it is in the group and `openedTab` does not change.\n */\n readonly selectedTab = linkedSignal<\n { tabs: ReadonlyArray<NgDocTabComponent<T>>; opened: T | undefined },\n NgDocTabComponent<T> | undefined\n >({\n source: () => ({ tabs: this.tabs(), opened: this.openedTab() }),\n computation: ({ tabs, opened }, previous) => {\n const kept: NgDocTabComponent<T> | undefined =\n previous?.value && previous.source.opened === opened && tabs.includes(previous.value)\n ? previous.value\n : undefined;\n\n return (\n kept ??\n (opened !== undefined && opened !== null\n ? tabs.find((tab: NgDocTabComponent<T>) => tab.id() === opened)\n : undefined) ??\n tabs[0]\n );\n },\n });\n\n /** Index of the open tab, or -1. */\n readonly selectedIndex: Signal<number> = computed(() => {\n const selected: NgDocTabComponent<T> | undefined = this.selectedTab();\n\n return selected ? this.tabs().indexOf(selected) : -1;\n });\n\n /** Prefix of the ids that tie the tabs to the panel. */\n protected readonly idPrefix: string = `ng-doc-tab-group-${nextId++}`;\n\n /**\n * Opens a tab.\n * @param tab - The tab to open.\n */\n selectTab(tab: NgDocTabComponent<T>): void {\n untracked(() => this.selectedTab.set(tab));\n }\n\n /**\n * Moves the selection with the keyboard and focuses the new tab.\n * @param event - The key press on a tab.\n */\n protected onKeydown(event: KeyboardEvent): void {\n const tabs: ReadonlyArray<NgDocTabComponent<T>> = this.tabs();\n const current: number = Math.max(this.selectedIndex(), 0);\n const next: number | undefined = {\n ArrowRight: (current + 1) % tabs.length,\n ArrowLeft: (current - 1 + tabs.length) % tabs.length,\n Home: 0,\n End: tabs.length - 1,\n }[event.key];\n\n if (next !== undefined && tabs[next]) {\n event.preventDefault();\n this.selectTab(tabs[next]);\n this.tabElements()[next]?.nativeElement.focus();\n }\n }\n}\n","<div class=\"ng-doc-tabs-header\">\n <div class=\"ng-doc-tabs-wrapper\" role=\"tablist\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-tab\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"tab === selectedTab()\"\n [attr.aria-controls]=\"idPrefix + '-panel'\"\n [attr.tabindex]=\"tab === selectedTab() ? 0 : -1\"\n [class.selected]=\"tab === selectedTab()\"\n [ngDocSelectionOrigin]=\"tab === selectedTab()\"\n (click)=\"selectTab(tab)\"\n (keydown)=\"onKeydown($event)\"\n #headerTab>\n <span class=\"ng-doc-tab-text\">\n <ng-container *polymorpheusOutlet=\"tab.label() as text; context: {}\">{{\n text\n }}</ng-container>\n </span>\n </button>\n }\n </div>\n</div>\n\n<div\n class=\"ng-doc-body-wrapper\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel'\"\n [attr.aria-labelledby]=\"selectedIndex() >= 0 ? idPrefix + '-tab-' + selectedIndex() : null\">\n <div *polymorpheusOutlet=\"selectedTab()?.content() ?? '' as text; context: {}\">\n {{ text }}\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;MAOa,iBAAiB,CAAA;AAN9B,IAAA,WAAA,GAAA;;QAQW,IAAA,CAAA,KAAK,GAAG,KAAK,CAAe,EAAE;kFAAC;;QAG/B,IAAA,CAAA,EAAE,GAAG,KAAK,CAAa,CAAC;+EAAC;;QAGzB,IAAA,CAAA,OAAO,GAAG,KAAK,CAAe,EAAE;oF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sources":["../../../../libs/ui-kit/components/tab-group/tab/tab.component.ts","../../../../libs/ui-kit/components/tab-group/tab-group.component.ts","../../../../libs/ui-kit/components/tab-group/tab-group.component.html","../../../../libs/ui-kit/components/tab-group/ng-doc-ui-kit-components-tab-group.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\n\n/** One tab of an `ng-doc-tab-group`: its label, its id and the content of its panel. */\n@Component({\n selector: 'ng-doc-tab, a[ng-doc-tab]',\n template: '',\n styleUrls: ['./tab.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocTabComponent<T> {\n /** Label of the tab: a string or a template. */\n readonly label = input<NgDocContent>('');\n\n /** Id the group's `openedTab` refers to. */\n readonly id = input<T | number>(0);\n\n /** Content of the tab's panel. */\n readonly content = input<NgDocContent>('');\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n ElementRef,\n input,\n linkedSignal,\n Signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport {\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n} from '@ng-doc/ui-kit/components/selection';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\nimport { NgDocTabComponent } from './tab/tab.component';\n\nlet nextId = 0;\n\n/**\n * Tabs as a segmented control over one panel. It follows the WAI-ARIA tabs pattern: the arrow keys,\n * Home and End move between the tabs and select them. The highlight of the open tab slides to\n * the newly opened one.\n */\n@Component({\n selector: 'ng-doc-tab-group',\n templateUrl: './tab-group.component.html',\n styleUrls: ['./tab-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n PolymorpheusOutlet,\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n ],\n host: {\n '[class.ng-doc-tab-group-plain]': \"appearance() === 'plain'\",\n },\n})\nexport class NgDocTabGroupComponent<T = number> {\n /**\n * `framed` draws the header bar and the panel as one surface; `plain` draws only the tabs over\n * a line, and the panel takes no frame or background of its own, for content that has its own.\n */\n readonly appearance = input<'framed' | 'plain'>('framed');\n\n /** Id of the tab to open; the first tab opens when it is not set or matches no tab. */\n readonly openedTab = input<T | undefined>(undefined);\n\n /** The tabs of the group. */\n readonly tabs: Signal<ReadonlyArray<NgDocTabComponent<T>>> =\n contentChildren<NgDocTabComponent<T>>(NgDocTabComponent);\n\n /** Header buttons of the tabs, in order. */\n readonly tabElements: Signal<ReadonlyArray<ElementRef<HTMLElement>>> =\n viewChildren<ElementRef<HTMLElement>>('headerTab');\n\n /**\n * The open tab. It follows `openedTab` and the tab list; a tab the user selects stays open as\n * long as it is in the group and `openedTab` does not change.\n */\n readonly selectedTab = linkedSignal<\n { tabs: ReadonlyArray<NgDocTabComponent<T>>; opened: T | undefined },\n NgDocTabComponent<T> | undefined\n >({\n source: () => ({ tabs: this.tabs(), opened: this.openedTab() }),\n computation: ({ tabs, opened }, previous) => {\n const kept: NgDocTabComponent<T> | undefined =\n previous?.value && previous.source.opened === opened && tabs.includes(previous.value)\n ? previous.value\n : undefined;\n\n return (\n kept ??\n (opened !== undefined && opened !== null\n ? tabs.find((tab: NgDocTabComponent<T>) => tab.id() === opened)\n : undefined) ??\n tabs[0]\n );\n },\n });\n\n /** Index of the open tab, or -1. */\n readonly selectedIndex: Signal<number> = computed(() => {\n const selected: NgDocTabComponent<T> | undefined = this.selectedTab();\n\n return selected ? this.tabs().indexOf(selected) : -1;\n });\n\n /** Prefix of the ids that tie the tabs to the panel. */\n protected readonly idPrefix: string = `ng-doc-tab-group-${nextId++}`;\n\n /**\n * Opens a tab.\n * @param tab - The tab to open.\n */\n selectTab(tab: NgDocTabComponent<T>): void {\n untracked(() => this.selectedTab.set(tab));\n }\n\n /**\n * Moves the selection with the keyboard and focuses the new tab.\n * @param event - The key press on a tab.\n */\n protected onKeydown(event: KeyboardEvent): void {\n const tabs: ReadonlyArray<NgDocTabComponent<T>> = this.tabs();\n const current: number = Math.max(this.selectedIndex(), 0);\n const next: number | undefined = {\n ArrowRight: (current + 1) % tabs.length,\n ArrowLeft: (current - 1 + tabs.length) % tabs.length,\n Home: 0,\n End: tabs.length - 1,\n }[event.key];\n\n if (next !== undefined && tabs[next]) {\n event.preventDefault();\n this.selectTab(tabs[next]);\n this.tabElements()[next]?.nativeElement.focus();\n }\n }\n}\n","<div class=\"ng-doc-tabs-header\">\n <div class=\"ng-doc-tabs-wrapper\" role=\"tablist\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (tab of tabs(); track tab; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-tab\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"tab === selectedTab()\"\n [attr.aria-controls]=\"idPrefix + '-panel'\"\n [attr.tabindex]=\"tab === selectedTab() ? 0 : -1\"\n [class.selected]=\"tab === selectedTab()\"\n [ngDocSelectionOrigin]=\"tab === selectedTab()\"\n (click)=\"selectTab(tab)\"\n (keydown)=\"onKeydown($event)\"\n #headerTab>\n <span class=\"ng-doc-tab-text\">\n <ng-container *polymorpheusOutlet=\"tab.label() as text; context: {}\">{{\n text\n }}</ng-container>\n </span>\n </button>\n }\n </div>\n</div>\n\n<div\n class=\"ng-doc-body-wrapper\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel'\"\n [attr.aria-labelledby]=\"selectedIndex() >= 0 ? idPrefix + '-tab-' + selectedIndex() : null\">\n <div *polymorpheusOutlet=\"selectedTab()?.content() ?? '' as text; context: {}\">\n {{ text }}\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;MAOa,iBAAiB,CAAA;AAN9B,IAAA,WAAA,GAAA;;QAQW,IAAA,CAAA,KAAK,GAAG,KAAK,CAAe,EAAE;kFAAC;;QAG/B,IAAA,CAAA,EAAE,GAAG,KAAK,CAAa,CAAC;+EAAC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KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,iBAAiB,yEAIjB,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3DrD;;AAEG;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The English texts of the `@ng-doc/ui-kit` components. They are the texts the components showed
|
|
5
|
+
* before the texts could be changed, so an application that changes none renders as before.
|
|
6
|
+
*/
|
|
7
|
+
const NG_DOC_UI_KIT_DEFAULT_TEXTS = Object.freeze({
|
|
8
|
+
blockquote: Object.freeze({
|
|
9
|
+
note: 'Note',
|
|
10
|
+
warning: 'Warning',
|
|
11
|
+
alert: 'Alert',
|
|
12
|
+
success: 'Success',
|
|
13
|
+
}),
|
|
14
|
+
pane: Object.freeze({
|
|
15
|
+
resizer: 'Resize the panes',
|
|
16
|
+
}),
|
|
17
|
+
combobox: Object.freeze({
|
|
18
|
+
placeholder: 'Choose the value',
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* The texts the `@ng-doc/ui-kit` components show. It resolves to `NG_DOC_UI_KIT_DEFAULT_TEXTS`
|
|
23
|
+
* unless `provideNgDocTexts` from `@ng-doc/app` sets it.
|
|
24
|
+
*/
|
|
25
|
+
const NG_DOC_UI_KIT_TEXTS = new InjectionToken('NG_DOC_UI_KIT_TEXTS', {
|
|
26
|
+
providedIn: 'root',
|
|
27
|
+
factory: () => NG_DOC_UI_KIT_DEFAULT_TEXTS,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Generated bundle index. Do not edit.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
export { NG_DOC_UI_KIT_DEFAULT_TEXTS, NG_DOC_UI_KIT_TEXTS };
|
|
35
|
+
//# sourceMappingURL=ng-doc-ui-kit-texts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-texts.mjs","sources":["../../../../libs/ui-kit/texts/texts.token.ts","../../../../libs/ui-kit/texts/ng-doc-ui-kit-texts.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { NgDocUiKitTexts } from './texts.interfaces';\n\n/**\n * The English texts of the `@ng-doc/ui-kit` components. They are the texts the components showed\n * before the texts could be changed, so an application that changes none renders as before.\n */\nexport const NG_DOC_UI_KIT_DEFAULT_TEXTS: NgDocUiKitTexts = Object.freeze({\n blockquote: Object.freeze({\n note: 'Note',\n warning: 'Warning',\n alert: 'Alert',\n success: 'Success',\n }),\n pane: Object.freeze({\n resizer: 'Resize the panes',\n }),\n combobox: Object.freeze({\n placeholder: 'Choose the value',\n }),\n});\n\n/**\n * The texts the `@ng-doc/ui-kit` components show. It resolves to `NG_DOC_UI_KIT_DEFAULT_TEXTS`\n * unless `provideNgDocTexts` from `@ng-doc/app` sets it.\n */\nexport const NG_DOC_UI_KIT_TEXTS: InjectionToken<NgDocUiKitTexts> =\n new InjectionToken<NgDocUiKitTexts>('NG_DOC_UI_KIT_TEXTS', {\n providedIn: 'root',\n factory: () => NG_DOC_UI_KIT_DEFAULT_TEXTS,\n });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA;;;AAGG;AACI,MAAM,2BAA2B,GAAoB,MAAM,CAAC,MAAM,CAAC;AACxE,IAAA,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;AACxB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,OAAO,EAAE,SAAS;KACnB,CAAC;AACF,IAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;AAClB,QAAA,OAAO,EAAE,kBAAkB;KAC5B,CAAC;AACF,IAAA,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;AACtB,QAAA,WAAW,EAAE,kBAAkB;KAChC,CAAC;AACH,CAAA;AAED;;;AAGG;MACU,mBAAmB,GAC9B,IAAI,cAAc,CAAkB,qBAAqB,EAAE;AACzD,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,2BAA2B;AAC3C,CAAA;;AC/BH;;AAEG;;;;"}
|
|
@@ -10,6 +10,7 @@ export * from '@ng-doc/ui-kit/observables';
|
|
|
10
10
|
export * from '@ng-doc/ui-kit/pipes';
|
|
11
11
|
export * from '@ng-doc/ui-kit/providers';
|
|
12
12
|
export * from '@ng-doc/ui-kit/services';
|
|
13
|
+
export * from '@ng-doc/ui-kit/texts';
|
|
13
14
|
export * from '@ng-doc/ui-kit/tokens';
|
|
14
15
|
export * from '@ng-doc/ui-kit/types';
|
|
15
16
|
export * from '@ng-doc/ui-kit/utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit.mjs","sources":["../../../../libs/ui-kit/ng-doc-ui-kit.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit.mjs","sources":["../../../../libs/ui-kit/ng-doc-ui-kit.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-doc/ui-kit",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.2.0",
|
|
4
4
|
"description": "The UI components NgDoc sites are built from.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"tslib": "^2.6.2",
|
|
34
|
-
"@ng-doc/core": "22.
|
|
34
|
+
"@ng-doc/core": "22.2.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
@@ -378,6 +378,10 @@
|
|
|
378
378
|
"types": "./types/ng-doc-ui-kit-services-scroll.d.ts",
|
|
379
379
|
"default": "./fesm2022/ng-doc-ui-kit-services-scroll.mjs"
|
|
380
380
|
},
|
|
381
|
+
"./texts": {
|
|
382
|
+
"types": "./types/ng-doc-ui-kit-texts.d.ts",
|
|
383
|
+
"default": "./fesm2022/ng-doc-ui-kit-texts.mjs"
|
|
384
|
+
},
|
|
381
385
|
"./tokens": {
|
|
382
386
|
"types": "./types/ng-doc-ui-kit-tokens.d.ts",
|
|
383
387
|
"default": "./fesm2022/ng-doc-ui-kit-tokens.mjs"
|
|
@@ -17,6 +17,7 @@ declare class NgDocBlockquoteComponent {
|
|
|
17
17
|
readonly icon: _angular_core.InputSignal<string | undefined>;
|
|
18
18
|
/** A title that replaces the type title, for example "Deprecated". */
|
|
19
19
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
20
|
+
private readonly texts;
|
|
20
21
|
/** The icon that is shown, if any. */
|
|
21
22
|
protected readonly iconName: Signal<string | undefined>;
|
|
22
23
|
/** The title that is shown, if any. */
|
|
@@ -12,7 +12,7 @@ import { DIControl } from 'di-controls';
|
|
|
12
12
|
declare class NgDocComboboxComponent<T> extends DIControl<T> implements NgDocListHost {
|
|
13
13
|
/** Whether the text field is read-only: the value is picked from the list only. */
|
|
14
14
|
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
15
|
-
/** Placeholder of the text field. */
|
|
15
|
+
/** Placeholder of the text field. Defaults to the `combobox.placeholder` text. */
|
|
16
16
|
readonly placeholder: _angular_core.InputSignal<string>;
|
|
17
17
|
/** Whether the clear button is shown. */
|
|
18
18
|
readonly clearButton: _angular_core.InputSignal<boolean>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { ElementRef } from '@angular/core';
|
|
3
|
+
import { NgDocPaneTexts } from '@ng-doc/ui-kit/texts';
|
|
3
4
|
|
|
4
5
|
/** Marks the content in front of an `ng-doc-pane` (the right side). */
|
|
5
6
|
declare class NgDocPaneFrontDirective {
|
|
@@ -16,6 +17,7 @@ declare class NgDocPaneBackDirective {
|
|
|
16
17
|
* arrow keys on it to reveal the back pane; Enter or Space toggles it.
|
|
17
18
|
*/
|
|
18
19
|
declare class NgDocPaneComponent {
|
|
20
|
+
protected readonly texts: NgDocPaneTexts;
|
|
19
21
|
private readonly document;
|
|
20
22
|
private readonly elementRef;
|
|
21
23
|
private readonly ngZone;
|
|
@@ -20,6 +20,11 @@ declare class NgDocTabComponent<T> {
|
|
|
20
20
|
* the newly opened one.
|
|
21
21
|
*/
|
|
22
22
|
declare class NgDocTabGroupComponent<T = number> {
|
|
23
|
+
/**
|
|
24
|
+
* `framed` draws the header bar and the panel as one surface; `plain` draws only the tabs over
|
|
25
|
+
* a line, and the panel takes no frame or background of its own, for content that has its own.
|
|
26
|
+
*/
|
|
27
|
+
readonly appearance: _angular_core.InputSignal<"framed" | "plain">;
|
|
23
28
|
/** Id of the tab to open; the first tab opens when it is not set or matches no tab. */
|
|
24
29
|
readonly openedTab: _angular_core.InputSignal<T | undefined>;
|
|
25
30
|
/** The tabs of the group. */
|
|
@@ -46,7 +51,7 @@ declare class NgDocTabGroupComponent<T = number> {
|
|
|
46
51
|
*/
|
|
47
52
|
protected onKeydown(event: KeyboardEvent): void;
|
|
48
53
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocTabGroupComponent<any>, never>;
|
|
49
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocTabGroupComponent<any>, "ng-doc-tab-group", never, { "openedTab": { "alias": "openedTab"; "required": false; "isSignal": true; }; }, {}, ["tabs"], never, true, never>;
|
|
54
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocTabGroupComponent<any>, "ng-doc-tab-group", never, { "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "openedTab": { "alias": "openedTab"; "required": false; "isSignal": true; }; }, {}, ["tabs"], never, true, never>;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
export { NgDocTabComponent, NgDocTabGroupComponent };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The titles of the built-in callout types (`NgDocBlockquoteComponent`).
|
|
5
|
+
*/
|
|
6
|
+
interface NgDocBlockquoteTexts {
|
|
7
|
+
/** Title of a `note` callout. Default: "Note". */
|
|
8
|
+
note: string;
|
|
9
|
+
/** Title of a `warning` callout. Default: "Warning". */
|
|
10
|
+
warning: string;
|
|
11
|
+
/** Title of an `alert` callout. Default: "Alert". */
|
|
12
|
+
alert: string;
|
|
13
|
+
/** Title of a `success` callout. Default: "Success". */
|
|
14
|
+
success: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The texts of the two-pane layout (`NgDocPaneComponent`), which the demo pane uses.
|
|
18
|
+
*/
|
|
19
|
+
interface NgDocPaneTexts {
|
|
20
|
+
/** Accessible name of the resizer between the panes. Default: "Resize the panes". */
|
|
21
|
+
resizer: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The texts of the select (`NgDocComboboxComponent`), which the playground uses for union types.
|
|
25
|
+
*/
|
|
26
|
+
interface NgDocComboboxTexts {
|
|
27
|
+
/**
|
|
28
|
+
* Placeholder of the text field, unless the `placeholder` input sets one. Default: "Choose the
|
|
29
|
+
* value".
|
|
30
|
+
*/
|
|
31
|
+
placeholder: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The texts that the components of `@ng-doc/ui-kit` show to readers, grouped by component.
|
|
35
|
+
* `@ng-doc/app` extends it into `NgDocTexts`, and `provideNgDocTexts` sets both.
|
|
36
|
+
*/
|
|
37
|
+
interface NgDocUiKitTexts {
|
|
38
|
+
/** Callouts. */
|
|
39
|
+
blockquote: NgDocBlockquoteTexts;
|
|
40
|
+
/** The two-pane layout. */
|
|
41
|
+
pane: NgDocPaneTexts;
|
|
42
|
+
/** The select. */
|
|
43
|
+
combobox: NgDocComboboxTexts;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The English texts of the `@ng-doc/ui-kit` components. They are the texts the components showed
|
|
48
|
+
* before the texts could be changed, so an application that changes none renders as before.
|
|
49
|
+
*/
|
|
50
|
+
declare const NG_DOC_UI_KIT_DEFAULT_TEXTS: NgDocUiKitTexts;
|
|
51
|
+
/**
|
|
52
|
+
* The texts the `@ng-doc/ui-kit` components show. It resolves to `NG_DOC_UI_KIT_DEFAULT_TEXTS`
|
|
53
|
+
* unless `provideNgDocTexts` from `@ng-doc/app` sets it.
|
|
54
|
+
*/
|
|
55
|
+
declare const NG_DOC_UI_KIT_TEXTS: InjectionToken<NgDocUiKitTexts>;
|
|
56
|
+
|
|
57
|
+
export { NG_DOC_UI_KIT_DEFAULT_TEXTS, NG_DOC_UI_KIT_TEXTS };
|
|
58
|
+
export type { NgDocBlockquoteTexts, NgDocComboboxTexts, NgDocPaneTexts, NgDocUiKitTexts };
|
package/types/ng-doc-ui-kit.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from '@ng-doc/ui-kit/observables';
|
|
|
10
10
|
export * from '@ng-doc/ui-kit/pipes';
|
|
11
11
|
export * from '@ng-doc/ui-kit/providers';
|
|
12
12
|
export * from '@ng-doc/ui-kit/services';
|
|
13
|
+
export * from '@ng-doc/ui-kit/texts';
|
|
13
14
|
export * from '@ng-doc/ui-kit/tokens';
|
|
14
15
|
export * from '@ng-doc/ui-kit/types';
|
|
15
16
|
export * from '@ng-doc/ui-kit/utils';
|