@taiga-ui/addon-doc 2.21.0 → 2.25.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.
Files changed (102) hide show
  1. package/README.md +7 -19
  2. package/bundles/taiga-ui-addon-doc.umd.js +816 -741
  3. package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
  4. package/bundles/taiga-ui-addon-doc.umd.min.js +2 -2
  5. package/bundles/taiga-ui-addon-doc.umd.min.js.map +1 -1
  6. package/components/code/code.component.d.ts +4 -1
  7. package/components/documentation/documentation-property-connector.directive.d.ts +3 -1
  8. package/components/example/example-get-tabs.pipe.d.ts +4 -0
  9. package/components/example/example.component.d.ts +4 -7
  10. package/components/navigation/navigation.component.d.ts +2 -1
  11. package/esm2015/addon-doc.module.js +1 -1
  12. package/esm2015/components/code/code.component.js +11 -4
  13. package/esm2015/components/code/code.module.js +1 -1
  14. package/esm2015/components/copy/copy.component.js +2 -2
  15. package/esm2015/components/copy/copy.module.js +1 -1
  16. package/esm2015/components/demo/demo.component.js +3 -3
  17. package/esm2015/components/demo/demo.module.js +1 -1
  18. package/esm2015/components/documentation/documentation-property-connector.directive.js +9 -2
  19. package/esm2015/components/documentation/documentation.component.js +9 -3
  20. package/esm2015/components/documentation/documentation.module.js +4 -3
  21. package/esm2015/components/example/example-get-tabs.pipe.js +12 -0
  22. package/esm2015/components/example/example.component.js +9 -27
  23. package/esm2015/components/example/example.module.js +4 -3
  24. package/esm2015/components/main/main.component.js +4 -2
  25. package/esm2015/components/main/main.module.js +1 -1
  26. package/esm2015/components/navigation/navigation.component.js +20 -17
  27. package/esm2015/components/navigation/navigation.module.js +1 -1
  28. package/esm2015/components/navigation/navigation.providers.js +1 -1
  29. package/esm2015/components/page/page.component.js +4 -4
  30. package/esm2015/components/page/page.module.js +2 -2
  31. package/esm2015/components/page/page.providers.js +1 -1
  32. package/esm2015/directives/scroll-into-view/scroll-into-view.module.js +1 -1
  33. package/esm2015/interfaces/page.js +1 -1
  34. package/esm2015/internal/header/header.component.js +12 -8
  35. package/esm2015/internal/header/header.module.js +1 -1
  36. package/esm2015/internal/input-opacity/input-opacity.module.js +1 -1
  37. package/esm2015/internal/see-also/see-also.component.js +2 -2
  38. package/esm2015/internal/see-also/see-also.module.js +1 -1
  39. package/esm2015/internal/source-code/source-code.component.js +2 -2
  40. package/esm2015/internal/source-code/source-code.module.js +1 -1
  41. package/esm2015/languages/russian.js +1 -1
  42. package/esm2015/public-api.js +5 -5
  43. package/esm2015/taiga-ui-addon-doc.js +12 -11
  44. package/esm2015/tokens/code-editor.js +1 -1
  45. package/esm2015/tokens/example-content-processor.js +2 -4
  46. package/esm2015/tokens/i18n.js +13 -5
  47. package/esm2015/tokens/pages.js +1 -1
  48. package/esm2015/tokens/source-code.js +1 -1
  49. package/esm2015/utils/raw-load-record.js +12 -0
  50. package/esm2015/utils/raw-load.js +7 -0
  51. package/esm5/addon-doc.module.js +1 -1
  52. package/esm5/components/code/code.component.js +15 -4
  53. package/esm5/components/code/code.module.js +1 -1
  54. package/esm5/components/copy/copy.component.js +2 -2
  55. package/esm5/components/copy/copy.module.js +1 -1
  56. package/esm5/components/demo/demo.component.js +3 -3
  57. package/esm5/components/demo/demo.module.js +1 -1
  58. package/esm5/components/documentation/documentation-property-connector.directive.js +9 -2
  59. package/esm5/components/documentation/documentation.component.js +9 -3
  60. package/esm5/components/documentation/documentation.module.js +4 -3
  61. package/esm5/components/example/example-get-tabs.pipe.js +15 -0
  62. package/esm5/components/example/example.component.js +10 -44
  63. package/esm5/components/example/example.module.js +4 -3
  64. package/esm5/components/main/main.component.js +4 -2
  65. package/esm5/components/main/main.module.js +1 -1
  66. package/esm5/components/navigation/navigation.component.js +20 -17
  67. package/esm5/components/navigation/navigation.module.js +1 -1
  68. package/esm5/components/navigation/navigation.providers.js +1 -1
  69. package/esm5/components/page/page.component.js +4 -4
  70. package/esm5/components/page/page.module.js +2 -2
  71. package/esm5/components/page/page.providers.js +1 -1
  72. package/esm5/directives/scroll-into-view/scroll-into-view.module.js +1 -1
  73. package/esm5/interfaces/page.js +1 -1
  74. package/esm5/internal/header/header.component.js +12 -8
  75. package/esm5/internal/header/header.module.js +1 -1
  76. package/esm5/internal/input-opacity/input-opacity.module.js +1 -1
  77. package/esm5/internal/see-also/see-also.component.js +2 -2
  78. package/esm5/internal/see-also/see-also.module.js +1 -1
  79. package/esm5/internal/source-code/source-code.component.js +2 -2
  80. package/esm5/internal/source-code/source-code.module.js +1 -1
  81. package/esm5/languages/russian.js +1 -1
  82. package/esm5/public-api.js +5 -5
  83. package/esm5/taiga-ui-addon-doc.js +12 -11
  84. package/esm5/tokens/code-editor.js +1 -1
  85. package/esm5/tokens/example-content-processor.js +2 -4
  86. package/esm5/tokens/i18n.js +13 -5
  87. package/esm5/tokens/pages.js +1 -1
  88. package/esm5/tokens/source-code.js +1 -1
  89. package/esm5/utils/raw-load-record.js +44 -0
  90. package/esm5/utils/raw-load.js +21 -0
  91. package/fesm2015/taiga-ui-addon-doc.js +734 -696
  92. package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
  93. package/fesm5/taiga-ui-addon-doc.js +803 -728
  94. package/fesm5/taiga-ui-addon-doc.js.map +1 -1
  95. package/interfaces/page.d.ts +4 -0
  96. package/internal/header/header.component.d.ts +3 -1
  97. package/package.json +6 -6
  98. package/public-api.d.ts +4 -4
  99. package/taiga-ui-addon-doc.d.ts +11 -10
  100. package/taiga-ui-addon-doc.metadata.json +1 -1
  101. package/utils/raw-load-record.d.ts +2 -0
  102. package/utils/raw-load.d.ts +2 -0
@@ -1,25 +1,54 @@
1
- import { __decorate, __param, __assign, __spread, __read } from 'tslib';
2
- import { Input, HostBinding, Component, NgModule, Inject, ChangeDetectionStrategy, InjectionToken, Renderer2, PLATFORM_ID, ContentChild, TemplateRef, ViewChild, HostListener, forwardRef, Optional, ElementRef, Directive, EventEmitter, Output, ChangeDetectorRef, ContentChildren, Attribute, ViewEncapsulation } from '@angular/core';
1
+ import { __awaiter, __generator, __decorate, __param, __assign, __spread, __read, __values } from 'tslib';
2
+ import { Input, HostBinding, Component, NgModule, Inject, ChangeDetectionStrategy, InjectionToken, Renderer2, PLATFORM_ID, ContentChild, TemplateRef, ViewChild, HostListener, forwardRef, EventEmitter, Output, Directive, ChangeDetectorRef, ContentChildren, Attribute, Optional, Pipe, ViewEncapsulation, ElementRef } from '@angular/core';
3
+ import { BehaviorSubject, Subject, timer, Observable, merge } from 'rxjs';
4
+ import { switchMap, switchMapTo, mapTo, startWith, takeUntil, map, debounceTime, filter, mergeMap, distinctUntilChanged } from 'rxjs/operators';
3
5
  import { CommonModule, isPlatformBrowser, Location as Location$1, DOCUMENT } from '@angular/common';
4
6
  import { HighlightModule } from 'ngx-highlightjs';
5
- import { tuiPure, TuiDestroyService, TUI_IS_MOBILE, TuiDragModule, isPresent, uniqBy, getElementObscurers, TuiActiveZoneModule, TuiLetModule, TuiAutoFocusModule, EMPTY_QUERY, itemsQueryListObservable, watch, TUI_FOCUSABLE_ITEM_ACCESSOR, identity, tuiDefaultProp } from '@taiga-ui/cdk';
6
- import { TUI_COPY_TEXTS, TuiSelectModule, TuiRadioBlockModule, TuiCheckboxLabeledModule, TuiDataListWrapperModule, TuiAccordionModule, TuiBadgeModule, TuiToggleModule, TuiInputCountModule, TuiTabsModule, TuiTagModule } from '@taiga-ui/kit';
7
- import { Subject, timer, Observable, merge } from 'rxjs';
8
- import { switchMapTo, mapTo, startWith, takeUntil, filter, map, mergeMap, debounceTime, switchMap, distinctUntilChanged } from 'rxjs/operators';
9
- import { TuiButtonModule, TuiModeDirective, TuiLinkModule, TuiExpandModule, TuiGroupModule, TuiTooltipModule, TuiModeModule, TuiSvgModule, TuiDataListModule, TuiTextfieldControllerModule, TuiHintControllerModule, TuiPrimitiveTextfieldModule, TuiHostedDropdownModule, TuiDropdownControllerModule, TuiScrollbarModule, TuiNotificationsService, TuiThemeNightModule, TuiRootModule, TuiDialogModule, TuiNotificationsModule } from '@taiga-ui/core';
7
+ import { tuiPure, TuiDestroyService, TUI_IS_MOBILE, TuiDragModule, EMPTY_QUERY, itemsQueryListObservable, watch, TUI_FOCUSABLE_ITEM_ACCESSOR, identity, TuiSwipeService, getElementObscurers, isPresent, uniqBy, TuiActiveZoneModule, TuiLetModule, TuiAutoFocusModule, tuiDefaultProp } from '@taiga-ui/cdk';
8
+ import { TUI_COPY_TEXTS, TuiSelectModule, TuiRadioBlockModule, TuiCheckboxLabeledModule, TuiDataListWrapperModule, TuiBadgeModule, TuiToggleModule, TuiInputCountModule, TuiTabsModule, TuiAccordionModule, TuiTagModule } from '@taiga-ui/kit';
9
+ import { TuiButtonModule, TuiModeDirective, TuiLinkModule, TuiExpandModule, TuiGroupModule, TuiTooltipModule, TuiModeModule, TuiSvgModule, TuiDataListModule, TuiTextfieldControllerModule, TuiHintControllerModule, TuiPrimitiveTextfieldModule, TuiDropdownControllerModule, TuiNotificationModule, TuiNotificationsService, TuiHostedDropdownModule, TuiScrollbarModule, TuiThemeNightModule, TuiRootModule, TuiDialogModule, TuiNotificationsModule } from '@taiga-ui/core';
10
10
  import { FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
11
- import { UrlSerializer, RouterModule, Router, ActivatedRoute, NavigationEnd } from '@angular/router';
12
- import { Title } from '@angular/platform-browser';
13
- import { TuiSidebarDirective, TuiSidebarModule } from '@taiga-ui/addon-mobile';
11
+ import { UrlSerializer, RouterModule, ActivatedRoute, Router, NavigationEnd } from '@angular/router';
12
+ import { trigger, transition, style, animate } from '@angular/animations';
14
13
  import { Clipboard, ClipboardModule } from '@angular/cdk/clipboard';
15
14
  import { LOCATION, LOCAL_STORAGE, WINDOW } from '@ng-web-apis/common';
16
15
  import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
16
+ import { TuiSidebarDirective, TuiSidebarModule } from '@taiga-ui/addon-mobile';
17
+ import { Title } from '@angular/platform-browser';
18
+
19
+ function rawLoad(content) {
20
+ return __awaiter(this, void 0, void 0, function () {
21
+ var _a;
22
+ return __generator(this, function (_b) {
23
+ switch (_b.label) {
24
+ case 0:
25
+ if (!(content instanceof Promise)) return [3 /*break*/, 2];
26
+ return [4 /*yield*/, content];
27
+ case 1:
28
+ _a = (_b.sent()).default;
29
+ return [3 /*break*/, 3];
30
+ case 2:
31
+ _a = content;
32
+ _b.label = 3;
33
+ case 3: return [2 /*return*/, _a];
34
+ }
35
+ });
36
+ });
37
+ }
17
38
 
18
39
  var TuiDocCodeComponent = /** @class */ (function () {
19
40
  function TuiDocCodeComponent() {
41
+ this.rawLoader$$ = new BehaviorSubject('');
42
+ this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
20
43
  this.filename = '';
21
- this.code = '';
22
44
  }
45
+ Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
46
+ set: function (code) {
47
+ this.rawLoader$$.next(code);
48
+ },
49
+ enumerable: true,
50
+ configurable: true
51
+ });
23
52
  Object.defineProperty(TuiDocCodeComponent.prototype, "hasFilename", {
24
53
  get: function () {
25
54
  return !!this.filename;
@@ -32,14 +61,14 @@ var TuiDocCodeComponent = /** @class */ (function () {
32
61
  ], TuiDocCodeComponent.prototype, "filename", void 0);
33
62
  __decorate([
34
63
  Input()
35
- ], TuiDocCodeComponent.prototype, "code", void 0);
64
+ ], TuiDocCodeComponent.prototype, "code", null);
36
65
  __decorate([
37
66
  HostBinding('class._has-filename')
38
67
  ], TuiDocCodeComponent.prototype, "hasFilename", null);
39
68
  TuiDocCodeComponent = __decorate([
40
69
  Component({
41
70
  selector: 'tui-doc-code',
42
- template: "<p *ngIf=\"filename\" class=\"t-header\">{{filename}}</p>\n<pre class=\"t-code\"><code [lineNumbers]=\"true\" [highlight]=\"code\"></code></pre>\n",
71
+ template: "<p *ngIf=\"filename\" class=\"t-header\">{{filename}}</p>\n<pre\n class=\"t-code\"\n><code [lineNumbers]=\"true\" [highlight]=\"processor$ | async\"></code></pre>\n",
43
72
  styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:700}.t-code{margin:0}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear-disabled);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.hljs:not(:empty)::-webkit-scrollbar,.hljs:not(:empty)::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.hljs:not(:empty)::-webkit-scrollbar{background-color:transparent}.hljs:not(:empty)::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.hljs:not(:empty)::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.hljs:not(:empty)::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host._has-filename .hljs:not(:empty){border-radius:.75rem}@media screen and (max-width:47.9375em){.hljs:not(:empty){padding:1rem}}"]
44
73
  })
45
74
  ], TuiDocCodeComponent);
