@taiga-ui/addon-doc 2.24.0 → 2.27.1

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 (82) hide show
  1. package/README.md +121 -121
  2. package/bundles/taiga-ui-addon-doc.umd.js +935 -935
  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 +1 -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/navigation/navigation.component.d.ts +1 -1
  10. package/components/page/page.component.d.ts +1 -1
  11. package/esm2015/addon-doc.module.js +1 -1
  12. package/esm2015/components/code/code.component.js +2 -2
  13. package/esm2015/components/code/code.module.js +1 -1
  14. package/esm2015/components/copy/copy.module.js +1 -1
  15. package/esm2015/components/demo/demo.component.js +12 -12
  16. package/esm2015/components/demo/demo.module.js +1 -1
  17. package/esm2015/components/documentation/documentation-property-connector.directive.js +6 -6
  18. package/esm2015/components/documentation/documentation.component.js +2 -2
  19. package/esm2015/components/documentation/documentation.module.js +2 -2
  20. package/esm2015/components/example/example.component.js +1 -1
  21. package/esm2015/components/example/example.module.js +2 -2
  22. package/esm2015/components/main/main.module.js +1 -1
  23. package/esm2015/components/navigation/navigation.component.js +2 -2
  24. package/esm2015/components/navigation/navigation.module.js +1 -1
  25. package/esm2015/components/navigation/navigation.providers.js +1 -1
  26. package/esm2015/components/page/page.component.js +3 -3
  27. package/esm2015/components/page/page.module.js +2 -2
  28. package/esm2015/components/page/page.providers.js +1 -1
  29. package/esm2015/directives/scroll-into-view/scroll-into-view.module.js +1 -1
  30. package/esm2015/internal/header/header.component.js +1 -1
  31. package/esm2015/internal/header/header.module.js +1 -1
  32. package/esm2015/internal/input-opacity/input-opacity.module.js +1 -1
  33. package/esm2015/internal/see-also/see-also.component.js +1 -1
  34. package/esm2015/internal/see-also/see-also.module.js +1 -1
  35. package/esm2015/internal/source-code/source-code.component.js +1 -1
  36. package/esm2015/internal/source-code/source-code.module.js +1 -1
  37. package/esm2015/languages/russian.js +1 -1
  38. package/esm2015/public-api.js +5 -5
  39. package/esm2015/taiga-ui-addon-doc.js +6 -6
  40. package/esm2015/tokens/code-editor.js +1 -1
  41. package/esm2015/tokens/pages.js +1 -1
  42. package/esm2015/tokens/source-code.js +1 -1
  43. package/esm5/addon-doc.module.js +1 -1
  44. package/esm5/components/code/code.component.js +2 -2
  45. package/esm5/components/code/code.module.js +1 -1
  46. package/esm5/components/copy/copy.module.js +1 -1
  47. package/esm5/components/demo/demo.component.js +12 -12
  48. package/esm5/components/demo/demo.module.js +1 -1
  49. package/esm5/components/documentation/documentation-property-connector.directive.js +6 -6
  50. package/esm5/components/documentation/documentation.component.js +2 -2
  51. package/esm5/components/documentation/documentation.module.js +2 -2
  52. package/esm5/components/example/example.component.js +1 -1
  53. package/esm5/components/example/example.module.js +2 -2
  54. package/esm5/components/main/main.module.js +1 -1
  55. package/esm5/components/navigation/navigation.component.js +2 -2
  56. package/esm5/components/navigation/navigation.module.js +1 -1
  57. package/esm5/components/navigation/navigation.providers.js +1 -1
  58. package/esm5/components/page/page.component.js +3 -3
  59. package/esm5/components/page/page.module.js +2 -2
  60. package/esm5/components/page/page.providers.js +1 -1
  61. package/esm5/directives/scroll-into-view/scroll-into-view.module.js +1 -1
  62. package/esm5/internal/header/header.component.js +1 -1
  63. package/esm5/internal/header/header.module.js +1 -1
  64. package/esm5/internal/input-opacity/input-opacity.module.js +1 -1
  65. package/esm5/internal/see-also/see-also.component.js +1 -1
  66. package/esm5/internal/see-also/see-also.module.js +1 -1
  67. package/esm5/internal/source-code/source-code.component.js +1 -1
  68. package/esm5/internal/source-code/source-code.module.js +1 -1
  69. package/esm5/languages/russian.js +1 -1
  70. package/esm5/public-api.js +5 -5
  71. package/esm5/taiga-ui-addon-doc.js +6 -6
  72. package/esm5/tokens/code-editor.js +1 -1
  73. package/esm5/tokens/pages.js +1 -1
  74. package/esm5/tokens/source-code.js +1 -1
  75. package/fesm2015/taiga-ui-addon-doc.js +561 -561
  76. package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
  77. package/fesm5/taiga-ui-addon-doc.js +927 -927
  78. package/fesm5/taiga-ui-addon-doc.js.map +1 -1
  79. package/package.json +6 -5
  80. package/public-api.d.ts +4 -4
  81. package/taiga-ui-addon-doc.d.ts +5 -5
  82. package/taiga-ui-addon-doc.metadata.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
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/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', 'rxjs', 'rxjs/operators', '@angular/common', 'ngx-highlightjs', '@taiga-ui/cdk', '@taiga-ui/kit', '@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.rxjs, global.rxjs.operators, global.ng.common, global.ngxHighlightjs, global.cdk, global.kit, 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, rxjs, operators, common, ngxHighlightjs, cdk, kit, 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.
@@ -246,8 +246,8 @@
246
246
  var TuiDocCodeComponent = /** @class */ (function () {
247
247
  function TuiDocCodeComponent() {
248
248
  this.rawLoader$$ = new rxjs.BehaviorSubject('');
249
- this.processor$ = this.rawLoader$$.pipe(operators.switchMap(rawLoad));
250
249
  this.filename = '';
250
+ this.processor$ = this.rawLoader$$.pipe(operators.switchMap(rawLoad));
251
251
  }
252
252
  Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
253
253
  set: function (code) {
@@ -406,6 +406,8 @@
406
406
  this.destroy$ = destroy$;
407
407
  this.renderer = renderer;
408
408
  this.texts = texts;
409
+ this.initialX = 0;
410
+ this.wrapperWidth = 0;
409
411
  this.control = null;
410
412
  this.updateOnVariants = ['change', 'blur', 'submit'];
411
413
  this.updateOn = 'change';
@@ -415,8 +417,6 @@
415
417
  this.mode = null;
416
418
  this.change$ = new rxjs.Subject();
417
419
  this.items = ['onLight', 'onDark'];
418
- this.initialX = 0;
419
- this.wrapperWidth = 0;
420
420
  this.isBrowser = common.isPlatformBrowser(platformId);
421
421
  var parsedMode = locationRef.path().match(/tui-mode=(onDark|onLight)/);
422
422
  if (parsedMode !== null && parsedMode.length > 0) {
@@ -433,6 +433,9 @@
433
433
  });
434
434
  }
435
435
  TuiDocDemoComponent_1 = TuiDocDemoComponent;
436
+ TuiDocDemoComponent.prototype.onResize = function () {
437
+ this.setResizerTextContent();
438
+ };
436
439
  TuiDocDemoComponent.prototype.ngOnInit = function () {
437
440
  this.createForm();
438
441
  };
@@ -449,9 +452,6 @@
449
452
  var offsetWidth = this.content.nativeElement.offsetWidth;
450
453
  this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
451
454
  };
