@taiga-ui/addon-doc 2.54.1 → 2.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-addon-doc.umd.js +241 -225
- package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-doc.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-doc.umd.min.js.map +1 -1
- package/components/example/example.component.d.ts +7 -1
- package/esm2015/components/code/code.component.js +5 -5
- package/esm2015/components/code/parse-code-block.js +3 -3
- package/esm2015/components/copy/copy.component.js +2 -2
- package/esm2015/components/demo/demo.component.js +12 -12
- package/esm2015/components/documentation/documentation-property-connector.directive.js +11 -11
- package/esm2015/components/documentation/documentation.component.js +30 -30
- package/esm2015/components/example/example-capitalize.pipe.js +3 -3
- package/esm2015/components/example/example-get-tabs.pipe.js +2 -2
- package/esm2015/components/example/example.component.js +29 -11
- package/esm2015/components/main/main.component.js +8 -8
- package/esm2015/components/navigation/navigation.component.js +16 -16
- package/esm2015/components/navigation/navigation.providers.js +4 -4
- package/esm2015/components/page/page-tab.directive.js +2 -2
- package/esm2015/components/page/page.component.js +10 -10
- package/esm2015/components/page/page.providers.js +4 -4
- package/esm2015/directives/scroll-into-view/scroll-into-view.directive.js +3 -3
- package/esm2015/interfaces/page.js +4 -4
- package/esm2015/internal/header/header.component.js +3 -3
- package/esm2015/internal/input-opacity/input-opacity.directive.js +3 -3
- package/esm2015/internal/see-also/see-also.component.js +4 -4
- package/esm2015/internal/source-code/source-code.component.js +6 -6
- package/esm2015/languages/russian.js +12 -12
- package/esm2015/tokens/code-actions.js +3 -3
- package/esm2015/tokens/code-editor.js +2 -2
- package/esm2015/tokens/default-tabs.js +2 -2
- package/esm2015/tokens/example-content-processor.js +2 -2
- package/esm2015/tokens/i18n.js +19 -19
- package/esm2015/tokens/logo.js +3 -3
- package/esm2015/tokens/page-loaded.js +2 -2
- package/esm2015/tokens/pages.js +2 -2
- package/esm2015/tokens/scroll-behavior.js +2 -2
- package/esm2015/tokens/see-also.js +2 -2
- package/esm2015/tokens/source-code.js +3 -3
- package/esm2015/tokens/title.js +3 -3
- package/esm2015/utils/coerce-value.js +6 -6
- package/esm2015/utils/color-conversion.js +5 -5
- package/esm2015/utils/generate-routes.js +3 -3
- package/esm2015/utils/inspect.js +13 -13
- package/esm2015/utils/transliterate-keyboard-layout.js +34 -34
- package/esm5/components/code/code.component.js +5 -5
- package/esm5/components/code/parse-code-block.js +3 -3
- package/esm5/components/copy/copy.component.js +2 -2
- package/esm5/components/demo/demo.component.js +12 -12
- package/esm5/components/documentation/documentation-property-connector.directive.js +11 -11
- package/esm5/components/documentation/documentation.component.js +30 -30
- package/esm5/components/example/example-capitalize.pipe.js +3 -3
- package/esm5/components/example/example-get-tabs.pipe.js +2 -2
- package/esm5/components/example/example.component.js +29 -11
- package/esm5/components/main/main.component.js +8 -8
- package/esm5/components/navigation/navigation.component.js +16 -16
- package/esm5/components/navigation/navigation.providers.js +4 -4
- package/esm5/components/page/page-tab.directive.js +2 -2
- package/esm5/components/page/page.component.js +10 -10
- package/esm5/components/page/page.providers.js +4 -4
- package/esm5/directives/scroll-into-view/scroll-into-view.directive.js +3 -3
- package/esm5/interfaces/page.js +4 -4
- package/esm5/internal/header/header.component.js +3 -3
- package/esm5/internal/input-opacity/input-opacity.directive.js +3 -3
- package/esm5/internal/see-also/see-also.component.js +4 -4
- package/esm5/internal/source-code/source-code.component.js +6 -6
- package/esm5/languages/russian.js +12 -12
- package/esm5/tokens/code-actions.js +3 -3
- package/esm5/tokens/code-editor.js +2 -2
- package/esm5/tokens/default-tabs.js +2 -2
- package/esm5/tokens/example-content-processor.js +2 -2
- package/esm5/tokens/i18n.js +19 -19
- package/esm5/tokens/logo.js +3 -3
- package/esm5/tokens/page-loaded.js +2 -2
- package/esm5/tokens/pages.js +2 -2
- package/esm5/tokens/scroll-behavior.js +2 -2
- package/esm5/tokens/see-also.js +2 -2
- package/esm5/tokens/source-code.js +3 -3
- package/esm5/tokens/title.js +3 -3
- package/esm5/utils/coerce-value.js +6 -6
- package/esm5/utils/color-conversion.js +5 -5
- package/esm5/utils/generate-routes.js +3 -3
- package/esm5/utils/inspect.js +13 -13
- package/esm5/utils/transliterate-keyboard-layout.js +34 -34
- package/fesm2015/taiga-ui-addon-doc.js +241 -225
- package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
- package/fesm5/taiga-ui-addon-doc.js +241 -225
- package/fesm5/taiga-ui-addon-doc.js.map +1 -1
- package/package.json +5 -5
- package/taiga-ui-addon-doc.metadata.json +1 -1
|
@@ -47,12 +47,12 @@ var tuiRawLoad = rawLoad;
|
|
|
47
47
|
*/
|
|
48
48
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
49
49
|
function tryParseMarkdownCodeBlock(text) {
|
|
50
|
-
if (text === void 0) { text =
|
|
50
|
+
if (text === void 0) { text = ""; }
|
|
51
51
|
var tokens = new MarkdownIt().parse(text, {});
|
|
52
52
|
var result = tokens
|
|
53
53
|
.filter(function (_a) {
|
|
54
54
|
var tag = _a.tag, type = _a.type;
|
|
55
|
-
return tag ===
|
|
55
|
+
return tag === "code" && type === "fence";
|
|
56
56
|
})
|
|
57
57
|
.map(function (_a) {
|
|
58
58
|
var content = _a.content;
|
|
@@ -64,8 +64,8 @@ var tuiTryParseMarkdownCodeBlock = tryParseMarkdownCodeBlock;
|
|
|
64
64
|
|
|
65
65
|
var TuiDocCodeComponent = /** @class */ (function () {
|
|
66
66
|
function TuiDocCodeComponent() {
|
|
67
|
-
this.rawLoader$$ = new BehaviorSubject(
|
|
68
|
-
this.filename =
|
|
67
|
+
this.rawLoader$$ = new BehaviorSubject("");
|
|
68
|
+
this.filename = "";
|
|
69
69
|
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad), map(tryParseMarkdownCodeBlock));
|
|
70
70
|
}
|
|
71
71
|
Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
|
|
@@ -89,11 +89,11 @@ var TuiDocCodeComponent = /** @class */ (function () {
|
|
|
89
89
|
Input()
|
|
90
90
|
], TuiDocCodeComponent.prototype, "code", null);
|
|
91
91
|
__decorate([
|
|
92
|
-
HostBinding(
|
|
92
|
+
HostBinding("class._has-filename")
|
|
93
93
|
], TuiDocCodeComponent.prototype, "hasFilename", null);
|
|
94
94
|
TuiDocCodeComponent = __decorate([
|
|
95
95
|
Component({
|
|
96
|
-
selector:
|
|
96
|
+
selector: "tui-doc-code",
|
|
97
97
|
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",
|
|
98
98
|
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}"]
|
|
99
99
|
})
|
|
@@ -139,7 +139,7 @@ var TuiDocCopyComponent = /** @class */ (function () {
|
|
|
139
139
|
], TuiDocCopyComponent.prototype, "copied$", null);
|
|
140
140
|
TuiDocCopyComponent = __decorate([
|
|
141
141
|
Component({
|
|
142
|
-
selector:
|
|
142
|
+
selector: "tui-doc-copy",
|
|
143
143
|
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",
|
|
144
144
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
145
145
|
providers: [TuiDestroyService],
|
|
@@ -170,8 +170,8 @@ var TuiDocCopyModule = /** @class */ (function () {
|
|
|
170
170
|
* Works with a tuple
|
|
171
171
|
* [@string tuiMode tooltip content, @string word 'background', @string 'form value']
|
|
172
172
|
*/
|
|
173
|
-
var TUI_DOC_DEMO_TEXTS = new InjectionToken(
|
|
174
|
-
factory: function () { return [
|
|
173
|
+
var TUI_DOC_DEMO_TEXTS = new InjectionToken("tui-doc-demo i18n texts", {
|
|
174
|
+
factory: function () { return ["Read more more about modes: ", "Background", "Form value"]; },
|
|
175
175
|
});
|
|
176
176
|
/**
|
|
177
177
|
* Works with a tuple
|
|
@@ -183,13 +183,13 @@ var TUI_DOC_DEMO_TEXTS = new InjectionToken('tui-doc-demo i18n texts', {
|
|
|
183
183
|
* @string message for tooltip about ng-polymorpheus
|
|
184
184
|
* ]
|
|
185
185
|
*/
|
|
186
|
-
var TUI_DOC_DOCUMENTATION_TEXTS = new InjectionToken(
|
|
186
|
+
var TUI_DOC_DOCUMENTATION_TEXTS = new InjectionToken("tui-doc-documentation i18n texts", {
|
|
187
187
|
factory: function () { return [
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
"Argument",
|
|
189
|
+
"Type",
|
|
190
|
+
"Name and description",
|
|
191
|
+
"Value",
|
|
192
|
+
"Learn about our dynamic templates from ",
|
|
193
193
|
]; },
|
|
194
194
|
});
|
|
195
195
|
/**
|
|
@@ -200,20 +200,20 @@ var TUI_DOC_DOCUMENTATION_TEXTS = new InjectionToken('tui-doc-documentation i18n
|
|
|
200
200
|
* @string link to a sample copied message label
|
|
201
201
|
* ]
|
|
202
202
|
*/
|
|
203
|
-
var TUI_DOC_EXAMPLE_TEXTS = new InjectionToken(
|
|
204
|
-
factory: function () { return [
|
|
203
|
+
var TUI_DOC_EXAMPLE_TEXTS = new InjectionToken("tui-doc-example i18n texts", {
|
|
204
|
+
factory: function () { return ["Preview", "Link to a sample was successfully copied", "Done"]; },
|
|
205
205
|
});
|
|
206
|
-
var TUI_DOC_MENU_TEXT = new InjectionToken(
|
|
207
|
-
factory: function () { return
|
|
206
|
+
var TUI_DOC_MENU_TEXT = new InjectionToken("menu i18n text", {
|
|
207
|
+
factory: function () { return "Menu"; },
|
|
208
208
|
});
|
|
209
|
-
var TUI_DOC_SEARCH_TEXT = new InjectionToken(
|
|
210
|
-
factory: function () { return
|
|
209
|
+
var TUI_DOC_SEARCH_TEXT = new InjectionToken("search i18n text", {
|
|
210
|
+
factory: function () { return "Search"; },
|
|
211
211
|
});
|
|
212
|
-
var TUI_DOC_SEE_ALSO_TEXT = new InjectionToken(
|
|
213
|
-
factory: function () { return
|
|
212
|
+
var TUI_DOC_SEE_ALSO_TEXT = new InjectionToken("tui-doc-see-also i18n text", {
|
|
213
|
+
factory: function () { return "See also"; },
|
|
214
214
|
});
|
|
215
|
-
var TUI_DOC_SOURCE_CODE_TEXT = new InjectionToken(
|
|
216
|
-
factory: function () { return
|
|
215
|
+
var TUI_DOC_SOURCE_CODE_TEXT = new InjectionToken("tui-doc-source-code i18n text", {
|
|
216
|
+
factory: function () { return "Source code"; },
|
|
217
217
|
});
|
|
218
218
|
|
|
219
219
|
var MIN_COMPONENT_WIDTH = 104;
|
|
@@ -229,14 +229,14 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
229
229
|
this.wrapperWidth = 0;
|
|
230
230
|
this.control = null;
|
|
231
231
|
this.template = null;
|
|
232
|
-
this.updateOnVariants = [
|
|
233
|
-
this.updateOn =
|
|
232
|
+
this.updateOnVariants = ["change", "blur", "submit"];
|
|
233
|
+
this.updateOn = "change";
|
|
234
234
|
this.expanded = false;
|
|
235
235
|
this.opaque = true;
|
|
236
236
|
this.modeControl = new FormControl();
|
|
237
237
|
this.mode = null;
|
|
238
238
|
this.change$ = new Subject();
|
|
239
|
-
this.items = [
|
|
239
|
+
this.items = ["onLight", "onDark"];
|
|
240
240
|
this.isBrowser = isPlatformBrowser(platformId);
|
|
241
241
|
var parsedMode = locationRef.path().match(/tuiMode=(onDark|onLight)/);
|
|
242
242
|
if (parsedMode !== null && parsedMode.length > 0) {
|
|
@@ -268,9 +268,9 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
268
268
|
}
|
|
269
269
|
var paddingLeft = this.isBrowser
|
|
270
270
|
? getComputedStyle(this.content.nativeElement).paddingLeft
|
|
271
|
-
:
|
|
271
|
+
: "0";
|
|
272
272
|
var offsetWidth = this.content.nativeElement.offsetWidth;
|
|
273
|
-
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft ||
|
|
273
|
+
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || "0", 10) * 2);
|
|
274
274
|
};
|
|
275
275
|
TuiDocDemoComponent.prototype.onDragStart = function (event) {
|
|
276
276
|
event.preventDefault();
|
|
@@ -303,7 +303,7 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
303
303
|
if (!this.wrapper) {
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
this.renderer.setStyle(this.wrapper.nativeElement,
|
|
306
|
+
this.renderer.setStyle(this.wrapper.nativeElement, "width", px(Math.max(this.wrapperWidth - delta, MIN_COMPONENT_WIDTH)));
|
|
307
307
|
};
|
|
308
308
|
var TuiDocDemoComponent_1;
|
|
309
309
|
TuiDocDemoComponent.ctorParameters = function () { return [
|
|
@@ -316,13 +316,13 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
316
316
|
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
|
|
317
317
|
]; };
|
|
318
318
|
__decorate([
|
|
319
|
-
ViewChild(
|
|
319
|
+
ViewChild("content")
|
|
320
320
|
], TuiDocDemoComponent.prototype, "content", void 0);
|
|
321
321
|
__decorate([
|
|
322
|
-
ViewChild(
|
|
322
|
+
ViewChild("wrapper")
|
|
323
323
|
], TuiDocDemoComponent.prototype, "wrapper", void 0);
|
|
324
324
|
__decorate([
|
|
325
|
-
ViewChild(
|
|
325
|
+
ViewChild("resizerText")
|
|
326
326
|
], TuiDocDemoComponent.prototype, "resizerText", void 0);
|
|
327
327
|
__decorate([
|
|
328
328
|
Input()
|
|
@@ -331,11 +331,11 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
331
331
|
ContentChild(TemplateRef)
|
|
332
332
|
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
333
333
|
__decorate([
|
|
334
|
-
HostListener(
|
|
334
|
+
HostListener("window:resize")
|
|
335
335
|
], TuiDocDemoComponent.prototype, "onResize", null);
|
|
336
336
|
TuiDocDemoComponent = TuiDocDemoComponent_1 = __decorate([
|
|
337
337
|
Component({
|
|
338
|
-
selector:
|
|
338
|
+
selector: "tui-doc-demo",
|
|
339
339
|
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",
|
|
340
340
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
341
341
|
providers: [
|
|
@@ -398,7 +398,7 @@ var TuiDocDemoModule = /** @class */ (function () {
|
|
|
398
398
|
*/
|
|
399
399
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
400
400
|
function rgbToHex(r, g, b) {
|
|
401
|
-
return "#" + [r, g, b].map(function (x) { return x.toString(16).padStart(2,
|
|
401
|
+
return "#" + [r, g, b].map(function (x) { return x.toString(16).padStart(2, "0"); }).join("");
|
|
402
402
|
}
|
|
403
403
|
var tuiRgbToHex = rgbToHex;
|
|
404
404
|
/**
|
|
@@ -407,10 +407,10 @@ var tuiRgbToHex = rgbToHex;
|
|
|
407
407
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
408
408
|
function hexToRgb(hex) {
|
|
409
409
|
var matches = hex
|
|
410
|
-
.replace(
|
|
411
|
-
.split(
|
|
410
|
+
.replace("#", "")
|
|
411
|
+
.split("")
|
|
412
412
|
.map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
|
|
413
|
-
.join(
|
|
413
|
+
.join("")
|
|
414
414
|
.match(/.{2}/g);
|
|
415
415
|
return matches
|
|
416
416
|
? matches.map(function (x) { return Number.parseInt(x, 16); })
|
|
@@ -420,18 +420,18 @@ var tuiHexToRgb = hexToRgb;
|
|
|
420
420
|
|
|
421
421
|
function inspectArray(array, depth) {
|
|
422
422
|
if (depth === 0) {
|
|
423
|
-
return
|
|
423
|
+
return "[\u2026]";
|
|
424
424
|
}
|
|
425
|
-
var result =
|
|
425
|
+
var result = "";
|
|
426
426
|
var first = true;
|
|
427
427
|
for (var index = 0; index < array.length; index++) {
|
|
428
428
|
if (first) {
|
|
429
429
|
first = false;
|
|
430
430
|
}
|
|
431
431
|
else {
|
|
432
|
-
result +=
|
|
432
|
+
result += ", ";
|
|
433
433
|
}
|
|
434
|
-
result += index in array ? inspectAny(array[index], depth - 1) :
|
|
434
|
+
result += index in array ? inspectAny(array[index], depth - 1) : "empty";
|
|
435
435
|
}
|
|
436
436
|
return "[" + result + "]";
|
|
437
437
|
}
|
|
@@ -439,7 +439,7 @@ function inspectObject(object, depth) {
|
|
|
439
439
|
if (depth === 0) {
|
|
440
440
|
return "{\u2026}";
|
|
441
441
|
}
|
|
442
|
-
var result =
|
|
442
|
+
var result = "";
|
|
443
443
|
var first = true;
|
|
444
444
|
for (var key in object) {
|
|
445
445
|
if (!object.hasOwnProperty(key)) {
|
|
@@ -449,7 +449,7 @@ function inspectObject(object, depth) {
|
|
|
449
449
|
first = false;
|
|
450
450
|
}
|
|
451
451
|
else {
|
|
452
|
-
result +=
|
|
452
|
+
result += ", ";
|
|
453
453
|
}
|
|
454
454
|
result += key + ": " + inspectAny(object[key], depth - 1);
|
|
455
455
|
}
|
|
@@ -465,15 +465,15 @@ function inspectObject(object, depth) {
|
|
|
465
465
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
466
466
|
function inspectAny(data, depth) {
|
|
467
467
|
if (data === null) {
|
|
468
|
-
return
|
|
468
|
+
return "null";
|
|
469
469
|
}
|
|
470
470
|
switch (typeof data) {
|
|
471
|
-
case
|
|
471
|
+
case "string":
|
|
472
472
|
return "'" + data + "'";
|
|
473
|
-
case
|
|
474
|
-
case
|
|
475
|
-
case
|
|
476
|
-
case
|
|
473
|
+
case "undefined":
|
|
474
|
+
case "number":
|
|
475
|
+
case "boolean":
|
|
476
|
+
case "function":
|
|
477
477
|
return String(data);
|
|
478
478
|
}
|
|
479
479
|
if (data instanceof RegExp) {
|
|
@@ -496,7 +496,7 @@ function coerceValue(value) {
|
|
|
496
496
|
return null;
|
|
497
497
|
}
|
|
498
498
|
else if (isBooleanParamValue(prepared)) {
|
|
499
|
-
return String(prepared) ===
|
|
499
|
+
return String(prepared) === "true";
|
|
500
500
|
}
|
|
501
501
|
else if (isNumberParamValue(prepared)) {
|
|
502
502
|
return Number(prepared);
|
|
@@ -513,10 +513,10 @@ function coerceValue(value) {
|
|
|
513
513
|
}
|
|
514
514
|
var tuiCoerceValue = coerceValue;
|
|
515
515
|
function isEmptyParamValue(value) {
|
|
516
|
-
return [
|
|
516
|
+
return ["undefined", "null", "NaN", "Infinity"].includes(value);
|
|
517
517
|
}
|
|
518
518
|
function isBooleanParamValue(value) {
|
|
519
|
-
return value ===
|
|
519
|
+
return value === "true" || value === "false";
|
|
520
520
|
}
|
|
521
521
|
function isNumberParamValue(value) {
|
|
522
522
|
// TODO: investigate to disallow potentially catastrophic exponential-time regular expressions.
|
|
@@ -524,13 +524,13 @@ function isNumberParamValue(value) {
|
|
|
524
524
|
return /^-?[\d.]+(?:e-?\d+)?$/.test(value);
|
|
525
525
|
}
|
|
526
526
|
function isPossibleArray(value) {
|
|
527
|
-
return value.startsWith(
|
|
527
|
+
return value.startsWith("[") && value.endsWith("]");
|
|
528
528
|
}
|
|
529
529
|
function isPossibleObject(value) {
|
|
530
|
-
return value.startsWith(
|
|
530
|
+
return value.startsWith("{") && value.endsWith("}");
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
var SERIALIZED_SUFFIX =
|
|
533
|
+
var SERIALIZED_SUFFIX = "$";
|
|
534
534
|
// @bad TODO: refactor output and value sync
|
|
535
535
|
var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
536
536
|
function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
|
|
@@ -538,9 +538,9 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
538
538
|
this.locationRef = locationRef;
|
|
539
539
|
this.activatedRoute = activatedRoute;
|
|
540
540
|
this.urlSerializer = urlSerializer;
|
|
541
|
-
this.documentationPropertyName =
|
|
541
|
+
this.documentationPropertyName = "";
|
|
542
542
|
this.documentationPropertyMode = null;
|
|
543
|
-
this.documentationPropertyType =
|
|
543
|
+
this.documentationPropertyType = "";
|
|
544
544
|
this.documentationPropertyDeprecated = false;
|
|
545
545
|
this.documentationPropertyValues = null;
|
|
546
546
|
this.documentationPropertyValueChange = new EventEmitter();
|
|
@@ -553,11 +553,11 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
553
553
|
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
|
|
554
554
|
get: function () {
|
|
555
555
|
switch (this.documentationPropertyMode) {
|
|
556
|
-
case
|
|
556
|
+
case "input":
|
|
557
557
|
return "[" + this.documentationPropertyName + "]";
|
|
558
|
-
case
|
|
558
|
+
case "output":
|
|
559
559
|
return "(" + this.documentationPropertyName + ")";
|
|
560
|
-
case
|
|
560
|
+
case "input-output":
|
|
561
561
|
return "[(" + this.documentationPropertyName + ")]";
|
|
562
562
|
default:
|
|
563
563
|
return this.documentationPropertyName;
|
|
@@ -575,7 +575,7 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
575
575
|
});
|
|
576
576
|
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
|
|
577
577
|
get: function () {
|
|
578
|
-
return this.documentationPropertyMode !==
|
|
578
|
+
return this.documentationPropertyMode !== "output";
|
|
579
579
|
},
|
|
580
580
|
enumerable: true,
|
|
581
581
|
configurable: true
|
|
@@ -611,7 +611,7 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
611
611
|
var computedValue = isValueAvailableByKey && this.documentationPropertyValues
|
|
612
612
|
? this.documentationPropertyValues.indexOf(value)
|
|
613
613
|
: value;
|
|
614
|
-
var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX :
|
|
614
|
+
var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : "";
|
|
615
615
|
var propName = this.documentationPropertyName + suffix;
|
|
616
616
|
tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
|
|
617
617
|
this.locationRef.go(String(tree));
|
|
@@ -645,8 +645,8 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
645
645
|
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
|
|
646
646
|
TuiDocDocumentationPropertyConnectorDirective = __decorate([
|
|
647
647
|
Directive({
|
|
648
|
-
selector:
|
|
649
|
-
exportAs:
|
|
648
|
+
selector: "ng-template[documentationPropertyName]",
|
|
649
|
+
exportAs: "documentationProperty",
|
|
650
650
|
}),
|
|
651
651
|
__param(0, Inject(TemplateRef)),
|
|
652
652
|
__param(1, Inject(Location$1)),
|
|
@@ -663,7 +663,7 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
|
663
663
|
function TuiDocDocumentationComponent(changeDetectorRef, texts) {
|
|
664
664
|
this.changeDetectorRef = changeDetectorRef;
|
|
665
665
|
this.texts = texts;
|
|
666
|
-
this.heading =
|
|
666
|
+
this.heading = "";
|
|
667
667
|
this.showValues = true;
|
|
668
668
|
this.isAPI = false;
|
|
669
669
|
this.propertiesConnectors = EMPTY_QUERY;
|
|
@@ -687,71 +687,71 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
|
687
687
|
TuiDocDocumentationComponent.prototype.getColor = function (color) {
|
|
688
688
|
if (color.length === 4) {
|
|
689
689
|
return color
|
|
690
|
-
.split(
|
|
690
|
+
.split("")
|
|
691
691
|
.reduce(function (result, current) { return __spread(result, [current, current]); }, [])
|
|
692
|
-
.join(
|
|
693
|
-
.replace(
|
|
692
|
+
.join("")
|
|
693
|
+
.replace("#", "");
|
|
694
694
|
}
|
|
695
|
-
if (color.startsWith(
|
|
695
|
+
if (color.startsWith("#")) {
|
|
696
696
|
return color;
|
|
697
697
|
}
|
|
698
|
-
if (color ===
|
|
699
|
-
return
|
|
698
|
+
if (color === "transparent") {
|
|
699
|
+
return "#000000";
|
|
700
700
|
}
|
|
701
701
|
var parsed = color
|
|
702
|
-
.replace(
|
|
703
|
-
.replace(
|
|
704
|
-
.replace(
|
|
705
|
-
.replace(
|
|
706
|
-
.split(
|
|
702
|
+
.replace("rgb(", "")
|
|
703
|
+
.replace("rgba(", "")
|
|
704
|
+
.replace(")", "")
|
|
705
|
+
.replace(" ", "")
|
|
706
|
+
.split(",")
|
|
707
707
|
.map(function (v) { return Number.parseInt(v, 10); });
|
|
708
708
|
return rgbToHex.apply(void 0, __spread(parsed));
|
|
709
709
|
};
|
|
710
710
|
TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
|
|
711
|
-
if (color.startsWith(
|
|
711
|
+
if (color.startsWith("#") || color.startsWith("rgb(")) {
|
|
712
712
|
return 100;
|
|
713
713
|
}
|
|
714
|
-
if (color ===
|
|
714
|
+
if (color === "transparent") {
|
|
715
715
|
return 0;
|
|
716
716
|
}
|
|
717
|
-
var lastComma = color.lastIndexOf(
|
|
717
|
+
var lastComma = color.lastIndexOf(",");
|
|
718
718
|
var parsed = color
|
|
719
719
|
.slice(lastComma)
|
|
720
|
-
.replace(
|
|
721
|
-
.replace(
|
|
722
|
-
.replace(
|
|
720
|
+
.replace(")", "")
|
|
721
|
+
.replace(" ", "")
|
|
722
|
+
.replace(",", "");
|
|
723
723
|
return Math.round(Number.parseFloat(parsed) * 100);
|
|
724
724
|
};
|
|
725
725
|
TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
|
|
726
|
-
var opacity = this.getOpacity(connector.documentationPropertyValue ||
|
|
726
|
+
var opacity = this.getOpacity(connector.documentationPropertyValue || "");
|
|
727
727
|
if (opacity === 100) {
|
|
728
728
|
connector.onValueChange(color);
|
|
729
729
|
return;
|
|
730
730
|
}
|
|
731
|
-
var rgb = hexToRgb(color).join(
|
|
731
|
+
var rgb = hexToRgb(color).join(", ");
|
|
732
732
|
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
733
733
|
connector.onValueChange(result);
|
|
734
734
|
};
|
|
735
735
|
TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
|
|
736
|
-
var hex = this.getColor(connector.documentationPropertyValue ||
|
|
736
|
+
var hex = this.getColor(connector.documentationPropertyValue || "");
|
|
737
737
|
var rgb = hexToRgb(hex);
|
|
738
738
|
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
739
739
|
connector.onValueChange(result);
|
|
740
740
|
};
|
|
741
741
|
TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
|
|
742
|
-
return name.replace(
|
|
742
|
+
return name.replace("?", "");
|
|
743
743
|
};
|
|
744
744
|
TuiDocDocumentationComponent.prototype.isOptional = function (name) {
|
|
745
|
-
return name.includes(
|
|
745
|
+
return name.includes("?");
|
|
746
746
|
};
|
|
747
747
|
TuiDocDocumentationComponent.prototype.isPrimitivePolymorpheusContent = function (value) {
|
|
748
|
-
return typeof value ===
|
|
748
|
+
return typeof value === "string" || typeof value === "number";
|
|
749
749
|
};
|
|
750
750
|
TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
|
|
751
|
-
return type.includes(
|
|
751
|
+
return type.includes("null");
|
|
752
752
|
};
|
|
753
753
|
TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
|
|
754
|
-
return type.includes(
|
|
754
|
+
return type.includes("PolymorpheusContent");
|
|
755
755
|
};
|
|
756
756
|
TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
|
|
757
757
|
return inspectAny(data, 2);
|
|
@@ -774,12 +774,12 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
|
774
774
|
], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
|
|
775
775
|
TuiDocDocumentationComponent = __decorate([
|
|
776
776
|
Component({
|
|
777
|
-
selector:
|
|
777
|
+
selector: "tui-doc-documentation",
|
|
778
778
|
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",
|
|
779
779
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
780
780
|
animations: [
|
|
781
|
-
trigger(
|
|
782
|
-
transition(
|
|
781
|
+
trigger("emitEvent", [
|
|
782
|
+
transition(":increment", [style({ opacity: 1 }), animate("500ms ease-in")]),
|
|
783
783
|
]),
|
|
784
784
|
],
|
|
785
785
|
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)}"]
|
|
@@ -799,7 +799,7 @@ var TuiInputOpacityDirective = /** @class */ (function () {
|
|
|
799
799
|
set: function (opacity) {
|
|
800
800
|
var nativeFocusableElement = this.tuiFocusableComponent.nativeFocusableElement;
|
|
801
801
|
if (nativeFocusableElement) {
|
|
802
|
-
this.renderer.setStyle(nativeFocusableElement,
|
|
802
|
+
this.renderer.setStyle(nativeFocusableElement, "opacity", opacity / 100);
|
|
803
803
|
}
|
|
804
804
|
},
|
|
805
805
|
enumerable: true,
|
|
@@ -814,7 +814,7 @@ var TuiInputOpacityDirective = /** @class */ (function () {
|
|
|
814
814
|
], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
|
|
815
815
|
TuiInputOpacityDirective = __decorate([
|
|
816
816
|
Directive({
|
|
817
|
-
selector:
|
|
817
|
+
selector: "[tuiInputOpacity]",
|
|
818
818
|
}),
|
|
819
819
|
__param(0, Inject(Renderer2)),
|
|
820
820
|
__param(1, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR))
|
|
@@ -873,13 +873,13 @@ var TuiDocDocumentationModule = /** @class */ (function () {
|
|
|
873
873
|
return TuiDocDocumentationModule;
|
|
874
874
|
}());
|
|
875
875
|
|
|
876
|
-
var TUI_DOC_CODE_ACTIONS = new InjectionToken(
|
|
877
|
-
factory: function () { return
|
|
876
|
+
var TUI_DOC_CODE_ACTIONS = new InjectionToken("Code actions for the opened tab with code example", {
|
|
877
|
+
factory: function () { return ""; },
|
|
878
878
|
});
|
|
879
879
|
|
|
880
|
-
var TUI_DOC_CODE_EDITOR = new InjectionToken(
|
|
880
|
+
var TUI_DOC_CODE_EDITOR = new InjectionToken("Contains service for opening online IDE e.g. Stackblitz");
|
|
881
881
|
|
|
882
|
-
var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new InjectionToken(
|
|
882
|
+
var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new InjectionToken("Processes content in example", { factory: function () { return identity; } });
|
|
883
883
|
|
|
884
884
|
/**
|
|
885
885
|
* @deprecated: use {@link tuiRawLoadRecord} instead
|
|
@@ -932,7 +932,7 @@ var tuiRawLoadRecord = rawLoadRecord;
|
|
|
932
932
|
// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
|
|
933
933
|
// @dynamic
|
|
934
934
|
var TuiDocExampleComponent = /** @class */ (function () {
|
|
935
|
-
function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent, isCypress, codeActions) {
|
|
935
|
+
function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent, isCypress, codeActions, router, route, ngLocation) {
|
|
936
936
|
var _this = this;
|
|
937
937
|
this.id = id;
|
|
938
938
|
this.clipboard = clipboard;
|
|
@@ -944,9 +944,12 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
944
944
|
this.processContent = processContent;
|
|
945
945
|
this.isCypress = isCypress;
|
|
946
946
|
this.codeActions = codeActions;
|
|
947
|
+
this.router = router;
|
|
948
|
+
this.route = route;
|
|
949
|
+
this.ngLocation = ngLocation;
|
|
947
950
|
this.rawLoader$$ = new BehaviorSubject({});
|
|
948
|
-
this.heading =
|
|
949
|
-
this.description =
|
|
951
|
+
this.heading = "";
|
|
952
|
+
this.description = "";
|
|
950
953
|
this.componentName = this.location.pathname.slice(1);
|
|
951
954
|
this.defaultTabIndex = 0;
|
|
952
955
|
this.defaultTab = this.texts[this.defaultTabIndex];
|
|
@@ -966,11 +969,12 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
966
969
|
configurable: true
|
|
967
970
|
});
|
|
968
971
|
TuiDocExampleComponent.prototype.copyExampleLink = function () {
|
|
969
|
-
var hashPosition = this.location.href.indexOf(
|
|
972
|
+
var hashPosition = this.location.href.indexOf("#");
|
|
970
973
|
var currentUrl = hashPosition > -1
|
|
971
974
|
? this.location.href.slice(0, Math.max(0, hashPosition))
|
|
972
975
|
: this.location.href;
|
|
973
976
|
var url = currentUrl + "#" + this.id;
|
|
977
|
+
this.setFragmentWithoutRedirect(this.id);
|
|
974
978
|
this.clipboard.copy(url);
|
|
975
979
|
this.notifications
|
|
976
980
|
.show(this.texts[1], {
|
|
@@ -983,10 +987,16 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
983
987
|
var _this = this;
|
|
984
988
|
var _a, _b;
|
|
985
989
|
this.loading$.next(true);
|
|
986
|
-
(_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, (_b = this.id) !== null && _b !== void 0 ? _b :
|
|
990
|
+
(_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); });
|
|
991
|
+
};
|
|
992
|
+
TuiDocExampleComponent.prototype.setFragmentWithoutRedirect = function (id) {
|
|
993
|
+
var url = this.router
|
|
994
|
+
.createUrlTree([], { relativeTo: this.route, fragment: id || "" })
|
|
995
|
+
.toString();
|
|
996
|
+
this.ngLocation.go(url);
|
|
987
997
|
};
|
|
988
998
|
TuiDocExampleComponent.ctorParameters = function () { return [
|
|
989
|
-
{ type: String, decorators: [{ type: Attribute, args: [
|
|
999
|
+
{ type: String, decorators: [{ type: Attribute, args: ["id",] }] },
|
|
990
1000
|
{ type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
|
|
991
1001
|
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
|
|
992
1002
|
{ type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
|
|
@@ -995,7 +1005,10 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
995
1005
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
|
|
996
1006
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] },
|
|
997
1007
|
{ type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_CYPRESS,] }] },
|
|
998
|
-
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_CODE_ACTIONS,] }] }
|
|
1008
|
+
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_CODE_ACTIONS,] }] },
|
|
1009
|
+
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
1010
|
+
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] },
|
|
1011
|
+
{ type: Location$1, decorators: [{ type: Inject, args: [Location$1,] }] }
|
|
999
1012
|
]; };
|
|
1000
1013
|
__decorate([
|
|
1001
1014
|
Input()
|
|
@@ -1011,12 +1024,12 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
1011
1024
|
], TuiDocExampleComponent.prototype, "componentName", void 0);
|
|
1012
1025
|
TuiDocExampleComponent = __decorate([
|
|
1013
1026
|
Component({
|
|
1014
|
-
selector:
|
|
1027
|
+
selector: "tui-doc-example",
|
|
1015
1028
|
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",
|
|
1016
1029
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1017
1030
|
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}"]
|
|
1018
1031
|
}),
|
|
1019
|
-
__param(0, Attribute(
|
|
1032
|
+
__param(0, Attribute("id")),
|
|
1020
1033
|
__param(1, Inject(Clipboard)),
|
|
1021
1034
|
__param(2, Inject(TuiNotificationsService)),
|
|
1022
1035
|
__param(3, Inject(LOCATION)),
|
|
@@ -1026,7 +1039,10 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
1026
1039
|
__param(6, Inject(TUI_DOC_CODE_EDITOR)),
|
|
1027
1040
|
__param(7, Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR)),
|
|
1028
1041
|
__param(8, Inject(TUI_IS_CYPRESS)),
|
|
1029
|
-
__param(9, Inject(TUI_DOC_CODE_ACTIONS))
|
|
1042
|
+
__param(9, Inject(TUI_DOC_CODE_ACTIONS)),
|
|
1043
|
+
__param(10, Inject(Router)),
|
|
1044
|
+
__param(11, Inject(ActivatedRoute)),
|
|
1045
|
+
__param(12, Inject(Location$1))
|
|
1030
1046
|
], TuiDocExampleComponent);
|
|
1031
1047
|
return TuiDocExampleComponent;
|
|
1032
1048
|
}());
|
|
@@ -1035,10 +1051,10 @@ var TuiDocExampleCapitalizePipe = /** @class */ (function () {
|
|
|
1035
1051
|
function TuiDocExampleCapitalizePipe() {
|
|
1036
1052
|
}
|
|
1037
1053
|
TuiDocExampleCapitalizePipe.prototype.transform = function (content) {
|
|
1038
|
-
return typeof content ===
|
|
1054
|
+
return typeof content === "string" ? capitalizeFirstLetter(content) : content;
|
|
1039
1055
|
};
|
|
1040
1056
|
TuiDocExampleCapitalizePipe = __decorate([
|
|
1041
|
-
Pipe({ name:
|
|
1057
|
+
Pipe({ name: "tuiDocExampleCapitalize" })
|
|
1042
1058
|
], TuiDocExampleCapitalizePipe);
|
|
1043
1059
|
return TuiDocExampleCapitalizePipe;
|
|
1044
1060
|
}());
|
|
@@ -1050,7 +1066,7 @@ var TuiDocExampleGetTabsPipe = /** @class */ (function () {
|
|
|
1050
1066
|
return __spread([defaultTab], Object.keys(content));
|
|
1051
1067
|
};
|
|
1052
1068
|
TuiDocExampleGetTabsPipe = __decorate([
|
|
1053
|
-
Pipe({ name:
|
|
1069
|
+
Pipe({ name: "tuiDocExampleGetTabs" })
|
|
1054
1070
|
], TuiDocExampleGetTabsPipe);
|
|
1055
1071
|
return TuiDocExampleGetTabsPipe;
|
|
1056
1072
|
}());
|
|
@@ -1089,15 +1105,15 @@ var TuiDocMainComponent = /** @class */ (function () {
|
|
|
1089
1105
|
function TuiDocMainComponent(storage, windowRef) {
|
|
1090
1106
|
this.storage = storage;
|
|
1091
1107
|
this.windowRef = windowRef;
|
|
1092
|
-
this.night = this.storage.getItem(
|
|
1093
|
-
(this.storage.getItem(
|
|
1094
|
-
this.windowRef.matchMedia(
|
|
1108
|
+
this.night = this.storage.getItem("night") === "true" ||
|
|
1109
|
+
(this.storage.getItem("night") === null &&
|
|
1110
|
+
this.windowRef.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
1095
1111
|
this.change$ = new Subject();
|
|
1096
1112
|
}
|
|
1097
1113
|
TuiDocMainComponent_1 = TuiDocMainComponent;
|
|
1098
1114
|
Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
|
|
1099
1115
|
get: function () {
|
|
1100
|
-
return this.night ?
|
|
1116
|
+
return this.night ? "onDark" : null;
|
|
1101
1117
|
},
|
|
1102
1118
|
enumerable: true,
|
|
1103
1119
|
configurable: true
|
|
@@ -1105,7 +1121,7 @@ var TuiDocMainComponent = /** @class */ (function () {
|
|
|
1105
1121
|
TuiDocMainComponent.prototype.onMode = function (night) {
|
|
1106
1122
|
this.night = night;
|
|
1107
1123
|
this.change$.next();
|
|
1108
|
-
this.storage.setItem(
|
|
1124
|
+
this.storage.setItem("night", String(night));
|
|
1109
1125
|
};
|
|
1110
1126
|
var TuiDocMainComponent_1;
|
|
1111
1127
|
TuiDocMainComponent.ctorParameters = function () { return [
|
|
@@ -1113,11 +1129,11 @@ var TuiDocMainComponent = /** @class */ (function () {
|
|
|
1113
1129
|
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
1114
1130
|
]; };
|
|
1115
1131
|
__decorate([
|
|
1116
|
-
HostBinding(
|
|
1132
|
+
HostBinding("attr.data-mode")
|
|
1117
1133
|
], TuiDocMainComponent.prototype, "mode", null);
|
|
1118
1134
|
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
1119
1135
|
Component({
|
|
1120
|
-
selector:
|
|
1136
|
+
selector: "tui-doc-main",
|
|
1121
1137
|
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",
|
|
1122
1138
|
encapsulation: ViewEncapsulation.None,
|
|
1123
1139
|
providers: [
|
|
@@ -1135,7 +1151,7 @@ var TuiDocMainComponent = /** @class */ (function () {
|
|
|
1135
1151
|
return TuiDocMainComponent;
|
|
1136
1152
|
}());
|
|
1137
1153
|
|
|
1138
|
-
var TUI_DOC_PAGE_LOADED = new InjectionToken(
|
|
1154
|
+
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))); }); } });
|
|
1139
1155
|
|
|
1140
1156
|
/**
|
|
1141
1157
|
* @deprecated: use {@link TuiScrollIntoViewLinkDirective}
|
|
@@ -1169,7 +1185,7 @@ var ScrollIntoViewDirective = /** @class */ (function () {
|
|
|
1169
1185
|
], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
|
|
1170
1186
|
ScrollIntoViewDirective = __decorate([
|
|
1171
1187
|
Directive({
|
|
1172
|
-
selector:
|
|
1188
|
+
selector: "[scrollIntoView]",
|
|
1173
1189
|
providers: [TuiDestroyService],
|
|
1174
1190
|
})
|
|
1175
1191
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -1187,7 +1203,7 @@ var TuiScrollIntoViewLinkDirective = /** @class */ (function (_super) {
|
|
|
1187
1203
|
}
|
|
1188
1204
|
TuiScrollIntoViewLinkDirective = __decorate([
|
|
1189
1205
|
Directive({
|
|
1190
|
-
selector:
|
|
1206
|
+
selector: "[tuiScrollIntoViewLink]",
|
|
1191
1207
|
providers: [TuiDestroyService],
|
|
1192
1208
|
})
|
|
1193
1209
|
], TuiScrollIntoViewLinkDirective);
|
|
@@ -1223,41 +1239,41 @@ var TuiScrollIntoViewLinkModule = /** @class */ (function () {
|
|
|
1223
1239
|
return TuiScrollIntoViewLinkModule;
|
|
1224
1240
|
}());
|
|
1225
1241
|
|
|
1226
|
-
var TUI_DOC_SCROLL_BEHAVIOR = new InjectionToken(
|
|
1242
|
+
var TUI_DOC_SCROLL_BEHAVIOR = new InjectionToken("[TUI_DOC_SCROLL_BEHAVIOR] Defines the transition animation for scroll", { factory: function () { return "smooth"; } });
|
|
1227
1243
|
|
|
1228
1244
|
var MAP = {
|
|
1229
|
-
а:
|
|
1230
|
-
б:
|
|
1231
|
-
в:
|
|
1232
|
-
г:
|
|
1233
|
-
д:
|
|
1234
|
-
е:
|
|
1235
|
-
ё:
|
|
1236
|
-
ж:
|
|
1237
|
-
з:
|
|
1238
|
-
и:
|
|
1239
|
-
й:
|
|
1240
|
-
к:
|
|
1241
|
-
л:
|
|
1242
|
-
м:
|
|
1243
|
-
н:
|
|
1244
|
-
о:
|
|
1245
|
-
п:
|
|
1246
|
-
р:
|
|
1247
|
-
с:
|
|
1248
|
-
т:
|
|
1249
|
-
у:
|
|
1250
|
-
ф:
|
|
1251
|
-
х:
|
|
1252
|
-
ц:
|
|
1253
|
-
ч:
|
|
1254
|
-
ш:
|
|
1255
|
-
щ:
|
|
1256
|
-
ъ:
|
|
1257
|
-
ы:
|
|
1258
|
-
ь:
|
|
1259
|
-
ю:
|
|
1260
|
-
я:
|
|
1245
|
+
а: "f",
|
|
1246
|
+
б: ",",
|
|
1247
|
+
в: "d",
|
|
1248
|
+
г: "u",
|
|
1249
|
+
д: "l",
|
|
1250
|
+
е: "t",
|
|
1251
|
+
ё: "`",
|
|
1252
|
+
ж: ";",
|
|
1253
|
+
з: "p",
|
|
1254
|
+
и: "b",
|
|
1255
|
+
й: "q",
|
|
1256
|
+
к: "r",
|
|
1257
|
+
л: "k",
|
|
1258
|
+
м: "v",
|
|
1259
|
+
н: "y",
|
|
1260
|
+
о: "j",
|
|
1261
|
+
п: "g",
|
|
1262
|
+
р: "h",
|
|
1263
|
+
с: "c",
|
|
1264
|
+
т: "n",
|
|
1265
|
+
у: "e",
|
|
1266
|
+
ф: "a",
|
|
1267
|
+
х: "[",
|
|
1268
|
+
ц: "w",
|
|
1269
|
+
ч: "x",
|
|
1270
|
+
ш: "i",
|
|
1271
|
+
щ: "o",
|
|
1272
|
+
ъ: "]",
|
|
1273
|
+
ы: "s",
|
|
1274
|
+
ь: "m",
|
|
1275
|
+
ю: ".",
|
|
1276
|
+
я: "z",
|
|
1261
1277
|
};
|
|
1262
1278
|
/**
|
|
1263
1279
|
* @deprecated: use {@link tuiTransliterateKeyboardLayout} instead
|
|
@@ -1267,7 +1283,7 @@ var MAP = {
|
|
|
1267
1283
|
*/
|
|
1268
1284
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1269
1285
|
function transliterateKeyboardLayout(string) {
|
|
1270
|
-
var newStr =
|
|
1286
|
+
var newStr = "";
|
|
1271
1287
|
for (var i = 0; i < string.length; i++) {
|
|
1272
1288
|
newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
|
|
1273
1289
|
}
|
|
@@ -1275,17 +1291,17 @@ function transliterateKeyboardLayout(string) {
|
|
|
1275
1291
|
}
|
|
1276
1292
|
var tuiTransliterateKeyboardLayout = transliterateKeyboardLayout;
|
|
1277
1293
|
|
|
1278
|
-
var TUI_DOC_PAGES = new InjectionToken(
|
|
1294
|
+
var TUI_DOC_PAGES = new InjectionToken("Documentation pages", {
|
|
1279
1295
|
factory: function () { return []; },
|
|
1280
1296
|
});
|
|
1281
1297
|
|
|
1282
|
-
var TUI_DOC_TITLE = new InjectionToken(
|
|
1283
|
-
factory: function () { return
|
|
1298
|
+
var TUI_DOC_TITLE = new InjectionToken("Page title", {
|
|
1299
|
+
factory: function () { return ""; },
|
|
1284
1300
|
});
|
|
1285
1301
|
|
|
1286
|
-
var NAVIGATION_TITLE = new InjectionToken(
|
|
1287
|
-
var NAVIGATION_LABELS = new InjectionToken(
|
|
1288
|
-
var NAVIGATION_ITEMS = new InjectionToken(
|
|
1302
|
+
var NAVIGATION_TITLE = new InjectionToken("Page title");
|
|
1303
|
+
var NAVIGATION_LABELS = new InjectionToken("Navigation sections labels for search");
|
|
1304
|
+
var NAVIGATION_ITEMS = new InjectionToken("Navigation pages");
|
|
1289
1305
|
var NAVIGATION_PROVIDERS = [
|
|
1290
1306
|
TuiDestroyService,
|
|
1291
1307
|
{
|
|
@@ -1351,12 +1367,12 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1351
1367
|
this.readyToScroll$ = readyToScroll$;
|
|
1352
1368
|
this.scrollBehavior = scrollBehavior;
|
|
1353
1369
|
this.menuOpen = false;
|
|
1354
|
-
this.search =
|
|
1370
|
+
this.search = "";
|
|
1355
1371
|
this.open = false;
|
|
1356
1372
|
this.openPagesArr = [];
|
|
1357
1373
|
this.openPagesGroupsArr = [];
|
|
1358
|
-
this.active =
|
|
1359
|
-
this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode ||
|
|
1374
|
+
this.active = "";
|
|
1375
|
+
this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode || "onLight"; }));
|
|
1360
1376
|
// Angular can't navigate no anchor links
|
|
1361
1377
|
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
1362
1378
|
title$.subscribe(function (title) {
|
|
@@ -1403,13 +1419,13 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1403
1419
|
TuiDocNavigationComponent.prototype.onClick = function () {
|
|
1404
1420
|
this.open = false;
|
|
1405
1421
|
this.menuOpen = false;
|
|
1406
|
-
this.search =
|
|
1422
|
+
this.search = "";
|
|
1407
1423
|
this.openActivePageGroup();
|
|
1408
1424
|
};
|
|
1409
1425
|
TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
|
|
1410
1426
|
return items.map(function (section) {
|
|
1411
1427
|
return uniqBy(section.filter(function (_a) {
|
|
1412
|
-
var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ?
|
|
1428
|
+
var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? "" : _b;
|
|
1413
1429
|
title = title.toLowerCase();
|
|
1414
1430
|
search = search.toLowerCase();
|
|
1415
1431
|
keywords = keywords.toLowerCase();
|
|
@@ -1417,14 +1433,14 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1417
1433
|
keywords.includes(search) ||
|
|
1418
1434
|
title.includes(transliterateKeyboardLayout(search)) ||
|
|
1419
1435
|
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
1420
|
-
search.replace(/-/gi,
|
|
1421
|
-
}),
|
|
1436
|
+
search.replace(/-/gi, "").includes(title));
|
|
1437
|
+
}), "title");
|
|
1422
1438
|
});
|
|
1423
1439
|
};
|
|
1424
1440
|
TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
|
|
1425
1441
|
return items.reduce(function (array, item) { return __spread(array, [
|
|
1426
1442
|
item.reduce(function (pages, page) {
|
|
1427
|
-
return
|
|
1443
|
+
return "subPages" in page
|
|
1428
1444
|
? __spread(pages, page.subPages) : __spread(pages, [page]);
|
|
1429
1445
|
}, []),
|
|
1430
1446
|
]); }, []);
|
|
@@ -1442,11 +1458,11 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1442
1458
|
var _this = this;
|
|
1443
1459
|
this.items.forEach(function (pages, pagesIndex) {
|
|
1444
1460
|
pages.forEach(function (page, pageIndex) {
|
|
1445
|
-
if (
|
|
1461
|
+
if ("route" in page && _this.isActiveRoute(page.route)) {
|
|
1446
1462
|
_this.openPagesArr[pagesIndex] = true;
|
|
1447
1463
|
_this.active = page.route;
|
|
1448
1464
|
}
|
|
1449
|
-
if (
|
|
1465
|
+
if ("subPages" in page) {
|
|
1450
1466
|
page.subPages.forEach(function (subPage) {
|
|
1451
1467
|
if (_this.isActiveRoute(subPage.route)) {
|
|
1452
1468
|
_this.openPagesArr[pagesIndex] = true;
|
|
@@ -1463,10 +1479,10 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1463
1479
|
if (!element) {
|
|
1464
1480
|
return;
|
|
1465
1481
|
}
|
|
1466
|
-
element.classList.add(
|
|
1482
|
+
element.classList.add("tui-doc-animated-example");
|
|
1467
1483
|
element.scrollIntoView({
|
|
1468
|
-
block:
|
|
1469
|
-
inline:
|
|
1484
|
+
block: "start",
|
|
1485
|
+
inline: "nearest",
|
|
1470
1486
|
behavior: this.scrollBehavior,
|
|
1471
1487
|
});
|
|
1472
1488
|
};
|
|
@@ -1487,7 +1503,7 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1487
1503
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_SCROLL_BEHAVIOR,] }] }
|
|
1488
1504
|
]; };
|
|
1489
1505
|
__decorate([
|
|
1490
|
-
HostBinding(
|
|
1506
|
+
HostBinding("class._open")
|
|
1491
1507
|
], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
|
|
1492
1508
|
__decorate([
|
|
1493
1509
|
tuiPure
|
|
@@ -1497,7 +1513,7 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1497
1513
|
], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
|
|
1498
1514
|
TuiDocNavigationComponent = __decorate([
|
|
1499
1515
|
Component({
|
|
1500
|
-
selector:
|
|
1516
|
+
selector: "tui-doc-navigation",
|
|
1501
1517
|
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",
|
|
1502
1518
|
providers: NAVIGATION_PROVIDERS,
|
|
1503
1519
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -1556,8 +1572,8 @@ var TuiDocNavigationModule = /** @class */ (function () {
|
|
|
1556
1572
|
return TuiDocNavigationModule;
|
|
1557
1573
|
}());
|
|
1558
1574
|
|
|
1559
|
-
var TUI_DOC_LOGO = new InjectionToken(
|
|
1560
|
-
factory: function () { return
|
|
1575
|
+
var TUI_DOC_LOGO = new InjectionToken("Main logo", {
|
|
1576
|
+
factory: function () { return ""; },
|
|
1561
1577
|
});
|
|
1562
1578
|
|
|
1563
1579
|
var TuiDocHeaderComponent = /** @class */ (function () {
|
|
@@ -1567,7 +1583,7 @@ var TuiDocHeaderComponent = /** @class */ (function () {
|
|
|
1567
1583
|
this.router = router;
|
|
1568
1584
|
this.swipes$ = swipes$;
|
|
1569
1585
|
this.stream$ = new Subject();
|
|
1570
|
-
this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$, this.swipes$.pipe(filter(function (swipe) { return swipe.direction ===
|
|
1586
|
+
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());
|
|
1571
1587
|
}
|
|
1572
1588
|
TuiDocHeaderComponent.prototype.onClick = function () {
|
|
1573
1589
|
this.stream$.next(true);
|
|
@@ -1585,7 +1601,7 @@ var TuiDocHeaderComponent = /** @class */ (function () {
|
|
|
1585
1601
|
]; };
|
|
1586
1602
|
TuiDocHeaderComponent = __decorate([
|
|
1587
1603
|
Component({
|
|
1588
|
-
selector:
|
|
1604
|
+
selector: "header[tuiDocHeader]",
|
|
1589
1605
|
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",
|
|
1590
1606
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1591
1607
|
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%}"]
|
|
@@ -1642,15 +1658,15 @@ var TuiDocMainModule = /** @class */ (function () {
|
|
|
1642
1658
|
return TuiDocMainModule;
|
|
1643
1659
|
}());
|
|
1644
1660
|
|
|
1645
|
-
var TUI_DOC_DEFAULT_TABS = new InjectionToken(
|
|
1661
|
+
var TUI_DOC_DEFAULT_TABS = new InjectionToken("Array of default tab names", {
|
|
1646
1662
|
factory: function () { return []; },
|
|
1647
1663
|
});
|
|
1648
1664
|
|
|
1649
|
-
var TUI_DOC_SEE_ALSO = new InjectionToken(
|
|
1665
|
+
var TUI_DOC_SEE_ALSO = new InjectionToken("Array of arrays of related pages", {
|
|
1650
1666
|
factory: function () { return []; },
|
|
1651
1667
|
});
|
|
1652
1668
|
|
|
1653
|
-
var PAGE_SEE_ALSO = new InjectionToken(
|
|
1669
|
+
var PAGE_SEE_ALSO = new InjectionToken("Page see also");
|
|
1654
1670
|
var PAGE_PROVIDERS = [
|
|
1655
1671
|
{
|
|
1656
1672
|
provide: PAGE_SEE_ALSO,
|
|
@@ -1661,11 +1677,11 @@ var PAGE_PROVIDERS = [
|
|
|
1661
1677
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1662
1678
|
function seeAlsoProviderFactory(_a, seeAlsoGroups) {
|
|
1663
1679
|
var nativeElement = _a.nativeElement;
|
|
1664
|
-
var currentHeader = nativeElement.getAttribute(
|
|
1680
|
+
var currentHeader = nativeElement.getAttribute("header");
|
|
1665
1681
|
var groups = seeAlsoGroups.filter(function (group) { return group.includes(currentHeader); }) || [];
|
|
1666
1682
|
var seeAlsoSet = new Set(groups
|
|
1667
1683
|
.join()
|
|
1668
|
-
.split(
|
|
1684
|
+
.split(",")
|
|
1669
1685
|
.filter(function (component) { return component && component !== currentHeader; }));
|
|
1670
1686
|
return Array.from(seeAlsoSet);
|
|
1671
1687
|
}
|
|
@@ -1683,7 +1699,7 @@ var TuiDocPageTabConnectorDirective = /** @class */ (function () {
|
|
|
1683
1699
|
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1684
1700
|
TuiDocPageTabConnectorDirective = __decorate([
|
|
1685
1701
|
Directive({
|
|
1686
|
-
selector:
|
|
1702
|
+
selector: "[pageTab]",
|
|
1687
1703
|
}),
|
|
1688
1704
|
__param(0, Inject(TemplateRef))
|
|
1689
1705
|
], TuiDocPageTabConnectorDirective);
|
|
@@ -1697,10 +1713,10 @@ var TuiDocPageComponent = /** @class */ (function () {
|
|
|
1697
1713
|
this.deprecated = deprecated;
|
|
1698
1714
|
this.defaultTabs = defaultTabs;
|
|
1699
1715
|
this.seeAlso = seeAlso;
|
|
1700
|
-
this.header =
|
|
1701
|
-
this.package =
|
|
1702
|
-
this.type =
|
|
1703
|
-
this.path =
|
|
1716
|
+
this.header = "";
|
|
1717
|
+
this.package = "";
|
|
1718
|
+
this.type = "";
|
|
1719
|
+
this.path = "";
|
|
1704
1720
|
this.tabConnectors = EMPTY_QUERY;
|
|
1705
1721
|
this.activeItemIndex = NaN;
|
|
1706
1722
|
}
|
|
@@ -1712,11 +1728,11 @@ var TuiDocPageComponent = /** @class */ (function () {
|
|
|
1712
1728
|
configurable: true
|
|
1713
1729
|
});
|
|
1714
1730
|
TuiDocPageComponent.prototype.getRouterLink = function (tab) {
|
|
1715
|
-
if (tab === void 0) { tab =
|
|
1716
|
-
return "./" + tab.replace(/ /g,
|
|
1731
|
+
if (tab === void 0) { tab = ""; }
|
|
1732
|
+
return "./" + tab.replace(/ /g, "_");
|
|
1717
1733
|
};
|
|
1718
1734
|
TuiDocPageComponent.ctorParameters = function () { return [
|
|
1719
|
-
{ type: String, decorators: [{ type: Attribute, args: [
|
|
1735
|
+
{ type: String, decorators: [{ type: Attribute, args: ["deprecated",] }] },
|
|
1720
1736
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_DEFAULT_TABS,] }] },
|
|
1721
1737
|
{ type: undefined, decorators: [{ type: Inject, args: [PAGE_SEE_ALSO,] }] }
|
|
1722
1738
|
]; };
|
|
@@ -1737,13 +1753,13 @@ var TuiDocPageComponent = /** @class */ (function () {
|
|
|
1737
1753
|
], TuiDocPageComponent.prototype, "tabConnectors", void 0);
|
|
1738
1754
|
TuiDocPageComponent = __decorate([
|
|
1739
1755
|
Component({
|
|
1740
|
-
selector:
|
|
1756
|
+
selector: "tui-doc-page",
|
|
1741
1757
|
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",
|
|
1742
1758
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1743
1759
|
providers: PAGE_PROVIDERS,
|
|
1744
1760
|
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}"]
|
|
1745
1761
|
}),
|
|
1746
|
-
__param(0, Attribute(
|
|
1762
|
+
__param(0, Attribute("deprecated")),
|
|
1747
1763
|
__param(1, Inject(TUI_DOC_DEFAULT_TABS)),
|
|
1748
1764
|
__param(2, Inject(PAGE_SEE_ALSO))
|
|
1749
1765
|
], TuiDocPageComponent);
|
|
@@ -1760,14 +1776,14 @@ var TuiDocSeeAlsoComponent = /** @class */ (function () {
|
|
|
1760
1776
|
TuiDocSeeAlsoComponent.prototype.getRouterLink = function (pageTitle) {
|
|
1761
1777
|
for (var i = 0; i < this.pages.length; i++) {
|
|
1762
1778
|
var page = this.pages
|
|
1763
|
-
.map(function (page) { return (
|
|
1779
|
+
.map(function (page) { return ("subPages" in page ? page.subPages : [page]); })
|
|
1764
1780
|
.reduce(function (pages, subPages) { return __spread(pages, subPages); }, [])
|
|
1765
1781
|
.find(function (page) { return page.title === pageTitle; });
|
|
1766
1782
|
if (page === null || page === void 0 ? void 0 : page.route) {
|
|
1767
1783
|
return page.route;
|
|
1768
1784
|
}
|
|
1769
1785
|
}
|
|
1770
|
-
return
|
|
1786
|
+
return "";
|
|
1771
1787
|
};
|
|
1772
1788
|
TuiDocSeeAlsoComponent.ctorParameters = function () { return [
|
|
1773
1789
|
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEE_ALSO_TEXT,] }] },
|
|
@@ -1778,7 +1794,7 @@ var TuiDocSeeAlsoComponent = /** @class */ (function () {
|
|
|
1778
1794
|
], TuiDocSeeAlsoComponent.prototype, "seeAlso", void 0);
|
|
1779
1795
|
TuiDocSeeAlsoComponent = __decorate([
|
|
1780
1796
|
Component({
|
|
1781
|
-
selector:
|
|
1797
|
+
selector: "tui-doc-see-also",
|
|
1782
1798
|
template: "<h5 class=\"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",
|
|
1783
1799
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1784
1800
|
styles: [":host{display:block}.header{font-size:.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:.075em;color:var(--tui-text-02);margin:0 0 .5rem;white-space:nowrap}"]
|
|
@@ -1802,18 +1818,18 @@ var TuiDocSeeAlsoModule = /** @class */ (function () {
|
|
|
1802
1818
|
return TuiDocSeeAlsoModule;
|
|
1803
1819
|
}());
|
|
1804
1820
|
|
|
1805
|
-
var TUI_DOC_SOURCE_CODE = new InjectionToken(
|
|
1806
|
-
factory: function () { return
|
|
1821
|
+
var TUI_DOC_SOURCE_CODE = new InjectionToken("Source code link", {
|
|
1822
|
+
factory: function () { return ""; },
|
|
1807
1823
|
});
|
|
1808
1824
|
|
|
1809
1825
|
var TuiDocSourceCodeComponent = /** @class */ (function () {
|
|
1810
1826
|
function TuiDocSourceCodeComponent(sourceCode, text) {
|
|
1811
1827
|
this.sourceCode = sourceCode;
|
|
1812
1828
|
this.text = text;
|
|
1813
|
-
this.header =
|
|
1814
|
-
this.package =
|
|
1815
|
-
this.type =
|
|
1816
|
-
this.path =
|
|
1829
|
+
this.header = "";
|
|
1830
|
+
this.package = "";
|
|
1831
|
+
this.type = "";
|
|
1832
|
+
this.path = "";
|
|
1817
1833
|
}
|
|
1818
1834
|
Object.defineProperty(TuiDocSourceCodeComponent.prototype, "pathOptions", {
|
|
1819
1835
|
get: function () {
|
|
@@ -1851,7 +1867,7 @@ var TuiDocSourceCodeComponent = /** @class */ (function () {
|
|
|
1851
1867
|
], TuiDocSourceCodeComponent.prototype, "getPathOptions", null);
|
|
1852
1868
|
TuiDocSourceCodeComponent = __decorate([
|
|
1853
1869
|
Component({
|
|
1854
|
-
selector:
|
|
1870
|
+
selector: "tui-doc-source-code",
|
|
1855
1871
|
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",
|
|
1856
1872
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1857
1873
|
}),
|
|
@@ -1895,21 +1911,21 @@ var TuiDocPageModule = /** @class */ (function () {
|
|
|
1895
1911
|
}());
|
|
1896
1912
|
|
|
1897
1913
|
var TUI_EXAMPLE_PRIMARY_FILE_NAME = {
|
|
1898
|
-
TS:
|
|
1899
|
-
LESS:
|
|
1900
|
-
HTML:
|
|
1914
|
+
TS: "TypeScript",
|
|
1915
|
+
LESS: "LESS",
|
|
1916
|
+
HTML: "HTML",
|
|
1901
1917
|
};
|
|
1902
1918
|
|
|
1903
1919
|
// TODO: 3.0 remove in ivy compilation
|
|
1904
|
-
var DEMO_TEXTS = [
|
|
1920
|
+
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"];
|
|
1905
1921
|
var DOC_TEXTS = [
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1922
|
+
"\u0410\u0440\u0433\u0443\u043C\u0435\u043D\u0442",
|
|
1923
|
+
"\u0422\u0438\u043F",
|
|
1924
|
+
"\u0418\u043C\u044F \u0438 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435",
|
|
1925
|
+
"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",
|
|
1926
|
+
"\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",
|
|
1911
1927
|
];
|
|
1912
|
-
var EXAMPLE_TEXTS = [
|
|
1928
|
+
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"];
|
|
1913
1929
|
var TUI_DOC_RUSSIAN = [
|
|
1914
1930
|
{
|
|
1915
1931
|
provide: TUI_DOC_DEMO_TEXTS,
|
|
@@ -1925,19 +1941,19 @@ var TUI_DOC_RUSSIAN = [
|
|
|
1925
1941
|
},
|
|
1926
1942
|
{
|
|
1927
1943
|
provide: TUI_DOC_MENU_TEXT,
|
|
1928
|
-
useValue:
|
|
1944
|
+
useValue: "\u041C\u0435\u043D\u044E",
|
|
1929
1945
|
},
|
|
1930
1946
|
{
|
|
1931
1947
|
provide: TUI_DOC_SEARCH_TEXT,
|
|
1932
|
-
useValue:
|
|
1948
|
+
useValue: "\u041F\u043E\u0438\u0441\u043A",
|
|
1933
1949
|
},
|
|
1934
1950
|
{
|
|
1935
1951
|
provide: TUI_DOC_SEE_ALSO_TEXT,
|
|
1936
|
-
useValue:
|
|
1952
|
+
useValue: "\u0421\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0442\u0430\u043A\u0436\u0435",
|
|
1937
1953
|
},
|
|
1938
1954
|
{
|
|
1939
1955
|
provide: TUI_DOC_SOURCE_CODE_TEXT,
|
|
1940
|
-
useValue:
|
|
1956
|
+
useValue: "\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434",
|
|
1941
1957
|
},
|
|
1942
1958
|
];
|
|
1943
1959
|
|
|
@@ -1966,11 +1982,11 @@ var TuiAddonDocModule = /** @class */ (function () {
|
|
|
1966
1982
|
function generateRoutes(type) {
|
|
1967
1983
|
return [
|
|
1968
1984
|
{
|
|
1969
|
-
path:
|
|
1985
|
+
path: "",
|
|
1970
1986
|
component: type,
|
|
1971
1987
|
children: [
|
|
1972
1988
|
{
|
|
1973
|
-
path:
|
|
1989
|
+
path: ":tab",
|
|
1974
1990
|
component: type,
|
|
1975
1991
|
},
|
|
1976
1992
|
],
|