@@ -85,7 +114,7 @@ var TuiDocCopyComponent = /** @class */ (function () {
85
114
  TuiDocCopyComponent = __decorate([
86
115
  Component({
87
116
  selector: 'tui-doc-copy',
88
- template: "<button\n *ngIf=\"texts$ | async as texts\"\n tuiButton\n type=\"button\"\n class=\"t-copy\"\n appearance=\"\"\n size=\"s\"\n [title]=\"texts[0]\"\n (click)=\"onClick()\"\n>\n <span class=\"t-content\" [class.t-content_moved]=\"copied$ | async\">\n <span class=\"t-initial\" [attr.data-text]=\"texts[0]\">\n <ng-content></ng-content>\n </span>\n {{texts[1]}}\n </span>\n</button>\n",
117
+ template: "<button\n *ngIf=\"texts$ | async as texts\"\n tuiButton\n type=\"button\"\n appearance=\"\"\n size=\"s\"\n class=\"t-copy\"\n [title]=\"texts[0]\"\n (click)=\"onClick()\"\n>\n <span class=\"t-content\" [class.t-content_moved]=\"copied$ | async\">\n <span class=\"t-initial\" [attr.data-text]=\"texts[0]\">\n <ng-content></ng-content>\n </span>\n {{ texts[1] }}\n </span>\n</button>\n",
89
118
  changeDetection: ChangeDetectionStrategy.OnPush,
90
119
  providers: [TuiDestroyService],
91
120
  styles: [":host{position:relative;display:inline-block;vertical-align:middle}.t-copy{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:100%;color:var(--tui-text-01);background:var(--tui-base-01);overflow:hidden}.t-copy:hover{background:var(--tui-base-02)}.t-initial{white-space:nowrap}.t-initial:empty:before{content:attr(data-text)}.t-content{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;flex-direction:column;transform:translateY(1rem);text-align:center;line-height:2rem}.t-content_moved{transform:translateY(-1rem)}"]
@@ -115,7 +144,9 @@ var TuiDocCopyModule = /** @class */ (function () {
115
144
  * Works with a tuple
116
145
  * [@string tuiMode tooltip content, @string word 'background', @string 'form value']
117
146
  */
118
- var TUI_DOC_DEMO_TEXTS = new InjectionToken('tui-doc-demo i18n texts', { factory: function () { return ['Read more more about modes: ', 'Background', 'Form value']; } });
147
+ var TUI_DOC_DEMO_TEXTS = new InjectionToken('tui-doc-demo i18n texts', {
148
+ factory: function () { return ['Read more more about modes: ', 'Background', 'Form value']; },
149
+ });
119
150
  /**
120
151
  * Works with a tuple
121
152
  * [
@@ -143,15 +174,21 @@ var TUI_DOC_DOCUMENTATION_TEXTS = new InjectionToken('tui-doc-documentation i18n
143
174
  * @string link to a sample copied message label
144
175
  * ]
145
176
  */
146
- var TUI_DOC_EXAMPLE_TEXTS = new InjectionToken('tui-doc-example i18n texts', { factory: function () { return ['Preview', 'Link to a sample was successfully copied', 'Done']; } });
177
+ var TUI_DOC_EXAMPLE_TEXTS = new InjectionToken('tui-doc-example i18n texts', {
178
+ factory: function () { return ['Preview', 'Link to a sample was successfully copied', 'Done']; },
179
+ });
147
180
  var TUI_DOC_MENU_TEXT = new InjectionToken('menu i18n text', {
148
181
  factory: function () { return 'Menu'; },
149
182
  });
150
183
  var TUI_DOC_SEARCH_TEXT = new InjectionToken('search i18n text', {
151
184
  factory: function () { return 'Search'; },
152
185
  });
153
- var TUI_DOC_SEE_ALSO_TEXT = new InjectionToken('tui-doc-see-also i18n text', { factory: function () { return 'See also'; } });
154
- var TUI_DOC_SOURCE_CODE_TEXT = new InjectionToken('tui-doc-source-code i18n text', { factory: function () { return 'Source code'; } });
186
+ var TUI_DOC_SEE_ALSO_TEXT = new InjectionToken('tui-doc-see-also i18n text', {
187
+ factory: function () { return 'See also'; },
188
+ });
189
+ var TUI_DOC_SOURCE_CODE_TEXT = new InjectionToken('tui-doc-source-code i18n text', {
190
+ factory: function () { return 'Source code'; },
191
+ });
155
192
 
156
193
  var MIN_COMPONENT_WIDTH = 104;
157
194
  // @dynamic
@@ -272,7 +309,7 @@ var TuiDocDemoComponent = /** @class */ (function () {
272
309
  TuiDocDemoComponent = TuiDocDemoComponent_1 = __decorate([
273
310
  Component({
274
311
  selector: 'tui-doc-demo',
275
- template: "<div class=\"t-bg-toggle\" [tuiMode]=\"null\">\n <ng-template #tooltip>\n {{texts[0]}}\n <a tuiLink tuiMode=\"onDark\" routerLink=\"/directives/mode\">\n <code>tuiMode</code>\n </a>\n </ng-template>\n <ng-container *ngIf=\"isMobile else desktop\">\n <tui-select\n class=\"t-mode\"\n tuiTextfieldSize=\"s\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiHintContent]=\"tooltip\"\n [formControl]=\"modeControl\"\n >\n tuiMode\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"items\"\n ></tui-data-list-wrapper>\n </tui-select>\n </ng-container>\n <ng-template #desktop>\n tuiMode:\n <tui-tooltip describeId=\"form\" [content]=\"tooltip\"></tui-tooltip>\n <div tuiGroup class=\"tui-space_left-3\" [collapsed]=\"true\">\n <tui-radio-block\n class=\"tui-group__auto-width-item\"\n size=\"s\"\n nativeId=\"form\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n null\n </tui-radio-block>\n <tui-radio-block\n class=\"tui-group__auto-width-item\"\n item=\"onDark\"\n size=\"s\"\n nativeId=\"form\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onDark\n </tui-radio-block>\n <tui-radio-block\n class=\"tui-group__auto-width-item\"\n item=\"onLight\"\n size=\"s\"\n nativeId=\"form\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n class=\"tui-space_left-3\"\n size=\"m\"\n [(ngModel)]=\"opaque\"\n >\n {{texts[1]}}\n </tui-checkbox-labeled>\n</div>\n<div\n #wrapper\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"modeControl.value === 'onDark'\"\n [class.t-wrapper_gray]=\"modeControl.value === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div #content id=\"demoContent\" class=\"t-content\">\n <form *ngIf=\"testForm\" class=\"t-form\" [formGroup]=\"testForm\">\n <div class=\"t-input-wrapper\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n </div>\n <button\n tuiButton\n type=\"button\"\n class=\"tui-space_top-3\"\n size=\"s\"\n [iconRight]=\"icon\"\n (click)=\"toggleDetails()\"\n >\n {{texts[2]}}\n </button>\n <ng-template #icon>\n <tui-svg\n src=\"tuiIconChevronDown\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"expanded\"\n ></tui-svg>\n </ng-template>\n <tui-expand class=\"t-expand\" [expanded]=\"expanded\">\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">\nForm data: {{testForm.value | json}}</pre\n >\n <div tuiGroup class=\"tui-space_top-3\">\n <tui-select\n class=\"t-select\"\n tuiTextfieldSize=\"s\"\n [ngModel]=\"updateOn\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"updateOnChange($event)\"\n >\n updateOn\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"updateOnVariants\"\n ></tui-data-list-wrapper>\n </tui-select>\n <button\n tuiButton\n class=\"tui-group__auto-width-item\"\n type=\"reset\"\n size=\"s\"\n >\n Reset\n </button>\n <button\n tuiButton\n class=\"tui-group__auto-width-item\"\n type=\"submit\"\n size=\"s\"\n >\n Submit\n </button>\n </div>\n </ng-template>\n </tui-expand>\n </form>\n <ng-content></ng-content>\n </div>\n <button\n class=\"t-resizer\"\n tabindex=\"-1\"\n (tuiDragStart)=\"onDragStart($event)\"\n (tuiDragContinues)=\"onDragContinues($event)\"\n (tuiDragEnd)=\"onDragEnd()\"\n >\n <span #resizerText class=\"t-resizer-text\"></span>\n </button>\n</div>\n",
312
+ template: "<div class=\"t-bg-toggle\" [tuiMode]=\"null\">\n <ng-template #tooltip>\n {{ texts[0] }}\n <a tuiLink tuiMode=\"onDark\" routerLink=\"/directives/mode\">\n <code>tuiMode</code>\n </a>\n </ng-template>\n <ng-container *ngIf=\"isMobile; else desktop\">\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-mode\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiHintContent]=\"tooltip\"\n [formControl]=\"modeControl\"\n >\n tuiMode\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"items\"\n ></tui-data-list-wrapper>\n </tui-select>\n </ng-container>\n <ng-template #desktop>\n tuiMode:\n <tui-tooltip describeId=\"form\" [content]=\"tooltip\"></tui-tooltip>\n <div tuiGroup class=\"tui-space_left-3\" [collapsed]=\"true\">\n <tui-radio-block\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n null\n </tui-radio-block>\n <tui-radio-block\n item=\"onDark\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onDark\n </tui-radio-block>\n <tui-radio-block\n item=\"onLight\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n size=\"m\"\n class=\"tui-space_left-3\"\n [(ngModel)]=\"opaque\"\n >\n {{ texts[1] }}\n </tui-checkbox-labeled>\n</div>\n<div\n #wrapper\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"modeControl.value === 'onDark'\"\n [class.t-wrapper_gray]=\"modeControl.value === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div #content id=\"demoContent\" class=\"t-content\">\n <form *ngIf=\"testForm\" class=\"t-form\" [formGroup]=\"testForm\">\n <div class=\"t-input-wrapper\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n </div>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n class=\"tui-space_top-3\"\n [iconRight]=\"icon\"\n (click)=\"toggleDetails()\"\n >\n {{ texts[2] }}\n </button>\n <ng-template #icon>\n <tui-svg\n src=\"tuiIconChevronDown\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"expanded\"\n ></tui-svg>\n </ng-template>\n <tui-expand class=\"t-expand\" [expanded]=\"expanded\">\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">\nForm data: {{ testForm.value | json }}</pre\n >\n <div tuiGroup class=\"tui-space_top-3\">\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-select\"\n [ngModel]=\"updateOn\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"updateOnChange($event)\"\n >\n updateOn\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"updateOnVariants\"\n ></tui-data-list-wrapper>\n </tui-select>\n <button\n tuiButton\n type=\"reset\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Reset\n </button>\n <button\n tuiButton\n type=\"submit\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Submit\n </button>\n </div>\n </ng-template>\n </tui-expand>\n </form>\n <ng-content></ng-content>\n </div>\n <button\n tabindex=\"-1\"\n class=\"t-resizer\"\n (tuiDragStart)=\"onDragStart($event)\"\n (tuiDragContinues)=\"onDragContinues($event)\"\n (tuiDragEnd)=\"onDragEnd()\"\n >\n <span #resizerText class=\"t-resizer-text\"></span>\n </button>\n</div>\n",
276
313
  changeDetection: ChangeDetectionStrategy.OnPush,
277
314
  providers: [
278
315
  TuiDestroyService,
@@ -281,7 +318,7 @@ var TuiDocDemoComponent = /** @class */ (function () {
281
318
  useExisting: forwardRef(function () { return TuiDocDemoComponent_1; }),
282
319
  },
283
320
  ],
284
- styles: [":host{position:relative;display:block;min-width:100%;margin:1.5rem 0}.t-bg-toggle{position:absolute;bottom:calc(100% + .75rem);display:flex;align-items:center;justify-content:flex-end;pointer-events:none;width:100%}.t-bg-toggle>*{pointer-events:auto}.t-wrapper{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:flex;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);max-width:100%;min-height:6rem;width:100%;background-color:var(--tui-base-01);overflow:hidden}.t-wrapper.wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-base-02) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-base-02) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-base-02) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-base-02) 75%);background-size:1.25rem 1.25rem;background-position:0 0,0 .625rem,.625rem -.625rem,-.625rem 0}.t-wrapper.wrapper_dark{background-color:#454e58;color:var(--tui-base-01)}.t-wrapper.wrapper_gray{background-color:#e5e7ea}.t-wrapper.wrapper_dark.wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-focus) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-focus) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-focus) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-focus) 75%)}.t-wrapper.wrapper_gray.wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-base-05) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-base-05) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-base-05) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-base-05) 75%)}.t-content{flex:1 1 0;min-width:0;padding:1.5rem;box-sizing:border-box;overflow:hidden}@media screen and (max-width:47.9375em){.t-wrapper{min-height:auto}.t-content{padding:1rem}}.t-form{display:flex;flex-wrap:wrap;align-items:flex-start}.t-input-wrapper{width:100%;margin-bottom:.5rem}.t-expand{width:100%}.t-icon{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out}.t-icon_rotated{transform:rotate(180deg)}.t-value{flex:1;background:var(--tui-clear-inverse);padding:.75rem;border-radius:.25rem}.t-mode{width:12.5rem}.t-select{max-width:15rem}.t-resizer{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;box-shadow:0 .5rem 1rem rgba(0,0,0,.16);position:relative;width:3.5rem;min-height:inherit;flex-shrink:0;border-left:1px solid var(--tui-base-03);cursor:col-resize;outline:0;background:var(--tui-base-01);color:var(--tui-text-01)}.t-resizer:after,.t-resizer:before{content:'';position:absolute;top:.75rem;left:50%;bottom:.75rem;width:1px;background:var(--tui-base-05)}.t-resizer:before{transform:translateX(.125rem)}.t-resizer:after{transform:translateX(-.1875rem)}@media screen and (max-width:47.9375em){.t-resizer{display:none}}.t-resizer-text{font:var(--tui-font-text-s);position:relative;z-index:1;padding:.75rem;background:var(--tui-base-01)}.wrapper_light .t-resizer-text{background:#3e464e}@supports ((position:-webkit-sticky) or (position:sticky)){@media screen and (min-height:37.5rem){:host{position:-webkit-sticky;position:sticky;top:4.625rem;z-index:2}}}"]
321
+ styles: [":host{position:relative;display:block;min-width:100%;margin:1.5rem 0}.t-bg-toggle{position:absolute;bottom:calc(100% + .75rem);display:flex;align-items:center;justify-content:flex-end;pointer-events:none;width:100%}.t-bg-toggle>*{pointer-events:auto}.t-wrapper{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:flex;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);max-width:100%;min-height:6rem;width:100%;background-color:var(--tui-base-01);overflow:hidden}.t-wrapper.t-wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-base-02) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-base-02) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-base-02) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-base-02) 75%);background-size:1.25rem 1.25rem;background-position:0 0,0 .625rem,.625rem -.625rem,-.625rem 0}.t-wrapper.t-wrapper_dark{background-color:#454e58;color:var(--tui-base-01)}.t-wrapper.t-wrapper_gray{background-color:#e5e7ea}.t-wrapper.t-wrapper_dark.t-wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-focus) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-focus) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-focus) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-focus) 75%)}.t-wrapper.t-wrapper_gray.t-wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-base-05) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-base-05) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-base-05) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-base-05) 75%)}.t-content{flex:1 1 0;min-width:0;padding:1.5rem;box-sizing:border-box;overflow:hidden}@media screen and (max-width:47.9375em){.t-wrapper{min-height:auto}.t-content{padding:1rem}}.t-form{display:flex;flex-wrap:wrap;align-items:flex-start}.t-input-wrapper{width:100%;margin-bottom:.5rem}.t-expand{width:100%}.t-icon{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out}.t-icon_rotated{transform:rotate(180deg)}.t-value{flex:1;background:var(--tui-clear-inverse);padding:.75rem;border-radius:.25rem}.t-mode{width:12.5rem}.t-select{max-width:15rem}.t-resizer{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;box-shadow:0 .5rem 1rem rgba(0,0,0,.16);position:relative;width:3.5rem;min-height:inherit;flex-shrink:0;border-left:1px solid var(--tui-base-03);cursor:col-resize;outline:0;background:var(--tui-base-01);color:var(--tui-text-01)}.t-resizer:after,.t-resizer:before{content:'';position:absolute;top:.75rem;left:50%;bottom:.75rem;width:1px;background:var(--tui-base-05)}.t-resizer:before{transform:translateX(.125rem)}.t-resizer:after{transform:translateX(-.1875rem)}@media screen and (max-width:47.9375em){.t-resizer{display:none}}.t-resizer-text{font:var(--tui-font-text-s);position:relative;z-index:1;padding:.75rem;background:var(--tui-base-01)}.wrapper_light .t-resizer-text{background:#3e464e}@supports (position:sticky){@media screen and (min-height:37.5rem){:host{position:sticky;top:4.625rem;z-index:2}}}"]
285
322
  }),
286
323
  __param(0, Inject(TUI_IS_MOBILE)),
287
324
  __param(1, Inject(TuiDestroyService)),
@@ -327,490 +364,131 @@ var TuiDocDemoModule = /** @class */ (function () {
327
364
  return TuiDocDemoModule;
328
365
  }());
329
366
 
330
- var MAP = {
331
- а: 'f',
332
- б: ',',
333
- в: 'd',
334
- г: 'u',
335
- д: 'l',
336
- е: 't',
337
- ё: '`',
338
- ж: ';',
339
- з: 'p',
340
- и: 'b',
341
- й: 'q',
342
- к: 'r',
343
- л: 'k',
344
- м: 'v',
345
- н: 'y',
346
- о: 'j',
347
- п: 'g',
348
- р: 'h',
349
- с: 'c',
350
- т: 'n',
351
- у: 'e',
352
- ф: 'a',
353
- х: '[',
354
- ц: 'w',
355
- ч: 'x',
356
- ш: 'i',
357
- щ: 'o',
358
- ъ: ']',
359
- ы: 's',
360
- ь: 'm',
361
- ю: '.',
362
- я: 'z',
363
- };
364
- /**
365
- * Translates text mistakenly typed in the Russian layout into English
366
- * @param string string with Russian layout characters
367
- * @return string with English layout characters
368
- */
369
- function transliterateKeyboardLayout(string) {
370
- var newStr = '';
371
- for (var i = 0; i < string.length; i++) {
372
- newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
373
- }
374
- return newStr;
367
+ function rgbToHex(r, g, b) {
368
+ return ('#' +
369
+ [r, g, b]
370
+ .map(function (x) {
371
+ var hex = x.toString(16);
372
+ return hex.length === 1 ? '0' + hex : hex;
373
+ })
374
+ .join(''));
375
+ }
376
+ function hexToRgb(hex) {
377
+ var matches = hex
378
+ .replace('#', '')
379
+ .split('')
380
+ .map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
381
+ .join('')
382
+ .match(/.{2}/g);
383
+ return matches
384
+ ? matches.map(function (x) { return Number.parseInt(x, 16); })
385
+ : [0, 0, 0];
375
386
  }
376
387
 
377
- var TUI_DOC_PAGES = new InjectionToken('Documentation pages', {
378
- factory: function () { return []; },
379
- });
380
-
381
- var TUI_DOC_TITLE = new InjectionToken('Page title', {
382
- factory: function () { return ''; },
383
- });
384
-
385
- var NAVIGATION_TITLE = new InjectionToken('Page title');
386
- var NAVIGATION_LABELS = new InjectionToken('Navigation sections labels for search');
387
- var NAVIGATION_ITEMS = new InjectionToken('Navigation pages');
388
- var NAVIGATION_PROVIDERS = [
389
- TuiDestroyService,
390
- {
391
- provide: NAVIGATION_TITLE,
392
- deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
393
- useFactory: titleProviderFactory,
394
- },
395
- {
396
- provide: NAVIGATION_LABELS,
397
- deps: [TUI_DOC_PAGES],
398
- useFactory: labelsProviderFactory,
399
- },
400
- {
401
- provide: NAVIGATION_ITEMS,
402
- deps: [TUI_DOC_PAGES],
403
- useFactory: itemsProviderFactory,
404
- },
405
- ];
406
- function titleProviderFactory(router, activatedRoute, titlePrefix, destroy$) {
407
- return router.events.pipe(filter(function (event) { return event instanceof NavigationEnd; }), map(function () { return activatedRoute.firstChild; }), filter(isPresent), mergeMap(function (_a) {
408
- var data = _a.data;
409
- return data;
410
- }), map(function (_a) {
411
- var title = _a.title;
412
- return titlePrefix + title;
413
- }), takeUntil(destroy$));
388
+ function inspectArray(array, depth) {
389
+ if (depth === 0) {
390
+ return '[…]';
391
+ }
392
+ var result = '';
393
+ var first = true;
394
+ for (var index = 0; index < array.length; index++) {
395
+ if (first) {
396
+ first = false;
397
+ }
398
+ else {
399
+ result += ', ';
400
+ }
401
+ result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
402
+ }
403
+ return "[" + result + "]";
414
404
  }
415
- function labelsProviderFactory(pages) {
416
- return pages
417
- .map(function (_a) {
418
- var section = _a.section;
419
- return section;
420
- })
421
- .filter(isPresent)
422
- .filter(function (item, index, array) { return array.indexOf(item) === index; });
405
+ function inspectObject(object, depth) {
406
+ if (depth === 0) {
407
+ return "{\u2026}";
408
+ }
409
+ var result = '';
410
+ var first = true;
411
+ for (var key in object) {
412
+ if (!object.hasOwnProperty(key)) {
413
+ continue;
414
+ }
415
+ if (first) {
416
+ first = false;
417
+ }
418
+ else {
419
+ result += ', ';
420
+ }
421
+ result += key + ": " + inspectAny(object[key], depth - 1);
422
+ }
423
+ return "{" + result + "}";
423
424
  }
424
- function itemsProviderFactory(pages) {
425
- var labels = labelsProviderFactory(pages);
426
- return __spread(labels.map(function (label) { return pages.filter(function (_a) {
427
- var section = _a.section;
428
- return section === label;
429
- }); }), [
430
- pages.filter(function (page) { return !page.section; }),
431
- ]);
425
+ // @bad TODO add more types
426
+ /**
427
+ * Returns readable JS entity
428
+ * @param data
429
+ * @param depth
430
+ * @return readable JS entity
431
+ */
432
+ function inspectAny(data, depth) {
433
+ if (data === null) {
434
+ return 'null';
435
+ }
436
+ switch (typeof data) {
437
+ case 'string':
438
+ return "'" + data + "'";
439
+ case 'undefined':
440
+ case 'number':
441
+ case 'boolean':
442
+ case 'function':
443
+ return String(data);
444
+ }
445
+ if (data instanceof RegExp) {
446
+ return data.toString();
447
+ }
448
+ if (Array.isArray(data)) {
449
+ return inspectArray(data, depth);
450
+ }
451
+ return inspectObject(data, depth);
432
452
  }
433
453
 
434
- var SCROLL_INTO_VIEW_DELAY = 200;
435
- // @dynamic
436
- var TuiDocNavigationComponent = /** @class */ (function () {
437
- function TuiDocNavigationComponent(titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
438
- var _this = this;
439
- this.documentRef = documentRef;
440
- this.mode = mode;
441
- this.sidebar = sidebar;
442
- this.labels = labels;
443
- this.items = items;
444
- this.searchText = searchText;
445
- this.router = router;
454
+ var SERIALIZED_SUFFIX = '$';
455
+ // @bad TODO: refactor output and value sync
456
+ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
457
+ function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
458
+ this.template = template;
459
+ this.locationRef = locationRef;
446
460
  this.activatedRoute = activatedRoute;
447
- this.search = '';
448
- this.open = false;
449
- this.openPagesArr = [];
450
- this.openPagesGroupsArr = [];
451
- this.active = '';
452
- this.menuOpen = false;
453
- this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode || 'onLight'; }));
454
- // Angular can't navigate no anchor links
455
- // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
456
- title$.subscribe(function (title) {
457
- titleService.setTitle(title);
458
- _this.openActivePageGroup();
459
- _this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
460
- });
461
+ this.urlSerializer = urlSerializer;
462
+ this.documentationPropertyName = '';
463
+ this.documentationPropertyMode = null;
464
+ this.documentationPropertyType = '';
465
+ this.documentationPropertyValue = null;
466
+ this.documentationPropertyDeprecated = false;
467
+ this.documentationPropertyValues = null;
468
+ this.documentationPropertyValueChange = new EventEmitter();
469
+ this.changed$ = new Subject();
470
+ this.emits$ = new BehaviorSubject(1);
461
471
  }
462
- Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
472
+ TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
473
+ this.parseParams(this.activatedRoute.snapshot.queryParams);
474
+ };
475
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
463
476
  get: function () {
464
- return this.search.length > 2;
477
+ switch (this.documentationPropertyMode) {
478
+ case 'input':
479
+ return "[" + this.documentationPropertyName + "]";
480
+ case 'output':
481
+ return "(" + this.documentationPropertyName + ")";
482
+ case 'input-output':
483
+ return "[(" + this.documentationPropertyName + ")]";
484
+ default:
485
+ return this.documentationPropertyName;
486
+ }
465
487
  },
466
488
  enumerable: true,
467
489
  configurable: true
468
490
  });
469
- Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
470
- get: function () {
471
- return this.filterItems(this.flattenSubPages(this.items), this.search);
472
- },
473
- enumerable: true,
474
- configurable: true
475
- });
476
- Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
477
- get: function () {
478
- return this.items[this.items.length - 1];
479
- },
480
- enumerable: true,
481
- configurable: true
482
- });
483
- TuiDocNavigationComponent.prototype.isActive = function (route) {
484
- return route === this.active;
485
- };
486
- TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
487
- this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
488
- };
489
- TuiDocNavigationComponent.prototype.closeMenu = function () {
490
- this.menuOpen = false;
491
- };
492
- TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
493
- this.search = search;
494
- this.open = this.canOpen;
495
- };
496
- TuiDocNavigationComponent.prototype.onClick = function () {
497
- this.open = false;
498
- this.menuOpen = false;
499
- this.search = '';
500
- this.openActivePageGroup();
501
- };
502
- TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
503
- return items.map(function (section) {
504
- return uniqBy(section.filter(function (_a) {
505
- var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
506
- title = title.toLowerCase();
507
- search = search.toLowerCase();
508
- keywords = keywords.toLowerCase();
509
- return (title.includes(search) ||
510
- keywords.includes(search) ||
511
- title.includes(transliterateKeyboardLayout(search)) ||
512
- keywords.includes(transliterateKeyboardLayout(search)) ||
513
- search.replace(/-/gi, '').includes(title));
514
- }), 'title');
515
- });
516
- };
517
- TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
518
- return items.reduce(function (array, item) { return __spread(array, [
519
- item.reduce(function (pages, page) {
520
- return 'subPages' in page
521
- ? __spread(pages, page.subPages) : __spread(pages, [page]);
522
- }, []),
523
- ]); }, []);
524
- };
525
- TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
526
- return this.router.isActive(route, false);
527
- };
528
- TuiDocNavigationComponent.prototype.handleAnchorLink = function (hash) {
529
- var _this = this;
530
- setTimeout(function () {
531
- _this.navigateToAnchorLink(hash);
532
- }, SCROLL_INTO_VIEW_DELAY);
533
- };
534
- TuiDocNavigationComponent.prototype.openActivePageGroup = function () {
535
- var _this = this;
536
- this.items.forEach(function (pages, pagesIndex) {
537
- pages.forEach(function (page, pageIndex) {
538
- if ('route' in page && _this.isActiveRoute(page.route)) {
539
- _this.openPagesArr[pagesIndex] = true;
540
- _this.active = page.route;
541
- }
542
- if ('subPages' in page) {
543
- page.subPages.forEach(function (subPage) {
544
- if (_this.isActiveRoute(subPage.route)) {
545
- _this.openPagesArr[pagesIndex] = true;
546
- _this.openPagesGroupsArr[pagesIndex + pageIndex] = true;
547
- _this.active = subPage.route;
548
- }
549
- });
550
- }
551
- });
552
- });
553
- };
554
- TuiDocNavigationComponent.prototype.navigateToAnchorLink = function (fragment) {
555
- var element = fragment && this.documentRef.querySelector("#" + fragment);
556
- if (!element) {
557
- return;
558
- }
559
- element.classList.add('tui-doc-animated-example');
560
- element.scrollIntoView({
561
- block: 'start',
562
- inline: 'nearest',
563
- behavior: 'smooth',
564
- });
565
- };
566
- TuiDocNavigationComponent.ctorParameters = function () { return [
567
- { type: Title, decorators: [{ type: Inject, args: [Title,] }] },
568
- { type: Observable, decorators: [{ type: Inject, args: [NAVIGATION_TITLE,] }] },
569
- { type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
570
- { type: TuiModeDirective, decorators: [{ type: Inject, args: [TuiModeDirective,] }] },
571
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TuiSidebarDirective,] }] },
572
- { type: Array, decorators: [{ type: Inject, args: [NAVIGATION_LABELS,] }] },
573
- { type: undefined, decorators: [{ type: Inject, args: [NAVIGATION_ITEMS,] }] },
574
- { type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
575
- { type: Router, decorators: [{ type: Inject, args: [Router,] }] },
576
- { type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] }
577
- ]; };
578
- __decorate([
579
- HostBinding('class._open')
580
- ], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
581
- __decorate([
582
- tuiPure
583
- ], TuiDocNavigationComponent.prototype, "filterItems", null);
584
- __decorate([
585
- tuiPure
586
- ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
587
- TuiDocNavigationComponent = __decorate([
588
- Component({
589
- selector: 'tui-doc-navigation',
590
- template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n class=\"input\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n [autoFocus]=\"!!sidebar\"\n [content]=\"dropdown\"\n [canOpen]=\"canOpen\"\n [(open)]=\"open\"\n>\n <tui-primitive-textfield\n iconAlign=\"left\"\n tuiTextfieldSize=\"m\"\n iconContent=\"tuiIconSearch\"\n [pseudoFocused]=\"open || null\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n [value]=\"search\"\n (valueChange)=\"onSearchChange($event)\"\n >\n {{searchText}}\n </tui-primitive-textfield>\n <ng-template #dropdown let-activeZone>\n <tui-data-list>\n <tui-opt-group\n *ngFor=\"let group of filtered; let index = index\"\n [label]=\"labels[index] || ''\"\n >\n <a\n *ngFor=\"let item of group\"\n tuiOption\n [routerLink]=\"item.route\"\n (click)=\"onClick()\"\n >\n {{item.title}}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-template>\n</tui-hosted-dropdown>\n\n<nav class=\"navigation\">\n <tui-scrollbar [tuiMode]=\"mode$ | async\" class=\"scrollbar\">\n <tui-accordion [closeOthers]=\"false\" [rounded]=\"false\">\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"tui-space_left-2\">\n <strong>{{label}}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: index + subIndex}\"\n >\n </ng-container>\n </ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: (items.length - 1) + index}\"\n >\n </ng-container>\n </ng-container>\n </div>\n\n <ng-template #pages let-item=\"item\" let-index=\"index\">\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n class=\"sublink\"\n routerLinkActive=\"sublink_active\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{item.title}}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"sublink sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"chevron\"\n [class.chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{item.title}}\n </button>\n <tui-expand\n class=\"tui-space_left-1\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"section section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n class=\"sublink sublink_small\"\n routerLinkActive=\"sublink_active\"\n [routerLink]=\"subPage.route\"\n [scrollIntoView]=\"isActive(subPage.route)\"\n (click)=\"closeMenu()\"\n >\n {{subPage.title}}\n </a>\n </div>\n </tui-expand>\n </div>\n </ng-template>\n </ng-template>\n </tui-scrollbar>\n</nav>\n\n<ng-content></ng-content>\n",
591
- providers: NAVIGATION_PROVIDERS,
592
- changeDetection: ChangeDetectionStrategy.OnPush,
593
- styles: [":host{display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01);z-index:1}.input{display:block;margin:1.25rem}.navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.scrollbar{width:100%;scroll-behavior:smooth}.items-container{display:flex;flex-direction:column;padding:0 16px}.section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.subsection{margin-left:.5rem}.sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;font:var(--tui-font-text-m);margin-left:.5rem;line-height:2.75rem}.sublink_small{margin-left:1rem;line-height:1.5rem}.sublink_small:not(:first-child){margin-top:1rem}.sublink_subsection{margin-left:0;line-height:2.75rem}.sublink_active{color:var(--tui-text-01)}.chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.chevron_active{transform:rotate(90deg)}"]
594
- }),
595
- __param(0, Inject(Title)),
596
- __param(1, Inject(NAVIGATION_TITLE)),
597
- __param(2, Inject(DOCUMENT)),
598
- __param(3, Inject(TuiModeDirective)),
599
- __param(4, Optional()),
600
- __param(4, Inject(TuiSidebarDirective)),
601
- __param(5, Inject(NAVIGATION_LABELS)),
602
- __param(6, Inject(NAVIGATION_ITEMS)),
603
- __param(7, Inject(TUI_DOC_SEARCH_TEXT)),
604
- __param(8, Inject(Router)),
605
- __param(9, Inject(ActivatedRoute))
606
- ], TuiDocNavigationComponent);
607
- return TuiDocNavigationComponent;
608
- }());
609
-
610
- var ScrollIntoViewDirective = /** @class */ (function () {
611
- function ScrollIntoViewDirective(destroy$, _a) {
612
- var nativeElement = _a.nativeElement;
613
- this.scroll$ = new Subject();
614
- this.scroll$
615
- .pipe(debounceTime(750), filter(function (shallWe) { return shallWe && !!getElementObscurers(nativeElement); }), takeUntil(destroy$))
616
- .subscribe(function () {
617
- nativeElement.scrollIntoView();
618
- });
619
- }
620
- Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
621
- set: function (shallWe) {
622
- this.scroll$.next(shallWe);
623
- },
624
- enumerable: true,
625
- configurable: true
626
- });
627
- ScrollIntoViewDirective.ctorParameters = function () { return [
628
- { type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
629
- { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] }
630
- ]; };
631
- __decorate([
632
- Input()
633
- ], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
634
- ScrollIntoViewDirective = __decorate([
635
- Directive({
636
- selector: '[scrollIntoView]',
637
- providers: [TuiDestroyService],
638
- }),
639
- __param(0, Inject(TuiDestroyService)),
640
- __param(1, Inject(ElementRef))
641
- ], ScrollIntoViewDirective);
642
- return ScrollIntoViewDirective;
643
- }());
644
-
645
- var ScrollIntoViewModule = /** @class */ (function () {
646
- function ScrollIntoViewModule() {
647
- }
648
- ScrollIntoViewModule = __decorate([
649
- NgModule({
650
- declarations: [ScrollIntoViewDirective],
651
- exports: [ScrollIntoViewDirective],
652
- })
653
- ], ScrollIntoViewModule);
654
- return ScrollIntoViewModule;
655
- }());
656
-
657
- var TuiDocNavigationModule = /** @class */ (function () {
658
- function TuiDocNavigationModule() {
659
- }
660
- TuiDocNavigationModule = __decorate([
661
- NgModule({
662
- imports: [
663
- CommonModule,
664
- FormsModule,
665
- RouterModule,
666
- ScrollIntoViewModule,
667
- TuiButtonModule,
668
- TuiPrimitiveTextfieldModule,
669
- TuiTextfieldControllerModule,
670
- TuiActiveZoneModule,
671
- TuiLetModule,
672
- TuiModeModule,
673
- TuiLinkModule,
674
- TuiExpandModule,
675
- TuiHostedDropdownModule,
676
- TuiDropdownControllerModule,
677
- TuiAccordionModule,
678
- TuiScrollbarModule,
679
- TuiSvgModule,
680
- TuiDataListModule,
681
- TuiAutoFocusModule,
682
- ],
683
- declarations: [TuiDocNavigationComponent],
684
- exports: [TuiDocNavigationComponent],
685
- })
686
- ], TuiDocNavigationModule);
687
- return TuiDocNavigationModule;
688
- }());
689
-
690
- function rgbToHex(r, g, b) {
691
- return ('#' +
692
- [r, g, b]
693
- .map(function (x) {
694
- var hex = x.toString(16);
695
- return hex.length === 1 ? '0' + hex : hex;
696
- })
697
- .join(''));
698
- }
699
- function hexToRgb(hex) {
700
- var matches = hex
701
- .replace('#', '')
702
- .split('')
703
- .map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
704
- .join('')
705
- .match(/.{2}/g);
706
- return matches
707
- ? matches.map(function (x) { return Number.parseInt(x, 16); })
708
- : [0, 0, 0];
709
- }
710
-
711
- function inspectArray(array, depth) {
712
- if (depth === 0) {
713
- return '[…]';
714
- }
715
- var result = '';
716
- var first = true;
717
- for (var index = 0; index < array.length; index++) {
718
- if (first) {
719
- first = false;
720
- }
721
- else {
722
- result += ', ';
723
- }
724
- result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
725
- }
726
- return "[" + result + "]";
727
- }
728
- function inspectObject(object, depth) {
729
- if (depth === 0) {
730
- return "{\u2026}";
731
- }
732
- var result = '';
733
- var first = true;
734
- for (var key in object) {
735
- if (!object.hasOwnProperty(key)) {
736
- continue;
737
- }
738
- if (first) {
739
- first = false;
740
- }
741
- else {
742
- result += ', ';
743
- }
744
- result += key + ": " + inspectAny(object[key], depth - 1);
745
- }
746
- return "{" + result + "}";
747
- }
748
- // @bad TODO add more types
749
- /**
750
- * Returns readable JS entity
751
- * @param data
752
- * @param depth
753
- * @return readable JS entity
754
- */
755
- function inspectAny(data, depth) {
756
- if (data === null) {
757
- return 'null';
758
- }
759
- switch (typeof data) {
760
- case 'string':
761
- return "'" + data + "'";
762
- case 'undefined':
763
- case 'number':
764
- case 'boolean':
765
- case 'function':
766
- return String(data);
767
- }
768
- if (data instanceof RegExp) {
769
- return data.toString();
770
- }
771
- if (Array.isArray(data)) {
772
- return inspectArray(data, depth);
773
- }
774
- return inspectObject(data, depth);
775
- }
776
-
777
- var SERIALIZED_SUFFIX = '$';
778
- // @bad TODO: refactor output and value sync
779
- var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
780
- function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
781
- this.template = template;
782
- this.locationRef = locationRef;
783
- this.activatedRoute = activatedRoute;
784
- this.urlSerializer = urlSerializer;
785
- this.documentationPropertyName = '';
786
- this.documentationPropertyMode = null;
787
- this.documentationPropertyType = '';
788
- this.documentationPropertyValue = null;
789
- this.documentationPropertyDeprecated = false;
790
- this.documentationPropertyValues = null;
791
- this.documentationPropertyValueChange = new EventEmitter();
792
- this.changed$ = new Subject();
793
- }
794
- TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
795
- this.parseParams(this.activatedRoute.snapshot.queryParams);
796
- };
797
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
798
- get: function () {
799
- switch (this.documentationPropertyMode) {
800
- case 'input':
801
- return "[" + this.documentationPropertyName + "]";
802
- case 'output':
803
- return "(" + this.documentationPropertyName + ")";
804
- case 'input-output':
805
- return "[(" + this.documentationPropertyName + ")]";
806
- default:
807
- return this.documentationPropertyName;
808
- }
809
- },
810
- enumerable: true,
811
- configurable: true
812
- });
813
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
491
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
814
492
  get: function () {
815
493
  return !!this.documentationPropertyValues;
816
494
  },