452
- TuiDocDemoComponent.prototype.onResize = function () {
453
- this.setResizerTextContent();
454
- };
455
455
  TuiDocDemoComponent.prototype.onDragStart = function (event) {
456
456
  event.preventDefault();
457
457
  this.initialX = event.clientX;
@@ -495,12 +495,6 @@
495
495
  { type: router.UrlSerializer, decorators: [{ type: core.Inject, args: [router.UrlSerializer,] }] },
496
496
  { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
497
497
  ]; };
498
- __decorate([
499
- core.Input()
500
- ], TuiDocDemoComponent.prototype, "control", void 0);
501
- __decorate([
502
- core.ContentChild(core.TemplateRef)
503
- ], TuiDocDemoComponent.prototype, "template", void 0);
504
498
  __decorate([
505
499
  core.ViewChild('content')
506
500
  ], TuiDocDemoComponent.prototype, "content", void 0);
@@ -510,6 +504,12 @@
510
504
  __decorate([
511
505
  core.ViewChild('resizerText')
512
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);
513
513
  __decorate([
514
514
  core.HostListener('window:resize')
515
515
  ], TuiDocDemoComponent.prototype, "onResize", null);
@@ -571,1012 +571,1012 @@
571
571
  return TuiDocDemoModule;
572
572
  }());
573
573
 
574
- var MAP = {
575
- а: 'f',
576
- б: ',',
577
- в: 'd',
578
- г: 'u',
579
- д: 'l',
580
- е: 't',
581
- ё: '`',
582
- ж: ';',
583
- з: 'p',
584
- и: 'b',
585
- й: 'q',
586
- к: 'r',
587
- л: 'k',
588
- м: 'v',
589
- н: 'y',
590
- о: 'j',
591
- п: 'g',
592
- р: 'h',
593
- с: 'c',
594
- т: 'n',
595
- у: 'e',
596
- ф: 'a',
597
- х: '[',
598
- ц: 'w',
599
- ч: 'x',
600
- ш: 'i',
601
- щ: 'o',
602
- ъ: ']',
603
- ы: 's',
604
- ь: 'm',
605
- ю: '.',
606
- я: 'z',
607
- };
608
- /**
609
- * Translates text mistakenly typed in the Russian layout into English
610
- * @param string string with Russian layout characters
611
- * @return string with English layout characters
612
- */
613
- function transliterateKeyboardLayout(string) {
614
- var newStr = '';
615
- for (var i = 0; i < string.length; i++) {
616
- newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
617
- }
618
- 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];
619
593
  }
620
594
 
621
- var TUI_DOC_PAGES = new core.InjectionToken('Documentation pages', {
622
- factory: function () { return []; },
623
- });
624
-
625
- var TUI_DOC_TITLE = new core.InjectionToken('Page title', {
626
- factory: function () { return ''; },
627
- });
628
-
629
- var NAVIGATION_TITLE = new core.InjectionToken('Page title');
630
- var NAVIGATION_LABELS = new core.InjectionToken('Navigation sections labels for search');
631
- var NAVIGATION_ITEMS = new core.InjectionToken('Navigation pages');
632
- var NAVIGATION_PROVIDERS = [
633
- cdk.TuiDestroyService,
634
- {
635
- provide: NAVIGATION_TITLE,
636
- deps: [router.Router, router.ActivatedRoute, TUI_DOC_TITLE, cdk.TuiDestroyService],
637
- useFactory: titleProviderFactory,
638
- },
639
- {
640
- provide: NAVIGATION_LABELS,
641
- deps: [TUI_DOC_PAGES],
642
- useFactory: labelsProviderFactory,
643
- },
644
- {
645
- provide: NAVIGATION_ITEMS,
646
- deps: [TUI_DOC_PAGES],
647
- useFactory: itemsProviderFactory,
648
- },
649
- ];
650
- function titleProviderFactory(router$1, activatedRoute, titlePrefix, destroy$) {
651
- 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) {
652
- var data = _a.data;
653
- return data;
654
- }), operators.map(function (_a) {
655
- var title = _a.title;
656
- return titlePrefix + title;
657
- }), 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 + "]";
658
611
  }
659
- function labelsProviderFactory(pages) {
660
- return pages
661
- .map(function (_a) {
662
- var section = _a.section;
663
- return section;
664
- })
665
- .filter(cdk.isPresent)
666
- .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 + "}";
667
631
  }
668
- function itemsProviderFactory(pages) {
669
- var labels = labelsProviderFactory(pages);
670
- return __spread(labels.map(function (label) { return pages.filter(function (_a) {
671
- var section = _a.section;
672
- return section === label;
673
- }); }), [
674
- pages.filter(function (page) { return !page.section; }),
675
- ]);
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);
676
659
  }
677
660
 
678
- var SCROLL_INTO_VIEW_DELAY = 200;
679
- // @dynamic
680
- var TuiDocNavigationComponent = /** @class */ (function () {
681
- function TuiDocNavigationComponent(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
682
- var _this = this;
683
- this.documentRef = documentRef;
684
- this.mode = mode;
685
- this.sidebar = sidebar;
686
- this.labels = labels;
687
- this.items = items;
688
- this.searchText = searchText;
689
- 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;
690
667
  this.activatedRoute = activatedRoute;
691
- this.search = '';
692
- this.open = false;
693
- this.openPagesArr = [];
694
- this.openPagesGroupsArr = [];
695
- this.active = '';
696
- this.menuOpen = false;
697
- this.mode$ = this.mode.change$.pipe(operators.startWith(null), operators.map(function () { return _this.mode.mode || 'onLight'; }));
698
- // Angular can't navigate no anchor links
699
- // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
700
- title$.subscribe(function (title) {
701
- changeDetectorRef.markForCheck();
702
- titleService.setTitle(title);
703
- _this.openActivePageGroup();
704
- _this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
705
- });
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);
706
678
  }
707
- Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
679
+ TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
680
+ this.parseParams(this.activatedRoute.snapshot.queryParams);
681
+ };
682
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
708
683
  get: function () {
709
- return this.search.length > 2;
710
- },
711
- enumerable: true,
712
- configurable: true
713
- });
714
- Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
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
+ }
694
+ },
695
+ enumerable: true,
696
+ configurable: true
697
+ });
698
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
715
699
  get: function () {
716
- return this.filterItems(this.flattenSubPages(this.items), this.search);
700
+ return !!this.documentationPropertyValues;
717
701
  },
718
702
  enumerable: true,
719
703
  configurable: true
720
704
  });
721
- Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
705
+ Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
722
706
  get: function () {
723
- return this.items[this.items.length - 1];
707
+ return this.documentationPropertyMode !== 'output';
724
708
  },
725
709
  enumerable: true,
726
710
  configurable: true
727
711
  });
728
- TuiDocNavigationComponent.prototype.isActive = function (route) {
729
- return route === this.active;
730
- };
731
- TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
732
- this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
733
- };
734
- TuiDocNavigationComponent.prototype.closeMenu = function () {
735
- this.menuOpen = false;
736
- };
737
- TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
738
- this.search = search;
739
- this.open = this.canOpen;
740
- };
741
- TuiDocNavigationComponent.prototype.onClick = function () {
742
- this.open = false;
743
- this.menuOpen = false;
744
- this.search = '';
745
- this.openActivePageGroup();
746
- };
747
- TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
748
- return items.map(function (section) {
749
- return cdk.uniqBy(section.filter(function (_a) {
750
- var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
751
- title = title.toLowerCase();
752
- search = search.toLowerCase();
753
- keywords = keywords.toLowerCase();
754
- return (title.includes(search) ||
755
- keywords.includes(search) ||
756
- title.includes(transliterateKeyboardLayout(search)) ||
757
- keywords.includes(transliterateKeyboardLayout(search)) ||
758
- search.replace(/-/gi, '').includes(title));
759
- }), 'title');
760
- });
761
- };
762
- TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
763
- return items.reduce(function (array, item) { return __spread(array, [
764
- item.reduce(function (pages, page) {
765
- return 'subPages' in page
766
- ? __spread(pages, page.subPages) : __spread(pages, [page]);
767
- }, []),
768
- ]); }, []);
769
- };
770
- TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
771
- return this.router.isActive(route, false);
712
+ TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnChanges = function () {
713
+ this.changed$.next();
772
714
  };
