@taiga-ui/addon-doc 3.21.0 → 3.22.0-dev.main-a08b721

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.
@@ -583,14 +583,19 @@
583
583
  factory: function () { return "Source code"; },
584
584
  });
585
585
 
586
+ var TUI_DOC_URL_STATE_HANDLER = new i0.InjectionToken("[TUI_DOC_URL_STATE_HANDLER]", {
587
+ factory: function () { return String; },
588
+ });
589
+
586
590
  var MIN_WIDTH = 160;
587
591
  var TuiDocDemoComponent = /** @class */ (function () {
588
- function TuiDocDemoComponent(isMobile, elementRef, locationRef, urlSerializer, texts) {
592
+ function TuiDocDemoComponent(isMobile, elementRef, locationRef, urlSerializer, texts, urlStateHandler) {
589
593
  this.isMobile = isMobile;
590
594
  this.elementRef = elementRef;
591
595
  this.locationRef = locationRef;
592
596
  this.urlSerializer = urlSerializer;
593
597
  this.texts = texts;
598
+ this.urlStateHandler = urlStateHandler;
594
599
  this.control = null;
595
600
  this.template = null;
596
601
  this.updateOnVariants = ['change', 'blur', 'submit'];
@@ -649,14 +654,14 @@
649
654
  configurable: true
650
655
  });
651
656
  TuiDocDemoComponent.prototype.updateUrl = function (tuiMode, sandboxWidth) {
652
- var urlTree = this.getUrlTree();
653
- var queryParams = urlTree.queryParams;
657
+ var tree = this.getUrlTree();
658
+ var queryParams = tree.queryParams;
654
659
  var modeParam = tuiMode ? { tuiMode: tuiMode } : {};
655
660
  var resizeParam = !Number.isNaN(sandboxWidth) ? { sandboxWidth: sandboxWidth } : {};
656
661
  delete queryParams.sandboxWidth;
657
662
  delete queryParams.tuiMode;
658
- urlTree.queryParams = Object.assign(Object.assign(Object.assign({}, queryParams), modeParam), resizeParam);
659
- this.locationRef.replaceState(String(urlTree));
663
+ tree.queryParams = Object.assign(Object.assign(Object.assign({}, queryParams), modeParam), resizeParam);
664
+ this.locationRef.go(this.urlStateHandler(tree));
660
665
  };
661
666
  TuiDocDemoComponent.prototype.createForm = function () {
662
667
  var _a = this, control = _a.control, updateOn = _a.updateOn;
@@ -669,7 +674,7 @@
669
674
  };
670
675
  return TuiDocDemoComponent;
671
676
  }());
672
- TuiDocDemoComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocDemoComponent, deps: [{ token: i6.TUI_IS_MOBILE }, { token: i0.ElementRef }, { token: i4.Location }, { token: i6$1.UrlSerializer }, { token: TUI_DOC_DEMO_TEXTS }], target: i0__namespace.ɵɵFactoryTarget.Component });
677
+ TuiDocDemoComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocDemoComponent, deps: [{ token: i6.TUI_IS_MOBILE }, { token: i0.ElementRef }, { token: i4.Location }, { token: i6$1.UrlSerializer }, { token: TUI_DOC_DEMO_TEXTS }, { token: TUI_DOC_URL_STATE_HANDLER }], target: i0__namespace.ɵɵFactoryTarget.Component });
673
678
  TuiDocDemoComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocDemoComponent, selector: "tui-doc-demo", inputs: { control: "control" }, host: { listeners: { "window:resize": "onResize()", "document:mouseup.silent": "onMouseUp()" } }, providers: [
674
679
  i6.TuiDestroyService,
675
680
  {
@@ -711,6 +716,9 @@
711
716
  }] }, { type: undefined, decorators: [{
712
717
  type: i0.Inject,
713
718
  args: [TUI_DOC_DEMO_TEXTS]
719
+ }] }, { type: undefined, decorators: [{
720
+ type: i0.Inject,
721
+ args: [TUI_DOC_URL_STATE_HANDLER]
714
722
  }] }];
