@taiga-ui/addon-doc 2.23.0 → 2.27.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 (101) hide show
  1. package/README.md +123 -135
  2. package/bundles/taiga-ui-addon-doc.umd.js +985 -931
  3. package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
  4. package/bundles/taiga-ui-addon-doc.umd.min.js +2 -2
  5. package/bundles/taiga-ui-addon-doc.umd.min.js.map +1 -1
  6. package/components/code/code.component.d.ts +4 -1
  7. package/components/demo/demo.component.d.ts +8 -8
  8. package/components/documentation/documentation-property-connector.directive.d.ts +1 -1
  9. package/components/example/example-get-tabs.pipe.d.ts +4 -0
  10. package/components/example/example.component.d.ts +4 -7
  11. package/components/navigation/navigation.component.d.ts +1 -1
  12. package/components/page/page.component.d.ts +1 -1
  13. package/esm2015/addon-doc.module.js +1 -1
  14. package/esm2015/components/code/code.component.js +11 -4
  15. package/esm2015/components/code/code.module.js +1 -1
  16. package/esm2015/components/copy/copy.component.js +2 -2
  17. package/esm2015/components/copy/copy.module.js +1 -1
  18. package/esm2015/components/demo/demo.component.js +13 -13
  19. package/esm2015/components/demo/demo.module.js +1 -1
  20. package/esm2015/components/documentation/documentation-property-connector.directive.js +6 -7
  21. package/esm2015/components/documentation/documentation.component.js +2 -2
  22. package/esm2015/components/documentation/documentation.module.js +2 -2
  23. package/esm2015/components/example/example-get-tabs.pipe.js +12 -0
  24. package/esm2015/components/example/example.component.js +8 -26
  25. package/esm2015/components/example/example.module.js +4 -3
  26. package/esm2015/components/main/main.module.js +1 -1
  27. package/esm2015/components/navigation/navigation.component.js +3 -3
  28. package/esm2015/components/navigation/navigation.module.js +1 -1
  29. package/esm2015/components/navigation/navigation.providers.js +1 -1
  30. package/esm2015/components/page/page.component.js +4 -4
  31. package/esm2015/components/page/page.module.js +2 -2
  32. package/esm2015/components/page/page.providers.js +1 -1
  33. package/esm2015/directives/scroll-into-view/scroll-into-view.module.js +1 -1
  34. package/esm2015/interfaces/page.js +1 -1
  35. package/esm2015/internal/header/header.component.js +2 -2
  36. package/esm2015/internal/header/header.module.js +1 -1
  37. package/esm2015/internal/input-opacity/input-opacity.module.js +1 -1
  38. package/esm2015/internal/see-also/see-also.component.js +2 -2
  39. package/esm2015/internal/see-also/see-also.module.js +1 -1
  40. package/esm2015/internal/source-code/source-code.component.js +2 -2
  41. package/esm2015/internal/source-code/source-code.module.js +1 -1
  42. package/esm2015/languages/russian.js +1 -1
  43. package/esm2015/public-api.js +5 -5
  44. package/esm2015/taiga-ui-addon-doc.js +12 -11
  45. package/esm2015/tokens/code-editor.js +1 -1
  46. package/esm2015/tokens/example-content-processor.js +2 -4
  47. package/esm2015/tokens/i18n.js +13 -5
  48. package/esm2015/tokens/pages.js +1 -1
  49. package/esm2015/tokens/source-code.js +1 -1
  50. package/esm2015/utils/raw-load-record.js +12 -0
  51. package/esm2015/utils/raw-load.js +7 -0
  52. package/esm5/addon-doc.module.js +1 -1
  53. package/esm5/components/code/code.component.js +15 -4
  54. package/esm5/components/code/code.module.js +1 -1
  55. package/esm5/components/copy/copy.component.js +2 -2
  56. package/esm5/components/copy/copy.module.js +1 -1
  57. package/esm5/components/demo/demo.component.js +13 -13
  58. package/esm5/components/demo/demo.module.js +1 -1
  59. package/esm5/components/documentation/documentation-property-connector.directive.js +6 -7
  60. package/esm5/components/documentation/documentation.component.js +2 -2
  61. package/esm5/components/documentation/documentation.module.js +2 -2
  62. package/esm5/components/example/example-get-tabs.pipe.js +15 -0
  63. package/esm5/components/example/example.component.js +9 -43
  64. package/esm5/components/example/example.module.js +4 -3
  65. package/esm5/components/main/main.module.js +1 -1
  66. package/esm5/components/navigation/navigation.component.js +3 -3
  67. package/esm5/components/navigation/navigation.module.js +1 -1
  68. package/esm5/components/navigation/navigation.providers.js +1 -1
  69. package/esm5/components/page/page.component.js +4 -4
  70. package/esm5/components/page/page.module.js +2 -2
  71. package/esm5/components/page/page.providers.js +1 -1
  72. package/esm5/directives/scroll-into-view/scroll-into-view.module.js +1 -1
  73. package/esm5/interfaces/page.js +1 -1
  74. package/esm5/internal/header/header.component.js +2 -2
  75. package/esm5/internal/header/header.module.js +1 -1
  76. package/esm5/internal/input-opacity/input-opacity.module.js +1 -1
  77. package/esm5/internal/see-also/see-also.component.js +2 -2
  78. package/esm5/internal/see-also/see-also.module.js +1 -1
  79. package/esm5/internal/source-code/source-code.component.js +2 -2
  80. package/esm5/internal/source-code/source-code.module.js +1 -1
  81. package/esm5/languages/russian.js +1 -1
  82. package/esm5/public-api.js +5 -5
  83. package/esm5/taiga-ui-addon-doc.js +12 -11
  84. package/esm5/tokens/code-editor.js +1 -1
  85. package/esm5/tokens/example-content-processor.js +2 -4
  86. package/esm5/tokens/i18n.js +13 -5
  87. package/esm5/tokens/pages.js +1 -1
  88. package/esm5/tokens/source-code.js +1 -1
  89. package/esm5/utils/raw-load-record.js +44 -0
  90. package/esm5/utils/raw-load.js +21 -0
  91. package/fesm2015/taiga-ui-addon-doc.js +603 -587
  92. package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
  93. package/fesm5/taiga-ui-addon-doc.js +972 -919
  94. package/fesm5/taiga-ui-addon-doc.js.map +1 -1
  95. package/interfaces/page.d.ts +4 -0
  96. package/package.json +7 -6
  97. package/public-api.d.ts +4 -4
  98. package/taiga-ui-addon-doc.d.ts +11 -10
  99. package/taiga-ui-addon-doc.metadata.json +1 -1
  100. package/utils/raw-load-record.d.ts +2 -0
  101. package/utils/raw-load.d.ts +2 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ngx-highlightjs'), require('@taiga-ui/cdk'), require('@taiga-ui/kit'), require('rxjs'), require('rxjs/operators'), require('@taiga-ui/core'), require('@angular/forms'), require('@angular/router'), require('@angular/platform-browser'), require('@taiga-ui/addon-mobile'), require('@angular/animations'), require('@angular/cdk/clipboard'), require('@ng-web-apis/common'), require('@tinkoff/ng-polymorpheus')) :
3
- typeof define === 'function' && define.amd ? define('@taiga-ui/addon-doc', ['exports', '@angular/core', '@angular/common', 'ngx-highlightjs', '@taiga-ui/cdk', '@taiga-ui/kit', 'rxjs', 'rxjs/operators', '@taiga-ui/core', '@angular/forms', '@angular/router', '@angular/platform-browser', '@taiga-ui/addon-mobile', '@angular/animations', '@angular/cdk/clipboard', '@ng-web-apis/common', '@tinkoff/ng-polymorpheus'], factory) :
4
- (global = global || self, factory((global['taiga-ui'] = global['taiga-ui'] || {}, global['taiga-ui']['addon-doc'] = {}), global.ng.core, global.ng.common, global.ngxHighlightjs, global.cdk, global.kit, global.rxjs, global.rxjs.operators, global.core$1, global.ng.forms, global.ng.router, global.ng.platformBrowser, global.addonMobile, global.ng.animations, global.ng.cdk.clipboard, global.common$1, global.ngPolymorpheus));
5
- }(this, (function (exports, core, common, ngxHighlightjs, cdk, kit, rxjs, operators, core$1, forms, router, platformBrowser, addonMobile, animations, clipboard, common$1, ngPolymorpheus) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('ngx-highlightjs'), require('@taiga-ui/cdk'), require('@taiga-ui/kit'), require('@taiga-ui/core'), require('@angular/forms'), require('@angular/router'), require('@angular/animations'), require('@angular/cdk/clipboard'), require('@ng-web-apis/common'), require('@tinkoff/ng-polymorpheus'), require('@taiga-ui/addon-mobile'), require('@angular/platform-browser')) :
3
+ typeof define === 'function' && define.amd ? define('@taiga-ui/addon-doc', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/common', 'ngx-highlightjs', '@taiga-ui/cdk', '@taiga-ui/kit', '@taiga-ui/core', '@angular/forms', '@angular/router', '@angular/animations', '@angular/cdk/clipboard', '@ng-web-apis/common', '@tinkoff/ng-polymorpheus', '@taiga-ui/addon-mobile', '@angular/platform-browser'], factory) :
4
+ (global = global || self, factory((global['taiga-ui'] = global['taiga-ui'] || {}, global['taiga-ui']['addon-doc'] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.common, global.ngxHighlightjs, global.cdk, global.kit, global.core$1, global.ng.forms, global.ng.router, global.ng.animations, global.ng.cdk.clipboard, global.common$1, global.ngPolymorpheus, global.addonMobile, global.ng.platformBrowser));
5
+ }(this, (function (exports, core, rxjs, operators, common, ngxHighlightjs, cdk, kit, core$1, forms, router, animations, clipboard, common$1, ngPolymorpheus, addonMobile, platformBrowser) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -223,11 +223,39 @@
223
223
  return value;
224
224
  }
225
225
 
226
+ function rawLoad(content) {
227
+ return __awaiter(this, void 0, void 0, function () {
228
+ var _a;
229
+ return __generator(this, function (_b) {
230
+ switch (_b.label) {
231
+ case 0:
232
+ if (!(content instanceof Promise)) return [3 /*break*/, 2];
233
+ return [4 /*yield*/, content];
234
+ case 1:
235
+ _a = (_b.sent()).default;
236
+ return [3 /*break*/, 3];
237
+ case 2:
238
+ _a = content;
239
+ _b.label = 3;
240
+ case 3: return [2 /*return*/, _a];
241
+ }
242
+ });
243
+ });
244
+ }
245
+
226
246
  var TuiDocCodeComponent = /** @class */ (function () {
227
247
  function TuiDocCodeComponent() {
248
+ this.rawLoader$$ = new rxjs.BehaviorSubject('');
228
249
  this.filename = '';
229
- this.code = '';
250
+ this.processor$ = this.rawLoader$$.pipe(operators.switchMap(rawLoad));
230
251
  }
252
+ Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
253
+ set: function (code) {
254
+ this.rawLoader$$.next(code);
255
+ },
256
+ enumerable: true,
257
+ configurable: true
258
+ });
231
259
  Object.defineProperty(TuiDocCodeComponent.prototype, "hasFilename", {
232
260
  get: function () {
233
261
  return !!this.filename;
@@ -240,14 +268,14 @@
240
268
  ], TuiDocCodeComponent.prototype, "filename", void 0);
241
269
  __decorate([
242
270
  core.Input()
243
- ], TuiDocCodeComponent.prototype, "code", void 0);
271
+ ], TuiDocCodeComponent.prototype, "code", null);
244
272
  __decorate([
245
273
  core.HostBinding('class._has-filename')
246
274
  ], TuiDocCodeComponent.prototype, "hasFilename", null);
247
275
  TuiDocCodeComponent = __decorate([
248
276
  core.Component({
249
277
  selector: 'tui-doc-code',
250
- template: "<p *ngIf=\"filename\" class=\"t-header\">{{filename}}</p>\n<pre class=\"t-code\"><code [lineNumbers]=\"true\" [highlight]=\"code\"></code></pre>\n",
278
+ template: "<p *ngIf=\"filename\" class=\"t-header\">{{filename}}</p>\n<pre\n class=\"t-code\"\n><code [lineNumbers]=\"true\" [highlight]=\"processor$ | async\"></code></pre>\n",
251
279
  styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:700}.t-code{margin:0}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear-disabled);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.hljs:not(:empty)::-webkit-scrollbar,.hljs:not(:empty)::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.hljs:not(:empty)::-webkit-scrollbar{background-color:transparent}.hljs:not(:empty)::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.hljs:not(:empty)::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.hljs:not(:empty)::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host._has-filename .hljs:not(:empty){border-radius:.75rem}@media screen and (max-width:47.9375em){.hljs:not(:empty){padding:1rem}}"]
252
280
  })
253
281
  ], TuiDocCodeComponent);