773
- TuiDocNavigationComponent.prototype.handleAnchorLink = function (hash) {
774
- var _this = this;
775
- setTimeout(function () {
776
- _this.navigateToAnchorLink(hash);
777
- }, SCROLL_INTO_VIEW_DELAY);
715
+ TuiDocDocumentationPropertyConnectorDirective.prototype.onValueChange = function (value) {
716
+ this.documentationPropertyValue = value;
717
+ this.documentationPropertyValueChange.emit(value);
718
+ this.setQueryParam(value);
778
719
  };
779
- TuiDocNavigationComponent.prototype.openActivePageGroup = function () {
780
- var _this = this;
781
- this.items.forEach(function (pages, pagesIndex) {
782
- pages.forEach(function (page, pageIndex) {
783
- if ('route' in page && _this.isActiveRoute(page.route)) {
784
- _this.openPagesArr[pagesIndex] = true;
785
- _this.active = page.route;
786
- }
787
- if ('subPages' in page) {
788
- page.subPages.forEach(function (subPage) {
789
- if (_this.isActiveRoute(subPage.route)) {
790
- _this.openPagesArr[pagesIndex] = true;
791
- _this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
792
- _this.active = subPage.route;
793
- }
794
- });
795
- }
796
- });
797
- });
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);
798
724
  };
799
- TuiDocNavigationComponent.prototype.navigateToAnchorLink = function (fragment) {
800
- var element = fragment && this.documentRef.querySelector("#" + fragment);
801
- if (!element) {
725
+ TuiDocDocumentationPropertyConnectorDirective.prototype.parseParams = function (params) {
726
+ if (!params[this.documentationPropertyName] &&
727
+ !params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
802
728
  return;
803
729
  }
804
- element.classList.add('tui-doc-animated-example');
805
- element.scrollIntoView({
806
- block: 'start',
807
- inline: 'nearest',
808
- behavior: 'smooth',
809
- });
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]);
810
738
  };
811
- TuiDocNavigationComponent.ctorParameters = function () { return [
812
- { type: core.ChangeDetectorRef, decorators: [{ type: core.Inject, args: [core.ChangeDetectorRef,] }] },
813
- { type: platformBrowser.Title, decorators: [{ type: core.Inject, args: [platformBrowser.Title,] }] },
814
- { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [NAVIGATION_TITLE,] }] },
815
- { type: Document, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
816
- { type: core$1.TuiModeDirective, decorators: [{ type: core.Inject, args: [core$1.TuiModeDirective,] }] },
817
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [addonMobile.TuiSidebarDirective,] }] },
818
- { type: Array, decorators: [{ type: core.Inject, args: [NAVIGATION_LABELS,] }] },
819
- { type: undefined, decorators: [{ type: core.Inject, args: [NAVIGATION_ITEMS,] }] },
820
- { type: String, decorators: [{ type: core.Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
821
- { type: router.Router, decorators: [{ type: core.Inject, args: [router.Router,] }] },
822
- { 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,] }] }
823
756
  ]; };
824
757
  __decorate([
825
- core.HostBinding('class._open')
826
- ], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
758
+ core.Input()
759
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyName", void 0);
827
760
  __decorate([
828
- cdk.tuiPure
829
- ], TuiDocNavigationComponent.prototype, "filterItems", null);
761
+ core.Input()
762
+ ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyMode", void 0);
830
763
  __decorate([
831
- cdk.tuiPure
832
- ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
833
- TuiDocNavigationComponent = __decorate([
834
- core.Component({
835
- selector: 'tui-doc-navigation',
836
- 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",
837
- providers: NAVIGATION_PROVIDERS,
838
- changeDetection: core.ChangeDetectionStrategy.OnPush,
839
- 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',
840
782
  }),
841
- __param(0, core.Inject(core.ChangeDetectorRef)),
842
- __param(1, core.Inject(platformBrowser.Title)),
843
- __param(2, core.Inject(NAVIGATION_TITLE)),
844
- __param(3, core.Inject(common.DOCUMENT)),
845
- __param(4, core.Inject(core$1.TuiModeDirective)),
846
- __param(5, core.Optional()),
847
- __param(5, core.Inject(addonMobile.TuiSidebarDirective)),
848
- __param(6, core.Inject(NAVIGATION_LABELS)),
849
- __param(7, core.Inject(NAVIGATION_ITEMS)),
850
- __param(8, core.Inject(TUI_DOC_SEARCH_TEXT)),
851
- __param(9, core.Inject(router.Router)),
852
- __param(10, core.Inject(router.ActivatedRoute))
853
- ], TuiDocNavigationComponent);
854
- 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;
855
789
  }());
856
790
 
857
- var ScrollIntoViewDirective = /** @class */ (function () {
858
- function ScrollIntoViewDirective(destroy$, _a) {
859
- var nativeElement = _a.nativeElement;
860
- this.scroll$ = new rxjs.Subject();
861
- this.scroll$
862
- .pipe(operators.debounceTime(750), operators.filter(function (shallWe) { return shallWe && !!cdk.getElementObscurers(nativeElement); }), operators.takeUntil(destroy$))
863
- .subscribe(function () {
864
- nativeElement.scrollIntoView();
865
- });
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;
866
803
  }
867
- Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
868
- set: function (shallWe) {
869
- 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];
870
815
  },
871
816
  enumerable: true,
872
817
  configurable: true
873
818
  });
874
- ScrollIntoViewDirective.ctorParameters = function () { return [
875
- { type: cdk.TuiDestroyService, decorators: [{ type: core.Inject, args: [cdk.TuiDestroyService,] }] },
876
- { type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] }
877
- ]; };
878
- __decorate([
879
- core.Input()
880
- ], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
881
- ScrollIntoViewDirective = __decorate([
882
- core.Directive({
883
- selector: '[scrollIntoView]',
884
- providers: [cdk.TuiDestroyService],
885
- }),
886
- __param(0, core.Inject(cdk.TuiDestroyService)),
887
- __param(1, core.Inject(core.ElementRef))
888
- ], ScrollIntoViewDirective);
889
- return ScrollIntoViewDirective;
890
- }());
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,] }] }
891
+ ]; };
892
+ __decorate([
893
+ core.Input()
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
+ }());
891
921
 
