@taiga-ui/addon-doc 2.61.0 → 3.0.0-rc.2
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.
- package/README.md +2 -2
- package/addon-doc.module.d.ts +9 -0
- package/bundles/taiga-ui-addon-doc.umd.js +1679 -1355
- package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
- package/components/code/code.component.d.ts +3 -0
- package/components/code/code.module.d.ts +7 -0
- package/components/code/parse-code-block.d.ts +1 -5
- package/components/copy/copy.component.d.ts +3 -0
- package/components/copy/copy.module.d.ts +7 -0
- package/components/demo/demo.component.d.ts +3 -0
- package/components/demo/demo.module.d.ts +11 -0
- package/components/documentation/documentation-property-connector.directive.d.ts +3 -0
- package/components/documentation/documentation.component.d.ts +3 -0
- package/components/documentation/documentation.module.d.ts +12 -0
- package/components/example/example-capitalize.pipe.d.ts +3 -0
- package/components/example/example-get-tabs.pipe.d.ts +3 -0
- package/components/example/example.component.d.ts +8 -5
- package/components/example/example.module.d.ts +14 -0
- package/components/language-switcher/language-switcher.component.d.ts +3 -0
- package/components/language-switcher/language-switcher.module.d.ts +9 -0
- package/components/main/main.component.d.ts +3 -0
- package/components/main/main.module.d.ts +12 -0
- package/components/navigation/navigation.component.d.ts +8 -5
- package/components/navigation/navigation.module.d.ts +13 -0
- package/components/navigation/navigation.providers.d.ts +0 -4
- package/components/page/page-tab.directive.d.ts +3 -0
- package/components/page/page.component.d.ts +3 -0
- package/components/page/page.module.d.ts +11 -0
- package/components/page/page.providers.d.ts +1 -2
- package/directives/scroll-into-view/scroll-into-view.directive.d.ts +5 -8
- package/directives/scroll-into-view/scroll-into-view.module.d.ts +5 -6
- package/esm2015/addon-doc.module.js +27 -16
- package/esm2015/components/code/code.component.js +26 -24
- package/esm2015/components/code/code.module.js +15 -12
- package/esm2015/components/code/parse-code-block.js +2 -7
- package/esm2015/components/copy/copy.component.js +24 -20
- package/esm2015/components/copy/copy.module.js +15 -12
- package/esm2015/components/demo/demo.component.js +75 -59
- package/esm2015/components/demo/demo.module.js +54 -13
- package/esm2015/components/documentation/documentation-property-connector.directive.js +45 -46
- package/esm2015/components/documentation/documentation.component.js +54 -48
- package/esm2015/components/documentation/documentation.module.js +64 -21
- package/esm2015/components/example/example-capitalize.pipe.js +13 -10
- package/esm2015/components/example/example-get-tabs.pipe.js +10 -8
- package/esm2015/components/example/example.component.js +86 -66
- package/esm2015/components/example/example.module.js +42 -21
- package/esm2015/components/language-switcher/language-switcher.component.js +27 -20
- package/esm2015/components/language-switcher/language-switcher.module.js +15 -12
- package/esm2015/components/main/main.component.js +44 -31
- package/esm2015/components/main/main.module.js +36 -13
- package/esm2015/components/navigation/navigation.component.js +86 -69
- package/esm2015/components/navigation/navigation.module.js +65 -21
- package/esm2015/components/navigation/navigation.providers.js +14 -19
- package/esm2015/components/page/page-tab.directive.js +18 -15
- package/esm2015/components/page/page.component.js +42 -39
- package/esm2015/components/page/page.module.js +28 -13
- package/esm2015/components/page/page.providers.js +10 -12
- package/esm2015/directives/scroll-into-view/scroll-into-view.directive.js +30 -43
- package/esm2015/directives/scroll-into-view/scroll-into-view.module.js +15 -28
- package/esm2015/interfaces/code-editor.js +2 -1
- package/esm2015/interfaces/page.js +1 -1
- package/esm2015/interfaces/source-code-path-options.js +2 -1
- package/esm2015/internal/header/header.component.js +34 -23
- package/esm2015/internal/header/header.module.js +28 -13
- package/esm2015/internal/input-opacity/input-opacity.directive.js +20 -19
- package/esm2015/internal/input-opacity/input-opacity.module.js +14 -11
- package/esm2015/internal/see-also/see-also.component.js +26 -23
- package/esm2015/internal/see-also/see-also.module.js +15 -12
- package/esm2015/internal/source-code/source-code.component.js +31 -30
- package/esm2015/internal/source-code/source-code.module.js +15 -12
- package/esm2015/languages/russian.js +10 -14
- package/esm2015/public-api.js +8 -1
- package/esm2015/taiga-ui-addon-doc.js +1 -13
- package/esm2015/tokens/code-actions.js +1 -1
- package/esm2015/tokens/code-editor.js +1 -1
- package/esm2015/tokens/default-tabs.js +1 -1
- package/esm2015/tokens/example-content-processor.js +1 -1
- package/esm2015/tokens/i18n.js +1 -1
- package/esm2015/tokens/logo.js +1 -1
- package/esm2015/tokens/page-loaded.js +1 -1
- package/esm2015/tokens/pages.js +1 -1
- package/esm2015/tokens/scroll-behavior.js +1 -1
- package/esm2015/tokens/see-also.js +1 -1
- package/esm2015/tokens/source-code.js +2 -2
- package/esm2015/tokens/title.js +1 -1
- package/esm2015/types/pages.js +2 -1
- package/esm2015/utils/coerce-value.js +2 -7
- package/esm2015/utils/generate-routes.js +2 -8
- package/esm2015/utils/inspect.js +4 -7
- package/esm2015/utils/raw-load-record.js +4 -9
- package/esm2015/utils/raw-load.js +14 -8
- package/esm2015/utils/transliterate-keyboard-layout.js +2 -5
- package/fesm2015/taiga-ui-addon-doc.js +1134 -904
- package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
- package/interfaces/code-editor.d.ts +0 -10
- package/internal/header/header.component.d.ts +3 -0
- package/internal/header/header.module.d.ts +11 -0
- package/internal/input-opacity/input-opacity.directive.d.ts +3 -0
- package/internal/input-opacity/input-opacity.module.d.ts +5 -0
- package/internal/see-also/see-also.component.d.ts +3 -0
- package/internal/see-also/see-also.module.d.ts +8 -0
- package/internal/source-code/source-code.component.d.ts +3 -0
- package/internal/source-code/source-code.module.d.ts +8 -0
- package/languages/russian.d.ts +0 -3
- package/package.json +11 -14
- package/public-api.d.ts +2 -0
- package/taiga-ui-addon-doc.d.ts +1 -12
- package/tokens/logo.d.ts +1 -1
- package/utils/coerce-value.d.ts +1 -5
- package/utils/generate-routes.d.ts +1 -6
- package/utils/inspect.d.ts +1 -3
- package/utils/raw-load-record.d.ts +1 -5
- package/utils/raw-load.d.ts +1 -5
- package/utils/transliterate-keyboard-layout.d.ts +1 -3
- package/bundles/taiga-ui-addon-doc.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-doc.umd.min.js.map +0 -1
- package/esm2015/utils/color-conversion.js +0 -27
- package/esm5/addon-doc.module.js +0 -25
- package/esm5/components/code/code.component.js +0 -46
- package/esm5/components/code/code.module.js +0 -19
- package/esm5/components/code/parse-code-block.js +0 -21
- package/esm5/components/copy/copy.component.js +0 -43
- package/esm5/components/copy/copy.module.js +0 -19
- package/esm5/components/demo/demo.component.js +0 -153
- package/esm5/components/demo/demo.module.js +0 -43
- package/esm5/components/documentation/documentation-property-connector.directive.js +0 -133
- package/esm5/components/documentation/documentation.component.js +0 -145
- package/esm5/components/documentation/documentation.module.js +0 -50
- package/esm5/components/example/example-capitalize.pipe.js +0 -16
- package/esm5/components/example/example-get-tabs.pipe.js +0 -15
- package/esm5/components/example/example.component.js +0 -135
- package/esm5/components/example/example.module.js +0 -42
- package/esm5/components/language-switcher/language-switcher.component.js +0 -49
- package/esm5/components/language-switcher/language-switcher.module.js +0 -21
- package/esm5/components/main/main.component.js +0 -58
- package/esm5/components/main/main.module.js +0 -35
- package/esm5/components/navigation/navigation.component.js +0 -203
- package/esm5/components/navigation/navigation.module.js +0 -45
- package/esm5/components/navigation/navigation.providers.js +0 -59
- package/esm5/components/page/page-tab.directive.js +0 -24
- package/esm5/components/page/page.component.js +0 -67
- package/esm5/components/page/page.module.js +0 -30
- package/esm5/components/page/page.providers.js +0 -22
- package/esm5/directives/scroll-into-view/scroll-into-view.directive.js +0 -65
- package/esm5/directives/scroll-into-view/scroll-into-view.module.js +0 -34
- package/esm5/interfaces/code-editor.js +0 -1
- package/esm5/interfaces/page.js +0 -6
- package/esm5/interfaces/source-code-path-options.js +0 -1
- package/esm5/internal/header/header.component.js +0 -47
- package/esm5/internal/header/header.module.js +0 -30
- package/esm5/internal/input-opacity/input-opacity.directive.js +0 -36
- package/esm5/internal/input-opacity/input-opacity.module.js +0 -16
- package/esm5/internal/see-also/see-also.component.js +0 -44
- package/esm5/internal/see-also/see-also.module.js +0 -20
- package/esm5/internal/source-code/source-code.component.js +0 -61
- package/esm5/internal/source-code/source-code.module.js +0 -20
- package/esm5/languages/russian.js +0 -42
- package/esm5/public-api.js +0 -51
- package/esm5/taiga-ui-addon-doc.js +0 -17
- package/esm5/tokens/code-actions.js +0 -5
- package/esm5/tokens/code-editor.js +0 -3
- package/esm5/tokens/default-tabs.js +0 -5
- package/esm5/tokens/example-content-processor.js +0 -4
- package/esm5/tokens/i18n.js +0 -54
- package/esm5/tokens/logo.js +0 -5
- package/esm5/tokens/page-loaded.js +0 -5
- package/esm5/tokens/pages.js +0 -5
- package/esm5/tokens/scroll-behavior.js +0 -3
- package/esm5/tokens/see-also.js +0 -5
- package/esm5/tokens/source-code.js +0 -5
- package/esm5/tokens/title.js +0 -5
- package/esm5/types/pages.js +0 -1
- package/esm5/utils/coerce-value.js +0 -44
- package/esm5/utils/color-conversion.js +0 -27
- package/esm5/utils/generate-routes.js +0 -21
- package/esm5/utils/inspect.js +0 -68
- package/esm5/utils/raw-load-record.js +0 -50
- package/esm5/utils/raw-load.js +0 -26
- package/esm5/utils/transliterate-keyboard-layout.js +0 -50
- package/fesm5/taiga-ui-addon-doc.js +0 -2064
- package/fesm5/taiga-ui-addon-doc.js.map +0 -1
- package/taiga-ui-addon-doc.metadata.json +0 -1
- package/utils/color-conversion.d.ts +0 -12
|
@@ -1,2064 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __generator, __decorate, __param, __assign, __spread, __read, __values, __extends } from 'tslib';
|
|
2
|
-
import { Input, HostBinding, Component, NgModule, Inject, ChangeDetectionStrategy, InjectionToken, Renderer2, PLATFORM_ID, ViewChild, ContentChild, TemplateRef, HostListener, forwardRef, EventEmitter, Output, Directive, ChangeDetectorRef, ContentChildren, Attribute, Optional, Pipe, ViewEncapsulation, ElementRef } from '@angular/core';
|
|
3
|
-
import { BehaviorSubject, Subject, timer, Observable, merge, identity, defer, of, ReplaySubject } from 'rxjs';
|
|
4
|
-
import { switchMap, map, switchMapTo, mapTo, startWith, takeUntil, filter, debounceTime, mergeMap, take, distinctUntilChanged } from 'rxjs/operators';
|
|
5
|
-
import MarkdownIt from 'markdown-it';
|
|
6
|
-
import { CommonModule, isPlatformBrowser, Location as Location$1, DOCUMENT } from '@angular/common';
|
|
7
|
-
import { HighlightModule } from 'ngx-highlightjs';
|
|
8
|
-
import { tuiPure, TuiDestroyService, px, TUI_IS_MOBILE, TuiDragModule, EMPTY_QUERY, itemsQueryListObservable, watch, TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_CYPRESS, TuiSwipeService, getElementObscurers, isPresent, uniqBy, TuiActiveZoneModule, TuiLetModule, TuiAutoFocusModule, tuiDefaultProp } from '@taiga-ui/cdk';
|
|
9
|
-
import { TUI_COPY_TEXTS, TuiSelectModule, TuiRadioBlockModule, TuiCheckboxLabeledModule, TuiDataListWrapperModule, TuiBadgeModule, TuiToggleModule, TuiInputCountModule, TuiTabsModule, TuiAccordionModule, TuiTagModule } from '@taiga-ui/kit';
|
|
10
|
-
import { TuiButtonModule, TuiModeDirective, TuiLinkModule, TuiExpandModule, TuiGroupModule, TuiTooltipModule, TuiModeModule, TuiSvgModule, TuiDataListModule, TuiTextfieldControllerModule, TuiHintControllerModule, TuiPrimitiveTextfieldModule, TuiDropdownControllerModule, TuiNotificationModule, TuiNotificationsService, capitalizeFirstLetter, tuiCapitalizeFirstLetter, TUI_ICONS_PATH, TuiHostedDropdownModule, TuiScrollbarModule, TuiThemeNightModule, TuiRootModule, TuiDialogModule, TuiAlertModule } from '@taiga-ui/core';
|
|
11
|
-
import { FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
12
|
-
import { UrlSerializer, RouterModule, ActivatedRoute, Router, NavigationEnd } from '@angular/router';
|
|
13
|
-
import { trigger, transition, style, animate } from '@angular/animations';
|
|
14
|
-
import { Clipboard, ClipboardModule } from '@angular/cdk/clipboard';
|
|
15
|
-
import { LOCATION, LOCAL_STORAGE, WINDOW } from '@ng-web-apis/common';
|
|
16
|
-
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
17
|
-
import { TuiCountryIsoCode, TuiLanguageSwitcher } from '@taiga-ui/i18n';
|
|
18
|
-
import { TuiSidebarDirective, TuiSidebarModule } from '@taiga-ui/addon-mobile';
|
|
19
|
-
import { Title } from '@angular/platform-browser';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated: use {@link tuiRawLoad} instead
|
|
23
|
-
*/
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
|
-
function rawLoad(content) {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
27
|
-
var _a;
|
|
28
|
-
return __generator(this, function (_b) {
|
|
29
|
-
switch (_b.label) {
|
|
30
|
-
case 0:
|
|
31
|
-
if (!(content instanceof Promise)) return [3 /*break*/, 2];
|
|
32
|
-
return [4 /*yield*/, content];
|
|
33
|
-
case 1:
|
|
34
|
-
_a = (_b.sent()).default;
|
|
35
|
-
return [3 /*break*/, 3];
|
|
36
|
-
case 2:
|
|
37
|
-
_a = content;
|
|
38
|
-
_b.label = 3;
|
|
39
|
-
case 3: return [2 /*return*/, _a];
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
var tuiRawLoad = rawLoad;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated: use {@link tuiTryParseMarkdownCodeBlock} instead
|
|
48
|
-
*/
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
|
-
function tryParseMarkdownCodeBlock(text) {
|
|
51
|
-
if (text === void 0) { text = ""; }
|
|
52
|
-
var tokens = new MarkdownIt().parse(text, {});
|
|
53
|
-
var result = tokens
|
|
54
|
-
.filter(function (_a) {
|
|
55
|
-
var tag = _a.tag, type = _a.type;
|
|
56
|
-
return tag === "code" && type === "fence";
|
|
57
|
-
})
|
|
58
|
-
.map(function (_a) {
|
|
59
|
-
var content = _a.content;
|
|
60
|
-
return content;
|
|
61
|
-
});
|
|
62
|
-
return result.length ? result : [text];
|
|
63
|
-
}
|
|
64
|
-
var tuiTryParseMarkdownCodeBlock = tryParseMarkdownCodeBlock;
|
|
65
|
-
|
|
66
|
-
var TuiDocCodeComponent = /** @class */ (function () {
|
|
67
|
-
function TuiDocCodeComponent() {
|
|
68
|
-
this.rawLoader$$ = new BehaviorSubject("");
|
|
69
|
-
this.filename = "";
|
|
70
|
-
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad), map(tryParseMarkdownCodeBlock));
|
|
71
|
-
}
|
|
72
|
-
Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
|
|
73
|
-
set: function (code) {
|
|
74
|
-
this.rawLoader$$.next(code);
|
|
75
|
-
},
|
|
76
|
-
enumerable: true,
|
|
77
|
-
configurable: true
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(TuiDocCodeComponent.prototype, "hasFilename", {
|
|
80
|
-
get: function () {
|
|
81
|
-
return !!this.filename;
|
|
82
|
-
},
|
|
83
|
-
enumerable: true,
|
|
84
|
-
configurable: true
|
|
85
|
-
});
|
|
86
|
-
__decorate([
|
|
87
|
-
Input()
|
|
88
|
-
], TuiDocCodeComponent.prototype, "filename", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
Input()
|
|
91
|
-
], TuiDocCodeComponent.prototype, "code", null);
|
|
92
|
-
__decorate([
|
|
93
|
-
HostBinding("class._has-filename")
|
|
94
|
-
], TuiDocCodeComponent.prototype, "hasFilename", null);
|
|
95
|
-
TuiDocCodeComponent = __decorate([
|
|
96
|
-
Component({
|
|
97
|
-
selector: "tui-doc-code",
|
|
98
|
-
template: "<p\n *ngIf=\"filename\"\n class=\"t-header\"\n>\n {{ filename }}\n</p>\n<pre\n *ngFor=\"let content of processor$ | async\"\n class=\"t-code\"\n><code [lineNumbers]=\"true\" [highlight]=\"content\"></code></pre>\n",
|
|
99
|
-
styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:700}.t-code{margin:0}.t-code+.t-code{margin-top:1rem}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear-disabled);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.hljs:not(:empty)::-webkit-scrollbar,.hljs:not(:empty)::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.hljs:not(:empty)::-webkit-scrollbar{background-color:transparent}.hljs:not(:empty)::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.hljs:not(:empty)::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.hljs:not(:empty)::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host._has-filename .hljs:not(:empty){border-radius:.75rem}:host-context(tui-root._mobile) .hljs:not(:empty){padding:1rem}"]
|
|
100
|
-
})
|
|
101
|
-
], TuiDocCodeComponent);
|
|
102
|
-
return TuiDocCodeComponent;
|
|
103
|
-
}());
|
|
104
|
-
|
|
105
|
-
var TuiDocCodeModule = /** @class */ (function () {
|
|
106
|
-
function TuiDocCodeModule() {
|
|
107
|
-
}
|
|
108
|
-
TuiDocCodeModule = __decorate([
|
|
109
|
-
NgModule({
|
|
110
|
-
imports: [CommonModule, HighlightModule],
|
|
111
|
-
declarations: [TuiDocCodeComponent],
|
|
112
|
-
exports: [TuiDocCodeComponent],
|
|
113
|
-
})
|
|
114
|
-
], TuiDocCodeModule);
|
|
115
|
-
return TuiDocCodeModule;
|
|
116
|
-
}());
|
|
117
|
-
|
|
118
|
-
var COPIED_TIMEOUT = 1500;
|
|
119
|
-
// @dynamic
|
|
120
|
-
var TuiDocCopyComponent = /** @class */ (function () {
|
|
121
|
-
function TuiDocCopyComponent(texts$) {
|
|
122
|
-
this.texts$ = texts$;
|
|
123
|
-
this.copy$ = new Subject();
|
|
124
|
-
}
|
|
125
|
-
Object.defineProperty(TuiDocCopyComponent.prototype, "copied$", {
|
|
126
|
-
get: function () {
|
|
127
|
-
return this.copy$.pipe(switchMapTo(timer(COPIED_TIMEOUT).pipe(mapTo(false), startWith(true))));
|
|
128
|
-
},
|
|
129
|
-
enumerable: true,
|
|
130
|
-
configurable: true
|
|
131
|
-
});
|
|
132
|
-
TuiDocCopyComponent.prototype.onClick = function () {
|
|
133
|
-
this.copy$.next();
|
|
134
|
-
};
|
|
135
|
-
TuiDocCopyComponent.ctorParameters = function () { return [
|
|
136
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_COPY_TEXTS,] }] }
|
|
137
|
-
]; };
|
|
138
|
-
__decorate([
|
|
139
|
-
tuiPure
|
|
140
|
-
], TuiDocCopyComponent.prototype, "copied$", null);
|
|
141
|
-
TuiDocCopyComponent = __decorate([
|
|
142
|
-
Component({
|
|
143
|
-
selector: "tui-doc-copy",
|
|
144
|
-
template: "<button\n *ngIf=\"texts$ | async as texts\"\n tuiButton\n type=\"button\"\n appearance=\"\"\n size=\"s\"\n class=\"t-copy\"\n [title]=\"texts[0]\"\n (click)=\"onClick()\"\n>\n <span\n class=\"t-content\"\n [class.t-content_moved]=\"copied$ | async\"\n >\n <span\n class=\"t-initial\"\n [attr.data-text]=\"texts[0]\"\n >\n <ng-content></ng-content>\n </span>\n {{ texts[1] }}\n </span>\n</button>\n",
|
|
145
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
146
|
-
providers: [TuiDestroyService],
|
|
147
|
-
styles: [":host{position:relative;display:inline-block;vertical-align:middle}.t-copy{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:100%;color:var(--tui-text-01);background:var(--tui-base-01);overflow:hidden}.t-copy:hover{background:var(--tui-base-02)}.t-initial{white-space:nowrap}.t-initial:empty:before{content:attr(data-text)}.t-content{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;flex-direction:column;transform:translateY(1rem);text-align:center;line-height:2rem}.t-content_moved{transform:translateY(-1rem)}"]
|
|
148
|
-
}),
|
|
149
|
-
__param(0, Inject(TUI_COPY_TEXTS))
|
|
150
|
-
], TuiDocCopyComponent);
|
|
151
|
-
return TuiDocCopyComponent;
|
|
152
|
-
}());
|
|
153
|
-
|
|
154
|
-
var TuiDocCopyModule = /** @class */ (function () {
|
|
155
|
-
function TuiDocCopyModule() {
|
|
156
|
-
}
|
|
157
|
-
TuiDocCopyModule = __decorate([
|
|
158
|
-
NgModule({
|
|
159
|
-
imports: [CommonModule, TuiButtonModule],
|
|
160
|
-
declarations: [TuiDocCopyComponent],
|
|
161
|
-
exports: [TuiDocCopyComponent],
|
|
162
|
-
})
|
|
163
|
-
], TuiDocCopyModule);
|
|
164
|
-
return TuiDocCopyModule;
|
|
165
|
-
}());
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* TODO: think about reorganization in @taiga-ui/i18n way
|
|
169
|
-
*/
|
|
170
|
-
/**
|
|
171
|
-
* Works with a tuple
|
|
172
|
-
* [@string tuiMode tooltip content, @string word 'background', @string 'form value']
|
|
173
|
-
*/
|
|
174
|
-
var TUI_DOC_DEMO_TEXTS = new InjectionToken("tui-doc-demo i18n texts", {
|
|
175
|
-
factory: function () { return ["Read more more about modes: ", "Background", "Form value"]; },
|
|
176
|
-
});
|
|
177
|
-
/**
|
|
178
|
-
* Works with a tuple
|
|
179
|
-
* [
|
|
180
|
-
* @string word 'argument',
|
|
181
|
-
* @string word 'type',
|
|
182
|
-
* @string 'name and description',
|
|
183
|
-
* @string word 'value'
|
|
184
|
-
* @string message for tooltip about ng-polymorpheus
|
|
185
|
-
* ]
|
|
186
|
-
*/
|
|
187
|
-
var TUI_DOC_DOCUMENTATION_TEXTS = new InjectionToken("tui-doc-documentation i18n texts", {
|
|
188
|
-
factory: function () { return [
|
|
189
|
-
"Argument",
|
|
190
|
-
"Type",
|
|
191
|
-
"Name and description",
|
|
192
|
-
"Value",
|
|
193
|
-
"Learn about our dynamic templates from ",
|
|
194
|
-
]; },
|
|
195
|
-
});
|
|
196
|
-
/**
|
|
197
|
-
* Works with a tuple
|
|
198
|
-
* [
|
|
199
|
-
* @string default tab name,
|
|
200
|
-
* @string link to a sample copied message text,
|
|
201
|
-
* @string link to a sample copied message label
|
|
202
|
-
* ]
|
|
203
|
-
*/
|
|
204
|
-
var TUI_DOC_EXAMPLE_TEXTS = new InjectionToken("tui-doc-example i18n texts", {
|
|
205
|
-
factory: function () { return ["Preview", "Link to a sample was successfully copied", "Done"]; },
|
|
206
|
-
});
|
|
207
|
-
var TUI_DOC_MENU_TEXT = new InjectionToken("menu i18n text", {
|
|
208
|
-
factory: function () { return "Menu"; },
|
|
209
|
-
});
|
|
210
|
-
var TUI_DOC_SEARCH_TEXT = new InjectionToken("search i18n text", {
|
|
211
|
-
factory: function () { return "Search"; },
|
|
212
|
-
});
|
|
213
|
-
var TUI_DOC_SEE_ALSO_TEXT = new InjectionToken("tui-doc-see-also i18n text", {
|
|
214
|
-
factory: function () { return "See also"; },
|
|
215
|
-
});
|
|
216
|
-
var TUI_DOC_SOURCE_CODE_TEXT = new InjectionToken("tui-doc-source-code i18n text", {
|
|
217
|
-
factory: function () { return "Source code"; },
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
var MIN_COMPONENT_WIDTH = 104;
|
|
221
|
-
// @dynamic
|
|
222
|
-
var TuiDocDemoComponent = /** @class */ (function () {
|
|
223
|
-
function TuiDocDemoComponent(isMobile, destroy$, renderer, platformId, locationRef, urlSerializer, texts) {
|
|
224
|
-
var _this = this;
|
|
225
|
-
this.isMobile = isMobile;
|
|
226
|
-
this.destroy$ = destroy$;
|
|
227
|
-
this.renderer = renderer;
|
|
228
|
-
this.texts = texts;
|
|
229
|
-
this.initialX = 0;
|
|
230
|
-
this.wrapperWidth = 0;
|
|
231
|
-
this.control = null;
|
|
232
|
-
this.template = null;
|
|
233
|
-
this.updateOnVariants = ["change", "blur", "submit"];
|
|
234
|
-
this.updateOn = "change";
|
|
235
|
-
this.expanded = false;
|
|
236
|
-
this.opaque = true;
|
|
237
|
-
this.modeControl = new FormControl();
|
|
238
|
-
this.mode = null;
|
|
239
|
-
this.change$ = new Subject();
|
|
240
|
-
this.items = ["onLight", "onDark"];
|
|
241
|
-
this.isBrowser = isPlatformBrowser(platformId);
|
|
242
|
-
var parsedMode = locationRef.path().match(/tuiMode=(onDark|onLight)/);
|
|
243
|
-
if (parsedMode !== null && parsedMode.length > 0) {
|
|
244
|
-
this.modeControl.setValue(parsedMode[1]);
|
|
245
|
-
}
|
|
246
|
-
this.modeControl.valueChanges
|
|
247
|
-
.pipe(startWith(this.modeControl.value), takeUntil(this.destroy$))
|
|
248
|
-
.subscribe(function (mode) {
|
|
249
|
-
var urlTree = urlSerializer.parse(locationRef.path());
|
|
250
|
-
urlTree.queryParams = __assign(__assign({}, urlTree.queryParams), { tuiMode: mode });
|
|
251
|
-
locationRef.go(String(urlTree));
|
|
252
|
-
_this.mode = mode;
|
|
253
|
-
_this.change$.next();
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
TuiDocDemoComponent_1 = TuiDocDemoComponent;
|
|
257
|
-
TuiDocDemoComponent.prototype.onResize = function () {
|
|
258
|
-
this.setResizerTextContent();
|
|
259
|
-
};
|
|
260
|
-
TuiDocDemoComponent.prototype.ngOnInit = function () {
|
|
261
|
-
this.createForm();
|
|
262
|
-
};
|
|
263
|
-
TuiDocDemoComponent.prototype.ngAfterViewInit = function () {
|
|
264
|
-
this.setResizerTextContent();
|
|
265
|
-
};
|
|
266
|
-
TuiDocDemoComponent.prototype.setResizerTextContent = function () {
|
|
267
|
-
if (!this.content || !this.resizerText) {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
var paddingLeft = this.isBrowser
|
|
271
|
-
? getComputedStyle(this.content.nativeElement).paddingLeft
|
|
272
|
-
: "0";
|
|
273
|
-
var offsetWidth = this.content.nativeElement.offsetWidth;
|
|
274
|
-
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || "0", 10) * 2);
|
|
275
|
-
};
|
|
276
|
-
TuiDocDemoComponent.prototype.onDragStart = function (event) {
|
|
277
|
-
event.preventDefault();
|
|
278
|
-
this.initialX = event.clientX;
|
|
279
|
-
this.wrapperWidth = this.wrapper ? this.wrapper.nativeElement.offsetWidth : 0;
|
|
280
|
-
};
|
|
281
|
-
TuiDocDemoComponent.prototype.onDragContinues = function (event) {
|
|
282
|
-
var deltaX = this.initialX - event.clientX;
|
|
283
|
-
this.resizeContent(deltaX);
|
|
284
|
-
this.setResizerTextContent();
|
|
285
|
-
};
|
|
286
|
-
TuiDocDemoComponent.prototype.onDragEnd = function () {
|
|
287
|
-
this.wrapperWidth = this.wrapper ? this.wrapper.nativeElement.offsetWidth : 0;
|
|
288
|
-
};
|
|
289
|
-
TuiDocDemoComponent.prototype.toggleDetails = function () {
|
|
290
|
-
this.expanded = !this.expanded;
|
|
291
|
-
};
|
|
292
|
-
TuiDocDemoComponent.prototype.updateOnChange = function (updateOn) {
|
|
293
|
-
this.updateOn = updateOn;
|
|
294
|
-
this.createForm();
|
|
295
|
-
};
|
|
296
|
-
TuiDocDemoComponent.prototype.createForm = function () {
|
|
297
|
-
var _a = this, control = _a.control, updateOn = _a.updateOn;
|
|
298
|
-
if (!control) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
this.testForm = new FormGroup({ testValue: control }, { updateOn: updateOn });
|
|
302
|
-
};
|
|
303
|
-
TuiDocDemoComponent.prototype.resizeContent = function (delta) {
|
|
304
|
-
if (!this.wrapper) {
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
this.renderer.setStyle(this.wrapper.nativeElement, "width", px(Math.max(this.wrapperWidth - delta, MIN_COMPONENT_WIDTH)));
|
|
308
|
-
};
|
|
309
|
-
var TuiDocDemoComponent_1;
|
|
310
|
-
TuiDocDemoComponent.ctorParameters = function () { return [
|
|
311
|
-
{ type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_MOBILE,] }] },
|
|
312
|
-
{ type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
313
|
-
{ type: Renderer2, decorators: [{ type: Inject, args: [Renderer2,] }] },
|
|
314
|
-
{ type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
|
|
315
|
-
{ type: Location$1, decorators: [{ type: Inject, args: [Location$1,] }] },
|
|
316
|
-
{ type: UrlSerializer, decorators: [{ type: Inject, args: [UrlSerializer,] }] },
|
|
317
|
-
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
|
|
318
|
-
]; };
|
|
319
|
-
__decorate([
|
|
320
|
-
ViewChild("content")
|
|
321
|
-
], TuiDocDemoComponent.prototype, "content", void 0);
|
|
322
|
-
__decorate([
|
|
323
|
-
ViewChild("wrapper")
|
|
324
|
-
], TuiDocDemoComponent.prototype, "wrapper", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
ViewChild("resizerText")
|
|
327
|
-
], TuiDocDemoComponent.prototype, "resizerText", void 0);
|
|
328
|
-
__decorate([
|
|
329
|
-
Input()
|
|
330
|
-
], TuiDocDemoComponent.prototype, "control", void 0);
|
|
331
|
-
__decorate([
|
|
332
|
-
ContentChild(TemplateRef)
|
|
333
|
-
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
334
|
-
__decorate([
|
|
335
|
-
HostListener("window:resize")
|
|
336
|
-
], TuiDocDemoComponent.prototype, "onResize", null);
|
|
337
|
-
TuiDocDemoComponent = TuiDocDemoComponent_1 = __decorate([
|
|
338
|
-
Component({
|
|
339
|
-
selector: "tui-doc-demo",
|
|
340
|
-
template: "<div\n class=\"t-bg-toggle\"\n [tuiMode]=\"null\"\n>\n <ng-template #tooltip>\n {{ texts[0] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n routerLink=\"/directives/mode\"\n >\n <code>tuiMode</code>\n </a>\n </ng-template>\n <ng-container *ngIf=\"isMobile; else desktop\">\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-mode\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiHintContent]=\"tooltip\"\n [formControl]=\"modeControl\"\n >\n tuiMode\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"items\"\n ></tui-data-list-wrapper>\n </tui-select>\n </ng-container>\n <ng-template #desktop>\n tuiMode:\n <tui-tooltip\n describeId=\"form\"\n [content]=\"tooltip\"\n ></tui-tooltip>\n <div\n tuiGroup\n class=\"t-group\"\n [collapsed]=\"true\"\n >\n <tui-radio-block\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n null\n </tui-radio-block>\n <tui-radio-block\n item=\"onDark\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onDark\n </tui-radio-block>\n <tui-radio-block\n item=\"onLight\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n size=\"m\"\n class=\"t-checkbox\"\n [(ngModel)]=\"opaque\"\n >\n {{ texts[1] }}\n </tui-checkbox-labeled>\n</div>\n<div\n #wrapper\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"modeControl.value === 'onDark'\"\n [class.t-wrapper_gray]=\"modeControl.value === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div\n #content\n id=\"demoContent\"\n class=\"t-content\"\n >\n <form\n *ngIf=\"testForm\"\n class=\"t-form\"\n [formGroup]=\"testForm\"\n >\n <div class=\"t-input-wrapper\">\n <ng-container [ngTemplateOutlet]=\"template\"></ng-container>\n </div>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n class=\"t-button\"\n [iconRight]=\"icon\"\n (click)=\"toggleDetails()\"\n >\n {{ texts[2] }}\n </button>\n <ng-template #icon>\n <tui-svg\n src=\"tuiIconChevronDown\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"expanded\"\n ></tui-svg>\n </ng-template>\n <tui-expand\n class=\"t-expand\"\n [expanded]=\"expanded\"\n >\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">Form data: {{ testForm.value | json }}</pre>\n <div\n tuiGroup\n class=\"t-form-controls\"\n >\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-select\"\n [ngModel]=\"updateOn\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"updateOnChange($event)\"\n >\n updateOn\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"updateOnVariants\"\n ></tui-data-list-wrapper>\n </tui-select>\n <button\n tuiButton\n type=\"reset\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Reset\n </button>\n <button\n tuiButton\n type=\"submit\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Submit\n </button>\n </div>\n </ng-template>\n </tui-expand>\n </form>\n <ng-content></ng-content>\n </div>\n <button\n tabindex=\"-1\"\n class=\"t-resizer\"\n (tuiDragStart)=\"onDragStart($event)\"\n (tuiDragContinues)=\"onDragContinues($event)\"\n (tuiDragEnd)=\"onDragEnd()\"\n >\n <span\n #resizerText\n class=\"t-resizer-text\"\n ></span>\n </button>\n</div>\n",
|
|
341
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
342
|
-
providers: [
|
|
343
|
-
TuiDestroyService,
|
|
344
|
-
{
|
|
345
|
-
provide: TuiModeDirective,
|
|
346
|
-
useExisting: forwardRef(function () { return TuiDocDemoComponent_1; }),
|
|
347
|
-
},
|
|
348
|
-
],
|
|
349
|
-
styles: [":host{position:relative;display:block;min-width:100%;margin:1.5rem 0}.t-bg-toggle{position:absolute;bottom:calc(100% + .75rem);display:flex;align-items:center;justify-content:flex-end;pointer-events:none;width:100%}.t-bg-toggle>*{pointer-events:auto}.t-wrapper{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:flex;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);max-width:100%;min-height:6rem;width:100%;background-color:var(--tui-base-01);overflow:hidden}.t-wrapper.t-wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-base-02) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-base-02) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-base-02) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-base-02) 75%);background-size:1.25rem 1.25rem;background-position:0 0,0 .625rem,.625rem -.625rem,-.625rem 0}.t-wrapper.t-wrapper_dark{background-color:#454e58;color:var(--tui-base-01)}.t-wrapper.t-wrapper_gray{background-color:#e5e7ea}.t-wrapper.t-wrapper_dark.t-wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-focus) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-focus) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-focus) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-focus) 75%)}.t-wrapper.t-wrapper_gray.t-wrapper_transparent{background-image:linear-gradient(45deg,var(--tui-base-05) 25%,transparent 25%),linear-gradient(-45deg,var(--tui-base-05) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--tui-base-05) 75%),linear-gradient(-45deg,transparent 75%,var(--tui-base-05) 75%)}:host-context(tui-root._mobile) .t-wrapper{min-height:auto}.t-content{flex:1 1 0;min-width:0;padding:1.5rem;box-sizing:border-box;overflow:hidden}:host-context(tui-root._mobile) .t-content{padding:1rem}.t-form{display:flex;flex-wrap:wrap;align-items:flex-start}.t-input-wrapper{width:100%;margin-bottom:.5rem}.t-expand{width:100%}.t-icon{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out}.t-icon_rotated{transform:rotate(180deg)}.t-value{flex:1;background:var(--tui-clear-inverse);padding:.75rem;border-radius:.25rem}.t-mode{width:12.5rem}.t-select{max-width:15rem}.t-resizer{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;box-shadow:0 .5rem 1rem rgba(0,0,0,.16);position:relative;width:3.5rem;min-height:inherit;flex-shrink:0;border-left:1px solid var(--tui-base-03);cursor:col-resize;outline:0;background:var(--tui-base-01);color:var(--tui-text-01)}.t-resizer:after,.t-resizer:before{content:'';position:absolute;top:.75rem;left:50%;bottom:.75rem;width:1px;background:var(--tui-base-05)}.t-resizer:before{transform:translateX(.125rem)}.t-resizer:after{transform:translateX(-.1875rem)}:host-context(tui-root._mobile) .t-resizer{display:none}.t-resizer-text{font:var(--tui-font-text-s);position:relative;z-index:1;padding:.75rem;background:var(--tui-base-01)}.wrapper_light .t-resizer-text{background:#3e464e}.t-checkbox,.t-group{margin-left:.75rem}.t-button,.t-form-controls{margin-top:.75rem}@supports ((position:-webkit-sticky) or (position:sticky)){@media screen and (min-height:37.5rem){:host{position:-webkit-sticky;position:sticky;top:4.625rem;z-index:2}}}"]
|
|
350
|
-
}),
|
|
351
|
-
__param(0, Inject(TUI_IS_MOBILE)),
|
|
352
|
-
__param(1, Inject(TuiDestroyService)),
|
|
353
|
-
__param(2, Inject(Renderer2)),
|
|
354
|
-
__param(3, Inject(PLATFORM_ID)),
|
|
355
|
-
__param(4, Inject(Location$1)),
|
|
356
|
-
__param(5, Inject(UrlSerializer)),
|
|
357
|
-
__param(6, Inject(TUI_DOC_DEMO_TEXTS))
|
|
358
|
-
], TuiDocDemoComponent);
|
|
359
|
-
return TuiDocDemoComponent;
|
|
360
|
-
}());
|
|
361
|
-
|
|
362
|
-
var TuiDocDemoModule = /** @class */ (function () {
|
|
363
|
-
function TuiDocDemoModule() {
|
|
364
|
-
}
|
|
365
|
-
TuiDocDemoModule = __decorate([
|
|
366
|
-
NgModule({
|
|
367
|
-
imports: [
|
|
368
|
-
CommonModule,
|
|
369
|
-
ReactiveFormsModule,
|
|
370
|
-
FormsModule,
|
|
371
|
-
RouterModule,
|
|
372
|
-
TuiLinkModule,
|
|
373
|
-
TuiDragModule,
|
|
374
|
-
TuiButtonModule,
|
|
375
|
-
TuiSelectModule,
|
|
376
|
-
TuiExpandModule,
|
|
377
|
-
TuiGroupModule,
|
|
378
|
-
TuiTooltipModule,
|
|
379
|
-
TuiModeModule,
|
|
380
|
-
TuiRadioBlockModule,
|
|
381
|
-
TuiCheckboxLabeledModule,
|
|
382
|
-
TuiSvgModule,
|
|
383
|
-
TuiDataListWrapperModule,
|
|
384
|
-
TuiDataListModule,
|
|
385
|
-
TuiTextfieldControllerModule,
|
|
386
|
-
TuiHintControllerModule,
|
|
387
|
-
],
|
|
388
|
-
declarations: [TuiDocDemoComponent],
|
|
389
|
-
exports: [TuiDocDemoComponent],
|
|
390
|
-
})
|
|
391
|
-
], TuiDocDemoModule);
|
|
392
|
-
return TuiDocDemoModule;
|
|
393
|
-
}());
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* TODO: duplicate, need fix it before v3
|
|
397
|
-
* TODO: move another package for reuse between addon-editor and addon-doc
|
|
398
|
-
* @deprecated: use {@link tuiRgbToHex} instead
|
|
399
|
-
*/
|
|
400
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
401
|
-
function rgbToHex(r, g, b) {
|
|
402
|
-
return "#" + [r, g, b].map(function (x) { return x.toString(16).padStart(2, "0"); }).join("");
|
|
403
|
-
}
|
|
404
|
-
var tuiRgbToHex = rgbToHex;
|
|
405
|
-
/**
|
|
406
|
-
* @deprecated: use {@link tuiHexToRgb} instead
|
|
407
|
-
*/
|
|
408
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
409
|
-
function hexToRgb(hex) {
|
|
410
|
-
var matches = hex
|
|
411
|
-
.replace("#", "")
|
|
412
|
-
.split("")
|
|
413
|
-
.map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
|
|
414
|
-
.join("")
|
|
415
|
-
.match(/.{2}/g);
|
|
416
|
-
return matches
|
|
417
|
-
? matches.map(function (x) { return Number.parseInt(x, 16); })
|
|
418
|
-
: [0, 0, 0];
|
|
419
|
-
}
|
|
420
|
-
var tuiHexToRgb = hexToRgb;
|
|
421
|
-
|
|
422
|
-
function inspectArray(array, depth) {
|
|
423
|
-
if (depth === 0) {
|
|
424
|
-
return "[\u2026]";
|
|
425
|
-
}
|
|
426
|
-
var result = "";
|
|
427
|
-
var first = true;
|
|
428
|
-
for (var index = 0; index < array.length; index++) {
|
|
429
|
-
if (first) {
|
|
430
|
-
first = false;
|
|
431
|
-
}
|
|
432
|
-
else {
|
|
433
|
-
result += ", ";
|
|
434
|
-
}
|
|
435
|
-
result += index in array ? inspectAny(array[index], depth - 1) : "empty";
|
|
436
|
-
}
|
|
437
|
-
return "[" + result + "]";
|
|
438
|
-
}
|
|
439
|
-
function inspectObject(object, depth) {
|
|
440
|
-
if (depth === 0) {
|
|
441
|
-
return "{\u2026}";
|
|
442
|
-
}
|
|
443
|
-
var result = "";
|
|
444
|
-
var first = true;
|
|
445
|
-
for (var key in object) {
|
|
446
|
-
if (!object.hasOwnProperty(key)) {
|
|
447
|
-
continue;
|
|
448
|
-
}
|
|
449
|
-
if (first) {
|
|
450
|
-
first = false;
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
result += ", ";
|
|
454
|
-
}
|
|
455
|
-
result += key + ": " + inspectAny(object[key], depth - 1);
|
|
456
|
-
}
|
|
457
|
-
return "{" + result + "}";
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* @deprecated: use {@link tuiInspectAny} instead
|
|
461
|
-
* Returns readable JS entity
|
|
462
|
-
* @param data
|
|
463
|
-
* @param depth
|
|
464
|
-
* @return readable JS entity
|
|
465
|
-
*/
|
|
466
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
467
|
-
function inspectAny(data, depth) {
|
|
468
|
-
if (data === null) {
|
|
469
|
-
return "null";
|
|
470
|
-
}
|
|
471
|
-
switch (typeof data) {
|
|
472
|
-
case "string":
|
|
473
|
-
return "'" + data + "'";
|
|
474
|
-
case "undefined":
|
|
475
|
-
case "number":
|
|
476
|
-
case "boolean":
|
|
477
|
-
case "function":
|
|
478
|
-
return String(data);
|
|
479
|
-
}
|
|
480
|
-
if (data instanceof RegExp) {
|
|
481
|
-
return String(data);
|
|
482
|
-
}
|
|
483
|
-
if (Array.isArray(data)) {
|
|
484
|
-
return inspectArray(data, depth);
|
|
485
|
-
}
|
|
486
|
-
return inspectObject(data, depth);
|
|
487
|
-
}
|
|
488
|
-
var tuiInspectAny = inspectAny;
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* @deprecated: use {@link tuiCoerceValue} instead
|
|
492
|
-
*/
|
|
493
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
494
|
-
function coerceValue(value) {
|
|
495
|
-
var prepared = String(value).trim();
|
|
496
|
-
if (isEmptyParamValue(prepared)) {
|
|
497
|
-
return null;
|
|
498
|
-
}
|
|
499
|
-
else if (isBooleanParamValue(prepared)) {
|
|
500
|
-
return String(prepared) === "true";
|
|
501
|
-
}
|
|
502
|
-
else if (isNumberParamValue(prepared)) {
|
|
503
|
-
return Number(prepared);
|
|
504
|
-
}
|
|
505
|
-
var decodedValue = decodeURIComponent(prepared);
|
|
506
|
-
try {
|
|
507
|
-
return isPossibleArray(decodedValue) || isPossibleObject(decodedValue)
|
|
508
|
-
? JSON.parse(decodedValue)
|
|
509
|
-
: decodedValue;
|
|
510
|
-
}
|
|
511
|
-
catch (_a) {
|
|
512
|
-
return decodedValue;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
var tuiCoerceValue = coerceValue;
|
|
516
|
-
function isEmptyParamValue(value) {
|
|
517
|
-
return ["undefined", "null", "NaN", "Infinity"].includes(value);
|
|
518
|
-
}
|
|
519
|
-
function isBooleanParamValue(value) {
|
|
520
|
-
return value === "true" || value === "false";
|
|
521
|
-
}
|
|
522
|
-
function isNumberParamValue(value) {
|
|
523
|
-
// TODO: investigate to disallow potentially catastrophic exponential-time regular expressions.
|
|
524
|
-
// eslint-disable-next-line unicorn/no-unsafe-regex
|
|
525
|
-
return /^-?[\d.]+(?:e-?\d+)?$/.test(value);
|
|
526
|
-
}
|
|
527
|
-
function isPossibleArray(value) {
|
|
528
|
-
return value.startsWith("[") && value.endsWith("]");
|
|
529
|
-
}
|
|
530
|
-
function isPossibleObject(value) {
|
|
531
|
-
return value.startsWith("{") && value.endsWith("}");
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
var SERIALIZED_SUFFIX = "$";
|
|
535
|
-
// @bad TODO: refactor output and value sync
|
|
536
|
-
var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
537
|
-
function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
|
|
538
|
-
this.template = template;
|
|
539
|
-
this.locationRef = locationRef;
|
|
540
|
-
this.activatedRoute = activatedRoute;
|
|
541
|
-
this.urlSerializer = urlSerializer;
|
|
542
|
-
this.documentationPropertyName = "";
|
|
543
|
-
this.documentationPropertyMode = null;
|
|
544
|
-
this.documentationPropertyType = "";
|
|
545
|
-
this.documentationPropertyDeprecated = false;
|
|
546
|
-
this.documentationPropertyValues = null;
|
|
547
|
-
this.documentationPropertyValueChange = new EventEmitter();
|
|
548
|
-
this.changed$ = new Subject();
|
|
549
|
-
this.emits$ = new BehaviorSubject(1);
|
|
550
|
-
}
|
|
551
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
|
|
552
|
-
this.parseParams(this.activatedRoute.snapshot.queryParams);
|
|
553
|
-
};
|
|
554
|
-
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
|
|
555
|
-
get: function () {
|
|
556
|
-
switch (this.documentationPropertyMode) {
|
|
557
|
-
case "input":
|
|
558
|
-
return "[" + this.documentationPropertyName + "]";
|
|
559
|
-
case "output":
|
|
560
|
-
return "(" + this.documentationPropertyName + ")";
|
|
561
|
-
case "input-output":
|
|
562
|
-
return "[(" + this.documentationPropertyName + ")]";
|
|
563
|
-
default:
|
|
564
|
-
return this.documentationPropertyName;
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
enumerable: true,
|
|
568
|
-
configurable: true
|
|
569
|
-
});
|
|
570
|
-
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
|
|
571
|
-
get: function () {
|
|
572
|
-
return !!this.documentationPropertyValues;
|
|
573
|
-
},
|
|
574
|
-
enumerable: true,
|
|
575
|
-
configurable: true
|
|
576
|
-
});
|
|
577
|
-
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
|
|
578
|
-
get: function () {
|
|
579
|
-
return this.documentationPropertyMode !== "output";
|
|
580
|
-
},
|
|
581
|
-
enumerable: true,
|
|
582
|
-
configurable: true
|
|
583
|
-
});
|
|
584
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnChanges = function () {
|
|
585
|
-
this.changed$.next();
|
|
586
|
-
};
|
|
587
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.onValueChange = function (value) {
|
|
588
|
-
this.documentationPropertyValue = value;
|
|
589
|
-
this.documentationPropertyValueChange.emit(value);
|
|
590
|
-
this.setQueryParam(value);
|
|
591
|
-
};
|
|
592
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
|
|
593
|
-
// For more convenient debugging
|
|
594
|
-
console.info(this.attrName, event);
|
|
595
|
-
this.emits$.next(this.emits$.value + 1);
|
|
596
|
-
};
|
|
597
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.parseParams = function (params) {
|
|
598
|
-
var propertyValue = params[this.documentationPropertyName];
|
|
599
|
-
var propertyValueWithSuffix = params["" + this.documentationPropertyName + SERIALIZED_SUFFIX];
|
|
600
|
-
if (!propertyValue && !propertyValueWithSuffix) {
|
|
601
|
-
return;
|
|
602
|
-
}
|
|
603
|
-
var value = !!propertyValueWithSuffix && this.documentationPropertyValues
|
|
604
|
-
? this.documentationPropertyValues[propertyValueWithSuffix]
|
|
605
|
-
: coerceValue(propertyValue);
|
|
606
|
-
this.onValueChange(value);
|
|
607
|
-
};
|
|
608
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.setQueryParam = function (value) {
|
|
609
|
-
var _a;
|
|
610
|
-
var tree = this.urlSerializer.parse(this.locationRef.path());
|
|
611
|
-
var isValueAvailableByKey = value instanceof Object;
|
|
612
|
-
var computedValue = isValueAvailableByKey && this.documentationPropertyValues
|
|
613
|
-
? this.documentationPropertyValues.indexOf(value)
|
|
614
|
-
: value;
|
|
615
|
-
var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : "";
|
|
616
|
-
var propName = this.documentationPropertyName + suffix;
|
|
617
|
-
tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
|
|
618
|
-
this.locationRef.go(String(tree));
|
|
619
|
-
};
|
|
620
|
-
TuiDocDocumentationPropertyConnectorDirective.ctorParameters = function () { return [
|
|
621
|
-
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] },
|
|
622
|
-
{ type: Location$1, decorators: [{ type: Inject, args: [Location$1,] }] },
|
|
623
|
-
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] },
|
|
624
|
-
{ type: UrlSerializer, decorators: [{ type: Inject, args: [UrlSerializer,] }] }
|
|
625
|
-
]; };
|
|
626
|
-
__decorate([
|
|
627
|
-
Input()
|
|
628
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyName", void 0);
|
|
629
|
-
__decorate([
|
|
630
|
-
Input()
|
|
631
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyMode", void 0);
|
|
632
|
-
__decorate([
|
|
633
|
-
Input()
|
|
634
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyType", void 0);
|
|
635
|
-
__decorate([
|
|
636
|
-
Input()
|
|
637
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValue", void 0);
|
|
638
|
-
__decorate([
|
|
639
|
-
Input()
|
|
640
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyDeprecated", void 0);
|
|
641
|
-
__decorate([
|
|
642
|
-
Input()
|
|
643
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValues", void 0);
|
|
644
|
-
__decorate([
|
|
645
|
-
Output()
|
|
646
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
|
|
647
|
-
TuiDocDocumentationPropertyConnectorDirective = __decorate([
|
|
648
|
-
Directive({
|
|
649
|
-
selector: "ng-template[documentationPropertyName]",
|
|
650
|
-
exportAs: "documentationProperty",
|
|
651
|
-
}),
|
|
652
|
-
__param(0, Inject(TemplateRef)),
|
|
653
|
-
__param(1, Inject(Location$1)),
|
|
654
|
-
__param(2, Inject(ActivatedRoute)),
|
|
655
|
-
__param(3, Inject(UrlSerializer))
|
|
656
|
-
], TuiDocDocumentationPropertyConnectorDirective);
|
|
657
|
-
return TuiDocDocumentationPropertyConnectorDirective;
|
|
658
|
-
}());
|
|
659
|
-
|
|
660
|
-
// @bad TODO subscribe propertiesConnectors changes
|
|
661
|
-
// @bad TODO refactor to make more flexible
|
|
662
|
-
// @dynamic
|
|
663
|
-
var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
664
|
-
function TuiDocDocumentationComponent(changeDetectorRef, texts) {
|
|
665
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
666
|
-
this.texts = texts;
|
|
667
|
-
this.heading = "";
|
|
668
|
-
this.showValues = true;
|
|
669
|
-
this.isAPI = false;
|
|
670
|
-
this.propertiesConnectors = EMPTY_QUERY;
|
|
671
|
-
this.activeItemIndex = 0;
|
|
672
|
-
}
|
|
673
|
-
TuiDocDocumentationComponent.prototype.ngAfterContentInit = function () {
|
|
674
|
-
itemsQueryListObservable(this.propertiesConnectors)
|
|
675
|
-
.pipe(switchMap(function (items) { return merge.apply(void 0, __spread(items.map(function (_a) {
|
|
676
|
-
var changed$ = _a.changed$;
|
|
677
|
-
return changed$;
|
|
678
|
-
}))); }), watch(this.changeDetectorRef))
|
|
679
|
-
.subscribe();
|
|
680
|
-
};
|
|
681
|
-
Object.defineProperty(TuiDocDocumentationComponent.prototype, "type", {
|
|
682
|
-
get: function () {
|
|
683
|
-
return this.isAPI ? this.texts[0] : this.texts[1];
|
|
684
|
-
},
|
|
685
|
-
enumerable: true,
|
|
686
|
-
configurable: true
|
|
687
|
-
});
|
|
688
|
-
TuiDocDocumentationComponent.prototype.getColor = function (color) {
|
|
689
|
-
if (color.length === 4) {
|
|
690
|
-
return color
|
|
691
|
-
.split("")
|
|
692
|
-
.reduce(function (result, current) { return __spread(result, [current, current]); }, [])
|
|
693
|
-
.join("")
|
|
694
|
-
.replace("#", "");
|
|
695
|
-
}
|
|
696
|
-
if (color.startsWith("#")) {
|
|
697
|
-
return color;
|
|
698
|
-
}
|
|
699
|
-
if (color === "transparent") {
|
|
700
|
-
return "#000000";
|
|
701
|
-
}
|
|
702
|
-
var parsed = color
|
|
703
|
-
.replace("rgb(", "")
|
|
704
|
-
.replace("rgba(", "")
|
|
705
|
-
.replace(")", "")
|
|
706
|
-
.replace(" ", "")
|
|
707
|
-
.split(",")
|
|
708
|
-
.map(function (v) { return Number.parseInt(v, 10); });
|
|
709
|
-
return rgbToHex.apply(void 0, __spread(parsed));
|
|
710
|
-
};
|
|
711
|
-
TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
|
|
712
|
-
if (color.startsWith("#") || color.startsWith("rgb(")) {
|
|
713
|
-
return 100;
|
|
714
|
-
}
|
|
715
|
-
if (color === "transparent") {
|
|
716
|
-
return 0;
|
|
717
|
-
}
|
|
718
|
-
var lastComma = color.lastIndexOf(",");
|
|
719
|
-
var parsed = color
|
|
720
|
-
.slice(lastComma)
|
|
721
|
-
.replace(")", "")
|
|
722
|
-
.replace(" ", "")
|
|
723
|
-
.replace(",", "");
|
|
724
|
-
return Math.round(Number.parseFloat(parsed) * 100);
|
|
725
|
-
};
|
|
726
|
-
TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
|
|
727
|
-
var opacity = this.getOpacity(connector.documentationPropertyValue || "");
|
|
728
|
-
if (opacity === 100) {
|
|
729
|
-
connector.onValueChange(color);
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
var rgb = hexToRgb(color).join(", ");
|
|
733
|
-
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
734
|
-
connector.onValueChange(result);
|
|
735
|
-
};
|
|
736
|
-
TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
|
|
737
|
-
var hex = this.getColor(connector.documentationPropertyValue || "");
|
|
738
|
-
var rgb = hexToRgb(hex);
|
|
739
|
-
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
740
|
-
connector.onValueChange(result);
|
|
741
|
-
};
|
|
742
|
-
TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
|
|
743
|
-
return name.replace("?", "");
|
|
744
|
-
};
|
|
745
|
-
TuiDocDocumentationComponent.prototype.isOptional = function (name) {
|
|
746
|
-
return name.includes("?");
|
|
747
|
-
};
|
|
748
|
-
TuiDocDocumentationComponent.prototype.isPrimitivePolymorpheusContent = function (value) {
|
|
749
|
-
return typeof value === "string" || typeof value === "number";
|
|
750
|
-
};
|
|
751
|
-
TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
|
|
752
|
-
return type.includes("null");
|
|
753
|
-
};
|
|
754
|
-
TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
|
|
755
|
-
return type.includes("PolymorpheusContent");
|
|
756
|
-
};
|
|
757
|
-
TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
|
|
758
|
-
return inspectAny(data, 2);
|
|
759
|
-
};
|
|
760
|
-
TuiDocDocumentationComponent.ctorParameters = function () { return [
|
|
761
|
-
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
762
|
-
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DOCUMENTATION_TEXTS,] }] }
|
|
763
|
-
]; };
|
|
764
|
-
__decorate([
|
|
765
|
-
Input()
|
|
766
|
-
], TuiDocDocumentationComponent.prototype, "heading", void 0);
|
|
767
|
-
__decorate([
|
|
768
|
-
Input()
|
|
769
|
-
], TuiDocDocumentationComponent.prototype, "showValues", void 0);
|
|
770
|
-
__decorate([
|
|
771
|
-
Input()
|
|
772
|
-
], TuiDocDocumentationComponent.prototype, "isAPI", void 0);
|
|
773
|
-
__decorate([
|
|
774
|
-
ContentChildren(TuiDocDocumentationPropertyConnectorDirective)
|
|
775
|
-
], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
|
|
776
|
-
TuiDocDocumentationComponent = __decorate([
|
|
777
|
-
Component({
|
|
778
|
-
selector: "tui-doc-documentation",
|
|
779
|
-
template: "<h1\n *ngIf=\"heading\"\n class=\"t-heading\"\n>\n {{ heading }}\n</h1>\n<ng-content></ng-content>\n<table class=\"t-table\">\n <tr class=\"t-row t-row_header\">\n <th class=\"t-th t-cell t-cell_prop\">{{ texts[2] }}</th>\n <th class=\"t-th\">{{ type }}</th>\n <th\n *ngIf=\"showValues && !isAPI\"\n class=\"t-th t-cell t-cell_value\"\n >\n {{ texts[3] }}\n </th>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors\"\n class=\"t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n >\n <td class=\"t-cell\">\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property\"\n >\n {{ 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 [ngTemplateOutlet]=\"propertyConnector.template\"></ng-container>\n </td>\n <td class=\"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/tinkoff/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"t-cell\"\n >\n <ng-container *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\">\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"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\n #selectContent\n let-data\n >\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container [ngSwitch]=\"propertyConnector.documentationPropertyType\">\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div\n *ngSwitchCase=\"'color'\"\n tuiGroup\n >\n <tui-primitive-textfield\n tuiTextfieldType=\"text\"\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\n <ng-container *ngSwitchCase=\"'PolymorpheusContent'\">\n <tui-primitive-textfield\n *ngIf=\"isPrimitivePolymorpheusContent(propertyConnector.documentationPropertyValue)\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue.toString()\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n >\n Default content\n </tui-primitive-textfield>\n </ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
|
|
780
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
781
|
-
animations: [
|
|
782
|
-
trigger("emitEvent", [
|
|
783
|
-
transition(":increment", [style({ opacity: 1 }), animate("500ms ease-in")]),
|
|
784
|
-
]),
|
|
785
|
-
],
|
|
786
|
-
styles: [":host{display:block;min-width:100%}.t-table{width:100%;table-layout:fixed}.t-row:not(:last-child){border-bottom:1px solid var(--tui-base-03)}:host-context(tui-root._mobile) .t-row{display:flex;flex-wrap:wrap}:host-context(tui-root._mobile) .t-row_header{display:none}.t-cell{padding:1rem 1rem .875rem}.t-cell:first-child{padding-left:0}.t-cell:last-child{padding-right:0;text-align:right}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}:host-context(tui-root._mobile) .t-cell_value{width:9.375rem}:host-context(tui-root._mobile) .t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}.t-th{padding:.5rem 1rem;color:var(--tui-text-02);font-weight:400;text-align:left}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}:host-context(tui-root._mobile) .t-property{padding:.5rem 0}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg);box-shadow:-1rem 0 var(--tui-error-bg),1rem 0 var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content}.t-output{text-align:left;opacity:0}.t-heading{font:var(--tui-font-heading-4)}"]
|
|
787
|
-
}),
|
|
788
|
-
__param(0, Inject(ChangeDetectorRef)),
|
|
789
|
-
__param(1, Inject(TUI_DOC_DOCUMENTATION_TEXTS))
|
|
790
|
-
], TuiDocDocumentationComponent);
|
|
791
|
-
return TuiDocDocumentationComponent;
|
|
792
|
-
}());
|
|
793
|
-
|
|
794
|
-
var TuiInputOpacityDirective = /** @class */ (function () {
|
|
795
|
-
function TuiInputOpacityDirective(renderer, tuiFocusableComponent) {
|
|
796
|
-
this.renderer = renderer;
|
|
797
|
-
this.tuiFocusableComponent = tuiFocusableComponent;
|
|
798
|
-
}
|
|
799
|
-
Object.defineProperty(TuiInputOpacityDirective.prototype, "tuiInputOpacity", {
|
|
800
|
-
set: function (opacity) {
|
|
801
|
-
var nativeFocusableElement = this.tuiFocusableComponent.nativeFocusableElement;
|
|
802
|
-
if (nativeFocusableElement) {
|
|
803
|
-
this.renderer.setStyle(nativeFocusableElement, "opacity", opacity / 100);
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
enumerable: true,
|
|
807
|
-
configurable: true
|
|
808
|
-
});
|
|
809
|
-
TuiInputOpacityDirective.ctorParameters = function () { return [
|
|
810
|
-
{ type: Renderer2, decorators: [{ type: Inject, args: [Renderer2,] }] },
|
|
811
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_FOCUSABLE_ITEM_ACCESSOR,] }] }
|
|
812
|
-
]; };
|
|
813
|
-
__decorate([
|
|
814
|
-
Input()
|
|
815
|
-
], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
|
|
816
|
-
TuiInputOpacityDirective = __decorate([
|
|
817
|
-
Directive({
|
|
818
|
-
selector: "[tuiInputOpacity]",
|
|
819
|
-
}),
|
|
820
|
-
__param(0, Inject(Renderer2)),
|
|
821
|
-
__param(1, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR))
|
|
822
|
-
], TuiInputOpacityDirective);
|
|
823
|
-
return TuiInputOpacityDirective;
|
|
824
|
-
}());
|
|
825
|
-
|
|
826
|
-
var TuiInputOpacityModule = /** @class */ (function () {
|
|
827
|
-
function TuiInputOpacityModule() {
|
|
828
|
-
}
|
|
829
|
-
TuiInputOpacityModule = __decorate([
|
|
830
|
-
NgModule({
|
|
831
|
-
declarations: [TuiInputOpacityDirective],
|
|
832
|
-
exports: [TuiInputOpacityDirective],
|
|
833
|
-
})
|
|
834
|
-
], TuiInputOpacityModule);
|
|
835
|
-
return TuiInputOpacityModule;
|
|
836
|
-
}());
|
|
837
|
-
|
|
838
|
-
var TuiDocDocumentationModule = /** @class */ (function () {
|
|
839
|
-
function TuiDocDocumentationModule() {
|
|
840
|
-
}
|
|
841
|
-
TuiDocDocumentationModule = __decorate([
|
|
842
|
-
NgModule({
|
|
843
|
-
imports: [
|
|
844
|
-
CommonModule,
|
|
845
|
-
FormsModule,
|
|
846
|
-
RouterModule,
|
|
847
|
-
TuiBadgeModule,
|
|
848
|
-
TuiSelectModule,
|
|
849
|
-
TuiToggleModule,
|
|
850
|
-
TuiTooltipModule,
|
|
851
|
-
TuiLinkModule,
|
|
852
|
-
TuiInputCountModule,
|
|
853
|
-
TuiModeModule,
|
|
854
|
-
TuiGroupModule,
|
|
855
|
-
TuiInputOpacityModule,
|
|
856
|
-
TuiPrimitiveTextfieldModule,
|
|
857
|
-
TuiTextfieldControllerModule,
|
|
858
|
-
TuiHintControllerModule,
|
|
859
|
-
TuiDropdownControllerModule,
|
|
860
|
-
TuiDataListModule,
|
|
861
|
-
TuiDataListWrapperModule,
|
|
862
|
-
TuiNotificationModule,
|
|
863
|
-
],
|
|
864
|
-
declarations: [
|
|
865
|
-
TuiDocDocumentationComponent,
|
|
866
|
-
TuiDocDocumentationPropertyConnectorDirective,
|
|
867
|
-
],
|
|
868
|
-
exports: [
|
|
869
|
-
TuiDocDocumentationComponent,
|
|
870
|
-
TuiDocDocumentationPropertyConnectorDirective,
|
|
871
|
-
],
|
|
872
|
-
})
|
|
873
|
-
], TuiDocDocumentationModule);
|
|
874
|
-
return TuiDocDocumentationModule;
|
|
875
|
-
}());
|
|
876
|
-
|
|
877
|
-
var TUI_DOC_CODE_ACTIONS = new InjectionToken("Code actions for the opened tab with code example", {
|
|
878
|
-
factory: function () { return ""; },
|
|
879
|
-
});
|
|
880
|
-
|
|
881
|
-
var TUI_DOC_CODE_EDITOR = new InjectionToken("Contains service for opening online IDE e.g. Stackblitz");
|
|
882
|
-
|
|
883
|
-
var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new InjectionToken("Processes content in example", { factory: function () { return identity; } });
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* @deprecated: use {@link tuiRawLoadRecord} instead
|
|
887
|
-
*/
|
|
888
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
889
|
-
function rawLoadRecord(example) {
|
|
890
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
891
|
-
var processedContent, _a, _b, _c, key, content, _d, _e, e_1_1;
|
|
892
|
-
var e_1, _f;
|
|
893
|
-
return __generator(this, function (_g) {
|
|
894
|
-
switch (_g.label) {
|
|
895
|
-
case 0:
|
|
896
|
-
processedContent = {};
|
|
897
|
-
_g.label = 1;
|
|
898
|
-
case 1:
|
|
899
|
-
_g.trys.push([1, 6, 7, 8]);
|
|
900
|
-
_a = __values(Object.entries(example)), _b = _a.next();
|
|
901
|
-
_g.label = 2;
|
|
902
|
-
case 2:
|
|
903
|
-
if (!!_b.done) return [3 /*break*/, 5];
|
|
904
|
-
_c = __read(_b.value, 2), key = _c[0], content = _c[1];
|
|
905
|
-
if (!content) return [3 /*break*/, 4];
|
|
906
|
-
_d = processedContent;
|
|
907
|
-
_e = key;
|
|
908
|
-
return [4 /*yield*/, rawLoad(content)];
|
|
909
|
-
case 3:
|
|
910
|
-
_d[_e] = _g.sent();
|
|
911
|
-
_g.label = 4;
|
|
912
|
-
case 4:
|
|
913
|
-
_b = _a.next();
|
|
914
|
-
return [3 /*break*/, 2];
|
|
915
|
-
case 5: return [3 /*break*/, 8];
|
|
916
|
-
case 6:
|
|
917
|
-
e_1_1 = _g.sent();
|
|
918
|
-
e_1 = { error: e_1_1 };
|
|
919
|
-
return [3 /*break*/, 8];
|
|
920
|
-
case 7:
|
|
921
|
-
try {
|
|
922
|
-
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
923
|
-
}
|
|
924
|
-
finally { if (e_1) throw e_1.error; }
|
|
925
|
-
return [7 /*endfinally*/];
|
|
926
|
-
case 8: return [2 /*return*/, processedContent];
|
|
927
|
-
}
|
|
928
|
-
});
|
|
929
|
-
});
|
|
930
|
-
}
|
|
931
|
-
var tuiRawLoadRecord = rawLoadRecord;
|
|
932
|
-
|
|
933
|
-
// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
|
|
934
|
-
// @dynamic
|
|
935
|
-
var TuiDocExampleComponent = /** @class */ (function () {
|
|
936
|
-
function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent, isCypress, codeActions, router, route, ngLocation) {
|
|
937
|
-
var _this = this;
|
|
938
|
-
this.id = id;
|
|
939
|
-
this.clipboard = clipboard;
|
|
940
|
-
this.notifications = notifications;
|
|
941
|
-
this.location = location;
|
|
942
|
-
this.copyTexts$ = copyTexts$;
|
|
943
|
-
this.texts = texts;
|
|
944
|
-
this.codeEditor = codeEditor;
|
|
945
|
-
this.processContent = processContent;
|
|
946
|
-
this.isCypress = isCypress;
|
|
947
|
-
this.codeActions = codeActions;
|
|
948
|
-
this.router = router;
|
|
949
|
-
this.route = route;
|
|
950
|
-
this.ngLocation = ngLocation;
|
|
951
|
-
this.rawLoader$$ = new BehaviorSubject({});
|
|
952
|
-
this.heading = "";
|
|
953
|
-
this.description = "";
|
|
954
|
-
this.componentName = this.location.pathname.slice(1);
|
|
955
|
-
this.defaultTabIndex = 0;
|
|
956
|
-
this.defaultTab = this.texts[this.defaultTabIndex];
|
|
957
|
-
this.activeItemIndex = this.defaultTabIndex;
|
|
958
|
-
this.copy$ = this.copyTexts$.pipe(map(function (_a) {
|
|
959
|
-
var _b = __read(_a, 1), copy = _b[0];
|
|
960
|
-
return copy;
|
|
961
|
-
}));
|
|
962
|
-
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoadRecord), map(function (value) { return _this.processContent(value); }));
|
|
963
|
-
this.loading$ = new Subject();
|
|
964
|
-
}
|
|
965
|
-
Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
|
|
966
|
-
set: function (content) {
|
|
967
|
-
this.rawLoader$$.next(content);
|
|
968
|
-
},
|
|
969
|
-
enumerable: true,
|
|
970
|
-
configurable: true
|
|
971
|
-
});
|
|
972
|
-
TuiDocExampleComponent.prototype.copyExampleLink = function () {
|
|
973
|
-
var hashPosition = this.location.href.indexOf("#");
|
|
974
|
-
var currentUrl = hashPosition > -1
|
|
975
|
-
? this.location.href.slice(0, Math.max(0, hashPosition))
|
|
976
|
-
: this.location.href;
|
|
977
|
-
var url = currentUrl + "#" + this.id;
|
|
978
|
-
this.setFragmentWithoutRedirect(this.id);
|
|
979
|
-
this.clipboard.copy(url);
|
|
980
|
-
this.notifications
|
|
981
|
-
.show(this.texts[1], {
|
|
982
|
-
label: this.texts[2],
|
|
983
|
-
status: "success" /* Success */,
|
|
984
|
-
})
|
|
985
|
-
.subscribe();
|
|
986
|
-
};
|
|
987
|
-
TuiDocExampleComponent.prototype.edit = function (files) {
|
|
988
|
-
var _this = this;
|
|
989
|
-
var _a, _b;
|
|
990
|
-
this.loading$.next(true);
|
|
991
|
-
(_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, (_b = this.id) !== null && _b !== void 0 ? _b : "", files).finally(function () { return _this.loading$.next(false); });
|
|
992
|
-
};
|
|
993
|
-
TuiDocExampleComponent.prototype.setFragmentWithoutRedirect = function (id) {
|
|
994
|
-
var url = this.router
|
|
995
|
-
.createUrlTree([], { relativeTo: this.route, fragment: id || "" })
|
|
996
|
-
.toString();
|
|
997
|
-
this.ngLocation.go(url);
|
|
998
|
-
};
|
|
999
|
-
TuiDocExampleComponent.ctorParameters = function () { return [
|
|
1000
|
-
{ type: String, decorators: [{ type: Attribute, args: ["id",] }] },
|
|
1001
|
-
{ type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
|
|
1002
|
-
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
|
|
1003
|
-
{ type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
|
|
1004
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_COPY_TEXTS,] }] },
|
|
1005
|
-
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
|
|
1006
|
-
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
|
|
1007
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] },
|
|
1008
|
-
{ type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_CYPRESS,] }] },
|
|
1009
|
-
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_CODE_ACTIONS,] }] },
|
|
1010
|
-
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
1011
|
-
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] },
|
|
1012
|
-
{ type: Location$1, decorators: [{ type: Inject, args: [Location$1,] }] }
|
|
1013
|
-
]; };
|
|
1014
|
-
__decorate([
|
|
1015
|
-
Input()
|
|
1016
|
-
], TuiDocExampleComponent.prototype, "heading", void 0);
|
|
1017
|
-
__decorate([
|
|
1018
|
-
Input()
|
|
1019
|
-
], TuiDocExampleComponent.prototype, "description", void 0);
|
|
1020
|
-
__decorate([
|
|
1021
|
-
Input()
|
|
1022
|
-
], TuiDocExampleComponent.prototype, "content", null);
|
|
1023
|
-
__decorate([
|
|
1024
|
-
Input()
|
|
1025
|
-
], TuiDocExampleComponent.prototype, "componentName", void 0);
|
|
1026
|
-
TuiDocExampleComponent = __decorate([
|
|
1027
|
-
Component({
|
|
1028
|
-
selector: "tui-doc-example",
|
|
1029
|
-
template: "<h3\n *ngIf=\"heading\"\n class=\"t-title\"\n>\n <span\n polymorpheus-outlet\n [content]=\"heading | tuiDocExampleCapitalize\"\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 polymorpheus-outlet\n class=\"t-description\"\n [content]=\"description | tuiDocExampleCapitalize\"\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 *tuiTab\n tuiTab\n >\n {{ tab }}\n </button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\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 <div\n polymorpheus-outlet\n [content]=\"action\"\n [context]=\"{$implicit: code}\"\n ></div>\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",
|
|
1030
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1031
|
-
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:400;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:0.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}"]
|
|
1032
|
-
}),
|
|
1033
|
-
__param(0, Attribute("id")),
|
|
1034
|
-
__param(1, Inject(Clipboard)),
|
|
1035
|
-
__param(2, Inject(TuiNotificationsService)),
|
|
1036
|
-
__param(3, Inject(LOCATION)),
|
|
1037
|
-
__param(4, Inject(TUI_COPY_TEXTS)),
|
|
1038
|
-
__param(5, Inject(TUI_DOC_EXAMPLE_TEXTS)),
|
|
1039
|
-
__param(6, Optional()),
|
|
1040
|
-
__param(6, Inject(TUI_DOC_CODE_EDITOR)),
|
|
1041
|
-
__param(7, Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR)),
|
|
1042
|
-
__param(8, Inject(TUI_IS_CYPRESS)),
|
|
1043
|
-
__param(9, Inject(TUI_DOC_CODE_ACTIONS)),
|
|
1044
|
-
__param(10, Inject(Router)),
|
|
1045
|
-
__param(11, Inject(ActivatedRoute)),
|
|
1046
|
-
__param(12, Inject(Location$1))
|
|
1047
|
-
], TuiDocExampleComponent);
|
|
1048
|
-
return TuiDocExampleComponent;
|
|
1049
|
-
}());
|
|
1050
|
-
|
|
1051
|
-
var TuiDocExampleCapitalizePipe = /** @class */ (function () {
|
|
1052
|
-
function TuiDocExampleCapitalizePipe() {
|
|
1053
|
-
}
|
|
1054
|
-
TuiDocExampleCapitalizePipe.prototype.transform = function (content) {
|
|
1055
|
-
return typeof content === "string" ? capitalizeFirstLetter(content) : content;
|
|
1056
|
-
};
|
|
1057
|
-
TuiDocExampleCapitalizePipe = __decorate([
|
|
1058
|
-
Pipe({ name: "tuiDocExampleCapitalize" })
|
|
1059
|
-
], TuiDocExampleCapitalizePipe);
|
|
1060
|
-
return TuiDocExampleCapitalizePipe;
|
|
1061
|
-
}());
|
|
1062
|
-
|
|
1063
|
-
var TuiDocExampleGetTabsPipe = /** @class */ (function () {
|
|
1064
|
-
function TuiDocExampleGetTabsPipe() {
|
|
1065
|
-
}
|
|
1066
|
-
TuiDocExampleGetTabsPipe.prototype.transform = function (content, defaultTab) {
|
|
1067
|
-
return __spread([defaultTab], Object.keys(content));
|
|
1068
|
-
};
|
|
1069
|
-
TuiDocExampleGetTabsPipe = __decorate([
|
|
1070
|
-
Pipe({ name: "tuiDocExampleGetTabs" })
|
|
1071
|
-
], TuiDocExampleGetTabsPipe);
|
|
1072
|
-
return TuiDocExampleGetTabsPipe;
|
|
1073
|
-
}());
|
|
1074
|
-
|
|
1075
|
-
var TuiDocExampleModule = /** @class */ (function () {
|
|
1076
|
-
function TuiDocExampleModule() {
|
|
1077
|
-
}
|
|
1078
|
-
TuiDocExampleModule = __decorate([
|
|
1079
|
-
NgModule({
|
|
1080
|
-
imports: [
|
|
1081
|
-
CommonModule,
|
|
1082
|
-
ClipboardModule,
|
|
1083
|
-
TuiTabsModule,
|
|
1084
|
-
TuiButtonModule,
|
|
1085
|
-
TuiDocCopyModule,
|
|
1086
|
-
TuiDocCodeModule,
|
|
1087
|
-
PolymorpheusModule,
|
|
1088
|
-
],
|
|
1089
|
-
declarations: [
|
|
1090
|
-
TuiDocExampleComponent,
|
|
1091
|
-
TuiDocExampleGetTabsPipe,
|
|
1092
|
-
TuiDocExampleCapitalizePipe,
|
|
1093
|
-
],
|
|
1094
|
-
exports: [
|
|
1095
|
-
TuiDocExampleComponent,
|
|
1096
|
-
TuiDocExampleGetTabsPipe,
|
|
1097
|
-
TuiDocExampleCapitalizePipe,
|
|
1098
|
-
],
|
|
1099
|
-
})
|
|
1100
|
-
], TuiDocExampleModule);
|
|
1101
|
-
return TuiDocExampleModule;
|
|
1102
|
-
}());
|
|
1103
|
-
|
|
1104
|
-
var TuiLanguageSwitcherComponent = /** @class */ (function () {
|
|
1105
|
-
function TuiLanguageSwitcherComponent(switcher, iconsPath) {
|
|
1106
|
-
this.switcher = switcher;
|
|
1107
|
-
this.iconsPath = iconsPath;
|
|
1108
|
-
this.path = this.iconsPath("tuiIcon").replace("tuiIcon.svg#tuiIcon", "");
|
|
1109
|
-
this.language = new FormControl(tuiCapitalizeFirstLetter(this.switcher.language));
|
|
1110
|
-
this.flags = new Map([
|
|
1111
|
-
["chinese", TuiCountryIsoCode.CN],
|
|
1112
|
-
["dutch", TuiCountryIsoCode.NL],
|
|
1113
|
-
["english", TuiCountryIsoCode.GB],
|
|
1114
|
-
["french", TuiCountryIsoCode.FR],
|
|
1115
|
-
["german", TuiCountryIsoCode.DE],
|
|
1116
|
-
["italian", TuiCountryIsoCode.IT],
|
|
1117
|
-
["polish", TuiCountryIsoCode.PL],
|
|
1118
|
-
["portuguese", TuiCountryIsoCode.PT],
|
|
1119
|
-
["russian", TuiCountryIsoCode.RU],
|
|
1120
|
-
["spanish", TuiCountryIsoCode.ES],
|
|
1121
|
-
["turkish", TuiCountryIsoCode.TR],
|
|
1122
|
-
["ukrainian", TuiCountryIsoCode.UA],
|
|
1123
|
-
["vietnamese", TuiCountryIsoCode.VN],
|
|
1124
|
-
]);
|
|
1125
|
-
this.names = Array.from(this.flags.keys());
|
|
1126
|
-
}
|
|
1127
|
-
TuiLanguageSwitcherComponent.prototype.getFlagPath = function (code) {
|
|
1128
|
-
return code ? "" + this.path + code + ".png" : null;
|
|
1129
|
-
};
|
|
1130
|
-
TuiLanguageSwitcherComponent.ctorParameters = function () { return [
|
|
1131
|
-
{ type: TuiLanguageSwitcher, decorators: [{ type: Inject, args: [TuiLanguageSwitcher,] }] },
|
|
1132
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ICONS_PATH,] }] }
|
|
1133
|
-
]; };
|
|
1134
|
-
TuiLanguageSwitcherComponent = __decorate([
|
|
1135
|
-
Component({
|
|
1136
|
-
selector: "tui-language-switcher",
|
|
1137
|
-
template: "<tui-select [formControl]=\"language\">\n <ng-content></ng-content>\n <tui-data-list *tuiDataList>\n <button\n *ngFor=\"let name of names\"\n tuiOption\n [value]=\"name | titlecase\"\n (click)=\"switcher.setLanguage(name)\"\n >\n <img\n alt=\"\"\n class=\"t-flag\"\n [src]=\"getFlagPath(flags.get(name))\"\n />\n {{ name | titlecase }}\n </button>\n </tui-data-list>\n</tui-select>\n",
|
|
1138
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1139
|
-
styles: [".t-flag{width:1.75rem;height:1.25rem;margin-right:.5rem}"]
|
|
1140
|
-
}),
|
|
1141
|
-
__param(0, Inject(TuiLanguageSwitcher)),
|
|
1142
|
-
__param(1, Inject(TUI_ICONS_PATH))
|
|
1143
|
-
], TuiLanguageSwitcherComponent);
|
|
1144
|
-
return TuiLanguageSwitcherComponent;
|
|
1145
|
-
}());
|
|
1146
|
-
|
|
1147
|
-
var TuiLanguageSwitcherModule = /** @class */ (function () {
|
|
1148
|
-
function TuiLanguageSwitcherModule() {
|
|
1149
|
-
}
|
|
1150
|
-
TuiLanguageSwitcherModule = __decorate([
|
|
1151
|
-
NgModule({
|
|
1152
|
-
exports: [TuiLanguageSwitcherComponent],
|
|
1153
|
-
declarations: [TuiLanguageSwitcherComponent],
|
|
1154
|
-
imports: [CommonModule, TuiSelectModule, TuiDataListModule, ReactiveFormsModule],
|
|
1155
|
-
})
|
|
1156
|
-
], TuiLanguageSwitcherModule);
|
|
1157
|
-
return TuiLanguageSwitcherModule;
|
|
1158
|
-
}());
|
|
1159
|
-
|
|
1160
|
-
// @dynamic
|
|
1161
|
-
var TuiDocMainComponent = /** @class */ (function () {
|
|
1162
|
-
function TuiDocMainComponent(storage, windowRef) {
|
|
1163
|
-
this.storage = storage;
|
|
1164
|
-
this.windowRef = windowRef;
|
|
1165
|
-
this.night = this.storage.getItem("night") === "true" ||
|
|
1166
|
-
(this.storage.getItem("night") === null &&
|
|
1167
|
-
this.windowRef.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
1168
|
-
this.change$ = new Subject();
|
|
1169
|
-
}
|
|
1170
|
-
TuiDocMainComponent_1 = TuiDocMainComponent;
|
|
1171
|
-
Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
|
|
1172
|
-
get: function () {
|
|
1173
|
-
return this.night ? "onDark" : null;
|
|
1174
|
-
},
|
|
1175
|
-
enumerable: true,
|
|
1176
|
-
configurable: true
|
|
1177
|
-
});
|
|
1178
|
-
TuiDocMainComponent.prototype.onMode = function (night) {
|
|
1179
|
-
this.night = night;
|
|
1180
|
-
this.change$.next();
|
|
1181
|
-
this.storage.setItem("night", String(night));
|
|
1182
|
-
};
|
|
1183
|
-
var TuiDocMainComponent_1;
|
|
1184
|
-
TuiDocMainComponent.ctorParameters = function () { return [
|
|
1185
|
-
{ type: Storage, decorators: [{ type: Inject, args: [LOCAL_STORAGE,] }] },
|
|
1186
|
-
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
1187
|
-
]; };
|
|
1188
|
-
__decorate([
|
|
1189
|
-
HostBinding("attr.data-mode")
|
|
1190
|
-
], TuiDocMainComponent.prototype, "mode", null);
|
|
1191
|
-
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
1192
|
-
Component({
|
|
1193
|
-
selector: "tui-doc-main",
|
|
1194
|
-
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-toggle\"\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=\"tuiOverAlerts\">\n <ng-content select=\"tuiOverAlerts\"></ng-content>\n </ng-container>\n <!-- TODO: 3.0 Remove-->\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",
|
|
1195
|
-
encapsulation: ViewEncapsulation.None,
|
|
1196
|
-
providers: [
|
|
1197
|
-
{
|
|
1198
|
-
provide: TuiModeDirective,
|
|
1199
|
-
useExisting: forwardRef(function () { return TuiDocMainComponent_1; }),
|
|
1200
|
-
},
|
|
1201
|
-
TuiSwipeService,
|
|
1202
|
-
],
|
|
1203
|
-
styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls>.t-bar_vertical{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([class*=language-]):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}a:focus code,button:focus code{background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width:47.9625em){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}label.night-mode .tui-toggle{margin-left:.5rem}.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.hljs-line-numbers{background:0 0}.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-link-hover)}[data-mode=onDark] .hljs-template-variable,[data-mode=onDark] .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}"]
|
|
1204
|
-
}),
|
|
1205
|
-
__param(0, Inject(LOCAL_STORAGE)),
|
|
1206
|
-
__param(1, Inject(WINDOW))
|
|
1207
|
-
], TuiDocMainComponent);
|
|
1208
|
-
return TuiDocMainComponent;
|
|
1209
|
-
}());
|
|
1210
|
-
|
|
1211
|
-
var TUI_DOC_PAGE_LOADED = new InjectionToken("[TUI_DOC_PAGE_LOADED] Stream that emits if loading of page is over (for example, to begin scrollIntoView)", { factory: function () { return defer(function () { return timer(200).pipe(switchMapTo(of(true))); }); } });
|
|
1212
|
-
|
|
1213
|
-
/**
|
|
1214
|
-
* @deprecated: use {@link TuiScrollIntoViewLinkDirective}
|
|
1215
|
-
* TODO: remove in v3.0
|
|
1216
|
-
*/
|
|
1217
|
-
var ScrollIntoViewDirective = /** @class */ (function () {
|
|
1218
|
-
function ScrollIntoViewDirective(destroy$, _a, readyToScroll$) {
|
|
1219
|
-
var nativeElement = _a.nativeElement;
|
|
1220
|
-
this.readyToScroll$ = readyToScroll$;
|
|
1221
|
-
this.scroll$ = new ReplaySubject(1);
|
|
1222
|
-
this.readyToScroll$
|
|
1223
|
-
.pipe(filter(Boolean), switchMapTo(this.scroll$), debounceTime(750), filter(function (shallWe) { return shallWe && !!getElementObscurers(nativeElement); }), takeUntil(destroy$))
|
|
1224
|
-
.subscribe(function () {
|
|
1225
|
-
nativeElement.scrollIntoView();
|
|
1226
|
-
});
|
|
1227
|
-
}
|
|
1228
|
-
Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
|
|
1229
|
-
set: function (shallWe) {
|
|
1230
|
-
this.scroll$.next(shallWe);
|
|
1231
|
-
},
|
|
1232
|
-
enumerable: true,
|
|
1233
|
-
configurable: true
|
|
1234
|
-
});
|
|
1235
|
-
ScrollIntoViewDirective.ctorParameters = function () { return [
|
|
1236
|
-
{ type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
1237
|
-
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
1238
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_DOC_PAGE_LOADED,] }] }
|
|
1239
|
-
]; };
|
|
1240
|
-
__decorate([
|
|
1241
|
-
Input()
|
|
1242
|
-
], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
|
|
1243
|
-
ScrollIntoViewDirective = __decorate([
|
|
1244
|
-
Directive({
|
|
1245
|
-
selector: "[scrollIntoView]",
|
|
1246
|
-
providers: [TuiDestroyService],
|
|
1247
|
-
})
|
|
1248
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1249
|
-
,
|
|
1250
|
-
__param(0, Inject(TuiDestroyService)),
|
|
1251
|
-
__param(1, Inject(ElementRef)),
|
|
1252
|
-
__param(2, Inject(TUI_DOC_PAGE_LOADED))
|
|
1253
|
-
], ScrollIntoViewDirective);
|
|
1254
|
-
return ScrollIntoViewDirective;
|
|
1255
|
-
}());
|
|
1256
|
-
var TuiScrollIntoViewLinkDirective = /** @class */ (function (_super) {
|
|
1257
|
-
__extends(TuiScrollIntoViewLinkDirective, _super);
|
|
1258
|
-
function TuiScrollIntoViewLinkDirective() {
|
|
1259
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1260
|
-
}
|
|
1261
|
-
TuiScrollIntoViewLinkDirective = __decorate([
|
|
1262
|
-
Directive({
|
|
1263
|
-
selector: "[tuiScrollIntoViewLink]",
|
|
1264
|
-
providers: [TuiDestroyService],
|
|
1265
|
-
})
|
|
1266
|
-
], TuiScrollIntoViewLinkDirective);
|
|
1267
|
-
return TuiScrollIntoViewLinkDirective;
|
|
1268
|
-
}(ScrollIntoViewDirective));
|
|
1269
|
-
|
|
1270
|
-
/**
|
|
1271
|
-
* @deprecated: use {@link TuiScrollIntoViewLinkModule}
|
|
1272
|
-
* TODO: remove in v3.0
|
|
1273
|
-
*/
|
|
1274
|
-
var ScrollIntoViewModule = /** @class */ (function () {
|
|
1275
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1276
|
-
function ScrollIntoViewModule() {
|
|
1277
|
-
}
|
|
1278
|
-
ScrollIntoViewModule = __decorate([
|
|
1279
|
-
NgModule({
|
|
1280
|
-
declarations: [ScrollIntoViewDirective],
|
|
1281
|
-
exports: [ScrollIntoViewDirective],
|
|
1282
|
-
})
|
|
1283
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1284
|
-
], ScrollIntoViewModule);
|
|
1285
|
-
return ScrollIntoViewModule;
|
|
1286
|
-
}());
|
|
1287
|
-
var TuiScrollIntoViewLinkModule = /** @class */ (function () {
|
|
1288
|
-
function TuiScrollIntoViewLinkModule() {
|
|
1289
|
-
}
|
|
1290
|
-
TuiScrollIntoViewLinkModule = __decorate([
|
|
1291
|
-
NgModule({
|
|
1292
|
-
declarations: [TuiScrollIntoViewLinkDirective],
|
|
1293
|
-
exports: [TuiScrollIntoViewLinkDirective],
|
|
1294
|
-
})
|
|
1295
|
-
], TuiScrollIntoViewLinkModule);
|
|
1296
|
-
return TuiScrollIntoViewLinkModule;
|
|
1297
|
-
}());
|
|
1298
|
-
|
|
1299
|
-
var TUI_DOC_SCROLL_BEHAVIOR = new InjectionToken("[TUI_DOC_SCROLL_BEHAVIOR] Defines the transition animation for scroll", { factory: function () { return "smooth"; } });
|
|
1300
|
-
|
|
1301
|
-
var MAP = {
|
|
1302
|
-
а: "f",
|
|
1303
|
-
б: ",",
|
|
1304
|
-
в: "d",
|
|
1305
|
-
г: "u",
|
|
1306
|
-
д: "l",
|
|
1307
|
-
е: "t",
|
|
1308
|
-
ё: "`",
|
|
1309
|
-
ж: ";",
|
|
1310
|
-
з: "p",
|
|
1311
|
-
и: "b",
|
|
1312
|
-
й: "q",
|
|
1313
|
-
к: "r",
|
|
1314
|
-
л: "k",
|
|
1315
|
-
м: "v",
|
|
1316
|
-
н: "y",
|
|
1317
|
-
о: "j",
|
|
1318
|
-
п: "g",
|
|
1319
|
-
р: "h",
|
|
1320
|
-
с: "c",
|
|
1321
|
-
т: "n",
|
|
1322
|
-
у: "e",
|
|
1323
|
-
ф: "a",
|
|
1324
|
-
х: "[",
|
|
1325
|
-
ц: "w",
|
|
1326
|
-
ч: "x",
|
|
1327
|
-
ш: "i",
|
|
1328
|
-
щ: "o",
|
|
1329
|
-
ъ: "]",
|
|
1330
|
-
ы: "s",
|
|
1331
|
-
ь: "m",
|
|
1332
|
-
ю: ".",
|
|
1333
|
-
я: "z",
|
|
1334
|
-
};
|
|
1335
|
-
/**
|
|
1336
|
-
* @deprecated: use {@link tuiTransliterateKeyboardLayout} instead
|
|
1337
|
-
* Translates text mistakenly typed in the Russian layout into English
|
|
1338
|
-
* @param string string with Russian layout characters
|
|
1339
|
-
* @return string with English layout characters
|
|
1340
|
-
*/
|
|
1341
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1342
|
-
function transliterateKeyboardLayout(string) {
|
|
1343
|
-
var newStr = "";
|
|
1344
|
-
for (var i = 0; i < string.length; i++) {
|
|
1345
|
-
newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
|
|
1346
|
-
}
|
|
1347
|
-
return newStr;
|
|
1348
|
-
}
|
|
1349
|
-
var tuiTransliterateKeyboardLayout = transliterateKeyboardLayout;
|
|
1350
|
-
|
|
1351
|
-
var TUI_DOC_PAGES = new InjectionToken("Documentation pages", {
|
|
1352
|
-
factory: function () { return []; },
|
|
1353
|
-
});
|
|
1354
|
-
|
|
1355
|
-
var TUI_DOC_TITLE = new InjectionToken("Page title", {
|
|
1356
|
-
factory: function () { return ""; },
|
|
1357
|
-
});
|
|
1358
|
-
|
|
1359
|
-
var NAVIGATION_TITLE = new InjectionToken("Page title");
|
|
1360
|
-
var NAVIGATION_LABELS = new InjectionToken("Navigation sections labels for search");
|
|
1361
|
-
var NAVIGATION_ITEMS = new InjectionToken("Navigation pages");
|
|
1362
|
-
var NAVIGATION_PROVIDERS = [
|
|
1363
|
-
TuiDestroyService,
|
|
1364
|
-
{
|
|
1365
|
-
provide: NAVIGATION_TITLE,
|
|
1366
|
-
deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
|
|
1367
|
-
useFactory: titleProviderFactory,
|
|
1368
|
-
},
|
|
1369
|
-
{
|
|
1370
|
-
provide: NAVIGATION_LABELS,
|
|
1371
|
-
deps: [TUI_DOC_PAGES],
|
|
1372
|
-
useFactory: labelsProviderFactory,
|
|
1373
|
-
},
|
|
1374
|
-
{
|
|
1375
|
-
provide: NAVIGATION_ITEMS,
|
|
1376
|
-
deps: [TUI_DOC_PAGES],
|
|
1377
|
-
useFactory: itemsProviderFactory,
|
|
1378
|
-
},
|
|
1379
|
-
];
|
|
1380
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1381
|
-
function titleProviderFactory(router, activatedRoute, titlePrefix, destroy$) {
|
|
1382
|
-
return router.events.pipe(filter(function (event) { return event instanceof NavigationEnd; }), map(function () { return activatedRoute.firstChild; }), filter(isPresent), mergeMap(function (_a) {
|
|
1383
|
-
var data = _a.data;
|
|
1384
|
-
return data;
|
|
1385
|
-
}), map(function (_a) {
|
|
1386
|
-
var title = _a.title;
|
|
1387
|
-
return titlePrefix + title;
|
|
1388
|
-
}), takeUntil(destroy$));
|
|
1389
|
-
}
|
|
1390
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1391
|
-
function labelsProviderFactory(pages) {
|
|
1392
|
-
return pages
|
|
1393
|
-
.map(function (_a) {
|
|
1394
|
-
var section = _a.section;
|
|
1395
|
-
return section;
|
|
1396
|
-
})
|
|
1397
|
-
.filter(isPresent)
|
|
1398
|
-
.filter(function (item, index, array) { return array.indexOf(item) === index; });
|
|
1399
|
-
}
|
|
1400
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1401
|
-
function itemsProviderFactory(pages) {
|
|
1402
|
-
var labels = labelsProviderFactory(pages);
|
|
1403
|
-
return __spread(labels.map(function (label) { return pages.filter(function (_a) {
|
|
1404
|
-
var section = _a.section;
|
|
1405
|
-
return section === label;
|
|
1406
|
-
}); }), [
|
|
1407
|
-
pages.filter(function (page) { return !page.section; }),
|
|
1408
|
-
]);
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
// @dynamic
|
|
1412
|
-
var TuiDocNavigationComponent = /** @class */ (function () {
|
|
1413
|
-
function TuiDocNavigationComponent(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute, destroy$, readyToScroll$, scrollBehavior) {
|
|
1414
|
-
var _this = this;
|
|
1415
|
-
this.documentRef = documentRef;
|
|
1416
|
-
this.mode = mode;
|
|
1417
|
-
this.sidebar = sidebar;
|
|
1418
|
-
this.labels = labels;
|
|
1419
|
-
this.items = items;
|
|
1420
|
-
this.searchText = searchText;
|
|
1421
|
-
this.router = router;
|
|
1422
|
-
this.activatedRoute = activatedRoute;
|
|
1423
|
-
this.destroy$ = destroy$;
|
|
1424
|
-
this.readyToScroll$ = readyToScroll$;
|
|
1425
|
-
this.scrollBehavior = scrollBehavior;
|
|
1426
|
-
this.menuOpen = false;
|
|
1427
|
-
this.search = "";
|
|
1428
|
-
this.open = false;
|
|
1429
|
-
this.openPagesArr = [];
|
|
1430
|
-
this.openPagesGroupsArr = [];
|
|
1431
|
-
this.active = "";
|
|
1432
|
-
this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode || "onLight"; }));
|
|
1433
|
-
// Angular can't navigate no anchor links
|
|
1434
|
-
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
1435
|
-
title$.subscribe(function (title) {
|
|
1436
|
-
changeDetectorRef.markForCheck();
|
|
1437
|
-
titleService.setTitle(title);
|
|
1438
|
-
_this.openActivePageGroup();
|
|
1439
|
-
_this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
|
|
1440
|
-
});
|
|
1441
|
-
}
|
|
1442
|
-
Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
|
|
1443
|
-
get: function () {
|
|
1444
|
-
return this.search.length > 2;
|
|
1445
|
-
},
|
|
1446
|
-
enumerable: true,
|
|
1447
|
-
configurable: true
|
|
1448
|
-
});
|
|
1449
|
-
Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
|
|
1450
|
-
get: function () {
|
|
1451
|
-
return this.filterItems(this.flattenSubPages(this.items), this.search);
|
|
1452
|
-
},
|
|
1453
|
-
enumerable: true,
|
|
1454
|
-
configurable: true
|
|
1455
|
-
});
|
|
1456
|
-
Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
|
|
1457
|
-
get: function () {
|
|
1458
|
-
return this.items[this.items.length - 1];
|
|
1459
|
-
},
|
|
1460
|
-
enumerable: true,
|
|
1461
|
-
configurable: true
|
|
1462
|
-
});
|
|
1463
|
-
TuiDocNavigationComponent.prototype.isActive = function (route) {
|
|
1464
|
-
return route === this.active;
|
|
1465
|
-
};
|
|
1466
|
-
TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
|
|
1467
|
-
this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
|
|
1468
|
-
};
|
|
1469
|
-
TuiDocNavigationComponent.prototype.closeMenu = function () {
|
|
1470
|
-
this.menuOpen = false;
|
|
1471
|
-
};
|
|
1472
|
-
TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
|
|
1473
|
-
this.search = search;
|
|
1474
|
-
this.open = this.canOpen;
|
|
1475
|
-
};
|
|
1476
|
-
TuiDocNavigationComponent.prototype.onClick = function () {
|
|
1477
|
-
this.open = false;
|
|
1478
|
-
this.menuOpen = false;
|
|
1479
|
-
this.search = "";
|
|
1480
|
-
this.openActivePageGroup();
|
|
1481
|
-
};
|
|
1482
|
-
TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
|
|
1483
|
-
return items.map(function (section) {
|
|
1484
|
-
return uniqBy(section.filter(function (_a) {
|
|
1485
|
-
var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? "" : _b;
|
|
1486
|
-
title = title.toLowerCase();
|
|
1487
|
-
search = search.toLowerCase();
|
|
1488
|
-
keywords = keywords.toLowerCase();
|
|
1489
|
-
return (title.includes(search) ||
|
|
1490
|
-
keywords.includes(search) ||
|
|
1491
|
-
title.includes(transliterateKeyboardLayout(search)) ||
|
|
1492
|
-
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
1493
|
-
search.replace(/-/gi, "").includes(title));
|
|
1494
|
-
}), "title");
|
|
1495
|
-
});
|
|
1496
|
-
};
|
|
1497
|
-
TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
|
|
1498
|
-
return items.reduce(function (array, item) { return __spread(array, [
|
|
1499
|
-
item.reduce(function (pages, page) {
|
|
1500
|
-
return "subPages" in page
|
|
1501
|
-
? __spread(pages, page.subPages) : __spread(pages, [page]);
|
|
1502
|
-
}, []),
|
|
1503
|
-
]); }, []);
|
|
1504
|
-
};
|
|
1505
|
-
TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
|
|
1506
|
-
return this.router.isActive(route, false);
|
|
1507
|
-
};
|
|
1508
|
-
TuiDocNavigationComponent.prototype.handleAnchorLink = function (hash) {
|
|
1509
|
-
var _this = this;
|
|
1510
|
-
this.readyToScroll$
|
|
1511
|
-
.pipe(filter(Boolean), take(1), takeUntil(this.destroy$))
|
|
1512
|
-
.subscribe(function () { return _this.navigateToAnchorLink(hash); });
|
|
1513
|
-
};
|
|
1514
|
-
TuiDocNavigationComponent.prototype.openActivePageGroup = function () {
|
|
1515
|
-
var _this = this;
|
|
1516
|
-
this.items.forEach(function (pages, pagesIndex) {
|
|
1517
|
-
pages.forEach(function (page, pageIndex) {
|
|
1518
|
-
if ("route" in page && _this.isActiveRoute(page.route)) {
|
|
1519
|
-
_this.openPagesArr[pagesIndex] = true;
|
|
1520
|
-
_this.active = page.route;
|
|
1521
|
-
}
|
|
1522
|
-
if ("subPages" in page) {
|
|
1523
|
-
page.subPages.forEach(function (subPage) {
|
|
1524
|
-
if (_this.isActiveRoute(subPage.route)) {
|
|
1525
|
-
_this.openPagesArr[pagesIndex] = true;
|
|
1526
|
-
_this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
|
|
1527
|
-
_this.active = subPage.route;
|
|
1528
|
-
}
|
|
1529
|
-
});
|
|
1530
|
-
}
|
|
1531
|
-
});
|
|
1532
|
-
});
|
|
1533
|
-
};
|
|
1534
|
-
TuiDocNavigationComponent.prototype.navigateToAnchorLink = function (fragment) {
|
|
1535
|
-
var element = fragment && this.documentRef.querySelector("#" + fragment);
|
|
1536
|
-
if (!element) {
|
|
1537
|
-
return;
|
|
1538
|
-
}
|
|
1539
|
-
element.classList.add("tui-doc-animated-example");
|
|
1540
|
-
element.scrollIntoView({
|
|
1541
|
-
block: "start",
|
|
1542
|
-
inline: "nearest",
|
|
1543
|
-
behavior: this.scrollBehavior,
|
|
1544
|
-
});
|
|
1545
|
-
};
|
|
1546
|
-
TuiDocNavigationComponent.ctorParameters = function () { return [
|
|
1547
|
-
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
1548
|
-
{ type: Title, decorators: [{ type: Inject, args: [Title,] }] },
|
|
1549
|
-
{ type: Observable, decorators: [{ type: Inject, args: [NAVIGATION_TITLE,] }] },
|
|
1550
|
-
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
1551
|
-
{ type: TuiModeDirective, decorators: [{ type: Inject, args: [TuiModeDirective,] }] },
|
|
1552
|
-
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TuiSidebarDirective,] }] },
|
|
1553
|
-
{ type: Array, decorators: [{ type: Inject, args: [NAVIGATION_LABELS,] }] },
|
|
1554
|
-
{ type: undefined, decorators: [{ type: Inject, args: [NAVIGATION_ITEMS,] }] },
|
|
1555
|
-
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
|
|
1556
|
-
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
1557
|
-
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] },
|
|
1558
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
1559
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_DOC_PAGE_LOADED,] }] },
|
|
1560
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_SCROLL_BEHAVIOR,] }] }
|
|
1561
|
-
]; };
|
|
1562
|
-
__decorate([
|
|
1563
|
-
HostBinding("class._open")
|
|
1564
|
-
], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
|
|
1565
|
-
__decorate([
|
|
1566
|
-
tuiPure
|
|
1567
|
-
], TuiDocNavigationComponent.prototype, "filterItems", null);
|
|
1568
|
-
__decorate([
|
|
1569
|
-
tuiPure
|
|
1570
|
-
], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
|
|
1571
|
-
TuiDocNavigationComponent = __decorate([
|
|
1572
|
-
Component({
|
|
1573
|
-
selector: "tui-doc-navigation",
|
|
1574
|
-
template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n class=\"t-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\n #dropdown\n let-activeZone\n >\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=\"t-navigation\">\n <tui-scrollbar\n class=\"t-scrollbar\"\n [tuiMode]=\"mode$ | async\"\n >\n <tui-accordion\n [closeOthers]=\"false\"\n [rounded]=\"false\"\n >\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"t-label\">\n <strong>{{ label }}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"t-section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n [ngTemplateOutlet]=\"pages\"\n [ngTemplateOutletContext]=\"{item: item, index: index * 100 + subIndex}\"\n ></ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"t-items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n [ngTemplateOutlet]=\"pages\"\n [ngTemplateOutletContext]=\"{item: item, index: items.length - 1 + index}\"\n ></ng-container>\n </div>\n\n <ng-template\n #pages\n let-item=\"item\"\n let-index=\"index\"\n >\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n routerLinkActive=\"t-sublink_active\"\n class=\"t-sublink\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{ item.title }}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"t-subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"t-sublink t-sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"t-chevron\"\n [class.t-chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{ item.title }}\n </button>\n <tui-expand\n class=\"t-expand\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"t-section t-section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n routerLinkActive=\"t-sublink_active\"\n class=\"t-sublink t-sublink_small\"\n [routerLink]=\"subPage.route\"\n [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",
|
|
1575
|
-
providers: NAVIGATION_PROVIDERS,
|
|
1576
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1577
|
-
styles: [":host{z-index:1;display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01)}.t-input{display:block;margin:1.25rem}.t-navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.t-scrollbar{width:100%;scroll-behavior:smooth}.t-items-container{display:flex;flex-direction:column;padding:0 1rem}.t-label{margin-left:.5rem}.t-expand{margin-left:.25rem}.t-section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.t-section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.t-subsection{margin-left:.5rem}.t-sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:1rem 0 0;border:0;background:0 0;font-size:inherit;line-height:inherit;font:var(--tui-font-text-m);margin-left:.5rem}.t-sublink_small{margin-left:1rem;line-height:1.5rem;padding-top:.5rem}.t-sublink_subsection{margin-left:0;line-height:1.6rem}.t-sublink_active{color:var(--tui-text-01)}.t-chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.t-chevron_active{transform:rotate(90deg)}"]
|
|
1578
|
-
}),
|
|
1579
|
-
__param(0, Inject(ChangeDetectorRef)),
|
|
1580
|
-
__param(1, Inject(Title)),
|
|
1581
|
-
__param(2, Inject(NAVIGATION_TITLE)),
|
|
1582
|
-
__param(3, Inject(DOCUMENT)),
|
|
1583
|
-
__param(4, Inject(TuiModeDirective)),
|
|
1584
|
-
__param(5, Optional()),
|
|
1585
|
-
__param(5, Inject(TuiSidebarDirective)),
|
|
1586
|
-
__param(6, Inject(NAVIGATION_LABELS)),
|
|
1587
|
-
__param(7, Inject(NAVIGATION_ITEMS)),
|
|
1588
|
-
__param(8, Inject(TUI_DOC_SEARCH_TEXT)),
|
|
1589
|
-
__param(9, Inject(Router)),
|
|
1590
|
-
__param(10, Inject(ActivatedRoute)),
|
|
1591
|
-
__param(11, Inject(TuiDestroyService)),
|
|
1592
|
-
__param(12, Inject(TUI_DOC_PAGE_LOADED)),
|
|
1593
|
-
__param(13, Inject(TUI_DOC_SCROLL_BEHAVIOR))
|
|
1594
|
-
], TuiDocNavigationComponent);
|
|
1595
|
-
return TuiDocNavigationComponent;
|
|
1596
|
-
}());
|
|
1597
|
-
|
|
1598
|
-
var TuiDocNavigationModule = /** @class */ (function () {
|
|
1599
|
-
function TuiDocNavigationModule() {
|
|
1600
|
-
}
|
|
1601
|
-
TuiDocNavigationModule = __decorate([
|
|
1602
|
-
NgModule({
|
|
1603
|
-
imports: [
|
|
1604
|
-
CommonModule,
|
|
1605
|
-
FormsModule,
|
|
1606
|
-
RouterModule,
|
|
1607
|
-
ScrollIntoViewModule,
|
|
1608
|
-
TuiScrollIntoViewLinkModule,
|
|
1609
|
-
TuiButtonModule,
|
|
1610
|
-
TuiPrimitiveTextfieldModule,
|
|
1611
|
-
TuiTextfieldControllerModule,
|
|
1612
|
-
TuiActiveZoneModule,
|
|
1613
|
-
TuiLetModule,
|
|
1614
|
-
TuiModeModule,
|
|
1615
|
-
TuiLinkModule,
|
|
1616
|
-
TuiExpandModule,
|
|
1617
|
-
TuiHostedDropdownModule,
|
|
1618
|
-
TuiDropdownControllerModule,
|
|
1619
|
-
TuiAccordionModule,
|
|
1620
|
-
TuiScrollbarModule,
|
|
1621
|
-
TuiSvgModule,
|
|
1622
|
-
TuiDataListModule,
|
|
1623
|
-
TuiAutoFocusModule,
|
|
1624
|
-
],
|
|
1625
|
-
declarations: [TuiDocNavigationComponent],
|
|
1626
|
-
exports: [TuiDocNavigationComponent],
|
|
1627
|
-
})
|
|
1628
|
-
], TuiDocNavigationModule);
|
|
1629
|
-
return TuiDocNavigationModule;
|
|
1630
|
-
}());
|
|
1631
|
-
|
|
1632
|
-
var TUI_DOC_LOGO = new InjectionToken("Main logo", {
|
|
1633
|
-
factory: function () { return ""; },
|
|
1634
|
-
});
|
|
1635
|
-
|
|
1636
|
-
var TuiDocHeaderComponent = /** @class */ (function () {
|
|
1637
|
-
function TuiDocHeaderComponent(logo, menu, router, swipes$) {
|
|
1638
|
-
this.logo = logo;
|
|
1639
|
-
this.menu = menu;
|
|
1640
|
-
this.router = router;
|
|
1641
|
-
this.swipes$ = swipes$;
|
|
1642
|
-
this.stream$ = new Subject();
|
|
1643
|
-
this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$, this.swipes$.pipe(filter(function (swipe) { return swipe.direction === "left" || swipe.direction === "right"; }), map(function (swipe) { return swipe.direction === "right"; }))).pipe(startWith(false), distinctUntilChanged());
|
|
1644
|
-
}
|
|
1645
|
-
TuiDocHeaderComponent.prototype.onClick = function () {
|
|
1646
|
-
this.stream$.next(true);
|
|
1647
|
-
};
|
|
1648
|
-
TuiDocHeaderComponent.prototype.onActiveZone = function (active) {
|
|
1649
|
-
if (!active) {
|
|
1650
|
-
this.stream$.next(false);
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
TuiDocHeaderComponent.ctorParameters = function () { return [
|
|
1654
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_LOGO,] }] },
|
|
1655
|
-
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_MENU_TEXT,] }] },
|
|
1656
|
-
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
1657
|
-
{ type: TuiSwipeService, decorators: [{ type: Inject, args: [TuiSwipeService,] }] }
|
|
1658
|
-
]; };
|
|
1659
|
-
TuiDocHeaderComponent = __decorate([
|
|
1660
|
-
Component({
|
|
1661
|
-
selector: "header[tuiDocHeader]",
|
|
1662
|
-
template: "<button\n tuiIconButton\n icon=\"tuiIconMenuLarge\"\n appearance=\"icon\"\n class=\"t-menu\"\n [title]=\"menu\"\n (click)=\"onClick()\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-doc-navigation\n *tuiSidebar=\"!!(open$ | async)\"\n class=\"t-navigation\"\n ></tui-doc-navigation>\n</button>\n<div\n polymorpheus-outlet\n class=\"t-logo\"\n [content]=\"logo\"\n>\n <ng-template let-src>\n <img\n alt=\"Logo\"\n class=\"t-img\"\n [src]=\"src\"\n />\n </ng-template>\n</div>\n<ng-content></ng-content>\n",
|
|
1663
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1664
|
-
styles: [":host{box-shadow:0 .125rem 1rem rgba(0,0,0,.08);position:fixed;top:0;left:0;right:0;z-index:1;display:flex;height:3.9375rem;align-items:center;padding:0 1.25rem;background:var(--tui-base-01);border-bottom:1px solid var(--tui-base-03)}.t-logo{margin-right:auto;font:var(--tui-font-heading-5)}.t-img{display:block}.t-menu{margin-left:-1.25rem}@media screen and (min-width:48em){.t-menu{display:none}}.t-navigation{min-height:100%}"]
|
|
1665
|
-
}),
|
|
1666
|
-
__param(0, Inject(TUI_DOC_LOGO)),
|
|
1667
|
-
__param(1, Inject(TUI_DOC_MENU_TEXT)),
|
|
1668
|
-
__param(2, Inject(Router)),
|
|
1669
|
-
__param(3, Inject(TuiSwipeService))
|
|
1670
|
-
], TuiDocHeaderComponent);
|
|
1671
|
-
return TuiDocHeaderComponent;
|
|
1672
|
-
}());
|
|
1673
|
-
|
|
1674
|
-
var TuiDocHeaderModule = /** @class */ (function () {
|
|
1675
|
-
function TuiDocHeaderModule() {
|
|
1676
|
-
}
|
|
1677
|
-
TuiDocHeaderModule = __decorate([
|
|
1678
|
-
NgModule({
|
|
1679
|
-
imports: [
|
|
1680
|
-
CommonModule,
|
|
1681
|
-
PolymorpheusModule,
|
|
1682
|
-
TuiButtonModule,
|
|
1683
|
-
TuiSidebarModule,
|
|
1684
|
-
TuiActiveZoneModule,
|
|
1685
|
-
TuiDocNavigationModule,
|
|
1686
|
-
],
|
|
1687
|
-
declarations: [TuiDocHeaderComponent],
|
|
1688
|
-
exports: [TuiDocHeaderComponent],
|
|
1689
|
-
})
|
|
1690
|
-
], TuiDocHeaderModule);
|
|
1691
|
-
return TuiDocHeaderModule;
|
|
1692
|
-
}());
|
|
1693
|
-
|
|
1694
|
-
var TuiDocMainModule = /** @class */ (function () {
|
|
1695
|
-
function TuiDocMainModule() {
|
|
1696
|
-
}
|
|
1697
|
-
TuiDocMainModule = __decorate([
|
|
1698
|
-
NgModule({
|
|
1699
|
-
imports: [
|
|
1700
|
-
CommonModule,
|
|
1701
|
-
RouterModule,
|
|
1702
|
-
FormsModule,
|
|
1703
|
-
TuiToggleModule,
|
|
1704
|
-
TuiThemeNightModule,
|
|
1705
|
-
TuiDocHeaderModule,
|
|
1706
|
-
TuiRootModule,
|
|
1707
|
-
TuiDialogModule,
|
|
1708
|
-
TuiAlertModule,
|
|
1709
|
-
TuiDocNavigationModule,
|
|
1710
|
-
],
|
|
1711
|
-
declarations: [TuiDocMainComponent],
|
|
1712
|
-
exports: [TuiDocMainComponent],
|
|
1713
|
-
})
|
|
1714
|
-
], TuiDocMainModule);
|
|
1715
|
-
return TuiDocMainModule;
|
|
1716
|
-
}());
|
|
1717
|
-
|
|
1718
|
-
var TUI_DOC_DEFAULT_TABS = new InjectionToken("Array of default tab names", {
|
|
1719
|
-
factory: function () { return []; },
|
|
1720
|
-
});
|
|
1721
|
-
|
|
1722
|
-
var TUI_DOC_SEE_ALSO = new InjectionToken("Array of arrays of related pages", {
|
|
1723
|
-
factory: function () { return []; },
|
|
1724
|
-
});
|
|
1725
|
-
|
|
1726
|
-
var PAGE_SEE_ALSO = new InjectionToken("Page see also");
|
|
1727
|
-
var PAGE_PROVIDERS = [
|
|
1728
|
-
{
|
|
1729
|
-
provide: PAGE_SEE_ALSO,
|
|
1730
|
-
deps: [ElementRef, TUI_DOC_SEE_ALSO],
|
|
1731
|
-
useFactory: seeAlsoProviderFactory,
|
|
1732
|
-
},
|
|
1733
|
-
];
|
|
1734
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1735
|
-
function seeAlsoProviderFactory(_a, seeAlsoGroups) {
|
|
1736
|
-
var nativeElement = _a.nativeElement;
|
|
1737
|
-
var currentHeader = nativeElement.getAttribute("header");
|
|
1738
|
-
var groups = seeAlsoGroups.filter(function (group) { return group.includes(currentHeader); }) || [];
|
|
1739
|
-
var seeAlsoSet = new Set(groups
|
|
1740
|
-
.join()
|
|
1741
|
-
.split(",")
|
|
1742
|
-
.filter(function (component) { return component && component !== currentHeader; }));
|
|
1743
|
-
return Array.from(seeAlsoSet);
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
var TuiDocPageTabConnectorDirective = /** @class */ (function () {
|
|
1747
|
-
function TuiDocPageTabConnectorDirective(template) {
|
|
1748
|
-
this.template = template;
|
|
1749
|
-
}
|
|
1750
|
-
TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
|
|
1751
|
-
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
1752
|
-
]; };
|
|
1753
|
-
__decorate([
|
|
1754
|
-
Input(),
|
|
1755
|
-
tuiDefaultProp()
|
|
1756
|
-
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1757
|
-
TuiDocPageTabConnectorDirective = __decorate([
|
|
1758
|
-
Directive({
|
|
1759
|
-
selector: "[pageTab]",
|
|
1760
|
-
}),
|
|
1761
|
-
__param(0, Inject(TemplateRef))
|
|
1762
|
-
], TuiDocPageTabConnectorDirective);
|
|
1763
|
-
return TuiDocPageTabConnectorDirective;
|
|
1764
|
-
}());
|
|
1765
|
-
|
|
1766
|
-
// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
|
|
1767
|
-
// @dynamic
|
|
1768
|
-
var TuiDocPageComponent = /** @class */ (function () {
|
|
1769
|
-
function TuiDocPageComponent(deprecated, defaultTabs, seeAlso) {
|
|
1770
|
-
this.deprecated = deprecated;
|
|
1771
|
-
this.defaultTabs = defaultTabs;
|
|
1772
|
-
this.seeAlso = seeAlso;
|
|
1773
|
-
this.header = "";
|
|
1774
|
-
this.package = "";
|
|
1775
|
-
this.type = "";
|
|
1776
|
-
this.path = "";
|
|
1777
|
-
this.tabConnectors = EMPTY_QUERY;
|
|
1778
|
-
this.activeItemIndex = NaN;
|
|
1779
|
-
}
|
|
1780
|
-
Object.defineProperty(TuiDocPageComponent.prototype, "showSeeAlso", {
|
|
1781
|
-
get: function () {
|
|
1782
|
-
return !!this.seeAlso.length && this.activeItemIndex === 0;
|
|
1783
|
-
},
|
|
1784
|
-
enumerable: true,
|
|
1785
|
-
configurable: true
|
|
1786
|
-
});
|
|
1787
|
-
TuiDocPageComponent.prototype.getRouterLink = function (tab) {
|
|
1788
|
-
if (tab === void 0) { tab = ""; }
|
|
1789
|
-
return "./" + tab.replace(/ /g, "_");
|
|
1790
|
-
};
|
|
1791
|
-
TuiDocPageComponent.ctorParameters = function () { return [
|
|
1792
|
-
{ type: String, decorators: [{ type: Attribute, args: ["deprecated",] }] },
|
|
1793
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_DEFAULT_TABS,] }] },
|
|
1794
|
-
{ type: undefined, decorators: [{ type: Inject, args: [PAGE_SEE_ALSO,] }] }
|
|
1795
|
-
]; };
|
|
1796
|
-
__decorate([
|
|
1797
|
-
Input()
|
|
1798
|
-
], TuiDocPageComponent.prototype, "header", void 0);
|
|
1799
|
-
__decorate([
|
|
1800
|
-
Input()
|
|
1801
|
-
], TuiDocPageComponent.prototype, "package", void 0);
|
|
1802
|
-
__decorate([
|
|
1803
|
-
Input()
|
|
1804
|
-
], TuiDocPageComponent.prototype, "type", void 0);
|
|
1805
|
-
__decorate([
|
|
1806
|
-
Input()
|
|
1807
|
-
], TuiDocPageComponent.prototype, "path", void 0);
|
|
1808
|
-
__decorate([
|
|
1809
|
-
ContentChildren(TuiDocPageTabConnectorDirective)
|
|
1810
|
-
], TuiDocPageComponent.prototype, "tabConnectors", void 0);
|
|
1811
|
-
TuiDocPageComponent = __decorate([
|
|
1812
|
-
Component({
|
|
1813
|
-
selector: "tui-doc-page",
|
|
1814
|
-
template: "<header class=\"t-header\">\n <h1 class=\"t-title\">\n {{ header }}\n <tui-tag\n *ngIf=\"deprecated !== null\"\n value=\"deprecated\"\n status=\"custom\"\n class=\"t-tag t-tag_deprecated\"\n ></tui-tag>\n <tui-tag\n *ngIf=\"package\"\n status=\"custom\"\n class=\"t-tag t-tag_package\"\n [value]=\"package\"\n [autoColor]=\"true\"\n ></tui-tag>\n </h1>\n <tui-tabs-with-more\n *ngIf=\"tabConnectors.length\"\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabConnectors; first as first; index as index\">\n <ng-container *ngIf=\"first; else dynamicTab\">\n <a\n *tuiTab\n tuiTab\n routerLink=\"./\"\n routerLinkActive\n [routerLinkActiveOptions]=\"{exact: true}\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-container>\n <ng-template #dynamicTab>\n <a\n *tuiTab\n tuiTab\n routerLinkActive\n [routerLink]=\"getRouterLink(tab.pageTab || defaultTabs[index])\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-template>\n </ng-container>\n </tui-tabs-with-more>\n <tui-doc-source-code\n class=\"t-source-code\"\n [header]=\"header\"\n [package]=\"package\"\n [type]=\"type\"\n [path]=\"path\"\n ></tui-doc-source-code>\n</header>\n<div class=\"t-content\">\n <ng-content></ng-content>\n <tui-doc-see-also\n *ngIf=\"showSeeAlso\"\n class=\"t-see-also\"\n [seeAlso]=\"seeAlso\"\n ></tui-doc-see-also>\n <ng-container *ngFor=\"let tab of tabConnectors; index as index\">\n <ng-container\n *ngIf=\"index === activeItemIndex\"\n [ngTemplateOutlet]=\"tab.template\"\n ></ng-container>\n </ng-container>\n</div>\n",
|
|
1815
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1816
|
-
providers: PAGE_PROVIDERS,
|
|
1817
|
-
styles: [":host{display:flex;flex-direction:column;min-height:0;flex-basis:0;flex-grow:1}.t-header{display:flex;font:var(--tui-font-heading-3);flex-wrap:wrap;min-height:7.25rem;color:var(--tui-text-01);box-shadow:inset 0 -1px 0 0 var(--tui-base-03);padding:3.75rem 0 0;box-sizing:border-box;flex-shrink:0;margin:0 min(10vw,8.75rem)}:host-context(tui-root._mobile) .t-header{font:var(--tui-font-heading-4);min-height:4.5rem;padding:1.25rem 1.25rem 0;margin:0}.t-title{min-width:100%;font-size:inherit;margin:0}.t-tag{vertical-align:middle;text-transform:uppercase;margin-right:.5rem}.t-tag_deprecated{background-color:var(--tui-error-fill)}.t-tag.t-tag_package{color:#000}.t-tabs{flex:1;margin:1.125rem .3125rem 0 0}:host-context(tui-root._mobile) .t-tabs{margin-top:.25rem}.t-content{padding:2rem 0;margin:0 min(10vw,8.75rem)}:host-context(tui-root._mobile) .t-content{padding:2rem 1.25rem;margin:0}.t-see-also{min-width:18.75rem;width:30%;float:right;margin-left:1.5rem}:host-context(tui-root._mobile) .t-see-also{float:none;width:100%;margin:0 0 1.5rem}.t-source-code{align-self:flex-end;line-height:2.75rem}"]
|
|
1818
|
-
}),
|
|
1819
|
-
__param(0, Attribute("deprecated")),
|
|
1820
|
-
__param(1, Inject(TUI_DOC_DEFAULT_TABS)),
|
|
1821
|
-
__param(2, Inject(PAGE_SEE_ALSO))
|
|
1822
|
-
], TuiDocPageComponent);
|
|
1823
|
-
return TuiDocPageComponent;
|
|
1824
|
-
}());
|
|
1825
|
-
|
|
1826
|
-
// @dynamic
|
|
1827
|
-
var TuiDocSeeAlsoComponent = /** @class */ (function () {
|
|
1828
|
-
function TuiDocSeeAlsoComponent(text, pages) {
|
|
1829
|
-
this.text = text;
|
|
1830
|
-
this.pages = pages;
|
|
1831
|
-
this.seeAlso = [];
|
|
1832
|
-
}
|
|
1833
|
-
TuiDocSeeAlsoComponent.prototype.getRouterLink = function (pageTitle) {
|
|
1834
|
-
for (var i = 0; i < this.pages.length; i++) {
|
|
1835
|
-
var page = this.pages
|
|
1836
|
-
.map(function (page) { return ("subPages" in page ? page.subPages : [page]); })
|
|
1837
|
-
.reduce(function (pages, subPages) { return __spread(pages, subPages); }, [])
|
|
1838
|
-
.find(function (page) { return page.title === pageTitle; });
|
|
1839
|
-
if (page === null || page === void 0 ? void 0 : page.route) {
|
|
1840
|
-
return page.route;
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
return "";
|
|
1844
|
-
};
|
|
1845
|
-
TuiDocSeeAlsoComponent.ctorParameters = function () { return [
|
|
1846
|
-
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEE_ALSO_TEXT,] }] },
|
|
1847
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_PAGES,] }] }
|
|
1848
|
-
]; };
|
|
1849
|
-
__decorate([
|
|
1850
|
-
Input()
|
|
1851
|
-
], TuiDocSeeAlsoComponent.prototype, "seeAlso", void 0);
|
|
1852
|
-
TuiDocSeeAlsoComponent = __decorate([
|
|
1853
|
-
Component({
|
|
1854
|
-
selector: "tui-doc-see-also",
|
|
1855
|
-
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 >\n {{ item }}\n </a>\n <ng-container *ngIf=\"!last\">{{ ', ' }}</ng-container>\n</ng-container>\n",
|
|
1856
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1857
|
-
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}"]
|
|
1858
|
-
}),
|
|
1859
|
-
__param(0, Inject(TUI_DOC_SEE_ALSO_TEXT)),
|
|
1860
|
-
__param(1, Inject(TUI_DOC_PAGES))
|
|
1861
|
-
], TuiDocSeeAlsoComponent);
|
|
1862
|
-
return TuiDocSeeAlsoComponent;
|
|
1863
|
-
}());
|
|
1864
|
-
|
|
1865
|
-
var TuiDocSeeAlsoModule = /** @class */ (function () {
|
|
1866
|
-
function TuiDocSeeAlsoModule() {
|
|
1867
|
-
}
|
|
1868
|
-
TuiDocSeeAlsoModule = __decorate([
|
|
1869
|
-
NgModule({
|
|
1870
|
-
imports: [CommonModule, RouterModule, TuiLinkModule],
|
|
1871
|
-
declarations: [TuiDocSeeAlsoComponent],
|
|
1872
|
-
exports: [TuiDocSeeAlsoComponent],
|
|
1873
|
-
})
|
|
1874
|
-
], TuiDocSeeAlsoModule);
|
|
1875
|
-
return TuiDocSeeAlsoModule;
|
|
1876
|
-
}());
|
|
1877
|
-
|
|
1878
|
-
var TUI_DOC_SOURCE_CODE = new InjectionToken("Source code link", {
|
|
1879
|
-
factory: function () { return ""; },
|
|
1880
|
-
});
|
|
1881
|
-
|
|
1882
|
-
var TuiDocSourceCodeComponent = /** @class */ (function () {
|
|
1883
|
-
function TuiDocSourceCodeComponent(sourceCode, text) {
|
|
1884
|
-
this.sourceCode = sourceCode;
|
|
1885
|
-
this.text = text;
|
|
1886
|
-
this.header = "";
|
|
1887
|
-
this.package = "";
|
|
1888
|
-
this.type = "";
|
|
1889
|
-
this.path = "";
|
|
1890
|
-
}
|
|
1891
|
-
Object.defineProperty(TuiDocSourceCodeComponent.prototype, "pathOptions", {
|
|
1892
|
-
get: function () {
|
|
1893
|
-
return this.getPathOptions(this.header, this.package, this.type, this.path);
|
|
1894
|
-
},
|
|
1895
|
-
enumerable: true,
|
|
1896
|
-
configurable: true
|
|
1897
|
-
});
|
|
1898
|
-
TuiDocSourceCodeComponent.prototype.getPathOptions = function (header, packageName, type, path) {
|
|
1899
|
-
return {
|
|
1900
|
-
header: header,
|
|
1901
|
-
package: packageName,
|
|
1902
|
-
type: type,
|
|
1903
|
-
path: path,
|
|
1904
|
-
};
|
|
1905
|
-
};
|
|
1906
|
-
TuiDocSourceCodeComponent.ctorParameters = function () { return [
|
|
1907
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_SOURCE_CODE,] }] },
|
|
1908
|
-
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SOURCE_CODE_TEXT,] }] }
|
|
1909
|
-
]; };
|
|
1910
|
-
__decorate([
|
|
1911
|
-
Input()
|
|
1912
|
-
], TuiDocSourceCodeComponent.prototype, "header", void 0);
|
|
1913
|
-
__decorate([
|
|
1914
|
-
Input()
|
|
1915
|
-
], TuiDocSourceCodeComponent.prototype, "package", void 0);
|
|
1916
|
-
__decorate([
|
|
1917
|
-
Input()
|
|
1918
|
-
], TuiDocSourceCodeComponent.prototype, "type", void 0);
|
|
1919
|
-
__decorate([
|
|
1920
|
-
Input()
|
|
1921
|
-
], TuiDocSourceCodeComponent.prototype, "path", void 0);
|
|
1922
|
-
__decorate([
|
|
1923
|
-
tuiPure
|
|
1924
|
-
], TuiDocSourceCodeComponent.prototype, "getPathOptions", null);
|
|
1925
|
-
TuiDocSourceCodeComponent = __decorate([
|
|
1926
|
-
Component({
|
|
1927
|
-
selector: "tui-doc-source-code",
|
|
1928
|
-
template: "<div\n *ngIf=\"!!sourceCode\"\n polymorpheus-outlet\n [content]=\"sourceCode\"\n [context]=\"pathOptions\"\n>\n <ng-template let-link>\n <a\n *ngIf=\"link\"\n tuiIconButton\n type=\"button\"\n icon=\"tuiIconCodeLarge\"\n appearance=\"icon\"\n target=\"_blank\"\n size=\"s\"\n [title]=\"text\"\n [href]=\"link\"\n ></a>\n </ng-template>\n</div>\n",
|
|
1929
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1930
|
-
}),
|
|
1931
|
-
__param(0, Inject(TUI_DOC_SOURCE_CODE)),
|
|
1932
|
-
__param(1, Inject(TUI_DOC_SOURCE_CODE_TEXT))
|
|
1933
|
-
], TuiDocSourceCodeComponent);
|
|
1934
|
-
return TuiDocSourceCodeComponent;
|
|
1935
|
-
}());
|
|
1936
|
-
|
|
1937
|
-
var TuiDocSourceCodeModule = /** @class */ (function () {
|
|
1938
|
-
function TuiDocSourceCodeModule() {
|
|
1939
|
-
}
|
|
1940
|
-
TuiDocSourceCodeModule = __decorate([
|
|
1941
|
-
NgModule({
|
|
1942
|
-
declarations: [TuiDocSourceCodeComponent],
|
|
1943
|
-
imports: [CommonModule, PolymorpheusModule, TuiButtonModule],
|
|
1944
|
-
exports: [TuiDocSourceCodeComponent],
|
|
1945
|
-
})
|
|
1946
|
-
], TuiDocSourceCodeModule);
|
|
1947
|
-
return TuiDocSourceCodeModule;
|
|
1948
|
-
}());
|
|
1949
|
-
|
|
1950
|
-
var TuiDocPageModule = /** @class */ (function () {
|
|
1951
|
-
function TuiDocPageModule() {
|
|
1952
|
-
}
|
|
1953
|
-
TuiDocPageModule = __decorate([
|
|
1954
|
-
NgModule({
|
|
1955
|
-
imports: [
|
|
1956
|
-
CommonModule,
|
|
1957
|
-
RouterModule,
|
|
1958
|
-
TuiDocSeeAlsoModule,
|
|
1959
|
-
TuiTabsModule,
|
|
1960
|
-
TuiTagModule,
|
|
1961
|
-
TuiDocSourceCodeModule,
|
|
1962
|
-
],
|
|
1963
|
-
declarations: [TuiDocPageComponent, TuiDocPageTabConnectorDirective],
|
|
1964
|
-
exports: [TuiDocPageComponent, TuiDocPageTabConnectorDirective],
|
|
1965
|
-
})
|
|
1966
|
-
], TuiDocPageModule);
|
|
1967
|
-
return TuiDocPageModule;
|
|
1968
|
-
}());
|
|
1969
|
-
|
|
1970
|
-
var TUI_EXAMPLE_PRIMARY_FILE_NAME = {
|
|
1971
|
-
TS: "TypeScript",
|
|
1972
|
-
LESS: "LESS",
|
|
1973
|
-
HTML: "HTML",
|
|
1974
|
-
};
|
|
1975
|
-
|
|
1976
|
-
// TODO: 3.0 remove in ivy compilation
|
|
1977
|
-
var DEMO_TEXTS = ["\u0421\u0434\u0435\u043B\u0430\u043D\u043E \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0434\u0438\u0440\u0435\u043A\u0442\u0438\u0432\u044B: ", "\u0424\u043E\u043D", "\u0414\u0435\u0442\u0430\u043B\u0438 \u0444\u043E\u0440\u043C\u044B"];
|
|
1978
|
-
var DOC_TEXTS = [
|
|
1979
|
-
"\u0410\u0440\u0433\u0443\u043C\u0435\u043D\u0442",
|
|
1980
|
-
"\u0422\u0438\u043F",
|
|
1981
|
-
"\u0418\u043C\u044F \u0438 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435",
|
|
1982
|
-
"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",
|
|
1983
|
-
"\u0414\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B \u0441 \u0434\u0438\u043D\u0430\u043C\u0438\u0447\u0435\u0441\u043A\u0438\u043C\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0430\u043C\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F",
|
|
1984
|
-
];
|
|
1985
|
-
var EXAMPLE_TEXTS = ["\u041F\u0440\u0435\u0432\u044C\u044E", "\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u043F\u0440\u0438\u043C\u0435\u0440 \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0430", "\u0413\u043E\u0442\u043E\u0432\u043E"];
|
|
1986
|
-
var TUI_DOC_RUSSIAN = [
|
|
1987
|
-
{
|
|
1988
|
-
provide: TUI_DOC_DEMO_TEXTS,
|
|
1989
|
-
useValue: DEMO_TEXTS,
|
|
1990
|
-
},
|
|
1991
|
-
{
|
|
1992
|
-
provide: TUI_DOC_DOCUMENTATION_TEXTS,
|
|
1993
|
-
useValue: DOC_TEXTS,
|
|
1994
|
-
},
|
|
1995
|
-
{
|
|
1996
|
-
provide: TUI_DOC_EXAMPLE_TEXTS,
|
|
1997
|
-
useValue: EXAMPLE_TEXTS,
|
|
1998
|
-
},
|
|
1999
|
-
{
|
|
2000
|
-
provide: TUI_DOC_MENU_TEXT,
|
|
2001
|
-
useValue: "\u041C\u0435\u043D\u044E",
|
|
2002
|
-
},
|
|
2003
|
-
{
|
|
2004
|
-
provide: TUI_DOC_SEARCH_TEXT,
|
|
2005
|
-
useValue: "\u041F\u043E\u0438\u0441\u043A",
|
|
2006
|
-
},
|
|
2007
|
-
{
|
|
2008
|
-
provide: TUI_DOC_SEE_ALSO_TEXT,
|
|
2009
|
-
useValue: "\u0421\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0442\u0430\u043A\u0436\u0435",
|
|
2010
|
-
},
|
|
2011
|
-
{
|
|
2012
|
-
provide: TUI_DOC_SOURCE_CODE_TEXT,
|
|
2013
|
-
useValue: "\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434",
|
|
2014
|
-
},
|
|
2015
|
-
];
|
|
2016
|
-
|
|
2017
|
-
var TuiAddonDocModule = /** @class */ (function () {
|
|
2018
|
-
function TuiAddonDocModule() {
|
|
2019
|
-
}
|
|
2020
|
-
TuiAddonDocModule = __decorate([
|
|
2021
|
-
NgModule({
|
|
2022
|
-
exports: [
|
|
2023
|
-
TuiDocCodeModule,
|
|
2024
|
-
TuiDocDemoModule,
|
|
2025
|
-
TuiDocDocumentationModule,
|
|
2026
|
-
TuiDocPageModule,
|
|
2027
|
-
TuiDocExampleModule,
|
|
2028
|
-
],
|
|
2029
|
-
})
|
|
2030
|
-
], TuiAddonDocModule);
|
|
2031
|
-
return TuiAddonDocModule;
|
|
2032
|
-
}());
|
|
2033
|
-
|
|
2034
|
-
/**
|
|
2035
|
-
* @deprecated: use {@link tuiGenerateRoutes} instead
|
|
2036
|
-
* Generates typical page routing structure
|
|
2037
|
-
*/
|
|
2038
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2039
|
-
function generateRoutes(type) {
|
|
2040
|
-
return [
|
|
2041
|
-
{
|
|
2042
|
-
path: "",
|
|
2043
|
-
component: type,
|
|
2044
|
-
children: [
|
|
2045
|
-
{
|
|
2046
|
-
path: ":tab",
|
|
2047
|
-
component: type,
|
|
2048
|
-
},
|
|
2049
|
-
],
|
|
2050
|
-
},
|
|
2051
|
-
];
|
|
2052
|
-
}
|
|
2053
|
-
var tuiGenerateRoutes = generateRoutes;
|
|
2054
|
-
|
|
2055
|
-
/**
|
|
2056
|
-
* Public API Surface of @taiga-ui/addon-doc
|
|
2057
|
-
*/
|
|
2058
|
-
|
|
2059
|
-
/**
|
|
2060
|
-
* Generated bundle index. Do not edit.
|
|
2061
|
-
*/
|
|
2062
|
-
|
|
2063
|
-
export { DEMO_TEXTS, DOC_TEXTS, EXAMPLE_TEXTS, ScrollIntoViewDirective, ScrollIntoViewModule, TUI_DOC_CODE_ACTIONS, TUI_DOC_CODE_EDITOR, TUI_DOC_DEFAULT_TABS, TUI_DOC_DEMO_TEXTS, TUI_DOC_DOCUMENTATION_TEXTS, TUI_DOC_EXAMPLE_CONTENT_PROCESSOR, TUI_DOC_EXAMPLE_TEXTS, TUI_DOC_LOGO, TUI_DOC_MENU_TEXT, TUI_DOC_PAGES, TUI_DOC_PAGE_LOADED, TUI_DOC_RUSSIAN, TUI_DOC_SCROLL_BEHAVIOR, TUI_DOC_SEARCH_TEXT, TUI_DOC_SEE_ALSO, TUI_DOC_SEE_ALSO_TEXT, TUI_DOC_SOURCE_CODE, TUI_DOC_SOURCE_CODE_TEXT, TUI_DOC_TITLE, TUI_EXAMPLE_PRIMARY_FILE_NAME, TuiAddonDocModule, TuiDocCodeComponent, TuiDocCodeModule, TuiDocCopyComponent, TuiDocCopyModule, TuiDocDemoComponent, TuiDocDemoModule, TuiDocDocumentationComponent, TuiDocDocumentationModule, TuiDocDocumentationPropertyConnectorDirective, TuiDocExampleComponent, TuiDocExampleModule, TuiDocMainComponent, TuiDocMainModule, TuiDocNavigationComponent, TuiDocNavigationModule, TuiDocPageComponent, TuiDocPageModule, TuiDocPageTabConnectorDirective, TuiLanguageSwitcherComponent, TuiLanguageSwitcherModule, TuiScrollIntoViewLinkDirective, TuiScrollIntoViewLinkModule, coerceValue, generateRoutes, rawLoad, rawLoadRecord, tryParseMarkdownCodeBlock, tuiCoerceValue, tuiGenerateRoutes, tuiRawLoad, tuiRawLoadRecord, tuiTryParseMarkdownCodeBlock, TuiInputOpacityModule as ɵa, TuiInputOpacityDirective as ɵb, TuiDocExampleGetTabsPipe as ɵc, TuiDocExampleCapitalizePipe as ɵd, TuiDocHeaderModule as ɵe, NAVIGATION_TITLE as ɵf, NAVIGATION_LABELS as ɵg, NAVIGATION_ITEMS as ɵh, NAVIGATION_PROVIDERS as ɵi, titleProviderFactory as ɵj, labelsProviderFactory as ɵk, itemsProviderFactory as ɵl, TuiDocHeaderComponent as ɵm, PAGE_SEE_ALSO as ɵn, PAGE_PROVIDERS as ɵo, seeAlsoProviderFactory as ɵp, TuiDocSeeAlsoModule as ɵq, TuiDocSeeAlsoComponent as ɵr, TuiDocSourceCodeModule as ɵs, TuiDocSourceCodeComponent as ɵt };
|
|
2064
|
-
//# sourceMappingURL=taiga-ui-addon-doc.js.map
|