@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
@@ -1,2393 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Input, HostBinding, NgModule, ElementRef, forwardRef, TemplateRef, ViewChild, ContentChild, HostListener, EventEmitter, Directive, Output, Pipe, Renderer2, ChangeDetectorRef, Self, ContentChildren, Optional, Injectable, inject, ViewEncapsulation } from '@angular/core';
3
- import * as i9 from 'rxjs';
4
- import { identity, BehaviorSubject, Subject, timer, merge, defer, of, ReplaySubject } from 'rxjs';
5
- import { switchMap, map, startWith, takeUntil, filter, mergeMap, debounceTime, take, distinctUntilChanged, share } from 'rxjs/operators';
6
- import MarkdownIt from 'markdown-it';
7
- import { __awaiter, __decorate } from 'tslib';
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 * as i6$1 from '@taiga-ui/cdk';
13
- import { ALWAYS_FALSE_HANDLER, TuiDestroyService, tuiPure, tuiToInteger, tuiClamp, tuiPx, tuiCleanObject, TUI_IS_MOBILE, TuiResizeableDirective, TuiResizerModule, tuiIsNumber, tuiRgbToHex, TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_CYPRESS, tuiIsString, EMPTY_QUERY, tuiQueryListChanges, tuiWatch, tuiHexToRgb, TuiFilterPipeModule, TuiMapperPipeModule, tuiIsPresent, tuiGetElementObscures, tuiControlValue, tuiUniqBy, TuiSwipeService, TuiActiveZoneModule, TuiLetModule, TuiAutoFocusModule, tuiDefaultProp, TuiReplacePipeModule } from '@taiga-ui/cdk';
14
- import * as i1 from '@taiga-ui/kit';
15
- import { TUI_COPY_TEXTS, TuiSelectModule, TuiRadioBlockModule, TuiCheckboxLabeledModule, TuiDataListWrapperModule, TuiBadgeModule, TuiToggleModule, TuiInputCountModule, TuiTabsModule, TuiInputModule, TuiAccordionModule, TuiTagModule } from '@taiga-ui/kit';
16
- import * as i2$1 from '@taiga-ui/core';
17
- import { TuiButtonModule, TuiModeDirective, TuiLinkModule, TuiExpandModule, TuiGroupModule, TuiTooltipModule, TuiModeModule, TuiSvgModule, TuiDataListModule, TuiTextfieldControllerModule, TuiHintModule, TuiPrimitiveTextfieldModule, TuiDropdownModule, TuiNotificationModule, tuiCapitalizeFirstLetter, TuiAlertService, TuiLoaderModule, TuiFlagPipe, TuiFlagPipeModule, TuiHostedDropdownModule, TuiScrollbarModule, TuiThemeNightModule, TuiRootModule, TuiDialogModule, TuiAlertModule } from '@taiga-ui/core';
18
- import * as i5 from '@angular/forms';
19
- import { FormGroup, ReactiveFormsModule, FormsModule, FormControl } from '@angular/forms';
20
- import * as i6 from '@angular/router';
21
- import { UrlSerializer, RouterModule, ActivatedRoute, Router, NavigationEnd } from '@angular/router';
22
- import { trigger, transition, style, animate } from '@angular/animations';
23
- import * as i8 from '@angular/cdk/clipboard';
24
- import { Clipboard, ClipboardModule } from '@angular/cdk/clipboard';
25
- import { LOCATION, LOCAL_STORAGE, WINDOW } from '@ng-web-apis/common';
26
- import * as i6$2 from '@tinkoff/ng-polymorpheus';
27
- import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
28
- import * as i5$1 from '@taiga-ui/i18n';
29
- import { TuiCountryIsoCode, TuiLanguageSwitcher } from '@taiga-ui/i18n';
30
- import { ALWAYS_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
31
- import * as i8$1 from '@angular/platform-browser';
32
- import { Title } from '@angular/platform-browser';
33
- import * as i4$1 from '@taiga-ui/addon-mobile';
34
- import { TuiSidebarDirective, TuiSidebarModule } from '@taiga-ui/addon-mobile';
35
-
36
- function tuiTryParseMarkdownCodeBlock(text = ``) {
37
- const tokens = new MarkdownIt().parse(text, {});
38
- const result = tokens
39
- .filter(({ tag, type }) => tag === `code` && type === `fence`)
40
- .map(({ content }) => content);
41
- return result.length ? result : [text];
42
- }
43
-
44
- /**
45
- * Processes content in example
46
- */
47
- const TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new InjectionToken(`[TUI_DOC_EXAMPLE_CONTENT_PROCESSOR]`, {
48
- factory: () => identity,
49
- });
50
- /**
51
- * Processes markdown in code block
52
- */
53
- const TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR = new InjectionToken(`[TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR]`, {
54
- factory: () => tuiTryParseMarkdownCodeBlock,
55
- });
56
-
57
- function tuiRawLoad(content) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- return content instanceof Promise ? (yield content).default : content;
60
- });
61
- }
62
-
63
- class TuiDocCodeComponent {
64
- constructor(markdownCodeProcessor) {
65
- this.markdownCodeProcessor = markdownCodeProcessor;
66
- this.rawLoader$$ = new BehaviorSubject('');
67
- this.filename = '';
68
- this.processor$ = this.rawLoader$$.pipe(switchMap(tuiRawLoad), map((value) => this.markdownCodeProcessor(value)));
69
- }
70
- set code(code) {
71
- this.rawLoader$$.next(code);
72
- }
73
- get hasFilename() {
74
- return !!this.filename;
75
- }
76
- }
77
- 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 });
78
- 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 });
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeComponent, decorators: [{
80
- type: Component,
81
- args: [{
82
- selector: 'tui-doc-code',
83
- templateUrl: './code.template.html',
84
- styleUrls: ['./code.style.less'],
85
- changeDetection: ChangeDetectionStrategy.OnPush,
86
- }]
87
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
88
- type: Inject,
89
- args: [TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR]
90
- }] }]; }, propDecorators: { filename: [{
91
- type: Input
92
- }], code: [{
93
- type: Input
94
- }], hasFilename: [{
95
- type: HostBinding,
96
- args: ['class._has-filename']
97
- }] } });
98
-
99
- class TuiDocCodeModule {
100
- }
101
- TuiDocCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
102
- TuiDocCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, declarations: [TuiDocCodeComponent], imports: [CommonModule, HighlightModule], exports: [TuiDocCodeComponent] });
103
- TuiDocCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, imports: [[CommonModule, HighlightModule]] });
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCodeModule, decorators: [{
105
- type: NgModule,
106
- args: [{
107
- imports: [CommonModule, HighlightModule],
108
- declarations: [TuiDocCodeComponent],
109
- exports: [TuiDocCodeComponent],
110
- }]
111
- }] });
112
-
113
- const COPIED_TIMEOUT = 1500;
114
- class TuiDocCopyComponent {
115
- constructor(texts$) {
116
- this.texts$ = texts$;
117
- this.copy$ = new Subject();
118
- }
119
- get copied$() {
120
- return this.copy$.pipe(switchMap(() => timer(COPIED_TIMEOUT).pipe(map(ALWAYS_FALSE_HANDLER), startWith(true))));
121
- }
122
- onClick() {
123
- this.copy$.next();
124
- }
125
- }
126
- 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 });
127
- 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 });
128
- __decorate([
129
- tuiPure
130
- ], TuiDocCopyComponent.prototype, "copied$", null);
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyComponent, decorators: [{
132
- type: Component,
133
- args: [{
134
- selector: 'tui-doc-copy',
135
- templateUrl: './copy.template.html',
136
- styleUrls: ['./copy.style.less'],
137
- changeDetection: ChangeDetectionStrategy.OnPush,
138
- providers: [TuiDestroyService],
139
- }]
140
- }], ctorParameters: function () { return [{ type: i9.Observable, decorators: [{
141
- type: Inject,
142
- args: [TUI_COPY_TEXTS]
143
- }] }]; }, propDecorators: { copied$: [] } });
144
-
145
- class TuiDocCopyModule {
146
- }
147
- TuiDocCopyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
148
- TuiDocCopyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, declarations: [TuiDocCopyComponent], imports: [CommonModule, TuiButtonModule], exports: [TuiDocCopyComponent] });
149
- TuiDocCopyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, imports: [[CommonModule, TuiButtonModule]] });
150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocCopyModule, decorators: [{
151
- type: NgModule,
152
- args: [{
153
- imports: [CommonModule, TuiButtonModule],
154
- declarations: [TuiDocCopyComponent],
155
- exports: [TuiDocCopyComponent],
156
- }]
157
- }] });
158
-
159
- /**
160
- * TODO: think about reorganization in @taiga-ui/i18n way
161
- */
162
- /**
163
- * tui-doc-demo i18n texts
164
- * Works with a tuple
165
- * [@string tuiMode tooltip content, @string word 'background', @string 'form value']
166
- */
167
- const TUI_DOC_DEMO_TEXTS = new InjectionToken(`[TUI_DOC_DEMO_TEXTS]`, {
168
- factory: () => [`Read more more about modes: `, `Background`, `Form value`],
169
- });
170
- /**
171
- * tui-doc-documentation i18n texts
172
- * Works with a tuple
173
- * [
174
- * @string word 'argument',
175
- * @string word 'type',
176
- * @string 'name and description',
177
- * @string word 'value'
178
- * @string message for tooltip about ng-polymorpheus
179
- * ]
180
- */
181
- const TUI_DOC_DOCUMENTATION_TEXTS = new InjectionToken(`[TUI_DOC_DOCUMENTATION_TEXTS]`, {
182
- factory: () => [
183
- `Argument`,
184
- `Type`,
185
- `Name and description`,
186
- `Value`,
187
- `Learn about our dynamic templates from `,
188
- ],
189
- });
190
- /**
191
- * tui-doc-example i18n texts
192
- * Works with a tuple
193
- * [
194
- * @string default tab name,
195
- * @string link to a sample copied message text,
196
- * @string link to a sample copied message label
197
- * ]
198
- */
199
- const TUI_DOC_EXAMPLE_TEXTS = new InjectionToken(`[TUI_DOC_EXAMPLE_TEXTS]`, {
200
- factory: () => [`Preview`, `Link to a sample was successfully copied`, `Done`],
201
- });
202
- const TUI_DOC_MENU_TEXT = new InjectionToken(`[TUI_DOC_MENU_TEXT]`, {
203
- factory: () => `Menu`,
204
- });
205
- const TUI_DOC_SEARCH_TEXT = new InjectionToken(`[TUI_DOC_SEARCH_TEXT]`, {
206
- factory: () => `Search`,
207
- });
208
- const TUI_DOC_SEE_ALSO_TEXT = new InjectionToken(`[TUI_DOC_SEE_ALSO_TEXT]`, {
209
- factory: () => `See also`,
210
- });
211
- const TUI_DOC_SOURCE_CODE_TEXT = new InjectionToken(`[TUI_DOC_SOURCE_CODE_TEXT]`, {
212
- factory: () => `Source code`,
213
- });
214
-
215
- const TUI_DOC_URL_STATE_HANDLER = new InjectionToken(`[TUI_DOC_URL_STATE_HANDLER]`, {
216
- factory: () => String,
217
- });
218
-
219
- function tuiCoerceValueIsTrue(value) {
220
- return (value === null || value === void 0 ? void 0 : value.toString()) === `true`;
221
- }
222
-
223
- const MIN_WIDTH = 160;
224
- class TuiDocDemoComponent {
225
- constructor(isMobile, el, locationRef, urlSerializer, texts, urlStateHandler) {
226
- var _a, _b;
227
- this.isMobile = isMobile;
228
- this.el = el;
229
- this.locationRef = locationRef;
230
- this.urlSerializer = urlSerializer;
231
- this.texts = texts;
232
- this.urlStateHandler = urlStateHandler;
233
- this.control = null;
234
- this.template = null;
235
- this.updateOnVariants = ['change', 'blur', 'submit'];
236
- this.updateOn = this.params.updateOn || this.updateOnVariants[0];
237
- this.opaque = tuiCoerceValueIsTrue((_a = this.params.sandboxOpaque) !== null && _a !== void 0 ? _a : true);
238
- this.expanded = tuiCoerceValueIsTrue((_b = this.params.sandboxExpanded) !== null && _b !== void 0 ? _b : false);
239
- this.mode = this.params.tuiMode || null;
240
- this.sandboxWidth = tuiToInteger(this.params.sandboxWidth);
241
- this.change$ = new Subject();
242
- this.items = ['onLight', 'onDark'];
243
- }
244
- onResize() {
245
- this.updateWidth();
246
- this.onMouseUp();
247
- }
248
- onMouseUp() {
249
- this.updateUrl({ sandboxWidth: this.sandboxWidth });
250
- }
251
- ngOnInit() {
252
- this.createForm();
253
- this.updateWidth(this.sandboxWidth + this.delta);
254
- }
255
- onModeChange(mode) {
256
- this.mode = mode;
257
- this.updateUrl({ sandboxWidth: this.sandboxWidth });
258
- this.change$.next();
259
- }
260
- toggleDetails() {
261
- this.expanded = !this.expanded;
262
- this.updateUrl({ sandboxExpanded: this.expanded });
263
- }
264
- changeOpaque(opaque) {
265
- this.opaque = opaque;
266
- this.updateUrl({ sandboxOpaque: this.opaque });
267
- }
268
- updateOnChange(updateOn) {
269
- this.updateOn = updateOn;
270
- this.updateUrl({ updateOn });
271
- this.createForm();
272
- }
273
- updateWidth(width = NaN) {
274
- if (!this.resizer || !this.resizeable || !this.content) {
275
- return;
276
- }
277
- const safe = width || this.resizeable.nativeElement.clientWidth;
278
- const total = this.el.nativeElement.clientWidth;
279
- const clamped = Math.round(tuiClamp(safe, MIN_WIDTH, total)) - this.delta;
280
- const validated = safe < total ? clamped : NaN;
281
- this.resizer.nativeElement.textContent = String(clamped || '-');
282
- this.resizeable.nativeElement.style.width = validated ? tuiPx(safe) : '';
283
- this.sandboxWidth = validated;
284
- }
285
- get delta() {
286
- return this.resizeable && this.content
287
- ? this.resizeable.nativeElement.clientWidth -
288
- this.content.nativeElement.clientWidth
289
- : 0;
290
- }
291
- updateUrl(params) {
292
- const tree = this.getUrlTree();
293
- const { queryParams } = tree;
294
- delete queryParams.sandboxWidth;
295
- delete queryParams.tuiMode;
296
- tree.queryParams = Object.assign(Object.assign({}, queryParams), tuiCleanObject(Object.assign({ tuiMode: this.mode }, params)));
297
- this.locationRef.go(this.urlStateHandler(tree));
298
- }
299
- createForm() {
300
- const { control, updateOn } = this;
301
- if (control) {
302
- this.testForm = new FormGroup({ testValue: control }, { updateOn });
303
- }
304
- }
305
- getUrlTree() {
306
- return this.urlSerializer.parse(this.locationRef.path());
307
- }
308
- get params() {
309
- return this.getUrlTree().queryParams;
310
- }
311
- }
312
- 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 });
313
- TuiDocDemoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocDemoComponent, selector: "tui-doc-demo", inputs: { control: "control" }, host: { listeners: { "window:resize": "onResize()", "document:mouseup.silent": "onMouseUp()" } }, providers: [
314
- TuiDestroyService,
315
- {
316
- provide: TuiModeDirective,
317
- useExisting: forwardRef(() => TuiDocDemoComponent),
318
- },
319
- ], 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{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 });
320
- __decorate([
321
- tuiPure
322
- ], TuiDocDemoComponent.prototype, "updateUrl", null);
323
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoComponent, decorators: [{
324
- type: Component,
325
- args: [{
326
- selector: 'tui-doc-demo',
327
- templateUrl: './demo.template.html',
328
- styleUrls: ['./demo.style.less'],
329
- changeDetection: ChangeDetectionStrategy.OnPush,
330
- providers: [
331
- TuiDestroyService,
332
- {
333
- provide: TuiModeDirective,
334
- useExisting: forwardRef(() => TuiDocDemoComponent),
335
- },
336
- ],
337
- }]
338
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
339
- type: Inject,
340
- args: [TUI_IS_MOBILE]
341
- }] }, { type: i0.ElementRef, decorators: [{
342
- type: Inject,
343
- args: [ElementRef]
344
- }] }, { type: i4.Location, decorators: [{
345
- type: Inject,
346
- args: [Location$1]
347
- }] }, { type: i6.UrlSerializer, decorators: [{
348
- type: Inject,
349
- args: [UrlSerializer]
350
- }] }, { type: undefined, decorators: [{
351
- type: Inject,
352
- args: [TUI_DOC_DEMO_TEXTS]
353
- }] }, { type: undefined, decorators: [{
354
- type: Inject,
355
- args: [TUI_DOC_URL_STATE_HANDLER]
356
- }] }]; }, propDecorators: { resizeable: [{
357
- type: ViewChild,
358
- args: [TuiResizeableDirective, { static: true }]
359
- }], content: [{
360
- type: ViewChild,
361
- args: ['content', { static: true }]
362
- }], resizer: [{
363
- type: ViewChild,
364
- args: ['resizer', { static: true }]
365
- }], control: [{
366
- type: Input
367
- }], template: [{
368
- type: ContentChild,
369
- args: [TemplateRef]
370
- }], onResize: [{
371
- type: HostListener,
372
- args: ['window:resize']
373
- }], onMouseUp: [{
374
- type: HostListener,
375
- args: ['document:mouseup.silent']
376
- }], updateUrl: [] } });
377
-
378
- class TuiDocDemoModule {
379
- }
380
- TuiDocDemoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
381
- TuiDocDemoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, declarations: [TuiDocDemoComponent], imports: [CommonModule,
382
- ReactiveFormsModule,
383
- FormsModule,
384
- RouterModule,
385
- TuiLinkModule,
386
- TuiButtonModule,
387
- TuiSelectModule,
388
- TuiExpandModule,
389
- TuiGroupModule,
390
- TuiTooltipModule,
391
- TuiModeModule,
392
- TuiRadioBlockModule,
393
- TuiCheckboxLabeledModule,
394
- TuiSvgModule,
395
- TuiDataListWrapperModule,
396
- TuiDataListModule,
397
- TuiTextfieldControllerModule,
398
- TuiHintModule,
399
- TuiResizerModule], exports: [TuiDocDemoComponent] });
400
- TuiDocDemoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, imports: [[
401
- CommonModule,
402
- ReactiveFormsModule,
403
- FormsModule,
404
- RouterModule,
405
- TuiLinkModule,
406
- TuiButtonModule,
407
- TuiSelectModule,
408
- TuiExpandModule,
409
- TuiGroupModule,
410
- TuiTooltipModule,
411
- TuiModeModule,
412
- TuiRadioBlockModule,
413
- TuiCheckboxLabeledModule,
414
- TuiSvgModule,
415
- TuiDataListWrapperModule,
416
- TuiDataListModule,
417
- TuiTextfieldControllerModule,
418
- TuiHintModule,
419
- TuiResizerModule,
420
- ]] });
421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDemoModule, decorators: [{
422
- type: NgModule,
423
- args: [{
424
- imports: [
425
- CommonModule,
426
- ReactiveFormsModule,
427
- FormsModule,
428
- RouterModule,
429
- TuiLinkModule,
430
- TuiButtonModule,
431
- TuiSelectModule,
432
- TuiExpandModule,
433
- TuiGroupModule,
434
- TuiTooltipModule,
435
- TuiModeModule,
436
- TuiRadioBlockModule,
437
- TuiCheckboxLabeledModule,
438
- TuiSvgModule,
439
- TuiDataListWrapperModule,
440
- TuiDataListModule,
441
- TuiTextfieldControllerModule,
442
- TuiHintModule,
443
- TuiResizerModule,
444
- ],
445
- declarations: [TuiDocDemoComponent],
446
- exports: [TuiDocDemoComponent],
447
- }]
448
- }] });
449
-
450
- /**
451
- * Token to exclude inherited documentation properties
452
- */
453
- const TUI_DOC_EXCLUDED_PROPERTIES = new InjectionToken(`[TUI_DOC_EXCLUDED_PROPERTIES]`, { factory: () => new Set([]) });
454
- function tuiDocExcludeProperties(properties) {
455
- return { provide: TUI_DOC_EXCLUDED_PROPERTIES, useValue: new Set(properties) };
456
- }
457
-
458
- function tuiCoerceValue(value) {
459
- const prepared = String(value).trim();
460
- if (isEmptyParamValue(prepared)) {
461
- return null;
462
- }
463
- if (isBooleanParamValue(prepared)) {
464
- return String(prepared) === `true`;
465
- }
466
- if (isNumberParamValue(prepared)) {
467
- return Number(prepared);
468
- }
469
- const decodedValue = decodeURIComponent(prepared);
470
- try {
471
- return isPossibleArray(decodedValue) || isPossibleObject(decodedValue)
472
- ? JSON.parse(decodedValue)
473
- : decodedValue;
474
- }
475
- catch (_a) {
476
- return decodedValue;
477
- }
478
- }
479
- function isEmptyParamValue(value) {
480
- return [`undefined`, `null`, `NaN`].includes(value);
481
- }
482
- function isBooleanParamValue(value) {
483
- return value === `true` || value === `false`;
484
- }
485
- function isNumberParamValue(value) {
486
- return !!value.trim() && !Number.isNaN(Number(value)) && !value.startsWith(`+`);
487
- }
488
- function isPossibleArray(value) {
489
- return value.startsWith(`[`) && value.endsWith(`]`);
490
- }
491
- function isPossibleObject(value) {
492
- return value.startsWith(`{`) && value.endsWith(`}`);
493
- }
494
-
495
- const SERIALIZED_SUFFIX = '$';
496
- // @bad TODO: refactor output and value sync
497
- class TuiDocDocumentationPropertyConnectorDirective {
498
- constructor(template, locationRef, activatedRoute, urlSerializer, urlStateHandler) {
499
- this.template = template;
500
- this.locationRef = locationRef;
501
- this.activatedRoute = activatedRoute;
502
- this.urlSerializer = urlSerializer;
503
- this.urlStateHandler = urlStateHandler;
504
- this.documentationPropertyName = '';
505
- this.documentationPropertyMode = null;
506
- this.documentationPropertyType = '';
507
- this.documentationPropertyDeprecated = false;
508
- this.documentationPropertyValues = null;
509
- this.documentationPropertyValueChange = new EventEmitter();
510
- this.changed$ = new Subject();
511
- this.emits$ = new BehaviorSubject(1);
512
- }
513
- ngOnInit() {
514
- this.parseParams(this.activatedRoute.snapshot.queryParams);
515
- }
516
- get attrName() {
517
- switch (this.documentationPropertyMode) {
518
- case 'input':
519
- return `[${this.documentationPropertyName}]`;
520
- case 'output':
521
- return `(${this.documentationPropertyName})`;
522
- case 'input-output':
523
- return `[(${this.documentationPropertyName})]`;
524
- default:
525
- return this.documentationPropertyName;
526
- }
527
- }
528
- get hasItems() {
529
- return !!this.documentationPropertyValues;
530
- }
531
- get shouldShowValues() {
532
- return this.documentationPropertyMode !== 'output';
533
- }
534
- ngOnChanges() {
535
- this.changed$.next();
536
- }
537
- onValueChange(value) {
538
- this.documentationPropertyValue = value;
539
- this.documentationPropertyValueChange.emit(value);
540
- this.setQueryParam(value);
541
- }
542
- emitEvent(event) {
543
- // For more convenient debugging
544
- console.info(this.attrName, event);
545
- this.emits$.next(this.emits$.value + 1);
546
- }
547
- parseParams(params) {
548
- const propertyValue = params[this.documentationPropertyName];
549
- const propertyValueWithSuffix = params[`${this.documentationPropertyName}${SERIALIZED_SUFFIX}`];
550
- if (!propertyValue && !propertyValueWithSuffix) {
551
- return;
552
- }
553
- let value = !!propertyValueWithSuffix && this.documentationPropertyValues
554
- ? this.documentationPropertyValues[propertyValueWithSuffix]
555
- : tuiCoerceValue(propertyValue);
556
- if (this.documentationPropertyType === 'string' && tuiIsNumber(value)) {
557
- value = value.toString();
558
- }
559
- this.onValueChange(value);
560
- }
561
- setQueryParam(value) {
562
- const tree = this.urlSerializer.parse(this.locationRef.path());
563
- const isValueAvailableByKey = value instanceof Object;
564
- const computedValue = isValueAvailableByKey && this.documentationPropertyValues
565
- ? this.documentationPropertyValues.indexOf(value)
566
- : value;
567
- const suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
568
- const propName = this.documentationPropertyName + suffix;
569
- tree.queryParams = Object.assign(Object.assign({}, tree.queryParams), { [propName]: computedValue });
570
- this.locationRef.go(this.urlStateHandler(tree));
571
- }
572
- }
573
- 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 });
574
- 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 });
575
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationPropertyConnectorDirective, decorators: [{
576
- type: Directive,
577
- args: [{
578
- selector: 'ng-template[documentationPropertyName]',
579
- exportAs: 'documentationProperty',
580
- }]
581
- }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
582
- type: Inject,
583
- args: [TemplateRef]
584
- }] }, { type: i4.Location, decorators: [{
585
- type: Inject,
586
- args: [Location$1]
587
- }] }, { type: i6.ActivatedRoute, decorators: [{
588
- type: Inject,
589
- args: [ActivatedRoute]
590
- }] }, { type: i6.UrlSerializer, decorators: [{
591
- type: Inject,
592
- args: [UrlSerializer]
593
- }] }, { type: undefined, decorators: [{
594
- type: Inject,
595
- args: [TUI_DOC_URL_STATE_HANDLER]
596
- }] }]; }, propDecorators: { documentationPropertyName: [{
597
- type: Input
598
- }], documentationPropertyMode: [{
599
- type: Input
600
- }], documentationPropertyType: [{
601
- type: Input
602
- }], documentationPropertyValue: [{
603
- type: Input
604
- }], documentationPropertyDeprecated: [{
605
- type: Input
606
- }], documentationPropertyValues: [{
607
- type: Input
608
- }], documentationPropertyValueChange: [{
609
- type: Output
610
- }] } });
611
-
612
- class TuiGetOpacityPipe {
613
- transform(color) {
614
- if (color.startsWith(`#`) || color.startsWith(`rgb(`)) {
615
- return 100;
616
- }
617
- if (color === `transparent`) {
618
- return 0;
619
- }
620
- const lastComma = color.lastIndexOf(`,`);
621
- const parsed = color
622
- .slice(lastComma)
623
- .replace(`)`, ``)
624
- .replace(` `, ``)
625
- .replace(`,`, ``);
626
- return Math.round(Number.parseFloat(parsed) * 100);
627
- }
628
- }
629
- TuiGetOpacityPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetOpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
630
- TuiGetOpacityPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetOpacityPipe, name: "tuiGetOpacity" });
631
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetOpacityPipe, decorators: [{
632
- type: Pipe,
633
- args: [{ name: `tuiGetOpacity` }]
634
- }] });
635
-
636
- class TuiGetColorPipe {
637
- transform(color) {
638
- if (color.length === 4) {
639
- return color
640
- .split(``)
641
- .reduce((result, current) => [...result, current, current], [])
642
- .join(``)
643
- .replace(`#`, ``);
644
- }
645
- if (color.startsWith(`#`)) {
646
- return color;
647
- }
648
- if (color === `transparent`) {
649
- return `#000000`;
650
- }
651
- const parsed = color
652
- .replace(`rgb(`, ``)
653
- .replace(`rgba(`, ``)
654
- .replace(`)`, ``)
655
- .replace(` `, ``)
656
- .split(`,`)
657
- .map(v => Number.parseInt(v, 10));
658
- return tuiRgbToHex(...parsed);
659
- }
660
- }
661
- TuiGetColorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
662
- TuiGetColorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetColorPipe, name: "tuiGetColorPipe" });
663
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiGetColorPipe, decorators: [{
664
- type: Pipe,
665
- args: [{ name: `tuiGetColorPipe` }]
666
- }] });
667
-
668
- class TuiInputOpacityDirective {
669
- constructor(renderer, focusable) {
670
- this.renderer = renderer;
671
- this.focusable = focusable;
672
- }
673
- set tuiInputOpacity(opacity) {
674
- const { nativeFocusableElement } = this.focusable;
675
- if (nativeFocusableElement) {
676
- this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
677
- }
678
- }
679
- }
680
- 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 });
681
- TuiInputOpacityDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiInputOpacityDirective, selector: "[tuiInputOpacity]", inputs: { tuiInputOpacity: "tuiInputOpacity" }, ngImport: i0 });
682
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityDirective, decorators: [{
683
- type: Directive,
684
- args: [{
685
- selector: '[tuiInputOpacity]',
686
- }]
687
- }], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
688
- type: Inject,
689
- args: [Renderer2]
690
- }] }, { type: undefined, decorators: [{
691
- type: Inject,
692
- args: [TUI_FOCUSABLE_ITEM_ACCESSOR]
693
- }] }]; }, propDecorators: { tuiInputOpacity: [{
694
- type: Input
695
- }] } });
696
-
697
- class TuiStripOptionalPipe {
698
- transform(name) {
699
- return name.replace(`?`, ``);
700
- }
701
- }
702
- TuiStripOptionalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiStripOptionalPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
703
- TuiStripOptionalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiStripOptionalPipe, name: "tuiStripOptionalPipe" });
704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiStripOptionalPipe, decorators: [{
705
- type: Pipe,
706
- args: [{ name: `tuiStripOptionalPipe` }]
707
- }] });
708
-
709
- class TuiIsOptionalPipe {
710
- transform(name) {
711
- return name.includes(`?`);
712
- }
713
- }
714
- TuiIsOptionalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsOptionalPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
715
- TuiIsOptionalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsOptionalPipe, name: "tuiIsOptionalPipe" });
716
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsOptionalPipe, decorators: [{
717
- type: Pipe,
718
- args: [{ name: `tuiIsOptionalPipe` }]
719
- }] });
720
-
721
- class TuiShowContentTooltip {
722
- transform(type) {
723
- return type.includes(`PolymorpheusContent`);
724
- }
725
- }
726
- TuiShowContentTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowContentTooltip, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
727
- TuiShowContentTooltip.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowContentTooltip, name: "tuiShowContentTooltip" });
728
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowContentTooltip, decorators: [{
729
- type: Pipe,
730
- args: [{ name: `tuiShowContentTooltip` }]
731
- }] });
732
-
733
- class TuiShowCleanerPipe {
734
- transform(type) {
735
- return type.includes(`null`);
736
- }
737
- }
738
- TuiShowCleanerPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowCleanerPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
739
- TuiShowCleanerPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowCleanerPipe, name: "tuiShowCleanerPipe" });
740
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiShowCleanerPipe, decorators: [{
741
- type: Pipe,
742
- args: [{ name: `tuiShowCleanerPipe` }]
743
- }] });
744
-
745
- function inspectArray(array, depth) {
746
- if (depth === 0) {
747
- return `[…]`;
748
- }
749
- let result = ``;
750
- let first = true;
751
- for (let index = 0; index < array.length; index++) {
752
- if (first) {
753
- first = false;
754
- }
755
- else {
756
- result += `, `;
757
- }
758
- result += index in array ? tuiInspectAny(array[index], depth - 1) : `empty`;
759
- }
760
- return `[${result}]`;
761
- }
762
- function inspectObject(object, depth) {
763
- if (depth === 0) {
764
- return `{…}`;
765
- }
766
- let result = ``;
767
- let first = true;
768
- for (const key in object) {
769
- if (!object.hasOwnProperty(key)) {
770
- continue;
771
- }
772
- if (first) {
773
- first = false;
774
- }
775
- else {
776
- result += `, `;
777
- }
778
- result += `${key}: ${tuiInspectAny(object[key], depth - 1)}`;
779
- }
780
- return `{${result}}`;
781
- }
782
- /**
783
- * Returns readable JS entity
784
- * @param data
785
- * @param depth
786
- * @return readable JS entity
787
- */
788
- function tuiInspectAny(data, depth) {
789
- if (data === null) {
790
- return `null`;
791
- }
792
- switch (typeof data) {
793
- case `string`:
794
- return `'${data}'`;
795
- case `undefined`:
796
- case `number`:
797
- case `boolean`:
798
- case `function`:
799
- return String(data);
800
- default:
801
- break;
802
- }
803
- if (data instanceof RegExp) {
804
- return String(data);
805
- }
806
- if (Array.isArray(data)) {
807
- return inspectArray(data, depth);
808
- }
809
- return inspectObject(data, depth);
810
- }
811
-
812
- class TuiInspectPipe {
813
- constructor(isCypress) {
814
- this.isCypress = isCypress;
815
- }
816
- transform(value, depth = 2) {
817
- if (this.isCypress && typeof value === `function`) {
818
- /**
819
- * @description:
820
- * When developing in production mode the webpack bundler minify
821
- * functions in different ways, then due to which the string content
822
- * of the function may differ from build to build, which can be to
823
- * various problems when screenshot testing on e2e.
824
- */
825
- return `λ(x) => y`;
826
- }
827
- return tuiInspectAny(value, depth);
828
- }
829
- }
830
- 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 });
831
- TuiInspectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInspectPipe, name: "tuiInspectAny" });
832
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInspectPipe, decorators: [{
833
- type: Pipe,
834
- args: [{ name: `tuiInspectAny` }]
835
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
836
- type: Inject,
837
- args: [TUI_IS_CYPRESS]
838
- }] }]; } });
839
-
840
- class TuiIsPrimitivePolymorpheusContentPipe {
841
- transform(value) {
842
- return tuiIsString(value) || tuiIsNumber(value);
843
- }
844
- }
845
- TuiIsPrimitivePolymorpheusContentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsPrimitivePolymorpheusContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
846
- TuiIsPrimitivePolymorpheusContentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsPrimitivePolymorpheusContentPipe, name: "tuiIsPrimitivePolymorpheusContentPipe" });
847
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiIsPrimitivePolymorpheusContentPipe, decorators: [{
848
- type: Pipe,
849
- args: [{ name: `tuiIsPrimitivePolymorpheusContentPipe` }]
850
- }] });
851
-
852
- // @bad TODO subscribe propertiesConnectors changes
853
- // @bad TODO refactor to make more flexible
854
- class TuiDocDocumentationComponent {
855
- constructor(cdr, texts, excludedProperties, destroy$, getColor, getOpacity) {
856
- this.cdr = cdr;
857
- this.texts = texts;
858
- this.excludedProperties = excludedProperties;
859
- this.destroy$ = destroy$;
860
- this.getColor = getColor;
861
- this.getOpacity = getOpacity;
862
- this.heading = '';
863
- this.showValues = true;
864
- this.isAPI = false;
865
- this.propertiesConnectors = EMPTY_QUERY;
866
- this.activeItemIndex = 0;
867
- this.matcher = (item, exclusions) => !exclusions.has(item.documentationPropertyName);
868
- }
869
- ngAfterContentInit() {
870
- tuiQueryListChanges(this.propertiesConnectors)
871
- .pipe(switchMap(items => merge(...items.map(({ changed$ }) => changed$))), tuiWatch(this.cdr), takeUntil(this.destroy$))
872
- .subscribe();
873
- }
874
- get type() {
875
- return this.isAPI ? this.texts[0] : this.texts[1];
876
- }
877
- onColorChange(connector, color) {
878
- const opacity = this.getOpacity.transform(connector.documentationPropertyValue || '');
879
- if (opacity === 100) {
880
- connector.onValueChange(color);
881
- return;
882
- }
883
- const rgb = tuiHexToRgb(color).join(', ');
884
- const result = `rgba(${rgb}, ${opacity / 100})`;
885
- connector.onValueChange(result);
886
- }
887
- onOpacityChange(connector, opacity) {
888
- const hex = this.getColor.transform(connector.documentationPropertyValue || '');
889
- const rgb = tuiHexToRgb(hex);
890
- const result = `rgba(${rgb}, ${opacity / 100})`;
891
- connector.onValueChange(result);
892
- }
893
- }
894
- 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 });
895
- 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: [
896
- trigger('emitEvent', [
897
- transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
898
- ]),
899
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
900
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationComponent, decorators: [{
901
- type: Component,
902
- args: [{
903
- selector: 'tui-doc-documentation',
904
- templateUrl: './documentation.template.html',
905
- styleUrls: ['./documentation.style.less'],
906
- changeDetection: ChangeDetectionStrategy.OnPush,
907
- animations: [
908
- trigger('emitEvent', [
909
- transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
910
- ]),
911
- ],
912
- providers: [TuiGetColorPipe, TuiGetOpacityPipe, TuiDestroyService],
913
- }]
914
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef, decorators: [{
915
- type: Inject,
916
- args: [ChangeDetectorRef]
917
- }] }, { type: undefined, decorators: [{
918
- type: Inject,
919
- args: [TUI_DOC_DOCUMENTATION_TEXTS]
920
- }] }, { type: Set, decorators: [{
921
- type: Inject,
922
- args: [TUI_DOC_EXCLUDED_PROPERTIES]
923
- }] }, { type: i6$1.TuiDestroyService, decorators: [{
924
- type: Self
925
- }, {
926
- type: Inject,
927
- args: [TuiDestroyService]
928
- }] }, { type: TuiGetColorPipe, decorators: [{
929
- type: Inject,
930
- args: [TuiGetColorPipe]
931
- }] }, { type: TuiGetOpacityPipe, decorators: [{
932
- type: Inject,
933
- args: [TuiGetOpacityPipe]
934
- }] }]; }, propDecorators: { heading: [{
935
- type: Input
936
- }], showValues: [{
937
- type: Input
938
- }], isAPI: [{
939
- type: Input
940
- }], propertiesConnectors: [{
941
- type: ContentChildren,
942
- args: [TuiDocDocumentationPropertyConnectorDirective]
943
- }] } });
944
-
945
- class TuiInputOpacityModule {
946
- }
947
- TuiInputOpacityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
948
- TuiInputOpacityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule, declarations: [TuiInputOpacityDirective], exports: [TuiInputOpacityDirective] });
949
- TuiInputOpacityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule });
950
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiInputOpacityModule, decorators: [{
951
- type: NgModule,
952
- args: [{
953
- declarations: [TuiInputOpacityDirective],
954
- exports: [TuiInputOpacityDirective],
955
- }]
956
- }] });
957
-
958
- class TuiDocDocumentationModule {
959
- }
960
- TuiDocDocumentationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
961
- TuiDocDocumentationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, declarations: [TuiInspectPipe,
962
- TuiGetColorPipe,
963
- TuiGetOpacityPipe,
964
- TuiIsOptionalPipe,
965
- TuiShowCleanerPipe,
966
- TuiStripOptionalPipe,
967
- TuiShowContentTooltip,
968
- TuiDocDocumentationComponent,
969
- TuiIsPrimitivePolymorpheusContentPipe,
970
- TuiDocDocumentationPropertyConnectorDirective], imports: [CommonModule,
971
- FormsModule,
972
- RouterModule,
973
- TuiBadgeModule,
974
- TuiSelectModule,
975
- TuiToggleModule,
976
- TuiTooltipModule,
977
- TuiLinkModule,
978
- TuiInputCountModule,
979
- TuiModeModule,
980
- TuiGroupModule,
981
- TuiInputOpacityModule,
982
- TuiPrimitiveTextfieldModule,
983
- TuiTextfieldControllerModule,
984
- TuiDropdownModule,
985
- TuiDataListModule,
986
- TuiDataListWrapperModule,
987
- TuiNotificationModule,
988
- TuiFilterPipeModule], exports: [TuiDocDocumentationComponent,
989
- TuiDocDocumentationPropertyConnectorDirective] });
990
- TuiDocDocumentationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, imports: [[
991
- CommonModule,
992
- FormsModule,
993
- RouterModule,
994
- TuiBadgeModule,
995
- TuiSelectModule,
996
- TuiToggleModule,
997
- TuiTooltipModule,
998
- TuiLinkModule,
999
- TuiInputCountModule,
1000
- TuiModeModule,
1001
- TuiGroupModule,
1002
- TuiInputOpacityModule,
1003
- TuiPrimitiveTextfieldModule,
1004
- TuiTextfieldControllerModule,
1005
- TuiDropdownModule,
1006
- TuiDataListModule,
1007
- TuiDataListWrapperModule,
1008
- TuiNotificationModule,
1009
- TuiFilterPipeModule,
1010
- ]] });
1011
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocDocumentationModule, decorators: [{
1012
- type: NgModule,
1013
- args: [{
1014
- imports: [
1015
- CommonModule,
1016
- FormsModule,
1017
- RouterModule,
1018
- TuiBadgeModule,
1019
- TuiSelectModule,
1020
- TuiToggleModule,
1021
- TuiTooltipModule,
1022
- TuiLinkModule,
1023
- TuiInputCountModule,
1024
- TuiModeModule,
1025
- TuiGroupModule,
1026
- TuiInputOpacityModule,
1027
- TuiPrimitiveTextfieldModule,
1028
- TuiTextfieldControllerModule,
1029
- TuiDropdownModule,
1030
- TuiDataListModule,
1031
- TuiDataListWrapperModule,
1032
- TuiNotificationModule,
1033
- TuiFilterPipeModule,
1034
- ],
1035
- declarations: [
1036
- TuiInspectPipe,
1037
- TuiGetColorPipe,
1038
- TuiGetOpacityPipe,
1039
- TuiIsOptionalPipe,
1040
- TuiShowCleanerPipe,
1041
- TuiStripOptionalPipe,
1042
- TuiShowContentTooltip,
1043
- TuiDocDocumentationComponent,
1044
- TuiIsPrimitivePolymorpheusContentPipe,
1045
- TuiDocDocumentationPropertyConnectorDirective,
1046
- ],
1047
- exports: [
1048
- TuiDocDocumentationComponent,
1049
- TuiDocDocumentationPropertyConnectorDirective,
1050
- ],
1051
- }]
1052
- }] });
1053
-
1054
- /**
1055
- * Code actions for the opened tab with code example
1056
- */
1057
- const TUI_DOC_CODE_ACTIONS = new InjectionToken(`[TUI_DOC_CODE_ACTIONS]`, {
1058
- factory: () => ``,
1059
- });
1060
-
1061
- /**
1062
- * Service for opening online IDE e.g. Stackblitz
1063
- */
1064
- const TUI_DOC_CODE_EDITOR = new InjectionToken(`[TUI_DOC_CODE_EDITOR]`);
1065
-
1066
- function tuiRawLoadRecord(example) {
1067
- return __awaiter(this, void 0, void 0, function* () {
1068
- const processedContent = {};
1069
- for (const [key, content] of Object.entries(example)) {
1070
- if (content) {
1071
- processedContent[key] = yield tuiRawLoad(content);
1072
- }
1073
- }
1074
- return processedContent;
1075
- });
1076
- }
1077
-
1078
- const TUI_EXAMPLE_PRIMARY_FILE_NAME = {
1079
- TS: `TypeScript`,
1080
- LESS: `LESS`,
1081
- HTML: `HTML`,
1082
- };
1083
-
1084
- const TUI_DOC_EXAMPLE_DEFAULT_OPTIONS = {
1085
- codeEditorVisibilityHandler: files => Boolean(files[TUI_EXAMPLE_PRIMARY_FILE_NAME.TS] &&
1086
- files[TUI_EXAMPLE_PRIMARY_FILE_NAME.HTML]),
1087
- };
1088
- /**
1089
- * Default parameters for DocExample component
1090
- */
1091
- const TUI_DOC_EXAMPLE_OPTIONS = new InjectionToken(`[TUI_DOC_EXAMPLE_OPTIONS]`, {
1092
- factory: () => TUI_DOC_EXAMPLE_DEFAULT_OPTIONS,
1093
- });
1094
- function tuiDocExampleOptionsProvider(options) {
1095
- return {
1096
- provide: TUI_DOC_EXAMPLE_OPTIONS,
1097
- useValue: Object.assign(Object.assign({}, TUI_DOC_EXAMPLE_DEFAULT_OPTIONS), options),
1098
- };
1099
- }
1100
-
1101
- class TuiDocExampleCapitalizePipe {
1102
- transform(content) {
1103
- return tuiIsString(content) ? tuiCapitalizeFirstLetter(content) : content;
1104
- }
1105
- }
1106
- TuiDocExampleCapitalizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleCapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1107
- TuiDocExampleCapitalizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleCapitalizePipe, name: "tuiDocExampleCapitalize" });
1108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleCapitalizePipe, decorators: [{
1109
- type: Pipe,
1110
- args: [{ name: `tuiDocExampleCapitalize` }]
1111
- }] });
1112
-
1113
- class TuiDocExampleGetTabsPipe {
1114
- transform(content, defaultTab) {
1115
- return [defaultTab, ...Object.keys(content)];
1116
- }
1117
- }
1118
- TuiDocExampleGetTabsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleGetTabsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1119
- TuiDocExampleGetTabsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleGetTabsPipe, name: "tuiDocExampleGetTabs" });
1120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleGetTabsPipe, decorators: [{
1121
- type: Pipe,
1122
- args: [{ name: `tuiDocExampleGetTabs` }]
1123
- }] });
1124
-
1125
- class TuiDocExampleComponent {
1126
- constructor(clipboard, alerts, location, copyTexts$, texts, codeEditor, processContent, isCypress, codeActions, router, route, ngLocation, options) {
1127
- this.clipboard = clipboard;
1128
- this.alerts = alerts;
1129
- this.location = location;
1130
- this.copyTexts$ = copyTexts$;
1131
- this.texts = texts;
1132
- this.codeEditor = codeEditor;
1133
- this.processContent = processContent;
1134
- this.isCypress = isCypress;
1135
- this.codeActions = codeActions;
1136
- this.router = router;
1137
- this.route = route;
1138
- this.ngLocation = ngLocation;
1139
- this.options = options;
1140
- this.rawLoader$$ = new BehaviorSubject({});
1141
- this.id = null;
1142
- this.heading = '';
1143
- this.description = '';
1144
- this.componentName = this.location.pathname.slice(1);
1145
- this.defaultTabIndex = 0;
1146
- this.defaultTab = this.texts[this.defaultTabIndex];
1147
- this.activeItemIndex = this.defaultTabIndex;
1148
- this.copy$ = this.copyTexts$.pipe(map(([copy]) => copy));
1149
- this.processor$ = this.rawLoader$$.pipe(switchMap(tuiRawLoadRecord), map(value => this.processContent(value)));
1150
- this.loading$ = new Subject();
1151
- this.visible = (files) => Boolean(this.codeEditor && this.options.codeEditorVisibilityHandler(files));
1152
- }
1153
- set content(content) {
1154
- this.rawLoader$$.next(content);
1155
- }
1156
- copyExampleLink() {
1157
- const hashPosition = this.location.href.indexOf('#');
1158
- const currentUrl = hashPosition > -1
1159
- ? this.location.href.slice(0, Math.max(0, hashPosition))
1160
- : this.location.href;
1161
- const url = `${currentUrl}#${this.id}`;
1162
- this.setFragmentWithoutRedirect(this.id);
1163
- this.clipboard.copy(url);
1164
- this.alerts
1165
- .open(this.texts[1], {
1166
- label: this.texts[2],
1167
- status: "success" /* Success */,
1168
- })
1169
- .subscribe();
1170
- }
1171
- edit(files) {
1172
- var _a;
1173
- this.loading$.next(true);
1174
- (_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));
1175
- }
1176
- setFragmentWithoutRedirect(id) {
1177
- const url = this.router
1178
- .createUrlTree([], { relativeTo: this.route, fragment: id || '' })
1179
- .toString();
1180
- this.ngLocation.go(url);
1181
- }
1182
- }
1183
- 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 });
1184
- 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 {{ tab }}\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 });
1185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleComponent, decorators: [{
1186
- type: Component,
1187
- args: [{
1188
- selector: 'tui-doc-example',
1189
- templateUrl: './example.template.html',
1190
- styleUrls: ['./example.style.less'],
1191
- changeDetection: ChangeDetectionStrategy.OnPush,
1192
- }]
1193
- }], ctorParameters: function () { return [{ type: i8.Clipboard, decorators: [{
1194
- type: Inject,
1195
- args: [Clipboard]
1196
- }] }, { type: i2$1.TuiAlertService, decorators: [{
1197
- type: Inject,
1198
- args: [TuiAlertService]
1199
- }] }, { type: Location, decorators: [{
1200
- type: Inject,
1201
- args: [LOCATION]
1202
- }] }, { type: i9.Observable, decorators: [{
1203
- type: Inject,
1204
- args: [TUI_COPY_TEXTS]
1205
- }] }, { type: undefined, decorators: [{
1206
- type: Inject,
1207
- args: [TUI_DOC_EXAMPLE_TEXTS]
1208
- }] }, { type: undefined, decorators: [{
1209
- type: Optional
1210
- }, {
1211
- type: Inject,
1212
- args: [TUI_DOC_CODE_EDITOR]
1213
- }] }, { type: undefined, decorators: [{
1214
- type: Inject,
1215
- args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR]
1216
- }] }, { type: undefined, decorators: [{
1217
- type: Inject,
1218
- args: [TUI_IS_CYPRESS]
1219
- }] }, { type: Array, decorators: [{
1220
- type: Inject,
1221
- args: [TUI_DOC_CODE_ACTIONS]
1222
- }] }, { type: i6.Router, decorators: [{
1223
- type: Inject,
1224
- args: [Router]
1225
- }] }, { type: i6.ActivatedRoute, decorators: [{
1226
- type: Inject,
1227
- args: [ActivatedRoute]
1228
- }] }, { type: i4.Location, decorators: [{
1229
- type: Inject,
1230
- args: [Location$1]
1231
- }] }, { type: undefined, decorators: [{
1232
- type: Inject,
1233
- args: [TUI_DOC_EXAMPLE_OPTIONS]
1234
- }] }]; }, propDecorators: { id: [{
1235
- type: Input
1236
- }], heading: [{
1237
- type: Input
1238
- }], description: [{
1239
- type: Input
1240
- }], content: [{
1241
- type: Input
1242
- }], componentName: [{
1243
- type: Input
1244
- }] } });
1245
-
1246
- class TuiDocExampleModule {
1247
- }
1248
- TuiDocExampleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1249
- TuiDocExampleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, declarations: [TuiDocExampleComponent,
1250
- TuiDocExampleGetTabsPipe,
1251
- TuiDocExampleCapitalizePipe], imports: [CommonModule,
1252
- ClipboardModule,
1253
- TuiTabsModule,
1254
- TuiButtonModule,
1255
- TuiDocCopyModule,
1256
- TuiDocCodeModule,
1257
- PolymorpheusModule,
1258
- TuiMapperPipeModule,
1259
- TuiLoaderModule], exports: [TuiDocExampleComponent,
1260
- TuiDocExampleGetTabsPipe,
1261
- TuiDocExampleCapitalizePipe] });
1262
- TuiDocExampleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, imports: [[
1263
- CommonModule,
1264
- ClipboardModule,
1265
- TuiTabsModule,
1266
- TuiButtonModule,
1267
- TuiDocCopyModule,
1268
- TuiDocCodeModule,
1269
- PolymorpheusModule,
1270
- TuiMapperPipeModule,
1271
- TuiLoaderModule,
1272
- ]] });
1273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocExampleModule, decorators: [{
1274
- type: NgModule,
1275
- args: [{
1276
- imports: [
1277
- CommonModule,
1278
- ClipboardModule,
1279
- TuiTabsModule,
1280
- TuiButtonModule,
1281
- TuiDocCopyModule,
1282
- TuiDocCodeModule,
1283
- PolymorpheusModule,
1284
- TuiMapperPipeModule,
1285
- TuiLoaderModule,
1286
- ],
1287
- declarations: [
1288
- TuiDocExampleComponent,
1289
- TuiDocExampleGetTabsPipe,
1290
- TuiDocExampleCapitalizePipe,
1291
- ],
1292
- exports: [
1293
- TuiDocExampleComponent,
1294
- TuiDocExampleGetTabsPipe,
1295
- TuiDocExampleCapitalizePipe,
1296
- ],
1297
- }]
1298
- }] });
1299
-
1300
- class TuiLanguageSwitcherComponent {
1301
- constructor(switcher, flagPipe) {
1302
- this.switcher = switcher;
1303
- this.flagPipe = flagPipe;
1304
- this.language = new FormControl(tuiCapitalizeFirstLetter(this.switcher.language));
1305
- this.flags = new Map([
1306
- ['chinese', TuiCountryIsoCode.CN],
1307
- ['dutch', TuiCountryIsoCode.NL],
1308
- ['english', TuiCountryIsoCode.GB],
1309
- ['french', TuiCountryIsoCode.FR],
1310
- ['german', TuiCountryIsoCode.DE],
1311
- ['italian', TuiCountryIsoCode.IT],
1312
- ['polish', TuiCountryIsoCode.PL],
1313
- ['portuguese', TuiCountryIsoCode.PT],
1314
- ['russian', TuiCountryIsoCode.RU],
1315
- ['spanish', TuiCountryIsoCode.ES],
1316
- ['turkish', TuiCountryIsoCode.TR],
1317
- ['ukrainian', TuiCountryIsoCode.UA],
1318
- ['vietnamese', TuiCountryIsoCode.VN],
1319
- ]);
1320
- this.names = Array.from(this.flags.keys());
1321
- }
1322
- /**
1323
- * @deprecated use `<img [src]="countryIsoCode | tuiFlagPipe" />`
1324
- * TODO drop in v4.0
1325
- */
1326
- getFlagPath(code) {
1327
- return this.flagPipe.transform(code);
1328
- }
1329
- }
1330
- 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 });
1331
- TuiLanguageSwitcherComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiLanguageSwitcherComponent, selector: "tui-language-switcher", providers: [
1332
- // TODO: for backward compatibility only. Drop in v4.0
1333
- TuiFlagPipe,
1334
- ], 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 });
1335
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherComponent, decorators: [{
1336
- type: Component,
1337
- args: [{
1338
- selector: 'tui-language-switcher',
1339
- templateUrl: './language-switcher.component.html',
1340
- styleUrls: ['./language-switcher.component.less'],
1341
- providers: [
1342
- // TODO: for backward compatibility only. Drop in v4.0
1343
- TuiFlagPipe,
1344
- ],
1345
- changeDetection: ChangeDetectionStrategy.OnPush,
1346
- }]
1347
- }], ctorParameters: function () { return [{ type: i5$1.TuiLanguageSwitcher, decorators: [{
1348
- type: Inject,
1349
- args: [TuiLanguageSwitcher]
1350
- }] }, { type: i2$1.TuiFlagPipe, decorators: [{
1351
- type: Inject,
1352
- args: [TuiFlagPipe]
1353
- }] }]; } });
1354
-
1355
- class TuiLanguageSwitcherModule {
1356
- }
1357
- TuiLanguageSwitcherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1358
- TuiLanguageSwitcherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, declarations: [TuiLanguageSwitcherComponent], imports: [CommonModule,
1359
- TuiFlagPipeModule,
1360
- TuiSelectModule,
1361
- TuiDataListModule,
1362
- ReactiveFormsModule], exports: [TuiLanguageSwitcherComponent] });
1363
- TuiLanguageSwitcherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, imports: [[
1364
- CommonModule,
1365
- TuiFlagPipeModule,
1366
- TuiSelectModule,
1367
- TuiDataListModule,
1368
- ReactiveFormsModule,
1369
- ]] });
1370
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiLanguageSwitcherModule, decorators: [{
1371
- type: NgModule,
1372
- args: [{
1373
- exports: [TuiLanguageSwitcherComponent],
1374
- declarations: [TuiLanguageSwitcherComponent],
1375
- imports: [
1376
- CommonModule,
1377
- TuiFlagPipeModule,
1378
- TuiSelectModule,
1379
- TuiDataListModule,
1380
- ReactiveFormsModule,
1381
- ],
1382
- }]
1383
- }] });
1384
-
1385
- const TUI_THEME_STORAGE_DEFAULT_KEY = `tuiTheme`;
1386
- const TUI_THEME_STORAGE_KEY = new InjectionToken(`[TUI_THEME_STORAGE_KEY]`, { factory: () => TUI_THEME_STORAGE_DEFAULT_KEY });
1387
- const TUI_THEME_DEFAULT_NAME = `Taiga UI`;
1388
- const TUI_THEME_NAME = new InjectionToken(`[TUI_THEME_NAME]`, {
1389
- factory: () => TUI_THEME_DEFAULT_NAME,
1390
- });
1391
-
1392
- class TuiThemeService extends BehaviorSubject {
1393
- constructor(initialTheme, key, storage) {
1394
- super(storage.getItem(key) || initialTheme);
1395
- this.initialTheme = initialTheme;
1396
- this.key = key;
1397
- this.storage = storage;
1398
- }
1399
- next(theme) {
1400
- this.storage.setItem(this.key, theme);
1401
- super.next(theme);
1402
- }
1403
- get isDefaultTheme() {
1404
- return this.value === TUI_THEME_DEFAULT_NAME;
1405
- }
1406
- }
1407
- TuiThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiThemeService, deps: [{ token: TUI_THEME_NAME }, { token: TUI_THEME_STORAGE_KEY }, { token: LOCAL_STORAGE }], target: i0.ɵɵFactoryTarget.Injectable });
1408
- TuiThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiThemeService, providedIn: `root` });
1409
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiThemeService, decorators: [{
1410
- type: Injectable,
1411
- args: [{
1412
- providedIn: `root`,
1413
- }]
1414
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1415
- type: Inject,
1416
- args: [TUI_THEME_NAME]
1417
- }] }, { type: undefined, decorators: [{
1418
- type: Inject,
1419
- args: [TUI_THEME_STORAGE_KEY]
1420
- }] }, { type: Storage, decorators: [{
1421
- type: Inject,
1422
- args: [LOCAL_STORAGE]
1423
- }] }]; } });
1424
-
1425
- const TUI_THEME_NIGHT_STORAGE_DEFAULT_KEY = `tuiNight`;
1426
- const TUI_THEME_NIGHT_STORAGE_KEY = new InjectionToken(`[TUI_THEME_NIGHT_STORAGE_KEY]`, { factory: () => TUI_THEME_NIGHT_STORAGE_DEFAULT_KEY });
1427
- const TUI_USE_DEFAULT_NIGHT_THEME = new InjectionToken(`[TUI_USE_DEFAULT_NIGHT_THEME]`, { factory: ALWAYS_TRUE_HANDLER });
1428
-
1429
- class TuiThemeNightService extends BehaviorSubject {
1430
- constructor(win, storage, key, useDefaultNightTheme) {
1431
- super(storage.getItem(key) === `true` ||
1432
- (storage.getItem(key) === null &&
1433
- win.matchMedia(`(prefers-color-scheme: dark)`).matches));
1434
- this.win = win;
1435
- this.storage = storage;
1436
- this.key = key;
1437
- this.useDefaultNightTheme = useDefaultNightTheme;
1438
- }
1439
- next(night) {
1440
- this.storage.setItem(this.key, String(night));
1441
- super.next(night);
1442
- }
1443
- toggle() {
1444
- this.next(!this.value);
1445
- }
1446
- }
1447
- TuiThemeNightService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiThemeNightService, deps: [{ token: WINDOW }, { token: LOCAL_STORAGE }, { token: TUI_THEME_NIGHT_STORAGE_KEY }, { token: TUI_USE_DEFAULT_NIGHT_THEME }], target: i0.ɵɵFactoryTarget.Injectable });
1448
- TuiThemeNightService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiThemeNightService, providedIn: `root` });
1449
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiThemeNightService, decorators: [{
1450
- type: Injectable,
1451
- args: [{
1452
- providedIn: `root`,
1453
- }]
1454
- }], ctorParameters: function () { return [{ type: Window, decorators: [{
1455
- type: Inject,
1456
- args: [WINDOW]
1457
- }] }, { type: Storage, decorators: [{
1458
- type: Inject,
1459
- args: [LOCAL_STORAGE]
1460
- }] }, { type: undefined, decorators: [{
1461
- type: Inject,
1462
- args: [TUI_THEME_NIGHT_STORAGE_KEY]
1463
- }] }, { type: undefined, decorators: [{
1464
- type: Inject,
1465
- args: [TUI_USE_DEFAULT_NIGHT_THEME]
1466
- }] }]; } });
1467
-
1468
- /**
1469
- * Stream that emits if loading of page is over (for example, to begin scrollIntoView)
1470
- */
1471
- const TUI_DOC_PAGE_LOADED = new InjectionToken(`[TUI_DOC_PAGE_LOADED]`, { factory: () => defer(() => timer(200).pipe(switchMap(() => of(true)))) });
1472
-
1473
- /**
1474
- * Defines the transition animation for scroll
1475
- */
1476
- const TUI_DOC_SCROLL_BEHAVIOR = new InjectionToken(`[TUI_DOC_SCROLL_BEHAVIOR]`, { factory: () => `smooth` });
1477
-
1478
- const MAP = {
1479
- а: `f`,
1480
- б: `,`,
1481
- в: `d`,
1482
- г: `u`,
1483
- д: `l`,
1484
- е: `t`,
1485
- ё: `\``,
1486
- ж: `;`,
1487
- з: `p`,
1488
- и: `b`,
1489
- й: `q`,
1490
- к: `r`,
1491
- л: `k`,
1492
- м: `v`,
1493
- н: `y`,
1494
- о: `j`,
1495
- п: `g`,
1496
- р: `h`,
1497
- с: `c`,
1498
- т: `n`,
1499
- у: `e`,
1500
- ф: `a`,
1501
- х: `[`,
1502
- ц: `w`,
1503
- ч: `x`,
1504
- ш: `i`,
1505
- щ: `o`,
1506
- ъ: `]`,
1507
- ы: `s`,
1508
- ь: `m`,
1509
- ю: `.`,
1510
- я: `z`,
1511
- };
1512
- /**
1513
- * Translates text mistakenly typed in the Russian layout into English
1514
- * @param string string with Russian layout characters
1515
- * @return string with English layout characters
1516
- */
1517
- function tuiTransliterateKeyboardLayout(string) {
1518
- let newStr = ``;
1519
- for (let i = 0; i < string.length; i++) {
1520
- newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
1521
- }
1522
- return newStr;
1523
- }
1524
-
1525
- function tuiToFlatMapPages(pages) {
1526
- const map = new Map();
1527
- for (const page of pages) {
1528
- if (`subPages` in page) {
1529
- for (const subPage of page.subPages) {
1530
- ngDevMode && assertTitle(subPage, map);
1531
- map.set(subPage.title, subPage);
1532
- }
1533
- }
1534
- else {
1535
- ngDevMode && assertTitle(page, map);
1536
- map.set(page.title, page);
1537
- }
1538
- }
1539
- return map;
1540
- }
1541
- function assertTitle(page, map) {
1542
- var _a;
1543
- if (map.has(page.title) && ((_a = map.get(page.title)) === null || _a === void 0 ? void 0 : _a.route) !== page.route) {
1544
- console.error(`Title for page should be unique for prevent inconsistent page names`, page, `<== Collisions between ==>`, map.get(page.title));
1545
- }
1546
- }
1547
-
1548
- /**
1549
- * Documentation pages
1550
- */
1551
- const TUI_DOC_PAGES = new InjectionToken(`[TUI_DOC_PAGES]`, {
1552
- factory: () => [],
1553
- });
1554
- const TUI_DOC_MAP_PAGES = new InjectionToken(`[TUI_DOC_MAP_PAGES]`, {
1555
- factory: () => {
1556
- const pages = inject(TUI_DOC_PAGES);
1557
- return tuiToFlatMapPages(pages);
1558
- },
1559
- });
1560
-
1561
- /**
1562
- * Page title prefix
1563
- */
1564
- const TUI_DOC_TITLE = new InjectionToken(`[TUI_DOC_TITLE]`, {
1565
- factory: () => ``,
1566
- });
1567
-
1568
- /**
1569
- * Page title
1570
- */
1571
- const NAVIGATION_TITLE = new InjectionToken(`[NAVIGATION_TITLE]`);
1572
- /**
1573
- * Navigation sections labels for search
1574
- */
1575
- const NAVIGATION_LABELS = new InjectionToken(`[NAVIGATION_LABELS]`);
1576
- /**
1577
- * Navigation pages
1578
- */
1579
- const NAVIGATION_ITEMS = new InjectionToken(`[NAVIGATION_ITEMS]`);
1580
- const NAVIGATION_PROVIDERS = [
1581
- TuiDestroyService,
1582
- {
1583
- provide: NAVIGATION_TITLE,
1584
- deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
1585
- useFactory: (router, activatedRoute, titlePrefix, destroy$) => {
1586
- return router.events.pipe(filter(event => event instanceof NavigationEnd), map(() => activatedRoute.firstChild), filter(tuiIsPresent), mergeMap(({ data }) => data), map(({ title }) => `${titlePrefix}${title}`), takeUntil(destroy$));
1587
- },
1588
- },
1589
- {
1590
- provide: NAVIGATION_LABELS,
1591
- deps: [TUI_DOC_PAGES],
1592
- useFactory: labelsProviderFactory,
1593
- },
1594
- {
1595
- provide: NAVIGATION_ITEMS,
1596
- deps: [TUI_DOC_PAGES],
1597
- useFactory: (pages) => {
1598
- const labels = labelsProviderFactory(pages);
1599
- return [
1600
- ...labels.map(label => pages.filter(({ section }) => section === label)),
1601
- pages.filter(page => !page.section),
1602
- ];
1603
- },
1604
- },
1605
- ];
1606
- function labelsProviderFactory(pages) {
1607
- return pages
1608
- .map(({ section }) => section)
1609
- .filter(tuiIsPresent)
1610
- .filter((item, index, array) => array.indexOf(item) === index);
1611
- }
1612
-
1613
- class TuiScrollIntoViewLinkDirective {
1614
- constructor(destroy$, { nativeElement }, readyToScroll$) {
1615
- this.readyToScroll$ = readyToScroll$;
1616
- this.scroll$ = new ReplaySubject(1);
1617
- this.readyToScroll$
1618
- .pipe(filter(Boolean), switchMap(() => this.scroll$), debounceTime(750), filter(shallWe => shallWe && !!tuiGetElementObscures(nativeElement)), takeUntil(destroy$))
1619
- .subscribe(() => {
1620
- nativeElement.scrollIntoView();
1621
- });
1622
- }
1623
- set tuiScrollIntoViewLink(shallWe) {
1624
- this.scroll$.next(shallWe);
1625
- }
1626
- }
1627
- TuiScrollIntoViewLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiScrollIntoViewLinkDirective, deps: [{ token: TuiDestroyService, self: true }, { token: ElementRef }, { token: TUI_DOC_PAGE_LOADED }], target: i0.ɵɵFactoryTarget.Directive });
1628
- TuiScrollIntoViewLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiScrollIntoViewLinkDirective, selector: "[tuiScrollIntoViewLink]", inputs: { tuiScrollIntoViewLink: "tuiScrollIntoViewLink" }, providers: [TuiDestroyService], ngImport: i0 });
1629
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiScrollIntoViewLinkDirective, decorators: [{
1630
- type: Directive,
1631
- args: [{
1632
- selector: '[tuiScrollIntoViewLink]',
1633
- providers: [TuiDestroyService],
1634
- }]
1635
- }], ctorParameters: function () { return [{ type: i6$1.TuiDestroyService, decorators: [{
1636
- type: Self
1637
- }, {
1638
- type: Inject,
1639
- args: [TuiDestroyService]
1640
- }] }, { type: i0.ElementRef, decorators: [{
1641
- type: Inject,
1642
- args: [ElementRef]
1643
- }] }, { type: i9.Observable, decorators: [{
1644
- type: Inject,
1645
- args: [TUI_DOC_PAGE_LOADED]
1646
- }] }]; }, propDecorators: { tuiScrollIntoViewLink: [{
1647
- type: Input
1648
- }] } });
1649
-
1650
- class TuiDocNavigationComponent {
1651
- constructor(cdr, titleService, title$, doc, mode, sidebar, labels, items, searchText, router, activatedRoute, destroy$, readyToScroll$, scrollBehavior) {
1652
- this.doc = doc;
1653
- this.mode = mode;
1654
- this.sidebar = sidebar;
1655
- this.labels = labels;
1656
- this.items = items;
1657
- this.searchText = searchText;
1658
- this.router = router;
1659
- this.activatedRoute = activatedRoute;
1660
- this.destroy$ = destroy$;
1661
- this.readyToScroll$ = readyToScroll$;
1662
- this.scrollBehavior = scrollBehavior;
1663
- this.menuOpen = false;
1664
- this.openPagesArr = [];
1665
- this.openPagesGroupsArr = [];
1666
- this.active = '';
1667
- this.search = new FormControl('');
1668
- this.filtered$ = tuiControlValue(this.search).pipe(filter(search => search.length > 2), map(search => this.filterItems(this.flattenSubPages(this.items), search)));
1669
- this.mode$ = this.mode.change$.pipe(startWith(null), map(() => this.mode.mode || 'onLight'));
1670
- // Angular can't navigate no anchor links
1671
- // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
1672
- title$.subscribe(title => {
1673
- cdr.markForCheck();
1674
- titleService.setTitle(title);
1675
- this.openActivePageGroup();
1676
- this.handleAnchorLink(this.activatedRoute.snapshot.fragment || '');
1677
- });
1678
- }
1679
- get canOpen() {
1680
- var _a, _b;
1681
- return ((_b = (_a = this.search.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 2;
1682
- }
1683
- get itemsWithoutSections() {
1684
- return this.items[this.items.length - 1];
1685
- }
1686
- isActive(route) {
1687
- return route === this.active;
1688
- }
1689
- onGroupClick(index) {
1690
- this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
1691
- }
1692
- closeMenu() {
1693
- this.menuOpen = false;
1694
- }
1695
- onClick(input) {
1696
- input.open = false;
1697
- this.menuOpen = false;
1698
- this.search.setValue('');
1699
- this.openActivePageGroup();
1700
- }
1701
- filterItems(items, search) {
1702
- return items.map(section => tuiUniqBy(section.filter(({ title, keywords = '' }) => {
1703
- title = title.toLowerCase();
1704
- search = search.toLowerCase();
1705
- keywords = keywords.toLowerCase();
1706
- return (title.includes(search) ||
1707
- keywords.includes(search) ||
1708
- title.includes(tuiTransliterateKeyboardLayout(search)) ||
1709
- keywords.includes(tuiTransliterateKeyboardLayout(search)) ||
1710
- search.replace(/-/gi, '').includes(title));
1711
- }), 'title'));
1712
- }
1713
- flattenSubPages(items) {
1714
- return items.reduce((array, item) => [
1715
- ...array,
1716
- item.reduce((pages, page) => 'subPages' in page
1717
- ? [...pages, ...page.subPages]
1718
- : [...pages, page], []),
1719
- ], []);
1720
- }
1721
- isActiveRoute(route) {
1722
- return this.router.isActive(route, {
1723
- paths: 'subset',
1724
- queryParams: 'subset',
1725
- fragment: 'ignored',
1726
- matrixParams: 'ignored',
1727
- });
1728
- }
1729
- handleAnchorLink(hash) {
1730
- this.readyToScroll$
1731
- .pipe(filter(Boolean), take(1), takeUntil(this.destroy$))
1732
- .subscribe(() => this.navigateToAnchorLink(hash));
1733
- }
1734
- openActivePageGroup() {
1735
- this.items.forEach((pages, pagesIndex) => {
1736
- pages.forEach((page, pageIndex) => {
1737
- if ('route' in page && this.isActiveRoute(page.route)) {
1738
- this.openPagesArr[pagesIndex] = true;
1739
- this.active = page.route;
1740
- }
1741
- if ('subPages' in page) {
1742
- page.subPages.forEach(subPage => {
1743
- if (this.isActiveRoute(subPage.route)) {
1744
- this.openPagesArr[pagesIndex] = true;
1745
- this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
1746
- this.active = subPage.route;
1747
- }
1748
- });
1749
- }
1750
- });
1751
- });
1752
- }
1753
- navigateToAnchorLink(fragment) {
1754
- const nodes = fragment ? this.doc.querySelectorAll(`#${fragment}`) : [];
1755
- const element = nodes.length && nodes[nodes.length - 1];
1756
- if (!element) {
1757
- return;
1758
- }
1759
- element.classList.add('tui-doc-animated-example');
1760
- element.scrollIntoView({
1761
- block: 'start',
1762
- inline: 'nearest',
1763
- behavior: this.scrollBehavior,
1764
- });
1765
- }
1766
- }
1767
- 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 });
1768
- 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: TuiScrollIntoViewLinkDirective, selector: "[tuiScrollIntoViewLink]", inputs: ["tuiScrollIntoViewLink"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1769
- __decorate([
1770
- tuiPure
1771
- ], TuiDocNavigationComponent.prototype, "filterItems", null);
1772
- __decorate([
1773
- tuiPure
1774
- ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
1775
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationComponent, decorators: [{
1776
- type: Component,
1777
- args: [{
1778
- selector: 'tui-doc-navigation',
1779
- templateUrl: './navigation.template.html',
1780
- styleUrls: ['./navigation.style.less'],
1781
- providers: NAVIGATION_PROVIDERS,
1782
- changeDetection: ChangeDetectionStrategy.OnPush,
1783
- }]
1784
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef, decorators: [{
1785
- type: Inject,
1786
- args: [ChangeDetectorRef]
1787
- }] }, { type: i8$1.Title, decorators: [{
1788
- type: Inject,
1789
- args: [Title]
1790
- }] }, { type: i9.Observable, decorators: [{
1791
- type: Inject,
1792
- args: [NAVIGATION_TITLE]
1793
- }] }, { type: Document, decorators: [{
1794
- type: Inject,
1795
- args: [DOCUMENT]
1796
- }] }, { type: i2$1.TuiModeDirective, decorators: [{
1797
- type: Inject,
1798
- args: [TuiModeDirective]
1799
- }] }, { type: undefined, decorators: [{
1800
- type: Optional
1801
- }, {
1802
- type: Inject,
1803
- args: [TuiSidebarDirective]
1804
- }] }, { type: undefined, decorators: [{
1805
- type: Inject,
1806
- args: [NAVIGATION_LABELS]
1807
- }] }, { type: undefined, decorators: [{
1808
- type: Inject,
1809
- args: [NAVIGATION_ITEMS]
1810
- }] }, { type: undefined, decorators: [{
1811
- type: Inject,
1812
- args: [TUI_DOC_SEARCH_TEXT]
1813
- }] }, { type: i6.Router, decorators: [{
1814
- type: Inject,
1815
- args: [Router]
1816
- }] }, { type: i6.ActivatedRoute, decorators: [{
1817
- type: Inject,
1818
- args: [ActivatedRoute]
1819
- }] }, { type: i9.Observable, decorators: [{
1820
- type: Self
1821
- }, {
1822
- type: Inject,
1823
- args: [TuiDestroyService]
1824
- }] }, { type: i9.Observable, decorators: [{
1825
- type: Inject,
1826
- args: [TUI_DOC_PAGE_LOADED]
1827
- }] }, { type: undefined, decorators: [{
1828
- type: Inject,
1829
- args: [TUI_DOC_SCROLL_BEHAVIOR]
1830
- }] }]; }, propDecorators: { menuOpen: [{
1831
- type: HostBinding,
1832
- args: ['class._open']
1833
- }], filterItems: [], flattenSubPages: [] } });
1834
-
1835
- /**
1836
- * Main logo
1837
- */
1838
- const TUI_DOC_LOGO = new InjectionToken(`[TUI_DOC_LOGO]`, {
1839
- factory: () => ``,
1840
- });
1841
-
1842
- class TuiDocHeaderComponent {
1843
- constructor(logo, menu, router, swipes$) {
1844
- this.logo = logo;
1845
- this.menu = menu;
1846
- this.router = router;
1847
- this.swipes$ = swipes$;
1848
- this.stream$ = new Subject();
1849
- 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());
1850
- }
1851
- onClick() {
1852
- this.stream$.next(true);
1853
- }
1854
- onActiveZone(active) {
1855
- if (!active) {
1856
- this.stream$.next(false);
1857
- }
1858
- }
1859
- }
1860
- 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 });
1861
- 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 });
1862
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderComponent, decorators: [{
1863
- type: Component,
1864
- args: [{
1865
- selector: 'header[tuiDocHeader]',
1866
- templateUrl: './header.template.html',
1867
- styleUrls: ['./header.style.less'],
1868
- changeDetection: ChangeDetectionStrategy.OnPush,
1869
- }]
1870
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1871
- type: Inject,
1872
- args: [TUI_DOC_LOGO]
1873
- }] }, { type: undefined, decorators: [{
1874
- type: Inject,
1875
- args: [TUI_DOC_MENU_TEXT]
1876
- }] }, { type: i6.Router, decorators: [{
1877
- type: Inject,
1878
- args: [Router]
1879
- }] }, { type: i6$1.TuiSwipeService, decorators: [{
1880
- type: Inject,
1881
- args: [TuiSwipeService]
1882
- }] }]; } });
1883
-
1884
- class TuiDocMainComponent {
1885
- constructor(theme, night) {
1886
- this.theme = theme;
1887
- this.night = night;
1888
- this.change$ = this.night;
1889
- this.night$ = this.change$.pipe(startWith(null), map(() => this.night.value), distinctUntilChanged(), share());
1890
- }
1891
- get mode() {
1892
- return this.night.value ? 'onDark' : null;
1893
- }
1894
- }
1895
- 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 });
1896
- 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: [
1897
- {
1898
- provide: TuiModeDirective,
1899
- useExisting: forwardRef(() => TuiDocMainComponent),
1900
- },
1901
- TuiSwipeService,
1902
- ], 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 });
1903
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainComponent, decorators: [{
1904
- type: Component,
1905
- args: [{
1906
- selector: 'tui-doc-main',
1907
- templateUrl: './main.template.html',
1908
- styleUrls: ['./main.style.less'],
1909
- encapsulation: ViewEncapsulation.None,
1910
- // @note: This one was default on purpose so we can test demo in default mode.
1911
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
1912
- changeDetection: ChangeDetectionStrategy.Default,
1913
- providers: [
1914
- {
1915
- provide: TuiModeDirective,
1916
- useExisting: forwardRef(() => TuiDocMainComponent),
1917
- },
1918
- TuiSwipeService,
1919
- ],
1920
- }]
1921
- }], ctorParameters: function () { return [{ type: TuiThemeService, decorators: [{
1922
- type: Inject,
1923
- args: [TuiThemeService]
1924
- }] }, { type: TuiThemeNightService, decorators: [{
1925
- type: Inject,
1926
- args: [TuiThemeNightService]
1927
- }] }]; }, propDecorators: { mode: [{
1928
- type: HostBinding,
1929
- args: ['attr.data-mode']
1930
- }] } });
1931
-
1932
- class TuiScrollIntoViewLinkModule {
1933
- }
1934
- TuiScrollIntoViewLinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiScrollIntoViewLinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1935
- TuiScrollIntoViewLinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiScrollIntoViewLinkModule, declarations: [TuiScrollIntoViewLinkDirective], exports: [TuiScrollIntoViewLinkDirective] });
1936
- TuiScrollIntoViewLinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiScrollIntoViewLinkModule });
1937
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiScrollIntoViewLinkModule, decorators: [{
1938
- type: NgModule,
1939
- args: [{
1940
- declarations: [TuiScrollIntoViewLinkDirective],
1941
- exports: [TuiScrollIntoViewLinkDirective],
1942
- }]
1943
- }] });
1944
-
1945
- class TuiDocNavigationModule {
1946
- }
1947
- TuiDocNavigationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1948
- TuiDocNavigationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, declarations: [TuiDocNavigationComponent], imports: [CommonModule,
1949
- ReactiveFormsModule,
1950
- RouterModule,
1951
- PolymorpheusModule,
1952
- TuiScrollIntoViewLinkModule,
1953
- TuiButtonModule,
1954
- TuiInputModule,
1955
- TuiTextfieldControllerModule,
1956
- TuiActiveZoneModule,
1957
- TuiLetModule,
1958
- TuiModeModule,
1959
- TuiLinkModule,
1960
- TuiExpandModule,
1961
- TuiHostedDropdownModule,
1962
- TuiDropdownModule,
1963
- TuiAccordionModule,
1964
- TuiScrollbarModule,
1965
- TuiSvgModule,
1966
- TuiDataListModule,
1967
- TuiAutoFocusModule], exports: [TuiDocNavigationComponent] });
1968
- TuiDocNavigationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, imports: [[
1969
- CommonModule,
1970
- ReactiveFormsModule,
1971
- RouterModule,
1972
- PolymorpheusModule,
1973
- TuiScrollIntoViewLinkModule,
1974
- TuiButtonModule,
1975
- TuiInputModule,
1976
- TuiTextfieldControllerModule,
1977
- TuiActiveZoneModule,
1978
- TuiLetModule,
1979
- TuiModeModule,
1980
- TuiLinkModule,
1981
- TuiExpandModule,
1982
- TuiHostedDropdownModule,
1983
- TuiDropdownModule,
1984
- TuiAccordionModule,
1985
- TuiScrollbarModule,
1986
- TuiSvgModule,
1987
- TuiDataListModule,
1988
- TuiAutoFocusModule,
1989
- ]] });
1990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocNavigationModule, decorators: [{
1991
- type: NgModule,
1992
- args: [{
1993
- imports: [
1994
- CommonModule,
1995
- ReactiveFormsModule,
1996
- RouterModule,
1997
- PolymorpheusModule,
1998
- TuiScrollIntoViewLinkModule,
1999
- TuiButtonModule,
2000
- TuiInputModule,
2001
- TuiTextfieldControllerModule,
2002
- TuiActiveZoneModule,
2003
- TuiLetModule,
2004
- TuiModeModule,
2005
- TuiLinkModule,
2006
- TuiExpandModule,
2007
- TuiHostedDropdownModule,
2008
- TuiDropdownModule,
2009
- TuiAccordionModule,
2010
- TuiScrollbarModule,
2011
- TuiSvgModule,
2012
- TuiDataListModule,
2013
- TuiAutoFocusModule,
2014
- ],
2015
- declarations: [TuiDocNavigationComponent],
2016
- exports: [TuiDocNavigationComponent],
2017
- }]
2018
- }] });
2019
-
2020
- class TuiDocHeaderModule {
2021
- }
2022
- TuiDocHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2023
- TuiDocHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, declarations: [TuiDocHeaderComponent], imports: [CommonModule,
2024
- PolymorpheusModule,
2025
- TuiButtonModule,
2026
- TuiSidebarModule,
2027
- TuiActiveZoneModule,
2028
- TuiDocNavigationModule], exports: [TuiDocHeaderComponent] });
2029
- TuiDocHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, imports: [[
2030
- CommonModule,
2031
- PolymorpheusModule,
2032
- TuiButtonModule,
2033
- TuiSidebarModule,
2034
- TuiActiveZoneModule,
2035
- TuiDocNavigationModule,
2036
- ]] });
2037
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocHeaderModule, decorators: [{
2038
- type: NgModule,
2039
- args: [{
2040
- imports: [
2041
- CommonModule,
2042
- PolymorpheusModule,
2043
- TuiButtonModule,
2044
- TuiSidebarModule,
2045
- TuiActiveZoneModule,
2046
- TuiDocNavigationModule,
2047
- ],
2048
- declarations: [TuiDocHeaderComponent],
2049
- exports: [TuiDocHeaderComponent],
2050
- }]
2051
- }] });
2052
-
2053
- class TuiDocMainModule {
2054
- }
2055
- TuiDocMainModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2056
- TuiDocMainModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, declarations: [TuiDocMainComponent], imports: [CommonModule,
2057
- RouterModule,
2058
- TuiThemeNightModule,
2059
- TuiDocHeaderModule,
2060
- TuiRootModule,
2061
- TuiDialogModule,
2062
- TuiAlertModule,
2063
- TuiButtonModule,
2064
- TuiModeModule,
2065
- TuiDocNavigationModule], exports: [TuiDocMainComponent] });
2066
- TuiDocMainModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, imports: [[
2067
- CommonModule,
2068
- RouterModule,
2069
- TuiThemeNightModule,
2070
- TuiDocHeaderModule,
2071
- TuiRootModule,
2072
- TuiDialogModule,
2073
- TuiAlertModule,
2074
- TuiButtonModule,
2075
- TuiModeModule,
2076
- TuiDocNavigationModule,
2077
- ]] });
2078
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocMainModule, decorators: [{
2079
- type: NgModule,
2080
- args: [{
2081
- imports: [
2082
- CommonModule,
2083
- RouterModule,
2084
- TuiThemeNightModule,
2085
- TuiDocHeaderModule,
2086
- TuiRootModule,
2087
- TuiDialogModule,
2088
- TuiAlertModule,
2089
- TuiButtonModule,
2090
- TuiModeModule,
2091
- TuiDocNavigationModule,
2092
- ],
2093
- declarations: [TuiDocMainComponent],
2094
- exports: [TuiDocMainComponent],
2095
- }]
2096
- }] });
2097
-
2098
- /**
2099
- * Array of default tab names
2100
- */
2101
- const TUI_DOC_DEFAULT_TABS = new InjectionToken(`[TUI_DOC_DEFAULT_TABS]`, {
2102
- factory: () => [],
2103
- });
2104
-
2105
- /**
2106
- * Array of arrays of related pages
2107
- */
2108
- const TUI_DOC_SEE_ALSO = new InjectionToken(`[TUI_DOC_SEE_ALSO]`, {
2109
- factory: () => [],
2110
- });
2111
-
2112
- /**
2113
- * Array if related page titles
2114
- */
2115
- const PAGE_SEE_ALSO = new InjectionToken(`[PAGE_SEE_ALSO]`);
2116
- const PAGE_PROVIDERS = [
2117
- {
2118
- provide: PAGE_SEE_ALSO,
2119
- deps: [ElementRef, TUI_DOC_SEE_ALSO],
2120
- useFactory: ({ nativeElement }, seeAlsoGroups) => {
2121
- const currentHeader = nativeElement.getAttribute(`header`);
2122
- const groups = seeAlsoGroups.filter(group => group.includes(currentHeader)) || [];
2123
- const seeAlsoSet = new Set(groups
2124
- .join()
2125
- .split(`,`)
2126
- .filter(component => component && component !== currentHeader));
2127
- return Array.from(seeAlsoSet);
2128
- },
2129
- },
2130
- ];
2131
-
2132
- class TuiDocPageTabConnectorDirective {
2133
- constructor(template) {
2134
- this.template = template;
2135
- }
2136
- }
2137
- TuiDocPageTabConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageTabConnectorDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
2138
- TuiDocPageTabConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocPageTabConnectorDirective, selector: "[pageTab]", inputs: { pageTab: "pageTab" }, ngImport: i0 });
2139
- __decorate([
2140
- tuiDefaultProp()
2141
- ], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
2142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageTabConnectorDirective, decorators: [{
2143
- type: Directive,
2144
- args: [{
2145
- selector: '[pageTab]',
2146
- }]
2147
- }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
2148
- type: Inject,
2149
- args: [TemplateRef]
2150
- }] }]; }, propDecorators: { pageTab: [{
2151
- type: Input
2152
- }] } });
2153
-
2154
- /**
2155
- * Source code link
2156
- */
2157
- const TUI_DOC_SOURCE_CODE = new InjectionToken(`[TUI_DOC_SOURCE_CODE]`, {
2158
- factory: () => null,
2159
- });
2160
-
2161
- class TuiDocSourceCodeComponent {
2162
- constructor(sourceCode, text) {
2163
- this.sourceCode = sourceCode;
2164
- this.text = text;
2165
- this.header = '';
2166
- this.package = '';
2167
- this.type = '';
2168
- this.path = '';
2169
- }
2170
- get pathOptions() {
2171
- return this.getPathOptions(this.header, this.package, this.type, this.path);
2172
- }
2173
- getPathOptions(header, packageName, type, path) {
2174
- return {
2175
- header,
2176
- package: packageName,
2177
- type,
2178
- path,
2179
- };
2180
- }
2181
- }
2182
- 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 });
2183
- 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 });
2184
- __decorate([
2185
- tuiPure
2186
- ], TuiDocSourceCodeComponent.prototype, "getPathOptions", null);
2187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeComponent, decorators: [{
2188
- type: Component,
2189
- args: [{
2190
- selector: 'tui-doc-source-code',
2191
- templateUrl: './source-code.template.html',
2192
- changeDetection: ChangeDetectionStrategy.OnPush,
2193
- }]
2194
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2195
- type: Inject,
2196
- args: [TUI_DOC_SOURCE_CODE]
2197
- }] }, { type: undefined, decorators: [{
2198
- type: Inject,
2199
- args: [TUI_DOC_SOURCE_CODE_TEXT]
2200
- }] }]; }, propDecorators: { header: [{
2201
- type: Input
2202
- }], package: [{
2203
- type: Input
2204
- }], type: [{
2205
- type: Input
2206
- }], path: [{
2207
- type: Input
2208
- }], getPathOptions: [] } });
2209
-
2210
- class TuiDocSeeAlsoComponent {
2211
- constructor(text, pages) {
2212
- this.text = text;
2213
- this.pages = pages;
2214
- this.seeAlso = [];
2215
- }
2216
- getRouterLink(pageTitle) {
2217
- var _a, _b;
2218
- return (_b = (_a = this.pages.get(pageTitle)) === null || _a === void 0 ? void 0 : _a.route) !== null && _b !== void 0 ? _b : '';
2219
- }
2220
- }
2221
- 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 });
2222
- 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 });
2223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoComponent, decorators: [{
2224
- type: Component,
2225
- args: [{
2226
- selector: 'tui-doc-see-also',
2227
- templateUrl: './see-also.template.html',
2228
- styleUrls: ['./see-also.style.less'],
2229
- changeDetection: ChangeDetectionStrategy.OnPush,
2230
- }]
2231
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2232
- type: Inject,
2233
- args: [TUI_DOC_SEE_ALSO_TEXT]
2234
- }] }, { type: Map, decorators: [{
2235
- type: Inject,
2236
- args: [TUI_DOC_MAP_PAGES]
2237
- }] }]; }, propDecorators: { seeAlso: [{
2238
- type: Input
2239
- }] } });
2240
-
2241
- class TuiDocPageComponent {
2242
- constructor(defaultTabs, seeAlso) {
2243
- this.defaultTabs = defaultTabs;
2244
- this.seeAlso = seeAlso;
2245
- this.header = '';
2246
- this.package = '';
2247
- this.type = '';
2248
- this.path = '';
2249
- this.deprecated = false;
2250
- this.tabConnectors = EMPTY_QUERY;
2251
- this.activeItemIndex = 0;
2252
- this.from = / /g;
2253
- this.to = '_';
2254
- }
2255
- get showSeeAlso() {
2256
- return !!this.seeAlso.length && this.activeItemIndex === 0;
2257
- }
2258
- }
2259
- 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 });
2260
- 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]", 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 });
2261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageComponent, decorators: [{
2262
- type: Component,
2263
- args: [{
2264
- selector: 'tui-doc-page',
2265
- templateUrl: './page.template.html',
2266
- styleUrls: ['./page.style.less'],
2267
- changeDetection: ChangeDetectionStrategy.OnPush,
2268
- providers: PAGE_PROVIDERS,
2269
- }]
2270
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2271
- type: Inject,
2272
- args: [TUI_DOC_DEFAULT_TABS]
2273
- }] }, { type: undefined, decorators: [{
2274
- type: Inject,
2275
- args: [PAGE_SEE_ALSO]
2276
- }] }]; }, propDecorators: { header: [{
2277
- type: Input
2278
- }], package: [{
2279
- type: Input
2280
- }], type: [{
2281
- type: Input
2282
- }], path: [{
2283
- type: Input
2284
- }], deprecated: [{
2285
- type: Input
2286
- }], tabConnectors: [{
2287
- type: ContentChildren,
2288
- args: [TuiDocPageTabConnectorDirective]
2289
- }] } });
2290
-
2291
- class TuiDocSeeAlsoModule {
2292
- }
2293
- TuiDocSeeAlsoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2294
- TuiDocSeeAlsoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, declarations: [TuiDocSeeAlsoComponent], imports: [CommonModule, RouterModule, TuiLinkModule], exports: [TuiDocSeeAlsoComponent] });
2295
- TuiDocSeeAlsoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, imports: [[CommonModule, RouterModule, TuiLinkModule]] });
2296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSeeAlsoModule, decorators: [{
2297
- type: NgModule,
2298
- args: [{
2299
- imports: [CommonModule, RouterModule, TuiLinkModule],
2300
- declarations: [TuiDocSeeAlsoComponent],
2301
- exports: [TuiDocSeeAlsoComponent],
2302
- }]
2303
- }] });
2304
-
2305
- class TuiDocSourceCodeModule {
2306
- }
2307
- TuiDocSourceCodeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2308
- TuiDocSourceCodeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, declarations: [TuiDocSourceCodeComponent], imports: [CommonModule, PolymorpheusModule, TuiButtonModule], exports: [TuiDocSourceCodeComponent] });
2309
- TuiDocSourceCodeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, imports: [[CommonModule, PolymorpheusModule, TuiButtonModule]] });
2310
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocSourceCodeModule, decorators: [{
2311
- type: NgModule,
2312
- args: [{
2313
- declarations: [TuiDocSourceCodeComponent],
2314
- imports: [CommonModule, PolymorpheusModule, TuiButtonModule],
2315
- exports: [TuiDocSourceCodeComponent],
2316
- }]
2317
- }] });
2318
-
2319
- class TuiDocPageModule {
2320
- }
2321
- TuiDocPageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2322
- TuiDocPageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, declarations: [TuiDocPageComponent, TuiDocPageTabConnectorDirective], imports: [CommonModule,
2323
- RouterModule,
2324
- TuiDocSeeAlsoModule,
2325
- TuiTabsModule,
2326
- TuiTagModule,
2327
- TuiDocSourceCodeModule,
2328
- TuiReplacePipeModule], exports: [TuiDocPageComponent, TuiDocPageTabConnectorDirective] });
2329
- TuiDocPageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, imports: [[
2330
- CommonModule,
2331
- RouterModule,
2332
- TuiDocSeeAlsoModule,
2333
- TuiTabsModule,
2334
- TuiTagModule,
2335
- TuiDocSourceCodeModule,
2336
- TuiReplacePipeModule,
2337
- ]] });
2338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDocPageModule, decorators: [{
2339
- type: NgModule,
2340
- args: [{
2341
- imports: [
2342
- CommonModule,
2343
- RouterModule,
2344
- TuiDocSeeAlsoModule,
2345
- TuiTabsModule,
2346
- TuiTagModule,
2347
- TuiDocSourceCodeModule,
2348
- TuiReplacePipeModule,
2349
- ],
2350
- declarations: [TuiDocPageComponent, TuiDocPageTabConnectorDirective],
2351
- exports: [TuiDocPageComponent, TuiDocPageTabConnectorDirective],
2352
- }]
2353
- }] });
2354
-
2355
- const TUI_DOC_RUSSIAN = [
2356
- {
2357
- provide: TUI_DOC_DEMO_TEXTS,
2358
- useValue: [`Сделано с помощью директивы: `, `Фон`, `Детали формы`],
2359
- },
2360
- {
2361
- provide: TUI_DOC_DOCUMENTATION_TEXTS,
2362
- useValue: [
2363
- `Аргумент`,
2364
- `Тип`,
2365
- `Имя и описание`,
2366
- `Значение`,
2367
- `Для работы с динамическими шаблонами используется`,
2368
- ],
2369
- },
2370
- {
2371
- provide: TUI_DOC_EXAMPLE_TEXTS,
2372
- useValue: [`Превью`, `Ссылка на пример скопирована`, `Готово`],
2373
- },
2374
- {
2375
- provide: TUI_DOC_MENU_TEXT,
2376
- useValue: `Меню`,
2377
- },
2378
- {
2379
- provide: TUI_DOC_SEARCH_TEXT,
2380
- useValue: `Поиск`,
2381
- },
2382
- {
2383
- provide: TUI_DOC_SEE_ALSO_TEXT,
2384
- useValue: `Смотрите также`,
2385
- },
2386
- {
2387
- provide: TUI_DOC_SOURCE_CODE_TEXT,
2388
- useValue: `Исходный код`,
2389
- },
2390
- ];
2
+ import { NgModule } from '@angular/core';
3
+ import { TuiDocCodeModule, TuiDocDemoModule, TuiDocDocumentationModule, TuiDocPageModule, TuiDocExampleModule } from '@taiga-ui/addon-doc/components';
4
+ export * from '@taiga-ui/addon-doc/components';
5
+ export * from '@taiga-ui/addon-doc/directives';
6
+ export * from '@taiga-ui/addon-doc/interfaces';
7
+ export * from '@taiga-ui/addon-doc/languages';
8
+ export * from '@taiga-ui/addon-doc/services';
9
+ export * from '@taiga-ui/addon-doc/tokens';
10
+ export * from '@taiga-ui/addon-doc/types';
11
+ export * from '@taiga-ui/addon-doc/utils';
2391
12
 