892
- var ScrollIntoViewModule = /** @class */ (function () {
893
- function ScrollIntoViewModule() {
922
+ var TuiInputOpacityDirective = /** @class */ (function () {
923
+ function TuiInputOpacityDirective(renderer, tuiFocusableComponent) {
924
+ this.renderer = renderer;
925
+ this.tuiFocusableComponent = tuiFocusableComponent;
894
926
  }
895
- ScrollIntoViewModule = __decorate([
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([
945
+ core.Directive({
946
+ selector: '[tuiInputOpacity]',
947
+ }),
948
+ __param(0, core.Inject(core.Renderer2)),
949
+ __param(1, core.Inject(cdk.TUI_FOCUSABLE_ITEM_ACCESSOR))
950
+ ], TuiInputOpacityDirective);
951
+ return TuiInputOpacityDirective;
952
+ }());
953
+
954
+ var TuiInputOpacityModule = /** @class */ (function () {
955
+ function TuiInputOpacityModule() {
956
+ }
957
+ TuiInputOpacityModule = __decorate([
896
958
  core.NgModule({
897
- declarations: [ScrollIntoViewDirective],
898
- exports: [ScrollIntoViewDirective],
959
+ declarations: [TuiInputOpacityDirective],
960
+ exports: [TuiInputOpacityDirective],
899
961
  })
900
- ], ScrollIntoViewModule);
901
- return ScrollIntoViewModule;
962
+ ], TuiInputOpacityModule);
963
+ return TuiInputOpacityModule;
902
964
  }());
903
965
 
904
- var TuiDocNavigationModule = /** @class */ (function () {
905
- function TuiDocNavigationModule() {
966
+ var TuiDocDocumentationModule = /** @class */ (function () {
967
+ function TuiDocDocumentationModule() {
906
968
  }
907
- TuiDocNavigationModule = __decorate([
969
+ TuiDocDocumentationModule = __decorate([
908
970
  core.NgModule({
909
971
  imports: [
910
972
  common.CommonModule,
911
973
  forms.FormsModule,
912
974
  router.RouterModule,
913
- ScrollIntoViewModule,
914
- 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,
915
984
  core$1.TuiPrimitiveTextfieldModule,
916
985
  core$1.TuiTextfieldControllerModule,
917
- cdk.TuiActiveZoneModule,
918
- cdk.TuiLetModule,
919
- core$1.TuiModeModule,
920
- core$1.TuiLinkModule,
921
- core$1.TuiExpandModule,
922
- core$1.TuiHostedDropdownModule,
986
+ core$1.TuiHintControllerModule,
923
987
  core$1.TuiDropdownControllerModule,
924
- kit.TuiAccordionModule,
925
- core$1.TuiScrollbarModule,
926
- core$1.TuiSvgModule,
927
988
  core$1.TuiDataListModule,
928
- cdk.TuiAutoFocusModule,
989
+ kit.TuiDataListWrapperModule,
990
+ core$1.TuiNotificationModule,
991
+ ],
992
+ declarations: [
993
+ TuiDocDocumentationComponent,
994
+ TuiDocDocumentationPropertyConnectorDirective,
995
+ ],
996
+ exports: [
997
+ TuiDocDocumentationComponent,
998
+ TuiDocDocumentationPropertyConnectorDirective,
929
999
  ],
930
- declarations: [TuiDocNavigationComponent],
931
- exports: [TuiDocNavigationComponent],
932
1000
  })
933
- ], TuiDocNavigationModule);
934
- return TuiDocNavigationModule;
1001
+ ], TuiDocDocumentationModule);
1002
+ return TuiDocDocumentationModule;
935
1003
  }());
936
1004
 
937
- function rgbToHex(r, g, b) {
938
- return ('#' +
939
- [r, g, b]
940
- .map(function (x) {
941
- var hex = x.toString(16);
942
- return hex.length === 1 ? '0' + hex : hex;
943
- })
944
- .join(''));
945
- }
946
- function hexToRgb(hex) {
947
- var matches = hex
948
- .replace('#', '')
949
- .split('')
950
- .map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
951
- .join('')
952
- .match(/.{2}/g);
953
- return matches
954
- ? matches.map(function (x) { return Number.parseInt(x, 16); })
955
- : [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
+ });
956
1049
  }
957
1050
 
958
- function inspectArray(array, depth) {
959
- if (depth === 0) {
960
- return '[…]';
961
- }
962
- var result = '';
963
- var first = true;
964
- for (var index = 0; index < array.length; index++) {
965
- if (first) {
966
- first = false;
967
- }
968
- else {
969
- result += ', ';
970
- }
971
- result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
972
- }
973
- return "[" + result + "]";
974
- }
975
- function inspectObject(object, depth) {
976
- if (depth === 0) {
977
- return "{\u2026}";
978
- }
979
- var result = '';
980
- var first = true;
981
- for (var key in object) {
982
- if (!object.hasOwnProperty(key)) {
983
- continue;
984
- }
985
- if (first) {
986
- first = false;
987
- }
988
- else {
989
- result += ', ';
990
- }
991
- result += key + ": " + inspectAny(object[key], depth - 1);
992
- }
993
- return "{" + result + "}";
994
- }
995
- // @bad TODO add more types
996
- /**
997
- * Returns readable JS entity
998
- * @param data
999
- * @param depth
1000
- * @return readable JS entity
1001
- */
1002
- function inspectAny(data, depth) {
1003
- if (data === null) {
1004
- return 'null';
1005
- }
1006
- switch (typeof data) {
1007
- case 'string':
1008
- return "'" + data + "'";
1009
- case 'undefined':
1010
- case 'number':
1011
- case 'boolean':
1012
- case 'function':
1013
- return String(data);
1014
- }
1015
- if (data instanceof RegExp) {
1016
- return data.toString();
1017
- }
1018
- if (Array.isArray(data)) {
1019
- return inspectArray(data, depth);
1020
- }
1021
- return inspectObject(data, depth);
1022
- }
1023
-
1024
- var SERIALIZED_SUFFIX = '$';
1025
- // @bad TODO: refactor output and value sync
1026
- var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
1027
- function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
1028
- this.template = template;
1029
- this.locationRef = locationRef;
1030
- this.activatedRoute = activatedRoute;
1031
- this.urlSerializer = urlSerializer;
1032
- this.documentationPropertyName = '';
1033
- this.documentationPropertyMode = null;
1034
- this.documentationPropertyType = '';
1035
- this.documentationPropertyValue = null;
1036
- this.documentationPropertyDeprecated = false;
1037
- this.documentationPropertyValues = null;
1038
- this.documentationPropertyValueChange = new core.EventEmitter();
1039
- this.changed$ = new rxjs.Subject();
1040
- this.emits$ = new rxjs.BehaviorSubject(1);
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));
1041
1074
  }
1042
- TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
1043
- this.parseParams(this.activatedRoute.snapshot.queryParams);
1044
- };
1045
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
1046
- get: function () {
1047
- switch (this.documentationPropertyMode) {
1048
- case 'input':
1049
- return "[" + this.documentationPropertyName + "]";
1050
- case 'output':
1051
- return "(" + this.documentationPropertyName + ")";
1052
- case 'input-output':
1053
- return "[(" + this.documentationPropertyName + ")]";
1054
- default:
1055
- return this.documentationPropertyName;
1056
- }
1057
- },
1058
- enumerable: true,
1059
- configurable: true
1060
- });
1061
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
1062
- get: function () {
1063
- return !!this.documentationPropertyValues;
1064
- },
1065
- enumerable: true,
1066
- configurable: true
1067
- });
1068
- Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
1069
- get: function () {
1070
- return this.documentationPropertyMode !== 'output';
1075
+ Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
1076
+ set: function (content) {
1077
+ this.rawLoader$$.next(content);
1071
1078
  },
1072
1079
  enumerable: true,
1073
1080
  configurable: true
1074
1081
  });
