@taiga-ui/addon-doc 3.25.0 → 3.26.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 (196) hide show
  1. package/addon-doc.module.d.ts +2 -6
  2. package/bundles/taiga-ui-addon-doc-components.umd.js +2452 -0
  3. package/bundles/taiga-ui-addon-doc-components.umd.js.map +1 -0
  4. package/bundles/taiga-ui-addon-doc-directives.umd.js +101 -0
  5. package/bundles/taiga-ui-addon-doc-directives.umd.js.map +1 -0
  6. package/bundles/taiga-ui-addon-doc-interfaces.umd.js +22 -0
  7. package/bundles/taiga-ui-addon-doc-interfaces.umd.js.map +1 -0
  8. package/bundles/taiga-ui-addon-doc-languages.umd.js +54 -0
  9. package/bundles/taiga-ui-addon-doc-languages.umd.js.map +1 -0
  10. package/bundles/taiga-ui-addon-doc-services.umd.js +459 -0
  11. package/bundles/taiga-ui-addon-doc-services.umd.js.map +1 -0
  12. package/bundles/taiga-ui-addon-doc-tokens.umd.js +189 -0
  13. package/bundles/taiga-ui-addon-doc-tokens.umd.js.map +1 -0
  14. package/bundles/taiga-ui-addon-doc-types.umd.js +11 -0
  15. package/bundles/taiga-ui-addon-doc-types.umd.js.map +1 -0
  16. package/bundles/taiga-ui-addon-doc-utils.umd.js +638 -0
  17. package/bundles/taiga-ui-addon-doc-utils.umd.js.map +1 -0
  18. package/bundles/taiga-ui-addon-doc.umd.js +95 -3128
  19. package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
  20. package/components/code/code.component.d.ts +1 -1
  21. package/components/demo/demo.component.d.ts +2 -1
  22. package/components/documentation/documentation.component.d.ts +1 -1
  23. package/components/documentation/documentation.module.d.ts +2 -2
  24. package/components/example/example-options.d.ts +2 -0
  25. package/components/example/example.component.d.ts +2 -2
  26. package/components/index.d.ts +40 -0
  27. package/{internal → components/internal}/header/header.module.d.ts +1 -1
  28. package/{internal → components/internal}/see-also/see-also.component.d.ts +1 -1
  29. package/{internal → components/internal}/source-code/source-code.component.d.ts +1 -1
  30. package/components/main/main.component.d.ts +1 -2
  31. package/components/main/main.module.d.ts +1 -1
  32. package/components/navigation/navigation.component.d.ts +2 -2
  33. package/components/navigation/navigation.module.d.ts +1 -1
  34. package/components/navigation/navigation.providers.d.ts +1 -1
  35. package/components/package.json +10 -0
  36. package/components/page/page.module.d.ts +2 -2
  37. package/components/taiga-ui-addon-doc-components.d.ts +5 -0
  38. package/directives/index.d.ts +2 -0
  39. package/directives/package.json +10 -0
  40. package/directives/taiga-ui-addon-doc-directives.d.ts +5 -0
  41. package/esm2015/addon-doc.module.js +2 -6
  42. package/esm2015/components/code/code.component.js +3 -3
  43. package/esm2015/components/code/code.module.js +1 -1
  44. package/esm2015/components/copy/copy.component.js +1 -1
  45. package/esm2015/components/copy/copy.module.js +1 -1
  46. package/esm2015/components/demo/demo.component.js +16 -8
  47. package/esm2015/components/demo/demo.module.js +1 -1
  48. package/esm2015/components/documentation/documentation-property-connector.directive.js +3 -3
  49. package/esm2015/components/documentation/documentation.component.js +5 -6
  50. package/esm2015/components/documentation/documentation.module.js +3 -3
  51. package/esm2015/components/documentation/pipes/cleaner.pipe.js +1 -1
  52. package/esm2015/components/documentation/pipes/color.pipe.js +35 -0
  53. package/esm2015/components/documentation/pipes/content-tooltip.pipe.js +1 -1
  54. package/esm2015/components/documentation/pipes/inspect.pipe.js +2 -2
  55. package/esm2015/components/documentation/pipes/opacity.pipe.js +1 -1
  56. package/esm2015/components/documentation/pipes/optional.pipe.js +1 -1
  57. package/esm2015/components/documentation/pipes/primitive-polymorpheus-content.pipe.js +1 -1
  58. package/esm2015/components/documentation/pipes/strip-optional.pipe.js +1 -1
  59. package/esm2015/components/example/example-capitalize.pipe.js +1 -1
  60. package/esm2015/components/example/example-get-tabs.pipe.js +1 -1
  61. package/esm2015/components/example/example-options.js +3 -2
  62. package/esm2015/components/example/example.component.js +7 -9
  63. package/esm2015/components/example/example.module.js +1 -1
  64. package/esm2015/components/index.js +41 -0
  65. package/esm2015/components/internal/header/header.component.js +56 -0
  66. package/esm2015/components/internal/header/header.module.js +42 -0
  67. package/esm2015/components/internal/input-opacity/input-opacity.directive.js +32 -0
  68. package/esm2015/{internal → components/internal}/input-opacity/input-opacity.module.js +1 -1
  69. package/esm2015/{internal → components/internal}/see-also/see-also.component.js +2 -3
  70. package/esm2015/{internal → components/internal}/see-also/see-also.module.js +1 -1
  71. package/esm2015/components/internal/source-code/source-code.component.js +56 -0
  72. package/esm2015/{internal → components/internal}/source-code/source-code.module.js +1 -1
  73. package/esm2015/components/language-switcher/language-switcher.component.js +1 -1
  74. package/esm2015/components/language-switcher/language-switcher.module.js +1 -1
  75. package/esm2015/components/main/main.component.js +5 -7
  76. package/esm2015/components/main/main.module.js +2 -2
  77. package/esm2015/components/navigation/navigation.component.js +4 -6
  78. package/esm2015/components/navigation/navigation.module.js +2 -2
  79. package/esm2015/components/navigation/navigation.providers.js +2 -3
  80. package/esm2015/components/page/page-tab.directive.js +1 -1
  81. package/esm2015/components/page/page.component.js +5 -5
  82. package/esm2015/components/page/page.module.js +3 -3
  83. package/esm2015/components/page/page.providers.js +2 -2
  84. package/esm2015/components/taiga-ui-addon-doc-components.js +5 -0
  85. package/esm2015/directives/index.js +3 -0
  86. package/esm2015/directives/scroll-into-view/scroll-into-view.directive.js +2 -2
  87. package/esm2015/directives/scroll-into-view/scroll-into-view.module.js +1 -1
  88. package/esm2015/directives/taiga-ui-addon-doc-directives.js +5 -0
  89. package/esm2015/index.js +10 -0
  90. package/esm2015/interfaces/code-editor.js +1 -1
  91. package/esm2015/interfaces/demo-params.js +1 -1
  92. package/esm2015/interfaces/index.js +5 -0
  93. package/esm2015/interfaces/page.js +1 -1
  94. package/esm2015/interfaces/source-code-path-options.js +1 -1
  95. package/esm2015/interfaces/taiga-ui-addon-doc-interfaces.js +5 -0
  96. package/esm2015/languages/index.js +2 -0
  97. package/esm2015/languages/russian.js +3 -2
  98. package/esm2015/languages/taiga-ui-addon-doc-languages.js +5 -0
  99. package/esm2015/services/index.js +5 -0
  100. package/esm2015/services/taiga-ui-addon-doc-services.js +5 -0
  101. package/esm2015/services/theme-night.options.js +1 -1
  102. package/esm2015/services/theme-night.service.js +1 -1
  103. package/esm2015/services/theme.options.js +1 -1
  104. package/esm2015/services/theme.service.js +1 -1
  105. package/esm2015/taiga-ui-addon-doc.js +2 -2
  106. package/esm2015/tokens/code-actions.js +1 -1
  107. package/esm2015/tokens/code-editor.js +1 -1
  108. package/esm2015/tokens/default-tabs.js +1 -1
  109. package/esm2015/tokens/example-content-processor.js +2 -2
  110. package/esm2015/tokens/excluded-properties.js +1 -1
  111. package/esm2015/tokens/i18n.js +1 -1
  112. package/esm2015/tokens/index.js +15 -0
  113. package/esm2015/tokens/logo.js +1 -1
  114. package/esm2015/tokens/page-loaded.js +1 -1
  115. package/esm2015/tokens/pages.js +2 -2
  116. package/esm2015/tokens/scroll-behavior.js +1 -1
  117. package/esm2015/tokens/see-also.js +1 -1
  118. package/esm2015/tokens/source-code.js +1 -1
  119. package/esm2015/tokens/taiga-ui-addon-doc-tokens.js +5 -0
  120. package/esm2015/tokens/title.js +1 -1
  121. package/esm2015/tokens/url-state-handler.js +1 -1
  122. package/esm2015/types/index.js +2 -0
  123. package/esm2015/types/pages.js +1 -1
  124. package/esm2015/types/taiga-ui-addon-doc-types.js +5 -0
  125. package/esm2015/utils/coerce-boolean.js +1 -1
  126. package/esm2015/utils/coerce-value.js +1 -1
  127. package/esm2015/utils/generate-routes.js +1 -1
  128. package/esm2015/utils/index.js +10 -0
  129. package/esm2015/utils/inspect.js +1 -1
  130. package/esm2015/utils/parse-code-block.js +9 -0
  131. package/esm2015/utils/raw-load-record.js +1 -1
  132. package/esm2015/utils/raw-load.js +1 -1
  133. package/esm2015/utils/taiga-ui-addon-doc-utils.js +5 -0
  134. package/esm2015/utils/to-flat-map-pages.js +1 -1
  135. package/esm2015/utils/transliterate-keyboard-layout.js +1 -1
  136. package/fesm2015/taiga-ui-addon-doc-components.js +1882 -0
  137. package/fesm2015/taiga-ui-addon-doc-components.js.map +1 -0
  138. package/fesm2015/taiga-ui-addon-doc-directives.js +65 -0
  139. package/fesm2015/taiga-ui-addon-doc-directives.js.map +1 -0
  140. package/fesm2015/taiga-ui-addon-doc-interfaces.js +12 -0
  141. package/fesm2015/taiga-ui-addon-doc-interfaces.js.map +1 -0
  142. package/fesm2015/taiga-ui-addon-doc-languages.js +46 -0
  143. package/fesm2015/taiga-ui-addon-doc-languages.js.map +1 -0
  144. package/fesm2015/taiga-ui-addon-doc-services.js +95 -0
  145. package/fesm2015/taiga-ui-addon-doc-services.js.map +1 -0
  146. package/fesm2015/taiga-ui-addon-doc-tokens.js +162 -0
  147. package/fesm2015/taiga-ui-addon-doc-tokens.js.map +1 -0
  148. package/fesm2015/taiga-ui-addon-doc-types.js +4 -0
  149. package/fesm2015/taiga-ui-addon-doc-types.js.map +1 -0
  150. package/fesm2015/taiga-ui-addon-doc-utils.js +228 -0
  151. package/fesm2015/taiga-ui-addon-doc-utils.js.map +1 -0
  152. package/fesm2015/taiga-ui-addon-doc.js +11 -2409
  153. package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
  154. package/index.d.ts +9 -0
  155. package/interfaces/index.d.ts +4 -0
  156. package/interfaces/package.json +10 -0
  157. package/interfaces/taiga-ui-addon-doc-interfaces.d.ts +5 -0
  158. package/languages/index.d.ts +1 -0
  159. package/languages/package.json +10 -0
  160. package/languages/taiga-ui-addon-doc-languages.d.ts +5 -0
  161. package/package.json +6 -6
  162. package/services/index.d.ts +4 -0
  163. package/services/package.json +10 -0
  164. package/services/taiga-ui-addon-doc-services.d.ts +5 -0
  165. package/taiga-ui-addon-doc.d.ts +1 -1
  166. package/tokens/code-editor.d.ts +1 -1
  167. package/tokens/index.d.ts +14 -0
  168. package/tokens/package.json +10 -0
  169. package/tokens/pages.d.ts +2 -2
  170. package/tokens/source-code.d.ts +1 -1
  171. package/tokens/taiga-ui-addon-doc-tokens.d.ts +5 -0
  172. package/types/index.d.ts +1 -0
  173. package/types/package.json +10 -0
  174. package/types/pages.d.ts +1 -1
  175. package/types/taiga-ui-addon-doc-types.d.ts +5 -0
  176. package/utils/index.d.ts +9 -0
  177. package/utils/package.json +10 -0
  178. package/utils/raw-load-record.d.ts +1 -1
  179. package/utils/raw-load.d.ts +1 -1
  180. package/utils/taiga-ui-addon-doc-utils.d.ts +5 -0
  181. package/utils/to-flat-map-pages.d.ts +2 -2
  182. package/esm2015/components/code/parse-code-block.js +0 -9
  183. package/esm2015/components/documentation/pipes//321/201olor.pipe.js +0 -35
  184. package/esm2015/internal/header/header.component.js +0 -57
  185. package/esm2015/internal/header/header.module.js +0 -42
  186. package/esm2015/internal/input-opacity/input-opacity.directive.js +0 -32
  187. package/esm2015/internal/source-code/source-code.component.js +0 -57
  188. package/esm2015/public-api.js +0 -69
  189. package/public-api.d.ts +0 -60
  190. /package/components/documentation/pipes/{/321/201olor.pipe.d.ts" → color.pipe.d.ts} +0 -0
  191. /package/{internal → components/internal}/header/header.component.d.ts +0 -0
  192. /package/{internal → components/internal}/input-opacity/input-opacity.directive.d.ts +0 -0
  193. /package/{internal → components/internal}/input-opacity/input-opacity.module.d.ts +0 -0
  194. /package/{internal → components/internal}/see-also/see-also.module.d.ts +0 -0
  195. /package/{internal → components/internal}/source-code/source-code.module.d.ts +0 -0
  196. /package/{components/code → utils}/parse-code-block.d.ts +0 -0
@@ -0,0 +1,1882 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Inject, Input, HostBinding, NgModule, ElementRef, forwardRef, TemplateRef, ViewChild, ContentChild, HostListener, EventEmitter, Directive, Output, Pipe, Renderer2, ChangeDetectorRef, Self, ContentChildren, InjectionToken, Optional, ViewEncapsulation } from '@angular/core';
3
+ import { TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR, TUI_DOC_DEMO_TEXTS, TUI_DOC_URL_STATE_HANDLER, TUI_DOC_DOCUMENTATION_TEXTS, TUI_DOC_EXCLUDED_PROPERTIES, TUI_DOC_EXAMPLE_TEXTS, TUI_DOC_CODE_EDITOR, TUI_DOC_EXAMPLE_CONTENT_PROCESSOR, TUI_DOC_CODE_ACTIONS, TUI_DOC_TITLE, TUI_DOC_PAGES, TUI_DOC_SEARCH_TEXT, TUI_DOC_PAGE_LOADED, TUI_DOC_SCROLL_BEHAVIOR, TUI_DOC_LOGO, TUI_DOC_MENU_TEXT, TUI_DOC_SEE_ALSO_TEXT, TUI_DOC_MAP_PAGES, TUI_DOC_SOURCE_CODE, TUI_DOC_SOURCE_CODE_TEXT, TUI_DOC_SEE_ALSO, TUI_DOC_DEFAULT_TABS } from '@taiga-ui/addon-doc/tokens';
4
+ import { tuiRawLoad, tuiCoerceValueIsTrue, tuiCoerceValue, tuiInspectAny, tuiRawLoadRecord, tuiTransliterateKeyboardLayout } from '@taiga-ui/addon-doc/utils';
5
+ import * as i9 from 'rxjs';
6
+ import { BehaviorSubject, Subject, timer, merge } from 'rxjs';
7
+ import { switchMap, map, startWith, takeUntil, filter, mergeMap, take, distinctUntilChanged, share } from 'rxjs/operators';
8
+ import * as i4 from '@angular/common';
9
+ import { CommonModule, Location as Location$1, DOCUMENT } from '@angular/common';
10
+ import * as i2 from 'ngx-highlightjs';
11
+ import { HighlightModule } from 'ngx-highlightjs';
12
+ import { __decorate } from 'tslib';
13
+ import * as i6$1 from '@taiga-ui/cdk';
14
+ import { ALWAYS_FALSE_HANDLER, TuiDestroyService, tuiPure, tuiToInteger, tuiClamp, tuiPx, tuiCleanObject, TUI_IS_MOBILE, TuiResizeableDirective, tuiDefaultProp, TuiResizerModule, tuiIsNumber, tuiRgbToHex, TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_CYPRESS, tuiIsString, EMPTY_QUERY, tuiQueryListChanges, tuiWatch, tuiHexToRgb, TuiFilterPipeModule, TuiMapperPipeModule, tuiIsPresent, tuiControlValue, tuiUniqBy, TuiSwipeService, TuiActiveZoneModule, TuiLetModule, TuiAutoFocusModule, TuiReplacePipeModule } from '@taiga-ui/cdk';
15
+ import * as i1 from '@taiga-ui/kit';
16
+ import { TUI_COPY_TEXTS, TuiSelectModule, TuiRadioBlockModule, TuiCheckboxLabeledModule, TuiDataListWrapperModule, TuiBadgeModule, TuiToggleModule, TuiInputCountModule, TuiTabsModule, TuiInputModule, TuiAccordionModule, TuiTagModule } from '@taiga-ui/kit';
17
+ import * as i2$1 from '@taiga-ui/core';
18
+ import { TuiButtonModule, TuiModeDirective, TuiLinkModule, TuiExpandModule, TuiGroupModule, TuiTooltipModule, TuiModeModule, TuiSvgModule, TuiDataListModule, TuiTextfieldControllerModule, TuiHintModule, TuiPrimitiveTextfieldModule, TuiDropdownModule, TuiNotificationModule, tuiCapitalizeFirstLetter, TuiAlertService, TuiLoaderModule, TuiHostedDropdownModule, TuiScrollbarModule, TuiFlagPipe, TuiFlagPipeModule, TuiThemeNightModule, TuiRootModule, TuiDialogModule, TuiAlertModule } from '@taiga-ui/core';
19
+ import * as i5 from '@angular/forms';
20
+ import { FormGroup, ReactiveFormsModule, FormsModule, FormControl } from '@angular/forms';
21
+ import * as i6 from '@angular/router';
22
+ import { UrlSerializer, RouterModule, ActivatedRoute, Router, NavigationEnd } from '@angular/router';
23
+ import { trigger, transition, style, animate } from '@angular/animations';
24
+ import * as i8 from '@angular/cdk/clipboard';
25
+ import { Clipboard, ClipboardModule } from '@angular/cdk/clipboard';
26
+ import { LOCATION } from '@ng-web-apis/common';
27
+ import { TUI_EXAMPLE_PRIMARY_FILE_NAME } from '@taiga-ui/addon-doc/interfaces';
28
+ import * as i6$2 from '@tinkoff/ng-polymorpheus';
29
+ import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
30
+ import * as i8$1 from '@angular/platform-browser';
31
+ import { Title } from '@angular/platform-browser';
32
+ import * as i4$1 from '@taiga-ui/addon-mobile';
33
+ import { TuiSidebarDirective, TuiSidebarModule } from '@taiga-ui/addon-mobile';
34
+ import * as i7 from '@taiga-ui/addon-doc/directives';
35
+ import { TuiScrollIntoViewLinkModule } from '@taiga-ui/addon-doc/directives';
36
+ import * as i5$1 from '@taiga-ui/i18n';
37
+ import { TuiCountryIsoCode, TuiLanguageSwitcher } from '@taiga-ui/i18n';
38
+ import * as i6$3 from '@taiga-ui/addon-doc/services';
39
+ import { TuiThemeService, TuiThemeNightService } from '@taiga-ui/addon-doc/services';
40
+
41
+ class TuiDocCodeComponent {
42
+ constructor(markdownCodeProcessor) {
43
+ this.markdownCodeProcessor = markdownCodeProcessor;
44
+ this.rawLoader$$ = new BehaviorSubject('');
45
+ this.filename = '';
46
+ this.processor$ = this.rawLoader$$.pipe(switchMap(tuiRawLoad), map((value) => this.markdownCodeProcessor(value)));
47
+ }
48
+ set code(code) {
49
+ this.rawLoader$$.next(code);
50
+ }
51
+ get hasFilename() {
52
+ return !!this.filename;
53
+ }
54
+ }
55
+ TuiDocCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeComponent, deps: [{ token: TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR }], target: i0.ɵɵFactoryTarget.Component });
56
+ TuiDocCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocCodeComponent, selector: "tui-doc-code", inputs: { filename: "filename", code: "code" }, host: { properties: { "class._has-filename": "this.hasFilename" } }, ngImport: i0, template: "<!-- eslint-disable @html-eslint/element-newline -->\n<p\n *ngIf=\"filename\"\n class=\"t-header\"\n>\n {{ filename }}\n</p>\n<pre\n *ngFor=\"let content of processor$ | async\"\n class=\"t-code\"\n><code [lineNumbers]=\"true\" [highlight]=\"content\"></code></pre>\n", styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:bold}.t-code{margin:0}.t-code+.t-code{margin-top:1rem}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .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:2.667rem 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}:host-context(tui-root._mobile) .hljs:not(:empty){padding:1rem}\n"], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.Highlight, selector: "[highlight]", inputs: ["highlight", "languages", "lineNumbers"], outputs: ["highlighted"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeComponent, decorators: [{
58
+ type: Component,
59
+ args: [{
60
+ selector: 'tui-doc-code',
61
+ templateUrl: './code.template.html',
62
+ styleUrls: ['./code.style.less'],
63
+ changeDetection: ChangeDetectionStrategy.OnPush,
64
+ }]
65
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
66
+ type: Inject,
67
+ args: [TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR]
68
+ }] }]; }, propDecorators: { filename: [{
69
+ type: Input
70
+ }], code: [{
71
+ type: Input
72
+ }], hasFilename: [{
73
+ type: HostBinding,
74
+ args: ['class._has-filename']
75
+ }] } });
76
+
77
+ class TuiDocCodeModule {
78
+ }
79
+ TuiDocCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
80
+ TuiDocCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, declarations: [TuiDocCodeComponent], imports: [CommonModule, HighlightModule], exports: [TuiDocCodeComponent] });
81
+ TuiDocCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, imports: [[CommonModule, HighlightModule]] });
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, decorators: [{
83
+ type: NgModule,
84
+ args: [{
85
+ imports: [CommonModule, HighlightModule],
86
+ declarations: [TuiDocCodeComponent],
87
+ exports: [TuiDocCodeComponent],
88
+ }]
89
+ }] });
90
+
91
+ const COPIED_TIMEOUT = 1500;
92
+ class TuiDocCopyComponent {
93
+ constructor(texts$) {
94
+ this.texts$ = texts$;
95
+ this.copy$ = new Subject();
96
+ }
97
+ get copied$() {
98
+ return this.copy$.pipe(switchMap(() => timer(COPIED_TIMEOUT).pipe(map(ALWAYS_FALSE_HANDLER), startWith(true))));
99
+ }
100
+ onClick() {
101
+ this.copy$.next();
102
+ }
103
+ }
104
+ TuiDocCopyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyComponent, deps: [{ token: TUI_COPY_TEXTS }], target: i0.ɵɵFactoryTarget.Component });
105
+ TuiDocCopyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocCopyComponent, selector: "tui-doc-copy", providers: [TuiDestroyService], ngImport: i0, 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\n class=\"t-content\"\n [class.t-content_moved]=\"copied$ | async\"\n >\n <span\n class=\"t-initial\"\n [attr.data-text]=\"texts[0]\"\n >\n <ng-content></ng-content>\n </span>\n {{ texts[1] }}\n </span>\n</button>\n", styles: [":host{position:relative;display:inline-block;vertical-align:middle}.t-copy{transition-property:background;transition-duration:var(--tui-duration, .3s);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, .3s);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)}\n"], components: [{ type: i2$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
106
+ __decorate([
107
+ tuiPure
108
+ ], TuiDocCopyComponent.prototype, "copied$", null);
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyComponent, decorators: [{
110
+ type: Component,
111
+ args: [{
112
+ selector: 'tui-doc-copy',
113
+ templateUrl: './copy.template.html',
114
+ styleUrls: ['./copy.style.less'],
115
+ changeDetection: ChangeDetectionStrategy.OnPush,
116
+ providers: [TuiDestroyService],
117
+ }]
118
+ }], ctorParameters: function () { return [{ type: i9.Observable, decorators: [{
119
+ type: Inject,
120
+ args: [TUI_COPY_TEXTS]
121
+ }] }]; }, propDecorators: { copied$: [] } });
122
+
123
+ class TuiDocCopyModule {
124
+ }
125
+ TuiDocCopyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
126
+ TuiDocCopyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, declarations: [TuiDocCopyComponent], imports: [CommonModule, TuiButtonModule], exports: [TuiDocCopyComponent] });
127
+ TuiDocCopyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, imports: [[CommonModule, TuiButtonModule]] });
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, decorators: [{
129
+ type: NgModule,
130
+ args: [{
131
+ imports: [CommonModule, TuiButtonModule],
132
+ declarations: [TuiDocCopyComponent],
133
+ exports: [TuiDocCopyComponent],
134
+ }]
135
+ }] });
136
+
137
+ const MIN_WIDTH = 160;
138
+ class TuiDocDemoComponent {
139
+ constructor(isMobile, el, locationRef, urlSerializer, texts, urlStateHandler) {
140
+ var _a, _b;
141
+ this.isMobile = isMobile;
142
+ this.el = el;
143
+ this.locationRef = locationRef;
144
+ this.urlSerializer = urlSerializer;
145
+ this.texts = texts;
146
+ this.urlStateHandler = urlStateHandler;
147
+ this.control = null;
148
+ this.sticky = true;
149
+ this.template = null;
150
+ this.updateOnVariants = ['change', 'blur', 'submit'];
151
+ this.updateOn = this.params.updateOn || this.updateOnVariants[0];
152
+ this.opaque = tuiCoerceValueIsTrue((_a = this.params.sandboxOpaque) !== null && _a !== void 0 ? _a : true);
153
+ this.expanded = tuiCoerceValueIsTrue((_b = this.params.sandboxExpanded) !== null && _b !== void 0 ? _b : false);
154
+ this.mode = this.params.tuiMode || null;
155
+ this.sandboxWidth = tuiToInteger(this.params.sandboxWidth);
156
+ this.change$ = new Subject();
157
+ this.items = ['onLight', 'onDark'];
158
+ }
159
+ onResize() {
160
+ this.updateWidth();
161
+ this.onMouseUp();
162
+ }
163
+ onMouseUp() {
164
+ this.updateUrl({ sandboxWidth: this.sandboxWidth });
165
+ }
166
+ ngOnInit() {
167
+ this.createForm();
168
+ this.updateWidth(this.sandboxWidth + this.delta);
169
+ }
170
+ onModeChange(mode) {
171
+ this.mode = mode;
172
+ this.updateUrl({ sandboxWidth: this.sandboxWidth });
173
+ this.change$.next();
174
+ }
175
+ toggleDetails() {
176
+ this.expanded = !this.expanded;
177
+ this.updateUrl({ sandboxExpanded: this.expanded });
178
+ }
179
+ changeOpaque(opaque) {
180
+ this.opaque = opaque;
181
+ this.updateUrl({ sandboxOpaque: this.opaque });
182
+ }
183
+ updateOnChange(updateOn) {
184
+ this.updateOn = updateOn;
185
+ this.updateUrl({ updateOn });
186
+ this.createForm();
187
+ }
188
+ updateWidth(width = NaN) {
189
+ if (!this.resizer || !this.resizeable || !this.content) {
190
+ return;
191
+ }
192
+ const safe = width || this.resizeable.nativeElement.clientWidth;
193
+ const total = this.el.nativeElement.clientWidth;
194
+ const clamped = Math.round(tuiClamp(safe, MIN_WIDTH, total)) - this.delta;
195
+ const validated = safe < total ? clamped : NaN;
196
+ this.resizer.nativeElement.textContent = String(clamped || '-');
197
+ this.resizeable.nativeElement.style.width = validated ? tuiPx(safe) : '';
198
+ this.sandboxWidth = validated;
199
+ }
200
+ get delta() {
201
+ return this.resizeable && this.content
202
+ ? this.resizeable.nativeElement.clientWidth -
203
+ this.content.nativeElement.clientWidth
204
+ : 0;
205
+ }
206
+ updateUrl(params) {
207
+ const tree = this.getUrlTree();
208
+ const { queryParams } = tree;
209
+ delete queryParams.sandboxWidth;
210
+ delete queryParams.tuiMode;
211
+ tree.queryParams = Object.assign(Object.assign({}, queryParams), tuiCleanObject(Object.assign({ tuiMode: this.mode }, params)));
212
+ this.locationRef.go(this.urlStateHandler(tree));
213
+ }
214
+ createForm() {
215
+ const { control, updateOn } = this;
216
+ if (control) {
217
+ this.testForm = new FormGroup({ testValue: control }, { updateOn });
218
+ }
219
+ }
220
+ getUrlTree() {
221
+ return this.urlSerializer.parse(this.locationRef.path());
222
+ }
223
+ get params() {
224
+ return this.getUrlTree().queryParams;
225
+ }
226
+ }
227
+ TuiDocDemoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoComponent, deps: [{ token: TUI_IS_MOBILE }, { token: ElementRef }, { token: Location$1 }, { token: UrlSerializer }, { token: TUI_DOC_DEMO_TEXTS }, { token: TUI_DOC_URL_STATE_HANDLER }], target: i0.ɵɵFactoryTarget.Component });
228
+ TuiDocDemoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocDemoComponent, selector: "tui-doc-demo", inputs: { control: "control", sticky: "sticky" }, host: { listeners: { "window:resize": "onResize()", "document:mouseup.silent": "onMouseUp()" }, properties: { "class._sticky": "this.sticky" } }, providers: [
229
+ TuiDestroyService,
230
+ {
231
+ provide: TuiModeDirective,
232
+ useExisting: forwardRef(() => TuiDocDemoComponent),
233
+ },
234
+ ], queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "resizeable", first: true, predicate: TuiResizeableDirective, descendants: true, static: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }, { propertyName: "resizer", first: true, predicate: ["resizer"], descendants: true, static: true }], ngImport: i0, template: "<div\n class=\"t-bg-toggle\"\n [tuiMode]=\"null\"\n>\n <ng-template #tooltip>\n {{ texts[0] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n routerLink=\"/directives/mode\"\n >\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 [ngModel]=\"mode\"\n (ngModelChange)=\"onModeChange($event)\"\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\n describeId=\"form\"\n [content]=\"tooltip\"\n ></tui-tooltip>\n <div\n tuiGroup\n class=\"t-group\"\n [collapsed]=\"true\"\n >\n <tui-radio-block\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [ngModel]=\"mode\"\n (ngModelChange)=\"onModeChange($event)\"\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 [ngModel]=\"mode\"\n (ngModelChange)=\"onModeChange($event)\"\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 [ngModel]=\"mode\"\n (ngModelChange)=\"onModeChange($event)\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n size=\"m\"\n class=\"t-checkbox\"\n [ngModel]=\"opaque\"\n (ngModelChange)=\"changeOpaque($event)\"\n >\n {{ texts[1] }}\n </tui-checkbox-labeled>\n</div>\n<div\n tuiResizeable\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"mode === 'onDark'\"\n [class.t-wrapper_gray]=\"mode === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div\n id=\"demo-content\"\n class=\"t-content\"\n >\n <div #content>\n <form\n *ngIf=\"testForm\"\n class=\"t-form\"\n [formGroup]=\"testForm\"\n >\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 automation-id=\"tui-demo-button__toggle-details\"\n class=\"t-button\"\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\n class=\"t-expand\"\n [expanded]=\"expanded\"\n >\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">Form data: {{ testForm.value | json }}</pre>\n <div\n tuiGroup\n class=\"t-form-controls\"\n >\n <tui-select\n tuiTextfieldSize=\"s\"\n automation-id=\"tui-demo-select__expand-update-on\"\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 automation-id=\"tui-demo-button__reset-state\"\n class=\"tui-group__auto-width-item\"\n >\n Reset\n </button>\n <button\n tuiButton\n type=\"submit\"\n size=\"s\"\n automation-id=\"tui-demo-button__submit-state\"\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 </div>\n <div\n #resizer\n class=\"t-resizer\"\n [tuiResizer]=\"[1, 0]\"\n (tuiSizeChange)=\"updateWidth($event[0])\"\n ></div>\n</div>\n", 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 1.5rem 1rem #00000008,0 .75rem .75rem #0000000a,0 .25rem .375rem #0000000d;display:flex;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);max-width:100%;min-height:6rem;width:100%;min-width:10rem;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%)}:host-context(tui-root._mobile) .t-wrapper{min-height:auto}.t-content{flex:1 1 0;min-width:0;padding:1.5rem;box-sizing:border-box;overflow:hidden}:host-context(tui-root._mobile) .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, .3s);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{box-shadow:0 1.5rem 1rem #00000008,0 .75rem .75rem #0000000a,0 .25rem .375rem #0000000d;position:relative;width:3.5rem;min-height:inherit;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-left:1px solid var(--tui-base-03);outline:none;background:var(--tui-base-01);color:var(--tui-text-01)}.t-resizer:before,.t-resizer:after{content:\"\";position:absolute;top:.75rem;left:50%;bottom:calc(50% + 1rem);width:1px;background:var(--tui-base-04);box-shadow:-.25rem 0 var(--tui-base-04);transform:translate(0)}.t-resizer:after{bottom:.75rem;top:calc(50% + 1rem)}:host-context(tui-root._mobile) .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}.t-group,.t-checkbox{margin-left:.75rem}.t-button,.t-form-controls{margin-top:.75rem}@supports ((position: -webkit-sticky) or (position: sticky)){@media screen and (min-height: 37.5rem){:host._sticky{position:-webkit-sticky;position:sticky;top:4.625rem;z-index:2}}}\n"], components: [{ type: i2$1.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { type: i1.TuiSelectComponent, selector: "tui-select", inputs: ["stringify", "identityMatcher", "valueContent"] }, { type: i1.TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items"] }, { type: i2$1.TuiTooltipComponent, selector: "tui-tooltip", inputs: ["content", "direction", "appearance", "showDelay", "hideDelay", "describeId"] }, { type: i1.TuiRadioBlockComponent, selector: "tui-radio-block", inputs: ["item", "identityMatcher", "contentAlign", "size", "hideRadio", "pseudoDisabled"] }, { type: i1.TuiCheckboxLabeledComponent, selector: "tui-checkbox-labeled", inputs: ["size"] }, { type: i2$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i2$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2$1.TuiExpandComponent, selector: "tui-expand", inputs: ["async", "expanded"] }], directives: [{ type: i2$1.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }, { type: i6.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.TuiSelectDirective, selector: "tui-select" }, { type: i2$1.TuiTextfieldSizeDirective, selector: "[tuiTextfieldSize]", inputs: ["tuiTextfieldSize"] }, { type: i2$1.TuiTextfieldCleanerDirective, selector: "[tuiTextfieldCleaner]", inputs: ["tuiTextfieldCleaner"] }, { type: i2$1.TuiHintOptionsDirective, selector: "[tuiHintContent]", inputs: ["tuiHintContent", "tuiHintDirection", "tuiHintAppearance", "tuiHintShowDelay", "tuiHintHideDelay"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2$1.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { type: i2$1.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i6$1.TuiResizeableDirective, selector: "[tuiResizeable]" }, { type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$1.TuiExpandContentDirective, selector: "[tuiExpandContent]" }, { type: i6$1.TuiResizerDirective, selector: "[tuiResizer]", inputs: ["tuiResizer"], outputs: ["tuiSizeChange"] }], pipes: { "json": i4.JsonPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
235
+ __decorate([
236
+ tuiDefaultProp()
237
+ ], TuiDocDemoComponent.prototype, "sticky", void 0);
238
+ __decorate([
239
+ tuiPure
240
+ ], TuiDocDemoComponent.prototype, "updateUrl", null);
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoComponent, decorators: [{
242
+ type: Component,
243
+ args: [{
244
+ selector: 'tui-doc-demo',
245
+ templateUrl: './demo.template.html',
246
+ styleUrls: ['./demo.style.less'],
247
+ changeDetection: ChangeDetectionStrategy.OnPush,
248
+ providers: [
249
+ TuiDestroyService,
250
+ {
251
+ provide: TuiModeDirective,
252
+ useExisting: forwardRef(() => TuiDocDemoComponent),
253
+ },
254
+ ],
255
+ }]
256
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
257
+ type: Inject,
258
+ args: [TUI_IS_MOBILE]
259
+ }] }, { type: i0.ElementRef, decorators: [{
260
+ type: Inject,
261
+ args: [ElementRef]
262
+ }] }, { type: i4.Location, decorators: [{
263
+ type: Inject,
264
+ args: [Location$1]
265
+ }] }, { type: i6.UrlSerializer, decorators: [{
266
+ type: Inject,
267
+ args: [UrlSerializer]
268
+ }] }, { type: undefined, decorators: [{
269
+ type: Inject,
270
+ args: [TUI_DOC_DEMO_TEXTS]
271
+ }] }, { type: undefined, decorators: [{
272
+ type: Inject,
273
+ args: [TUI_DOC_URL_STATE_HANDLER]
274
+ }] }]; }, propDecorators: { resizeable: [{
275
+ type: ViewChild,
276
+ args: [TuiResizeableDirective, { static: true }]
277
+ }], content: [{
278
+ type: ViewChild,
279
+ args: ['content', { static: true }]
280
+ }], resizer: [{
281
+ type: ViewChild,
282
+ args: ['resizer', { static: true }]
283
+ }], control: [{
284
+ type: Input
285
+ }], sticky: [{
286
+ type: Input
287
+ }, {
288
+ type: HostBinding,
289
+ args: ['class._sticky']
290
+ }], template: [{
291
+ type: ContentChild,
292
+ args: [TemplateRef]
293
+ }], onResize: [{
294
+ type: HostListener,
295
+ args: ['window:resize']
296
+ }], onMouseUp: [{
297
+ type: HostListener,
298
+ args: ['document:mouseup.silent']
299
+ }], updateUrl: [] } });
300
+
301
+ class TuiDocDemoModule {
302
+ }
303
+ TuiDocDemoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
304
+ TuiDocDemoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, declarations: [TuiDocDemoComponent], imports: [CommonModule,
305
+ ReactiveFormsModule,
306
+ FormsModule,
307
+ RouterModule,
308
+ TuiLinkModule,
309
+ TuiButtonModule,
310
+ TuiSelectModule,
311
+ TuiExpandModule,
312
+ TuiGroupModule,
313
+ TuiTooltipModule,
314
+ TuiModeModule,
315
+ TuiRadioBlockModule,
316
+ TuiCheckboxLabeledModule,
317
+ TuiSvgModule,
318
+ TuiDataListWrapperModule,
319
+ TuiDataListModule,
320
+ TuiTextfieldControllerModule,
321
+ TuiHintModule,
322
+ TuiResizerModule], exports: [TuiDocDemoComponent] });
323
+ TuiDocDemoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, imports: [[
324
+ CommonModule,
325
+ ReactiveFormsModule,
326
+ FormsModule,
327
+ RouterModule,
328
+ TuiLinkModule,
329
+ TuiButtonModule,
330
+ TuiSelectModule,
331
+ TuiExpandModule,
332
+ TuiGroupModule,
333
+ TuiTooltipModule,
334
+ TuiModeModule,
335
+ TuiRadioBlockModule,
336
+ TuiCheckboxLabeledModule,
337
+ TuiSvgModule,
338
+ TuiDataListWrapperModule,
339
+ TuiDataListModule,
340
+ TuiTextfieldControllerModule,
341
+ TuiHintModule,
342
+ TuiResizerModule,
343
+ ]] });
344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, decorators: [{
345
+ type: NgModule,
346
+ args: [{
347
+ imports: [
348
+ CommonModule,
349
+ ReactiveFormsModule,
350
+ FormsModule,
351
+ RouterModule,
352
+ TuiLinkModule,
353
+ TuiButtonModule,
354
+ TuiSelectModule,
355
+ TuiExpandModule,
356
+ TuiGroupModule,
357
+ TuiTooltipModule,
358
+ TuiModeModule,
359
+ TuiRadioBlockModule,
360
+ TuiCheckboxLabeledModule,
361
+ TuiSvgModule,
362
+ TuiDataListWrapperModule,
363
+ TuiDataListModule,
364
+ TuiTextfieldControllerModule,
365
+ TuiHintModule,
366
+ TuiResizerModule,
367
+ ],
368
+ declarations: [TuiDocDemoComponent],
369
+ exports: [TuiDocDemoComponent],
370
+ }]
371
+ }] });
372
+
373
+ const SERIALIZED_SUFFIX = '$';
374
+ // @bad TODO: refactor output and value sync
375
+ class TuiDocDocumentationPropertyConnectorDirective {
376
+ constructor(template, locationRef, activatedRoute, urlSerializer, urlStateHandler) {
377
+ this.template = template;
378
+ this.locationRef = locationRef;
379
+ this.activatedRoute = activatedRoute;
380
+ this.urlSerializer = urlSerializer;
381
+ this.urlStateHandler = urlStateHandler;
382
+ this.documentationPropertyName = '';
383
+ this.documentationPropertyMode = null;
384
+ this.documentationPropertyType = '';
385
+ this.documentationPropertyDeprecated = false;
386
+ this.documentationPropertyValues = null;
387
+ this.documentationPropertyValueChange = new EventEmitter();
388
+ this.changed$ = new Subject();
389
+ this.emits$ = new BehaviorSubject(1);
390
+ }
391
+ ngOnInit() {
392
+ this.parseParams(this.activatedRoute.snapshot.queryParams);
393
+ }
394
+ get attrName() {
395
+ switch (this.documentationPropertyMode) {
396
+ case 'input':
397
+ return `[${this.documentationPropertyName}]`;
398
+ case 'output':
399
+ return `(${this.documentationPropertyName})`;
400
+ case 'input-output':
401
+ return `[(${this.documentationPropertyName})]`;
402
+ default:
403
+ return this.documentationPropertyName;
404
+ }
405
+ }
406
+ get hasItems() {
407
+ return !!this.documentationPropertyValues;
408
+ }
409
+ get shouldShowValues() {
410
+ return this.documentationPropertyMode !== 'output';
411
+ }
412
+ ngOnChanges() {
413
+ this.changed$.next();
414
+ }
415
+ onValueChange(value) {
416
+ this.documentationPropertyValue = value;
417
+ this.documentationPropertyValueChange.emit(value);
418
+ this.setQueryParam(value);
419
+ }
420
+ emitEvent(event) {
421
+ // For more convenient debugging
422
+ console.info(this.attrName, event);
423
+ this.emits$.next(this.emits$.value + 1);
424
+ }
425
+ parseParams(params) {
426
+ const propertyValue = params[this.documentationPropertyName];
427
+ const propertyValueWithSuffix = params[`${this.documentationPropertyName}${SERIALIZED_SUFFIX}`];
428
+ if (!propertyValue && !propertyValueWithSuffix) {
429
+ return;
430
+ }
431
+ let value = !!propertyValueWithSuffix && this.documentationPropertyValues
432
+ ? this.documentationPropertyValues[propertyValueWithSuffix]
433
+ : tuiCoerceValue(propertyValue);
434
+ if (this.documentationPropertyType === 'string' && tuiIsNumber(value)) {
435
+ value = value.toString();
436
+ }
437
+ this.onValueChange(value);
438
+ }
439
+ setQueryParam(value) {
440
+ const tree = this.urlSerializer.parse(this.locationRef.path());
441
+ const isValueAvailableByKey = value instanceof Object;
442
+ const computedValue = isValueAvailableByKey && this.documentationPropertyValues
443
+ ? this.documentationPropertyValues.indexOf(value)
444
+ : value;
445
+ const suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
446
+ const propName = this.documentationPropertyName + suffix;
447
+ tree.queryParams = Object.assign(Object.assign({}, tree.queryParams), { [propName]: computedValue });
448
+ this.locationRef.go(this.urlStateHandler(tree));
449
+ }
450
+ }
451
+ TuiDocDocumentationPropertyConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationPropertyConnectorDirective, deps: [{ token: TemplateRef }, { token: Location$1 }, { token: ActivatedRoute }, { token: UrlSerializer }, { token: TUI_DOC_URL_STATE_HANDLER }], target: i0.ɵɵFactoryTarget.Directive });
452
+ TuiDocDocumentationPropertyConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocDocumentationPropertyConnectorDirective, selector: "ng-template[documentationPropertyName]", inputs: { documentationPropertyName: "documentationPropertyName", documentationPropertyMode: "documentationPropertyMode", documentationPropertyType: "documentationPropertyType", documentationPropertyValue: "documentationPropertyValue", documentationPropertyDeprecated: "documentationPropertyDeprecated", documentationPropertyValues: "documentationPropertyValues" }, outputs: { documentationPropertyValueChange: "documentationPropertyValueChange" }, exportAs: ["documentationProperty"], usesOnChanges: true, ngImport: i0 });
453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationPropertyConnectorDirective, decorators: [{
454
+ type: Directive,
455
+ args: [{
456
+ selector: 'ng-template[documentationPropertyName]',
457
+ exportAs: 'documentationProperty',
458
+ }]
459
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
460
+ type: Inject,
461
+ args: [TemplateRef]
462
+ }] }, { type: i4.Location, decorators: [{
463
+ type: Inject,
464
+ args: [Location$1]
465
+ }] }, { type: i6.ActivatedRoute, decorators: [{
466
+ type: Inject,
467
+ args: [ActivatedRoute]
468
+ }] }, { type: i6.UrlSerializer, decorators: [{
469
+ type: Inject,
470
+ args: [UrlSerializer]
471
+ }] }, { type: undefined, decorators: [{
472
+ type: Inject,
473
+ args: [TUI_DOC_URL_STATE_HANDLER]
474
+ }] }]; }, propDecorators: { documentationPropertyName: [{
475
+ type: Input
476
+ }], documentationPropertyMode: [{
477
+ type: Input
478
+ }], documentationPropertyType: [{
479
+ type: Input
480
+ }], documentationPropertyValue: [{
481
+ type: Input
482
+ }], documentationPropertyDeprecated: [{
483
+ type: Input
484
+ }], documentationPropertyValues: [{
485
+ type: Input
486
+ }], documentationPropertyValueChange: [{
487
+ type: Output
488
+ }] } });
489
+
490
+ class TuiGetColorPipe {
491
+ transform(color) {
492
+ if (color.length === 4) {
493
+ return color
494
+ .split(``)
495
+ .reduce((result, current) => [...result, current, current], [])
496
+ .join(``)
497
+ .replace(`#`, ``);
498
+ }
499
+ if (color.startsWith(`#`)) {
500
+ return color;
501
+ }
502
+ if (color === `transparent`) {
503
+ return `#000000`;
504
+ }
505
+ const parsed = color
506
+ .replace(`rgb(`, ``)
507
+ .replace(`rgba(`, ``)
508
+ .replace(`)`, ``)
509
+ .replace(` `, ``)
510
+ .split(`,`)
511
+ .map(v => Number.parseInt(v, 10));
512
+ return tuiRgbToHex(...parsed);
513
+ }
514
+ }
515
+ TuiGetColorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
516
+ TuiGetColorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetColorPipe, name: "tuiGetColorPipe" });
517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetColorPipe, decorators: [{
518
+ type: Pipe,
519
+ args: [{ name: `tuiGetColorPipe` }]
520
+ }] });
521
+
522
+ class TuiGetOpacityPipe {
523
+ transform(color) {
524
+ if (color.startsWith(`#`) || color.startsWith(`rgb(`)) {
525
+ return 100;
526
+ }
527
+ if (color === `transparent`) {
528
+ return 0;
529
+ }
530
+ const lastComma = color.lastIndexOf(`,`);
531
+ const parsed = color
532
+ .slice(lastComma)
533
+ .replace(`)`, ``)
534
+ .replace(` `, ``)
535
+ .replace(`,`, ``);
536
+ return Math.round(Number.parseFloat(parsed) * 100);
537
+ }
538
+ }
539
+ TuiGetOpacityPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetOpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
540
+ TuiGetOpacityPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetOpacityPipe, name: "tuiGetOpacity" });
541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetOpacityPipe, decorators: [{
542
+ type: Pipe,
543
+ args: [{ name: `tuiGetOpacity` }]
544
+ }] });
545
+
546
+ class TuiInputOpacityDirective {
547
+ constructor(renderer, focusable) {
548
+ this.renderer = renderer;
549
+ this.focusable = focusable;
550
+ }
551
+ set tuiInputOpacity(opacity) {
552
+ const { nativeFocusableElement } = this.focusable;
553
+ if (nativeFocusableElement) {
554
+ this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
555
+ }
556
+ }
557
+ }
558
+ TuiInputOpacityDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityDirective, deps: [{ token: Renderer2 }, { token: TUI_FOCUSABLE_ITEM_ACCESSOR }], target: i0.ɵɵFactoryTarget.Directive });
559
+ TuiInputOpacityDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiInputOpacityDirective, selector: "[tuiInputOpacity]", inputs: { tuiInputOpacity: "tuiInputOpacity" }, ngImport: i0 });
560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityDirective, decorators: [{
561
+ type: Directive,
562
+ args: [{
563
+ selector: '[tuiInputOpacity]',
564
+ }]
565
+ }], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
566
+ type: Inject,
567
+ args: [Renderer2]
568
+ }] }, { type: undefined, decorators: [{
569
+ type: Inject,
570
+ args: [TUI_FOCUSABLE_ITEM_ACCESSOR]
571
+ }] }]; }, propDecorators: { tuiInputOpacity: [{
572
+ type: Input
573
+ }] } });
574
+
575
+ class TuiStripOptionalPipe {
576
+ transform(name) {
577
+ return name.replace(`?`, ``);
578
+ }
579
+ }
580
+ TuiStripOptionalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiStripOptionalPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
581
+ TuiStripOptionalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiStripOptionalPipe, name: "tuiStripOptionalPipe" });
582
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiStripOptionalPipe, decorators: [{
583
+ type: Pipe,
584
+ args: [{ name: `tuiStripOptionalPipe` }]
585
+ }] });
586
+
587
+ class TuiIsOptionalPipe {
588
+ transform(name) {
589
+ return name.includes(`?`);
590
+ }
591
+ }
592
+ TuiIsOptionalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsOptionalPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
593
+ TuiIsOptionalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsOptionalPipe, name: "tuiIsOptionalPipe" });
594
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsOptionalPipe, decorators: [{
595
+ type: Pipe,
596
+ args: [{ name: `tuiIsOptionalPipe` }]
597
+ }] });
598
+
599
+ class TuiShowContentTooltip {
600
+ transform(type) {
601
+ return type.includes(`PolymorpheusContent`);
602
+ }
603
+ }
604
+ TuiShowContentTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowContentTooltip, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
605
+ TuiShowContentTooltip.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowContentTooltip, name: "tuiShowContentTooltip" });
606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowContentTooltip, decorators: [{
607
+ type: Pipe,
608
+ args: [{ name: `tuiShowContentTooltip` }]
609
+ }] });
610
+
611
+ class TuiShowCleanerPipe {
612
+ transform(type) {
613
+ return type.includes(`null`);
614
+ }
615
+ }
616
+ TuiShowCleanerPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowCleanerPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
617
+ TuiShowCleanerPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowCleanerPipe, name: "tuiShowCleanerPipe" });
618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowCleanerPipe, decorators: [{
619
+ type: Pipe,
620
+ args: [{ name: `tuiShowCleanerPipe` }]
621
+ }] });
622
+
623
+ class TuiInspectPipe {
624
+ constructor(isCypress) {
625
+ this.isCypress = isCypress;
626
+ }
627
+ transform(value, depth = 2) {
628
+ if (this.isCypress && typeof value === `function`) {
629
+ /**
630
+ * @description:
631
+ * When developing in production mode the webpack bundler minify
632
+ * functions in different ways, then due to which the string content
633
+ * of the function may differ from build to build, which can be to
634
+ * various problems when screenshot testing on e2e.
635
+ */
636
+ return `λ(x) => y`;
637
+ }
638
+ return tuiInspectAny(value, depth);
639
+ }
640
+ }
641
+ TuiInspectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInspectPipe, deps: [{ token: TUI_IS_CYPRESS }], target: i0.ɵɵFactoryTarget.Pipe });
642
+ TuiInspectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInspectPipe, name: "tuiInspectAny" });
643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInspectPipe, decorators: [{
644
+ type: Pipe,
645
+ args: [{ name: `tuiInspectAny` }]
646
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
647
+ type: Inject,
648
+ args: [TUI_IS_CYPRESS]
649
+ }] }]; } });
650
+
651
+ class TuiIsPrimitivePolymorpheusContentPipe {
652
+ transform(value) {
653
+ return tuiIsString(value) || tuiIsNumber(value);
654
+ }
655
+ }
656
+ TuiIsPrimitivePolymorpheusContentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsPrimitivePolymorpheusContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
657
+ TuiIsPrimitivePolymorpheusContentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsPrimitivePolymorpheusContentPipe, name: "tuiIsPrimitivePolymorpheusContentPipe" });
658
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsPrimitivePolymorpheusContentPipe, decorators: [{
659
+ type: Pipe,
660
+ args: [{ name: `tuiIsPrimitivePolymorpheusContentPipe` }]
661
+ }] });
662
+
663
+ // @bad TODO subscribe propertiesConnectors changes
664
+ // @bad TODO refactor to make more flexible
665
+ class TuiDocDocumentationComponent {
666
+ constructor(cdr, texts, excludedProperties, destroy$, getColor, getOpacity) {
667
+ this.cdr = cdr;
668
+ this.texts = texts;
669
+ this.excludedProperties = excludedProperties;
670
+ this.destroy$ = destroy$;
671
+ this.getColor = getColor;
672
+ this.getOpacity = getOpacity;
673
+ this.heading = '';
674
+ this.showValues = true;
675
+ this.isAPI = false;
676
+ this.propertiesConnectors = EMPTY_QUERY;
677
+ this.activeItemIndex = 0;
678
+ this.matcher = (item, exclusions) => !exclusions.has(item.documentationPropertyName);
679
+ }
680
+ ngAfterContentInit() {
681
+ tuiQueryListChanges(this.propertiesConnectors)
682
+ .pipe(switchMap(items => merge(...items.map(({ changed$ }) => changed$))), tuiWatch(this.cdr), takeUntil(this.destroy$))
683
+ .subscribe();
684
+ }
685
+ get type() {
686
+ return this.isAPI ? this.texts[0] : this.texts[1];
687
+ }
688
+ onColorChange(connector, color) {
689
+ const opacity = this.getOpacity.transform(connector.documentationPropertyValue || '');
690
+ if (opacity === 100) {
691
+ connector.onValueChange(color);
692
+ return;
693
+ }
694
+ const rgb = tuiHexToRgb(color).join(', ');
695
+ const result = `rgba(${rgb}, ${opacity / 100})`;
696
+ connector.onValueChange(result);
697
+ }
698
+ onOpacityChange(connector, opacity) {
699
+ const hex = this.getColor.transform(connector.documentationPropertyValue || '');
700
+ const rgb = tuiHexToRgb(hex);
701
+ const result = `rgba(${rgb}, ${opacity / 100})`;
702
+ connector.onValueChange(result);
703
+ }
704
+ }
705
+ TuiDocDocumentationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationComponent, deps: [{ token: ChangeDetectorRef }, { token: TUI_DOC_DOCUMENTATION_TEXTS }, { token: TUI_DOC_EXCLUDED_PROPERTIES }, { token: TuiDestroyService, self: true }, { token: TuiGetColorPipe }, { token: TuiGetOpacityPipe }], target: i0.ɵɵFactoryTarget.Component });
706
+ TuiDocDocumentationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocDocumentationComponent, selector: "tui-doc-documentation", inputs: { heading: "heading", showValues: "showValues", isAPI: "isAPI" }, providers: [TuiGetColorPipe, TuiGetOpacityPipe, TuiDestroyService], queries: [{ propertyName: "propertiesConnectors", predicate: TuiDocDocumentationPropertyConnectorDirective }], ngImport: i0, template: "<h1\n *ngIf=\"heading\"\n class=\"t-heading\"\n>\n {{ heading }}\n</h1>\n<ng-content></ng-content>\n<ng-container *ngIf=\"$any(propertiesConnectors) | tuiFilter : matcher : excludedProperties as properties\">\n <table\n *ngIf=\"properties.length\"\n class=\"t-table\"\n >\n <tr class=\"t-row t-row_header\">\n <th class=\"t-th t-cell t-cell_prop\">{{ texts[2] }}</th>\n <th class=\"t-th\">{{ type }}</th>\n <th\n *ngIf=\"showValues && !isAPI\"\n class=\"t-th t-cell t-th_value\"\n >\n {{ texts[3] }}\n </th>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of properties\"\n class=\"t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n >\n <td class=\"t-cell\">\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property\"\n >\n {{ propertyConnector.attrName | tuiStripOptionalPipe }}\n <tui-badge\n *ngIf=\"propertyConnector.attrName | tuiIsOptionalPipe\"\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 [ngTemplateOutlet]=\"propertyConnector.template\"></ng-container>\n </td>\n <td class=\"t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"propertyConnector.documentationPropertyType | tuiShowContentTooltip\"\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 rel=\"noreferrer\"\n href=\"https://github.com/tinkoff/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=\"t-cell t-cell_value\"\n >\n <ng-container *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\">\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"propertyConnector.documentationPropertyType | tuiShowCleanerPipe\"\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\n #selectContent\n let-data\n >\n <code>{{ data | tuiInspectAny }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container [ngSwitch]=\"propertyConnector.documentationPropertyType\">\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\n *ngSwitchCase=\"'color'\"\n tuiGroup\n >\n <tui-primitive-textfield\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"propertyConnector.documentationPropertyValue | tuiGetOpacity\"\n [value]=\"propertyConnector.documentationPropertyValue | tuiGetColorPipe\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n >\n <input\n tuiTextfield\n type=\"text\"\n />\n </tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"propertyConnector.documentationPropertyValue | tuiGetOpacity\"\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\n <ng-container *ngSwitchCase=\"'PolymorpheusContent'\">\n <tui-primitive-textfield\n *ngIf=\"\n propertyConnector.documentationPropertyValue\n | tuiIsPrimitivePolymorpheusContentPipe\n \"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue.toString()\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n >\n Default content\n </tui-primitive-textfield>\n </ng-container>\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</ng-container>\n", styles: [":host{display:block;min-width:100%}.t-table{width:100%;table-layout:fixed}.t-row:not(:last-child){border-bottom:1px solid var(--tui-base-03)}:host-context(tui-root._mobile) .t-row{display:flex;flex-wrap:wrap}:host-context(tui-root._mobile) .t-row_header{display:none}.t-cell{padding:1rem 1rem .875rem}.t-cell:first-child{padding-left:0}.t-cell:last-child{padding-right:0}.t-cell_prop{width:40%}.t-cell_value{text-align:right}:host-context(tui-root._mobile) .t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}.t-th{padding:.5rem 1rem;color:var(--tui-text-02);font-weight:normal;text-align:left}.t-th_value{max-width:20rem;text-align:right}:host-context(tui-root._mobile) .t-th_value{width:9.375rem}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}:host-context(tui-root._mobile) .t-property{padding:.5rem 0}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg);box-shadow:-1rem 0 var(--tui-error-bg),1rem 0 var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:max-content}.t-output{text-align:left;opacity:0}.t-heading{font:var(--tui-font-heading-4)}\n"], components: [{ type: i1.TuiBadgeComponent, selector: "tui-badge", inputs: ["value", "size", "status", "hoverable"] }, { type: i2$1.TuiTooltipComponent, selector: "tui-tooltip", inputs: ["content", "direction", "appearance", "showDelay", "hideDelay", "describeId"] }, { type: i2$1.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { type: i1.TuiSelectComponent, selector: "tui-select", inputs: ["stringify", "identityMatcher", "valueContent"] }, { type: i1.TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items"] }, { type: i1.TuiToggleComponent, selector: "tui-toggle", inputs: ["singleColor", "showIcons", "showLoader", "size"] }, { type: i2$1.TuiPrimitiveTextfieldComponent, selector: "tui-primitive-textfield", inputs: ["editable", "filler", "iconCleaner", "readOnly", "invalid", "disabled", "prefix", "postfix", "value"], outputs: ["valueChange"] }, { type: i2$1.TuiTextfieldComponent, selector: "input[tuiTextfield], textarea[tuiTextfield]" }, { type: i1.TuiInputCountComponent, selector: "tui-input-count", inputs: ["step", "min", "max", "hideButtons", "prefix", "postfix"] }, { type: i2$1.TuiNotificationComponent, selector: "tui-notification", inputs: ["hasIcon", "status", "hideClose"], outputs: ["close"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$1.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }, { type: i1.TuiSelectDirective, selector: "tui-select" }, { type: i2$1.TuiTextfieldSizeDirective, selector: "[tuiTextfieldSize]", inputs: ["tuiTextfieldSize"] }, { type: i2$1.TuiDropdownOptionsDirective, selector: "[tuiDropdownAlign], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]", inputs: ["tuiDropdownAlign", "tuiDropdownDirection", "tuiDropdownLimitWidth", "tuiDropdownMinHeight", "tuiDropdownMaxHeight", "tuiDropdownOffset"] }, { type: i2$1.TuiTextfieldCleanerDirective, selector: "[tuiTextfieldCleaner]", inputs: ["tuiTextfieldCleaner"] }, { type: i2$1.TuiTextfieldLabelOutsideDirective, selector: "[tuiTextfieldLabelOutside]", inputs: ["tuiTextfieldLabelOutside"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2$1.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$1.TuiPrimitiveTextfieldDirective, selector: "tui-primitive-textfield" }, { type: i2$1.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: TuiInputOpacityDirective, selector: "[tuiInputOpacity]", inputs: ["tuiInputOpacity"] }, { type: i1.TuiInputCountDirective, selector: "tui-input-count" }], pipes: { "tuiFilter": i6$1.TuiFilterPipe, "tuiStripOptionalPipe": TuiStripOptionalPipe, "tuiIsOptionalPipe": TuiIsOptionalPipe, "tuiShowContentTooltip": TuiShowContentTooltip, "tuiShowCleanerPipe": TuiShowCleanerPipe, "tuiInspectAny": TuiInspectPipe, "tuiGetOpacity": TuiGetOpacityPipe, "tuiGetColorPipe": TuiGetColorPipe, "tuiIsPrimitivePolymorpheusContentPipe": TuiIsPrimitivePolymorpheusContentPipe, "async": i4.AsyncPipe }, animations: [
707
+ trigger('emitEvent', [
708
+ transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
709
+ ]),
710
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
711
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationComponent, decorators: [{
712
+ type: Component,
713
+ args: [{
714
+ selector: 'tui-doc-documentation',
715
+ templateUrl: './documentation.template.html',
716
+ styleUrls: ['./documentation.style.less'],
717
+ changeDetection: ChangeDetectionStrategy.OnPush,
718
+ animations: [
719
+ trigger('emitEvent', [
720
+ transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
721
+ ]),
722
+ ],
723
+ providers: [TuiGetColorPipe, TuiGetOpacityPipe, TuiDestroyService],
724
+ }]
725
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef, decorators: [{
726
+ type: Inject,
727
+ args: [ChangeDetectorRef]
728
+ }] }, { type: undefined, decorators: [{
729
+ type: Inject,
730
+ args: [TUI_DOC_DOCUMENTATION_TEXTS]
731
+ }] }, { type: Set, decorators: [{
732
+ type: Inject,
733
+ args: [TUI_DOC_EXCLUDED_PROPERTIES]
734
+ }] }, { type: i6$1.TuiDestroyService, decorators: [{
735
+ type: Self
736
+ }, {
737
+ type: Inject,
738
+ args: [TuiDestroyService]
739
+ }] }, { type: TuiGetColorPipe, decorators: [{
740
+ type: Inject,
741
+ args: [TuiGetColorPipe]
742
+ }] }, { type: TuiGetOpacityPipe, decorators: [{
743
+ type: Inject,
744
+ args: [TuiGetOpacityPipe]
745
+ }] }]; }, propDecorators: { heading: [{
746
+ type: Input
747
+ }], showValues: [{
748
+ type: Input
749
+ }], isAPI: [{
750
+ type: Input
751
+ }], propertiesConnectors: [{
752
+ type: ContentChildren,
753
+ args: [TuiDocDocumentationPropertyConnectorDirective]
754
+ }] } });
755
+
756
+ class TuiInputOpacityModule {
757
+ }
758
+ TuiInputOpacityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
759
+ TuiInputOpacityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule, declarations: [TuiInputOpacityDirective], exports: [TuiInputOpacityDirective] });
760
+ TuiInputOpacityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule });
761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule, decorators: [{
762
+ type: NgModule,
763
+ args: [{
764
+ declarations: [TuiInputOpacityDirective],
765
+ exports: [TuiInputOpacityDirective],
766
+ }]
767
+ }] });
768
+
769
+ class TuiDocDocumentationModule {
770
+ }
771
+ TuiDocDocumentationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
772
+ TuiDocDocumentationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, declarations: [TuiInspectPipe,
773
+ TuiGetColorPipe,
774
+ TuiGetOpacityPipe,
775
+ TuiIsOptionalPipe,
776
+ TuiShowCleanerPipe,
777
+ TuiStripOptionalPipe,
778
+ TuiShowContentTooltip,
779
+ TuiDocDocumentationComponent,
780
+ TuiIsPrimitivePolymorpheusContentPipe,
781
+ TuiDocDocumentationPropertyConnectorDirective], imports: [CommonModule,
782
+ FormsModule,
783
+ RouterModule,
784
+ TuiBadgeModule,
785
+ TuiSelectModule,
786
+ TuiToggleModule,
787
+ TuiTooltipModule,
788
+ TuiLinkModule,
789
+ TuiInputCountModule,
790
+ TuiModeModule,
791
+ TuiGroupModule,
792
+ TuiInputOpacityModule,
793
+ TuiPrimitiveTextfieldModule,
794
+ TuiTextfieldControllerModule,
795
+ TuiDropdownModule,
796
+ TuiDataListModule,
797
+ TuiDataListWrapperModule,
798
+ TuiNotificationModule,
799
+ TuiFilterPipeModule], exports: [TuiDocDocumentationComponent,
800
+ TuiDocDocumentationPropertyConnectorDirective] });
801
+ TuiDocDocumentationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, imports: [[
802
+ CommonModule,
803
+ FormsModule,
804
+ RouterModule,
805
+ TuiBadgeModule,
806
+ TuiSelectModule,
807
+ TuiToggleModule,
808
+ TuiTooltipModule,
809
+ TuiLinkModule,
810
+ TuiInputCountModule,
811
+ TuiModeModule,
812
+ TuiGroupModule,
813
+ TuiInputOpacityModule,
814
+ TuiPrimitiveTextfieldModule,
815
+ TuiTextfieldControllerModule,
816
+ TuiDropdownModule,
817
+ TuiDataListModule,
818
+ TuiDataListWrapperModule,
819
+ TuiNotificationModule,
820
+ TuiFilterPipeModule,
821
+ ]] });
822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, decorators: [{
823
+ type: NgModule,
824
+ args: [{
825
+ imports: [
826
+ CommonModule,
827
+ FormsModule,
828
+ RouterModule,
829
+ TuiBadgeModule,
830
+ TuiSelectModule,
831
+ TuiToggleModule,
832
+ TuiTooltipModule,
833
+ TuiLinkModule,
834
+ TuiInputCountModule,
835
+ TuiModeModule,
836
+ TuiGroupModule,
837
+ TuiInputOpacityModule,
838
+ TuiPrimitiveTextfieldModule,
839
+ TuiTextfieldControllerModule,
840
+ TuiDropdownModule,
841
+ TuiDataListModule,
842
+ TuiDataListWrapperModule,
843
+ TuiNotificationModule,
844
+ TuiFilterPipeModule,
845
+ ],
846
+ declarations: [
847
+ TuiInspectPipe,
848
+ TuiGetColorPipe,
849
+ TuiGetOpacityPipe,
850
+ TuiIsOptionalPipe,
851
+ TuiShowCleanerPipe,
852
+ TuiStripOptionalPipe,
853
+ TuiShowContentTooltip,
854
+ TuiDocDocumentationComponent,
855
+ TuiIsPrimitivePolymorpheusContentPipe,
856
+ TuiDocDocumentationPropertyConnectorDirective,
857
+ ],
858
+ exports: [
859
+ TuiDocDocumentationComponent,
860
+ TuiDocDocumentationPropertyConnectorDirective,
861
+ ],
862
+ }]
863
+ }] });
864
+
865
+ const TUI_DOC_EXAMPLE_DEFAULT_OPTIONS = {
866
+ codeEditorVisibilityHandler: files => Boolean(files[TUI_EXAMPLE_PRIMARY_FILE_NAME.TS] &&
867
+ files[TUI_EXAMPLE_PRIMARY_FILE_NAME.HTML]),
868
+ tabTitles: new Map(),
869
+ };
870
+ /**
871
+ * Default parameters for DocExample component
872
+ */
873
+ const TUI_DOC_EXAMPLE_OPTIONS = new InjectionToken(`[TUI_DOC_EXAMPLE_OPTIONS]`, {
874
+ factory: () => TUI_DOC_EXAMPLE_DEFAULT_OPTIONS,
875
+ });
876
+ function tuiDocExampleOptionsProvider(options) {
877
+ return {
878
+ provide: TUI_DOC_EXAMPLE_OPTIONS,
879
+ useValue: Object.assign(Object.assign({}, TUI_DOC_EXAMPLE_DEFAULT_OPTIONS), options),
880
+ };
881
+ }
882
+
883
+ class TuiDocExampleCapitalizePipe {
884
+ transform(content) {
885
+ return tuiIsString(content) ? tuiCapitalizeFirstLetter(content) : content;
886
+ }
887
+ }
888
+ TuiDocExampleCapitalizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleCapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
889
+ TuiDocExampleCapitalizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleCapitalizePipe, name: "tuiDocExampleCapitalize" });
890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleCapitalizePipe, decorators: [{
891
+ type: Pipe,
892
+ args: [{ name: `tuiDocExampleCapitalize` }]
893
+ }] });
894
+
895
+ class TuiDocExampleGetTabsPipe {
896
+ transform(content, defaultTab) {
897
+ return [defaultTab, ...Object.keys(content)];
898
+ }
899
+ }
900
+ TuiDocExampleGetTabsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleGetTabsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
901
+ TuiDocExampleGetTabsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleGetTabsPipe, name: "tuiDocExampleGetTabs" });
902
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleGetTabsPipe, decorators: [{
903
+ type: Pipe,
904
+ args: [{ name: `tuiDocExampleGetTabs` }]
905
+ }] });
906
+
907
+ class TuiDocExampleComponent {
908
+ constructor(clipboard, alerts, location, copyTexts$, texts, codeEditor, processContent, isCypress, codeActions, router, route, ngLocation, options) {
909
+ this.clipboard = clipboard;
910
+ this.alerts = alerts;
911
+ this.location = location;
912
+ this.copyTexts$ = copyTexts$;
913
+ this.texts = texts;
914
+ this.codeEditor = codeEditor;
915
+ this.processContent = processContent;
916
+ this.isCypress = isCypress;
917
+ this.codeActions = codeActions;
918
+ this.router = router;
919
+ this.route = route;
920
+ this.ngLocation = ngLocation;
921
+ this.options = options;
922
+ this.rawLoader$$ = new BehaviorSubject({});
923
+ this.id = null;
924
+ this.componentName = this.location.pathname.slice(1);
925
+ this.defaultTabIndex = 0;
926
+ this.defaultTab = this.texts[this.defaultTabIndex];
927
+ this.activeItemIndex = this.defaultTabIndex;
928
+ this.copy$ = this.copyTexts$.pipe(map(([copy]) => copy));
929
+ this.processor$ = this.rawLoader$$.pipe(switchMap(tuiRawLoadRecord), map(value => this.processContent(value)));
930
+ this.loading$ = new Subject();
931
+ this.visible = (files) => Boolean(this.codeEditor && this.options.codeEditorVisibilityHandler(files));
932
+ }
933
+ set content(content) {
934
+ this.rawLoader$$.next(content);
935
+ }
936
+ getTabTitle(fileName) {
937
+ return this.options.tabTitles.get(fileName) || fileName;
938
+ }
939
+ copyExampleLink() {
940
+ const hashPosition = this.location.href.indexOf('#');
941
+ const currentUrl = hashPosition > -1
942
+ ? this.location.href.slice(0, Math.max(0, hashPosition))
943
+ : this.location.href;
944
+ const url = `${currentUrl}#${this.id}`;
945
+ this.setFragmentWithoutRedirect(this.id);
946
+ this.clipboard.copy(url);
947
+ this.alerts
948
+ .open(this.texts[1], {
949
+ label: this.texts[2],
950
+ status: "success" /* Success */,
951
+ })
952
+ .subscribe();
953
+ }
954
+ edit(files) {
955
+ var _a;
956
+ this.loading$.next(true);
957
+ (_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, this.id || '', files).then(() => this.loading$.next(false)).catch(() => this.loading$.next(false));
958
+ }
959
+ setFragmentWithoutRedirect(id) {
960
+ const url = this.router
961
+ .createUrlTree([], { relativeTo: this.route, fragment: id || '' })
962
+ .toString();
963
+ this.ngLocation.go(url);
964
+ }
965
+ }
966
+ TuiDocExampleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleComponent, deps: [{ token: Clipboard }, { token: TuiAlertService }, { token: LOCATION }, { token: TUI_COPY_TEXTS }, { token: TUI_DOC_EXAMPLE_TEXTS }, { token: TUI_DOC_CODE_EDITOR, optional: true }, { token: TUI_DOC_EXAMPLE_CONTENT_PROCESSOR }, { token: TUI_IS_CYPRESS }, { token: TUI_DOC_CODE_ACTIONS }, { token: Router }, { token: ActivatedRoute }, { token: Location$1 }, { token: TUI_DOC_EXAMPLE_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
967
+ TuiDocExampleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocExampleComponent, selector: "tui-doc-example", inputs: { id: "id", heading: "heading", description: "description", content: "content", componentName: "componentName" }, ngImport: i0, template: "<h3\n *ngIf=\"heading\"\n class=\"t-title\"\n>\n <span\n *polymorpheusOutlet=\"heading | tuiDocExampleCapitalize as text\"\n [textContent]=\"text\"\n ></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 class=\"t-description\"\n>\n <ng-container *polymorpheusOutlet=\"description | tuiDocExampleCapitalize as text\">\n {{ text }}\n </ng-container>\n</h4>\n\n<div\n *ngIf=\"processor$ | async as files\"\n class=\"t-example\"\n>\n <ng-container *ngIf=\"files | 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\n *tuiItem\n tuiTab\n >\n <ng-container *polymorpheusOutlet=\"getTabTitle(tab) as text\">\n {{ text }}\n </ng-container>\n </button>\n </ng-container>\n </tui-tabs-with-more>\n\n <tui-loader\n *ngIf=\"files | tuiMapper : visible\"\n size=\"xs\"\n [overlay]=\"true\"\n [showLoader]=\"!!(loading$ | async)\"\n (click)=\"edit(files)\"\n >\n <ng-container *ngIf=\"codeEditor?.content as content; else defaultEditContent\">\n <ng-container *polymorpheusOutlet=\"content as editContent\">\n {{ editContent }}\n </ng-container>\n </ng-container>\n\n <ng-template #defaultEditContent>\n <button\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n type=\"button\"\n >\n Edit on {{ codeEditor!.name }}\n </button>\n </ng-template>\n </tui-loader>\n </div>\n\n <div\n *ngFor=\"let tab of tabs; let index = index\"\n class=\"t-content\"\n [class.t-content_animated]=\"!isCypress\"\n [class.t-content_visible]=\"activeItemIndex === index\"\n >\n <ng-container\n *ngIf=\"index === defaultTabIndex; else anotherTab\"\n [ngTemplateOutlet]=\"preview\"\n ></ng-container>\n <ng-template #anotherTab>\n <ng-container\n [ngTemplateOutlet]=\"codeSection\"\n [ngTemplateOutletContext]=\"{$implicit: files[tabs[activeItemIndex]] || ''}\"\n ></ng-container>\n </ng-template>\n </div>\n </ng-container>\n</div>\n\n<ng-template #preview>\n <div\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n</ng-template>\n\n<ng-template\n #codeSection\n let-code\n>\n <section class=\"t-code-actions\">\n <ng-container *ngFor=\"let action of codeActions\">\n <ng-container *polymorpheusOutlet=\"action as text; context: {$implicit: code}\">\n {{ text }}\n </ng-container>\n </ng-container>\n <tui-doc-copy [cdkCopyToClipboard]=\"code\"></tui-doc-copy>\n </section>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n</ng-template>\n", styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}:host :host-context(tui-root._mobile){padding-top:2rem}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}:host-context(tui-root._mobile) .t-title{font:var(--tui-font-heading-6)}.t-description{font:var(--tui-font-text-m);font-weight:normal;margin:0}.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 #0000001a}:host-context(tui-root._mobile) .t-example{margin-top:.75rem}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}:host-context(tui-root._mobile) .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: .001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem 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)}}:host-context(tui-root._mobile) .t-demo{padding:1rem}.t-code-actions{position:absolute;top:4.375rem;right:1rem;display:flex;justify-content:flex-end;align-items:center}.t-code-actions>*{margin-left:.5rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}.t-content{will-change:opacity;height:0;visibility:hidden;opacity:0}.t-content_animated{transition:opacity .3s ease-in-out}.t-content_visible{height:auto;visibility:visible;opacity:1}\n"], components: [{ type: i2$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i1.TuiTabsWithMoreComponent, selector: "tui-tabs-with-more, nav[tuiTabsWithMore]", inputs: ["moreContent", "dropdownContent", "underline", "activeItemIndex", "itemsLimit"], outputs: ["activeItemIndexChange"] }, { type: i1.TuiTabComponent, selector: "a[tuiTab]:not([routerLink]), a[tuiTab][routerLink][routerLinkActive], button[tuiTab]" }, { type: i2$1.TuiLoaderComponent, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { type: TuiDocCopyComponent, selector: "tui-doc-copy" }, { type: TuiDocCodeComponent, selector: "tui-doc-code", inputs: ["filename", "code"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6$2.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6$1.TuiItemDirective, selector: "[tuiItem]" }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i8.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }], pipes: { "tuiDocExampleCapitalize": TuiDocExampleCapitalizePipe, "async": i4.AsyncPipe, "tuiDocExampleGetTabs": TuiDocExampleGetTabsPipe, "tuiMapper": i6$1.TuiMapperPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
968
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleComponent, decorators: [{
969
+ type: Component,
970
+ args: [{
971
+ selector: 'tui-doc-example',
972
+ templateUrl: './example.template.html',
973
+ styleUrls: ['./example.style.less'],
974
+ changeDetection: ChangeDetectionStrategy.OnPush,
975
+ }]
976
+ }], ctorParameters: function () { return [{ type: i8.Clipboard, decorators: [{
977
+ type: Inject,
978
+ args: [Clipboard]
979
+ }] }, { type: i2$1.TuiAlertService, decorators: [{
980
+ type: Inject,
981
+ args: [TuiAlertService]
982
+ }] }, { type: Location, decorators: [{
983
+ type: Inject,
984
+ args: [LOCATION]
985
+ }] }, { type: i9.Observable, decorators: [{
986
+ type: Inject,
987
+ args: [TUI_COPY_TEXTS]
988
+ }] }, { type: undefined, decorators: [{
989
+ type: Inject,
990
+ args: [TUI_DOC_EXAMPLE_TEXTS]
991
+ }] }, { type: undefined, decorators: [{
992
+ type: Optional
993
+ }, {
994
+ type: Inject,
995
+ args: [TUI_DOC_CODE_EDITOR]
996
+ }] }, { type: undefined, decorators: [{
997
+ type: Inject,
998
+ args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR]
999
+ }] }, { type: undefined, decorators: [{
1000
+ type: Inject,
1001
+ args: [TUI_IS_CYPRESS]
1002
+ }] }, { type: Array, decorators: [{
1003
+ type: Inject,
1004
+ args: [TUI_DOC_CODE_ACTIONS]
1005
+ }] }, { type: i6.Router, decorators: [{
1006
+ type: Inject,
1007
+ args: [Router]
1008
+ }] }, { type: i6.ActivatedRoute, decorators: [{
1009
+ type: Inject,
1010
+ args: [ActivatedRoute]
1011
+ }] }, { type: i4.Location, decorators: [{
1012
+ type: Inject,
1013
+ args: [Location$1]
1014
+ }] }, { type: undefined, decorators: [{
1015
+ type: Inject,
1016
+ args: [TUI_DOC_EXAMPLE_OPTIONS]
1017
+ }] }]; }, propDecorators: { id: [{
1018
+ type: Input
1019
+ }], heading: [{
1020
+ type: Input
1021
+ }], description: [{
1022
+ type: Input
1023
+ }], content: [{
1024
+ type: Input
1025
+ }], componentName: [{
1026
+ type: Input
1027
+ }] } });
1028
+
1029
+ class TuiDocExampleModule {
1030
+ }
1031
+ TuiDocExampleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1032
+ TuiDocExampleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, declarations: [TuiDocExampleComponent,
1033
+ TuiDocExampleGetTabsPipe,
1034
+ TuiDocExampleCapitalizePipe], imports: [CommonModule,
1035
+ ClipboardModule,
1036
+ TuiTabsModule,
1037
+ TuiButtonModule,
1038
+ TuiDocCopyModule,
1039
+ TuiDocCodeModule,
1040
+ PolymorpheusModule,
1041
+ TuiMapperPipeModule,
1042
+ TuiLoaderModule], exports: [TuiDocExampleComponent,
1043
+ TuiDocExampleGetTabsPipe,
1044
+ TuiDocExampleCapitalizePipe] });
1045
+ TuiDocExampleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, imports: [[
1046
+ CommonModule,
1047
+ ClipboardModule,
1048
+ TuiTabsModule,
1049
+ TuiButtonModule,
1050
+ TuiDocCopyModule,
1051
+ TuiDocCodeModule,
1052
+ PolymorpheusModule,
1053
+ TuiMapperPipeModule,
1054
+ TuiLoaderModule,
1055
+ ]] });
1056
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, decorators: [{
1057
+ type: NgModule,
1058
+ args: [{
1059
+ imports: [
1060
+ CommonModule,
1061
+ ClipboardModule,
1062
+ TuiTabsModule,
1063
+ TuiButtonModule,
1064
+ TuiDocCopyModule,
1065
+ TuiDocCodeModule,
1066
+ PolymorpheusModule,
1067
+ TuiMapperPipeModule,
1068
+ TuiLoaderModule,
1069
+ ],
1070
+ declarations: [
1071
+ TuiDocExampleComponent,
1072
+ TuiDocExampleGetTabsPipe,
1073
+ TuiDocExampleCapitalizePipe,
1074
+ ],
1075
+ exports: [
1076
+ TuiDocExampleComponent,
1077
+ TuiDocExampleGetTabsPipe,
1078
+ TuiDocExampleCapitalizePipe,
1079
+ ],
1080
+ }]
1081
+ }] });
1082
+
1083
+ /**
1084
+ * Page title
1085
+ */
1086
+ const NAVIGATION_TITLE = new InjectionToken(`[NAVIGATION_TITLE]`);
1087
+ /**
1088
+ * Navigation sections labels for search
1089
+ */
1090
+ const NAVIGATION_LABELS = new InjectionToken(`[NAVIGATION_LABELS]`);
1091
+ /**
1092
+ * Navigation pages
1093
+ */
1094
+ const NAVIGATION_ITEMS = new InjectionToken(`[NAVIGATION_ITEMS]`);
1095
+ const NAVIGATION_PROVIDERS = [
1096
+ TuiDestroyService,
1097
+ {
1098
+ provide: NAVIGATION_TITLE,
1099
+ deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
1100
+ useFactory: (router, activatedRoute, titlePrefix, destroy$) => {
1101
+ return router.events.pipe(filter(event => event instanceof NavigationEnd), map(() => activatedRoute.firstChild), filter(tuiIsPresent), mergeMap(({ data }) => data), map(({ title }) => `${titlePrefix}${title}`), takeUntil(destroy$));
1102
+ },
1103
+ },
1104
+ {
1105
+ provide: NAVIGATION_LABELS,
1106
+ deps: [TUI_DOC_PAGES],
1107
+ useFactory: labelsProviderFactory,
1108
+ },
1109
+ {
1110
+ provide: NAVIGATION_ITEMS,
1111
+ deps: [TUI_DOC_PAGES],
1112
+ useFactory: (pages) => {
1113
+ const labels = labelsProviderFactory(pages);
1114
+ return [
1115
+ ...labels.map(label => pages.filter(({ section }) => section === label)),
1116
+ pages.filter(page => !page.section),
1117
+ ];
1118
+ },
1119
+ },
1120
+ ];
1121
+ function labelsProviderFactory(pages) {
1122
+ return pages
1123
+ .map(({ section }) => section)
1124
+ .filter(tuiIsPresent)
1125
+ .filter((item, index, array) => array.indexOf(item) === index);
1126
+ }
1127
+
1128
+ class TuiDocNavigationComponent {
1129
+ constructor(cdr, titleService, title$, doc, mode, sidebar, labels, items, searchText, router, activatedRoute, destroy$, readyToScroll$, scrollBehavior) {
1130
+ this.doc = doc;
1131
+ this.mode = mode;
1132
+ this.sidebar = sidebar;
1133
+ this.labels = labels;
1134
+ this.items = items;
1135
+ this.searchText = searchText;
1136
+ this.router = router;
1137
+ this.activatedRoute = activatedRoute;
1138
+ this.destroy$ = destroy$;
1139
+ this.readyToScroll$ = readyToScroll$;
1140
+ this.scrollBehavior = scrollBehavior;
1141
+ this.menuOpen = false;
1142
+ this.openPagesArr = [];
1143
+ this.openPagesGroupsArr = [];
1144
+ this.active = '';
1145
+ this.search = new FormControl('');
1146
+ this.filtered$ = tuiControlValue(this.search).pipe(filter(search => search.length > 2), map(search => this.filterItems(this.flattenSubPages(this.items), search)));
1147
+ this.mode$ = this.mode.change$.pipe(startWith(null), map(() => this.mode.mode || 'onLight'));
1148
+ // Angular can't navigate no anchor links
1149
+ // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
1150
+ title$.subscribe(title => {
1151
+ cdr.markForCheck();
1152
+ titleService.setTitle(title);
1153
+ this.openActivePageGroup();
1154
+ this.handleAnchorLink(this.activatedRoute.snapshot.fragment || '');
1155
+ });
1156
+ }
1157
+ get canOpen() {
1158
+ var _a, _b;
1159
+ return ((_b = (_a = this.search.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 2;
1160
+ }
1161
+ get itemsWithoutSections() {
1162
+ return this.items[this.items.length - 1];
1163
+ }
1164
+ isActive(route) {
1165
+ return route === this.active;
1166
+ }
1167
+ onGroupClick(index) {
1168
+ this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
1169
+ }
1170
+ closeMenu() {
1171
+ this.menuOpen = false;
1172
+ }
1173
+ onClick(input) {
1174
+ input.open = false;
1175
+ this.menuOpen = false;
1176
+ this.search.setValue('');
1177
+ this.openActivePageGroup();
1178
+ }
1179
+ filterItems(items, search) {
1180
+ return items.map(section => tuiUniqBy(section.filter(({ title, keywords = '' }) => {
1181
+ title = title.toLowerCase();
1182
+ search = search.toLowerCase();
1183
+ keywords = keywords.toLowerCase();
1184
+ return (title.includes(search) ||
1185
+ keywords.includes(search) ||
1186
+ title.includes(tuiTransliterateKeyboardLayout(search)) ||
1187
+ keywords.includes(tuiTransliterateKeyboardLayout(search)) ||
1188
+ search.replace(/-/gi, '').includes(title));
1189
+ }), 'title'));
1190
+ }
1191
+ flattenSubPages(items) {
1192
+ return items.reduce((array, item) => [
1193
+ ...array,
1194
+ item.reduce((pages, page) => 'subPages' in page
1195
+ ? [...pages, ...page.subPages]
1196
+ : [...pages, page], []),
1197
+ ], []);
1198
+ }
1199
+ isActiveRoute(route) {
1200
+ return this.router.isActive(route, {
1201
+ paths: 'subset',
1202
+ queryParams: 'subset',
1203
+ fragment: 'ignored',
1204
+ matrixParams: 'ignored',
1205
+ });
1206
+ }
1207
+ handleAnchorLink(hash) {
1208
+ this.readyToScroll$
1209
+ .pipe(filter(Boolean), take(1), takeUntil(this.destroy$))
1210
+ .subscribe(() => this.navigateToAnchorLink(hash));
1211
+ }
1212
+ openActivePageGroup() {
1213
+ this.items.forEach((pages, pagesIndex) => {
1214
+ pages.forEach((page, pageIndex) => {
1215
+ if ('route' in page && this.isActiveRoute(page.route)) {
1216
+ this.openPagesArr[pagesIndex] = true;
1217
+ this.active = page.route;
1218
+ }
1219
+ if ('subPages' in page) {
1220
+ page.subPages.forEach(subPage => {
1221
+ if (this.isActiveRoute(subPage.route)) {
1222
+ this.openPagesArr[pagesIndex] = true;
1223
+ this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
1224
+ this.active = subPage.route;
1225
+ }
1226
+ });
1227
+ }
1228
+ });
1229
+ });
1230
+ }
1231
+ navigateToAnchorLink(fragment) {
1232
+ const nodes = fragment ? this.doc.querySelectorAll(`#${fragment}`) : [];
1233
+ const element = nodes.length && nodes[nodes.length - 1];
1234
+ if (!element) {
1235
+ return;
1236
+ }
1237
+ element.classList.add('tui-doc-animated-example');
1238
+ element.scrollIntoView({
1239
+ block: 'start',
1240
+ inline: 'nearest',
1241
+ behavior: this.scrollBehavior,
1242
+ });
1243
+ }
1244
+ }
1245
+ TuiDocNavigationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationComponent, deps: [{ token: ChangeDetectorRef }, { token: Title }, { token: NAVIGATION_TITLE }, { token: DOCUMENT }, { token: TuiModeDirective }, { token: TuiSidebarDirective, optional: true }, { token: NAVIGATION_LABELS }, { token: NAVIGATION_ITEMS }, { token: TUI_DOC_SEARCH_TEXT }, { token: Router }, { token: ActivatedRoute }, { token: TuiDestroyService, self: true }, { token: TUI_DOC_PAGE_LOADED }, { token: TUI_DOC_SCROLL_BEHAVIOR }], target: i0.ɵɵFactoryTarget.Component });
1246
+ TuiDocNavigationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocNavigationComponent, selector: "tui-doc-navigation", host: { properties: { "class._open": "this.menuOpen" } }, providers: NAVIGATION_PROVIDERS, ngImport: i0, template: "<tui-input\n #input\n tuiTextfieldSize=\"m\"\n tuiTextfieldIconLeft=\"tuiIconSearch\"\n class=\"t-input\"\n [formControl]=\"search\"\n [tuiAutoFocus]=\"!!sidebar\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n>\n {{ searchText }}\n <ng-container *ngIf=\"canOpen\">\n <tui-data-list *tuiDataList>\n <tui-opt-group\n *ngFor=\"let group of filtered$ | async; 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(input)\"\n >\n {{ item.title }}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-container>\n</tui-input>\n\n<nav class=\"t-navigation\">\n <tui-scrollbar\n class=\"t-scrollbar\"\n [tuiMode]=\"mode$ | async\"\n >\n <tui-accordion\n [closeOthers]=\"false\"\n [rounded]=\"false\"\n >\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=\"t-label\">\n <strong>{{ label }}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"t-section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n [ngTemplateOutlet]=\"pages\"\n [ngTemplateOutletContext]=\"{item: item, index: index * 100 + subIndex}\"\n ></ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"t-items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n [ngTemplateOutlet]=\"pages\"\n [ngTemplateOutletContext]=\"{item: item, index: items.length - 1 + index}\"\n ></ng-container>\n </div>\n\n <ng-template\n #pages\n let-item=\"item\"\n let-index=\"index\"\n >\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n routerLinkActive=\"t-sublink_active\"\n class=\"t-sublink\"\n [routerLink]=\"item.route\"\n [tuiScrollIntoViewLink]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{ item.title }}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"t-subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"t-sublink t-sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"t-chevron\"\n [class.t-chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{ item.title }}\n </button>\n <tui-expand\n class=\"t-expand\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"t-section t-section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n routerLinkActive=\"t-sublink_active\"\n class=\"t-sublink t-sublink_small\"\n [routerLink]=\"subPage.route\"\n [tuiScrollIntoViewLink]=\"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", styles: [":host{z-index:1;display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01)}.t-input{margin:1.25rem}.t-navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.t-scrollbar{scroll-behavior:smooth;width:100%}@media screen and (prefers-reduced-motion: reduce){.t-scrollbar{scroll-behavior:auto}}.t-items-container{display:flex;flex-direction:column;padding:0 1rem}.t-label{margin-left:.5rem}.t-expand{margin-left:.25rem}.t-section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.t-section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.t-subsection{margin-left:.5rem}.t-sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:1rem 0 0;border:0;background:none;font-size:inherit;line-height:inherit;font:var(--tui-font-text-m);margin-left:.5rem}.t-sublink_small{margin-left:1rem;line-height:1.5rem;padding-top:.5rem}.t-sublink_subsection{margin-left:0;line-height:1.6rem}.t-sublink_active{color:var(--tui-text-01)}.t-chevron{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.t-chevron_active{transform:rotate(90deg)}\n"], components: [{ type: i1.TuiInputComponent, selector: "tui-input" }, { type: i2$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["role", "emptyContent", "size"] }, { type: i2$1.TuiOptionComponent, selector: "button[tuiOption], a[tuiOption]", inputs: ["size", "role", "disabled", "value"] }, { type: i2$1.TuiScrollbarComponent, selector: "tui-scrollbar", inputs: ["hidden"] }, { type: i1.TuiAccordionComponent, selector: "tui-accordion", inputs: ["closeOthers", "rounded"] }, { type: i1.TuiAccordionItemComponent, selector: "tui-accordion-item", inputs: ["noPadding", "showArrow", "borders", "size", "disabled", "disableHover", "open", "async"], outputs: ["openChange"] }, { type: i2$1.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { type: i2$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2$1.TuiExpandComponent, selector: "tui-expand", inputs: ["async", "expanded"] }], directives: [{ type: i1.TuiInputDirective, selector: "tui-input" }, { type: i2$1.TuiTextfieldSizeDirective, selector: "[tuiTextfieldSize]", inputs: ["tuiTextfieldSize"] }, { type: i2$1.TuiTextfieldIconLeftDirective, selector: "[tuiTextfieldIconLeft]", inputs: ["tuiTextfieldIconLeft"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6$1.TuiAutoFocusDirective, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { type: i2$1.TuiTextfieldCleanerDirective, selector: "[tuiTextfieldCleaner]", inputs: ["tuiTextfieldCleaner"] }, { type: i2$1.TuiTextfieldLabelOutsideDirective, selector: "[tuiTextfieldLabelOutside]", inputs: ["tuiTextfieldLabelOutside"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.TuiOptGroupDirective, selector: "tui-opt-group", inputs: ["label"] }, { type: i6.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i2$1.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }, { type: i1.TuiAccordionItemContentDirective, selector: "ng-template[tuiAccordionItemContent]" }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], exportAs: ["routerLinkActive"] }, { type: i7.TuiScrollIntoViewLinkDirective, selector: "[tuiScrollIntoViewLink]", inputs: ["tuiScrollIntoViewLink"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1247
+ __decorate([
1248
+ tuiPure
1249
+ ], TuiDocNavigationComponent.prototype, "filterItems", null);
1250
+ __decorate([
1251
+ tuiPure
1252
+ ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
1253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationComponent, decorators: [{
1254
+ type: Component,
1255
+ args: [{
1256
+ selector: 'tui-doc-navigation',
1257
+ templateUrl: './navigation.template.html',
1258
+ styleUrls: ['./navigation.style.less'],
1259
+ providers: NAVIGATION_PROVIDERS,
1260
+ changeDetection: ChangeDetectionStrategy.OnPush,
1261
+ }]
1262
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef, decorators: [{
1263
+ type: Inject,
1264
+ args: [ChangeDetectorRef]
1265
+ }] }, { type: i8$1.Title, decorators: [{
1266
+ type: Inject,
1267
+ args: [Title]
1268
+ }] }, { type: i9.Observable, decorators: [{
1269
+ type: Inject,
1270
+ args: [NAVIGATION_TITLE]
1271
+ }] }, { type: Document, decorators: [{
1272
+ type: Inject,
1273
+ args: [DOCUMENT]
1274
+ }] }, { type: i2$1.TuiModeDirective, decorators: [{
1275
+ type: Inject,
1276
+ args: [TuiModeDirective]
1277
+ }] }, { type: undefined, decorators: [{
1278
+ type: Optional
1279
+ }, {
1280
+ type: Inject,
1281
+ args: [TuiSidebarDirective]
1282
+ }] }, { type: undefined, decorators: [{
1283
+ type: Inject,
1284
+ args: [NAVIGATION_LABELS]
1285
+ }] }, { type: undefined, decorators: [{
1286
+ type: Inject,
1287
+ args: [NAVIGATION_ITEMS]
1288
+ }] }, { type: undefined, decorators: [{
1289
+ type: Inject,
1290
+ args: [TUI_DOC_SEARCH_TEXT]
1291
+ }] }, { type: i6.Router, decorators: [{
1292
+ type: Inject,
1293
+ args: [Router]
1294
+ }] }, { type: i6.ActivatedRoute, decorators: [{
1295
+ type: Inject,
1296
+ args: [ActivatedRoute]
1297
+ }] }, { type: i9.Observable, decorators: [{
1298
+ type: Self
1299
+ }, {
1300
+ type: Inject,
1301
+ args: [TuiDestroyService]
1302
+ }] }, { type: i9.Observable, decorators: [{
1303
+ type: Inject,
1304
+ args: [TUI_DOC_PAGE_LOADED]
1305
+ }] }, { type: undefined, decorators: [{
1306
+ type: Inject,
1307
+ args: [TUI_DOC_SCROLL_BEHAVIOR]
1308
+ }] }]; }, propDecorators: { menuOpen: [{
1309
+ type: HostBinding,
1310
+ args: ['class._open']
1311
+ }], filterItems: [], flattenSubPages: [] } });
1312
+
1313
+ class TuiDocHeaderComponent {
1314
+ constructor(logo, menu, router, swipes$) {
1315
+ this.logo = logo;
1316
+ this.menu = menu;
1317
+ this.router = router;
1318
+ this.swipes$ = swipes$;
1319
+ this.stream$ = new Subject();
1320
+ this.open$ = merge(this.router.events.pipe(map(ALWAYS_FALSE_HANDLER)), this.stream$, this.swipes$.pipe(filter(swipe => swipe.direction === 'left' || swipe.direction === 'right'), map(swipe => swipe.direction === 'right'))).pipe(startWith(false), distinctUntilChanged());
1321
+ }
1322
+ onClick() {
1323
+ this.stream$.next(true);
1324
+ }
1325
+ onActiveZone(active) {
1326
+ if (!active) {
1327
+ this.stream$.next(false);
1328
+ }
1329
+ }
1330
+ }
1331
+ TuiDocHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderComponent, deps: [{ token: TUI_DOC_LOGO }, { token: TUI_DOC_MENU_TEXT }, { token: Router }, { token: TuiSwipeService }], target: i0.ɵɵFactoryTarget.Component });
1332
+ TuiDocHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocHeaderComponent, selector: "header[tuiDocHeader]", ngImport: i0, template: "<button\n tuiIconButton\n icon=\"tuiIconMenuLarge\"\n appearance=\"icon\"\n type=\"button\"\n class=\"t-menu\"\n [title]=\"menu\"\n (click)=\"onClick()\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-doc-navigation\n *tuiSidebar=\"!!(open$ | async)\"\n class=\"t-navigation\"\n ></tui-doc-navigation>\n</button>\n<div class=\"t-logo\">\n <img\n *polymorpheusOutlet=\"logo as src\"\n alt=\"Logo\"\n class=\"t-img\"\n [src]=\"src\"\n />\n</div>\n<ng-content></ng-content>\n", styles: [":host{box-shadow:0 .125rem 1rem #00000014;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)}.t-logo{margin-right:auto;font:var(--tui-font-heading-5)}.t-img{display:block}.t-menu{margin-left:-1.25rem}@media screen and (min-width: 48em){.t-menu{display:none}}.t-navigation{min-height:100%}\n"], components: [{ type: i2$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: TuiDocNavigationComponent, selector: "tui-doc-navigation" }], directives: [{ type: i6$1.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i4$1.TuiSidebarDirective, selector: "[tuiSidebar]", inputs: ["tuiSidebarDirection", "tuiSidebarAutoWidth", "tuiSidebar"] }, { type: i6$2.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderComponent, decorators: [{
1334
+ type: Component,
1335
+ args: [{
1336
+ selector: 'header[tuiDocHeader]',
1337
+ templateUrl: './header.template.html',
1338
+ styleUrls: ['./header.style.less'],
1339
+ changeDetection: ChangeDetectionStrategy.OnPush,
1340
+ }]
1341
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1342
+ type: Inject,
1343
+ args: [TUI_DOC_LOGO]
1344
+ }] }, { type: undefined, decorators: [{
1345
+ type: Inject,
1346
+ args: [TUI_DOC_MENU_TEXT]
1347
+ }] }, { type: i6.Router, decorators: [{
1348
+ type: Inject,
1349
+ args: [Router]
1350
+ }] }, { type: i6$1.TuiSwipeService, decorators: [{
1351
+ type: Inject,
1352
+ args: [TuiSwipeService]
1353
+ }] }]; } });
1354
+
1355
+ class TuiDocNavigationModule {
1356
+ }
1357
+ TuiDocNavigationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1358
+ TuiDocNavigationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, declarations: [TuiDocNavigationComponent], imports: [CommonModule,
1359
+ ReactiveFormsModule,
1360
+ RouterModule,
1361
+ PolymorpheusModule,
1362
+ TuiScrollIntoViewLinkModule,
1363
+ TuiButtonModule,
1364
+ TuiInputModule,
1365
+ TuiTextfieldControllerModule,
1366
+ TuiActiveZoneModule,
1367
+ TuiLetModule,
1368
+ TuiModeModule,
1369
+ TuiLinkModule,
1370
+ TuiExpandModule,
1371
+ TuiHostedDropdownModule,
1372
+ TuiDropdownModule,
1373
+ TuiAccordionModule,
1374
+ TuiScrollbarModule,
1375
+ TuiSvgModule,
1376
+ TuiDataListModule,
1377
+ TuiAutoFocusModule], exports: [TuiDocNavigationComponent] });
1378
+ TuiDocNavigationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, imports: [[
1379
+ CommonModule,
1380
+ ReactiveFormsModule,
1381
+ RouterModule,
1382
+ PolymorpheusModule,
1383
+ TuiScrollIntoViewLinkModule,
1384
+ TuiButtonModule,
1385
+ TuiInputModule,
1386
+ TuiTextfieldControllerModule,
1387
+ TuiActiveZoneModule,
1388
+ TuiLetModule,
1389
+ TuiModeModule,
1390
+ TuiLinkModule,
1391
+ TuiExpandModule,
1392
+ TuiHostedDropdownModule,
1393
+ TuiDropdownModule,
1394
+ TuiAccordionModule,
1395
+ TuiScrollbarModule,
1396
+ TuiSvgModule,
1397
+ TuiDataListModule,
1398
+ TuiAutoFocusModule,
1399
+ ]] });
1400
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, decorators: [{
1401
+ type: NgModule,
1402
+ args: [{
1403
+ imports: [
1404
+ CommonModule,
1405
+ ReactiveFormsModule,
1406
+ RouterModule,
1407
+ PolymorpheusModule,
1408
+ TuiScrollIntoViewLinkModule,
1409
+ TuiButtonModule,
1410
+ TuiInputModule,
1411
+ TuiTextfieldControllerModule,
1412
+ TuiActiveZoneModule,
1413
+ TuiLetModule,
1414
+ TuiModeModule,
1415
+ TuiLinkModule,
1416
+ TuiExpandModule,
1417
+ TuiHostedDropdownModule,
1418
+ TuiDropdownModule,
1419
+ TuiAccordionModule,
1420
+ TuiScrollbarModule,
1421
+ TuiSvgModule,
1422
+ TuiDataListModule,
1423
+ TuiAutoFocusModule,
1424
+ ],
1425
+ declarations: [TuiDocNavigationComponent],
1426
+ exports: [TuiDocNavigationComponent],
1427
+ }]
1428
+ }] });
1429
+
1430
+ class TuiDocHeaderModule {
1431
+ }
1432
+ TuiDocHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1433
+ TuiDocHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, declarations: [TuiDocHeaderComponent], imports: [CommonModule,
1434
+ PolymorpheusModule,
1435
+ TuiButtonModule,
1436
+ TuiSidebarModule,
1437
+ TuiActiveZoneModule,
1438
+ TuiDocNavigationModule], exports: [TuiDocHeaderComponent] });
1439
+ TuiDocHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, imports: [[
1440
+ CommonModule,
1441
+ PolymorpheusModule,
1442
+ TuiButtonModule,
1443
+ TuiSidebarModule,
1444
+ TuiActiveZoneModule,
1445
+ TuiDocNavigationModule,
1446
+ ]] });
1447
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, decorators: [{
1448
+ type: NgModule,
1449
+ args: [{
1450
+ imports: [
1451
+ CommonModule,
1452
+ PolymorpheusModule,
1453
+ TuiButtonModule,
1454
+ TuiSidebarModule,
1455
+ TuiActiveZoneModule,
1456
+ TuiDocNavigationModule,
1457
+ ],
1458
+ declarations: [TuiDocHeaderComponent],
1459
+ exports: [TuiDocHeaderComponent],
1460
+ }]
1461
+ }] });
1462
+
1463
+ class TuiDocSeeAlsoComponent {
1464
+ constructor(text, pages) {
1465
+ this.text = text;
1466
+ this.pages = pages;
1467
+ this.seeAlso = [];
1468
+ }
1469
+ getRouterLink(pageTitle) {
1470
+ var _a, _b;
1471
+ return (_b = (_a = this.pages.get(pageTitle)) === null || _a === void 0 ? void 0 : _a.route) !== null && _b !== void 0 ? _b : '';
1472
+ }
1473
+ }
1474
+ TuiDocSeeAlsoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoComponent, deps: [{ token: TUI_DOC_SEE_ALSO_TEXT }, { token: TUI_DOC_MAP_PAGES }], target: i0.ɵɵFactoryTarget.Component });
1475
+ TuiDocSeeAlsoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocSeeAlsoComponent, selector: "tui-doc-see-also", inputs: { seeAlso: "seeAlso" }, ngImport: i0, template: "<h5 class=\"t-header\">{{ text }}</h5>\n<ng-container *ngFor=\"let item of seeAlso; last as last\">\n <a\n tuiLink\n [routerLink]=\"getRouterLink(item)\"\n [innerText]=\"item\"\n ></a>\n <ng-container *ngIf=\"!last\">{{ ', ' }}</ng-container>\n</ng-container>\n", styles: [":host{display:block}.t-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}\n"], components: [{ type: i2$1.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoComponent, decorators: [{
1477
+ type: Component,
1478
+ args: [{
1479
+ selector: 'tui-doc-see-also',
1480
+ templateUrl: './see-also.template.html',
1481
+ styleUrls: ['./see-also.style.less'],
1482
+ changeDetection: ChangeDetectionStrategy.OnPush,
1483
+ }]
1484
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1485
+ type: Inject,
1486
+ args: [TUI_DOC_SEE_ALSO_TEXT]
1487
+ }] }, { type: Map, decorators: [{
1488
+ type: Inject,
1489
+ args: [TUI_DOC_MAP_PAGES]
1490
+ }] }]; }, propDecorators: { seeAlso: [{
1491
+ type: Input
1492
+ }] } });
1493
+
1494
+ class TuiDocSeeAlsoModule {
1495
+ }
1496
+ TuiDocSeeAlsoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1497
+ TuiDocSeeAlsoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, declarations: [TuiDocSeeAlsoComponent], imports: [CommonModule, RouterModule, TuiLinkModule], exports: [TuiDocSeeAlsoComponent] });
1498
+ TuiDocSeeAlsoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, imports: [[CommonModule, RouterModule, TuiLinkModule]] });
1499
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, decorators: [{
1500
+ type: NgModule,
1501
+ args: [{
1502
+ imports: [CommonModule, RouterModule, TuiLinkModule],
1503
+ declarations: [TuiDocSeeAlsoComponent],
1504
+ exports: [TuiDocSeeAlsoComponent],
1505
+ }]
1506
+ }] });
1507
+
1508
+ class TuiDocSourceCodeComponent {
1509
+ constructor(sourceCode, text) {
1510
+ this.sourceCode = sourceCode;
1511
+ this.text = text;
1512
+ this.header = '';
1513
+ this.package = '';
1514
+ this.type = '';
1515
+ this.path = '';
1516
+ }
1517
+ get pathOptions() {
1518
+ return this.getPathOptions(this.header, this.package, this.type, this.path);
1519
+ }
1520
+ getPathOptions(header, packageName, type, path) {
1521
+ return {
1522
+ header,
1523
+ package: packageName,
1524
+ type,
1525
+ path,
1526
+ };
1527
+ }
1528
+ }
1529
+ TuiDocSourceCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeComponent, deps: [{ token: TUI_DOC_SOURCE_CODE }, { token: TUI_DOC_SOURCE_CODE_TEXT }], target: i0.ɵɵFactoryTarget.Component });
1530
+ TuiDocSourceCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocSourceCodeComponent, selector: "tui-doc-source-code", inputs: { header: "header", package: "package", type: "type", path: "path" }, ngImport: i0, template: "<a\n *polymorpheusOutlet=\"sourceCode as link; context: pathOptions\"\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", components: [{ type: i2$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], directives: [{ type: i6$2.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1531
+ __decorate([
1532
+ tuiPure
1533
+ ], TuiDocSourceCodeComponent.prototype, "getPathOptions", null);
1534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeComponent, decorators: [{
1535
+ type: Component,
1536
+ args: [{
1537
+ selector: 'tui-doc-source-code',
1538
+ templateUrl: './source-code.template.html',
1539
+ changeDetection: ChangeDetectionStrategy.OnPush,
1540
+ }]
1541
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1542
+ type: Inject,
1543
+ args: [TUI_DOC_SOURCE_CODE]
1544
+ }] }, { type: undefined, decorators: [{
1545
+ type: Inject,
1546
+ args: [TUI_DOC_SOURCE_CODE_TEXT]
1547
+ }] }]; }, propDecorators: { header: [{
1548
+ type: Input
1549
+ }], package: [{
1550
+ type: Input
1551
+ }], type: [{
1552
+ type: Input
1553
+ }], path: [{
1554
+ type: Input
1555
+ }], getPathOptions: [] } });
1556
+
1557
+ class TuiDocSourceCodeModule {
1558
+ }
1559
+ TuiDocSourceCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1560
+ TuiDocSourceCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, declarations: [TuiDocSourceCodeComponent], imports: [CommonModule, PolymorpheusModule, TuiButtonModule], exports: [TuiDocSourceCodeComponent] });
1561
+ TuiDocSourceCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, imports: [[CommonModule, PolymorpheusModule, TuiButtonModule]] });
1562
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, decorators: [{
1563
+ type: NgModule,
1564
+ args: [{
1565
+ declarations: [TuiDocSourceCodeComponent],
1566
+ imports: [CommonModule, PolymorpheusModule, TuiButtonModule],
1567
+ exports: [TuiDocSourceCodeComponent],
1568
+ }]
1569
+ }] });
1570
+
1571
+ class TuiLanguageSwitcherComponent {
1572
+ constructor(switcher, flagPipe) {
1573
+ this.switcher = switcher;
1574
+ this.flagPipe = flagPipe;
1575
+ this.language = new FormControl(tuiCapitalizeFirstLetter(this.switcher.language));
1576
+ this.flags = new Map([
1577
+ ['chinese', TuiCountryIsoCode.CN],
1578
+ ['dutch', TuiCountryIsoCode.NL],
1579
+ ['english', TuiCountryIsoCode.GB],
1580
+ ['french', TuiCountryIsoCode.FR],
1581
+ ['german', TuiCountryIsoCode.DE],
1582
+ ['italian', TuiCountryIsoCode.IT],
1583
+ ['polish', TuiCountryIsoCode.PL],
1584
+ ['portuguese', TuiCountryIsoCode.PT],
1585
+ ['russian', TuiCountryIsoCode.RU],
1586
+ ['spanish', TuiCountryIsoCode.ES],
1587
+ ['turkish', TuiCountryIsoCode.TR],
1588
+ ['ukrainian', TuiCountryIsoCode.UA],
1589
+ ['vietnamese', TuiCountryIsoCode.VN],
1590
+ ]);
1591
+ this.names = Array.from(this.flags.keys());
1592
+ }
1593
+ /**
1594
+ * @deprecated use `<img [src]="countryIsoCode | tuiFlagPipe" />`
1595
+ * TODO drop in v4.0
1596
+ */
1597
+ getFlagPath(code) {
1598
+ return this.flagPipe.transform(code);
1599
+ }
1600
+ }
1601
+ TuiLanguageSwitcherComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherComponent, deps: [{ token: TuiLanguageSwitcher }, { token: TuiFlagPipe }], target: i0.ɵɵFactoryTarget.Component });
1602
+ TuiLanguageSwitcherComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiLanguageSwitcherComponent, selector: "tui-language-switcher", providers: [
1603
+ // TODO: for backward compatibility only. Drop in v4.0
1604
+ TuiFlagPipe,
1605
+ ], ngImport: i0, template: "<tui-select [formControl]=\"language\">\n <ng-content></ng-content>\n <tui-data-list *tuiDataList>\n <button\n *ngFor=\"let name of names\"\n tuiOption\n [value]=\"name | titlecase\"\n (click)=\"switcher.setLanguage(name)\"\n >\n <img\n alt=\"\"\n class=\"t-flag\"\n [src]=\"flags.get(name) | tuiFlag\"\n />\n {{ name | titlecase }}\n </button>\n </tui-data-list>\n</tui-select>\n", styles: [".t-flag{width:1.75rem;height:1.25rem;margin-right:.5rem}\n"], components: [{ type: i1.TuiSelectComponent, selector: "tui-select", inputs: ["stringify", "identityMatcher", "valueContent"] }, { type: i2$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["role", "emptyContent", "size"] }, { type: i2$1.TuiOptionComponent, selector: "button[tuiOption], a[tuiOption]", inputs: ["size", "role", "disabled", "value"] }], directives: [{ type: i1.TuiSelectDirective, selector: "tui-select" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2$1.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "titlecase": i4.TitleCasePipe, "tuiFlag": i2$1.TuiFlagPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherComponent, decorators: [{
1607
+ type: Component,
1608
+ args: [{
1609
+ selector: 'tui-language-switcher',
1610
+ templateUrl: './language-switcher.component.html',
1611
+ styleUrls: ['./language-switcher.component.less'],
1612
+ providers: [
1613
+ // TODO: for backward compatibility only. Drop in v4.0
1614
+ TuiFlagPipe,
1615
+ ],
1616
+ changeDetection: ChangeDetectionStrategy.OnPush,
1617
+ }]
1618
+ }], ctorParameters: function () { return [{ type: i5$1.TuiLanguageSwitcher, decorators: [{
1619
+ type: Inject,
1620
+ args: [TuiLanguageSwitcher]
1621
+ }] }, { type: i2$1.TuiFlagPipe, decorators: [{
1622
+ type: Inject,
1623
+ args: [TuiFlagPipe]
1624
+ }] }]; } });
1625
+
1626
+ class TuiLanguageSwitcherModule {
1627
+ }
1628
+ TuiLanguageSwitcherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1629
+ TuiLanguageSwitcherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, declarations: [TuiLanguageSwitcherComponent], imports: [CommonModule,
1630
+ TuiFlagPipeModule,
1631
+ TuiSelectModule,
1632
+ TuiDataListModule,
1633
+ ReactiveFormsModule], exports: [TuiLanguageSwitcherComponent] });
1634
+ TuiLanguageSwitcherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, imports: [[
1635
+ CommonModule,
1636
+ TuiFlagPipeModule,
1637
+ TuiSelectModule,
1638
+ TuiDataListModule,
1639
+ ReactiveFormsModule,
1640
+ ]] });
1641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, decorators: [{
1642
+ type: NgModule,
1643
+ args: [{
1644
+ exports: [TuiLanguageSwitcherComponent],
1645
+ declarations: [TuiLanguageSwitcherComponent],
1646
+ imports: [
1647
+ CommonModule,
1648
+ TuiFlagPipeModule,
1649
+ TuiSelectModule,
1650
+ TuiDataListModule,
1651
+ ReactiveFormsModule,
1652
+ ],
1653
+ }]
1654
+ }] });
1655
+
1656
+ class TuiDocMainComponent {
1657
+ constructor(theme, night) {
1658
+ this.theme = theme;
1659
+ this.night = night;
1660
+ this.change$ = this.night;
1661
+ this.night$ = this.change$.pipe(startWith(null), map(() => this.night.value), distinctUntilChanged(), share());
1662
+ }
1663
+ get mode() {
1664
+ return this.night.value ? 'onDark' : null;
1665
+ }
1666
+ }
1667
+ TuiDocMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainComponent, deps: [{ token: TuiThemeService }, { token: TuiThemeNightService }], target: i0.ɵɵFactoryTarget.Component });
1668
+ TuiDocMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocMainComponent, selector: "tui-doc-main", host: { properties: { "attr.data-mode": "this.mode" } }, providers: [
1669
+ {
1670
+ provide: TuiModeDirective,
1671
+ useExisting: forwardRef(() => TuiDocMainComponent),
1672
+ },
1673
+ TuiSwipeService,
1674
+ ], ngImport: i0, template: "<tui-theme-night *ngIf=\"theme.isDefaultTheme && night.useDefaultNightTheme && (night$ | async)\"></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 <ng-content select=\"tuiDocHeader\"></ng-content>\n <button\n tuiIconButton\n tuiMode=\"onLight\"\n appearance=\"secondary\"\n size=\"s\"\n shape=\"rounded\"\n type=\"button\"\n class=\"tui-doc-night-mode-switch\"\n [icon]=\"night.value ? 'tuiIconSunLarge' : 'tuiIconMoonLarge'\"\n (click)=\"night.toggle()\"\n ></button>\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=\"tuiOverAlerts\">\n <ng-content select=\"tuiOverAlerts\"></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", styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls>.t-bar_vertical{top:4rem!important}@keyframes tuiShaking{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-.3125rem)}20%,40%,60%,80%{transform:translate(.3125rem)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(pre code):not(.hljs):not([class*=\"language-\"]){transition-property:background;transition-duration:var(--tui-duration, .3s);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}button:focus code,a:focus code{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)}@media screen and (max-width: 47.9625em){tui-doc-navigation.tui-doc-navigation{display:none}}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width: 47.9625em){.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{animation:1s .3s tuiShaking}.tui-doc-night-mode-switch{margin-left:1rem}.tui-doc-night-mode-switch tui-svg{color:var(--tui-text-02)}tui-doc-code .hljs-tag{background:none}tui-doc-code .hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear)}tui-doc-code .hljs.hljs-line-numbers{background:transparent}tui-doc-code .hljs-subst,tui-doc-code .hljs-title{font-weight:normal;color:var(--tui-text-01)}tui-doc-code .hljs-comment,tui-doc-code .hljs-quote{color:var(--tui-text-03);font-style:italic}tui-doc-code .hljs-meta{color:#e38162}tui-doc-code .hljs-section,tui-doc-code .hljs-name,tui-doc-code .hljs-literal,tui-doc-code .hljs-keyword,tui-doc-code .hljs-selector-tag,tui-doc-code .hljs-type,tui-doc-code .hljs-selector-id,tui-doc-code .hljs-selector-class{font-weight:bold;color:var(--tui-link)}tui-doc-code .hljs-attribute,tui-doc-code .hljs-number,tui-doc-code .hljs-regexp,tui-doc-code .hljs-link{font-weight:bold;color:var(--tui-support-06)}tui-doc-code .hljs-number,tui-doc-code .hljs-regexp,tui-doc-code .hljs-link{font-weight:normal}tui-doc-code .hljs-string{color:var(--tui-positive);font-weight:bold}tui-doc-code .hljs-symbol,tui-doc-code .hljs-bullet,tui-doc-code .hljs-formula{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}tui-doc-code .hljs-doctag{text-decoration:underline}tui-doc-code .hljs-variable,tui-doc-code .hljs-template-variable{color:var(--tui-link-hover)}tui-doc-code [data-mode=onDark] .hljs-variable,tui-doc-code [data-mode=onDark] .hljs-template-variable{color:var(--tui-warning-fill)}tui-doc-code .hljs-addition{background:var(--tui-success-bg)}tui-doc-code .hljs-deletion{background:var(--tui-error-bg)}tui-doc-code .hljs-emphasis{font-style:italic}tui-doc-code .hljs-strong{font-weight:bold}tui-doc-code .hljs .hljs-line-numbers{padding:0}tui-doc-code .hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}\n"], components: [{ type: i2$1.TuiThemeNightComponent, selector: "tui-theme-night" }, { type: i2$1.TuiRootComponent, selector: "tui-root" }, { type: TuiDocNavigationComponent, selector: "tui-doc-navigation" }, { type: TuiDocHeaderComponent, selector: "header[tuiDocHeader]" }, { type: i2$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }, { type: i2$1.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
1675
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainComponent, decorators: [{
1676
+ type: Component,
1677
+ args: [{
1678
+ selector: 'tui-doc-main',
1679
+ templateUrl: './main.template.html',
1680
+ styleUrls: ['./main.style.less'],
1681
+ encapsulation: ViewEncapsulation.None,
1682
+ // @note: This one was default on purpose so we can test demo in default mode.
1683
+ // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
1684
+ changeDetection: ChangeDetectionStrategy.Default,
1685
+ providers: [
1686
+ {
1687
+ provide: TuiModeDirective,
1688
+ useExisting: forwardRef(() => TuiDocMainComponent),
1689
+ },
1690
+ TuiSwipeService,
1691
+ ],
1692
+ }]
1693
+ }], ctorParameters: function () { return [{ type: i6$3.TuiThemeService, decorators: [{
1694
+ type: Inject,
1695
+ args: [TuiThemeService]
1696
+ }] }, { type: i6$3.TuiThemeNightService, decorators: [{
1697
+ type: Inject,
1698
+ args: [TuiThemeNightService]
1699
+ }] }]; }, propDecorators: { mode: [{
1700
+ type: HostBinding,
1701
+ args: ['attr.data-mode']
1702
+ }] } });
1703
+
1704
+ class TuiDocMainModule {
1705
+ }
1706
+ TuiDocMainModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1707
+ TuiDocMainModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, declarations: [TuiDocMainComponent], imports: [CommonModule,
1708
+ RouterModule,
1709
+ TuiThemeNightModule,
1710
+ TuiDocHeaderModule,
1711
+ TuiRootModule,
1712
+ TuiDialogModule,
1713
+ TuiAlertModule,
1714
+ TuiButtonModule,
1715
+ TuiModeModule,
1716
+ TuiDocNavigationModule], exports: [TuiDocMainComponent] });
1717
+ TuiDocMainModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, imports: [[
1718
+ CommonModule,
1719
+ RouterModule,
1720
+ TuiThemeNightModule,
1721
+ TuiDocHeaderModule,
1722
+ TuiRootModule,
1723
+ TuiDialogModule,
1724
+ TuiAlertModule,
1725
+ TuiButtonModule,
1726
+ TuiModeModule,
1727
+ TuiDocNavigationModule,
1728
+ ]] });
1729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, decorators: [{
1730
+ type: NgModule,
1731
+ args: [{
1732
+ imports: [
1733
+ CommonModule,
1734
+ RouterModule,
1735
+ TuiThemeNightModule,
1736
+ TuiDocHeaderModule,
1737
+ TuiRootModule,
1738
+ TuiDialogModule,
1739
+ TuiAlertModule,
1740
+ TuiButtonModule,
1741
+ TuiModeModule,
1742
+ TuiDocNavigationModule,
1743
+ ],
1744
+ declarations: [TuiDocMainComponent],
1745
+ exports: [TuiDocMainComponent],
1746
+ }]
1747
+ }] });
1748
+
1749
+ /**
1750
+ * Array if related page titles
1751
+ */
1752
+ const PAGE_SEE_ALSO = new InjectionToken(`[PAGE_SEE_ALSO]`);
1753
+ const PAGE_PROVIDERS = [
1754
+ {
1755
+ provide: PAGE_SEE_ALSO,
1756
+ deps: [ElementRef, TUI_DOC_SEE_ALSO],
1757
+ useFactory: ({ nativeElement }, seeAlsoGroups) => {
1758
+ const currentHeader = nativeElement.getAttribute(`header`);
1759
+ const groups = seeAlsoGroups.filter(group => group.includes(currentHeader)) || [];
1760
+ const seeAlsoSet = new Set(groups
1761
+ .join()
1762
+ .split(`,`)
1763
+ .filter(component => component && component !== currentHeader));
1764
+ return Array.from(seeAlsoSet);
1765
+ },
1766
+ },
1767
+ ];
1768
+
1769
+ class TuiDocPageTabConnectorDirective {
1770
+ constructor(template) {
1771
+ this.template = template;
1772
+ }
1773
+ }
1774
+ TuiDocPageTabConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageTabConnectorDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1775
+ TuiDocPageTabConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocPageTabConnectorDirective, selector: "[pageTab]", inputs: { pageTab: "pageTab" }, ngImport: i0 });
1776
+ __decorate([
1777
+ tuiDefaultProp()
1778
+ ], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
1779
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageTabConnectorDirective, decorators: [{
1780
+ type: Directive,
1781
+ args: [{
1782
+ selector: '[pageTab]',
1783
+ }]
1784
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1785
+ type: Inject,
1786
+ args: [TemplateRef]
1787
+ }] }]; }, propDecorators: { pageTab: [{
1788
+ type: Input
1789
+ }] } });
1790
+
1791
+ class TuiDocPageComponent {
1792
+ constructor(defaultTabs, seeAlso) {
1793
+ this.defaultTabs = defaultTabs;
1794
+ this.seeAlso = seeAlso;
1795
+ this.header = '';
1796
+ this.package = '';
1797
+ this.type = '';
1798
+ this.path = '';
1799
+ this.deprecated = false;
1800
+ this.tabConnectors = EMPTY_QUERY;
1801
+ this.activeItemIndex = 0;
1802
+ this.from = / /g;
1803
+ this.to = '_';
1804
+ }
1805
+ get showSeeAlso() {
1806
+ return !!this.seeAlso.length && this.activeItemIndex === 0;
1807
+ }
1808
+ }
1809
+ TuiDocPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageComponent, deps: [{ token: TUI_DOC_DEFAULT_TABS }, { token: PAGE_SEE_ALSO }], target: i0.ɵɵFactoryTarget.Component });
1810
+ TuiDocPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocPageComponent, selector: "tui-doc-page", inputs: { header: "header", package: "package", type: "type", path: "path", deprecated: "deprecated" }, providers: PAGE_PROVIDERS, queries: [{ propertyName: "tabConnectors", predicate: TuiDocPageTabConnectorDirective }], ngImport: i0, template: "<header class=\"t-header\">\n <h1 class=\"t-title\">\n {{ header }}\n <tui-tag\n *ngIf=\"!!deprecated || deprecated === ''\"\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 *ngFor=\"let tab of tabConnectors; first as first; index as index\">\n <ng-container *ngIf=\"tab.pageTab || defaultTabs[index] as tabName\">\n <a\n *tuiItem\n tuiTab\n routerLinkActive\n [routerLinkActiveOptions]=\"{exact: first}\"\n [routerLink]=\"first ? './' : (tabName | tuiReplace : from : to)\"\n >\n {{ tabName }}\n </a>\n </ng-container>\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\n *ngIf=\"index === activeItemIndex\"\n [ngTemplateOutlet]=\"tab.template\"\n ></ng-container>\n </ng-container>\n</div>\n", 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)}:host-context(tui-root._mobile) .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}:host-context(tui-root._mobile) .t-tabs{margin-top:.25rem}.t-content{padding:2rem 0;margin:0 min(10vw,8.75rem)}:host-context(tui-root._mobile) .t-content{padding:2rem 1.25rem;margin:0}.t-see-also{min-width:18.75rem;width:30%;float:right;margin-left:1.5rem}:host-context(tui-root._mobile) .t-see-also{float:none;width:100%;margin:0 0 1.5rem}.t-source-code{align-self:flex-end;line-height:2.75rem;margin-left:auto}\n"], components: [{ type: i1.TuiTagComponent, selector: "tui-tag, a[tuiTag], button[tuiTag]", inputs: ["value", "editable", "separator", "maxLength", "size", "showLoader", "status", "hoverable", "removable", "disabled", "autoColor", "leftContent"], outputs: ["edited"] }, { type: i1.TuiTabsWithMoreComponent, selector: "tui-tabs-with-more, nav[tuiTabsWithMore]", inputs: ["moreContent", "dropdownContent", "underline", "activeItemIndex", "itemsLimit"], outputs: ["activeItemIndexChange"] }, { type: i1.TuiTabComponent, selector: "a[tuiTab]:not([routerLink]), a[tuiTab][routerLink][routerLinkActive], button[tuiTab]" }, { type: TuiDocSourceCodeComponent, selector: "tui-doc-source-code", inputs: ["header", "package", "type", "path"] }, { type: TuiDocSeeAlsoComponent, selector: "tui-doc-see-also", inputs: ["seeAlso"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6$1.TuiItemDirective, selector: "[tuiItem]" }, { type: i6.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i6.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], exportAs: ["routerLinkActive"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "tuiReplace": i6$1.TuiReplacePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1811
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageComponent, decorators: [{
1812
+ type: Component,
1813
+ args: [{
1814
+ selector: 'tui-doc-page',
1815
+ templateUrl: './page.template.html',
1816
+ styleUrls: ['./page.style.less'],
1817
+ changeDetection: ChangeDetectionStrategy.OnPush,
1818
+ providers: PAGE_PROVIDERS,
1819
+ }]
1820
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1821
+ type: Inject,
1822
+ args: [TUI_DOC_DEFAULT_TABS]
1823
+ }] }, { type: undefined, decorators: [{
1824
+ type: Inject,
1825
+ args: [PAGE_SEE_ALSO]
1826
+ }] }]; }, propDecorators: { header: [{
1827
+ type: Input
1828
+ }], package: [{
1829
+ type: Input
1830
+ }], type: [{
1831
+ type: Input
1832
+ }], path: [{
1833
+ type: Input
1834
+ }], deprecated: [{
1835
+ type: Input
1836
+ }], tabConnectors: [{
1837
+ type: ContentChildren,
1838
+ args: [TuiDocPageTabConnectorDirective]
1839
+ }] } });
1840
+
1841
+ class TuiDocPageModule {
1842
+ }
1843
+ TuiDocPageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1844
+ TuiDocPageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, declarations: [TuiDocPageComponent, TuiDocPageTabConnectorDirective], imports: [CommonModule,
1845
+ RouterModule,
1846
+ TuiDocSeeAlsoModule,
1847
+ TuiTabsModule,
1848
+ TuiTagModule,
1849
+ TuiDocSourceCodeModule,
1850
+ TuiReplacePipeModule], exports: [TuiDocPageComponent, TuiDocPageTabConnectorDirective] });
1851
+ TuiDocPageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, imports: [[
1852
+ CommonModule,
1853
+ RouterModule,
1854
+ TuiDocSeeAlsoModule,
1855
+ TuiTabsModule,
1856
+ TuiTagModule,
1857
+ TuiDocSourceCodeModule,
1858
+ TuiReplacePipeModule,
1859
+ ]] });
1860
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, decorators: [{
1861
+ type: NgModule,
1862
+ args: [{
1863
+ imports: [
1864
+ CommonModule,
1865
+ RouterModule,
1866
+ TuiDocSeeAlsoModule,
1867
+ TuiTabsModule,
1868
+ TuiTagModule,
1869
+ TuiDocSourceCodeModule,
1870
+ TuiReplacePipeModule,
1871
+ ],
1872
+ declarations: [TuiDocPageComponent, TuiDocPageTabConnectorDirective],
1873
+ exports: [TuiDocPageComponent, TuiDocPageTabConnectorDirective],
1874
+ }]
1875
+ }] });
1876
+
1877
+ /**
1878
+ * Generated bundle index. Do not edit.
1879
+ */
1880
+
1881
+ export { PAGE_PROVIDERS, PAGE_SEE_ALSO, TUI_DOC_EXAMPLE_DEFAULT_OPTIONS, TUI_DOC_EXAMPLE_OPTIONS, TuiDocCodeComponent, TuiDocCodeModule, TuiDocCopyComponent, TuiDocCopyModule, TuiDocDemoComponent, TuiDocDemoModule, TuiDocDocumentationComponent, TuiDocDocumentationModule, TuiDocDocumentationPropertyConnectorDirective, TuiDocExampleCapitalizePipe, TuiDocExampleComponent, TuiDocExampleGetTabsPipe, TuiDocExampleModule, TuiDocHeaderComponent, TuiDocHeaderModule, TuiDocMainComponent, TuiDocMainModule, TuiDocNavigationComponent, TuiDocNavigationModule, TuiDocPageComponent, TuiDocPageModule, TuiDocPageTabConnectorDirective, TuiDocSeeAlsoComponent, TuiDocSeeAlsoModule, TuiDocSourceCodeComponent, TuiDocSourceCodeModule, TuiGetColorPipe, TuiGetOpacityPipe, TuiInputOpacityDirective, TuiInputOpacityModule, TuiInspectPipe, TuiIsOptionalPipe, TuiIsPrimitivePolymorpheusContentPipe, TuiLanguageSwitcherComponent, TuiLanguageSwitcherModule, TuiShowCleanerPipe, TuiShowContentTooltip, TuiStripOptionalPipe, tuiDocExampleOptionsProvider };
1882
+ //# sourceMappingURL=taiga-ui-addon-doc-components.js.map