715
723
  }, propDecorators: { resizeable: [{
716
724
  type: i0.ViewChild,
@@ -857,11 +865,12 @@
857
865
  var SERIALIZED_SUFFIX = '$';
858
866
  // @bad TODO: refactor output and value sync
859
867
  var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
860
- function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
868
+ function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer, urlStateHandler) {
861
869
  this.template = template;
862
870
  this.locationRef = locationRef;
863
871
  this.activatedRoute = activatedRoute;
864
872
  this.urlSerializer = urlSerializer;
873
+ this.urlStateHandler = urlStateHandler;
865
874
  this.documentationPropertyName = '';
866
875
  this.documentationPropertyMode = null;
867
876
  this.documentationPropertyType = '';
@@ -941,11 +950,11 @@
941
950
  var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
942
951
  var propName = this.documentationPropertyName + suffix;
943
952
  tree.queryParams = Object.assign(Object.assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
944
- this.locationRef.go(String(tree));
953
+ this.locationRef.go(this.urlStateHandler(tree));
945
954
  };
946
955
  return TuiDocDocumentationPropertyConnectorDirective;
947
956
  }());
948
- TuiDocDocumentationPropertyConnectorDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocDocumentationPropertyConnectorDirective, deps: [{ token: i0.TemplateRef }, { token: i4.Location }, { token: i6$1.ActivatedRoute }, { token: i6$1.UrlSerializer }], target: i0__namespace.ɵɵFactoryTarget.Directive });
957
+ TuiDocDocumentationPropertyConnectorDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocDocumentationPropertyConnectorDirective, deps: [{ token: i0.TemplateRef }, { token: i4.Location }, { token: i6$1.ActivatedRoute }, { token: i6$1.UrlSerializer }, { token: TUI_DOC_URL_STATE_HANDLER }], target: i0__namespace.ɵɵFactoryTarget.Directive });
949
958
  TuiDocDocumentationPropertyConnectorDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocDocumentationPropertyConnectorDirective, selector: "ng-template[documentationPropertyName]", inputs: { documentationPropertyName: "documentationPropertyName", documentationPropertyMode: "documentationPropertyMode", documentationPropertyType: "documentationPropertyType", documentationPropertyValue: "documentationPropertyValue", documentationPropertyDeprecated: "documentationPropertyDeprecated", documentationPropertyValues: "documentationPropertyValues" }, outputs: { documentationPropertyValueChange: "documentationPropertyValueChange" }, exportAs: ["documentationProperty"], usesOnChanges: true, ngImport: i0__namespace });
950
959
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocDocumentationPropertyConnectorDirective, decorators: [{
951
960
  type: i0.Directive,
@@ -966,6 +975,9 @@
966
975
  }] }, { type: i6__namespace.UrlSerializer, decorators: [{
967
976
  type: i0.Inject,
968
977
  args: [i6$1.UrlSerializer]
978
+ }] }, { type: undefined, decorators: [{
979
+ type: i0.Inject,
980
+ args: [TUI_DOC_URL_STATE_HANDLER]
969
981
  }] }];
970
982
  }, propDecorators: { documentationPropertyName: [{
971
983
  type: i0.Input
@@ -1650,7 +1662,7 @@
1650
1662
  return TuiDocExampleComponent;
1651
1663
  }());
1652
1664
  TuiDocExampleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocExampleComponent, deps: [{ token: i8.Clipboard }, { token: i2$1.TuiAlertService }, { token: common.LOCATION }, { token: i1.TUI_COPY_TEXTS }, { token: TUI_DOC_EXAMPLE_TEXTS }, { token: TUI_DOC_CODE_EDITOR, optional: true }, { token: TUI_DOC_EXAMPLE_CONTENT_PROCESSOR }, { token: i6.TUI_IS_CYPRESS }, { token: TUI_DOC_CODE_ACTIONS }, { token: i6$1.Router }, { token: i6$1.ActivatedRoute }, { token: i4.Location }, { token: TUI_DOC_EXAMPLE_OPTIONS }], target: i0__namespace.ɵɵFactoryTarget.Component });