1075
- TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnChanges = function () {
1076
- this.changed$.next();
1077
- };
1078
- TuiDocDocumentationPropertyConnectorDirective.prototype.onValueChange = function (value) {
1079
- this.documentationPropertyValue = value;
1080
- this.documentationPropertyValueChange.emit(value);
1081
- this.setQueryParam(value);
1082
- };
1083
- TuiDocDocumentationPropertyConnectorDirective.prototype.parseParams = function (params) {
1084
- if (!params[this.documentationPropertyName] &&
1085
- !params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
1086
- return;
1087
- }
1088
- var isValueAvailableByKey = !!params[this.documentationPropertyName + SERIALIZED_SUFFIX];
1089
- if (isValueAvailableByKey && this.documentationPropertyValues) {
1090
- this.onValueChange(this.documentationPropertyValues[params[this.documentationPropertyName + SERIALIZED_SUFFIX]]);
1091
- return;
1092
- }
1093
- this.onValueChange(!isNaN(Number(params[this.documentationPropertyName]))
1094
- ? Number(params[this.documentationPropertyName])
1095
- : params[this.documentationPropertyName]);
1096
- };
1097
- TuiDocDocumentationPropertyConnectorDirective.prototype.setQueryParam = function (value) {
1098
- var _a;
1099
- var tree = this.urlSerializer.parse(this.locationRef.path());
1100
- var isValueAvailableByKey = value instanceof Object;
1101
- var computedValue = isValueAvailableByKey && this.documentationPropertyValues
1102
- ? this.documentationPropertyValues.indexOf(value)
1103
- : value;
1104
- var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
1105
- var propName = this.documentationPropertyName + suffix;
1106
- tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
1107
- this.locationRef.go(String(tree));
1108
- };
1109
- TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
1110
- // For more convenient debugging
1111
- console.log(this.attrName, event);
1112
- 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();
1113
1095
  };
1114
- TuiDocDocumentationPropertyConnectorDirective.ctorParameters = function () { return [
1115
- { type: core.TemplateRef, decorators: [{ type: core.Inject, args: [core.TemplateRef,] }] },
1116
- { type: common.Location, decorators: [{ type: core.Inject, args: [common.Location,] }] },
1117
- { type: router.ActivatedRoute, decorators: [{ type: core.Inject, args: [router.ActivatedRoute,] }] },
1118
- { 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,] }] }
1119
1105
  ]; };
1120
1106
  __decorate([
1121
1107
  core.Input()
1122
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyName", void 0);
1123
- __decorate([
1124
- core.Input()
1125
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyMode", void 0);
1126
- __decorate([
1127
- core.Input()
1128
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyType", void 0);
1108
+ ], TuiDocExampleComponent.prototype, "heading", void 0);
1129
1109
  __decorate([
1130
1110
  core.Input()
1131
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValue", void 0);
1111
+ ], TuiDocExampleComponent.prototype, "description", void 0);
1132
1112
  __decorate([
1133
1113
  core.Input()
1134
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyDeprecated", void 0);
1114
+ ], TuiDocExampleComponent.prototype, "content", null);
1135
1115
  __decorate([
1136
1116
  core.Input()
1137
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValues", void 0);
1138
- __decorate([
1139
- core.Output()
1140
- ], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
1141
- TuiDocDocumentationPropertyConnectorDirective = __decorate([
1142
- core.Directive({
1143
- selector: 'ng-template[documentationPropertyName]',
1144
- 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}"]
1145
1124
  }),
1146
- __param(0, core.Inject(core.TemplateRef)),
1147
- __param(1, core.Inject(common.Location)),
1148
- __param(2, core.Inject(router.ActivatedRoute)),
1149
- __param(3, core.Inject(router.UrlSerializer))
1150
- ], TuiDocDocumentationPropertyConnectorDirective);
1151
- 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;
1152
1136
  }());
1153
1137
 
1154
- // @bad TODO subscribe propertiesConnectors changes
1155
- // @bad TODO refactor to make more flexible
1156
- // @dynamic
1157
- var TuiDocDocumentationComponent = /** @class */ (function () {
1158
- function TuiDocDocumentationComponent(changeDetectorRef, texts) {
1159
- this.changeDetectorRef = changeDetectorRef;
1160
- this.texts = texts;
1161
- this.heading = '';
1162
- this.showValues = true;
1163
- this.isAPI = false;
1164
- this.propertiesConnectors = cdk.EMPTY_QUERY;
1165
- this.activeItemIndex = 0;
1138
+ var TuiDocExampleGetTabsPipe = /** @class */ (function () {
1139
+ function TuiDocExampleGetTabsPipe() {
1166
1140
  }
1167
- TuiDocDocumentationComponent.prototype.ngAfterContentInit = function () {
1168
- cdk.itemsQueryListObservable(this.propertiesConnectors)
1169
- .pipe(operators.switchMap(function (items) { return rxjs.merge.apply(void 0, __spread(items.map(function (_a) {
1170
- var changed$ = _a.changed$;
1171
- return changed$;
1172
- }))); }), cdk.watch(this.changeDetectorRef))
1173
- .subscribe();
1141
+ TuiDocExampleGetTabsPipe.prototype.transform = function (content, defaultTab) {
1142
+ return __spread([defaultTab], Object.keys(content));
1174
1143
  };
1175
- 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", {
1176
1183
  get: function () {
1177
- return this.isAPI ? this.texts[0] : this.texts[1];
1184
+ return this.night ? 'onDark' : null;
1178
1185
  },
1179
1186
  enumerable: true,
1180
1187
  configurable: true
1181
1188
  });
1182
- TuiDocDocumentationComponent.prototype.getColor = function (color) {
1183
- if (color.length === 4) {
1184
- return color
1185
- .split('')
1186
- .reduce(function (result, current) { return __spread(result, [current, current]); }, [])
1187
- .join('')
1188
- .replace('#', '');
1189
- }
1190
- if (color.startsWith('#')) {
1191
- return color;
1192
- }
1193
- if (color === 'transparent') {
1194
- return '#000000';
1195
- }
1196
- var parsed = color
1197
- .replace('rgb(', '')
1198
- .replace('rgba(', '')
1199
- .replace(')', '')
1200
- .replace(' ', '')
1201
- .split(',')
1202
- .map(function (v) { return Number.parseInt(v, 10); });
1203
- return rgbToHex.apply(void 0, __spread(parsed));
1204
- };
1205
- TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
1206
- if (color.startsWith('#') || color.startsWith('rgb(')) {
1207
- return 100;
1208
- }
1209
- if (color === 'transparent') {
1210
- return 0;
1211
- }
1212
- var lastComma = color.lastIndexOf(',');
1213
- var parsed = color
1214
- .substr(lastComma)
1215
- .replace(')', '')
1216
- .replace(' ', '')
1217
- .replace(',', '');
1218
- return Math.round(Number.parseFloat(parsed) * 100);
1219
- };
1220
- TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
1221
- var opacity = this.getOpacity(connector.documentationPropertyValue || '');
1222
- if (opacity === 100) {
1223
- connector.onValueChange(color);
1224
- return;
1225
- }
1226
- var rgb = hexToRgb(color).join(', ');
1227
- var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
1228
- connector.onValueChange(result);
1229
- };
1230
- TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
1231
- var hex = this.getColor(connector.documentationPropertyValue || '');
1232
- var rgb = hexToRgb(hex);
1233
- var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
1234
- connector.onValueChange(result);
1235
- };
1236
- TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
1237
- return name.replace('?', '');
1238
- };
1239
- TuiDocDocumentationComponent.prototype.isOptional = function (name) {
1240
- return name.includes('?');
1241
- };
1242
- TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
1243
- return type.includes('null');
1244
- };
1245
- TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
1246
- return type.includes('PolymorpheusContent');
1247
- };
1248
- TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
1249
- 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));
1250
1193
  };