@@ -858,6 +536,11 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
858
536
  tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
859
537
  this.locationRef.go(String(tree));
860
538
  };
539
+ TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
540
+ // For more convenient debugging
541
+ console.log(this.attrName, event);
542
+ this.emits$.next(this.emits$.value + 1);
543
+ };
861
544
  TuiDocDocumentationPropertyConnectorDirective.ctorParameters = function () { return [
862
545
  { type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] },
863
546
  { type: Location$1, decorators: [{ type: Inject, args: [Location$1,] }] },
@@ -888,6 +571,7 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
888
571
  TuiDocDocumentationPropertyConnectorDirective = __decorate([
889
572
  Directive({
890
573
  selector: 'ng-template[documentationPropertyName]',
574
+ exportAs: 'documentationProperty',
891
575
  }),
892
576
  __param(0, Inject(TemplateRef)),
893
577
  __param(1, Inject(Location$1)),
@@ -1013,9 +697,14 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
1013
697
  TuiDocDocumentationComponent = __decorate([
1014
698
  Component({
1015
699
  selector: 'tui-doc-documentation',
1016
- template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{heading}}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{texts[2]}}\n </th>\n <td class=\"tui-table__th\">{{type}}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"\n tui-table__th tui-table__th_last tui-table__th_text_right\n t-cell t-cell_value\n \"\n >\n {{texts[3]}}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"\n tui-table__td tui-table__td_first tui-table__td_align_center\n t-cell\n \"\n >\n <div\n class=\"t-property t-cell\"\n automation-id=\"tui-documentation__property-name\"\n >\n {{stripOptional(propertyConnector.attrName)}}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >deprecated</span\n >\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{propertyConnector.documentationPropertyType}}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{texts[4]}}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n ><code>ng-polymorpheus</code></a\n >\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"\n tui-table__td\n tui-table__td_align_center\n tui-table__td_last\n tui-table__td_text_right\n t-cell\n \"\n >\n <ng-container *ngIf=\"propertyConnector.shouldShowValues\">\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{inspectAny(data)}}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n </td>\n </tr>\n</table>\n",
700
+ template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"\n tui-table__th tui-table__th_last tui-table__th_text_right\n t-cell t-cell_value\n \"\n >\n {{ texts[3] }}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"\n tui-table__td tui-table__td_first tui-table__td_align_center\n t-cell\n \"\n >\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property t-cell\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"\n tui-table__td\n tui-table__td_align_center\n tui-table__td_last\n tui-table__td_text_right\n t-cell\n \"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
1017
701
  changeDetection: ChangeDetectionStrategy.OnPush,
1018
- styles: [":host{display:block;min-width:100%}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}@media screen and (max-width:47.9375em){.t-row{display:flex;flex-wrap:wrap}.t-row_header{display:none}.t-cell_value{width:9.375rem}.t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}"]
702
+ animations: [
703
+ trigger('emitEvent', [
704
+ transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
705
+ ]),
706
+ ],
707
+ styles: [":host{display:block;min-width:100%}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}@media screen and (max-width:47.9375em){.t-row{display:flex;flex-wrap:wrap}.t-row_header{display:none}.t-cell_value{width:9.375rem}.t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content}.t-output{text-align:left;opacity:0}"]
1019
708
  }),
1020
709
  __param(0, Inject(ChangeDetectorRef)),
1021
710
  __param(1, Inject(TUI_DOC_DOCUMENTATION_TEXTS))
@@ -1067,237 +756,620 @@ var TuiInputOpacityModule = /** @class */ (function () {
1067
756
  return TuiInputOpacityModule;
1068
757
  }());
1069
758
 
1070
- var TuiDocDocumentationModule = /** @class */ (function () {
1071
- function TuiDocDocumentationModule() {
759
+ var TuiDocDocumentationModule = /** @class */ (function () {
760
+ function TuiDocDocumentationModule() {
761
+ }
762
+ TuiDocDocumentationModule = __decorate([
763
+ NgModule({
764
+ imports: [
765
+ CommonModule,
766
+ FormsModule,
767
+ RouterModule,
768
+ TuiBadgeModule,
769
+ TuiSelectModule,
770
+ TuiToggleModule,
771
+ TuiTooltipModule,
772
+ TuiLinkModule,
773
+ TuiInputCountModule,
774
+ TuiModeModule,
775
+ TuiGroupModule,
776
+ TuiInputOpacityModule,
777
+ TuiPrimitiveTextfieldModule,
778
+ TuiTextfieldControllerModule,
779
+ TuiHintControllerModule,
780
+ TuiDropdownControllerModule,
781
+ TuiDataListModule,
782
+ TuiDataListWrapperModule,
783
+ TuiNotificationModule,
784
+ ],
785
+ declarations: [
786
+ TuiDocDocumentationComponent,
787
+ TuiDocDocumentationPropertyConnectorDirective,
788
+ ],
789
+ exports: [
790
+ TuiDocDocumentationComponent,
791
+ TuiDocDocumentationPropertyConnectorDirective,
792
+ ],
793
+ })
794
+ ], TuiDocDocumentationModule);
795
+ return TuiDocDocumentationModule;
796
+ }());
797
+
798
+ var TUI_DOC_CODE_EDITOR = new InjectionToken('Contains service for opening online IDE e.g. Stackblitz');
799
+
800
+ var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new InjectionToken('Processes content in example', { factory: function () { return identity; } });
801
+
802
+ function rawLoadRecord(example) {
803
+ return __awaiter(this, void 0, void 0, function () {
804
+ var processedContent, _a, _b, _c, key, content, _d, _e, e_1_1;
805
+ var e_1, _f;
806
+ return __generator(this, function (_g) {
807
+ switch (_g.label) {
808
+ case 0:
809
+ processedContent = {};
810
+ _g.label = 1;
811
+ case 1:
812
+ _g.trys.push([1, 6, 7, 8]);
813
+ _a = __values(Object.entries(example)), _b = _a.next();
814
+ _g.label = 2;
815
+ case 2:
816
+ if (!!_b.done) return [3 /*break*/, 5];
817
+ _c = __read(_b.value, 2), key = _c[0], content = _c[1];
818
+ _d = processedContent;
819
+ _e = key;
820
+ return [4 /*yield*/, rawLoad(content)];
821
+ case 3:
822
+ _d[_e] = _g.sent();
823
+ _g.label = 4;
824
+ case 4:
825
+ _b = _a.next();
826
+ return [3 /*break*/, 2];
827
+ case 5: return [3 /*break*/, 8];
828
+ case 6:
829
+ e_1_1 = _g.sent();
830
+ e_1 = { error: e_1_1 };
831
+ return [3 /*break*/, 8];
832
+ case 7:
833
+ try {
834
+ if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
835
+ }
836
+ finally { if (e_1) throw e_1.error; }
837
+ return [7 /*endfinally*/];
838
+ case 8: return [2 /*return*/, processedContent];
839
+ }
840
+ });
841
+ });
842
+ }
843
+
844
+ // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
845
+ // @dynamic
846
+ var TuiDocExampleComponent = /** @class */ (function () {
847
+ function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent) {
848
+ this.id = id;
849
+ this.clipboard = clipboard;
850
+ this.notifications = notifications;
851
+ this.location = location;
852
+ this.copyTexts$ = copyTexts$;
853
+ this.texts = texts;
854
+ this.codeEditor = codeEditor;
855
+ this.processContent = processContent;
856
+ this.rawLoader$$ = new BehaviorSubject({});
857
+ this.heading = '';
858
+ this.description = '';
859
+ this.componentName = this.location.pathname.slice(1);
860
+ this.activeItemIndex = 0;
861
+ this.defaultTab = this.texts[0];
862
+ this.copy$ = this.copyTexts$.pipe(map(function (_a) {
863
+ var _b = __read(_a, 1), copy = _b[0];
864
+ return copy;
865
+ }));
866
+ this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoadRecord), map(this.processContent));
867
+ }
868
+ Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
869
+ set: function (content) {
870
+ this.rawLoader$$.next(content);
871
+ },
872
+ enumerable: true,
873
+ configurable: true
874
+ });
875
+ TuiDocExampleComponent.prototype.copyExampleLink = function () {
876
+ var hashPosition = this.location.href.indexOf('#');
877
+ var currentUrl = hashPosition > -1
878
+ ? this.location.href.substr(0, hashPosition)
879
+ : this.location.href;
880
+ var url = currentUrl + "#" + this.id;
881
+ this.clipboard.copy(url);
882
+ this.notifications
883
+ .show(this.texts[1], {
884
+ label: this.texts[2],
885
+ status: "success" /* Success */,
886
+ })
887
+ .subscribe();
888
+ };
889
+ TuiDocExampleComponent.ctorParameters = function () { return [
890
+ { type: String, decorators: [{ type: Attribute, args: ['id',] }] },
891
+ { type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
892
+ { type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
893
+ { type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
894
+ { type: Observable, decorators: [{ type: Inject, args: [TUI_COPY_TEXTS,] }] },
895
+ { type: Array, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
896
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
897
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] }
898
+ ]; };
899
+ __decorate([
900
+ Input()
901
+ ], TuiDocExampleComponent.prototype, "heading", void 0);
902
+ __decorate([
903
+ Input()
904
+ ], TuiDocExampleComponent.prototype, "description", void 0);
905
+ __decorate([
906
+ Input()
907
+ ], TuiDocExampleComponent.prototype, "content", null);
908
+ __decorate([
909
+ Input()
910
+ ], TuiDocExampleComponent.prototype, "componentName", void 0);
911
+ TuiDocExampleComponent = __decorate([
912
+ Component({
913
+ selector: 'tui-doc-example',
914
+ template: "<h3 *ngIf=\"heading\" class=\"t-title\">\n <span polymorpheus-outlet [content]=\"heading\"></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n polymorpheus-outlet\n class=\"t-description\"\n [content]=\"description\"\n></h4>\n\n<div *ngIf=\"processor$ | async as content\" class=\"t-example\">\n <ng-container *ngIf=\"content | tuiDocExampleGetTabs: defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button *tuiTab tuiTab>{{tab}}</button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n (click)=\"codeEditor.open(componentName, id || '', content)\"\n >\n Edit on {{codeEditor.name}}\n </button>\n </div>\n\n <ng-container\n *ngIf=\"{\n activeTab: tabs[activeItemIndex],\n code: content[tabs[activeItemIndex]] || ''\n } as state\"\n >\n <div\n *ngIf=\"state.activeTab == defaultTab; else codeSection\"\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n\n <ng-template #codeSection>\n <tui-doc-copy\n class=\"t-copy-code\"\n [cdkCopyToClipboard]=\"state.code\"\n ></tui-doc-copy>\n <tui-doc-code [code]=\"state.code\"></tui-doc-code>\n </ng-template>\n </ng-container>\n </ng-container>\n</div>\n",
915
+ changeDetection: ChangeDetectionStrategy.OnPush,
916
+ styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}@media screen and (max-width:47.9375em){:host{padding-top:2rem}.t-title{font:var(--tui-font-heading-6)}}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-description:first-letter,.t-title:first-letter{text-transform:capitalize}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}@media screen and (max-width:47.9375em){.t-example{margin-top:.75rem}.t-tabs-wrapper{padding:0 1rem}}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}@media screen and (max-width:47.9375em){.t-demo{padding:1rem}}.t-copy-code{position:absolute;top:4.375rem;right:1rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}"]
917
+ }),
918
+ __param(0, Attribute('id')),
919
+ __param(1, Inject(Clipboard)),
920
+ __param(2, Inject(TuiNotificationsService)),
921
+ __param(3, Inject(LOCATION)),
922
+ __param(4, Inject(TUI_COPY_TEXTS)),
923
+ __param(5, Inject(TUI_DOC_EXAMPLE_TEXTS)),
924
+ __param(6, Optional()),
925
+ __param(6, Inject(TUI_DOC_CODE_EDITOR)),
926
+ __param(7, Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR))
927
+ ], TuiDocExampleComponent);
928
+ return TuiDocExampleComponent;
929
+ }());
930
+
931
+ var TuiDocExampleGetTabsPipe = /** @class */ (function () {
932
+ function TuiDocExampleGetTabsPipe() {
933
+ }
934
+ TuiDocExampleGetTabsPipe.prototype.transform = function (content, defaultTab) {
935
+ return __spread([defaultTab], Object.keys(content));
936
+ };
937
+ TuiDocExampleGetTabsPipe = __decorate([
938
+ Pipe({ name: 'tuiDocExampleGetTabs' })
939
+ ], TuiDocExampleGetTabsPipe);
940
+ return TuiDocExampleGetTabsPipe;
941
+ }());
942
+
943
+ var TuiDocExampleModule = /** @class */ (function () {
944
+ function TuiDocExampleModule() {
945
+ }
946
+ TuiDocExampleModule = __decorate([
947
+ NgModule({
948
+ imports: [
949
+ CommonModule,
950
+ ClipboardModule,
951
+ TuiTabsModule,
952
+ TuiButtonModule,
953
+ TuiDocCopyModule,
954
+ TuiDocCodeModule,
955
+ PolymorpheusModule,
956
+ ],
957
+ declarations: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
958
+ exports: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
959
+ })
960
+ ], TuiDocExampleModule);
961
+ return TuiDocExampleModule;
962
+ }());
963
+
964
+ // @dynamic
965
+ var TuiDocMainComponent = /** @class */ (function () {
966
+ function TuiDocMainComponent(storage, windowRef) {
967
+ this.storage = storage;
968
+ this.windowRef = windowRef;
969
+ this.night = this.storage.getItem('night') === 'true' ||
970
+ (this.storage.getItem('night') === null &&
971
+ this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
972
+ this.change$ = new Subject();
973
+ }
974
+ TuiDocMainComponent_1 = TuiDocMainComponent;
975
+ Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
976
+ get: function () {
977
+ return this.night ? 'onDark' : null;
978
+ },
979
+ enumerable: true,
980
+ configurable: true
981
+ });
982
+ TuiDocMainComponent.prototype.onMode = function (night) {
983
+ this.night = night;
984
+ this.change$.next();
985
+ this.storage.setItem('night', String(night));
986
+ };
987
+ var TuiDocMainComponent_1;
988
+ TuiDocMainComponent.ctorParameters = function () { return [
989
+ { type: Storage, decorators: [{ type: Inject, args: [LOCAL_STORAGE,] }] },
990
+ { type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
991
+ ]; };
992
+ TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
993
+ Component({
994
+ selector: 'tui-doc-main',
995
+ template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-space_left-2\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
996
+ encapsulation: ViewEncapsulation.None,
997
+ providers: [
998
+ {
999
+ provide: TuiModeDirective,
1000
+ useExisting: forwardRef(function () { return TuiDocMainComponent_1; }),
1001
+ },
1002
+ TuiSwipeService,
1003
+ ],
1004
+ styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls{top:4rem!important}@-webkit-keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}@keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(.hljs):not(.exception){transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;background:var(--tui-base-02);color:var(--tui-text-02);vertical-align:middle;box-shadow:inset 0 -2px var(--tui-secondary);padding:.375rem .5rem;font-size:.875rem;border-radius:.5rem}:focus code:not(.exception){background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width:47.9375em){tui-doc-navigation.tui-doc-navigation{display:none}.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{-webkit-animation:1s .3s tuiShaking;animation:1s .3s tuiShaking}label.night-mode{cursor:pointer}.hljs-tag{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear-disabled)}.hljs-subst,.hljs-title{font-weight:400;color:var(--tui-text-01)}.hljs-comment,.hljs-quote{color:var(--tui-text-03);font-style:italic}.hljs-meta{color:#e38162}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type{font-weight:700;color:var(--tui-link)}.hljs-attribute,.hljs-link,.hljs-number,.hljs-regexp{font-weight:700;color:var(--tui-support-06)}.hljs-link,.hljs-number,.hljs-regexp{font-weight:400}.hljs-string{color:var(--tui-positive);font-weight:700}.hljs-bullet,.hljs-formula,.hljs-symbol{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}.hljs-doctag{text-decoration:underline}.hljs-template-variable,.hljs-variable{color:var(--tui-warning-fill)}.hljs-addition{background:var(--tui-success-bg)}.hljs-deletion{background:var(--tui-error-bg)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs .hljs-line-numbers{padding:0}.hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}"]
1005
+ }),
1006
+ __param(0, Inject(LOCAL_STORAGE)),
1007
+ __param(1, Inject(WINDOW))
1008
+ ], TuiDocMainComponent);
1009
+ return TuiDocMainComponent;
1010
+ }());
1011
+
1012
+ var ScrollIntoViewDirective = /** @class */ (function () {
1013
+ function ScrollIntoViewDirective(destroy$, _a) {
1014
+ var nativeElement = _a.nativeElement;
1015
+ this.scroll$ = new Subject();
1016
+ this.scroll$
1017
+ .pipe(debounceTime(750), filter(function (shallWe) { return shallWe && !!getElementObscurers(nativeElement); }), takeUntil(destroy$))
1018
+ .subscribe(function () {
1019
+ nativeElement.scrollIntoView();
1020
+ });
1021
+ }
1022
+ Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
1023
+ set: function (shallWe) {
1024
+ this.scroll$.next(shallWe);
1025
+ },
1026
+ enumerable: true,
1027
+ configurable: true
1028
+ });
1029
+ ScrollIntoViewDirective.ctorParameters = function () { return [
1030
+ { type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
1031
+ { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] }
1032
+ ]; };
1033
+ __decorate([
1034
+ Input()
1035
+ ], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
1036
+ ScrollIntoViewDirective = __decorate([
1037
+ Directive({
1038
+ selector: '[scrollIntoView]',
1039
+ providers: [TuiDestroyService],
1040
+ }),
1041
+ __param(0, Inject(TuiDestroyService)),
1042
+ __param(1, Inject(ElementRef))
1043
+ ], ScrollIntoViewDirective);
1044
+ return ScrollIntoViewDirective;
1045
+ }());
1046
+
1047
+ var ScrollIntoViewModule = /** @class */ (function () {
1048
+ function ScrollIntoViewModule() {
1072
1049
  }
1073
- TuiDocDocumentationModule = __decorate([
1050
+ ScrollIntoViewModule = __decorate([
1074
1051
  NgModule({
1075
- imports: [
1076
- CommonModule,
1077
- FormsModule,
1078
- RouterModule,
1079
- TuiBadgeModule,
1080
- TuiSelectModule,
1081
- TuiToggleModule,
1082
- TuiTooltipModule,
1083
- TuiLinkModule,
1084
- TuiInputCountModule,
1085
- TuiModeModule,
1086
- TuiGroupModule,
1087
- TuiInputOpacityModule,
1088
- TuiPrimitiveTextfieldModule,
1089
- TuiTextfieldControllerModule,
1090
- TuiHintControllerModule,
1091
- TuiDropdownControllerModule,
1092
- TuiDataListModule,
1093
- TuiDataListWrapperModule,
1094
- ],
1095
- declarations: [
1096
- TuiDocDocumentationComponent,
1097
- TuiDocDocumentationPropertyConnectorDirective,
1098
- ],
1099
- exports: [
1100
- TuiDocDocumentationComponent,
1101
- TuiDocDocumentationPropertyConnectorDirective,
1102
- ],
1052
+ declarations: [ScrollIntoViewDirective],
1053
+ exports: [ScrollIntoViewDirective],
1103
1054
  })
1104
- ], TuiDocDocumentationModule);
1105
- return TuiDocDocumentationModule;
1055
+ ], ScrollIntoViewModule);
1056
+ return ScrollIntoViewModule;
1106
1057
  }());