1653
- TuiDocExampleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocExampleComponent, selector: "tui-doc-example", inputs: { id: "id", heading: "heading", description: "description", content: "content", componentName: "componentName" }, ngImport: i0__namespace, template: "<h3\n *ngIf=\"heading\"\n class=\"t-title\"\n>\n <span\n *polymorpheusOutlet=\"heading | tuiDocExampleCapitalize as text\"\n [textContent]=\"text\"\n ></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n class=\"t-description\"\n>\n <ng-container *polymorpheusOutlet=\"description | tuiDocExampleCapitalize as text\">\n {{ text }}\n </ng-container>\n</h4>\n\n<div\n *ngIf=\"processor$ | async as files\"\n class=\"t-example\"\n>\n <ng-container *ngIf=\"files | tuiDocExampleGetTabs : defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button\n *tuiItem\n tuiTab\n >\n {{ tab }}\n </button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"files | tuiMapper : visible\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n type=\"button\"\n [showLoader]=\"!!(loading$ | async)\"\n (click)=\"edit(files)\"\n >\n Edit on {{ codeEditor!.name }}\n </button>\n </div>\n\n <div\n *ngFor=\"let tab of tabs; let index = index\"\n class=\"t-content\"\n [class.t-content_animated]=\"!isCypress\"\n [class.t-content_visible]=\"activeItemIndex === index\"\n >\n <ng-container\n *ngIf=\"index === defaultTabIndex; else anotherTab\"\n [ngTemplateOutlet]=\"preview\"\n ></ng-container>\n <ng-template #anotherTab>\n <ng-container\n [ngTemplateOutlet]=\"codeSection\"\n [ngTemplateOutletContext]=\"{$implicit: files[tabs[activeItemIndex]] || ''}\"\n ></ng-container>\n </ng-template>\n </div>\n </ng-container>\n</div>\n\n<ng-template #preview>\n <div\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n</ng-template>\n\n<ng-template\n #codeSection\n let-code\n>\n <section class=\"t-code-actions\">\n <ng-container *ngFor=\"let action of codeActions\">\n <ng-container *polymorpheusOutlet=\"action as text; context: {$implicit: code}\">\n {{ text }}\n </ng-container>\n </ng-container>\n <tui-doc-copy [cdkCopyToClipboard]=\"code\"></tui-doc-copy>\n </section>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n</ng-template>\n", styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}:host :host-context(tui-root._mobile){padding-top:2rem}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}:host-context(tui-root._mobile) .t-title{font:var(--tui-font-heading-6)}.t-description{font:var(--tui-font-text-m);font-weight:normal;margin:0}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}:host-context(tui-root._mobile) .t-example{margin-top:.75rem}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}:host-context(tui-root._mobile) .t-tabs-wrapper{padding:0 1rem}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host-context(tui-root._mobile) .t-demo{padding:1rem}.t-code-actions{position:absolute;top:4.375rem;right:1rem;display:flex;justify-content:flex-end;align-items:center}.t-code-actions>*{margin-left:.5rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}.t-content{will-change:opacity;height:0;visibility:hidden;opacity:0}.t-content_animated{transition:opacity .3s ease-in-out}.t-content_visible{height:auto;visibility:visible;opacity:1}\n"], components: [{ type: i2__namespace$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i1__namespace.TuiTabsWithMoreComponent, selector: "tui-tabs-with-more, nav[tuiTabsWithMore]", inputs: ["moreContent", "dropdownContent", "underline", "activeItemIndex", "itemsLimit"], outputs: ["activeItemIndexChange"] }, { type: i1__namespace.TuiTabComponent, selector: "a[tuiTab]:not([routerLink]), a[tuiTab][routerLink][routerLinkActive], button[tuiTab]" }, { type: TuiDocCopyComponent, selector: "tui-doc-copy" }, { type: TuiDocCodeComponent, selector: "tui-doc-code", inputs: ["filename", "code"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace$2.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace$1.TuiItemDirective, selector: "[tuiItem]" }, { type: i4__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i8__namespace.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }], pipes: { "tuiDocExampleCapitalize": TuiDocExampleCapitalizePipe, "async": i4__namespace.AsyncPipe, "tuiDocExampleGetTabs": TuiDocExampleGetTabsPipe, "tuiMapper": i6__namespace$1.TuiMapperPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1665
+ TuiDocExampleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocExampleComponent, selector: "tui-doc-example", inputs: { id: "id", heading: "heading", description: "description", content: "content", componentName: "componentName" }, ngImport: i0__namespace, template: "<h3\n *ngIf=\"heading\"\n class=\"t-title\"\n>\n <span\n *polymorpheusOutlet=\"heading | tuiDocExampleCapitalize as text\"\n [textContent]=\"text\"\n ></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n class=\"t-description\"\n>\n <ng-container *polymorpheusOutlet=\"description | tuiDocExampleCapitalize as text\">\n {{ text }}\n </ng-container>\n</h4>\n\n<div\n *ngIf=\"processor$ | async as files\"\n class=\"t-example\"\n>\n <ng-container *ngIf=\"files | tuiDocExampleGetTabs : defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button\n *tuiItem\n tuiTab\n >\n {{ tab }}\n </button>\n </ng-container>\n </tui-tabs-with-more>\n\n <tui-loader\n *ngIf=\"files | tuiMapper : visible\"\n size=\"xs\"\n [overlay]=\"true\"\n [showLoader]=\"!!(loading$ | async)\"\n (click)=\"edit(files)\"\n >\n <ng-container *ngIf=\"codeEditor?.content as content; else defaultEditContent\">\n <ng-container *polymorpheusOutlet=\"content as editContent\">\n {{ editContent }}\n </ng-container>\n </ng-container>\n\n <ng-template #defaultEditContent>\n <button\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n type=\"button\"\n >\n Edit on {{ codeEditor!.name }}\n </button>\n </ng-template>\n </tui-loader>\n </div>\n\n <div\n *ngFor=\"let tab of tabs; let index = index\"\n class=\"t-content\"\n [class.t-content_animated]=\"!isCypress\"\n [class.t-content_visible]=\"activeItemIndex === index\"\n >\n <ng-container\n *ngIf=\"index === defaultTabIndex; else anotherTab\"\n [ngTemplateOutlet]=\"preview\"\n ></ng-container>\n <ng-template #anotherTab>\n <ng-container\n [ngTemplateOutlet]=\"codeSection\"\n [ngTemplateOutletContext]=\"{$implicit: files[tabs[activeItemIndex]] || ''}\"\n ></ng-container>\n </ng-template>\n </div>\n </ng-container>\n</div>\n\n<ng-template #preview>\n <div\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n</ng-template>\n\n<ng-template\n #codeSection\n let-code\n>\n <section class=\"t-code-actions\">\n <ng-container *ngFor=\"let action of codeActions\">\n <ng-container *polymorpheusOutlet=\"action as text; context: {$implicit: code}\">\n {{ text }}\n </ng-container>\n </ng-container>\n <tui-doc-copy [cdkCopyToClipboard]=\"code\"></tui-doc-copy>\n </section>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n</ng-template>\n", styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}:host :host-context(tui-root._mobile){padding-top:2rem}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}:host-context(tui-root._mobile) .t-title{font:var(--tui-font-heading-6)}.t-description{font:var(--tui-font-text-m);font-weight:normal;margin:0}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}:host-context(tui-root._mobile) .t-example{margin-top:.75rem}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}:host-context(tui-root._mobile) .t-tabs-wrapper{padding:0 1rem}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host-context(tui-root._mobile) .t-demo{padding:1rem}.t-code-actions{position:absolute;top:4.375rem;right:1rem;display:flex;justify-content:flex-end;align-items:center}.t-code-actions>*{margin-left:.5rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}.t-content{will-change:opacity;height:0;visibility:hidden;opacity:0}.t-content_animated{transition:opacity .3s ease-in-out}.t-content_visible{height:auto;visibility:visible;opacity:1}\n"], components: [{ type: i2__namespace$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { type: i1__namespace.TuiTabsWithMoreComponent, selector: "tui-tabs-with-more, nav[tuiTabsWithMore]", inputs: ["moreContent", "dropdownContent", "underline", "activeItemIndex", "itemsLimit"], outputs: ["activeItemIndexChange"] }, { type: i1__namespace.TuiTabComponent, selector: "a[tuiTab]:not([routerLink]), a[tuiTab][routerLink][routerLinkActive], button[tuiTab]" }, { type: i2__namespace$1.TuiLoaderComponent, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { type: TuiDocCopyComponent, selector: "tui-doc-copy" }, { type: TuiDocCodeComponent, selector: "tui-doc-code", inputs: ["filename", "code"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace$2.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace$1.TuiItemDirective, selector: "[tuiItem]" }, { type: i4__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i8__namespace.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }], pipes: { "tuiDocExampleCapitalize": TuiDocExampleCapitalizePipe, "async": i4__namespace.AsyncPipe, "tuiDocExampleGetTabs": TuiDocExampleGetTabsPipe, "tuiMapper": i6__namespace$1.TuiMapperPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1654
1666
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocExampleComponent, decorators: [{
1655
1667
  type: i0.Component,
1656
1668
  args: [{
@@ -1729,7 +1741,8 @@
1729
1741
  TuiDocCopyModule,
1730
1742
  TuiDocCodeModule,
1731
1743
  i6$2.PolymorpheusModule,
1732
- i6.TuiMapperPipeModule], exports: [TuiDocExampleComponent,
1744
+ i6.TuiMapperPipeModule,
1745
+ i2$1.TuiLoaderModule], exports: [TuiDocExampleComponent,
1733
1746
  TuiDocExampleGetTabsPipe,
1734
1747
  TuiDocExampleCapitalizePipe] });
1735
1748
  TuiDocExampleModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocExampleModule, imports: [[
@@ -1741,6 +1754,7 @@
1741
1754
  TuiDocCodeModule,
1742
1755
  i6$2.PolymorpheusModule,
1743
1756
  i6.TuiMapperPipeModule,
1757
+ i2$1.TuiLoaderModule,
1744
1758
  ]] });