1251
- TuiDocDocumentationComponent.ctorParameters = function () { return [
1252
- { type: core.ChangeDetectorRef, decorators: [{ type: core.Inject, args: [core.ChangeDetectorRef,] }] },
1253
- { 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,] }] }
1254
1198
  ]; };
1255
- __decorate([
1256
- core.Input()
1257
- ], TuiDocDocumentationComponent.prototype, "heading", void 0);
1258
- __decorate([
1259
- core.Input()
1260
- ], TuiDocDocumentationComponent.prototype, "showValues", void 0);
1261
- __decorate([
1262
- core.Input()
1263
- ], TuiDocDocumentationComponent.prototype, "isAPI", void 0);
1264
- __decorate([
1265
- core.ContentChildren(TuiDocDocumentationPropertyConnectorDirective)
1266
- ], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
1267
- TuiDocDocumentationComponent = __decorate([
1199
+ TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
1268
1200
  core.Component({
1269
- selector: 'tui-doc-documentation',
1270
- template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"\n tui-table__th tui-table__th_last tui-table__th_text_right\n t-cell t-cell_value\n \"\n >\n {{ texts[3] }}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"\n tui-table__td tui-table__td_first tui-table__td_align_center\n t-cell\n \"\n >\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property t-cell\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"\n tui-table__td\n tui-table__td_align_center\n tui-table__td_last\n tui-table__td_text_right\n t-cell\n \"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
1271
- changeDetection: core.ChangeDetectionStrategy.OnPush,
1272
- animations: [
1273
- animations.trigger('emitEvent', [
1274
- animations.transition(':increment', [animations.style({ opacity: 1 }), animations.animate('500ms ease-in')]),
1275
- ]),
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,
1276
1210
  ],
1277
- 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}"]
1278
1212
  }),
1279
- __param(0, core.Inject(core.ChangeDetectorRef)),
1280
- __param(1, core.Inject(TUI_DOC_DOCUMENTATION_TEXTS))
1281
- ], TuiDocDocumentationComponent);
1282
- return TuiDocDocumentationComponent;
1213
+ __param(0, core.Inject(common$1.LOCAL_STORAGE)),
1214
+ __param(1, core.Inject(common$1.WINDOW))
1215
+ ], TuiDocMainComponent);
1216
+ return TuiDocMainComponent;
1283
1217
  }());
1284
1218
 
1285
- var TuiInputOpacityDirective = /** @class */ (function () {
1286
- function TuiInputOpacityDirective(renderer, tuiFocusableComponent) {
1287
- this.renderer = renderer;
1288
- 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
+ });
1289
1228
  }
1290
- Object.defineProperty(TuiInputOpacityDirective.prototype, "tuiInputOpacity", {
1291
- set: function (opacity) {
1292
- var nativeFocusableElement = this.tuiFocusableComponent.nativeFocusableElement;
1293
- if (nativeFocusableElement) {
1294
- this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
1295
- }
1229
+ Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
1230
+ set: function (shallWe) {
1231
+ this.scroll$.next(shallWe);
1296
1232
  },
1297
1233
  enumerable: true,
1298
1234
  configurable: true
1299
1235
  });
1300
- TuiInputOpacityDirective.ctorParameters = function () { return [
1301
- { type: core.Renderer2, decorators: [{ type: core.Inject, args: [core.Renderer2,] }] },
1302
- { type: undefined, decorators: [{ type: core.Inject, args: [cdk.TUI_FOCUSABLE_ITEM_ACCESSOR,] }] }
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,] }] }
1303
1239
  ]; };
1304
1240
  __decorate([
1305
1241
  core.Input()
1306
- ], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
1307
- TuiInputOpacityDirective = __decorate([
1242
+ ], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
1243
+ ScrollIntoViewDirective = __decorate([
1308
1244
  core.Directive({
1309
- selector: '[tuiInputOpacity]',
1245
+ selector: '[scrollIntoView]',
1246
+ providers: [cdk.TuiDestroyService],
1310
1247
  }),
1311
- __param(0, core.Inject(core.Renderer2)),
1312
- __param(1, core.Inject(cdk.TUI_FOCUSABLE_ITEM_ACCESSOR))
1313
- ], TuiInputOpacityDirective);
1314
- return TuiInputOpacityDirective;
1248
+ __param(0, core.Inject(cdk.TuiDestroyService)),
1249
+ __param(1, core.Inject(core.ElementRef))
1250
+ ], ScrollIntoViewDirective);
1251
+ return ScrollIntoViewDirective;
1315
1252
  }());
1316
1253
 
1317
- var TuiInputOpacityModule = /** @class */ (function () {
1318
- function TuiInputOpacityModule() {
1254
+ var ScrollIntoViewModule = /** @class */ (function () {
1255
+ function ScrollIntoViewModule() {
1319
1256
  }
1320
- TuiInputOpacityModule = __decorate([
1257
+ ScrollIntoViewModule = __decorate([
1321
1258
  core.NgModule({
1322
- declarations: [TuiInputOpacityDirective],
1323
- exports: [TuiInputOpacityDirective],
1259
+ declarations: [ScrollIntoViewDirective],
1260
+ exports: [ScrollIntoViewDirective],
1324
1261
  })
1325
- ], TuiInputOpacityModule);
1326
- return TuiInputOpacityModule;
1262
+ ], ScrollIntoViewModule);
1263
+ return ScrollIntoViewModule;
1327
1264
  }());
1328
1265
 
1329
- var TuiDocDocumentationModule = /** @class */ (function () {
1330
- function TuiDocDocumentationModule() {
1331
- }
1332
- TuiDocDocumentationModule = __decorate([
1333
- core.NgModule({
1334
- imports: [
1335
- common.CommonModule,
1336
- forms.FormsModule,
1337
- router.RouterModule,
1338
- kit.TuiBadgeModule,
1339
- kit.TuiSelectModule,
1340
- kit.TuiToggleModule,
1341
- core$1.TuiTooltipModule,
1342
- core$1.TuiLinkModule,
1343
- kit.TuiInputCountModule,
1344
- core$1.TuiModeModule,
1345
- core$1.TuiGroupModule,
1346
- TuiInputOpacityModule,
1347
- core$1.TuiPrimitiveTextfieldModule,
1348
- core$1.TuiTextfieldControllerModule,
1349
- core$1.TuiHintControllerModule,
1350
- core$1.TuiDropdownControllerModule,
1351
- core$1.TuiDataListModule,
1352
- kit.TuiDataListWrapperModule,
1353
- core$1.TuiNotificationModule,
1354
- ],
1355
- declarations: [
1356
- TuiDocDocumentationComponent,
1357
- TuiDocDocumentationPropertyConnectorDirective,
1358
- ],
1359
- exports: [
1360
- TuiDocDocumentationComponent,
1361
- TuiDocDocumentationPropertyConnectorDirective,
1362
- ],
1363
- })
1364
- ], TuiDocDocumentationModule);
1365
- return TuiDocDocumentationModule;
1366
- }());
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
+ }
1367
1312
 
1368
- var TUI_DOC_CODE_EDITOR = new core.InjectionToken('Contains service for opening online IDE e.g. Stackblitz');
1313
+ var TUI_DOC_PAGES = new core.InjectionToken('Documentation pages', {
1314
+ factory: function () { return []; },
1315
+ });
1369
1316
 
1370
- var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new core.InjectionToken('Processes content in example', { factory: function () { return cdk.identity; } });
1317
+ var TUI_DOC_TITLE = new core.InjectionToken('Page title', {
1318
+ factory: function () { return ''; },
1319
+ });
1371
1320
 
1372
- function rawLoadRecord(example) {
1373
- return __awaiter(this, void 0, void 0, function () {
1374
- var processedContent, _a, _b, _c, key, content, _d, _e, e_1_1;
1375
- var e_1, _f;
1376
- return __generator(this, function (_g) {
1377
- switch (_g.label) {
1378
- case 0:
1379
- processedContent = {};
1380
- _g.label = 1;
1381
- case 1:
1382
- _g.trys.push([1, 6, 7, 8]);
1383
- _a = __values(Object.entries(example)), _b = _a.next();
1384
- _g.label = 2;
1385
- case 2:
1386
- if (!!_b.done) return [3 /*break*/, 5];
1387
- _c = __read(_b.value, 2), key = _c[0], content = _c[1];
1388
- _d = processedContent;
1389
- _e = key;
1390
- return [4 /*yield*/, rawLoad(content)];
1391
- case 3:
1392
- _d[_e] = _g.sent();
1393
- _g.label = 4;
1394
- case 4:
1395
- _b = _a.next();
1396
- return [3 /*break*/, 2];
1397
- case 5: return [3 /*break*/, 8];
1398
- case 6:
1399
- e_1_1 = _g.sent();
1400
- e_1 = { error: e_1_1 };
1401
- return [3 /*break*/, 8];
1402
- case 7:
1403
- try {
1404
- if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
1405
- }
1406
- finally { if (e_1) throw e_1.error; }
1407
- return [7 /*endfinally*/];
1408
- case 8: return [2 /*return*/, processedContent];
1409
- }
1410
- });
1411
- });
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
+ ]);
1412
1368
  }