1107
1058
 
1108
- var TUI_DOC_CODE_EDITOR = new InjectionToken('Contains service for opening online IDE e.g. Stackblitz');
1059
+ var MAP = {
1060
+ а: 'f',
1061
+ б: ',',
1062
+ в: 'd',
1063
+ г: 'u',
1064
+ д: 'l',
1065
+ е: 't',
1066
+ ё: '`',
1067
+ ж: ';',
1068
+ з: 'p',
1069
+ и: 'b',
1070
+ й: 'q',
1071
+ к: 'r',
1072
+ л: 'k',
1073
+ м: 'v',
1074
+ н: 'y',
1075
+ о: 'j',
1076
+ п: 'g',
1077
+ р: 'h',
1078
+ с: 'c',
1079
+ т: 'n',
1080
+ у: 'e',
1081
+ ф: 'a',
1082
+ х: '[',
1083
+ ц: 'w',
1084
+ ч: 'x',
1085
+ ш: 'i',
1086
+ щ: 'o',
1087
+ ъ: ']',
1088
+ ы: 's',
1089
+ ь: 'm',
1090
+ ю: '.',
1091
+ я: 'z',
1092
+ };
1093
+ /**
1094
+ * Translates text mistakenly typed in the Russian layout into English
1095
+ * @param string string with Russian layout characters
1096
+ * @return string with English layout characters
1097
+ */
1098
+ function transliterateKeyboardLayout(string) {
1099
+ var newStr = '';
1100
+ for (var i = 0; i < string.length; i++) {
1101
+ newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
1102
+ }
1103
+ return newStr;
1104
+ }
1109
1105
 