@@ -293,7 +321,7 @@
293
321
  TuiDocCopyComponent = __decorate([
294
322
  core.Component({
295
323
  selector: 'tui-doc-copy',
296
- template: "<button\n *ngIf=\"texts$ | async as texts\"\n tuiButton\n type=\"button\"\n class=\"t-copy\"\n appearance=\"\"\n size=\"s\"\n [title]=\"texts[0]\"\n (click)=\"onClick()\"\n>\n <span class=\"t-content\" [class.t-content_moved]=\"copied$ | async\">\n <span class=\"t-initial\" [attr.data-text]=\"texts[0]\">\n <ng-content></ng-content>\n </span>\n {{texts[1]}}\n </span>\n</button>\n",
324
+ template: "<button\n *ngIf=\"texts$ | async as texts\"\n tuiButton\n type=\"button\"\n appearance=\"\"\n size=\"s\"\n class=\"t-copy\"\n [title]=\"texts[0]\"\n (click)=\"onClick()\"\n>\n <span class=\"t-content\" [class.t-content_moved]=\"copied$ | async\">\n <span class=\"t-initial\" [attr.data-text]=\"texts[0]\">\n <ng-content></ng-content>\n </span>\n {{ texts[1] }}\n </span>\n</button>\n",
297
325
  changeDetection: core.ChangeDetectionStrategy.OnPush,
298
326
  providers: [cdk.TuiDestroyService],
299
327
  styles: [":host{position:relative;display:inline-block;vertical-align:middle}.t-copy{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:100%;color:var(--tui-text-01);background:var(--tui-base-01);overflow:hidden}.t-copy:hover{background:var(--tui-base-02)}.t-initial{white-space:nowrap}.t-initial:empty:before{content:attr(data-text)}.t-content{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;flex-direction:column;transform:translateY(1rem);text-align:center;line-height:2rem}.t-content_moved{transform:translateY(-1rem)}"]
@@ -323,7 +351,9 @@
323
351
  * Works with a tuple
324
352
  * [@string tuiMode tooltip content, @string word 'background', @string 'form value']
325
353
  */
326
- var TUI_DOC_DEMO_TEXTS = new core.InjectionToken('tui-doc-demo i18n texts', { factory: function () { return ['Read more more about modes: ', 'Background', 'Form value']; } });
354
+ var TUI_DOC_DEMO_TEXTS = new core.InjectionToken('tui-doc-demo i18n texts', {
355
+ factory: function () { return ['Read more more about modes: ', 'Background', 'Form value']; },
356
+ });
327
357
  /**
328
358
  * Works with a tuple
329
359
  * [
@@ -351,15 +381,21 @@
351
381
  * @string link to a sample copied message label
352
382
  * ]
353
383
  */
354
- var TUI_DOC_EXAMPLE_TEXTS = new core.InjectionToken('tui-doc-example i18n texts', { factory: function () { return ['Preview', 'Link to a sample was successfully copied', 'Done']; } });
384
+ var TUI_DOC_EXAMPLE_TEXTS = new core.InjectionToken('tui-doc-example i18n texts', {
385
+ factory: function () { return ['Preview', 'Link to a sample was successfully copied', 'Done']; },
386
+ });
355
387
  var TUI_DOC_MENU_TEXT = new core.InjectionToken('menu i18n text', {
356
388
  factory: function () { return 'Menu'; },
357
389
  });
358
390
  var TUI_DOC_SEARCH_TEXT = new core.InjectionToken('search i18n text', {
359
391
  factory: function () { return 'Search'; },
360
392
  });
361
- var TUI_DOC_SEE_ALSO_TEXT = new core.InjectionToken('tui-doc-see-also i18n text', { factory: function () { return 'See also'; } });
362
- var TUI_DOC_SOURCE_CODE_TEXT = new core.InjectionToken('tui-doc-source-code i18n text', { factory: function () { return 'Source code'; } });
393
+ var TUI_DOC_SEE_ALSO_TEXT = new core.InjectionToken('tui-doc-see-also i18n text', {
394
+ factory: function () { return 'See also'; },
395
+ });
396
+ var TUI_DOC_SOURCE_CODE_TEXT = new core.InjectionToken('tui-doc-source-code i18n text', {
397
+ factory: function () { return 'Source code'; },
398
+ });
363
399
 
364
400
  var MIN_COMPONENT_WIDTH = 104;
365
401
  // @dynamic
@@ -370,6 +406,8 @@
370
406
  this.destroy$ = destroy$;
371
407
  this.renderer = renderer;
372
408
  this.texts = texts;
409
+ this.initialX = 0;
410
+ this.wrapperWidth = 0;
373
411
  this.control = null;
374
412
  this.updateOnVariants = ['change', 'blur', 'submit'];
375
413
  this.updateOn = 'change';
@@ -379,8 +417,6 @@
379
417
  this.mode = null;
380
418
  this.change$ = new rxjs.Subject();
381
419
  this.items = ['onLight', 'onDark'];
382
- this.initialX = 0;
383
- this.wrapperWidth = 0;
384
420
  this.isBrowser = common.isPlatformBrowser(platformId);
385
421
  var parsedMode = locationRef.path().match(/tui-mode=(onDark|onLight)/);
386
422
  if (parsedMode !== null && parsedMode.length > 0) {
@@ -397,6 +433,9 @@
397
433
  });
398
434
  }
399
435
  TuiDocDemoComponent_1 = TuiDocDemoComponent;
436
+ TuiDocDemoComponent.prototype.onResize = function () {
437
+ this.setResizerTextContent();
438
+ };
400
439
  TuiDocDemoComponent.prototype.ngOnInit = function () {
401
440
  this.createForm();
402
441
  };
@@ -413,9 +452,6 @@
413
452
  var offsetWidth = this.content.nativeElement.offsetWidth;
414
453
  this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
415
454
  };
416
- TuiDocDemoComponent.prototype.onResize = function () {
417
- this.setResizerTextContent();
418
- };
419
455
  TuiDocDemoComponent.prototype.onDragStart = function (event) {
420
456
  event.preventDefault();
421
457
  this.initialX = event.clientX;
@@ -459,12 +495,6 @@
459
495
  { type: router.UrlSerializer, decorators: [{ type: core.Inject, args: [router.UrlSerializer,] }] },
460
496
  { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
461
497
  ]; };
462
- __decorate([
463
- core.Input()
464
- ], TuiDocDemoComponent.prototype, "control", void 0);
465
- __decorate([
466
- core.ContentChild(core.TemplateRef)
467
- ], TuiDocDemoComponent.prototype, "template", void 0);
468
498
  __decorate([
469
499
  core.ViewChild('content')
470
500
  ], TuiDocDemoComponent.prototype, "content", void 0);
@@ -474,13 +504,19 @@
474
504
  __decorate([
475
505
  core.ViewChild('resizerText')
476
506
  ], TuiDocDemoComponent.prototype, "resizerText", void 0);
507
+ __decorate([
508
+ core.Input()
509
+ ], TuiDocDemoComponent.prototype, "control", void 0);
510
+ __decorate([
511
+ core.ContentChild(core.TemplateRef)
512
+ ], TuiDocDemoComponent.prototype, "template", void 0);
477
513
  __decorate([
478
514
  core.HostListener('window:resize')
479
515
  ], TuiDocDemoComponent.prototype, "onResize", null);
480
516
  TuiDocDemoComponent = TuiDocDemoComponent_1 = __decorate([
481
517
  core.Component({
482
518
  selector: 'tui-doc-demo',
483
- template: "<div class=\"t-bg-toggle\" [tuiMode]=\"null\">\n <ng-template #tooltip>\n {{texts[0]}}\n <a tuiLink tuiMode=\"onDark\" routerLink=\"/directives/mode\">\n <code>tuiMode</code>\n </a>\n </ng-template>\n <ng-container *ngIf=\"isMobile else desktop\">\n <tui-select\n class=\"t-mode\"\n tuiTextfieldSize=\"s\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiHintContent]=\"tooltip\"\n [formControl]=\"modeControl\"\n >\n tuiMode\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"items\"\n ></tui-data-list-wrapper>\n </tui-select>\n </ng-container>\n <ng-template #desktop>\n tuiMode:\n <tui-tooltip describeId=\"form\" [content]=\"tooltip\"></tui-tooltip>\n <div tuiGroup class=\"tui-space_left-3\" [collapsed]=\"true\">\n <tui-radio-block\n class=\"tui-group__auto-width-item\"\n size=\"s\"\n nativeId=\"form\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n null\n </tui-radio-block>\n <tui-radio-block\n class=\"tui-group__auto-width-item\"\n item=\"onDark\"\n size=\"s\"\n nativeId=\"form\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onDark\n </tui-radio-block>\n <tui-radio-block\n class=\"tui-group__auto-width-item\"\n item=\"onLight\"\n size=\"s\"\n nativeId=\"form\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n class=\"tui-space_left-3\"\n size=\"m\"\n [(ngModel)]=\"opaque\"\n >\n {{texts[1]}}\n </tui-checkbox-labeled>\n</div>\n<div\n #wrapper\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"modeControl.value === 'onDark'\"\n [class.t-wrapper_gray]=\"modeControl.value === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div #content id=\"demoContent\" class=\"t-content\">\n <form *ngIf=\"testForm\" class=\"t-form\" [formGroup]=\"testForm\">\n <div class=\"t-input-wrapper\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n </div>\n <button\n tuiButton\n type=\"button\"\n class=\"tui-space_top-3\"\n size=\"s\"\n [iconRight]=\"icon\"\n (click)=\"toggleDetails()\"\n >\n {{texts[2]}}\n </button>\n <ng-template #icon>\n <tui-svg\n src=\"tuiIconChevronDown\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"expanded\"\n ></tui-svg>\n </ng-template>\n <tui-expand class=\"t-expand\" [expanded]=\"expanded\">\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">\nForm data: {{testForm.value | json}}</pre\n >\n <div tuiGroup class=\"tui-space_top-3\">\n <tui-select\n class=\"t-select\"\n tuiTextfieldSize=\"s\"\n [ngModel]=\"updateOn\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"updateOnChange($event)\"\n >\n updateOn\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"updateOnVariants\"\n ></tui-data-list-wrapper>\n </tui-select>\n <button\n tuiButton\n class=\"tui-group__auto-width-item\"\n type=\"reset\"\n size=\"s\"\n >\n Reset\n </button>\n <button\n tuiButton\n class=\"tui-group__auto-width-item\"\n type=\"submit\"\n size=\"s\"\n >\n Submit\n </button>\n </div>\n </ng-template>\n </tui-expand>\n </form>\n <ng-content></ng-content>\n </div>\n <button\n class=\"t-resizer\"\n tabindex=\"-1\"\n (tuiDragStart)=\"onDragStart($event)\"\n (tuiDragContinues)=\"onDragContinues($event)\"\n (tuiDragEnd)=\"onDragEnd()\"\n >\n <span #resizerText class=\"t-resizer-text\"></span>\n </button>\n</div>\n",
519
+ template: "<div class=\"t-bg-toggle\" [tuiMode]=\"null\">\n <ng-template #tooltip>\n {{ texts[0] }}\n <a tuiLink tuiMode=\"onDark\" routerLink=\"/directives/mode\">\n <code>tuiMode</code>\n </a>\n </ng-template>\n <ng-container *ngIf=\"isMobile; else desktop\">\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-mode\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiHintContent]=\"tooltip\"\n [formControl]=\"modeControl\"\n >\n tuiMode\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"items\"\n ></tui-data-list-wrapper>\n </tui-select>\n </ng-container>\n <ng-template #desktop>\n tuiMode:\n <tui-tooltip describeId=\"form\" [content]=\"tooltip\"></tui-tooltip>\n <div tuiGroup class=\"tui-space_left-3\" [collapsed]=\"true\">\n <tui-radio-block\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n null\n </tui-radio-block>\n <tui-radio-block\n item=\"onDark\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onDark\n </tui-radio-block>\n <tui-radio-block\n item=\"onLight\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n size=\"m\"\n class=\"tui-space_left-3\"\n [(ngModel)]=\"opaque\"\n >\n {{ texts[1] }}\n </tui-checkbox-labeled>\n</div>\n<div\n #wrapper\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"modeControl.value === 'onDark'\"\n [class.t-wrapper_gray]=\"modeControl.value === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div #content id=\"demoContent\" class=\"t-content\">\n <form *ngIf=\"testForm\" class=\"t-form\" [formGroup]=\"testForm\">\n <div class=\"t-input-wrapper\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n </div>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n class=\"tui-space_top-3\"\n [iconRight]=\"icon\"\n (click)=\"toggleDetails()\"\n >\n {{ texts[2] }}\n </button>\n <ng-template #icon>\n <tui-svg\n src=\"tuiIconChevronDown\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"expanded\"\n ></tui-svg>\n </ng-template>\n <tui-expand class=\"t-expand\" [expanded]=\"expanded\">\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">\nForm data: {{ testForm.value | json }}</pre\n >\n <div tuiGroup class=\"tui-space_top-3\">\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-select\"\n [ngModel]=\"updateOn\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"updateOnChange($event)\"\n >\n updateOn\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"updateOnVariants\"\n ></tui-data-list-wrapper>\n </tui-select>\n <button\n tuiButton\n type=\"reset\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Reset\n </button>\n <button\n tuiButton\n type=\"submit\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Submit\n </button>\n </div>\n </ng-template>\n </tui-expand>\n </form>\n <ng-content></ng-content>\n </div>\n <button\n tabindex=\"-1\"\n class=\"t-resizer\"\n (tuiDragStart)=\"onDragStart($event)\"\n (tuiDragContinues)=\"onDragContinues($event)\"\n (tuiDragEnd)=\"onDragEnd()\"\n >\n <span #resizerText class=\"t-resizer-text\"></span>\n </button>\n</div>\n",
484
520
  changeDetection: core.ChangeDetectionStrategy.OnPush,
485
521
  providers: [
486
522
  cdk.TuiDestroyService,
@@ -535,995 +571,1012 @@
535
571
  return TuiDocDemoModule;
536
572
  }());
537
573
 
538
- var MAP = {
539
- а: 'f',
540
- б: ',',
541
- в: 'd',
542
- г: 'u',
543
- д: 'l',
544
- е: 't',
545
- ё: '`',
546
- ж: ';',
547
- з: 'p',
548
- и: 'b',
549
- й: 'q',
550
- к: 'r',
551
- л: 'k',
552
- м: 'v',
553
- н: 'y',
554
- о: 'j',
555
- п: 'g',
556
- р: 'h',
557
- с: 'c',
558
- т: 'n',
559
- у: 'e',
560
- ф: 'a',
561
- х: '[',
562
- ц: 'w',
563
- ч: 'x',
564
- ш: 'i',
565
- щ: 'o',
566
- ъ: ']',
567
- ы: 's',
568
- ь: 'm',
569
- ю: '.',
570
- я: 'z',
571
- };
572
- /**
573
- * Translates text mistakenly typed in the Russian layout into English
574
- * @param string string with Russian layout characters
575
- * @return string with English layout characters
576
- */
577
- function transliterateKeyboardLayout(string) {
578
- var newStr = '';
579
- for (var i = 0; i < string.length; i++) {
580
- newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
581
- }
582
- return newStr;
574
+ function rgbToHex(r, g, b) {
575
+ return ('#' +
576
+ [r, g, b]
577
+ .map(function (x) {
578
+ var hex = x.toString(16);
579
+ return hex.length === 1 ? '0' + hex : hex;
580
+ })
581
+ .join(''));
582
+ }
583
+ function hexToRgb(hex) {
584
+ var matches = hex
585
+ .replace('#', '')
586
+ .split('')
587
+ .map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
588
+ .join('')
589
+ .match(/.{2}/g);
590
+ return matches
591
+ ? matches.map(function (x) { return Number.parseInt(x, 16); })
592
+ : [0, 0, 0];
583
593
  }
584
594
 
585
- var TUI_DOC_PAGES = new core.InjectionToken('Documentation pages', {
586
- factory: function () { return []; },
587
- });
588
-
589
- var TUI_DOC_TITLE = new core.InjectionToken('Page title', {
590
- factory: function () { return ''; },
591
- });
592
-
593
- var NAVIGATION_TITLE = new core.InjectionToken('Page title');
594
- var NAVIGATION_LABELS = new core.InjectionToken('Navigation sections labels for search');
595
- var NAVIGATION_ITEMS = new core.InjectionToken('Navigation pages');
596
- var NAVIGATION_PROVIDERS = [
597
- cdk.TuiDestroyService,
598
- {
599
- provide: NAVIGATION_TITLE,
600
- deps: [router.Router, router.ActivatedRoute, TUI_DOC_TITLE, cdk.TuiDestroyService],
601
- useFactory: titleProviderFactory,
602
- },
603
- {
604
- provide: NAVIGATION_LABELS,
605
- deps: [TUI_DOC_PAGES],
606
- useFactory: labelsProviderFactory,
607
- },
608
- {
609
- provide: NAVIGATION_ITEMS,
610
- deps: [TUI_DOC_PAGES],
611
- useFactory: itemsProviderFactory,
612
- },
613
- ];
614
- function titleProviderFactory(router$1, activatedRoute, titlePrefix, destroy$) {
615
- return router$1.events.pipe(operators.filter(function (event) { return event instanceof router.NavigationEnd; }), operators.map(function () { return activatedRoute.firstChild; }), operators.filter(cdk.isPresent), operators.mergeMap(function (_a) {
616
- var data = _a.data;
617
- return data;
618
- }), operators.map(function (_a) {
619
- var title = _a.title;
620
- return titlePrefix + title;
621
- }), operators.takeUntil(destroy$));
595
+ function inspectArray(array, depth) {
596
+ if (depth === 0) {
597
+ return '[…]';
598
+ }
599
+ var result = '';
600
+ var first = true;
601
+ for (var index = 0; index < array.length; index++) {
602
+ if (first) {
603
+ first = false;
604
+ }
605
+ else {
606
+ result += ', ';
607
+ }
608
+ result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
609
+ }
610
+ return "[" + result + "]";
622
611
  }
623
- function labelsProviderFactory(pages) {
624
- return pages
625
- .map(function (_a) {
626
- var section = _a.section;
627
- return section;
628
- })
629
- .filter(cdk.isPresent)
630
- .filter(function (item, index, array) { return array.indexOf(item) === index; });
612
+ function inspectObject(object, depth) {
613
+ if (depth === 0) {
614
+ return "{\u2026}";
615
+ }
616
+ var result = '';
617
+ var first = true;
618
+ for (var key in object) {
619
+ if (!object.hasOwnProperty(key)) {
620
+ continue;
621
+ }
622
+ if (first) {
623
+ first = false;
624
+ }
625
+ else {
626
+ result += ', ';
627
+ }
628
+ result += key + ": " + inspectAny(object[key], depth - 1);
629
+ }
630
+ return "{" + result + "}";
631
631
  }
632
- function itemsProviderFactory(pages) {
633
- var labels = labelsProviderFactory(pages);
634
- return __spread(labels.map(function (label) { return pages.filter(function (_a) {
635
- var section = _a.section;
636
- return section === label;
637
- }); }), [
638
- pages.filter(function (page) { return !page.section; }),
639
- ]);
632
+ // @bad TODO add more types
633
+ /**
634
+ * Returns readable JS entity
635
+ * @param data
636
+ * @param depth
637
+ * @return readable JS entity
638
+ */
639
+ function inspectAny(data, depth) {
640
+ if (data === null) {
641
+ return 'null';
642
+ }
643
+ switch (typeof data) {
644
+ case 'string':
645
+ return "'" + data + "'";
646
+ case 'undefined':
647
+ case 'number':
648
+ case 'boolean':
649
+ case 'function':
650
+ return String(data);
651
+ }
652
+ if (data instanceof RegExp) {
653
+ return data.toString();
654
+ }
655
+ if (Array.isArray(data)) {
656
+ return inspectArray(data, depth);
657
+ }
658
+ return inspectObject(data, depth);
640
659
  }
641
660
 
642
- var SCROLL_INTO_VIEW_DELAY = 200;
643
- // @dynamic
644
- var TuiDocNavigationComponent = /** @class */ (function () {
645
- function TuiDocNavigationComponent(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
646
- var _this = this;
647
- this.documentRef = documentRef;
648
- this.mode = mode;
649
- this.sidebar = sidebar;
650
- this.labels = labels;
651
- this.items = items;
652
- this.searchText = searchText;
653
- this.router = router;
661
+ var SERIALIZED_SUFFIX = '$';
662
+ // @bad TODO: refactor output and value sync
663
+ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
664
+ function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
665
+ this.template = template;
666
+ this.locationRef = locationRef;
654
667
  this.activatedRoute = activatedRoute;
655
- this.search = '';
656
- this.open = false;
657
- this.openPagesArr = [];
658
- this.openPagesGroupsArr = [];
659
- this.active = '';
660
- this.menuOpen = false;
661
- this.mode$ = this.mode.change$.pipe(operators.startWith(null), operators.map(function () { return _this.mode.mode || 'onLight'; }));
662
- // Angular can't navigate no anchor links
663
- // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
664
- title$.subscribe(function (title) {
665
- changeDetectorRef.markForCheck();
666
- titleService.setTitle(title);
667
- _this.openActivePageGroup();
668
- _this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
669
- });
670
- }
671
- Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
672
- get: function () {
673
- return this.search.length > 2;
674
- },
675
- enumerable: true,
676
- configurable: true
677
- });
678
- Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
668
+ this.urlSerializer = urlSerializer;
669
+ this.documentationPropertyName = '';
670
+ this.documentationPropertyMode = null;
671
+ this.documentationPropertyType = '';
672
+ this.documentationPropertyValue = null;
673
+ this.documentationPropertyDeprecated = false;
674
+ this.documentationPropertyValues = null;
675
+ this.documentationPropertyValueChange = new core.EventEmitter();
676
+ this.changed$ = new rxjs.Subject();
677
+ this.emits$ = new rxjs.BehaviorSubject(1);
678
+ }
679
+ TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
680
+ this.parseParams(this.activatedRoute.snapshot.queryParams);
681
+ };
682
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
679
683
  get: function () {
680
- return this.filterItems(this.flattenSubPages(this.items), this.search);
684
+ switch (this.documentationPropertyMode) {
685
+ case 'input':
686
+ return "[" + this.documentationPropertyName + "]";
687
+ case 'output':
688
+ return "(" + this.documentationPropertyName + ")";
689
+ case 'input-output':
690
+ return "[(" + this.documentationPropertyName + ")]";
691
+ default:
692
+ return this.documentationPropertyName;
693
+ }
681
694
  },
682
695
  enumerable: true,
683
696
  configurable: true
684
697
  });
685
- Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
698
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
686
699
  get: function () {
687
- return this.items[this.items.length - 1];
700
+ return !!this.documentationPropertyValues;
688
701
  },
689
702
  enumerable: true,
690
703
  configurable: true
691
704
  });
692
- TuiDocNavigationComponent.prototype.isActive = function (route) {
693
- return route === this.active;
694
- };
695
- TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
696
- this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
697
- };
698
- TuiDocNavigationComponent.prototype.closeMenu = function () {
699
- this.menuOpen = false;
700
- };
701
- TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
702
- this.search = search;
703
- this.open = this.canOpen;
704
- };
705
- TuiDocNavigationComponent.prototype.onClick = function () {
706
- this.open = false;
707
- this.menuOpen = false;
708
- this.search = '';
709
- this.openActivePageGroup();
710
- };
711
- TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
712
- return items.map(function (section) {
713
- return cdk.uniqBy(section.filter(function (_a) {
714
- var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
715
- title = title.toLowerCase();
716
- search = search.toLowerCase();
717
- keywords = keywords.toLowerCase();
718
- return (title.includes(search) ||
719
- keywords.includes(search) ||
720
- title.includes(transliterateKeyboardLayout(search)) ||
721
- keywords.includes(transliterateKeyboardLayout(search)) ||
722
- search.replace(/-/gi, '').includes(title));
723
- }), 'title');
724
- });
725
- };
726
- TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
727
- return items.reduce(function (array, item) { return __spread(array, [
728
- item.reduce(function (pages, page) {
729
- return 'subPages' in page
730
- ? __spread(pages, page.subPages) : __spread(pages, [page]);
731
- }, []),
732
- ]); }, []);
733
- };
734
- TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
735
- return this.router.isActive(route, false);
705
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
706
+ get: function () {
707
+ return this.documentationPropertyMode !== 'output';
708
+ },
709
+ enumerable: true,
710
+ configurable: true
711
+ });
712
+ TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnChanges = function () {
713
+ this.changed$.next();
736
714
  };