1745
1759
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocExampleModule, decorators: [{
1746
1760
  type: i0.NgModule,
@@ -1754,6 +1768,7 @@
1754
1768
  TuiDocCodeModule,
1755
1769
  i6$2.PolymorpheusModule,
1756
1770
  i6.TuiMapperPipeModule,
1771
+ i2$1.TuiLoaderModule,
1757
1772
  ],
1758
1773
  declarations: [
1759
1774
  TuiDocExampleComponent,
@@ -1916,12 +1931,62 @@
1916
1931
  return newStr;
1917
1932
  }
1918
1933
 
1934
+ function tuiToFlatMapPages(pages) {
1935
+ var e_1, _b, e_2, _c;
1936
+ var map = new Map();
1937
+ try {
1938
+ for (var pages_1 = __values(pages), pages_1_1 = pages_1.next(); !pages_1_1.done; pages_1_1 = pages_1.next()) {
1939
+ var page = pages_1_1.value;
1940
+ if ("subPages" in page) {
1941
+ try {
1942
+ for (var _d = (e_2 = void 0, __values(page.subPages)), _e = _d.next(); !_e.done; _e = _d.next()) {
1943
+ var subPage = _e.value;
1944
+ tuiPageCheckUniqueTitle(subPage, map);
1945
+ map.set(subPage.title, subPage);
1946
+ }
1947
+ }
1948
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1949
+ finally {
1950
+ try {
1951
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
1952
+ }
1953
+ finally { if (e_2) throw e_2.error; }
1954
+ }
1955
+ }
1956
+ else {
1957
+ tuiPageCheckUniqueTitle(page, map);
1958
+ map.set(page.title, page);
1959
+ }
1960
+ }
1961
+ }
1962
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1963
+ finally {
1964
+ try {
1965
+ if (pages_1_1 && !pages_1_1.done && (_b = pages_1.return)) _b.call(pages_1);
1966
+ }
1967
+ finally { if (e_1) throw e_1.error; }
1968
+ }
1969
+ return map;
1970
+ }
1971
+ function tuiPageCheckUniqueTitle(page, map) {
1972
+ var _a;
1973
+ if (map.has(page.title) && ((_a = map.get(page.title)) === null || _a === void 0 ? void 0 : _a.route) !== page.route) {
1974
+ console.error("Title for page should be unique for prevent inconsistent page names", page, "<== Collisions between ==>", map.get(page.title));
1975
+ }
1976
+ }
1977
+
1919
1978
  /**
1920
1979
  * Documentation pages
1921
1980
  */
1922
1981
  var TUI_DOC_PAGES = new i0.InjectionToken("[TUI_DOC_PAGES]", {
1923
1982
  factory: function () { return []; },
1924
1983
  });
1984
+ var TUI_DOC_MAP_PAGES = new i0.InjectionToken("[TUI_DOC_MAP_PAGES]", {
1985
+ factory: function () {
1986
+ var pages = i0.inject(TUI_DOC_PAGES);
1987
+ return tuiToFlatMapPages(pages);
1988
+ },
1989
+ });
1925
1990
 
1926
1991
  /**
1927
1992
  * Page title prefix
@@ -1953,7 +2018,7 @@
1953
2018
  return data;
1954
2019
  }), operators.map(function (_a) {
1955
2020
  var title = _a.title;
1956
- return titlePrefix + title;
2021
+ return "" + titlePrefix + title;
1957
2022
  }), operators.takeUntil(destroy$));
1958
2023
  },
1959
2024
  },
@@ -2652,20 +2717,12 @@
2652
2717
  this.seeAlso = [];
2653
2718
  }
2654
2719
  TuiDocSeeAlsoComponent.prototype.getRouterLink = function (pageTitle) {
2655
- for (var i = 0; i < this.pages.length; i++) {
2656
- var page = this.pages
2657
- .map(function (page) { return ('subPages' in page ? page.subPages : [page]); })
2658
- .reduce(function (pages, subPages) { return __spreadArray(__spreadArray([], __read(pages)), __read(subPages)); }, [])
2659
- .find(function (page) { return page.title === pageTitle; });
2660
- if (page === null || page === void 0 ? void 0 : page.route) {
2661
- return page.route;
2662
- }
2663
- }
2664
- return '';
2720
+ var _a, _b;
2721
+ return (_b = (_a = this.pages.get(pageTitle)) === null || _a === void 0 ? void 0 : _a.route) !== null && _b !== void 0 ? _b : '';
2665
2722
  };
2666
2723
  return TuiDocSeeAlsoComponent;
2667
2724
  }());
2668
- TuiDocSeeAlsoComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocSeeAlsoComponent, deps: [{ token: TUI_DOC_SEE_ALSO_TEXT }, { token: TUI_DOC_PAGES }], target: i0__namespace.ɵɵFactoryTarget.Component });
2725
+ TuiDocSeeAlsoComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocSeeAlsoComponent, deps: [{ token: TUI_DOC_SEE_ALSO_TEXT }, { token: TUI_DOC_MAP_PAGES }], target: i0__namespace.ɵɵFactoryTarget.Component });
2669
2726
  TuiDocSeeAlsoComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDocSeeAlsoComponent, selector: "tui-doc-see-also", inputs: { seeAlso: "seeAlso" }, ngImport: i0__namespace, template: "<h5 class=\"t-header\">{{ text }}</h5>\n<ng-container *ngFor=\"let item of seeAlso; last as last\">\n <a\n tuiLink\n [routerLink]=\"getRouterLink(item)\"\n [innerText]=\"item\"\n ></a>\n <ng-container *ngIf=\"!last\">{{ ', ' }}</ng-container>\n</ng-container>\n", styles: [":host{display:block}.t-header{font-size:.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:.075em;color:var(--tui-text-02);margin:0 0 .5rem;white-space:nowrap}\n"], components: [{ type: i2__namespace$1.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }], directives: [{ type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2670
2727
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocSeeAlsoComponent, decorators: [{
2671
2728
  type: i0.Component,
@@ -2679,9 +2736,9 @@
2679
2736
  return [{ type: undefined, decorators: [{
2680
2737
  type: i0.Inject,
2681
2738
  args: [TUI_DOC_SEE_ALSO_TEXT]
2682
- }] }, { type: undefined, decorators: [{
2739
+ }] }, { type: Map, decorators: [{
2683
2740
  type: i0.Inject,
2684
- args: [TUI_DOC_PAGES]
2741
+ args: [TUI_DOC_MAP_PAGES]
2685
2742
  }] }];
2686
2743
  }, propDecorators: { seeAlso: [{
2687
2744
  type: i0.Input
@@ -2917,6 +2974,7 @@
2917
2974
  exports.TUI_DOC_EXAMPLE_TEXTS = TUI_DOC_EXAMPLE_TEXTS;
2918
2975
  exports.TUI_DOC_EXCLUDED_PROPERTIES = TUI_DOC_EXCLUDED_PROPERTIES;
2919
2976
  exports.TUI_DOC_LOGO = TUI_DOC_LOGO;
2977
+ exports.TUI_DOC_MAP_PAGES = TUI_DOC_MAP_PAGES;
2920
2978
  exports.TUI_DOC_MENU_TEXT = TUI_DOC_MENU_TEXT;
2921
2979
  exports.TUI_DOC_PAGES = TUI_DOC_PAGES;
2922
2980
  exports.TUI_DOC_PAGE_LOADED = TUI_DOC_PAGE_LOADED;
@@ -2928,6 +2986,7 @@
2928
2986
  exports.TUI_DOC_SOURCE_CODE = TUI_DOC_SOURCE_CODE;
2929
2987
  exports.TUI_DOC_SOURCE_CODE_TEXT = TUI_DOC_SOURCE_CODE_TEXT;
2930
2988
  exports.TUI_DOC_TITLE = TUI_DOC_TITLE;
2989
+ exports.TUI_DOC_URL_STATE_HANDLER = TUI_DOC_URL_STATE_HANDLER;
2931
2990
  exports.TUI_EXAMPLE_PRIMARY_FILE_NAME = TUI_EXAMPLE_PRIMARY_FILE_NAME;
2932
2991
  exports.TuiAddonDocModule = TuiAddonDocModule;
2933
2992
  exports.TuiDocCodeComponent = TuiDocCodeComponent;