1110
- var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new InjectionToken('Processes content in example', {
1111
- factory: function () { return identity; },
1106
+ var TUI_DOC_PAGES = new InjectionToken('Documentation pages', {
1107
+ factory: function () { return []; },
1112
1108
  });
1113
1109
 
1114
- // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1110
+ var TUI_DOC_TITLE = new InjectionToken('Page title', {
1111
+ factory: function () { return ''; },
1112
+ });
1113
+
1114
+ var NAVIGATION_TITLE = new InjectionToken('Page title');
1115
+ var NAVIGATION_LABELS = new InjectionToken('Navigation sections labels for search');
1116
+ var NAVIGATION_ITEMS = new InjectionToken('Navigation pages');
1117
+ var NAVIGATION_PROVIDERS = [
1118
+ TuiDestroyService,
1119
+ {
1120
+ provide: NAVIGATION_TITLE,
1121
+ deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
1122
+ useFactory: titleProviderFactory,
1123
+ },
1124
+ {
1125
+ provide: NAVIGATION_LABELS,
1126
+ deps: [TUI_DOC_PAGES],
1127
+ useFactory: labelsProviderFactory,
1128
+ },
1129
+ {
1130
+ provide: NAVIGATION_ITEMS,
1131
+ deps: [TUI_DOC_PAGES],
1132
+ useFactory: itemsProviderFactory,
1133
+ },
1134
+ ];
1135
+ function titleProviderFactory(router, activatedRoute, titlePrefix, destroy$) {
1136
+ return router.events.pipe(filter(function (event) { return event instanceof NavigationEnd; }), map(function () { return activatedRoute.firstChild; }), filter(isPresent), mergeMap(function (_a) {
1137
+ var data = _a.data;
1138
+ return data;
1139
+ }), map(function (_a) {
1140
+ var title = _a.title;
1141
+ return titlePrefix + title;
1142
+ }), takeUntil(destroy$));
1143
+ }
1144
+ function labelsProviderFactory(pages) {
1145
+ return pages
1146
+ .map(function (_a) {
1147
+ var section = _a.section;
1148
+ return section;
1149
+ })
1150
+ .filter(isPresent)
1151
+ .filter(function (item, index, array) { return array.indexOf(item) === index; });
1152
+ }
1153
+ function itemsProviderFactory(pages) {
1154
+ var labels = labelsProviderFactory(pages);
1155
+ return __spread(labels.map(function (label) { return pages.filter(function (_a) {
1156
+ var section = _a.section;
1157
+ return section === label;
1158
+ }); }), [
1159
+ pages.filter(function (page) { return !page.section; }),
1160
+ ]);
1161
+ }
1162
+
1163
+ var SCROLL_INTO_VIEW_DELAY = 200;
1115
1164
  // @dynamic
1116
- var TuiDocExampleComponent = /** @class */ (function () {
1117
- function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent) {
1118
- this.id = id;
1119
- this.clipboard = clipboard;
1120
- this.notifications = notifications;
1121
- this.location = location;
1122
- this.copyTexts$ = copyTexts$;
1123
- this.texts = texts;
1124
- this.codeEditor = codeEditor;
1125
- this.processContent = processContent;
1126
- this.heading = '';
1127
- this.description = '';
1128
- this.componentName = this.location.pathname.slice(1);
1129
- this.activeItemIndex = 0;
1130
- this.processedContent = {};
1131
- this.defaultTab = this.texts[0];
1132
- this.copy$ = this.copyTexts$.pipe(map(function (_a) {
1133
- var _b = __read(_a, 1), copy = _b[0];
1134
- return copy;
1135
- }));
1165
+ var TuiDocNavigationComponent = /** @class */ (function () {
1166
+ function TuiDocNavigationComponent(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
1167
+ var _this = this;
1168
+ this.documentRef = documentRef;
1169
+ this.mode = mode;
1170
+ this.sidebar = sidebar;
1171
+ this.labels = labels;
1172
+ this.items = items;
1173
+ this.searchText = searchText;
1174
+ this.router = router;
1175
+ this.activatedRoute = activatedRoute;
1176
+ this.search = '';
1177
+ this.open = false;
1178
+ this.openPagesArr = [];
1179
+ this.openPagesGroupsArr = [];
1180
+ this.active = '';
1181
+ this.menuOpen = false;
1182
+ this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode || 'onLight'; }));
1183
+ // Angular can't navigate no anchor links
1184
+ // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
1185
+ title$.subscribe(function (title) {
1186
+ changeDetectorRef.markForCheck();
1187
+ titleService.setTitle(title);
1188
+ _this.openActivePageGroup();
1189
+ _this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
1190
+ });
1136
1191
  }
1137
- Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
1138
- set: function (content) {
1139
- this.processedContent = this.processContent(content);
1140
- },
1141
- enumerable: true,
1142
- configurable: true
1143
- });
1144
- Object.defineProperty(TuiDocExampleComponent.prototype, "activeItem", {
1145
- get: function () {
1146
- return this.tabs[this.activeItemIndex];
1147
- },
1148
- enumerable: true,
1149
- configurable: true
1150
- });
1151
- Object.defineProperty(TuiDocExampleComponent.prototype, "tabs", {
1192
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
1152
1193
  get: function () {
1153
- return this.getTabs(this.processedContent);
1194
+ return this.search.length > 2;
1154
1195
  },
1155
1196
  enumerable: true,
1156
1197
  configurable: true
1157
1198
  });
1158
- Object.defineProperty(TuiDocExampleComponent.prototype, "code", {
1199
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
1159
1200
  get: function () {
1160
- var code = this.processedContent[this.activeItem];
1161
- return code ? code.trim() : '';
1201
+ return this.filterItems(this.flattenSubPages(this.items), this.search);
1162
1202
  },
1163
1203
  enumerable: true,
1164
1204
  configurable: true
1165
1205
  });
1166
- Object.defineProperty(TuiDocExampleComponent.prototype, "isDefaultItem", {
1206
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
1167
1207
  get: function () {
1168
- return this.activeItem === this.defaultTab;
1208
+ return this.items[this.items.length - 1];
1169
1209
  },
1170
1210
  enumerable: true,
1171
1211
  configurable: true
1172
1212
  });
1173
- TuiDocExampleComponent.prototype.copyExampleLink = function () {
1174
- var hashPosition = this.location.href.indexOf('#');
1175
- var currentUrl = hashPosition > -1
1176
- ? this.location.href.substr(0, hashPosition)
1177
- : this.location.href;
1178
- var url = currentUrl + "#" + this.id;
1179
- this.clipboard.copy(url);
1180
- this.notifications
1181
- .show(this.texts[1], {
1182
- label: this.texts[2],
1183
- status: "success" /* Success */,
1184
- })
1185
- .subscribe();
1213
+ TuiDocNavigationComponent.prototype.isActive = function (route) {
1214
+ return route === this.active;
1215
+ };
1216
+ TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
1217
+ this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
1218
+ };
1219
+ TuiDocNavigationComponent.prototype.closeMenu = function () {
1220
+ this.menuOpen = false;
1221
+ };
1222
+ TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
1223
+ this.search = search;
1224
+ this.open = this.canOpen;
1225
+ };
1226
+ TuiDocNavigationComponent.prototype.onClick = function () {
1227
+ this.open = false;
1228
+ this.menuOpen = false;
1229
+ this.search = '';
1230
+ this.openActivePageGroup();
1231
+ };
1232
+ TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
1233
+ return items.map(function (section) {
1234
+ return uniqBy(section.filter(function (_a) {
1235
+ var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
1236
+ title = title.toLowerCase();
1237
+ search = search.toLowerCase();
1238
+ keywords = keywords.toLowerCase();
1239
+ return (title.includes(search) ||
1240
+ keywords.includes(search) ||
1241
+ title.includes(transliterateKeyboardLayout(search)) ||
1242
+ keywords.includes(transliterateKeyboardLayout(search)) ||
1243
+ search.replace(/-/gi, '').includes(title));
1244
+ }), 'title');
1245
+ });
1246
+ };
1247
+ TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
1248
+ return items.reduce(function (array, item) { return __spread(array, [
1249
+ item.reduce(function (pages, page) {
1250
+ return 'subPages' in page
1251
+ ? __spread(pages, page.subPages) : __spread(pages, [page]);
1252
+ }, []),
1253
+ ]); }, []);
1186
1254
  };