737
- TuiDocNavigationComponent.prototype.handleAnchorLink = function (hash) {
738
- var _this = this;
739
- setTimeout(function () {
740
- _this.navigateToAnchorLink(hash);
741
- }, SCROLL_INTO_VIEW_DELAY);
715
+ TuiDocDocumentationPropertyConnectorDirective.prototype.onValueChange = function (value) {
716
+ this.documentationPropertyValue = value;
717
+ this.documentationPropertyValueChange.emit(value);
718
+ this.setQueryParam(value);
742
719
  };
743
- TuiDocNavigationComponent.prototype.openActivePageGroup = function () {
744
- var _this = this;
745
- this.items.forEach(function (pages, pagesIndex) {
746
- pages.forEach(function (page, pageIndex) {
747
- if ('route' in page && _this.isActiveRoute(page.route)) {
748
- _this.openPagesArr[pagesIndex] = true;
749
- _this.active = page.route;
750
- }
751
- if ('subPages' in page) {
752
- page.subPages.forEach(function (subPage) {
753
- if (_this.isActiveRoute(subPage.route)) {
754
- _this.openPagesArr[pagesIndex] = true;
755
- _this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
756
- _this.active = subPage.route;
757
- }
758
- });
759
- }
760
- });
761
- });
720
+ TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
721
+ // For more convenient debugging
722
+ console.log(this.attrName, event);
723
+ this.emits$.next(this.emits$.value + 1);
762
724
  };
763
- TuiDocNavigationComponent.prototype.navigateToAnchorLink = function (fragment) {
764
- var element = fragment && this.documentRef.querySelector("#" + fragment);
765
- if (!element) {
725
+ TuiDocDocumentationPropertyConnectorDirective.prototype.parseParams = function (params) {
726
+ if (!params[this.documentationPropertyName] &&
727
+ !params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
766
728
  return;
767
729
  }
768
- element.classList.add('tui-doc-animated-example');
769
- element.scrollIntoView({
770
- block: 'start',
771
- inline: 'nearest',
772
- behavior: 'smooth',
773
- });
730
+ var isValueAvailableByKey = !!params[this.documentationPropertyName + SERIALIZED_SUFFIX];
731
+ if (isValueAvailableByKey && this.documentationPropertyValues) {
732
+ this.onValueChange(this.documentationPropertyValues[params[this.documentationPropertyName + SERIALIZED_SUFFIX]]);
733
+ return;
734
+ }
735
+ this.onValueChange(!isNaN(Number(params[this.documentationPropertyName]))
736
+ ? Number(params[this.documentationPropertyName])
737
+ : params[this.documentationPropertyName]);
774
738
  };
775
- TuiDocNavigationComponent.ctorParameters = function () { return [
776
- { type: core.ChangeDetectorRef, decorators: [{ type: core.Inject, args: [core.ChangeDetectorRef,] }] },
777
- { type: platformBrowser.Title, decorators: [{ type: core.Inject, args: [platformBrowser.Title,] }] },
778
- { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [NAVIGATION_TITLE,] }] },
779
- { type: Document, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
780
- { type: core$1.TuiModeDirective, decorators: [{ type: core.Inject, args: [core$1.TuiModeDirective,] }] },
781
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [addonMobile.TuiSidebarDirective,] }] },
782
- { type: Array, decorators: [{ type: core.Inject, args: [NAVIGATION_LABELS,] }] },
783
- { type: undefined, decorators: [{ type: core.Inject, args: [NAVIGATION_ITEMS,] }] },
784
- { type: String, decorators: [{ type: core.Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
785
- { type: router.Router, decorators: [{ type: core.Inject, args: [router.Router,] }] },
786
- { type: router.ActivatedRoute, decorators: [{ type: core.Inject, args: [router.ActivatedRoute,] }] }
739
+ TuiDocDocumentationPropertyConnectorDirective.prototype.setQueryParam = function (value) {
740
+ var _a;
741
+ var tree = this.urlSerializer.parse(this.locationRef.path());
742
+ var isValueAvailableByKey = value instanceof Object;
743
+ var computedValue = isValueAvailableByKey && this.documentationPropertyValues
744
+ ? this.documentationPropertyValues.indexOf(value)
745
+ : value;
746
+ var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
747
+ var propName = this.documentationPropertyName + suffix;
748
+ tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
749
+ this.locationRef.go(String(tree));
750
+ };
751
+ TuiDocDocumentationPropertyConnectorDirective.ctorParameters = function () { return [
752
+ { type: core.TemplateRef, decorators: [{ type: core.Inject, args: [core.TemplateRef,] }] },
753
+ { type: common.Location, decorators: [{ type: core.Inject, args: [common.Location,] }] },
754
+ { type: router.ActivatedRoute, decorators: [{ type: core.Inject, args: [router.ActivatedRoute,] }] },
755
+ { type: router.UrlSerializer, decorators: [{ type: core.Inject, args: [router.UrlSerializer,] }] }
787
756
  ]; };
788
757
  __decorate([
789
- core.HostBinding('class._open')
790
- ], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
758
+ core.Input()
759
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyName", void 0);
791
760
  __decorate([
792
- cdk.tuiPure
793
- ], TuiDocNavigationComponent.prototype, "filterItems", null);
761
+ core.Input()
762
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyMode", void 0);
794
763
  __decorate([
795
- cdk.tuiPure
796
- ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
797
- TuiDocNavigationComponent = __decorate([
798
- core.Component({
799
- selector: 'tui-doc-navigation',
800
- template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n class=\"input\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n [autoFocus]=\"!!sidebar\"\n [content]=\"dropdown\"\n [canOpen]=\"canOpen\"\n [(open)]=\"open\"\n>\n <tui-primitive-textfield\n iconAlign=\"left\"\n tuiTextfieldSize=\"m\"\n iconContent=\"tuiIconSearch\"\n [pseudoFocused]=\"open || null\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n [value]=\"search\"\n (valueChange)=\"onSearchChange($event)\"\n >\n {{searchText}}\n </tui-primitive-textfield>\n <ng-template #dropdown let-activeZone>\n <tui-data-list>\n <tui-opt-group\n *ngFor=\"let group of filtered; let index = index\"\n [label]=\"labels[index] || ''\"\n >\n <a\n *ngFor=\"let item of group\"\n tuiOption\n [routerLink]=\"item.route\"\n (click)=\"onClick()\"\n >\n {{item.title}}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-template>\n</tui-hosted-dropdown>\n\n<nav class=\"navigation\">\n <tui-scrollbar [tuiMode]=\"mode$ | async\" class=\"scrollbar\">\n <tui-accordion [closeOthers]=\"false\" [rounded]=\"false\">\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"tui-space_left-2\">\n <strong>{{label}}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: (index * 100) + subIndex}\"\n >\n </ng-container>\n </ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: (items.length - 1) + index}\"\n >\n </ng-container>\n </ng-container>\n </div>\n\n <ng-template #pages let-item=\"item\" let-index=\"index\">\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n class=\"sublink\"\n routerLinkActive=\"sublink_active\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{item.title}}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"sublink sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"chevron\"\n [class.chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{item.title}}\n </button>\n <tui-expand\n class=\"tui-space_left-1\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"section section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n class=\"sublink sublink_small\"\n routerLinkActive=\"sublink_active\"\n [routerLink]=\"subPage.route\"\n [scrollIntoView]=\"isActive(subPage.route)\"\n (click)=\"closeMenu()\"\n >\n {{subPage.title}}\n </a>\n </div>\n </tui-expand>\n </div>\n </ng-template>\n </ng-template>\n </tui-scrollbar>\n</nav>\n\n<ng-content></ng-content>\n",
801
- providers: NAVIGATION_PROVIDERS,
802
- changeDetection: core.ChangeDetectionStrategy.OnPush,
803
- styles: [":host{z-index:1;display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01)}.input{display:block;margin:1.25rem}.navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.scrollbar{width:100%;scroll-behavior:smooth}.items-container{display:flex;flex-direction:column;padding:0 16px}.section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.subsection{margin-left:.5rem}.sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;font:var(--tui-font-text-m);margin-left:.5rem;line-height:2.75rem}.sublink_small{margin-left:1rem;line-height:1.5rem}.sublink_small:not(:first-child){margin-top:1rem}.sublink_subsection{margin-left:0;line-height:2.75rem}.sublink_active{color:var(--tui-text-01)}.chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.chevron_active{transform:rotate(90deg)}"]
764
+ core.Input()
765
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyType", void 0);
766
+ __decorate([
767
+ core.Input()
768
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValue", void 0);
769
+ __decorate([
770
+ core.Input()
771
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyDeprecated", void 0);
772
+ __decorate([
773
+ core.Input()
774
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValues", void 0);
775
+ __decorate([
776
+ core.Output()
777
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
778
+ TuiDocDocumentationPropertyConnectorDirective = __decorate([
779
+ core.Directive({
780
+ selector: 'ng-template[documentationPropertyName]',
781
+ exportAs: 'documentationProperty',
804
782
  }),
805
- __param(0, core.Inject(core.ChangeDetectorRef)),
806
- __param(1, core.Inject(platformBrowser.Title)),
807
- __param(2, core.Inject(NAVIGATION_TITLE)),
808
- __param(3, core.Inject(common.DOCUMENT)),
809
- __param(4, core.Inject(core$1.TuiModeDirective)),
810
- __param(5, core.Optional()),
811
- __param(5, core.Inject(addonMobile.TuiSidebarDirective)),
812
- __param(6, core.Inject(NAVIGATION_LABELS)),
813
- __param(7, core.Inject(NAVIGATION_ITEMS)),
814
- __param(8, core.Inject(TUI_DOC_SEARCH_TEXT)),
815
- __param(9, core.Inject(router.Router)),
816
- __param(10, core.Inject(router.ActivatedRoute))
817
- ], TuiDocNavigationComponent);
818
- return TuiDocNavigationComponent;
783
+ __param(0, core.Inject(core.TemplateRef)),
784
+ __param(1, core.Inject(common.Location)),
785
+ __param(2, core.Inject(router.ActivatedRoute)),
786
+ __param(3, core.Inject(router.UrlSerializer))
787
+ ], TuiDocDocumentationPropertyConnectorDirective);
788
+ return TuiDocDocumentationPropertyConnectorDirective;
819
789
  }());
820
790
 
821
- var ScrollIntoViewDirective = /** @class */ (function () {
822
- function ScrollIntoViewDirective(destroy$, _a) {
823
- var nativeElement = _a.nativeElement;
824
- this.scroll$ = new rxjs.Subject();
825
- this.scroll$
826
- .pipe(operators.debounceTime(750), operators.filter(function (shallWe) { return shallWe && !!cdk.getElementObscurers(nativeElement); }), operators.takeUntil(destroy$))
827
- .subscribe(function () {
828
- nativeElement.scrollIntoView();
829
- });
791
+ // @bad TODO subscribe propertiesConnectors changes
792
+ // @bad TODO refactor to make more flexible
793
+ // @dynamic
794
+ var TuiDocDocumentationComponent = /** @class */ (function () {
795
+ function TuiDocDocumentationComponent(changeDetectorRef, texts) {
796
+ this.changeDetectorRef = changeDetectorRef;
797
+ this.texts = texts;
798
+ this.heading = '';
799
+ this.showValues = true;
800
+ this.isAPI = false;
801
+ this.propertiesConnectors = cdk.EMPTY_QUERY;
802
+ this.activeItemIndex = 0;
830
803
  }
831
- Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
832
- set: function (shallWe) {
833
- this.scroll$.next(shallWe);
804
+ TuiDocDocumentationComponent.prototype.ngAfterContentInit = function () {
805
+ cdk.itemsQueryListObservable(this.propertiesConnectors)
806
+ .pipe(operators.switchMap(function (items) { return rxjs.merge.apply(void 0, __spread(items.map(function (_a) {
807
+ var changed$ = _a.changed$;
808
+ return changed$;
809
+ }))); }), cdk.watch(this.changeDetectorRef))
810
+ .subscribe();
811
+ };
812
+ Object.defineProperty(TuiDocDocumentationComponent.prototype, "type", {
813
+ get: function () {
814
+ return this.isAPI ? this.texts[0] : this.texts[1];
834
815
  },
835
816
  enumerable: true,
836
817
  configurable: true
837
818
  });
838
- ScrollIntoViewDirective.ctorParameters = function () { return [
839
- { type: cdk.TuiDestroyService, decorators: [{ type: core.Inject, args: [cdk.TuiDestroyService,] }] },
840
- { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] }
819
+ TuiDocDocumentationComponent.prototype.getColor = function (color) {
820
+ if (color.length === 4) {
821
+ return color
822
+ .split('')
823
+ .reduce(function (result, current) { return __spread(result, [current, current]); }, [])
824
+ .join('')
825
+ .replace('#', '');
826
+ }
827
+ if (color.startsWith('#')) {
828
+ return color;
829
+ }
830
+ if (color === 'transparent') {
831
+ return '#000000';
832
+ }
833
+ var parsed = color
834
+ .replace('rgb(', '')
835
+ .replace('rgba(', '')
836
+ .replace(')', '')
837
+ .replace(' ', '')
838
+ .split(',')
839
+ .map(function (v) { return Number.parseInt(v, 10); });
840
+ return rgbToHex.apply(void 0, __spread(parsed));
841
+ };
842
+ TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
843
+ if (color.startsWith('#') || color.startsWith('rgb(')) {
844
+ return 100;
845
+ }
846
+ if (color === 'transparent') {
847
+ return 0;
848
+ }
849
+ var lastComma = color.lastIndexOf(',');
850
+ var parsed = color
851
+ .substr(lastComma)
852
+ .replace(')', '')
853
+ .replace(' ', '')
854
+ .replace(',', '');
855
+ return Math.round(Number.parseFloat(parsed) * 100);
856
+ };
857
+ TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
858
+ var opacity = this.getOpacity(connector.documentationPropertyValue || '');
859
+ if (opacity === 100) {
860
+ connector.onValueChange(color);
861
+ return;
862
+ }
863
+ var rgb = hexToRgb(color).join(', ');
864
+ var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
865
+ connector.onValueChange(result);
866
+ };
867
+ TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
868
+ var hex = this.getColor(connector.documentationPropertyValue || '');
869
+ var rgb = hexToRgb(hex);
870
+ var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
871
+ connector.onValueChange(result);
872
+ };
873
+ TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
874
+ return name.replace('?', '');
875
+ };
876
+ TuiDocDocumentationComponent.prototype.isOptional = function (name) {
877
+ return name.includes('?');
878
+ };
879
+ TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
880
+ return type.includes('null');
881
+ };
882
+ TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
883
+ return type.includes('PolymorpheusContent');
884
+ };
885
+ TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
886
+ return inspectAny(data, 2);
887
+ };
888
+ TuiDocDocumentationComponent.ctorParameters = function () { return [
889
+ { type: core.ChangeDetectorRef, decorators: [{ type: core.Inject, args: [core.ChangeDetectorRef,] }] },
890
+ { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_DOCUMENTATION_TEXTS,] }] }
841
891
  ]; };
842
892
  __decorate([
843
893
  core.Input()
844
- ], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
845
- ScrollIntoViewDirective = __decorate([
894
+ ], TuiDocDocumentationComponent.prototype, "heading", void 0);
895
+ __decorate([
896
+ core.Input()
897
+ ], TuiDocDocumentationComponent.prototype, "showValues", void 0);
898
+ __decorate([
899
+ core.Input()
900
+ ], TuiDocDocumentationComponent.prototype, "isAPI", void 0);
901
+ __decorate([
902
+ core.ContentChildren(TuiDocDocumentationPropertyConnectorDirective)
903
+ ], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
904
+ TuiDocDocumentationComponent = __decorate([
905
+ core.Component({
906
+ selector: 'tui-doc-documentation',
907
+ template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"tui-table__th tui-table__th_last tui-table__th_text_right t-cell t-cell_value\"\n >\n {{ texts[3] }}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"tui-table__td tui-table__td_first tui-table__td_align_center t-cell\"\n >\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property t-cell\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"tui-table__td tui-table__td_align_center tui-table__td_last tui-table__td_text_right t-cell\"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
908
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
909
+ animations: [
910
+ animations.trigger('emitEvent', [
911
+ animations.transition(':increment', [animations.style({ opacity: 1 }), animations.animate('500ms ease-in')]),
912
+ ]),
913
+ ],
914
+ styles: [":host{display:block;min-width:100%}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}@media screen and (max-width:47.9375em){.t-row{display:flex;flex-wrap:wrap}.t-row_header{display:none}.t-cell_value{width:9.375rem}.t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content}.t-output{text-align:left;opacity:0}"]
915
+ }),
916
+ __param(0, core.Inject(core.ChangeDetectorRef)),
917
+ __param(1, core.Inject(TUI_DOC_DOCUMENTATION_TEXTS))
918
+ ], TuiDocDocumentationComponent);
919
+ return TuiDocDocumentationComponent;
920
+ }());
921
+
922
+ var TuiInputOpacityDirective = /** @class */ (function () {
923
+ function TuiInputOpacityDirective(renderer, tuiFocusableComponent) {
924
+ this.renderer = renderer;
925
+ this.tuiFocusableComponent = tuiFocusableComponent;
926
+ }
927
+ Object.defineProperty(TuiInputOpacityDirective.prototype, "tuiInputOpacity", {
928
+ set: function (opacity) {
929
+ var nativeFocusableElement = this.tuiFocusableComponent.nativeFocusableElement;
930
+ if (nativeFocusableElement) {
931
+ this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
932
+ }
933
+ },
934
+ enumerable: true,
935
+ configurable: true
936
+ });
937
+ TuiInputOpacityDirective.ctorParameters = function () { return [
938
+ { type: core.Renderer2, decorators: [{ type: core.Inject, args: [core.Renderer2,] }] },
939
+ { type: undefined, decorators: [{ type: core.Inject, args: [cdk.TUI_FOCUSABLE_ITEM_ACCESSOR,] }] }
940
+ ]; };
941
+ __decorate([
942
+ core.Input()
943
+ ], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
944
+ TuiInputOpacityDirective = __decorate([
846
945
  core.Directive({
847
- selector: '[scrollIntoView]',
848
- providers: [cdk.TuiDestroyService],
946
+ selector: '[tuiInputOpacity]',
849
947
  }),
850
- __param(0, core.Inject(cdk.TuiDestroyService)),
851
- __param(1, core.Inject(core.ElementRef))
852
- ], ScrollIntoViewDirective);
853
- return ScrollIntoViewDirective;
948
+ __param(0, core.Inject(core.Renderer2)),
949
+ __param(1, core.Inject(cdk.TUI_FOCUSABLE_ITEM_ACCESSOR))
950
+ ], TuiInputOpacityDirective);
951
+ return TuiInputOpacityDirective;
854
952
  }());
855
953
 
856
- var ScrollIntoViewModule = /** @class */ (function () {
857
- function ScrollIntoViewModule() {
954
+ var TuiInputOpacityModule = /** @class */ (function () {
955
+ function TuiInputOpacityModule() {
858
956
  }
859
- ScrollIntoViewModule = __decorate([
957
+ TuiInputOpacityModule = __decorate([
860
958
  core.NgModule({
861
- declarations: [ScrollIntoViewDirective],
862
- exports: [ScrollIntoViewDirective],
959
+ declarations: [TuiInputOpacityDirective],
960
+ exports: [TuiInputOpacityDirective],
863
961
  })
864
- ], ScrollIntoViewModule);
865
- return ScrollIntoViewModule;
962
+ ], TuiInputOpacityModule);
963
+ return TuiInputOpacityModule;
866
964
  }());
867
965
 
868
- var TuiDocNavigationModule = /** @class */ (function () {
869
- function TuiDocNavigationModule() {
966
+ var TuiDocDocumentationModule = /** @class */ (function () {
967
+ function TuiDocDocumentationModule() {
870
968
  }
871
- TuiDocNavigationModule = __decorate([
969
+ TuiDocDocumentationModule = __decorate([
872
970
  core.NgModule({
873
971
  imports: [
874
972
  common.CommonModule,
875
973
  forms.FormsModule,
876
974
  router.RouterModule,
877
- ScrollIntoViewModule,
878
- core$1.TuiButtonModule,
975
+ kit.TuiBadgeModule,
976
+ kit.TuiSelectModule,
977
+ kit.TuiToggleModule,
978
+ core$1.TuiTooltipModule,
979
+ core$1.TuiLinkModule,
980
+ kit.TuiInputCountModule,
981
+ core$1.TuiModeModule,
982
+ core$1.TuiGroupModule,
983
+ TuiInputOpacityModule,
879
984
  core$1.TuiPrimitiveTextfieldModule,
880
985
  core$1.TuiTextfieldControllerModule,
881
- cdk.TuiActiveZoneModule,
882
- cdk.TuiLetModule,
883
- core$1.TuiModeModule,
884
- core$1.TuiLinkModule,
885
- core$1.TuiExpandModule,
886
- core$1.TuiHostedDropdownModule,
986
+ core$1.TuiHintControllerModule,
887
987
  core$1.TuiDropdownControllerModule,
888
- kit.TuiAccordionModule,
889
- core$1.TuiScrollbarModule,
890
- core$1.TuiSvgModule,
891
988
  core$1.TuiDataListModule,
892
- cdk.TuiAutoFocusModule,
989
+ kit.TuiDataListWrapperModule,
990
+ core$1.TuiNotificationModule,
991
+ ],
992
+ declarations: [
993
+ TuiDocDocumentationComponent,
994
+ TuiDocDocumentationPropertyConnectorDirective,
995
+ ],
996
+ exports: [
997
+ TuiDocDocumentationComponent,
998
+ TuiDocDocumentationPropertyConnectorDirective,
893
999
  ],
894
- declarations: [TuiDocNavigationComponent],
895
- exports: [TuiDocNavigationComponent],
896
1000
  })
897
- ], TuiDocNavigationModule);
898
- return TuiDocNavigationModule;
1001
+ ], TuiDocDocumentationModule);
1002
+ return TuiDocDocumentationModule;
899
1003
  }());
900
1004
 
901
- function rgbToHex(r, g, b) {
902
- return ('#' +
903
- [r, g, b]
904
- .map(function (x) {
905
- var hex = x.toString(16);
906
- return hex.length === 1 ? '0' + hex : hex;
907
- })
908
- .join(''));
909
- }
910
- function hexToRgb(hex) {
911
- var matches = hex
912
- .replace('#', '')
913
- .split('')
914
- .map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
915
- .join('')
916
- .match(/.{2}/g);
917
- return matches
918
- ? matches.map(function (x) { return Number.parseInt(x, 16); })
919
- : [0, 0, 0];
1005
+ var TUI_DOC_CODE_EDITOR = new core.InjectionToken('Contains service for opening online IDE e.g. Stackblitz');
1006
+
1007
+ var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new core.InjectionToken('Processes content in example', { factory: function () { return cdk.identity; } });
1008
+
1009
+ function rawLoadRecord(example) {
1010
+ return __awaiter(this, void 0, void 0, function () {
1011
+ var processedContent, _a, _b, _c, key, content, _d, _e, e_1_1;
1012
+ var e_1, _f;
1013
+ return __generator(this, function (_g) {
1014
+ switch (_g.label) {
1015
+ case 0:
1016
+ processedContent = {};
1017
+ _g.label = 1;
1018
+ case 1:
1019
+ _g.trys.push([1, 6, 7, 8]);
1020
+ _a = __values(Object.entries(example)), _b = _a.next();
1021
+ _g.label = 2;
1022
+ case 2:
1023
+ if (!!_b.done) return [3 /*break*/, 5];
1024
+ _c = __read(_b.value, 2), key = _c[0], content = _c[1];
1025
+ _d = processedContent;
1026
+ _e = key;
1027
+ return [4 /*yield*/, rawLoad(content)];
1028
+ case 3:
1029
+ _d[_e] = _g.sent();
1030
+ _g.label = 4;
1031
+ case 4:
1032
+ _b = _a.next();
1033
+ return [3 /*break*/, 2];
1034
+ case 5: return [3 /*break*/, 8];
1035
+ case 6:
1036
+ e_1_1 = _g.sent();
1037
+ e_1 = { error: e_1_1 };
1038
+ return [3 /*break*/, 8];
1039
+ case 7:
1040
+ try {
1041
+ if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
1042
+ }
1043
+ finally { if (e_1) throw e_1.error; }
1044
+ return [7 /*endfinally*/];
1045
+ case 8: return [2 /*return*/, processedContent];
1046
+ }
1047
+ });
1048
+ });
920
1049
  }
921
1050
 
922
- function inspectArray(array, depth) {
923
- if (depth === 0) {
924
- return '[…]';
925
- }
926
- var result = '';
927
- var first = true;
928
- for (var index = 0; index < array.length; index++) {
929
- if (first) {
930
- first = false;
931
- }
932
- else {
933
- result += ', ';
934
- }
935
- result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
1051
+ // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1052
+ // @dynamic
1053
+ var TuiDocExampleComponent = /** @class */ (function () {
1054
+ function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent) {
1055
+ this.id = id;
1056
+ this.clipboard = clipboard;
1057
+ this.notifications = notifications;
1058
+ this.location = location;
1059
+ this.copyTexts$ = copyTexts$;
1060
+ this.texts = texts;
1061
+ this.codeEditor = codeEditor;
1062
+ this.processContent = processContent;
1063
+ this.rawLoader$$ = new rxjs.BehaviorSubject({});
1064
+ this.heading = '';
1065
+ this.description = '';
1066
+ this.componentName = this.location.pathname.slice(1);
1067
+ this.activeItemIndex = 0;
1068
+ this.defaultTab = this.texts[0];
1069
+ this.copy$ = this.copyTexts$.pipe(operators.map(function (_a) {
1070
+ var _b = __read(_a, 1), copy = _b[0];
1071
+ return copy;
1072
+ }));
1073
+ this.processor$ = this.rawLoader$$.pipe(operators.switchMap(rawLoadRecord), operators.map(this.processContent));
936
1074
  }
937
- return "[" + result + "]";
938
- }
939
- function inspectObject(object, depth) {
940
- if (depth === 0) {
941
- return "{\u2026}";
942
- }
943
- var result = '';
944
- var first = true;
945
- for (var key in object) {
946
- if (!object.hasOwnProperty(key)) {
947
- continue;
948
- }
949
- if (first) {
950
- first = false;
951
- }
952
- else {
953
- result += ', ';
954
- }
955
- result += key + ": " + inspectAny(object[key], depth - 1);
956
- }
957
- return "{" + result + "}";
958
- }
959
- // @bad TODO add more types
960
- /**
961
- * Returns readable JS entity
962
- * @param data
963
- * @param depth
964
- * @return readable JS entity
965
- */
966
- function inspectAny(data, depth) {
967
- if (data === null) {
968
- return 'null';
969
- }
970
- switch (typeof data) {
971
- case 'string':
972
- return "'" + data + "'";
973
- case 'undefined':
974
- case 'number':
975
- case 'boolean':
976
- case 'function':
977
- return String(data);
978
- }
979
- if (data instanceof RegExp) {
980
- return data.toString();
981
- }
982
- if (Array.isArray(data)) {
983
- return inspectArray(data, depth);
984
- }
985
- return inspectObject(data, depth);
986
- }
987
-
988
- var SERIALIZED_SUFFIX = '$';
989
- // @bad TODO: refactor output and value sync
990
- var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
991
- function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
992
- this.template = template;
993
- this.locationRef = locationRef;
994
- this.activatedRoute = activatedRoute;
995
- this.urlSerializer = urlSerializer;
996
- this.documentationPropertyName = '';
997
- this.documentationPropertyMode = null;
998
- this.documentationPropertyType = '';
999
- this.documentationPropertyValue = null;
1000
- this.documentationPropertyDeprecated = false;
1001
- this.documentationPropertyValues = null;
1002
- this.documentationPropertyValueChange = new core.EventEmitter();
1003
- this.changed$ = new rxjs.Subject();
1004
- this.emits$ = new rxjs.BehaviorSubject(1);
1005
- }
1006
- TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
1007
- this.parseParams(this.activatedRoute.snapshot.queryParams);
1008
- };
1009
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
1010
- get: function () {
1011
- switch (this.documentationPropertyMode) {
1012
- case 'input':
1013
- return "[" + this.documentationPropertyName + "]";
1014
- case 'output':
1015
- return "(" + this.documentationPropertyName + ")";
1016
- case 'input-output':
1017
- return "[(" + this.documentationPropertyName + ")]";
1018
- default:
1019
- return this.documentationPropertyName;
1020
- }
1021
- },
1022
- enumerable: true,
1023
- configurable: true
1024
- });
1025
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
1026
- get: function () {
1027
- return !!this.documentationPropertyValues;
1028
- },
1029
- enumerable: true,
1030
- configurable: true
1031
- });
1032
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
1033
- get: function () {
1034
- return this.documentationPropertyMode !== 'output';
1075
+ Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
1076
+ set: function (content) {
1077
+ this.rawLoader$$.next(content);
1035
1078
  },
1036
1079
  enumerable: true,
1037
1080
  configurable: true
1038
1081
  });
1039
- TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnChanges = function () {
1040
- this.changed$.next();
1041
- };
1042
- TuiDocDocumentationPropertyConnectorDirective.prototype.onValueChange = function (value) {
1043
- this.documentationPropertyValue = value;
1044
- this.documentationPropertyValueChange.emit(value);
1045
- this.setQueryParam(value);
1046
- };
1047
- TuiDocDocumentationPropertyConnectorDirective.prototype.parseParams = function (params) {
1048
- if (!params[this.documentationPropertyName] &&
1049
- !params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
1050
- return;
1051
- }
1052
- var isValueAvailableByKey = !!params[this.documentationPropertyName + SERIALIZED_SUFFIX];
1053
- if (isValueAvailableByKey && this.documentationPropertyValues) {
1054
- this.onValueChange(this.documentationPropertyValues[params[this.documentationPropertyName + SERIALIZED_SUFFIX]]);
1055
- return;
1056
- }
1057
- this.onValueChange(!isNaN(Number(params[this.documentationPropertyName]))
1058
- ? Number(params[this.documentationPropertyName])
1059
- : params[this.documentationPropertyName]);
1060
- };
1061
- TuiDocDocumentationPropertyConnectorDirective.prototype.setQueryParam = function (value) {
1062
- var _a;
1063
- var tree = this.urlSerializer.parse(this.locationRef.path());
1064
- var isValueAvailableByKey = value instanceof Object;
1065
- var computedValue = isValueAvailableByKey && this.documentationPropertyValues
1066
- ? this.documentationPropertyValues.indexOf(value)
1067
- : value;
1068
- var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
1069
- var propName = this.documentationPropertyName + suffix;
1070
- tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
1071
- this.locationRef.go(String(tree));
1072
- };
1073
- TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
1074
- // For more convenient debugging
1075
- // tslint:disable-next-line:no-console
1076
- console.log(this.attrName, event);
1077
- this.emits$.next(this.emits$.value + 1);
1082
+ TuiDocExampleComponent.prototype.copyExampleLink = function () {
1083
+ var hashPosition = this.location.href.indexOf('#');
1084
+ var currentUrl = hashPosition > -1
1085
+ ? this.location.href.substr(0, hashPosition)
1086
+ : this.location.href;
1087
+ var url = currentUrl + "#" + this.id;
1088
+ this.clipboard.copy(url);
1089
+ this.notifications
1090
+ .show(this.texts[1], {
1091
+ label: this.texts[2],
1092
+ status: "success" /* Success */,
1093
+ })
1094
+ .subscribe();
1078
1095
  };
1079
- TuiDocDocumentationPropertyConnectorDirective.ctorParameters = function () { return [
1080
- { type: core.TemplateRef, decorators: [{ type: core.Inject, args: [core.TemplateRef,] }] },
1081
- { type: common.Location, decorators: [{ type: core.Inject, args: [common.Location,] }] },
1082
- { type: router.ActivatedRoute, decorators: [{ type: core.Inject, args: [router.ActivatedRoute,] }] },
1083
- { type: router.UrlSerializer, decorators: [{ type: core.Inject, args: [router.UrlSerializer,] }] }
1096
+ TuiDocExampleComponent.ctorParameters = function () { return [
1097
+ { type: String, decorators: [{ type: core.Attribute, args: ['id',] }] },
1098
+ { type: clipboard.Clipboard, decorators: [{ type: core.Inject, args: [clipboard.Clipboard,] }] },
1099
+ { type: core$1.TuiNotificationsService, decorators: [{ type: core.Inject, args: [core$1.TuiNotificationsService,] }] },
1100
+ { type: Location, decorators: [{ type: core.Inject, args: [common$1.LOCATION,] }] },
1101
+ { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [kit.TUI_COPY_TEXTS,] }] },
1102
+ { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
1103
+ { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
1104
+ { type: undefined, decorators: [{ type: core.Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] }
1084
1105
  ]; };
1085
1106
  __decorate([
1086
1107
  core.Input()
1087
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyName", void 0);
1088
- __decorate([
1089
- core.Input()
1090
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyMode", void 0);
1091
- __decorate([
1092
- core.Input()
1093
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyType", void 0);
1108
+ ], TuiDocExampleComponent.prototype, "heading", void 0);
1094
1109
  __decorate([
1095
1110
  core.Input()
1096
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValue", void 0);
1111
+ ], TuiDocExampleComponent.prototype, "description", void 0);
1097
1112
  __decorate([
1098
1113
  core.Input()
1099
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyDeprecated", void 0);
1114
+ ], TuiDocExampleComponent.prototype, "content", null);
1100
1115
  __decorate([
1101
1116
  core.Input()
1102
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValues", void 0);
1103
- __decorate([
1104
- core.Output()
1105
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
1106
- TuiDocDocumentationPropertyConnectorDirective = __decorate([
1107
- core.Directive({
1108
- selector: 'ng-template[documentationPropertyName]',
1109
- exportAs: 'documentationProperty',
1117
+ ], TuiDocExampleComponent.prototype, "componentName", void 0);
1118
+ TuiDocExampleComponent = __decorate([
1119
+ core.Component({
1120
+ selector: 'tui-doc-example',
1121
+ template: "<h3 *ngIf=\"heading\" class=\"t-title\">\n <span polymorpheus-outlet [content]=\"heading\"></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n polymorpheus-outlet\n class=\"t-description\"\n [content]=\"description\"\n></h4>\n\n<div *ngIf=\"processor$ | async as content\" class=\"t-example\">\n <ng-container *ngIf=\"content | tuiDocExampleGetTabs: defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button *tuiTab tuiTab>{{tab}}</button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n (click)=\"codeEditor.open(componentName, id || '', content)\"\n >\n Edit on {{codeEditor.name}}\n </button>\n </div>\n\n <ng-container\n *ngIf=\"{\n activeTab: tabs[activeItemIndex],\n code: content[tabs[activeItemIndex]] || ''\n } as state\"\n >\n <div\n *ngIf=\"state.activeTab == defaultTab; else codeSection\"\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n\n <ng-template #codeSection>\n <tui-doc-copy\n class=\"t-copy-code\"\n [cdkCopyToClipboard]=\"state.code\"\n ></tui-doc-copy>\n <tui-doc-code [code]=\"state.code\"></tui-doc-code>\n </ng-template>\n </ng-container>\n </ng-container>\n</div>\n",
1122
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
1123
+ styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}@media screen and (max-width:47.9375em){:host{padding-top:2rem}.t-title{font:var(--tui-font-heading-6)}}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-description:first-letter,.t-title:first-letter{text-transform:capitalize}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}@media screen and (max-width:47.9375em){.t-example{margin-top:.75rem}.t-tabs-wrapper{padding:0 1rem}}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}@media screen and (max-width:47.9375em){.t-demo{padding:1rem}}.t-copy-code{position:absolute;top:4.375rem;right:1rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}"]
1110
1124
  }),
1111
- __param(0, core.Inject(core.TemplateRef)),
1112
- __param(1, core.Inject(common.Location)),
1113
- __param(2, core.Inject(router.ActivatedRoute)),
1114
- __param(3, core.Inject(router.UrlSerializer))
1115
- ], TuiDocDocumentationPropertyConnectorDirective);
1116
- return TuiDocDocumentationPropertyConnectorDirective;
1125
+ __param(0, core.Attribute('id')),
1126
+ __param(1, core.Inject(clipboard.Clipboard)),
1127
+ __param(2, core.Inject(core$1.TuiNotificationsService)),
1128
+ __param(3, core.Inject(common$1.LOCATION)),
1129
+ __param(4, core.Inject(kit.TUI_COPY_TEXTS)),
1130
+ __param(5, core.Inject(TUI_DOC_EXAMPLE_TEXTS)),
1131
+ __param(6, core.Optional()),
1132
+ __param(6, core.Inject(TUI_DOC_CODE_EDITOR)),
1133
+ __param(7, core.Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR))
1134
+ ], TuiDocExampleComponent);
1135
+ return TuiDocExampleComponent;
1117
1136
  }());
1118
1137
 
1119
- // @bad TODO subscribe propertiesConnectors changes
1120
- // @bad TODO refactor to make more flexible
1121
- // @dynamic
1122
- var TuiDocDocumentationComponent = /** @class */ (function () {
1123
- function TuiDocDocumentationComponent(changeDetectorRef, texts) {
1124
- this.changeDetectorRef = changeDetectorRef;
1125
- this.texts = texts;
1126
- this.heading = '';
1127
- this.showValues = true;
1128
- this.isAPI = false;
1129
- this.propertiesConnectors = cdk.EMPTY_QUERY;
1130
- this.activeItemIndex = 0;
1138
+ var TuiDocExampleGetTabsPipe = /** @class */ (function () {
1139
+ function TuiDocExampleGetTabsPipe() {
1131
1140
  }
1132
- TuiDocDocumentationComponent.prototype.ngAfterContentInit = function () {
1133
- cdk.itemsQueryListObservable(this.propertiesConnectors)
1134
- .pipe(operators.switchMap(function (items) { return rxjs.merge.apply(void 0, __spread(items.map(function (_a) {
1135
- var changed$ = _a.changed$;
1136
- return changed$;
1137
- }))); }), cdk.watch(this.changeDetectorRef))
1138
- .subscribe();
1141
+ TuiDocExampleGetTabsPipe.prototype.transform = function (content, defaultTab) {
1142
+ return __spread([defaultTab], Object.keys(content));
1139
1143
  };
1140
- Object.defineProperty(TuiDocDocumentationComponent.prototype, "type", {
1144
+ TuiDocExampleGetTabsPipe = __decorate([
1145
+ core.Pipe({ name: 'tuiDocExampleGetTabs' })
1146
+ ], TuiDocExampleGetTabsPipe);
1147
+ return TuiDocExampleGetTabsPipe;
1148
+ }());
1149
+
1150
+ var TuiDocExampleModule = /** @class */ (function () {
1151
+ function TuiDocExampleModule() {
1152
+ }
1153
+ TuiDocExampleModule = __decorate([
1154
+ core.NgModule({
1155
+ imports: [
1156
+ common.CommonModule,
1157
+ clipboard.ClipboardModule,
1158
+ kit.TuiTabsModule,
1159
+ core$1.TuiButtonModule,
1160
+ TuiDocCopyModule,
1161
+ TuiDocCodeModule,
1162
+ ngPolymorpheus.PolymorpheusModule,
1163
+ ],
1164
+ declarations: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
1165
+ exports: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
1166
+ })
1167
+ ], TuiDocExampleModule);
1168
+ return TuiDocExampleModule;
1169
+ }());
1170
+
1171
+ // @dynamic
1172
+ var TuiDocMainComponent = /** @class */ (function () {
1173
+ function TuiDocMainComponent(storage, windowRef) {
1174
+ this.storage = storage;
1175
+ this.windowRef = windowRef;
1176
+ this.night = this.storage.getItem('night') === 'true' ||
1177
+ (this.storage.getItem('night') === null &&
1178
+ this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
1179
+ this.change$ = new rxjs.Subject();
1180
+ }
1181
+ TuiDocMainComponent_1 = TuiDocMainComponent;
1182
+ Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
1141
1183
  get: function () {
1142
- return this.isAPI ? this.texts[0] : this.texts[1];
1184
+ return this.night ? 'onDark' : null;
1143
1185
  },
1144
1186
  enumerable: true,
1145
1187
  configurable: true
1146
1188
  });
1147
- TuiDocDocumentationComponent.prototype.getColor = function (color) {
1148
- if (color.length === 4) {
1149
- return color
1150
- .split('')
1151
- .reduce(function (result, current) { return __spread(result, [current, current]); }, [])
1152
- .join('')
1153
- .replace('#', '');
1154
- }
1155
- if (color.startsWith('#')) {
1156
- return color;
1157
- }
1158
- if (color === 'transparent') {
1159
- return '#000000';
1160
- }
1161
- var parsed = color
1162
- .replace('rgb(', '')
1163
- .replace('rgba(', '')
1164
- .replace(')', '')
1165
- .replace(' ', '')
1166
- .split(',')
1167
- .map(function (v) { return Number.parseInt(v, 10); });
1168
- return rgbToHex.apply(void 0, __spread(parsed));
1169
- };
1170
- TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
1171
- if (color.startsWith('#') || color.startsWith('rgb(')) {
1172
- return 100;
1173
- }
1174
- if (color === 'transparent') {
1175
- return 0;
1176
- }
1177
- var lastComma = color.lastIndexOf(',');
1178
- var parsed = color
1179
- .substr(lastComma)
1180
- .replace(')', '')
1181
- .replace(' ', '')
1182
- .replace(',', '');
1183
- return Math.round(Number.parseFloat(parsed) * 100);
1184
- };
1185
- TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
1186
- var opacity = this.getOpacity(connector.documentationPropertyValue || '');
1187
- if (opacity === 100) {
1188
- connector.onValueChange(color);
1189
- return;
1190
- }
1191
- var rgb = hexToRgb(color).join(', ');
1192
- var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
1193
- connector.onValueChange(result);
1194
- };
1195
- TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
1196
- var hex = this.getColor(connector.documentationPropertyValue || '');
1197
- var rgb = hexToRgb(hex);
1198
- var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
1199
- connector.onValueChange(result);
1200
- };
1201
- TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
1202
- return name.replace('?', '');
1203
- };
1204
- TuiDocDocumentationComponent.prototype.isOptional = function (name) {
1205
- return name.includes('?');
1206
- };
1207
- TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
1208
- return type.includes('null');
1209
- };
1210
- TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
1211
- return type.includes('PolymorpheusContent');
1212
- };
1213
- TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
1214
- return inspectAny(data, 2);
1189
+ TuiDocMainComponent.prototype.onMode = function (night) {
1190
+ this.night = night;
1191
+ this.change$.next();
1192
+ this.storage.setItem('night', String(night));
1215
1193
  };
1216
- TuiDocDocumentationComponent.ctorParameters = function () { return [
1217
- { type: core.ChangeDetectorRef, decorators: [{ type: core.Inject, args: [core.ChangeDetectorRef,] }] },
1218
- { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_DOCUMENTATION_TEXTS,] }] }
1194
+ var TuiDocMainComponent_1;
1195
+ TuiDocMainComponent.ctorParameters = function () { return [
1196
+ { type: Storage, decorators: [{ type: core.Inject, args: [common$1.LOCAL_STORAGE,] }] },
1197
+ { type: Window, decorators: [{ type: core.Inject, args: [common$1.WINDOW,] }] }
1219
1198
  ]; };
1220
- __decorate([
1221
- core.Input()
1222
- ], TuiDocDocumentationComponent.prototype, "heading", void 0);
1223
- __decorate([
1224
- core.Input()
1225
- ], TuiDocDocumentationComponent.prototype, "showValues", void 0);
1226
- __decorate([
1227
- core.Input()
1228
- ], TuiDocDocumentationComponent.prototype, "isAPI", void 0);
1229
- __decorate([
1230
- core.ContentChildren(TuiDocDocumentationPropertyConnectorDirective)
1231
- ], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
1232
- TuiDocDocumentationComponent = __decorate([
1199
+ TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
1233
1200
  core.Component({
1234
- selector: 'tui-doc-documentation',
1235
- template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{heading}}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{texts[2]}}\n </th>\n <td class=\"tui-table__th\">{{type}}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"\n tui-table__th tui-table__th_last tui-table__th_text_right\n t-cell t-cell_value\n \"\n >\n {{texts[3]}}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"\n tui-table__td tui-table__td_first tui-table__td_align_center\n t-cell\n \"\n >\n <div\n class=\"t-property t-cell\"\n automation-id=\"tui-documentation__property-name\"\n >\n {{stripOptional(propertyConnector.attrName)}}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >deprecated</span\n >\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{propertyConnector.documentationPropertyType}}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{texts[4]}}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n ><code>ng-polymorpheus</code></a\n >\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"\n tui-table__td\n tui-table__td_align_center\n tui-table__td_last\n tui-table__td_text_right\n t-cell\n \"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{inspectAny(data)}}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
1236
- changeDetection: core.ChangeDetectionStrategy.OnPush,
1237
- animations: [
1238
- animations.trigger('emitEvent', [
1239
- animations.transition(':increment', [animations.style({ opacity: 1 }), animations.animate('500ms ease-in')]),
1240
- ]),
1201
+ selector: 'tui-doc-main',
1202
+ template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-space_left-2\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
1203
+ encapsulation: core.ViewEncapsulation.None,
1204
+ providers: [
1205
+ {
1206
+ provide: core$1.TuiModeDirective,
1207
+ useExisting: core.forwardRef(function () { return TuiDocMainComponent_1; }),
1208
+ },
1209
+ cdk.TuiSwipeService,
1241
1210
  ],
1242
- styles: [":host{display:block;min-width:100%}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}@media screen and (max-width:47.9375em){.t-row{display:flex;flex-wrap:wrap}.t-row_header{display:none}.t-cell_value{width:9.375rem}.t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content}.t-output{text-align:left;opacity:0}"]
1211
+ styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls{top:4rem!important}@-webkit-keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}@keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(.hljs):not(.exception){transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;background:var(--tui-base-02);color:var(--tui-text-02);vertical-align:middle;box-shadow:inset 0 -2px var(--tui-secondary);padding:.375rem .5rem;font-size:.875rem;border-radius:.5rem}:focus code:not(.exception){background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width:47.9375em){tui-doc-navigation.tui-doc-navigation{display:none}.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{-webkit-animation:1s .3s tuiShaking;animation:1s .3s tuiShaking}label.night-mode{cursor:pointer}.hljs-tag{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear-disabled)}.hljs-subst,.hljs-title{font-weight:400;color:var(--tui-text-01)}.hljs-comment,.hljs-quote{color:var(--tui-text-03);font-style:italic}.hljs-meta{color:#e38162}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type{font-weight:700;color:var(--tui-link)}.hljs-attribute,.hljs-link,.hljs-number,.hljs-regexp{font-weight:700;color:var(--tui-support-06)}.hljs-link,.hljs-number,.hljs-regexp{font-weight:400}.hljs-string{color:var(--tui-positive);font-weight:700}.hljs-bullet,.hljs-formula,.hljs-symbol{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}.hljs-doctag{text-decoration:underline}.hljs-template-variable,.hljs-variable{color:var(--tui-warning-fill)}.hljs-addition{background:var(--tui-success-bg)}.hljs-deletion{background:var(--tui-error-bg)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs .hljs-line-numbers{padding:0}.hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}"]
1243
1212
  }),
1244
- __param(0, core.Inject(core.ChangeDetectorRef)),
1245
- __param(1, core.Inject(TUI_DOC_DOCUMENTATION_TEXTS))
1246
- ], TuiDocDocumentationComponent);
1247
- return TuiDocDocumentationComponent;
1213
+ __param(0, core.Inject(common$1.LOCAL_STORAGE)),
1214
+ __param(1, core.Inject(common$1.WINDOW))
1215
+ ], TuiDocMainComponent);
1216
+ return TuiDocMainComponent;
1248
1217
  }());
1249
1218
 
1250
- var TuiInputOpacityDirective = /** @class */ (function () {
1251
- function TuiInputOpacityDirective(renderer, tuiFocusableComponent) {
1252
- this.renderer = renderer;
1253
- this.tuiFocusableComponent = tuiFocusableComponent;
1219
+ var ScrollIntoViewDirective = /** @class */ (function () {
1220
+ function ScrollIntoViewDirective(destroy$, _a) {
1221
+ var nativeElement = _a.nativeElement;
1222
+ this.scroll$ = new rxjs.Subject();
1223
+ this.scroll$
1224
+ .pipe(operators.debounceTime(750), operators.filter(function (shallWe) { return shallWe && !!cdk.getElementObscurers(nativeElement); }), operators.takeUntil(destroy$))
1225
+ .subscribe(function () {
1226
+ nativeElement.scrollIntoView();
1227
+ });
1254
1228
  }
1255
- Object.defineProperty(TuiInputOpacityDirective.prototype, "tuiInputOpacity", {
1256
- set: function (opacity) {
1257
- var nativeFocusableElement = this.tuiFocusableComponent.nativeFocusableElement;
1258
- if (nativeFocusableElement) {
1259
- this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
1260
- }
1229
+ Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
1230
+ set: function (shallWe) {
1231
+ this.scroll$.next(shallWe);
1261
1232
  },
1262
1233
  enumerable: true,
1263
1234
  configurable: true
1264
1235
  });
1265
- TuiInputOpacityDirective.ctorParameters = function () { return [
1266
- { type: core.Renderer2, decorators: [{ type: core.Inject, args: [core.Renderer2,] }] },
1267
- { type: undefined, decorators: [{ type: core.Inject, args: [cdk.TUI_FOCUSABLE_ITEM_ACCESSOR,] }] }
1268
- ]; };
1269
- __decorate([
1270
- core.Input()
1271
- ], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
1272
- TuiInputOpacityDirective = __decorate([
1273
- core.Directive({
1274
- selector: '[tuiInputOpacity]',
1275
- }),
1276
- __param(0, core.Inject(core.Renderer2)),
1277
- __param(1, core.Inject(cdk.TUI_FOCUSABLE_ITEM_ACCESSOR))
1278
- ], TuiInputOpacityDirective);
1279
- return TuiInputOpacityDirective;
1280
- }());
1281
-
1282
- var TuiInputOpacityModule = /** @class */ (function () {
1283
- function TuiInputOpacityModule() {
1284
- }
1285
- TuiInputOpacityModule = __decorate([
1286
- core.NgModule({
1287
- declarations: [TuiInputOpacityDirective],
1288
- exports: [TuiInputOpacityDirective],
1289
- })
1290
- ], TuiInputOpacityModule);
1291
- return TuiInputOpacityModule;
1292
- }());
1293
-
1294
- var TuiDocDocumentationModule = /** @class */ (function () {
1295
- function TuiDocDocumentationModule() {
1296
- }
1297
- TuiDocDocumentationModule = __decorate([
1298
- core.NgModule({
1299
- imports: [
1300
- common.CommonModule,
1301
- forms.FormsModule,
1302
- router.RouterModule,
1303
- kit.TuiBadgeModule,
1304
- kit.TuiSelectModule,
1305
- kit.TuiToggleModule,
1306
- core$1.TuiTooltipModule,
1307
- core$1.TuiLinkModule,
1308
- kit.TuiInputCountModule,
1309
- core$1.TuiModeModule,
1310
- core$1.TuiGroupModule,
1311
- TuiInputOpacityModule,
1312
- core$1.TuiPrimitiveTextfieldModule,
1313
- core$1.TuiTextfieldControllerModule,
1314
- core$1.TuiHintControllerModule,
1315
- core$1.TuiDropdownControllerModule,
1316
- core$1.TuiDataListModule,
1317
- kit.TuiDataListWrapperModule,
1318
- core$1.TuiNotificationModule,
1319
- ],
1320
- declarations: [
1321
- TuiDocDocumentationComponent,
1322
- TuiDocDocumentationPropertyConnectorDirective,
1323
- ],
1324
- exports: [
1325
- TuiDocDocumentationComponent,
1326
- TuiDocDocumentationPropertyConnectorDirective,
1327
- ],
1236
+ ScrollIntoViewDirective.ctorParameters = function () { return [
1237
+ { type: cdk.TuiDestroyService, decorators: [{ type: core.Inject, args: [cdk.TuiDestroyService,] }] },
1238
+ { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] }
1239
+ ]; };
1240
+ __decorate([
1241
+ core.Input()
1242
+ ], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
1243
+ ScrollIntoViewDirective = __decorate([
1244
+ core.Directive({
1245
+ selector: '[scrollIntoView]',
1246
+ providers: [cdk.TuiDestroyService],
1247
+ }),
1248
+ __param(0, core.Inject(cdk.TuiDestroyService)),
1249
+ __param(1, core.Inject(core.ElementRef))
1250
+ ], ScrollIntoViewDirective);
1251
+ return ScrollIntoViewDirective;
1252
+ }());
1253
+
1254
+ var ScrollIntoViewModule = /** @class */ (function () {
1255
+ function ScrollIntoViewModule() {
1256
+ }
1257
+ ScrollIntoViewModule = __decorate([
1258
+ core.NgModule({
1259
+ declarations: [ScrollIntoViewDirective],
1260
+ exports: [ScrollIntoViewDirective],
1328
1261
  })
1329
- ], TuiDocDocumentationModule);
1330
- return TuiDocDocumentationModule;
1262
+ ], ScrollIntoViewModule);
1263
+ return ScrollIntoViewModule;
1331
1264
  }());
1332
1265
 
1333
- var TUI_DOC_CODE_EDITOR = new core.InjectionToken('Contains service for opening online IDE e.g. Stackblitz');
1266
+ var MAP = {
1267
+ а: 'f',
1268
+ б: ',',
1269
+ в: 'd',
1270
+ г: 'u',
1271
+ д: 'l',
1272
+ е: 't',
1273
+ ё: '`',
1274
+ ж: ';',
1275
+ з: 'p',
1276
+ и: 'b',
1277
+ й: 'q',
1278
+ к: 'r',
1279
+ л: 'k',
1280
+ м: 'v',
1281
+ н: 'y',
1282
+ о: 'j',
1283
+ п: 'g',
1284
+ р: 'h',
1285
+ с: 'c',
1286
+ т: 'n',
1287
+ у: 'e',
1288
+ ф: 'a',
1289
+ х: '[',
1290
+ ц: 'w',
1291
+ ч: 'x',
1292
+ ш: 'i',
1293
+ щ: 'o',
1294
+ ъ: ']',
1295
+ ы: 's',
1296
+ ь: 'm',
1297
+ ю: '.',
1298
+ я: 'z',
1299
+ };
1300
+ /**
1301
+ * Translates text mistakenly typed in the Russian layout into English
1302
+ * @param string string with Russian layout characters
1303
+ * @return string with English layout characters
1304
+ */
1305
+ function transliterateKeyboardLayout(string) {
1306
+ var newStr = '';
1307
+ for (var i = 0; i < string.length; i++) {
1308
+ newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
1309
+ }
1310
+ return newStr;
1311
+ }
1334
1312
 
1335
- var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new core.InjectionToken('Processes content in example', {
1336
- factory: function () { return cdk.identity; },
1313
+ var TUI_DOC_PAGES = new core.InjectionToken('Documentation pages', {
1314
+ factory: function () { return []; },
1337
1315
  });
1338
1316
 
1339
- // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1317
+ var TUI_DOC_TITLE = new core.InjectionToken('Page title', {
1318
+ factory: function () { return ''; },
1319
+ });
1320
+
1321
+ var NAVIGATION_TITLE = new core.InjectionToken('Page title');
1322
+ var NAVIGATION_LABELS = new core.InjectionToken('Navigation sections labels for search');
1323
+ var NAVIGATION_ITEMS = new core.InjectionToken('Navigation pages');
1324
+ var NAVIGATION_PROVIDERS = [
1325
+ cdk.TuiDestroyService,
1326
+ {
1327
+ provide: NAVIGATION_TITLE,
1328
+ deps: [router.Router, router.ActivatedRoute, TUI_DOC_TITLE, cdk.TuiDestroyService],
1329
+ useFactory: titleProviderFactory,
1330
+ },
1331
+ {
1332
+ provide: NAVIGATION_LABELS,
1333
+ deps: [TUI_DOC_PAGES],
1334
+ useFactory: labelsProviderFactory,
1335
+ },
1336
+ {
1337
+ provide: NAVIGATION_ITEMS,
1338
+ deps: [TUI_DOC_PAGES],
1339
+ useFactory: itemsProviderFactory,
1340
+ },
1341
+ ];
1342
+ function titleProviderFactory(router$1, activatedRoute, titlePrefix, destroy$) {
1343
+ return router$1.events.pipe(operators.filter(function (event) { return event instanceof router.NavigationEnd; }), operators.map(function () { return activatedRoute.firstChild; }), operators.filter(cdk.isPresent), operators.mergeMap(function (_a) {
1344
+ var data = _a.data;
1345
+ return data;
1346
+ }), operators.map(function (_a) {
1347
+ var title = _a.title;
1348
+ return titlePrefix + title;
1349
+ }), operators.takeUntil(destroy$));
1350
+ }
1351
+ function labelsProviderFactory(pages) {
1352
+ return pages
1353
+ .map(function (_a) {
1354
+ var section = _a.section;
1355
+ return section;
1356
+ })
1357
+ .filter(cdk.isPresent)
1358
+ .filter(function (item, index, array) { return array.indexOf(item) === index; });
1359
+ }
1360
+ function itemsProviderFactory(pages) {
1361
+ var labels = labelsProviderFactory(pages);
1362
+ return __spread(labels.map(function (label) { return pages.filter(function (_a) {
1363
+ var section = _a.section;
1364
+ return section === label;
1365
+ }); }), [
1366
+ pages.filter(function (page) { return !page.section; }),
1367
+ ]);
1368
+ }
1369
+
1370
+ var SCROLL_INTO_VIEW_DELAY = 200;
1340
1371
  // @dynamic
1341
- var TuiDocExampleComponent = /** @class */ (function () {
1342
- function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent) {
1343
- this.id = id;
1344
- this.clipboard = clipboard;
1345
- this.notifications = notifications;
1346
- this.location = location;
1347
- this.copyTexts$ = copyTexts$;
1348
- this.texts = texts;
1349
- this.codeEditor = codeEditor;
1350
- this.processContent = processContent;
1351
- this.heading = '';
1352
- this.description = '';
1353
- this.componentName = this.location.pathname.slice(1);
1354
- this.activeItemIndex = 0;
1355
- this.processedContent = {};
1356
- this.defaultTab = this.texts[0];
1357
- this.copy$ = this.copyTexts$.pipe(operators.map(function (_a) {
1358
- var _b = __read(_a, 1), copy = _b[0];
1359
- return copy;
1360
- }));
1372
+ var TuiDocNavigationComponent = /** @class */ (function () {
1373
+ function TuiDocNavigationComponent(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
1374
+ var _this = this;
1375
+ this.documentRef = documentRef;
1376
+ this.mode = mode;
1377
+ this.sidebar = sidebar;
1378
+ this.labels = labels;
1379
+ this.items = items;
1380
+ this.searchText = searchText;
1381
+ this.router = router;
1382
+ this.activatedRoute = activatedRoute;
1383
+ this.menuOpen = false;
1384
+ this.search = '';
1385
+ this.open = false;
1386
+ this.openPagesArr = [];
1387
+ this.openPagesGroupsArr = [];
1388
+ this.active = '';
1389
+ this.mode$ = this.mode.change$.pipe(operators.startWith(null), operators.map(function () { return _this.mode.mode || 'onLight'; }));
1390
+ // Angular can't navigate no anchor links
1391
+ // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
1392
+ title$.subscribe(function (title) {
1393
+ changeDetectorRef.markForCheck();
1394
+ titleService.setTitle(title);
1395
+ _this.openActivePageGroup();
1396
+ _this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
1397
+ });
1361
1398
  }
1362
- Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
1363
- set: function (content) {
1364
- this.processedContent = this.processContent(content);
1365
- },
1366
- enumerable: true,
1367
- configurable: true
1368
- });
1369
- Object.defineProperty(TuiDocExampleComponent.prototype, "activeItem", {
1370
- get: function () {
1371
- return this.tabs[this.activeItemIndex];
1372
- },
1373
- enumerable: true,
1374
- configurable: true
1375
- });
1376
- Object.defineProperty(TuiDocExampleComponent.prototype, "tabs", {
1399
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
1377
1400
  get: function () {
1378
- return this.getTabs(this.processedContent);
1401
+ return this.search.length > 2;
1379
1402
  },
1380
1403
  enumerable: true,
1381
1404
  configurable: true
1382
1405
  });
1383
- Object.defineProperty(TuiDocExampleComponent.prototype, "code", {
1406
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
1384
1407
  get: function () {
1385
- var code = this.processedContent[this.activeItem];
1386
- return code ? code.trim() : '';
1408
+ return this.filterItems(this.flattenSubPages(this.items), this.search);
1387
1409
  },
1388
1410
  enumerable: true,
1389
1411
  configurable: true
1390
1412
  });
1391
- Object.defineProperty(TuiDocExampleComponent.prototype, "isDefaultItem", {
1413
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
1392
1414
  get: function () {
1393
- return this.activeItem === this.defaultTab;
1415
+ return this.items[this.items.length - 1];
1394
1416
  },
1395
1417
  enumerable: true,
1396
1418
  configurable: true
1397
1419
  });
1398
- TuiDocExampleComponent.prototype.copyExampleLink = function () {
1399
- var hashPosition = this.location.href.indexOf('#');
1400
- var currentUrl = hashPosition > -1
1401
- ? this.location.href.substr(0, hashPosition)
1402
- : this.location.href;
1403
- var url = currentUrl + "#" + this.id;
1404
- this.clipboard.copy(url);
1405
- this.notifications
1406
- .show(this.texts[1], {
1407
- label: this.texts[2],
1408
- status: "success" /* Success */,
1409
- })
1410
- .subscribe();
1420
+ TuiDocNavigationComponent.prototype.isActive = function (route) {
1421
+ return route === this.active;
1422
+ };
1423
+ TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
1424
+ this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
1425
+ };
1426
+ TuiDocNavigationComponent.prototype.closeMenu = function () {
1427
+ this.menuOpen = false;
1428
+ };
1429
+ TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
1430
+ this.search = search;
1431
+ this.open = this.canOpen;
1432
+ };
1433
+ TuiDocNavigationComponent.prototype.onClick = function () {
1434
+ this.open = false;
1435
+ this.menuOpen = false;
1436
+ this.search = '';
1437
+ this.openActivePageGroup();
1438
+ };
1439
+ TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
1440
+ return items.map(function (section) {
1441
+ return cdk.uniqBy(section.filter(function (_a) {
1442
+ var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
1443
+ title = title.toLowerCase();
1444
+ search = search.toLowerCase();
1445
+ keywords = keywords.toLowerCase();
1446
+ return (title.includes(search) ||
1447
+ keywords.includes(search) ||
1448
+ title.includes(transliterateKeyboardLayout(search)) ||
1449
+ keywords.includes(transliterateKeyboardLayout(search)) ||
1450
+ search.replace(/-/gi, '').includes(title));
1451
+ }), 'title');
1452
+ });
1453
+ };
1454
+ TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
1455
+ return items.reduce(function (array, item) { return __spread(array, [
1456
+ item.reduce(function (pages, page) {
1457
+ return 'subPages' in page
1458
+ ? __spread(pages, page.subPages) : __spread(pages, [page]);
1459
+ }, []),
1460
+ ]); }, []);
1461
+ };
1462
+ TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
1463
+ return this.router.isActive(route, false);
1464
+ };
1465
+ TuiDocNavigationComponent.prototype.handleAnchorLink = function (hash) {
1466
+ var _this = this;
1467
+ setTimeout(function () {
1468
+ _this.navigateToAnchorLink(hash);
1469
+ }, SCROLL_INTO_VIEW_DELAY);
1470
+ };
1471
+ TuiDocNavigationComponent.prototype.openActivePageGroup = function () {
1472
+ var _this = this;
1473
+ this.items.forEach(function (pages, pagesIndex) {
1474
+ pages.forEach(function (page, pageIndex) {
1475
+ if ('route' in page && _this.isActiveRoute(page.route)) {
1476
+ _this.openPagesArr[pagesIndex] = true;
1477
+ _this.active = page.route;
1478
+ }
1479
+ if ('subPages' in page) {
1480
+ page.subPages.forEach(function (subPage) {
1481
+ if (_this.isActiveRoute(subPage.route)) {
1482
+ _this.openPagesArr[pagesIndex] = true;
1483
+ _this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
1484
+ _this.active = subPage.route;
1485
+ }
1486
+ });
1487
+ }
1488
+ });
1489
+ });
1411
1490
  };
1412
- TuiDocExampleComponent.prototype.getTabs = function (content) {
1413
- return __spread([this.defaultTab], Object.keys(content));
1491
+ TuiDocNavigationComponent.prototype.navigateToAnchorLink = function (fragment) {
1492
+ var element = fragment && this.documentRef.querySelector("#" + fragment);
1493
+ if (!element) {
1494
+ return;
1495
+ }
1496
+ element.classList.add('tui-doc-animated-example');
1497
+ element.scrollIntoView({
1498
+ block: 'start',
1499
+ inline: 'nearest',
1500
+ behavior: 'smooth',
1501
+ });
1414
1502
  };
1415
- TuiDocExampleComponent.ctorParameters = function () { return [
1416
- { type: String, decorators: [{ type: core.Attribute, args: ['id',] }] },
1417
- { type: clipboard.Clipboard, decorators: [{ type: core.Inject, args: [clipboard.Clipboard,] }] },
1418
- { type: core$1.TuiNotificationsService, decorators: [{ type: core.Inject, args: [core$1.TuiNotificationsService,] }] },
1419
- { type: Location, decorators: [{ type: core.Inject, args: [common$1.LOCATION,] }] },
1420
- { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [kit.TUI_COPY_TEXTS,] }] },
1421
- { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
1422
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
1423
- { type: undefined, decorators: [{ type: core.Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] }
1503
+ TuiDocNavigationComponent.ctorParameters = function () { return [
1504
+ { type: core.ChangeDetectorRef, decorators: [{ type: core.Inject, args: [core.ChangeDetectorRef,] }] },
1505
+ { type: platformBrowser.Title, decorators: [{ type: core.Inject, args: [platformBrowser.Title,] }] },
1506
+ { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [NAVIGATION_TITLE,] }] },
1507
+ { type: Document, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
1508
+ { type: core$1.TuiModeDirective, decorators: [{ type: core.Inject, args: [core$1.TuiModeDirective,] }] },
1509
+ { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [addonMobile.TuiSidebarDirective,] }] },
1510
+ { type: Array, decorators: [{ type: core.Inject, args: [NAVIGATION_LABELS,] }] },
1511
+ { type: undefined, decorators: [{ type: core.Inject, args: [NAVIGATION_ITEMS,] }] },
1512
+ { type: String, decorators: [{ type: core.Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
1513
+ { type: router.Router, decorators: [{ type: core.Inject, args: [router.Router,] }] },
1514
+ { type: router.ActivatedRoute, decorators: [{ type: core.Inject, args: [router.ActivatedRoute,] }] }
1424
1515
  ]; };
1425
1516
  __decorate([
1426
- core.Input()
1427
- ], TuiDocExampleComponent.prototype, "heading", void 0);
1428
- __decorate([
1429
- core.Input()
1430
- ], TuiDocExampleComponent.prototype, "description", void 0);
1431
- __decorate([
1432
- core.Input()
1433
- ], TuiDocExampleComponent.prototype, "content", null);
1517
+ core.HostBinding('class._open')
1518
+ ], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
1434
1519
  __decorate([
1435
- core.Input()
1436
- ], TuiDocExampleComponent.prototype, "componentName", void 0);
1520
+ cdk.tuiPure
1521
+ ], TuiDocNavigationComponent.prototype, "filterItems", null);
1437
1522
  __decorate([
1438
1523
  cdk.tuiPure
1439
- ], TuiDocExampleComponent.prototype, "getTabs", null);
1440
- TuiDocExampleComponent = __decorate([
1524
+ ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
1525
+ TuiDocNavigationComponent = __decorate([
1441
1526
  core.Component({
1442
- selector: 'tui-doc-example',
1443
- template: "<h3 *ngIf=\"heading\" class=\"t-title\">\n <span polymorpheus-outlet [content]=\"heading\"></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n class=\"t-link-icon\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n class=\"t-description\"\n polymorpheus-outlet\n [content]=\"description\"\n></h4>\n<div class=\"t-example\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button *tuiTab tuiTab>{{tab}}</button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n (click)=\"codeEditor.open(componentName, id || '', processedContent)\"\n >\n Edit on {{codeEditor.name}}\n </button>\n </div>\n <ng-container [ngSwitch]=\"activeItem\">\n <div\n *ngIf=\"isDefaultItem; else codeTab\"\n class=\"t-demo\"\n automation-id=\"tui-doc-example\"\n >\n <ng-content></ng-content>\n </div>\n <ng-template #codeTab>\n <tui-doc-copy\n class=\"t-copy-code\"\n [cdkCopyToClipboard]=\"code\"\n ></tui-doc-copy>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n </ng-template>\n </ng-container>\n</div>\n",
1527
+ selector: 'tui-doc-navigation',
1528
+ template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n class=\"input\"\n [autoFocus]=\"!!sidebar\"\n [content]=\"dropdown\"\n [canOpen]=\"canOpen\"\n [(open)]=\"open\"\n>\n <tui-primitive-textfield\n iconAlign=\"left\"\n tuiTextfieldSize=\"m\"\n iconContent=\"tuiIconSearch\"\n [pseudoFocused]=\"open || null\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n [value]=\"search\"\n (valueChange)=\"onSearchChange($event)\"\n >\n {{ searchText }}\n </tui-primitive-textfield>\n <ng-template #dropdown let-activeZone>\n <tui-data-list>\n <tui-opt-group\n *ngFor=\"let group of filtered; let index = index\"\n [label]=\"labels[index] || ''\"\n >\n <a\n *ngFor=\"let item of group\"\n tuiOption\n [routerLink]=\"item.route\"\n (click)=\"onClick()\"\n >\n {{ item.title }}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-template>\n</tui-hosted-dropdown>\n\n<nav class=\"navigation\">\n <tui-scrollbar class=\"scrollbar\" [tuiMode]=\"mode$ | async\">\n <tui-accordion [closeOthers]=\"false\" [rounded]=\"false\">\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"tui-space_left-2\">\n <strong>{{ label }}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: index * 100 + subIndex}\"\n ></ng-container>\n </ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: items.length - 1 + index}\"\n ></ng-container>\n </ng-container>\n </div>\n\n <ng-template #pages let-item=\"item\" let-index=\"index\">\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{ item.title }}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"sublink sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"chevron\"\n [class.chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{ item.title }}\n </button>\n <tui-expand\n class=\"tui-space_left-1\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"section section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink sublink_small\"\n [routerLink]=\"subPage.route\"\n [scrollIntoView]=\"isActive(subPage.route)\"\n (click)=\"closeMenu()\"\n >\n {{ subPage.title }}\n </a>\n </div>\n </tui-expand>\n </div>\n </ng-template>\n </ng-template>\n </tui-scrollbar>\n</nav>\n\n<ng-content></ng-content>\n",
1529
+ providers: NAVIGATION_PROVIDERS,
1444
1530
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1445
- styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}@media screen and (max-width:47.9375em){:host{padding-top:2rem}.t-title{font:var(--tui-font-heading-6)}}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-description:first-letter,.t-title:first-letter{text-transform:capitalize}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}@media screen and (max-width:47.9375em){.t-example{margin-top:.75rem}.t-tabs-wrapper{padding:0 1rem}}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}@media screen and (max-width:47.9375em){.t-demo{padding:1rem}}.t-copy-code{position:absolute;top:4.375rem;right:1rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}"]
1531
+ styles: [":host{z-index:1;display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01)}.input{display:block;margin:1.25rem}.navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.scrollbar{width:100%;scroll-behavior:smooth}.items-container{display:flex;flex-direction:column;padding:0 16px}.section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.subsection{margin-left:.5rem}.sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;font:var(--tui-font-text-m);margin-left:.5rem;line-height:2.75rem}.sublink_small{margin-left:1rem;line-height:1.5rem}.sublink_small:not(:first-child){margin-top:1rem}.sublink_subsection{margin-left:0;line-height:2.75rem}.sublink_active{color:var(--tui-text-01)}.chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.chevron_active{transform:rotate(90deg)}"]
1446
1532
  }),
1447
- __param(0, core.Attribute('id')),
1448
- __param(1, core.Inject(clipboard.Clipboard)),
1449
- __param(2, core.Inject(core$1.TuiNotificationsService)),
1450
- __param(3, core.Inject(common$1.LOCATION)),
1451
- __param(4, core.Inject(kit.TUI_COPY_TEXTS)),
1452
- __param(5, core.Inject(TUI_DOC_EXAMPLE_TEXTS)),
1453
- __param(6, core.Optional()),
1454
- __param(6, core.Inject(TUI_DOC_CODE_EDITOR)),
1455
- __param(7, core.Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR))
1456
- ], TuiDocExampleComponent);
1457
- return TuiDocExampleComponent;
1533
+ __param(0, core.Inject(core.ChangeDetectorRef)),
1534
+ __param(1, core.Inject(platformBrowser.Title)),
1535
+ __param(2, core.Inject(NAVIGATION_TITLE)),
1536
+ __param(3, core.Inject(common.DOCUMENT)),
1537
+ __param(4, core.Inject(core$1.TuiModeDirective)),
1538
+ __param(5, core.Optional()),
1539
+ __param(5, core.Inject(addonMobile.TuiSidebarDirective)),
1540
+ __param(6, core.Inject(NAVIGATION_LABELS)),
1541
+ __param(7, core.Inject(NAVIGATION_ITEMS)),
1542
+ __param(8, core.Inject(TUI_DOC_SEARCH_TEXT)),
1543
+ __param(9, core.Inject(router.Router)),
1544
+ __param(10, core.Inject(router.ActivatedRoute))
1545
+ ], TuiDocNavigationComponent);
1546
+ return TuiDocNavigationComponent;
1458
1547
  }());
1459
1548
 
1460
- var TuiDocExampleModule = /** @class */ (function () {
1461
- function TuiDocExampleModule() {
1549
+ var TuiDocNavigationModule = /** @class */ (function () {
1550
+ function TuiDocNavigationModule() {
1462
1551
  }
1463
- TuiDocExampleModule = __decorate([
1552
+ TuiDocNavigationModule = __decorate([
1464
1553
  core.NgModule({
1465
1554
  imports: [
1466
1555
  common.CommonModule,
1467
- clipboard.ClipboardModule,
1468
- kit.TuiTabsModule,
1556
+ forms.FormsModule,
1557
+ router.RouterModule,
1558
+ ScrollIntoViewModule,
1469
1559
  core$1.TuiButtonModule,
1470
- TuiDocCopyModule,
1471
- TuiDocCodeModule,
1472
- ngPolymorpheus.PolymorpheusModule,
1560
+ core$1.TuiPrimitiveTextfieldModule,
1561
+ core$1.TuiTextfieldControllerModule,
1562
+ cdk.TuiActiveZoneModule,
1563
+ cdk.TuiLetModule,
1564
+ core$1.TuiModeModule,
1565
+ core$1.TuiLinkModule,
1566
+ core$1.TuiExpandModule,
1567
+ core$1.TuiHostedDropdownModule,
1568
+ core$1.TuiDropdownControllerModule,
1569
+ kit.TuiAccordionModule,
1570
+ core$1.TuiScrollbarModule,
1571
+ core$1.TuiSvgModule,
1572
+ core$1.TuiDataListModule,
1573
+ cdk.TuiAutoFocusModule,
1473
1574
  ],
1474
- declarations: [TuiDocExampleComponent],
1475
- exports: [TuiDocExampleComponent],
1575
+ declarations: [TuiDocNavigationComponent],
1576
+ exports: [TuiDocNavigationComponent],
1476
1577
  })
1477
- ], TuiDocExampleModule);
1478
- return TuiDocExampleModule;
1479
- }());
1480
-
1481
- // @dynamic
1482
- var TuiDocMainComponent = /** @class */ (function () {
1483
- function TuiDocMainComponent(storage, windowRef) {
1484
- this.storage = storage;
1485
- this.windowRef = windowRef;
1486
- this.night = this.storage.getItem('night') === 'true' ||
1487
- (this.storage.getItem('night') === null &&
1488
- this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
1489
- this.change$ = new rxjs.Subject();
1490
- }
1491
- TuiDocMainComponent_1 = TuiDocMainComponent;
1492
- Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
1493
- get: function () {
1494
- return this.night ? 'onDark' : null;
1495
- },
1496
- enumerable: true,
1497
- configurable: true
1498
- });
1499
- TuiDocMainComponent.prototype.onMode = function (night) {
1500
- this.night = night;
1501
- this.change$.next();
1502
- this.storage.setItem('night', String(night));
1503
- };
1504
- var TuiDocMainComponent_1;
1505
- TuiDocMainComponent.ctorParameters = function () { return [
1506
- { type: Storage, decorators: [{ type: core.Inject, args: [common$1.LOCAL_STORAGE,] }] },
1507
- { type: Window, decorators: [{ type: core.Inject, args: [common$1.WINDOW,] }] }
1508
- ]; };
1509
- TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
1510
- core.Component({
1511
- selector: 'tui-doc-main',
1512
- template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-space_left-2\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
1513
- encapsulation: core.ViewEncapsulation.None,
1514
- providers: [
1515
- {
1516
- provide: core$1.TuiModeDirective,
1517
- useExisting: core.forwardRef(function () { return TuiDocMainComponent_1; }),
1518
- },
1519
- cdk.TuiSwipeService,
1520
- ],
1521
- styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls{top:4rem!important}@-webkit-keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}@keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(.hljs):not(.exception){transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;background:var(--tui-base-02);color:var(--tui-text-02);vertical-align:middle;box-shadow:inset 0 -2px var(--tui-secondary);padding:.375rem .5rem;font-size:.875rem;border-radius:.5rem}:focus code:not(.exception){background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width:47.9375em){tui-doc-navigation.tui-doc-navigation{display:none}.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{-webkit-animation:1s .3s tuiShaking;animation:1s .3s tuiShaking}label.night-mode{cursor:pointer}.hljs-tag{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear-disabled)}.hljs-subst,.hljs-title{font-weight:400;color:var(--tui-text-01)}.hljs-comment,.hljs-quote{color:var(--tui-text-03);font-style:italic}.hljs-meta{color:#e38162}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type{font-weight:700;color:var(--tui-link)}.hljs-attribute,.hljs-link,.hljs-number,.hljs-regexp{font-weight:700;color:var(--tui-support-06)}.hljs-link,.hljs-number,.hljs-regexp{font-weight:400}.hljs-string{color:var(--tui-positive);font-weight:700}.hljs-bullet,.hljs-formula,.hljs-symbol{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}.hljs-doctag{text-decoration:underline}.hljs-template-variable,.hljs-variable{color:var(--tui-warning-fill)}.hljs-addition{background:var(--tui-success-bg)}.hljs-deletion{background:var(--tui-error-bg)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs .hljs-line-numbers{padding:0}.hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}"]
1522
- }),
1523
- __param(0, core.Inject(common$1.LOCAL_STORAGE)),
1524
- __param(1, core.Inject(common$1.WINDOW))
1525
- ], TuiDocMainComponent);
1526
- return TuiDocMainComponent;
1578
+ ], TuiDocNavigationModule);
1579
+ return TuiDocNavigationModule;
1527
1580
  }());
1528
1581
 
1529
1582
  var TUI_DOC_LOGO = new core.InjectionToken('Main logo', {
@@ -1556,7 +1609,7 @@
1556
1609
  TuiDocHeaderComponent = __decorate([
1557
1610
  core.Component({
1558
1611
  selector: 'header[tuiDocHeader]',
1559
- template: "<button\n tuiIconButton\n class=\"menu\"\n icon=\"tuiIconMenuLarge\"\n appearance=\"icon\"\n [title]=\"menu\"\n (click)=\"onClick()\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-doc-navigation\n *tuiSidebar=\"open$ | async\"\n class=\"navigation\"\n ></tui-doc-navigation>\n</button>\n<div polymorpheus-outlet class=\"logo tui-text_h5\" [content]=\"logo\">\n <ng-template let-src>\n <img class=\"img\" alt=\"Logo\" [src]=\"src\" />\n </ng-template>\n</div>\n<ng-content></ng-content>\n",
1612
+ template: "<button\n tuiIconButton\n icon=\"tuiIconMenuLarge\"\n appearance=\"icon\"\n class=\"menu\"\n [title]=\"menu\"\n (click)=\"onClick()\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-doc-navigation\n *tuiSidebar=\"open$ | async\"\n class=\"navigation\"\n ></tui-doc-navigation>\n</button>\n<div polymorpheus-outlet class=\"logo tui-text_h5\" [content]=\"logo\">\n <ng-template let-src>\n <img alt=\"Logo\" class=\"img\" [src]=\"src\" />\n </ng-template>\n</div>\n<ng-content></ng-content>\n",
1560
1613
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1561
1614
  styles: [":host{box-shadow:0 .125rem 1rem rgba(0,0,0,.08);position:fixed;top:0;left:0;right:0;z-index:1;display:flex;height:3.9375rem;align-items:center;padding:0 1.25rem;background:var(--tui-base-01);border-bottom:1px solid var(--tui-base-03)}.logo{margin-right:auto}.img{display:block}.menu{margin-left:-1.25rem}@media screen and (min-width:48em){.menu{display:none}}.navigation{min-height:100%}"]
1562
1615
  }),
@@ -1616,26 +1669,6 @@
1616
1669
  factory: function () { return []; },
1617
1670
  });
1618
1671
 
1619
- var TuiDocPageTabConnectorDirective = /** @class */ (function () {
1620
- function TuiDocPageTabConnectorDirective(template) {
1621
- this.template = template;
1622
- }
1623
- TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
1624
- { type: core.TemplateRef, decorators: [{ type: core.Inject, args: [core.TemplateRef,] }] }
1625
- ]; };
1626
- __decorate([
1627
- core.Input(),
1628
- cdk.tuiDefaultProp()
1629
- ], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
1630
- TuiDocPageTabConnectorDirective = __decorate([
1631
- core.Directive({
1632
- selector: '[pageTab]',
1633
- }),
1634
- __param(0, core.Inject(core.TemplateRef))
1635
- ], TuiDocPageTabConnectorDirective);
1636
- return TuiDocPageTabConnectorDirective;
1637
- }());
1638
-
1639
1672
  var TUI_DOC_SEE_ALSO = new core.InjectionToken('Array of arrays of related pages', {
1640
1673
  factory: function () { return []; },
1641
1674
  });
@@ -1658,6 +1691,26 @@
1658
1691
  return Array.from(seeAlsoSet);
1659
1692
  }
1660
1693
 
1694
+ var TuiDocPageTabConnectorDirective = /** @class */ (function () {
1695
+ function TuiDocPageTabConnectorDirective(template) {
1696
+ this.template = template;
1697
+ }
1698
+ TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
1699
+ { type: core.TemplateRef, decorators: [{ type: core.Inject, args: [core.TemplateRef,] }] }
1700
+ ]; };
1701
+ __decorate([
1702
+ core.Input(),
1703
+ cdk.tuiDefaultProp()
1704
+ ], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
1705
+ TuiDocPageTabConnectorDirective = __decorate([
1706
+ core.Directive({
1707
+ selector: '[pageTab]',
1708
+ }),
1709
+ __param(0, core.Inject(core.TemplateRef))
1710
+ ], TuiDocPageTabConnectorDirective);
1711
+ return TuiDocPageTabConnectorDirective;
1712
+ }());
1713
+
1661
1714
  // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1662
1715
  // @dynamic
1663
1716
  var TuiDocPageComponent = /** @class */ (function () {
@@ -1669,8 +1722,8 @@
1669
1722
  this.package = '';
1670
1723
  this.type = '';
1671
1724
  this.path = '';
1672
- this.activeItemIndex = NaN;
1673
1725
  this.tabConnectors = cdk.EMPTY_QUERY;
1726
+ this.activeItemIndex = NaN;
1674
1727
  }
1675
1728
  Object.defineProperty(TuiDocPageComponent.prototype, "showSeeAlso", {
1676
1729
  get: function () {
@@ -1706,7 +1759,7 @@
1706
1759
  TuiDocPageComponent = __decorate([
1707
1760
  core.Component({
1708
1761
  selector: 'tui-doc-page',
1709
- template: "<header class=\"t-header\">\n <h1 class=\"t-title\">\n {{header}}\n <tui-tag\n *ngIf=\"deprecated !== null\"\n class=\"t-tag t-tag_deprecated\"\n value=\"deprecated\"\n status=\"custom\"\n ></tui-tag>\n <tui-tag\n *ngIf=\"package\"\n class=\"t-tag t-tag_package\"\n status=\"custom\"\n [value]=\"package\"\n [autoColor]=\"true\"\n ></tui-tag>\n </h1>\n <tui-tabs-with-more\n *ngIf=\"tabConnectors.length\"\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container\n *ngFor=\"let tab of tabConnectors; first as first; index as index\"\n >\n <ng-container *ngIf=\"first; else dynamicTab\">\n <a\n *tuiTab\n tuiTab\n routerLink=\"./\"\n routerLinkActive\n [routerLinkActiveOptions]=\"{ exact: true }\"\n >\n {{tab.pageTab || defaultTabs[index]}}\n </a>\n </ng-container>\n <ng-template #dynamicTab>\n <a\n *tuiTab\n tuiTab\n routerLinkActive\n [routerLink]=\"getRouterLink(tab.pageTab || defaultTabs[index])\"\n >\n {{tab.pageTab || defaultTabs[index]}}\n </a>\n </ng-template>\n </ng-container>\n </tui-tabs-with-more>\n <tui-doc-source-code\n class=\"t-source-code\"\n [header]=\"header\"\n [package]=\"package\"\n [type]=\"type\"\n [path]=\"path\"\n ></tui-doc-source-code>\n</header>\n<div class=\"t-content\">\n <ng-content></ng-content>\n <tui-doc-see-also\n *ngIf=\"showSeeAlso\"\n class=\"t-see-also\"\n [seeAlso]=\"seeAlso\"\n ></tui-doc-see-also>\n <ng-container *ngFor=\"let tab of tabConnectors; index as index\">\n <ng-container *ngIf=\"index === activeItemIndex\">\n <ng-container *ngTemplateOutlet=\"tab.template\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n",
1762
+ template: "<header class=\"t-header\">\n <h1 class=\"t-title\">\n {{ header }}\n <tui-tag\n *ngIf=\"deprecated !== null\"\n value=\"deprecated\"\n status=\"custom\"\n class=\"t-tag t-tag_deprecated\"\n ></tui-tag>\n <tui-tag\n *ngIf=\"package\"\n status=\"custom\"\n class=\"t-tag t-tag_package\"\n [value]=\"package\"\n [autoColor]=\"true\"\n ></tui-tag>\n </h1>\n <tui-tabs-with-more\n *ngIf=\"tabConnectors.length\"\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container\n *ngFor=\"let tab of tabConnectors; first as first; index as index\"\n >\n <ng-container *ngIf=\"first; else dynamicTab\">\n <a\n *tuiTab\n tuiTab\n routerLink=\"./\"\n routerLinkActive\n [routerLinkActiveOptions]=\"{exact: true}\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-container>\n <ng-template #dynamicTab>\n <a\n *tuiTab\n tuiTab\n routerLinkActive\n [routerLink]=\"getRouterLink(tab.pageTab || defaultTabs[index])\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-template>\n </ng-container>\n </tui-tabs-with-more>\n <tui-doc-source-code\n class=\"t-source-code\"\n [header]=\"header\"\n [package]=\"package\"\n [type]=\"type\"\n [path]=\"path\"\n ></tui-doc-source-code>\n</header>\n<div class=\"t-content\">\n <ng-content></ng-content>\n <tui-doc-see-also\n *ngIf=\"showSeeAlso\"\n class=\"t-see-also\"\n [seeAlso]=\"seeAlso\"\n ></tui-doc-see-also>\n <ng-container *ngFor=\"let tab of tabConnectors; index as index\">\n <ng-container *ngIf=\"index === activeItemIndex\">\n <ng-container *ngTemplateOutlet=\"tab.template\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n",
1710
1763
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1711
1764
  providers: PAGE_PROVIDERS,
1712
1765
  styles: [":host{display:flex;flex-direction:column;min-height:0;flex-basis:0;flex-grow:1}.t-header{display:flex;font:var(--tui-font-heading-3);flex-wrap:wrap;min-height:7.25rem;color:var(--tui-text-01);box-shadow:inset 0 -1px 0 0 var(--tui-base-03);padding:3.75rem 0 0;box-sizing:border-box;flex-shrink:0;margin:0 min(10vw,8.75rem)}@media screen and (max-width:47.9375em){.t-header{font:var(--tui-font-heading-4);min-height:4.5rem;padding:1.25rem 1.25rem 0;margin:0}}.t-title{min-width:100%;font-size:inherit;margin:0}.t-tag{vertical-align:middle;text-transform:uppercase;margin-right:.5rem}.t-tag_deprecated{background-color:var(--tui-error-fill)}.t-tag.t-tag_package{color:#000}.t-tabs{flex:1;margin:1.125rem .3125rem 0 0}@media screen and (max-width:47.9375em){.t-tabs{margin-top:.25rem}}.t-content{padding:2rem 0;margin:0 min(10vw,8.75rem)}@media screen and (max-width:47.9375em){.t-content{padding:2rem 1.25rem;margin:0}}.t-see-also{min-width:18.75rem;width:30%;float:right;margin-left:1.5rem}@media screen and (max-width:47.9375em){.t-see-also{float:none;width:100%;margin:0 0 1.5rem}}.t-source-code{align-self:flex-end;line-height:2.75rem}"]
@@ -1747,7 +1800,7 @@
1747
1800
  TuiDocSeeAlsoComponent = __decorate([
1748
1801
  core.Component({
1749
1802
  selector: 'tui-doc-see-also',
1750
- template: "<h5 class=\"header\">{{text}}</h5>\n<ng-container *ngFor=\"let item of seeAlso; last as last\">\n <a tuiLink [routerLink]=\"getRouterLink(item)\">{{item}}</a>\n <ng-container *ngIf=\"!last\">, </ng-container>\n</ng-container>\n",
1803
+ template: "<h5 class=\"header\">{{ text }}</h5>\n<ng-container *ngFor=\"let item of seeAlso; last as last\">\n <a tuiLink [routerLink]=\"getRouterLink(item)\">{{ item }}</a>\n <ng-container *ngIf=\"!last\">,</ng-container>\n</ng-container>\n",
1751
1804
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1752
1805
  styles: [":host{display:block}.header{font-size:.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:.075em;color:var(--tui-text-02);margin:0 0 .5rem;white-space:nowrap}"]
1753
1806
  }),
@@ -1820,7 +1873,7 @@
1820
1873
  TuiDocSourceCodeComponent = __decorate([
1821
1874
  core.Component({
1822
1875
  selector: 'tui-doc-source-code',
1823
- template: "<div\n polymorpheus-outlet\n *ngIf=\"!!sourceCode\"\n [content]=\"sourceCode\"\n [context]=\"pathOptions\"\n>\n <ng-template let-link>\n <a\n *ngIf=\"link\"\n tuiIconButton\n type=\"button\"\n icon=\"tuiIconCodeLarge\"\n appearance=\"icon\"\n target=\"_blank\"\n size=\"s\"\n [title]=\"text\"\n [href]=\"link\"\n ></a>\n </ng-template>\n</div>\n",
1876
+ template: "<div\n *ngIf=\"!!sourceCode\"\n polymorpheus-outlet\n [content]=\"sourceCode\"\n [context]=\"pathOptions\"\n>\n <ng-template let-link>\n <a\n *ngIf=\"link\"\n tuiIconButton\n type=\"button\"\n icon=\"tuiIconCodeLarge\"\n appearance=\"icon\"\n target=\"_blank\"\n size=\"s\"\n [title]=\"text\"\n [href]=\"link\"\n ></a>\n </ng-template>\n</div>\n",
1824
1877
  changeDetection: core.ChangeDetectionStrategy.OnPush
1825
1878
  }),
1826
1879
  __param(0, core.Inject(TUI_DOC_SOURCE_CODE)),
@@ -1903,6 +1956,23 @@
1903
1956
  },
1904
1957
  ];
1905
1958
 
1959
+ var TuiAddonDocModule = /** @class */ (function () {
1960
+ function TuiAddonDocModule() {
1961
+ }
1962
+ TuiAddonDocModule = __decorate([
1963
+ core.NgModule({
1964
+ exports: [
1965
+ TuiDocCodeModule,
1966
+ TuiDocDemoModule,
1967
+ TuiDocDocumentationModule,
1968
+ TuiDocPageModule,
1969
+ TuiDocExampleModule,
1970
+ ],
1971
+ })
1972
+ ], TuiAddonDocModule);
1973
+ return TuiAddonDocModule;
1974
+ }());
1975
+
1906
1976
  /**
1907
1977
  * Generates typical page routing structure
1908
1978
  */
@@ -1921,23 +1991,6 @@
1921
1991
  ];
1922
1992
  }
1923
1993
 
1924
- var TuiAddonDocModule = /** @class */ (function () {
1925
- function TuiAddonDocModule() {
1926
- }
1927
- TuiAddonDocModule = __decorate([
1928
- core.NgModule({
1929
- exports: [
1930
- TuiDocCodeModule,
1931
- TuiDocDemoModule,
1932
- TuiDocDocumentationModule,
1933
- TuiDocPageModule,
1934
- TuiDocExampleModule,
1935
- ],
1936
- })
1937
- ], TuiAddonDocModule);
1938
- return TuiAddonDocModule;
1939
- }());
1940
-
1941
1994
  exports.DEMO_TEXTS = DEMO_TEXTS;
1942
1995
  exports.DOC_TEXTS = DOC_TEXTS;
1943
1996
  exports.EXAMPLE_TEXTS = EXAMPLE_TEXTS;
@@ -1979,24 +2032,25 @@
1979
2032
  exports.TuiDocPageModule = TuiDocPageModule;
1980
2033
  exports.TuiDocPageTabConnectorDirective = TuiDocPageTabConnectorDirective;
1981
2034
  exports.generateRoutes = generateRoutes;
1982
- exports.ɵa = NAVIGATION_TITLE;
1983
- exports.ɵb = NAVIGATION_LABELS;
1984
- exports.ɵc = NAVIGATION_ITEMS;
1985
- exports.ɵd = NAVIGATION_PROVIDERS;
1986
- exports.ɵe = titleProviderFactory;
1987
- exports.ɵf = labelsProviderFactory;
1988
- exports.ɵg = itemsProviderFactory;
1989
- exports.ɵh = TuiInputOpacityModule;
1990
- exports.ɵi = TuiInputOpacityDirective;
1991
- exports.ɵj = TuiDocHeaderModule;
1992
- exports.ɵk = TuiDocHeaderComponent;
1993
- exports.ɵl = PAGE_SEE_ALSO;
1994
- exports.ɵm = PAGE_PROVIDERS;
1995
- exports.ɵn = seeAlsoProviderFactory;
1996
- exports.ɵo = TuiDocSeeAlsoModule;
1997
- exports.ɵp = TuiDocSeeAlsoComponent;
1998
- exports.ɵq = TuiDocSourceCodeModule;
1999
- exports.ɵr = TuiDocSourceCodeComponent;
2035
+ exports.ɵa = TuiInputOpacityModule;
2036
+ exports.ɵb = TuiInputOpacityDirective;
2037
+ exports.ɵc = TuiDocExampleGetTabsPipe;
2038
+ exports.ɵd = TuiDocHeaderModule;
2039
+ exports.ɵe = NAVIGATION_TITLE;
2040
+ exports.ɵf = NAVIGATION_LABELS;
2041
+ exports.ɵg = NAVIGATION_ITEMS;
2042
+ exports.ɵh = NAVIGATION_PROVIDERS;
2043
+ exports.ɵi = titleProviderFactory;
2044
+ exports.ɵj = labelsProviderFactory;
2045
+ exports.ɵk = itemsProviderFactory;
2046
+ exports.ɵl = TuiDocHeaderComponent;
2047
+ exports.ɵm = PAGE_SEE_ALSO;
2048
+ exports.ɵn = PAGE_PROVIDERS;
2049
+ exports.ɵo = seeAlsoProviderFactory;
2050
+ exports.ɵp = TuiDocSeeAlsoModule;
2051
+ exports.ɵq = TuiDocSeeAlsoComponent;
2052
+ exports.ɵr = TuiDocSourceCodeModule;
2053
+ exports.ɵs = TuiDocSourceCodeComponent;
2000
2054
 
2001
2055
  Object.defineProperty(exports, '__esModule', { value: true });
2002
2056