2392
13
  class TuiAddonDocModule {
2393
14
  }
@@ -2415,28 +36,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
2415
36
  }]
2416
37
  }] });
2417
38
 
2418
- function tuiGenerateRoutes(type) {
2419
- return [
2420
- {
2421
- path: ``,
2422
- component: type,
2423
- children: [
2424
- {
2425
- path: `:tab`,
2426
- component: type,
2427
- },
2428
- ],
2429
- },
2430
- ];
2431
- }
2432
-
2433
- /**
2434
- * Public API Surface of @taiga-ui/addon-doc
2435
- */
2436
-
2437
39
  /**
2438
40
  * Generated bundle index. Do not edit.
2439
41
  */
2440
42
 
2441
- export { TUI_DOC_CODE_ACTIONS, TUI_DOC_CODE_EDITOR, TUI_DOC_DEFAULT_TABS, TUI_DOC_DEMO_TEXTS, TUI_DOC_DOCUMENTATION_TEXTS, TUI_DOC_EXAMPLE_CONTENT_PROCESSOR, TUI_DOC_EXAMPLE_DEFAULT_OPTIONS, TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR, TUI_DOC_EXAMPLE_OPTIONS, TUI_DOC_EXAMPLE_TEXTS, TUI_DOC_EXCLUDED_PROPERTIES, TUI_DOC_LOGO, TUI_DOC_MAP_PAGES, TUI_DOC_MENU_TEXT, TUI_DOC_PAGES, TUI_DOC_PAGE_LOADED, TUI_DOC_RUSSIAN, TUI_DOC_SCROLL_BEHAVIOR, TUI_DOC_SEARCH_TEXT, TUI_DOC_SEE_ALSO, TUI_DOC_SEE_ALSO_TEXT, TUI_DOC_SOURCE_CODE, TUI_DOC_SOURCE_CODE_TEXT, TUI_DOC_TITLE, TUI_DOC_URL_STATE_HANDLER, TUI_EXAMPLE_PRIMARY_FILE_NAME, TUI_THEME_DEFAULT_NAME, TUI_THEME_NAME, TUI_THEME_NIGHT_STORAGE_DEFAULT_KEY, TUI_THEME_NIGHT_STORAGE_KEY, TUI_THEME_STORAGE_DEFAULT_KEY, TUI_THEME_STORAGE_KEY, TUI_USE_DEFAULT_NIGHT_THEME, TuiAddonDocModule, TuiDocCodeComponent, TuiDocCodeModule, TuiDocCopyComponent, TuiDocCopyModule, TuiDocDemoComponent, TuiDocDemoModule, TuiDocDocumentationComponent, TuiDocDocumentationModule, TuiDocDocumentationPropertyConnectorDirective, TuiDocExampleCapitalizePipe, TuiDocExampleComponent, TuiDocExampleGetTabsPipe, TuiDocExampleModule, TuiDocMainComponent, TuiDocMainModule, TuiDocNavigationComponent, TuiDocNavigationModule, TuiDocPageComponent, TuiDocPageModule, TuiDocPageTabConnectorDirective, TuiInspectPipe, TuiLanguageSwitcherComponent, TuiLanguageSwitcherModule, TuiScrollIntoViewLinkDirective, TuiScrollIntoViewLinkModule, TuiThemeNightService, TuiThemeService, tuiCoerceValue, tuiCoerceValueIsTrue, tuiDocExampleOptionsProvider, tuiDocExcludeProperties, tuiGenerateRoutes, tuiRawLoad, tuiRawLoadRecord, tuiTryParseMarkdownCodeBlock };
43
+ export { TuiAddonDocModule };
2442
44
  //# sourceMappingURL=taiga-ui-addon-doc.js.map