1187
- TuiDocExampleComponent.prototype.getTabs = function (content) {
1188
- return __spread([this.defaultTab], Object.keys(content));
1255
+ TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
1256
+ return this.router.isActive(route, false);
1189
1257
  };
1190
- TuiDocExampleComponent.ctorParameters = function () { return [
1191
- { type: String, decorators: [{ type: Attribute, args: ['id',] }] },
1192
- { type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
1193
- { type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
1194
- { type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
1195
- { type: Observable, decorators: [{ type: Inject, args: [TUI_COPY_TEXTS,] }] },
1196
- { type: Array, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
1197
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
1198
- { type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] }
1258
+ TuiDocNavigationComponent.prototype.handleAnchorLink = function (hash) {
1259
+ var _this = this;
1260
+ setTimeout(function () {
1261
+ _this.navigateToAnchorLink(hash);
1262
+ }, SCROLL_INTO_VIEW_DELAY);
1263
+ };
1264
+ TuiDocNavigationComponent.prototype.openActivePageGroup = function () {
1265
+ var _this = this;
1266
+ this.items.forEach(function (pages, pagesIndex) {
1267
+ pages.forEach(function (page, pageIndex) {
1268
+ if ('route' in page && _this.isActiveRoute(page.route)) {
1269
+ _this.openPagesArr[pagesIndex] = true;
1270
+ _this.active = page.route;
1271
+ }
1272
+ if ('subPages' in page) {
1273
+ page.subPages.forEach(function (subPage) {
1274
+ if (_this.isActiveRoute(subPage.route)) {
1275
+ _this.openPagesArr[pagesIndex] = true;
1276
+ _this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
1277
+ _this.active = subPage.route;
1278
+ }
1279
+ });
1280
+ }
1281
+ });
1282
+ });
1283
+ };
1284
+ TuiDocNavigationComponent.prototype.navigateToAnchorLink = function (fragment) {
1285
+ var element = fragment && this.documentRef.querySelector("#" + fragment);
1286
+ if (!element) {
1287
+ return;
1288
+ }
1289
+ element.classList.add('tui-doc-animated-example');
1290
+ element.scrollIntoView({
1291
+ block: 'start',
1292
+ inline: 'nearest',
1293
+ behavior: 'smooth',
1294
+ });
1295
+ };
1296
+ TuiDocNavigationComponent.ctorParameters = function () { return [
1297
+ { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
1298
+ { type: Title, decorators: [{ type: Inject, args: [Title,] }] },
1299
+ { type: Observable, decorators: [{ type: Inject, args: [NAVIGATION_TITLE,] }] },
1300
+ { type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
1301
+ { type: TuiModeDirective, decorators: [{ type: Inject, args: [TuiModeDirective,] }] },
1302
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TuiSidebarDirective,] }] },
1303
+ { type: Array, decorators: [{ type: Inject, args: [NAVIGATION_LABELS,] }] },
1304
+ { type: undefined, decorators: [{ type: Inject, args: [NAVIGATION_ITEMS,] }] },
1305
+ { type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
1306
+ { type: Router, decorators: [{ type: Inject, args: [Router,] }] },
1307
+ { type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] }
1199
1308
  ]; };
1200
1309
  __decorate([
1201
- Input()
1202
- ], TuiDocExampleComponent.prototype, "heading", void 0);
1203
- __decorate([
1204
- Input()
1205
- ], TuiDocExampleComponent.prototype, "description", void 0);
1206
- __decorate([
1207
- Input()
1208
- ], TuiDocExampleComponent.prototype, "content", null);
1310
+ HostBinding('class._open')
1311
+ ], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
1209
1312
  __decorate([
1210
- Input()
1211
- ], TuiDocExampleComponent.prototype, "componentName", void 0);
1313
+ tuiPure
1314
+ ], TuiDocNavigationComponent.prototype, "filterItems", null);
1212
1315
  __decorate([
1213
1316
  tuiPure
1214
- ], TuiDocExampleComponent.prototype, "getTabs", null);
1215
- TuiDocExampleComponent = __decorate([
1317
+ ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
1318
+ TuiDocNavigationComponent = __decorate([
1216
1319
  Component({
1217
- selector: 'tui-doc-example',
1218
- template: "<h3 *ngIf=\"heading\" class=\"t-title\">\n <span polymorpheus-outlet [content]=\"heading\"></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n class=\"t-link-icon\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n class=\"t-description\"\n polymorpheus-outlet\n [content]=\"description\"\n></h4>\n<div class=\"t-example\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button *tuiTab tuiTab>{{tab}}</button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n (click)=\"codeEditor.open(componentName, id || '', processedContent)\"\n >\n Edit on {{codeEditor.name}}\n </button>\n </div>\n <ng-container [ngSwitch]=\"activeItem\">\n <div\n *ngIf=\"isDefaultItem; else codeTab\"\n class=\"t-demo\"\n automation-id=\"tui-doc-example\"\n >\n <ng-content></ng-content>\n </div>\n <ng-template #codeTab>\n <tui-doc-copy\n class=\"t-copy-code\"\n [cdkCopyToClipboard]=\"code\"\n ></tui-doc-copy>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n </ng-template>\n </ng-container>\n</div>\n",
1320
+ selector: 'tui-doc-navigation',
1321
+ template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n class=\"input\"\n [autoFocus]=\"!!sidebar\"\n [content]=\"dropdown\"\n [canOpen]=\"canOpen\"\n [(open)]=\"open\"\n>\n <tui-primitive-textfield\n iconAlign=\"left\"\n tuiTextfieldSize=\"m\"\n iconContent=\"tuiIconSearch\"\n [pseudoFocused]=\"open || null\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n [value]=\"search\"\n (valueChange)=\"onSearchChange($event)\"\n >\n {{ searchText }}\n </tui-primitive-textfield>\n <ng-template #dropdown let-activeZone>\n <tui-data-list>\n <tui-opt-group\n *ngFor=\"let group of filtered; let index = index\"\n [label]=\"labels[index] || ''\"\n >\n <a\n *ngFor=\"let item of group\"\n tuiOption\n [routerLink]=\"item.route\"\n (click)=\"onClick()\"\n >\n {{ item.title }}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-template>\n</tui-hosted-dropdown>\n\n<nav class=\"navigation\">\n <tui-scrollbar class=\"scrollbar\" [tuiMode]=\"mode$ | async\">\n <tui-accordion [closeOthers]=\"false\" [rounded]=\"false\">\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"tui-space_left-2\">\n <strong>{{ label }}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: index * 100 + subIndex}\"\n ></ng-container>\n </ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: items.length - 1 + index}\"\n ></ng-container>\n </ng-container>\n </div>\n\n <ng-template #pages let-item=\"item\" let-index=\"index\">\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{ item.title }}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"sublink sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"chevron\"\n [class.chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{ item.title }}\n </button>\n <tui-expand\n class=\"tui-space_left-1\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"section section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink sublink_small\"\n [routerLink]=\"subPage.route\"\n [scrollIntoView]=\"isActive(subPage.route)\"\n (click)=\"closeMenu()\"\n >\n {{ subPage.title }}\n </a>\n </div>\n </tui-expand>\n </div>\n </ng-template>\n </ng-template>\n </tui-scrollbar>\n</nav>\n\n<ng-content></ng-content>\n",
1322
+ providers: NAVIGATION_PROVIDERS,
1219
1323
  changeDetection: ChangeDetectionStrategy.OnPush,
1220
- styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}@media screen and (max-width:47.9375em){:host{padding-top:2rem}.t-title{font:var(--tui-font-heading-6)}}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-description:first-letter,.t-title:first-letter{text-transform:capitalize}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}.t-tabs-wrapper{padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);display:flex;justify-content:space-between;align-items:center}@media screen and (max-width:47.9375em){.t-example{margin-top:.75rem}.t-tabs-wrapper{padding:0 1rem}}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}@media screen and (max-width:47.9375em){.t-demo{padding:1rem}}.t-copy-code{position:absolute;top:4.375rem;right:1rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}"]
1324
+ styles: [":host{z-index:1;display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01)}.input{display:block;margin:1.25rem}.navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.scrollbar{width:100%;scroll-behavior:smooth}.items-container{display:flex;flex-direction:column;padding:0 16px}.section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.subsection{margin-left:.5rem}.sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;font:var(--tui-font-text-m);margin-left:.5rem;line-height:2.75rem}.sublink_small{margin-left:1rem;line-height:1.5rem}.sublink_small:not(:first-child){margin-top:1rem}.sublink_subsection{margin-left:0;line-height:2.75rem}.sublink_active{color:var(--tui-text-01)}.chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.chevron_active{transform:rotate(90deg)}"]
1221
1325
  }),