1413
1369
 
1414
- // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1370
+ var SCROLL_INTO_VIEW_DELAY = 200;
1415
1371
  // @dynamic
1416
- var TuiDocExampleComponent = /** @class */ (function () {
1417
- function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent) {
1418
- this.id = id;
1419
- this.clipboard = clipboard;
1420
- this.notifications = notifications;
1421
- this.location = location;
1422
- this.copyTexts$ = copyTexts$;
1423
- this.texts = texts;
1424
- this.codeEditor = codeEditor;
1425
- this.processContent = processContent;
1426
- this.rawLoader$$ = new rxjs.BehaviorSubject({});
1427
- this.heading = '';
1428
- this.description = '';
1429
- this.componentName = this.location.pathname.slice(1);
1430
- this.activeItemIndex = 0;
1431
- this.defaultTab = this.texts[0];
1432
- this.copy$ = this.copyTexts$.pipe(operators.map(function (_a) {
1433
- var _b = __read(_a, 1), copy = _b[0];
1434
- return copy;
1435
- }));
1436
- this.processor$ = this.rawLoader$$.pipe(operators.switchMap(rawLoadRecord), operators.map(this.processContent));
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
+ });
1437
1398
  }
1438
- Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
1439
- set: function (content) {
1440
- this.rawLoader$$.next(content);
1399
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
1400
+ get: function () {
1401
+ return this.search.length > 2;
1441
1402
  },
1442
1403
  enumerable: true,
1443
1404
  configurable: true
1444
1405
  });
1445
- TuiDocExampleComponent.prototype.copyExampleLink = function () {
1446
- var hashPosition = this.location.href.indexOf('#');
1447
- var currentUrl = hashPosition > -1
1448
- ? this.location.href.substr(0, hashPosition)
1449
- : this.location.href;
1450
- var url = currentUrl + "#" + this.id;
1451
- this.clipboard.copy(url);
1452
- this.notifications
1453
- .show(this.texts[1], {
1454
- label: this.texts[2],
1455
- status: "success" /* Success */,
1456
- })
1457
- .subscribe();
1406
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
1407
+ get: function () {
1408
+ return this.filterItems(this.flattenSubPages(this.items), this.search);
1409
+ },
1410
+ enumerable: true,
1411
+ configurable: true
1412
+ });
1413
+ Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
1414
+ get: function () {
1415
+ return this.items[this.items.length - 1];
1416
+ },
1417
+ enumerable: true,
1418
+ configurable: true
1419
+ });
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
+ });
1458
1490
  };
1459
- TuiDocExampleComponent.ctorParameters = function () { return [
1460
- { type: String, decorators: [{ type: core.Attribute, args: ['id',] }] },
1461
- { type: clipboard.Clipboard, decorators: [{ type: core.Inject, args: [clipboard.Clipboard,] }] },
1462
- { type: core$1.TuiNotificationsService, decorators: [{ type: core.Inject, args: [core$1.TuiNotificationsService,] }] },
1463
- { type: Location, decorators: [{ type: core.Inject, args: [common$1.LOCATION,] }] },
1464
- { type: rxjs.Observable, decorators: [{ type: core.Inject, args: [kit.TUI_COPY_TEXTS,] }] },
1465
- { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
1466
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
1467
- { type: undefined, decorators: [{ type: core.Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] }
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
+ });
1502
+ };
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,] }] }
1468
1515
  ]; };
1469
1516
  __decorate([
1470
- core.Input()
1471
- ], TuiDocExampleComponent.prototype, "heading", void 0);
1472
- __decorate([
1473
- core.Input()
1474
- ], TuiDocExampleComponent.prototype, "description", void 0);
1517
+ core.HostBinding('class._open')
1518
+ ], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
1475
1519
  __decorate([
1476
- core.Input()
1477
- ], TuiDocExampleComponent.prototype, "content", null);
1520
+ cdk.tuiPure
1521
+ ], TuiDocNavigationComponent.prototype, "filterItems", null);
1478
1522
  __decorate([
1479
- core.Input()
1480
- ], TuiDocExampleComponent.prototype, "componentName", void 0);
1481
- TuiDocExampleComponent = __decorate([
1523
+ cdk.tuiPure
1524
+ ], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
1525
+ TuiDocNavigationComponent = __decorate([
1482
1526
  core.Component({
1483
- selector: 'tui-doc-example',
1484
- 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",
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,
1485
1530
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1486
- 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)}"]
1487
1532
  }),
1488
- __param(0, core.Attribute('id')),
1489
- __param(1, core.Inject(clipboard.Clipboard)),
1490
- __param(2, core.Inject(core$1.TuiNotificationsService)),
1491
- __param(3, core.Inject(common$1.LOCATION)),
1492
- __param(4, core.Inject(kit.TUI_COPY_TEXTS)),
1493
- __param(5, core.Inject(TUI_DOC_EXAMPLE_TEXTS)),
1494
- __param(6, core.Optional()),
1495
- __param(6, core.Inject(TUI_DOC_CODE_EDITOR)),
1496
- __param(7, core.Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR))
1497
- ], TuiDocExampleComponent);
1498
- return TuiDocExampleComponent;
1499
- }());
1500
-
1501
- var TuiDocExampleGetTabsPipe = /** @class */ (function () {
1502
- function TuiDocExampleGetTabsPipe() {
1503
- }
1504
- TuiDocExampleGetTabsPipe.prototype.transform = function (content, defaultTab) {
1505
- return __spread([defaultTab], Object.keys(content));
1506
- };
1507
- TuiDocExampleGetTabsPipe = __decorate([
1508
- core.Pipe({ name: 'tuiDocExampleGetTabs' })
1509
- ], TuiDocExampleGetTabsPipe);
1510
- return TuiDocExampleGetTabsPipe;
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;
1511
1547
  }());
1512
1548
 