1222
- __param(0, Attribute('id')),
1223
- __param(1, Inject(Clipboard)),
1224
- __param(2, Inject(TuiNotificationsService)),
1225
- __param(3, Inject(LOCATION)),
1226
- __param(4, Inject(TUI_COPY_TEXTS)),
1227
- __param(5, Inject(TUI_DOC_EXAMPLE_TEXTS)),
1228
- __param(6, Optional()),
1229
- __param(6, Inject(TUI_DOC_CODE_EDITOR)),
1230
- __param(7, Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR))
1231
- ], TuiDocExampleComponent);
1232
- return TuiDocExampleComponent;
1326
+ __param(0, Inject(ChangeDetectorRef)),
1327
+ __param(1, Inject(Title)),
1328
+ __param(2, Inject(NAVIGATION_TITLE)),
1329
+ __param(3, Inject(DOCUMENT)),
1330
+ __param(4, Inject(TuiModeDirective)),
1331
+ __param(5, Optional()),
1332
+ __param(5, Inject(TuiSidebarDirective)),
1333
+ __param(6, Inject(NAVIGATION_LABELS)),
1334
+ __param(7, Inject(NAVIGATION_ITEMS)),
1335
+ __param(8, Inject(TUI_DOC_SEARCH_TEXT)),
1336
+ __param(9, Inject(Router)),
1337
+ __param(10, Inject(ActivatedRoute))
1338
+ ], TuiDocNavigationComponent);
1339
+ return TuiDocNavigationComponent;
1233
1340
  }());
1234
1341
 