1513
- var TuiDocExampleModule = /** @class */ (function () {
1514
- function TuiDocExampleModule() {
1549
+ var TuiDocNavigationModule = /** @class */ (function () {
1550
+ function TuiDocNavigationModule() {
1515
1551
  }
1516
- TuiDocExampleModule = __decorate([
1552
+ TuiDocNavigationModule = __decorate([
1517
1553
  core.NgModule({
1518
1554
  imports: [
1519
1555
  common.CommonModule,
1520
- clipboard.ClipboardModule,
1521
- kit.TuiTabsModule,
1556
+ forms.FormsModule,
1557
+ router.RouterModule,
1558
+ ScrollIntoViewModule,
1522
1559
  core$1.TuiButtonModule,
1523
- TuiDocCopyModule,
1524
- TuiDocCodeModule,
1525
- 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,
1526
1574
  ],
1527
- declarations: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
1528
- exports: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
1575
+ declarations: [TuiDocNavigationComponent],
1576
+ exports: [TuiDocNavigationComponent],
1529
1577
  })
1530
- ], TuiDocExampleModule);
1531
- return TuiDocExampleModule;
1532
- }());
1533
-
1534
- // @dynamic
1535
- var TuiDocMainComponent = /** @class */ (function () {
1536
- function TuiDocMainComponent(storage, windowRef) {
1537
- this.storage = storage;
1538
- this.windowRef = windowRef;
1539
- this.night = this.storage.getItem('night') === 'true' ||
1540
- (this.storage.getItem('night') === null &&
1541
- this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
1542
- this.change$ = new rxjs.Subject();
1543
- }
1544
- TuiDocMainComponent_1 = TuiDocMainComponent;
1545
- Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
1546
- get: function () {
1547
- return this.night ? 'onDark' : null;
1548
- },
1549
- enumerable: true,
1550
- configurable: true
1551
- });
1552
- TuiDocMainComponent.prototype.onMode = function (night) {
1553
- this.night = night;
1554
- this.change$.next();
1555
- this.storage.setItem('night', String(night));
1556
- };
1557
- var TuiDocMainComponent_1;
1558
- TuiDocMainComponent.ctorParameters = function () { return [
1559
- { type: Storage, decorators: [{ type: core.Inject, args: [common$1.LOCAL_STORAGE,] }] },
1560
- { type: Window, decorators: [{ type: core.Inject, args: [common$1.WINDOW,] }] }
1561
- ]; };
1562
- TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
1563
- core.Component({
1564
- selector: 'tui-doc-main',
1565
- 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",
1566
- encapsulation: core.ViewEncapsulation.None,
1567
- providers: [
1568
- {
1569
- provide: core$1.TuiModeDirective,
1570
- useExisting: core.forwardRef(function () { return TuiDocMainComponent_1; }),
1571
- },
1572
- cdk.TuiSwipeService,
1573
- ],
1574
- 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}"]
1575
- }),
1576
- __param(0, core.Inject(common$1.LOCAL_STORAGE)),
1577
- __param(1, core.Inject(common$1.WINDOW))
1578
- ], TuiDocMainComponent);
1579
- return TuiDocMainComponent;
1578
+ ], TuiDocNavigationModule);
1579
+ return TuiDocNavigationModule;
1580
1580
  }());
1581
1581
 
1582
1582
  var TUI_DOC_LOGO = new core.InjectionToken('Main logo', {
@@ -1669,26 +1669,6 @@
1669
1669
  factory: function () { return []; },
1670
1670
  });
1671
1671
 
1672
- var TuiDocPageTabConnectorDirective = /** @class */ (function () {
1673
- function TuiDocPageTabConnectorDirective(template) {
1674
- this.template = template;
1675
- }
1676
- TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
1677
- { type: core.TemplateRef, decorators: [{ type: core.Inject, args: [core.TemplateRef,] }] }
1678
- ]; };
1679
- __decorate([
1680
- core.Input(),
1681
- cdk.tuiDefaultProp()
1682
- ], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
1683
- TuiDocPageTabConnectorDirective = __decorate([
1684
- core.Directive({
1685
- selector: '[pageTab]',
1686
- }),
1687
- __param(0, core.Inject(core.TemplateRef))
1688
- ], TuiDocPageTabConnectorDirective);
1689
- return TuiDocPageTabConnectorDirective;
1690
- }());
1691
-
1692
1672
  var TUI_DOC_SEE_ALSO = new core.InjectionToken('Array of arrays of related pages', {
1693
1673
  factory: function () { return []; },
1694
1674
  });
@@ -1711,6 +1691,26 @@
1711
1691
  return Array.from(seeAlsoSet);
1712
1692
  }
1713
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
+
1714
1714
  // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1715
1715
  // @dynamic
1716
1716
  var TuiDocPageComponent = /** @class */ (function () {
@@ -1722,8 +1722,8 @@
1722
1722
  this.package = '';
1723
1723
  this.type = '';
1724
1724
  this.path = '';
1725
- this.activeItemIndex = NaN;
1726
1725
  this.tabConnectors = cdk.EMPTY_QUERY;
1726
+ this.activeItemIndex = NaN;
1727
1727
  }
1728
1728
  Object.defineProperty(TuiDocPageComponent.prototype, "showSeeAlso", {
1729
1729
  get: function () {
@@ -1956,6 +1956,23 @@
1956
1956
  },
1957
1957
  ];
1958
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
+
1959
1976
  /**
1960
1977
  * Generates typical page routing structure
1961
1978
  */
@@ -1974,23 +1991,6 @@
1974
1991
  ];
1975
1992
  }
1976
1993
 
1977
- var TuiAddonDocModule = /** @class */ (function () {
1978
- function TuiAddonDocModule() {
1979
- }
1980
- TuiAddonDocModule = __decorate([
1981
- core.NgModule({
1982
- exports: [
1983
- TuiDocCodeModule,
1984
- TuiDocDemoModule,
1985
- TuiDocDocumentationModule,
1986
- TuiDocPageModule,
1987
- TuiDocExampleModule,
1988
- ],
1989
- })
1990
- ], TuiAddonDocModule);
1991
- return TuiAddonDocModule;
1992
- }());
1993
-
1994
1994
  exports.DEMO_TEXTS = DEMO_TEXTS;
1995
1995
  exports.DOC_TEXTS = DOC_TEXTS;
1996
1996
  exports.EXAMPLE_TEXTS = EXAMPLE_TEXTS;
@@ -2032,17 +2032,17 @@
2032
2032
  exports.TuiDocPageModule = TuiDocPageModule;
2033
2033
  exports.TuiDocPageTabConnectorDirective = TuiDocPageTabConnectorDirective;
2034
2034
  exports.generateRoutes = generateRoutes;
2035
- exports.ɵa = NAVIGATION_TITLE;
2036
- exports.ɵb = NAVIGATION_LABELS;
2037
- exports.ɵc = NAVIGATION_ITEMS;
2038
- exports.ɵd = NAVIGATION_PROVIDERS;
2039
- exports.ɵe = titleProviderFactory;
2040
- exports.ɵf = labelsProviderFactory;
2041
- exports.ɵg = itemsProviderFactory;
2042
- exports.ɵh = TuiInputOpacityModule;
2043
- exports.ɵi = TuiInputOpacityDirective;
2044
- exports.ɵj = TuiDocExampleGetTabsPipe;
2045
- exports.ɵk = TuiDocHeaderModule;
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
2046
  exports.ɵl = TuiDocHeaderComponent;
2047
2047
  exports.ɵm = PAGE_SEE_ALSO;
2048
2048
  exports.ɵn = PAGE_PROVIDERS;