1235
- var TuiDocExampleModule = /** @class */ (function () {
1236
- function TuiDocExampleModule() {
1342
+ var TuiDocNavigationModule = /** @class */ (function () {
1343
+ function TuiDocNavigationModule() {
1237
1344
  }
1238
- TuiDocExampleModule = __decorate([
1345
+ TuiDocNavigationModule = __decorate([
1239
1346
  NgModule({
1240
1347
  imports: [
1241
1348
  CommonModule,
1242
- ClipboardModule,
1243
- TuiTabsModule,
1349
+ FormsModule,
1350
+ RouterModule,
1351
+ ScrollIntoViewModule,
1244
1352
  TuiButtonModule,
1245
- TuiDocCopyModule,
1246
- TuiDocCodeModule,
1247
- PolymorpheusModule,
1353
+ TuiPrimitiveTextfieldModule,
1354
+ TuiTextfieldControllerModule,
1355
+ TuiActiveZoneModule,
1356
+ TuiLetModule,
1357
+ TuiModeModule,
1358
+ TuiLinkModule,
1359
+ TuiExpandModule,
1360
+ TuiHostedDropdownModule,
1361
+ TuiDropdownControllerModule,
1362
+ TuiAccordionModule,
1363
+ TuiScrollbarModule,
1364
+ TuiSvgModule,
1365
+ TuiDataListModule,
1366
+ TuiAutoFocusModule,
1248
1367
  ],
1249
- declarations: [TuiDocExampleComponent],
1250
- exports: [TuiDocExampleComponent],
1368
+ declarations: [TuiDocNavigationComponent],
1369
+ exports: [TuiDocNavigationComponent],
1251
1370
  })
1252
- ], TuiDocExampleModule);
1253
- return TuiDocExampleModule;
1254
- }());
1255
-
1256
- // @dynamic
1257
- var TuiDocMainComponent = /** @class */ (function () {
1258
- function TuiDocMainComponent(storage, windowRef) {
1259
- this.storage = storage;
1260
- this.windowRef = windowRef;
1261
- this.night = this.storage.getItem('night') === 'true' ||
1262
- (this.storage.getItem('night') === null &&
1263
- this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
1264
- this.change$ = new Subject();
1265
- }
1266
- TuiDocMainComponent_1 = TuiDocMainComponent;
1267
- Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
1268
- get: function () {
1269
- return this.night ? 'onDark' : null;
1270
- },
1271
- enumerable: true,
1272
- configurable: true
1273
- });
1274
- TuiDocMainComponent.prototype.onMode = function (night) {
1275
- this.night = night;
1276
- this.change$.next();
1277
- this.storage.setItem('night', String(night));
1278
- };
1279
- var TuiDocMainComponent_1;
1280
- TuiDocMainComponent.ctorParameters = function () { return [
1281
- { type: Storage, decorators: [{ type: Inject, args: [LOCAL_STORAGE,] }] },
1282
- { type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
1283
- ]; };
1284
- TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
1285
- Component({
1286
- selector: 'tui-doc-main',
1287
- template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-space_left-2\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
1288
- encapsulation: ViewEncapsulation.None,
1289
- providers: [
1290
- {
1291
- provide: TuiModeDirective,
1292
- useExisting: forwardRef(function () { return TuiDocMainComponent_1; }),
1293
- },
1294
- ],
1295
- styles: ["html{scroll-padding-top:4rem;height:auto}@-webkit-keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}@keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(.hljs):not(.exception){transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;background:var(--tui-base-02);color:var(--tui-text-02);vertical-align:middle;box-shadow:inset 0 -2px var(--tui-secondary);padding:.375rem .5rem;font-size:.875rem;border-radius:.5rem}:focus code:not(.exception){background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width:47.9375em){tui-doc-navigation.tui-doc-navigation{display:none}.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{-webkit-animation:1s .3s tuiShaking;animation:1s .3s tuiShaking}label.night-mode{cursor:pointer}.hljs-tag{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear-disabled)}.hljs-subst,.hljs-title{font-weight:400;color:var(--tui-text-01)}.hljs-comment,.hljs-quote{color:var(--tui-text-03);font-style:italic}.hljs-meta{color:#e38162}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type{font-weight:700;color:var(--tui-link)}.hljs-attribute,.hljs-link,.hljs-number,.hljs-regexp{font-weight:700;color:var(--tui-support-06)}.hljs-link,.hljs-number,.hljs-regexp{font-weight:400}.hljs-string{color:var(--tui-positive);font-weight:700}.hljs-bullet,.hljs-formula,.hljs-symbol{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}.hljs-doctag{text-decoration:underline}.hljs-template-variable,.hljs-variable{color:var(--tui-warning-fill)}.hljs-addition{background:var(--tui-success-bg)}.hljs-deletion{background:var(--tui-error-bg)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs .hljs-line-numbers{padding:0}.hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}"]
1296
- }),
1297
- __param(0, Inject(LOCAL_STORAGE)),
1298
- __param(1, Inject(WINDOW))
1299
- ], TuiDocMainComponent);
1300
- return TuiDocMainComponent;
1371
+ ], TuiDocNavigationModule);
1372
+ return TuiDocNavigationModule;
1301
1373
  }());
1302
1374
 
1303
1375
  var TUI_DOC_LOGO = new InjectionToken('Main logo', {
@@ -1305,12 +1377,13 @@ var TUI_DOC_LOGO = new InjectionToken('Main logo', {
1305
1377
  });
1306
1378
 
1307
1379
  var TuiDocHeaderComponent = /** @class */ (function () {
1308
- function TuiDocHeaderComponent(logo, menu, router) {
1380
+ function TuiDocHeaderComponent(logo, menu, router, swipes$) {
1309
1381
  this.logo = logo;
1310
1382
  this.menu = menu;
1311
1383
  this.router = router;
1384
+ this.swipes$ = swipes$;
1312
1385
  this.stream$ = new Subject();
1313
- this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$).pipe(startWith(false), distinctUntilChanged());
1386
+ this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$, this.swipes$.pipe(filter(function (swipe) { return swipe.direction === 'left' || swipe.direction === 'right'; }), map(function (swipe) { return swipe.direction === 'right'; }))).pipe(startWith(false), distinctUntilChanged());
1314
1387
  }
1315
1388
  TuiDocHeaderComponent.prototype.onClick = function () {
1316
1389
  this.stream$.next(true);
@@ -1323,18 +1396,20 @@ var TuiDocHeaderComponent = /** @class */ (function () {
1323
1396
  TuiDocHeaderComponent.ctorParameters = function () { return [
1324
1397
  { type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_LOGO,] }] },
1325
1398
  { type: String, decorators: [{ type: Inject, args: [TUI_DOC_MENU_TEXT,] }] },
1326
- { type: Router, decorators: [{ type: Inject, args: [Router,] }] }
1399
+ { type: Router, decorators: [{ type: Inject, args: [Router,] }] },
1400
+ { type: TuiSwipeService, decorators: [{ type: Inject, args: [TuiSwipeService,] }] }
1327
1401
  ]; };
1328
1402
  TuiDocHeaderComponent = __decorate([
1329
1403
  Component({
1330
1404
  selector: 'header[tuiDocHeader]',
1331
- template: "<button\n tuiIconButton\n class=\"menu\"\n icon=\"tuiIconMenuLarge\"\n appearance=\"icon\"\n [title]=\"menu\"\n (click)=\"onClick()\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-doc-navigation\n *tuiSidebar=\"open$ | async\"\n class=\"navigation\"\n ></tui-doc-navigation>\n</button>\n<div polymorpheus-outlet class=\"logo tui-text_h5\" [content]=\"logo\">\n <ng-template let-src>\n <img class=\"img\" alt=\"Logo\" [src]=\"src\" />\n </ng-template>\n</div>\n<ng-content></ng-content>\n",
1405
+ template: "<button\n tuiIconButton\n icon=\"tuiIconMenuLarge\"\n appearance=\"icon\"\n class=\"menu\"\n [title]=\"menu\"\n (click)=\"onClick()\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-doc-navigation\n *tuiSidebar=\"open$ | async\"\n class=\"navigation\"\n ></tui-doc-navigation>\n</button>\n<div polymorpheus-outlet class=\"logo tui-text_h5\" [content]=\"logo\">\n <ng-template let-src>\n <img alt=\"Logo\" class=\"img\" [src]=\"src\" />\n </ng-template>\n</div>\n<ng-content></ng-content>\n",
1332
1406
  changeDetection: ChangeDetectionStrategy.OnPush,
1333
- styles: [":host{box-shadow:0 .125rem 1rem rgba(0,0,0,.08);position:fixed;top:0;left:0;right:0;display:flex;height:3.9375rem;align-items:center;padding:0 1.25rem;background:var(--tui-base-01);border-bottom:1px solid var(--tui-base-03);z-index:1}.logo{margin-right:auto}.img{display:block}.menu{margin-left:-1.25rem}@media screen and (min-width:80em){.menu{display:none}}.navigation{min-height:100%}"]
1407
+ styles: [":host{box-shadow:0 .125rem 1rem rgba(0,0,0,.08);position:fixed;top:0;left:0;right:0;z-index:1;display:flex;height:3.9375rem;align-items:center;padding:0 1.25rem;background:var(--tui-base-01);border-bottom:1px solid var(--tui-base-03)}.logo{margin-right:auto}.img{display:block}.menu{margin-left:-1.25rem}@media screen and (min-width:48em){.menu{display:none}}.navigation{min-height:100%}"]
1334
1408
  }),
1335
1409
  __param(0, Inject(TUI_DOC_LOGO)),
1336
1410
  __param(1, Inject(TUI_DOC_MENU_TEXT)),
1337
- __param(2, Inject(Router))
1411
+ __param(2, Inject(Router)),
1412
+ __param(3, Inject(TuiSwipeService))
1338
1413
  ], TuiDocHeaderComponent);
1339
1414
  return TuiDocHeaderComponent;
1340
1415
  }());
@@ -1387,26 +1462,6 @@ var TUI_DOC_DEFAULT_TABS = new InjectionToken('Array of default tab names', {
1387
1462
  factory: function () { return []; },
1388
1463
  });
1389
1464
 
1390
- var TuiDocPageTabConnectorDirective = /** @class */ (function () {
1391
- function TuiDocPageTabConnectorDirective(template) {
1392
- this.template = template;
1393
- }
1394
- TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
1395
- { type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
1396
- ]; };
1397
- __decorate([
1398
- Input(),
1399
- tuiDefaultProp()
1400
- ], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
1401
- TuiDocPageTabConnectorDirective = __decorate([
1402
- Directive({
1403
- selector: '[pageTab]',
1404
- }),
1405
- __param(0, Inject(TemplateRef))
1406
- ], TuiDocPageTabConnectorDirective);
1407
- return TuiDocPageTabConnectorDirective;
1408
- }());
1409
-
1410
1465
  var TUI_DOC_SEE_ALSO = new InjectionToken('Array of arrays of related pages', {
1411
1466
  factory: function () { return []; },
1412
1467
  });
@@ -1429,6 +1484,26 @@ function seeAlsoProviderFactory(_a, seeAlsoGroups) {
1429
1484
  return Array.from(seeAlsoSet);
1430
1485
  }
1431
1486
 
1487
+ var TuiDocPageTabConnectorDirective = /** @class */ (function () {
1488
+ function TuiDocPageTabConnectorDirective(template) {
1489
+ this.template = template;
1490
+ }
1491
+ TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
1492
+ { type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
1493
+ ]; };
1494
+ __decorate([
1495
+ Input(),
1496
+ tuiDefaultProp()
1497
+ ], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
1498
+ TuiDocPageTabConnectorDirective = __decorate([
1499
+ Directive({
1500
+ selector: '[pageTab]',
1501
+ }),
1502
+ __param(0, Inject(TemplateRef))
1503
+ ], TuiDocPageTabConnectorDirective);
1504
+ return TuiDocPageTabConnectorDirective;
1505
+ }());
1506
+
1432
1507
  // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1433
1508
  // @dynamic
1434
1509
  var TuiDocPageComponent = /** @class */ (function () {
@@ -1477,10 +1552,10 @@ var TuiDocPageComponent = /** @class */ (function () {
1477
1552
  TuiDocPageComponent = __decorate([
1478
1553
  Component({
1479
1554
  selector: 'tui-doc-page',
1480
- template: "<header class=\"t-header\">\n <h1 class=\"t-title\">\n {{header}}\n <tui-tag\n *ngIf=\"deprecated !== null\"\n class=\"t-tag t-tag_deprecated\"\n value=\"deprecated\"\n status=\"custom\"\n ></tui-tag>\n <tui-tag\n *ngIf=\"package\"\n class=\"t-tag t-tag_package\"\n status=\"custom\"\n [value]=\"package\"\n [autoColor]=\"true\"\n ></tui-tag>\n </h1>\n <tui-tabs-with-more\n *ngIf=\"tabConnectors.length\"\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container\n *ngFor=\"let tab of tabConnectors; first as first; index as index\"\n >\n <ng-container *ngIf=\"first; else dynamicTab\">\n <a\n *tuiTab\n tuiTab\n routerLink=\"./\"\n routerLinkActive\n [routerLinkActiveOptions]=\"{ exact: true }\"\n >\n {{tab.pageTab || defaultTabs[index]}}\n </a>\n </ng-container>\n <ng-template #dynamicTab>\n <a\n *tuiTab\n tuiTab\n routerLinkActive\n [routerLink]=\"getRouterLink(tab.pageTab || defaultTabs[index])\"\n >\n {{tab.pageTab || defaultTabs[index]}}\n </a>\n </ng-template>\n </ng-container>\n </tui-tabs-with-more>\n <tui-doc-source-code\n class=\"t-source-code\"\n [header]=\"header\"\n [package]=\"package\"\n [type]=\"type\"\n [path]=\"path\"\n ></tui-doc-source-code>\n</header>\n<div class=\"t-content\">\n <ng-content></ng-content>\n <tui-doc-see-also\n *ngIf=\"showSeeAlso\"\n class=\"t-see-also\"\n [seeAlso]=\"seeAlso\"\n ></tui-doc-see-also>\n <ng-container *ngFor=\"let tab of tabConnectors; index as index\">\n <ng-container *ngIf=\"index === activeItemIndex\">\n <ng-container *ngTemplateOutlet=\"tab.template\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n",
1555
+ template: "<header class=\"t-header\">\n <h1 class=\"t-title\">\n {{ header }}\n <tui-tag\n *ngIf=\"deprecated !== null\"\n value=\"deprecated\"\n status=\"custom\"\n class=\"t-tag t-tag_deprecated\"\n ></tui-tag>\n <tui-tag\n *ngIf=\"package\"\n status=\"custom\"\n class=\"t-tag t-tag_package\"\n [value]=\"package\"\n [autoColor]=\"true\"\n ></tui-tag>\n </h1>\n <tui-tabs-with-more\n *ngIf=\"tabConnectors.length\"\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container\n *ngFor=\"let tab of tabConnectors; first as first; index as index\"\n >\n <ng-container *ngIf=\"first; else dynamicTab\">\n <a\n *tuiTab\n tuiTab\n routerLink=\"./\"\n routerLinkActive\n [routerLinkActiveOptions]=\"{exact: true}\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-container>\n <ng-template #dynamicTab>\n <a\n *tuiTab\n tuiTab\n routerLinkActive\n [routerLink]=\"getRouterLink(tab.pageTab || defaultTabs[index])\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-template>\n </ng-container>\n </tui-tabs-with-more>\n <tui-doc-source-code\n class=\"t-source-code\"\n [header]=\"header\"\n [package]=\"package\"\n [type]=\"type\"\n [path]=\"path\"\n ></tui-doc-source-code>\n</header>\n<div class=\"t-content\">\n <ng-content></ng-content>\n <tui-doc-see-also\n *ngIf=\"showSeeAlso\"\n class=\"t-see-also\"\n [seeAlso]=\"seeAlso\"\n ></tui-doc-see-also>\n <ng-container *ngFor=\"let tab of tabConnectors; index as index\">\n <ng-container *ngIf=\"index === activeItemIndex\">\n <ng-container *ngTemplateOutlet=\"tab.template\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n",
1481
1556
  changeDetection: ChangeDetectionStrategy.OnPush,
1482
1557
  providers: PAGE_PROVIDERS,
1483
- styles: [":host{display:flex;flex-direction:column;min-height:0;flex-basis:0;flex-grow:1}.t-header{font:var(--tui-font-heading-3);display:flex;flex-wrap:wrap;min-height:7.25rem;color:var(--tui-text-01);box-shadow:inset 0 -1px 0 0 var(--tui-base-03);padding:3.75rem 0 0;box-sizing:border-box;flex-shrink:0;margin:0 min(10vw,8.75rem)}@media screen and (max-width:47.9375em){.t-header{font:var(--tui-font-heading-4);min-height:4.5rem;padding:1.25rem 1.25rem 0;margin:0}}.t-title{min-width:100%;font-size:inherit;margin:0}.t-tag{vertical-align:middle;text-transform:uppercase;margin-right:.5rem}.t-tag_deprecated{background-color:var(--tui-error-fill)}.t-tag.t-tag_package{color:#000}.t-tabs{flex:1;margin:1.125rem .3125rem 0 0}@media screen and (max-width:47.9375em){.t-tabs{margin-top:.25rem}}.t-content{padding:2rem 0;margin:0 min(10vw,8.75rem)}@media screen and (max-width:47.9375em){.t-content{padding:2rem 1.25rem;margin:0}}.t-see-also{min-width:18.75rem;width:30%;float:right;margin-left:1.5rem}@media screen and (max-width:47.9375em){.t-see-also{float:none;width:100%;margin:0 0 1.5rem}}.t-source-code{align-self:flex-end;line-height:2.75rem}"]
1558
+ styles: [":host{display:flex;flex-direction:column;min-height:0;flex-basis:0;flex-grow:1}.t-header{display:flex;font:var(--tui-font-heading-3);flex-wrap:wrap;min-height:7.25rem;color:var(--tui-text-01);box-shadow:inset 0 -1px 0 0 var(--tui-base-03);padding:3.75rem 0 0;box-sizing:border-box;flex-shrink:0;margin:0 min(10vw,8.75rem)}@media screen and (max-width:47.9375em){.t-header{font:var(--tui-font-heading-4);min-height:4.5rem;padding:1.25rem 1.25rem 0;margin:0}}.t-title{min-width:100%;font-size:inherit;margin:0}.t-tag{vertical-align:middle;text-transform:uppercase;margin-right:.5rem}.t-tag_deprecated{background-color:var(--tui-error-fill)}.t-tag.t-tag_package{color:#000}.t-tabs{flex:1;margin:1.125rem .3125rem 0 0}@media screen and (max-width:47.9375em){.t-tabs{margin-top:.25rem}}.t-content{padding:2rem 0;margin:0 min(10vw,8.75rem)}@media screen and (max-width:47.9375em){.t-content{padding:2rem 1.25rem;margin:0}}.t-see-also{min-width:18.75rem;width:30%;float:right;margin-left:1.5rem}@media screen and (max-width:47.9375em){.t-see-also{float:none;width:100%;margin:0 0 1.5rem}}.t-source-code{align-self:flex-end;line-height:2.75rem}"]
1484
1559
  }),
1485
1560
  __param(0, Attribute('deprecated')),
1486
1561
  __param(1, Inject(TUI_DOC_DEFAULT_TABS)),
@@ -1518,7 +1593,7 @@ var TuiDocSeeAlsoComponent = /** @class */ (function () {
1518
1593
  TuiDocSeeAlsoComponent = __decorate([
1519
1594
  Component({
1520
1595
  selector: 'tui-doc-see-also',
1521
- template: "<h5 class=\"header\">{{text}}</h5>\n<ng-container *ngFor=\"let item of seeAlso; last as last\">\n <a tuiLink [routerLink]=\"getRouterLink(item)\">{{item}}</a>\n <ng-container *ngIf=\"!last\">, </ng-container>\n</ng-container>\n",
1596
+ template: "<h5 class=\"header\">{{ text }}</h5>\n<ng-container *ngFor=\"let item of seeAlso; last as last\">\n <a tuiLink [routerLink]=\"getRouterLink(item)\">{{ item }}</a>\n <ng-container *ngIf=\"!last\">,</ng-container>\n</ng-container>\n",
1522
1597
  changeDetection: ChangeDetectionStrategy.OnPush,
1523
1598
  styles: [":host{display:block}.header{font-size:.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:.075em;color:var(--tui-text-02);margin:0 0 .5rem;white-space:nowrap}"]
1524
1599
  }),
@@ -1591,7 +1666,7 @@ var TuiDocSourceCodeComponent = /** @class */ (function () {
1591
1666
  TuiDocSourceCodeComponent = __decorate([
1592
1667
  Component({
1593
1668
  selector: 'tui-doc-source-code',
1594
- template: "<div\n polymorpheus-outlet\n *ngIf=\"!!sourceCode\"\n [content]=\"sourceCode\"\n [context]=\"pathOptions\"\n>\n <ng-template let-link>\n <a\n *ngIf=\"link\"\n tuiIconButton\n type=\"button\"\n icon=\"tuiIconCodeLarge\"\n appearance=\"icon\"\n target=\"_blank\"\n size=\"s\"\n [title]=\"text\"\n [href]=\"link\"\n ></a>\n </ng-template>\n</div>\n",
1669
+ template: "<div\n *ngIf=\"!!sourceCode\"\n polymorpheus-outlet\n [content]=\"sourceCode\"\n [context]=\"pathOptions\"\n>\n <ng-template let-link>\n <a\n *ngIf=\"link\"\n tuiIconButton\n type=\"button\"\n icon=\"tuiIconCodeLarge\"\n appearance=\"icon\"\n target=\"_blank\"\n size=\"s\"\n [title]=\"text\"\n [href]=\"link\"\n ></a>\n </ng-template>\n</div>\n",
1595
1670
  changeDetection: ChangeDetectionStrategy.OnPush
1596
1671
  }),
1597
1672
  __param(0, Inject(TUI_DOC_SOURCE_CODE)),
@@ -1674,6 +1749,23 @@ var TUI_DOC_RUSSIAN = [
1674
1749
  },
1675
1750
  ];
1676
1751
 
1752
+ var TuiAddonDocModule = /** @class */ (function () {
1753
+ function TuiAddonDocModule() {
1754
+ }
1755
+ TuiAddonDocModule = __decorate([
1756
+ NgModule({
1757
+ exports: [
1758
+ TuiDocCodeModule,
1759
+ TuiDocDemoModule,
1760
+ TuiDocDocumentationModule,
1761
+ TuiDocPageModule,
1762
+ TuiDocExampleModule,
1763
+ ],
1764
+ })
1765
+ ], TuiAddonDocModule);
1766
+ return TuiAddonDocModule;
1767
+ }());
1768
+
1677
1769
  /**
1678
1770
  * Generates typical page routing structure
1679
1771
  */
@@ -1692,23 +1784,6 @@ function generateRoutes(type) {
1692
1784
  ];
1693
1785
  }
1694
1786
 
1695
- var TuiAddonDocModule = /** @class */ (function () {
1696
- function TuiAddonDocModule() {
1697
- }
1698
- TuiAddonDocModule = __decorate([
1699
- NgModule({
1700
- exports: [
1701
- TuiDocCodeModule,
1702
- TuiDocDemoModule,
1703
- TuiDocDocumentationModule,
1704
- TuiDocPageModule,
1705
- TuiDocExampleModule,
1706
- ],
1707
- })
1708
- ], TuiAddonDocModule);
1709
- return TuiAddonDocModule;
1710
- }());
1711
-
1712
1787
  /**
1713
1788
  * Public API Surface of @taiga-ui/addon-doc
1714
1789
  */
@@ -1717,5 +1792,5 @@ var TuiAddonDocModule = /** @class */ (function () {
1717
1792
  * Generated bundle index. Do not edit.
1718
1793
  */
1719
1794
 
1720
- export { DEMO_TEXTS, DOC_TEXTS, EXAMPLE_TEXTS, ScrollIntoViewDirective, ScrollIntoViewModule, TUI_DOC_CODE_EDITOR, TUI_DOC_DEFAULT_TABS, TUI_DOC_DEMO_TEXTS, TUI_DOC_DOCUMENTATION_TEXTS, TUI_DOC_EXAMPLE_CONTENT_PROCESSOR, TUI_DOC_EXAMPLE_TEXTS, TUI_DOC_LOGO, TUI_DOC_MENU_TEXT, TUI_DOC_PAGES, TUI_DOC_RUSSIAN, TUI_DOC_SEARCH_TEXT, TUI_DOC_SEE_ALSO, TUI_DOC_SEE_ALSO_TEXT, TUI_DOC_SOURCE_CODE, TUI_DOC_SOURCE_CODE_TEXT, TUI_DOC_TITLE, TuiAddonDocModule, TuiDocCodeComponent, TuiDocCodeModule, TuiDocCopyComponent, TuiDocCopyModule, TuiDocDemoComponent, TuiDocDemoModule, TuiDocDocumentationComponent, TuiDocDocumentationModule, TuiDocDocumentationPropertyConnectorDirective, TuiDocExampleComponent, TuiDocExampleModule, TuiDocMainComponent, TuiDocMainModule, TuiDocNavigationComponent, TuiDocNavigationModule, TuiDocPageComponent, TuiDocPageModule, TuiDocPageTabConnectorDirective, generateRoutes, NAVIGATION_TITLE as ɵa, NAVIGATION_LABELS as ɵb, NAVIGATION_ITEMS as ɵc, NAVIGATION_PROVIDERS as ɵd, titleProviderFactory as ɵe, labelsProviderFactory as ɵf, itemsProviderFactory as ɵg, TuiInputOpacityModule as ɵh, TuiInputOpacityDirective as ɵi, TuiDocHeaderModule as ɵj, TuiDocHeaderComponent as ɵk, PAGE_SEE_ALSO as ɵl, PAGE_PROVIDERS as ɵm, seeAlsoProviderFactory as ɵn, TuiDocSeeAlsoModule as ɵo, TuiDocSeeAlsoComponent as ɵp, TuiDocSourceCodeModule as ɵq, TuiDocSourceCodeComponent as ɵr };
1795
+ export { DEMO_TEXTS, DOC_TEXTS, EXAMPLE_TEXTS, ScrollIntoViewDirective, ScrollIntoViewModule, TUI_DOC_CODE_EDITOR, TUI_DOC_DEFAULT_TABS, TUI_DOC_DEMO_TEXTS, TUI_DOC_DOCUMENTATION_TEXTS, TUI_DOC_EXAMPLE_CONTENT_PROCESSOR, TUI_DOC_EXAMPLE_TEXTS, TUI_DOC_LOGO, TUI_DOC_MENU_TEXT, TUI_DOC_PAGES, TUI_DOC_RUSSIAN, TUI_DOC_SEARCH_TEXT, TUI_DOC_SEE_ALSO, TUI_DOC_SEE_ALSO_TEXT, TUI_DOC_SOURCE_CODE, TUI_DOC_SOURCE_CODE_TEXT, TUI_DOC_TITLE, TuiAddonDocModule, TuiDocCodeComponent, TuiDocCodeModule, TuiDocCopyComponent, TuiDocCopyModule, TuiDocDemoComponent, TuiDocDemoModule, TuiDocDocumentationComponent, TuiDocDocumentationModule, TuiDocDocumentationPropertyConnectorDirective, TuiDocExampleComponent, TuiDocExampleModule, TuiDocMainComponent, TuiDocMainModule, TuiDocNavigationComponent, TuiDocNavigationModule, TuiDocPageComponent, TuiDocPageModule, TuiDocPageTabConnectorDirective, generateRoutes, TuiInputOpacityModule as ɵa, TuiInputOpacityDirective as ɵb, TuiDocExampleGetTabsPipe as ɵc, TuiDocHeaderModule as ɵd, NAVIGATION_TITLE as ɵe, NAVIGATION_LABELS as ɵf, NAVIGATION_ITEMS as ɵg, NAVIGATION_PROVIDERS as ɵh, titleProviderFactory as ɵi, labelsProviderFactory as ɵj, itemsProviderFactory as ɵk, TuiDocHeaderComponent as ɵl, PAGE_SEE_ALSO as ɵm, PAGE_PROVIDERS as ɵn, seeAlsoProviderFactory as ɵo, TuiDocSeeAlsoModule as ɵp, TuiDocSeeAlsoComponent as ɵq, TuiDocSourceCodeModule as ɵr, TuiDocSourceCodeComponent as ɵs };
1721
1796
  //# sourceMappingURL=taiga-ui-addon-doc.js.map