@taiga-ui/addon-doc 2.24.0 → 2.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -121
- package/bundles/taiga-ui-addon-doc.umd.js +935 -935
- package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-doc.umd.min.js +2 -2
- package/bundles/taiga-ui-addon-doc.umd.min.js.map +1 -1
- package/components/code/code.component.d.ts +1 -1
- package/components/demo/demo.component.d.ts +8 -8
- package/components/documentation/documentation-property-connector.directive.d.ts +1 -1
- package/components/navigation/navigation.component.d.ts +1 -1
- package/components/page/page.component.d.ts +1 -1
- package/esm2015/addon-doc.module.js +1 -1
- package/esm2015/components/code/code.component.js +2 -2
- package/esm2015/components/code/code.module.js +1 -1
- package/esm2015/components/copy/copy.module.js +1 -1
- package/esm2015/components/demo/demo.component.js +12 -12
- package/esm2015/components/demo/demo.module.js +1 -1
- package/esm2015/components/documentation/documentation-property-connector.directive.js +6 -6
- package/esm2015/components/documentation/documentation.component.js +2 -2
- package/esm2015/components/documentation/documentation.module.js +2 -2
- package/esm2015/components/example/example.component.js +1 -1
- package/esm2015/components/example/example.module.js +2 -2
- package/esm2015/components/main/main.module.js +1 -1
- package/esm2015/components/navigation/navigation.component.js +2 -2
- package/esm2015/components/navigation/navigation.module.js +1 -1
- package/esm2015/components/navigation/navigation.providers.js +1 -1
- package/esm2015/components/page/page.component.js +3 -3
- package/esm2015/components/page/page.module.js +2 -2
- package/esm2015/components/page/page.providers.js +1 -1
- package/esm2015/directives/scroll-into-view/scroll-into-view.module.js +1 -1
- package/esm2015/internal/header/header.component.js +1 -1
- package/esm2015/internal/header/header.module.js +1 -1
- package/esm2015/internal/input-opacity/input-opacity.module.js +1 -1
- package/esm2015/internal/see-also/see-also.component.js +1 -1
- package/esm2015/internal/see-also/see-also.module.js +1 -1
- package/esm2015/internal/source-code/source-code.component.js +1 -1
- package/esm2015/internal/source-code/source-code.module.js +1 -1
- package/esm2015/languages/russian.js +1 -1
- package/esm2015/public-api.js +5 -5
- package/esm2015/taiga-ui-addon-doc.js +6 -6
- package/esm2015/tokens/code-editor.js +1 -1
- package/esm2015/tokens/pages.js +1 -1
- package/esm2015/tokens/source-code.js +1 -1
- package/esm5/addon-doc.module.js +1 -1
- package/esm5/components/code/code.component.js +2 -2
- package/esm5/components/code/code.module.js +1 -1
- package/esm5/components/copy/copy.module.js +1 -1
- package/esm5/components/demo/demo.component.js +12 -12
- package/esm5/components/demo/demo.module.js +1 -1
- package/esm5/components/documentation/documentation-property-connector.directive.js +6 -6
- package/esm5/components/documentation/documentation.component.js +2 -2
- package/esm5/components/documentation/documentation.module.js +2 -2
- package/esm5/components/example/example.component.js +1 -1
- package/esm5/components/example/example.module.js +2 -2
- package/esm5/components/main/main.module.js +1 -1
- package/esm5/components/navigation/navigation.component.js +2 -2
- package/esm5/components/navigation/navigation.module.js +1 -1
- package/esm5/components/navigation/navigation.providers.js +1 -1
- package/esm5/components/page/page.component.js +3 -3
- package/esm5/components/page/page.module.js +2 -2
- package/esm5/components/page/page.providers.js +1 -1
- package/esm5/directives/scroll-into-view/scroll-into-view.module.js +1 -1
- package/esm5/internal/header/header.component.js +1 -1
- package/esm5/internal/header/header.module.js +1 -1
- package/esm5/internal/input-opacity/input-opacity.module.js +1 -1
- package/esm5/internal/see-also/see-also.component.js +1 -1
- package/esm5/internal/see-also/see-also.module.js +1 -1
- package/esm5/internal/source-code/source-code.component.js +1 -1
- package/esm5/internal/source-code/source-code.module.js +1 -1
- package/esm5/languages/russian.js +1 -1
- package/esm5/public-api.js +5 -5
- package/esm5/taiga-ui-addon-doc.js +6 -6
- package/esm5/tokens/code-editor.js +1 -1
- package/esm5/tokens/pages.js +1 -1
- package/esm5/tokens/source-code.js +1 -1
- package/fesm2015/taiga-ui-addon-doc.js +561 -561
- package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
- package/fesm5/taiga-ui-addon-doc.js +927 -927
- package/fesm5/taiga-ui-addon-doc.js.map +1 -1
- package/package.json +6 -5
- package/public-api.d.ts +4 -4
- package/taiga-ui-addon-doc.d.ts +5 -5
- package/taiga-ui-addon-doc.metadata.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { __awaiter, __decorate, __param } from 'tslib';
|
|
2
|
-
import { Input, HostBinding, Component, NgModule, Inject, ChangeDetectionStrategy, InjectionToken, Renderer2, PLATFORM_ID, ContentChild, TemplateRef,
|
|
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
3
|
import { BehaviorSubject, Subject, timer, Observable, merge } from 'rxjs';
|
|
4
|
-
import { switchMap, switchMapTo, mapTo, startWith, takeUntil,
|
|
4
|
+
import { switchMap, switchMapTo, mapTo, startWith, takeUntil, map, debounceTime, filter, mergeMap, distinctUntilChanged } from 'rxjs/operators';
|
|
5
5
|
import { CommonModule, isPlatformBrowser, Location as Location$1, DOCUMENT } from '@angular/common';
|
|
6
6
|
import { HighlightModule } from 'ngx-highlightjs';
|
|
7
|
-
import { tuiPure, TuiDestroyService, TUI_IS_MOBILE, TuiDragModule,
|
|
8
|
-
import { TUI_COPY_TEXTS, TuiSelectModule, TuiRadioBlockModule, TuiCheckboxLabeledModule, TuiDataListWrapperModule,
|
|
9
|
-
import { TuiButtonModule, TuiModeDirective, TuiLinkModule, TuiExpandModule, TuiGroupModule, TuiTooltipModule, TuiModeModule, TuiSvgModule, TuiDataListModule, TuiTextfieldControllerModule, TuiHintControllerModule, TuiPrimitiveTextfieldModule,
|
|
7
|
+
import { tuiPure, TuiDestroyService, TUI_IS_MOBILE, TuiDragModule, EMPTY_QUERY, itemsQueryListObservable, watch, TUI_FOCUSABLE_ITEM_ACCESSOR, identity, TuiSwipeService, getElementObscurers, isPresent, uniqBy, TuiActiveZoneModule, TuiLetModule, TuiAutoFocusModule, tuiDefaultProp } from '@taiga-ui/cdk';
|
|
8
|
+
import { TUI_COPY_TEXTS, TuiSelectModule, TuiRadioBlockModule, TuiCheckboxLabeledModule, TuiDataListWrapperModule, TuiBadgeModule, TuiToggleModule, TuiInputCountModule, TuiTabsModule, TuiAccordionModule, TuiTagModule } from '@taiga-ui/kit';
|
|
9
|
+
import { TuiButtonModule, TuiModeDirective, TuiLinkModule, TuiExpandModule, TuiGroupModule, TuiTooltipModule, TuiModeModule, TuiSvgModule, TuiDataListModule, TuiTextfieldControllerModule, TuiHintControllerModule, TuiPrimitiveTextfieldModule, TuiDropdownControllerModule, TuiNotificationModule, TuiNotificationsService, TuiHostedDropdownModule, TuiScrollbarModule, TuiThemeNightModule, TuiRootModule, TuiDialogModule, TuiNotificationsModule } from '@taiga-ui/core';
|
|
10
10
|
import { FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
11
|
-
import { UrlSerializer, RouterModule,
|
|
12
|
-
import { Title } from '@angular/platform-browser';
|
|
13
|
-
import { TuiSidebarDirective, TuiSidebarModule } from '@taiga-ui/addon-mobile';
|
|
11
|
+
import { UrlSerializer, RouterModule, ActivatedRoute, Router, NavigationEnd } from '@angular/router';
|
|
14
12
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
15
13
|
import { Clipboard, ClipboardModule } from '@angular/cdk/clipboard';
|
|
16
14
|
import { LOCATION, LOCAL_STORAGE, WINDOW } from '@ng-web-apis/common';
|
|
17
15
|
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
16
|
+
import { TuiSidebarDirective, TuiSidebarModule } from '@taiga-ui/addon-mobile';
|
|
17
|
+
import { Title } from '@angular/platform-browser';
|
|
18
18
|
|
|
19
19
|
function rawLoad(content) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -25,8 +25,8 @@ function rawLoad(content) {
|
|
|
25
25
|
let TuiDocCodeComponent = class TuiDocCodeComponent {
|
|
26
26
|
constructor() {
|
|
27
27
|
this.rawLoader$$ = new BehaviorSubject('');
|
|
28
|
-
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
|
|
29
28
|
this.filename = '';
|
|
29
|
+
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
|
|
30
30
|
}
|
|
31
31
|
set code(code) {
|
|
32
32
|
this.rawLoader$$.next(code);
|
|
@@ -165,6 +165,8 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
|
|
|
165
165
|
this.destroy$ = destroy$;
|
|
166
166
|
this.renderer = renderer;
|
|
167
167
|
this.texts = texts;
|
|
168
|
+
this.initialX = 0;
|
|
169
|
+
this.wrapperWidth = 0;
|
|
168
170
|
this.control = null;
|
|
169
171
|
this.updateOnVariants = ['change', 'blur', 'submit'];
|
|
170
172
|
this.updateOn = 'change';
|
|
@@ -174,8 +176,6 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
|
|
|
174
176
|
this.mode = null;
|
|
175
177
|
this.change$ = new Subject();
|
|
176
178
|
this.items = ['onLight', 'onDark'];
|
|
177
|
-
this.initialX = 0;
|
|
178
|
-
this.wrapperWidth = 0;
|
|
179
179
|
this.isBrowser = isPlatformBrowser(platformId);
|
|
180
180
|
const parsedMode = locationRef.path().match(/tui-mode=(onDark|onLight)/);
|
|
181
181
|
if (parsedMode !== null && parsedMode.length > 0) {
|
|
@@ -191,6 +191,9 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
|
|
|
191
191
|
this.change$.next();
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
+
onResize() {
|
|
195
|
+
this.setResizerTextContent();
|
|
196
|
+
}
|
|
194
197
|
ngOnInit() {
|
|
195
198
|
this.createForm();
|
|
196
199
|
}
|
|
@@ -207,9 +210,6 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
|
|
|
207
210
|
const { offsetWidth } = this.content.nativeElement;
|
|
208
211
|
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
|
|
209
212
|
}
|
|
210
|
-
onResize() {
|
|
211
|
-
this.setResizerTextContent();
|
|
212
|
-
}
|
|
213
213
|
onDragStart(event) {
|
|
214
214
|
event.preventDefault();
|
|
215
215
|
this.initialX = event.clientX;
|
|
@@ -253,12 +253,6 @@ TuiDocDemoComponent.ctorParameters = () => [
|
|
|
253
253
|
{ type: UrlSerializer, decorators: [{ type: Inject, args: [UrlSerializer,] }] },
|
|
254
254
|
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
|
|
255
255
|
];
|
|
256
|
-
__decorate([
|
|
257
|
-
Input()
|
|
258
|
-
], TuiDocDemoComponent.prototype, "control", void 0);
|
|
259
|
-
__decorate([
|
|
260
|
-
ContentChild(TemplateRef)
|
|
261
|
-
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
262
256
|
__decorate([
|
|
263
257
|
ViewChild('content')
|
|
264
258
|
], TuiDocDemoComponent.prototype, "content", void 0);
|
|
@@ -268,6 +262,12 @@ __decorate([
|
|
|
268
262
|
__decorate([
|
|
269
263
|
ViewChild('resizerText')
|
|
270
264
|
], TuiDocDemoComponent.prototype, "resizerText", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
Input()
|
|
267
|
+
], TuiDocDemoComponent.prototype, "control", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
ContentChild(TemplateRef)
|
|
270
|
+
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
271
271
|
__decorate([
|
|
272
272
|
HostListener('window:resize')
|
|
273
273
|
], TuiDocDemoComponent.prototype, "onResize", null);
|
|
@@ -324,410 +324,89 @@ TuiDocDemoModule = __decorate([
|
|
|
324
324
|
})
|
|
325
325
|
], TuiDocDemoModule);
|
|
326
326
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
ж: ';',
|
|
336
|
-
з: 'p',
|
|
337
|
-
и: 'b',
|
|
338
|
-
й: 'q',
|
|
339
|
-
к: 'r',
|
|
340
|
-
л: 'k',
|
|
341
|
-
м: 'v',
|
|
342
|
-
н: 'y',
|
|
343
|
-
о: 'j',
|
|
344
|
-
п: 'g',
|
|
345
|
-
р: 'h',
|
|
346
|
-
с: 'c',
|
|
347
|
-
т: 'n',
|
|
348
|
-
у: 'e',
|
|
349
|
-
ф: 'a',
|
|
350
|
-
х: '[',
|
|
351
|
-
ц: 'w',
|
|
352
|
-
ч: 'x',
|
|
353
|
-
ш: 'i',
|
|
354
|
-
щ: 'o',
|
|
355
|
-
ъ: ']',
|
|
356
|
-
ы: 's',
|
|
357
|
-
ь: 'm',
|
|
358
|
-
ю: '.',
|
|
359
|
-
я: 'z',
|
|
360
|
-
};
|
|
361
|
-
/**
|
|
362
|
-
* Translates text mistakenly typed in the Russian layout into English
|
|
363
|
-
* @param string string with Russian layout characters
|
|
364
|
-
* @return string with English layout characters
|
|
365
|
-
*/
|
|
366
|
-
function transliterateKeyboardLayout(string) {
|
|
367
|
-
let newStr = '';
|
|
368
|
-
for (let i = 0; i < string.length; i++) {
|
|
369
|
-
newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
|
|
370
|
-
}
|
|
371
|
-
return newStr;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const TUI_DOC_PAGES = new InjectionToken('Documentation pages', {
|
|
375
|
-
factory: () => [],
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
const TUI_DOC_TITLE = new InjectionToken('Page title', {
|
|
379
|
-
factory: () => '',
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
const NAVIGATION_TITLE = new InjectionToken('Page title');
|
|
383
|
-
const NAVIGATION_LABELS = new InjectionToken('Navigation sections labels for search');
|
|
384
|
-
const NAVIGATION_ITEMS = new InjectionToken('Navigation pages');
|
|
385
|
-
const NAVIGATION_PROVIDERS = [
|
|
386
|
-
TuiDestroyService,
|
|
387
|
-
{
|
|
388
|
-
provide: NAVIGATION_TITLE,
|
|
389
|
-
deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
|
|
390
|
-
useFactory: titleProviderFactory,
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
provide: NAVIGATION_LABELS,
|
|
394
|
-
deps: [TUI_DOC_PAGES],
|
|
395
|
-
useFactory: labelsProviderFactory,
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
provide: NAVIGATION_ITEMS,
|
|
399
|
-
deps: [TUI_DOC_PAGES],
|
|
400
|
-
useFactory: itemsProviderFactory,
|
|
401
|
-
},
|
|
402
|
-
];
|
|
403
|
-
function titleProviderFactory(router, activatedRoute, titlePrefix, destroy$) {
|
|
404
|
-
return router.events.pipe(filter(event => event instanceof NavigationEnd), map(() => activatedRoute.firstChild), filter(isPresent), mergeMap(({ data }) => data), map(({ title }) => titlePrefix + title), takeUntil(destroy$));
|
|
405
|
-
}
|
|
406
|
-
function labelsProviderFactory(pages) {
|
|
407
|
-
return pages
|
|
408
|
-
.map(({ section }) => section)
|
|
409
|
-
.filter(isPresent)
|
|
410
|
-
.filter((item, index, array) => array.indexOf(item) === index);
|
|
327
|
+
function rgbToHex(r, g, b) {
|
|
328
|
+
return ('#' +
|
|
329
|
+
[r, g, b]
|
|
330
|
+
.map(x => {
|
|
331
|
+
const hex = x.toString(16);
|
|
332
|
+
return hex.length === 1 ? '0' + hex : hex;
|
|
333
|
+
})
|
|
334
|
+
.join(''));
|
|
411
335
|
}
|
|
412
|
-
function
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
336
|
+
function hexToRgb(hex) {
|
|
337
|
+
const matches = hex
|
|
338
|
+
.replace('#', '')
|
|
339
|
+
.split('')
|
|
340
|
+
.map((char, _, array) => (array.length === 3 ? char + char : char))
|
|
341
|
+
.join('')
|
|
342
|
+
.match(/.{2}/g);
|
|
343
|
+
return matches
|
|
344
|
+
? matches.map(x => Number.parseInt(x, 16))
|
|
345
|
+
: [0, 0, 0];
|
|
418
346
|
}
|
|
419
347
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
constructor(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
|
|
424
|
-
this.documentRef = documentRef;
|
|
425
|
-
this.mode = mode;
|
|
426
|
-
this.sidebar = sidebar;
|
|
427
|
-
this.labels = labels;
|
|
428
|
-
this.items = items;
|
|
429
|
-
this.searchText = searchText;
|
|
430
|
-
this.router = router;
|
|
431
|
-
this.activatedRoute = activatedRoute;
|
|
432
|
-
this.search = '';
|
|
433
|
-
this.open = false;
|
|
434
|
-
this.openPagesArr = [];
|
|
435
|
-
this.openPagesGroupsArr = [];
|
|
436
|
-
this.active = '';
|
|
437
|
-
this.menuOpen = false;
|
|
438
|
-
this.mode$ = this.mode.change$.pipe(startWith(null), map(() => this.mode.mode || 'onLight'));
|
|
439
|
-
// Angular can't navigate no anchor links
|
|
440
|
-
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
441
|
-
title$.subscribe(title => {
|
|
442
|
-
changeDetectorRef.markForCheck();
|
|
443
|
-
titleService.setTitle(title);
|
|
444
|
-
this.openActivePageGroup();
|
|
445
|
-
this.handleAnchorLink(this.activatedRoute.snapshot.fragment);
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
get canOpen() {
|
|
449
|
-
return this.search.length > 2;
|
|
450
|
-
}
|
|
451
|
-
get filteredItems() {
|
|
452
|
-
return this.filterItems(this.flattenSubPages(this.items), this.search);
|
|
348
|
+
function inspectArray(array, depth) {
|
|
349
|
+
if (depth === 0) {
|
|
350
|
+
return '[…]';
|
|
453
351
|
}
|
|
454
|
-
|
|
455
|
-
|
|
352
|
+
let result = '';
|
|
353
|
+
let first = true;
|
|
354
|
+
for (let index = 0; index < array.length; index++) {
|
|
355
|
+
if (first) {
|
|
356
|
+
first = false;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
result += ', ';
|
|
360
|
+
}
|
|
361
|
+
result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
|
|
456
362
|
}
|
|
457
|
-
|
|
458
|
-
|
|
363
|
+
return `[${result}]`;
|
|
364
|
+
}
|
|
365
|
+
function inspectObject(object, depth) {
|
|
366
|
+
if (depth === 0) {
|
|
367
|
+
return `{…}`;
|
|
459
368
|
}
|
|
460
|
-
|
|
461
|
-
|
|
369
|
+
let result = '';
|
|
370
|
+
let first = true;
|
|
371
|
+
for (const key in object) {
|
|
372
|
+
if (!object.hasOwnProperty(key)) {
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
if (first) {
|
|
376
|
+
first = false;
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
result += ', ';
|
|
380
|
+
}
|
|
381
|
+
result += `${key}: ${inspectAny(object[key], depth - 1)}`;
|
|
462
382
|
}
|
|
463
|
-
|
|
464
|
-
|
|
383
|
+
return `{${result}}`;
|
|
384
|
+
}
|
|
385
|
+
// @bad TODO add more types
|
|
386
|
+
/**
|
|
387
|
+
* Returns readable JS entity
|
|
388
|
+
* @param data
|
|
389
|
+
* @param depth
|
|
390
|
+
* @return readable JS entity
|
|
391
|
+
*/
|
|
392
|
+
function inspectAny(data, depth) {
|
|
393
|
+
if (data === null) {
|
|
394
|
+
return 'null';
|
|
465
395
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
396
|
+
switch (typeof data) {
|
|
397
|
+
case 'string':
|
|
398
|
+
return `'${data}'`;
|
|
399
|
+
case 'undefined':
|
|
400
|
+
case 'number':
|
|
401
|
+
case 'boolean':
|
|
402
|
+
case 'function':
|
|
403
|
+
return String(data);
|
|
469
404
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
this.menuOpen = false;
|
|
473
|
-
this.search = '';
|
|
474
|
-
this.openActivePageGroup();
|
|
405
|
+
if (data instanceof RegExp) {
|
|
406
|
+
return data.toString();
|
|
475
407
|
}
|
|
476
|
-
|
|
477
|
-
return
|
|
478
|
-
title = title.toLowerCase();
|
|
479
|
-
search = search.toLowerCase();
|
|
480
|
-
keywords = keywords.toLowerCase();
|
|
481
|
-
return (title.includes(search) ||
|
|
482
|
-
keywords.includes(search) ||
|
|
483
|
-
title.includes(transliterateKeyboardLayout(search)) ||
|
|
484
|
-
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
485
|
-
search.replace(/-/gi, '').includes(title));
|
|
486
|
-
}), 'title'));
|
|
487
|
-
}
|
|
488
|
-
flattenSubPages(items) {
|
|
489
|
-
return items.reduce((array, item) => [
|
|
490
|
-
...array,
|
|
491
|
-
item.reduce((pages, page) => 'subPages' in page
|
|
492
|
-
? [...pages, ...page.subPages]
|
|
493
|
-
: [...pages, page], []),
|
|
494
|
-
], []);
|
|
495
|
-
}
|
|
496
|
-
isActiveRoute(route) {
|
|
497
|
-
return this.router.isActive(route, false);
|
|
498
|
-
}
|
|
499
|
-
handleAnchorLink(hash) {
|
|
500
|
-
setTimeout(() => {
|
|
501
|
-
this.navigateToAnchorLink(hash);
|
|
502
|
-
}, SCROLL_INTO_VIEW_DELAY);
|
|
503
|
-
}
|
|
504
|
-
openActivePageGroup() {
|
|
505
|
-
this.items.forEach((pages, pagesIndex) => {
|
|
506
|
-
pages.forEach((page, pageIndex) => {
|
|
507
|
-
if ('route' in page && this.isActiveRoute(page.route)) {
|
|
508
|
-
this.openPagesArr[pagesIndex] = true;
|
|
509
|
-
this.active = page.route;
|
|
510
|
-
}
|
|
511
|
-
if ('subPages' in page) {
|
|
512
|
-
page.subPages.forEach(subPage => {
|
|
513
|
-
if (this.isActiveRoute(subPage.route)) {
|
|
514
|
-
this.openPagesArr[pagesIndex] = true;
|
|
515
|
-
this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
|
|
516
|
-
this.active = subPage.route;
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
});
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
navigateToAnchorLink(fragment) {
|
|
524
|
-
const element = fragment && this.documentRef.querySelector(`#${fragment}`);
|
|
525
|
-
if (!element) {
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
element.classList.add('tui-doc-animated-example');
|
|
529
|
-
element.scrollIntoView({
|
|
530
|
-
block: 'start',
|
|
531
|
-
inline: 'nearest',
|
|
532
|
-
behavior: 'smooth',
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
TuiDocNavigationComponent.ctorParameters = () => [
|
|
537
|
-
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
538
|
-
{ type: Title, decorators: [{ type: Inject, args: [Title,] }] },
|
|
539
|
-
{ type: Observable, decorators: [{ type: Inject, args: [NAVIGATION_TITLE,] }] },
|
|
540
|
-
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
541
|
-
{ type: TuiModeDirective, decorators: [{ type: Inject, args: [TuiModeDirective,] }] },
|
|
542
|
-
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TuiSidebarDirective,] }] },
|
|
543
|
-
{ type: Array, decorators: [{ type: Inject, args: [NAVIGATION_LABELS,] }] },
|
|
544
|
-
{ type: undefined, decorators: [{ type: Inject, args: [NAVIGATION_ITEMS,] }] },
|
|
545
|
-
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
|
|
546
|
-
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
547
|
-
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] }
|
|
548
|
-
];
|
|
549
|
-
__decorate([
|
|
550
|
-
HostBinding('class._open')
|
|
551
|
-
], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
|
|
552
|
-
__decorate([
|
|
553
|
-
tuiPure
|
|
554
|
-
], TuiDocNavigationComponent.prototype, "filterItems", null);
|
|
555
|
-
__decorate([
|
|
556
|
-
tuiPure
|
|
557
|
-
], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
|
|
558
|
-
TuiDocNavigationComponent = __decorate([
|
|
559
|
-
Component({
|
|
560
|
-
selector: 'tui-doc-navigation',
|
|
561
|
-
template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n class=\"input\"\n [autoFocus]=\"!!sidebar\"\n [content]=\"dropdown\"\n [canOpen]=\"canOpen\"\n [(open)]=\"open\"\n>\n <tui-primitive-textfield\n iconAlign=\"left\"\n tuiTextfieldSize=\"m\"\n iconContent=\"tuiIconSearch\"\n [pseudoFocused]=\"open || null\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n [value]=\"search\"\n (valueChange)=\"onSearchChange($event)\"\n >\n {{ searchText }}\n </tui-primitive-textfield>\n <ng-template #dropdown let-activeZone>\n <tui-data-list>\n <tui-opt-group\n *ngFor=\"let group of filtered; let index = index\"\n [label]=\"labels[index] || ''\"\n >\n <a\n *ngFor=\"let item of group\"\n tuiOption\n [routerLink]=\"item.route\"\n (click)=\"onClick()\"\n >\n {{ item.title }}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-template>\n</tui-hosted-dropdown>\n\n<nav class=\"navigation\">\n <tui-scrollbar class=\"scrollbar\" [tuiMode]=\"mode$ | async\">\n <tui-accordion [closeOthers]=\"false\" [rounded]=\"false\">\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"tui-space_left-2\">\n <strong>{{ label }}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: index * 100 + subIndex}\"\n ></ng-container>\n </ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: items.length - 1 + index}\"\n ></ng-container>\n </ng-container>\n </div>\n\n <ng-template #pages let-item=\"item\" let-index=\"index\">\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{ item.title }}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"sublink sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"chevron\"\n [class.chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{ item.title }}\n </button>\n <tui-expand\n class=\"tui-space_left-1\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"section section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink sublink_small\"\n [routerLink]=\"subPage.route\"\n [scrollIntoView]=\"isActive(subPage.route)\"\n (click)=\"closeMenu()\"\n >\n {{ subPage.title }}\n </a>\n </div>\n </tui-expand>\n </div>\n </ng-template>\n </ng-template>\n </tui-scrollbar>\n</nav>\n\n<ng-content></ng-content>\n",
|
|
562
|
-
providers: NAVIGATION_PROVIDERS,
|
|
563
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
564
|
-
styles: [":host{z-index:1;display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01)}.input{display:block;margin:1.25rem}.navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.scrollbar{width:100%;scroll-behavior:smooth}.items-container{display:flex;flex-direction:column;padding:0 16px}.section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.subsection{margin-left:.5rem}.sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;font:var(--tui-font-text-m);margin-left:.5rem;line-height:2.75rem}.sublink_small{margin-left:1rem;line-height:1.5rem}.sublink_small:not(:first-child){margin-top:1rem}.sublink_subsection{margin-left:0;line-height:2.75rem}.sublink_active{color:var(--tui-text-01)}.chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.chevron_active{transform:rotate(90deg)}"]
|
|
565
|
-
}),
|
|
566
|
-
__param(0, Inject(ChangeDetectorRef)),
|
|
567
|
-
__param(1, Inject(Title)),
|
|
568
|
-
__param(2, Inject(NAVIGATION_TITLE)),
|
|
569
|
-
__param(3, Inject(DOCUMENT)),
|
|
570
|
-
__param(4, Inject(TuiModeDirective)),
|
|
571
|
-
__param(5, Optional()),
|
|
572
|
-
__param(5, Inject(TuiSidebarDirective)),
|
|
573
|
-
__param(6, Inject(NAVIGATION_LABELS)),
|
|
574
|
-
__param(7, Inject(NAVIGATION_ITEMS)),
|
|
575
|
-
__param(8, Inject(TUI_DOC_SEARCH_TEXT)),
|
|
576
|
-
__param(9, Inject(Router)),
|
|
577
|
-
__param(10, Inject(ActivatedRoute))
|
|
578
|
-
], TuiDocNavigationComponent);
|
|
579
|
-
|
|
580
|
-
let ScrollIntoViewDirective = class ScrollIntoViewDirective {
|
|
581
|
-
constructor(destroy$, { nativeElement }) {
|
|
582
|
-
this.scroll$ = new Subject();
|
|
583
|
-
this.scroll$
|
|
584
|
-
.pipe(debounceTime(750), filter(shallWe => shallWe && !!getElementObscurers(nativeElement)), takeUntil(destroy$))
|
|
585
|
-
.subscribe(() => {
|
|
586
|
-
nativeElement.scrollIntoView();
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
set scrollIntoView(shallWe) {
|
|
590
|
-
this.scroll$.next(shallWe);
|
|
591
|
-
}
|
|
592
|
-
};
|
|
593
|
-
ScrollIntoViewDirective.ctorParameters = () => [
|
|
594
|
-
{ type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
595
|
-
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] }
|
|
596
|
-
];
|
|
597
|
-
__decorate([
|
|
598
|
-
Input()
|
|
599
|
-
], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
|
|
600
|
-
ScrollIntoViewDirective = __decorate([
|
|
601
|
-
Directive({
|
|
602
|
-
selector: '[scrollIntoView]',
|
|
603
|
-
providers: [TuiDestroyService],
|
|
604
|
-
}),
|
|
605
|
-
__param(0, Inject(TuiDestroyService)),
|
|
606
|
-
__param(1, Inject(ElementRef))
|
|
607
|
-
], ScrollIntoViewDirective);
|
|
608
|
-
|
|
609
|
-
let ScrollIntoViewModule = class ScrollIntoViewModule {
|
|
610
|
-
};
|
|
611
|
-
ScrollIntoViewModule = __decorate([
|
|
612
|
-
NgModule({
|
|
613
|
-
declarations: [ScrollIntoViewDirective],
|
|
614
|
-
exports: [ScrollIntoViewDirective],
|
|
615
|
-
})
|
|
616
|
-
], ScrollIntoViewModule);
|
|
617
|
-
|
|
618
|
-
let TuiDocNavigationModule = class TuiDocNavigationModule {
|
|
619
|
-
};
|
|
620
|
-
TuiDocNavigationModule = __decorate([
|
|
621
|
-
NgModule({
|
|
622
|
-
imports: [
|
|
623
|
-
CommonModule,
|
|
624
|
-
FormsModule,
|
|
625
|
-
RouterModule,
|
|
626
|
-
ScrollIntoViewModule,
|
|
627
|
-
TuiButtonModule,
|
|
628
|
-
TuiPrimitiveTextfieldModule,
|
|
629
|
-
TuiTextfieldControllerModule,
|
|
630
|
-
TuiActiveZoneModule,
|
|
631
|
-
TuiLetModule,
|
|
632
|
-
TuiModeModule,
|
|
633
|
-
TuiLinkModule,
|
|
634
|
-
TuiExpandModule,
|
|
635
|
-
TuiHostedDropdownModule,
|
|
636
|
-
TuiDropdownControllerModule,
|
|
637
|
-
TuiAccordionModule,
|
|
638
|
-
TuiScrollbarModule,
|
|
639
|
-
TuiSvgModule,
|
|
640
|
-
TuiDataListModule,
|
|
641
|
-
TuiAutoFocusModule,
|
|
642
|
-
],
|
|
643
|
-
declarations: [TuiDocNavigationComponent],
|
|
644
|
-
exports: [TuiDocNavigationComponent],
|
|
645
|
-
})
|
|
646
|
-
], TuiDocNavigationModule);
|
|
647
|
-
|
|
648
|
-
function rgbToHex(r, g, b) {
|
|
649
|
-
return ('#' +
|
|
650
|
-
[r, g, b]
|
|
651
|
-
.map(x => {
|
|
652
|
-
const hex = x.toString(16);
|
|
653
|
-
return hex.length === 1 ? '0' + hex : hex;
|
|
654
|
-
})
|
|
655
|
-
.join(''));
|
|
656
|
-
}
|
|
657
|
-
function hexToRgb(hex) {
|
|
658
|
-
const matches = hex
|
|
659
|
-
.replace('#', '')
|
|
660
|
-
.split('')
|
|
661
|
-
.map((char, _, array) => (array.length === 3 ? char + char : char))
|
|
662
|
-
.join('')
|
|
663
|
-
.match(/.{2}/g);
|
|
664
|
-
return matches
|
|
665
|
-
? matches.map(x => Number.parseInt(x, 16))
|
|
666
|
-
: [0, 0, 0];
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
function inspectArray(array, depth) {
|
|
670
|
-
if (depth === 0) {
|
|
671
|
-
return '[…]';
|
|
672
|
-
}
|
|
673
|
-
let result = '';
|
|
674
|
-
let first = true;
|
|
675
|
-
for (let index = 0; index < array.length; index++) {
|
|
676
|
-
if (first) {
|
|
677
|
-
first = false;
|
|
678
|
-
}
|
|
679
|
-
else {
|
|
680
|
-
result += ', ';
|
|
681
|
-
}
|
|
682
|
-
result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
|
|
683
|
-
}
|
|
684
|
-
return `[${result}]`;
|
|
685
|
-
}
|
|
686
|
-
function inspectObject(object, depth) {
|
|
687
|
-
if (depth === 0) {
|
|
688
|
-
return `{…}`;
|
|
689
|
-
}
|
|
690
|
-
let result = '';
|
|
691
|
-
let first = true;
|
|
692
|
-
for (const key in object) {
|
|
693
|
-
if (!object.hasOwnProperty(key)) {
|
|
694
|
-
continue;
|
|
695
|
-
}
|
|
696
|
-
if (first) {
|
|
697
|
-
first = false;
|
|
698
|
-
}
|
|
699
|
-
else {
|
|
700
|
-
result += ', ';
|
|
701
|
-
}
|
|
702
|
-
result += `${key}: ${inspectAny(object[key], depth - 1)}`;
|
|
703
|
-
}
|
|
704
|
-
return `{${result}}`;
|
|
705
|
-
}
|
|
706
|
-
// @bad TODO add more types
|
|
707
|
-
/**
|
|
708
|
-
* Returns readable JS entity
|
|
709
|
-
* @param data
|
|
710
|
-
* @param depth
|
|
711
|
-
* @return readable JS entity
|
|
712
|
-
*/
|
|
713
|
-
function inspectAny(data, depth) {
|
|
714
|
-
if (data === null) {
|
|
715
|
-
return 'null';
|
|
716
|
-
}
|
|
717
|
-
switch (typeof data) {
|
|
718
|
-
case 'string':
|
|
719
|
-
return `'${data}'`;
|
|
720
|
-
case 'undefined':
|
|
721
|
-
case 'number':
|
|
722
|
-
case 'boolean':
|
|
723
|
-
case 'function':
|
|
724
|
-
return String(data);
|
|
725
|
-
}
|
|
726
|
-
if (data instanceof RegExp) {
|
|
727
|
-
return data.toString();
|
|
728
|
-
}
|
|
729
|
-
if (Array.isArray(data)) {
|
|
730
|
-
return inspectArray(data, depth);
|
|
408
|
+
if (Array.isArray(data)) {
|
|
409
|
+
return inspectArray(data, depth);
|
|
731
410
|
}
|
|
732
411
|
return inspectObject(data, depth);
|
|
733
412
|
}
|
|
@@ -779,6 +458,11 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
|
|
|
779
458
|
this.documentationPropertyValueChange.emit(value);
|
|
780
459
|
this.setQueryParam(value);
|
|
781
460
|
}
|
|
461
|
+
emitEvent(event) {
|
|
462
|
+
// For more convenient debugging
|
|
463
|
+
console.log(this.attrName, event);
|
|
464
|
+
this.emits$.next(this.emits$.value + 1);
|
|
465
|
+
}
|
|
782
466
|
parseParams(params) {
|
|
783
467
|
if (!params[this.documentationPropertyName] &&
|
|
784
468
|
!params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
|
|
@@ -804,11 +488,6 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
|
|
|
804
488
|
tree.queryParams = Object.assign(Object.assign({}, tree.queryParams), { [propName]: computedValue });
|
|
805
489
|
this.locationRef.go(String(tree));
|
|
806
490
|
}
|
|
807
|
-
emitEvent(event) {
|
|
808
|
-
// For more convenient debugging
|
|
809
|
-
console.log(this.attrName, event);
|
|
810
|
-
this.emits$.next(this.emits$.value + 1);
|
|
811
|
-
}
|
|
812
491
|
};
|
|
813
492
|
TuiDocDocumentationPropertyConnectorDirective.ctorParameters = () => [
|
|
814
493
|
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] },
|
|
@@ -958,7 +637,7 @@ __decorate([
|
|
|
958
637
|
TuiDocDocumentationComponent = __decorate([
|
|
959
638
|
Component({
|
|
960
639
|
selector: 'tui-doc-documentation',
|
|
961
|
-
template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"
|
|
640
|
+
template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"tui-table__th tui-table__th_last tui-table__th_text_right t-cell t-cell_value\"\n >\n {{ texts[3] }}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"tui-table__td tui-table__td_first tui-table__td_align_center t-cell\"\n >\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property t-cell\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"tui-table__td tui-table__td_align_center tui-table__td_last tui-table__td_text_right t-cell\"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
|
|
962
641
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
963
642
|
animations: [
|
|
964
643
|
trigger('emitEvent', [
|
|
@@ -1081,129 +760,450 @@ let TuiDocExampleComponent = class TuiDocExampleComponent {
|
|
|
1081
760
|
set content(content) {
|
|
1082
761
|
this.rawLoader$$.next(content);
|
|
1083
762
|
}
|
|
1084
|
-
copyExampleLink() {
|
|
1085
|
-
const hashPosition = this.location.href.indexOf('#');
|
|
1086
|
-
const currentUrl = hashPosition > -1
|
|
1087
|
-
? this.location.href.substr(0, hashPosition)
|
|
1088
|
-
: this.location.href;
|
|
1089
|
-
const url = `${currentUrl}#${this.id}`;
|
|
1090
|
-
this.clipboard.copy(url);
|
|
1091
|
-
this.notifications
|
|
1092
|
-
.show(this.texts[1], {
|
|
1093
|
-
label: this.texts[2],
|
|
1094
|
-
status: "success" /* Success */,
|
|
1095
|
-
})
|
|
1096
|
-
.subscribe();
|
|
763
|
+
copyExampleLink() {
|
|
764
|
+
const hashPosition = this.location.href.indexOf('#');
|
|
765
|
+
const currentUrl = hashPosition > -1
|
|
766
|
+
? this.location.href.substr(0, hashPosition)
|
|
767
|
+
: this.location.href;
|
|
768
|
+
const url = `${currentUrl}#${this.id}`;
|
|
769
|
+
this.clipboard.copy(url);
|
|
770
|
+
this.notifications
|
|
771
|
+
.show(this.texts[1], {
|
|
772
|
+
label: this.texts[2],
|
|
773
|
+
status: "success" /* Success */,
|
|
774
|
+
})
|
|
775
|
+
.subscribe();
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
TuiDocExampleComponent.ctorParameters = () => [
|
|
779
|
+
{ type: String, decorators: [{ type: Attribute, args: ['id',] }] },
|
|
780
|
+
{ type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
|
|
781
|
+
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
|
|
782
|
+
{ type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
|
|
783
|
+
{ type: Observable, decorators: [{ type: Inject, args: [TUI_COPY_TEXTS,] }] },
|
|
784
|
+
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
|
|
785
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
|
|
786
|
+
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] }
|
|
787
|
+
];
|
|
788
|
+
__decorate([
|
|
789
|
+
Input()
|
|
790
|
+
], TuiDocExampleComponent.prototype, "heading", void 0);
|
|
791
|
+
__decorate([
|
|
792
|
+
Input()
|
|
793
|
+
], TuiDocExampleComponent.prototype, "description", void 0);
|
|
794
|
+
__decorate([
|
|
795
|
+
Input()
|
|
796
|
+
], TuiDocExampleComponent.prototype, "content", null);
|
|
797
|
+
__decorate([
|
|
798
|
+
Input()
|
|
799
|
+
], TuiDocExampleComponent.prototype, "componentName", void 0);
|
|
800
|
+
TuiDocExampleComponent = __decorate([
|
|
801
|
+
Component({
|
|
802
|
+
selector: 'tui-doc-example',
|
|
803
|
+
template: "<h3 *ngIf=\"heading\" class=\"t-title\">\n <span polymorpheus-outlet [content]=\"heading\"></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n polymorpheus-outlet\n class=\"t-description\"\n [content]=\"description\"\n></h4>\n\n<div *ngIf=\"processor$ | async as content\" class=\"t-example\">\n <ng-container *ngIf=\"content | tuiDocExampleGetTabs: defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button *tuiTab tuiTab>{{tab}}</button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n (click)=\"codeEditor.open(componentName, id || '', content)\"\n >\n Edit on {{codeEditor.name}}\n </button>\n </div>\n\n <ng-container\n *ngIf=\"{\n activeTab: tabs[activeItemIndex],\n code: content[tabs[activeItemIndex]] || ''\n } as state\"\n >\n <div\n *ngIf=\"state.activeTab == defaultTab; else codeSection\"\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n\n <ng-template #codeSection>\n <tui-doc-copy\n class=\"t-copy-code\"\n [cdkCopyToClipboard]=\"state.code\"\n ></tui-doc-copy>\n <tui-doc-code [code]=\"state.code\"></tui-doc-code>\n </ng-template>\n </ng-container>\n </ng-container>\n</div>\n",
|
|
804
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
805
|
+
styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}@media screen and (max-width:47.9375em){:host{padding-top:2rem}.t-title{font:var(--tui-font-heading-6)}}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-description:first-letter,.t-title:first-letter{text-transform:capitalize}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}@media screen and (max-width:47.9375em){.t-example{margin-top:.75rem}.t-tabs-wrapper{padding:0 1rem}}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}@media screen and (max-width:47.9375em){.t-demo{padding:1rem}}.t-copy-code{position:absolute;top:4.375rem;right:1rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}"]
|
|
806
|
+
}),
|
|
807
|
+
__param(0, Attribute('id')),
|
|
808
|
+
__param(1, Inject(Clipboard)),
|
|
809
|
+
__param(2, Inject(TuiNotificationsService)),
|
|
810
|
+
__param(3, Inject(LOCATION)),
|
|
811
|
+
__param(4, Inject(TUI_COPY_TEXTS)),
|
|
812
|
+
__param(5, Inject(TUI_DOC_EXAMPLE_TEXTS)),
|
|
813
|
+
__param(6, Optional()),
|
|
814
|
+
__param(6, Inject(TUI_DOC_CODE_EDITOR)),
|
|
815
|
+
__param(7, Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR))
|
|
816
|
+
], TuiDocExampleComponent);
|
|
817
|
+
|
|
818
|
+
let TuiDocExampleGetTabsPipe = class TuiDocExampleGetTabsPipe {
|
|
819
|
+
transform(content, defaultTab) {
|
|
820
|
+
return [defaultTab, ...Object.keys(content)];
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
TuiDocExampleGetTabsPipe = __decorate([
|
|
824
|
+
Pipe({ name: 'tuiDocExampleGetTabs' })
|
|
825
|
+
], TuiDocExampleGetTabsPipe);
|
|
826
|
+
|
|
827
|
+
let TuiDocExampleModule = class TuiDocExampleModule {
|
|
828
|
+
};
|
|
829
|
+
TuiDocExampleModule = __decorate([
|
|
830
|
+
NgModule({
|
|
831
|
+
imports: [
|
|
832
|
+
CommonModule,
|
|
833
|
+
ClipboardModule,
|
|
834
|
+
TuiTabsModule,
|
|
835
|
+
TuiButtonModule,
|
|
836
|
+
TuiDocCopyModule,
|
|
837
|
+
TuiDocCodeModule,
|
|
838
|
+
PolymorpheusModule,
|
|
839
|
+
],
|
|
840
|
+
declarations: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
|
|
841
|
+
exports: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
|
|
842
|
+
})
|
|
843
|
+
], TuiDocExampleModule);
|
|
844
|
+
|
|
845
|
+
var TuiDocMainComponent_1;
|
|
846
|
+
// @dynamic
|
|
847
|
+
let TuiDocMainComponent = TuiDocMainComponent_1 = class TuiDocMainComponent {
|
|
848
|
+
constructor(storage, windowRef) {
|
|
849
|
+
this.storage = storage;
|
|
850
|
+
this.windowRef = windowRef;
|
|
851
|
+
this.night = this.storage.getItem('night') === 'true' ||
|
|
852
|
+
(this.storage.getItem('night') === null &&
|
|
853
|
+
this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
854
|
+
this.change$ = new Subject();
|
|
855
|
+
}
|
|
856
|
+
get mode() {
|
|
857
|
+
return this.night ? 'onDark' : null;
|
|
858
|
+
}
|
|
859
|
+
onMode(night) {
|
|
860
|
+
this.night = night;
|
|
861
|
+
this.change$.next();
|
|
862
|
+
this.storage.setItem('night', String(night));
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
TuiDocMainComponent.ctorParameters = () => [
|
|
866
|
+
{ type: Storage, decorators: [{ type: Inject, args: [LOCAL_STORAGE,] }] },
|
|
867
|
+
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
868
|
+
];
|
|
869
|
+
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
870
|
+
Component({
|
|
871
|
+
selector: 'tui-doc-main',
|
|
872
|
+
template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-space_left-2\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
|
|
873
|
+
encapsulation: ViewEncapsulation.None,
|
|
874
|
+
providers: [
|
|
875
|
+
{
|
|
876
|
+
provide: TuiModeDirective,
|
|
877
|
+
useExisting: forwardRef(() => TuiDocMainComponent_1),
|
|
878
|
+
},
|
|
879
|
+
TuiSwipeService,
|
|
880
|
+
],
|
|
881
|
+
styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls{top:4rem!important}@-webkit-keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}@keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(.hljs):not(.exception){transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;background:var(--tui-base-02);color:var(--tui-text-02);vertical-align:middle;box-shadow:inset 0 -2px var(--tui-secondary);padding:.375rem .5rem;font-size:.875rem;border-radius:.5rem}:focus code:not(.exception){background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width:47.9375em){tui-doc-navigation.tui-doc-navigation{display:none}.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{-webkit-animation:1s .3s tuiShaking;animation:1s .3s tuiShaking}label.night-mode{cursor:pointer}.hljs-tag{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear-disabled)}.hljs-subst,.hljs-title{font-weight:400;color:var(--tui-text-01)}.hljs-comment,.hljs-quote{color:var(--tui-text-03);font-style:italic}.hljs-meta{color:#e38162}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type{font-weight:700;color:var(--tui-link)}.hljs-attribute,.hljs-link,.hljs-number,.hljs-regexp{font-weight:700;color:var(--tui-support-06)}.hljs-link,.hljs-number,.hljs-regexp{font-weight:400}.hljs-string{color:var(--tui-positive);font-weight:700}.hljs-bullet,.hljs-formula,.hljs-symbol{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}.hljs-doctag{text-decoration:underline}.hljs-template-variable,.hljs-variable{color:var(--tui-warning-fill)}.hljs-addition{background:var(--tui-success-bg)}.hljs-deletion{background:var(--tui-error-bg)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs .hljs-line-numbers{padding:0}.hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}"]
|
|
882
|
+
}),
|
|
883
|
+
__param(0, Inject(LOCAL_STORAGE)),
|
|
884
|
+
__param(1, Inject(WINDOW))
|
|
885
|
+
], TuiDocMainComponent);
|
|
886
|
+
|
|
887
|
+
let ScrollIntoViewDirective = class ScrollIntoViewDirective {
|
|
888
|
+
constructor(destroy$, { nativeElement }) {
|
|
889
|
+
this.scroll$ = new Subject();
|
|
890
|
+
this.scroll$
|
|
891
|
+
.pipe(debounceTime(750), filter(shallWe => shallWe && !!getElementObscurers(nativeElement)), takeUntil(destroy$))
|
|
892
|
+
.subscribe(() => {
|
|
893
|
+
nativeElement.scrollIntoView();
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
set scrollIntoView(shallWe) {
|
|
897
|
+
this.scroll$.next(shallWe);
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
ScrollIntoViewDirective.ctorParameters = () => [
|
|
901
|
+
{ type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
902
|
+
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] }
|
|
903
|
+
];
|
|
904
|
+
__decorate([
|
|
905
|
+
Input()
|
|
906
|
+
], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
|
|
907
|
+
ScrollIntoViewDirective = __decorate([
|
|
908
|
+
Directive({
|
|
909
|
+
selector: '[scrollIntoView]',
|
|
910
|
+
providers: [TuiDestroyService],
|
|
911
|
+
}),
|
|
912
|
+
__param(0, Inject(TuiDestroyService)),
|
|
913
|
+
__param(1, Inject(ElementRef))
|
|
914
|
+
], ScrollIntoViewDirective);
|
|
915
|
+
|
|
916
|
+
let ScrollIntoViewModule = class ScrollIntoViewModule {
|
|
917
|
+
};
|
|
918
|
+
ScrollIntoViewModule = __decorate([
|
|
919
|
+
NgModule({
|
|
920
|
+
declarations: [ScrollIntoViewDirective],
|
|
921
|
+
exports: [ScrollIntoViewDirective],
|
|
922
|
+
})
|
|
923
|
+
], ScrollIntoViewModule);
|
|
924
|
+
|
|
925
|
+
const MAP = {
|
|
926
|
+
а: 'f',
|
|
927
|
+
б: ',',
|
|
928
|
+
в: 'd',
|
|
929
|
+
г: 'u',
|
|
930
|
+
д: 'l',
|
|
931
|
+
е: 't',
|
|
932
|
+
ё: '`',
|
|
933
|
+
ж: ';',
|
|
934
|
+
з: 'p',
|
|
935
|
+
и: 'b',
|
|
936
|
+
й: 'q',
|
|
937
|
+
к: 'r',
|
|
938
|
+
л: 'k',
|
|
939
|
+
м: 'v',
|
|
940
|
+
н: 'y',
|
|
941
|
+
о: 'j',
|
|
942
|
+
п: 'g',
|
|
943
|
+
р: 'h',
|
|
944
|
+
с: 'c',
|
|
945
|
+
т: 'n',
|
|
946
|
+
у: 'e',
|
|
947
|
+
ф: 'a',
|
|
948
|
+
х: '[',
|
|
949
|
+
ц: 'w',
|
|
950
|
+
ч: 'x',
|
|
951
|
+
ш: 'i',
|
|
952
|
+
щ: 'o',
|
|
953
|
+
ъ: ']',
|
|
954
|
+
ы: 's',
|
|
955
|
+
ь: 'm',
|
|
956
|
+
ю: '.',
|
|
957
|
+
я: 'z',
|
|
958
|
+
};
|
|
959
|
+
/**
|
|
960
|
+
* Translates text mistakenly typed in the Russian layout into English
|
|
961
|
+
* @param string string with Russian layout characters
|
|
962
|
+
* @return string with English layout characters
|
|
963
|
+
*/
|
|
964
|
+
function transliterateKeyboardLayout(string) {
|
|
965
|
+
let newStr = '';
|
|
966
|
+
for (let i = 0; i < string.length; i++) {
|
|
967
|
+
newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
|
|
968
|
+
}
|
|
969
|
+
return newStr;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
const TUI_DOC_PAGES = new InjectionToken('Documentation pages', {
|
|
973
|
+
factory: () => [],
|
|
974
|
+
});
|
|
975
|
+
|
|
976
|
+
const TUI_DOC_TITLE = new InjectionToken('Page title', {
|
|
977
|
+
factory: () => '',
|
|
978
|
+
});
|
|
979
|
+
|
|
980
|
+
const NAVIGATION_TITLE = new InjectionToken('Page title');
|
|
981
|
+
const NAVIGATION_LABELS = new InjectionToken('Navigation sections labels for search');
|
|
982
|
+
const NAVIGATION_ITEMS = new InjectionToken('Navigation pages');
|
|
983
|
+
const NAVIGATION_PROVIDERS = [
|
|
984
|
+
TuiDestroyService,
|
|
985
|
+
{
|
|
986
|
+
provide: NAVIGATION_TITLE,
|
|
987
|
+
deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
|
|
988
|
+
useFactory: titleProviderFactory,
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
provide: NAVIGATION_LABELS,
|
|
992
|
+
deps: [TUI_DOC_PAGES],
|
|
993
|
+
useFactory: labelsProviderFactory,
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
provide: NAVIGATION_ITEMS,
|
|
997
|
+
deps: [TUI_DOC_PAGES],
|
|
998
|
+
useFactory: itemsProviderFactory,
|
|
999
|
+
},
|
|
1000
|
+
];
|
|
1001
|
+
function titleProviderFactory(router, activatedRoute, titlePrefix, destroy$) {
|
|
1002
|
+
return router.events.pipe(filter(event => event instanceof NavigationEnd), map(() => activatedRoute.firstChild), filter(isPresent), mergeMap(({ data }) => data), map(({ title }) => titlePrefix + title), takeUntil(destroy$));
|
|
1003
|
+
}
|
|
1004
|
+
function labelsProviderFactory(pages) {
|
|
1005
|
+
return pages
|
|
1006
|
+
.map(({ section }) => section)
|
|
1007
|
+
.filter(isPresent)
|
|
1008
|
+
.filter((item, index, array) => array.indexOf(item) === index);
|
|
1009
|
+
}
|
|
1010
|
+
function itemsProviderFactory(pages) {
|
|
1011
|
+
const labels = labelsProviderFactory(pages);
|
|
1012
|
+
return [
|
|
1013
|
+
...labels.map(label => pages.filter(({ section }) => section === label)),
|
|
1014
|
+
pages.filter(page => !page.section),
|
|
1015
|
+
];
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
const SCROLL_INTO_VIEW_DELAY = 200;
|
|
1019
|
+
// @dynamic
|
|
1020
|
+
let TuiDocNavigationComponent = class TuiDocNavigationComponent {
|
|
1021
|
+
constructor(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
|
|
1022
|
+
this.documentRef = documentRef;
|
|
1023
|
+
this.mode = mode;
|
|
1024
|
+
this.sidebar = sidebar;
|
|
1025
|
+
this.labels = labels;
|
|
1026
|
+
this.items = items;
|
|
1027
|
+
this.searchText = searchText;
|
|
1028
|
+
this.router = router;
|
|
1029
|
+
this.activatedRoute = activatedRoute;
|
|
1030
|
+
this.menuOpen = false;
|
|
1031
|
+
this.search = '';
|
|
1032
|
+
this.open = false;
|
|
1033
|
+
this.openPagesArr = [];
|
|
1034
|
+
this.openPagesGroupsArr = [];
|
|
1035
|
+
this.active = '';
|
|
1036
|
+
this.mode$ = this.mode.change$.pipe(startWith(null), map(() => this.mode.mode || 'onLight'));
|
|
1037
|
+
// Angular can't navigate no anchor links
|
|
1038
|
+
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
1039
|
+
title$.subscribe(title => {
|
|
1040
|
+
changeDetectorRef.markForCheck();
|
|
1041
|
+
titleService.setTitle(title);
|
|
1042
|
+
this.openActivePageGroup();
|
|
1043
|
+
this.handleAnchorLink(this.activatedRoute.snapshot.fragment);
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
get canOpen() {
|
|
1047
|
+
return this.search.length > 2;
|
|
1048
|
+
}
|
|
1049
|
+
get filteredItems() {
|
|
1050
|
+
return this.filterItems(this.flattenSubPages(this.items), this.search);
|
|
1051
|
+
}
|
|
1052
|
+
get itemsWithoutSections() {
|
|
1053
|
+
return this.items[this.items.length - 1];
|
|
1054
|
+
}
|
|
1055
|
+
isActive(route) {
|
|
1056
|
+
return route === this.active;
|
|
1057
|
+
}
|
|
1058
|
+
onGroupClick(index) {
|
|
1059
|
+
this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
|
|
1060
|
+
}
|
|
1061
|
+
closeMenu() {
|
|
1062
|
+
this.menuOpen = false;
|
|
1063
|
+
}
|
|
1064
|
+
onSearchChange(search) {
|
|
1065
|
+
this.search = search;
|
|
1066
|
+
this.open = this.canOpen;
|
|
1067
|
+
}
|
|
1068
|
+
onClick() {
|
|
1069
|
+
this.open = false;
|
|
1070
|
+
this.menuOpen = false;
|
|
1071
|
+
this.search = '';
|
|
1072
|
+
this.openActivePageGroup();
|
|
1073
|
+
}
|
|
1074
|
+
filterItems(items, search) {
|
|
1075
|
+
return items.map(section => uniqBy(section.filter(({ title, keywords = '' }) => {
|
|
1076
|
+
title = title.toLowerCase();
|
|
1077
|
+
search = search.toLowerCase();
|
|
1078
|
+
keywords = keywords.toLowerCase();
|
|
1079
|
+
return (title.includes(search) ||
|
|
1080
|
+
keywords.includes(search) ||
|
|
1081
|
+
title.includes(transliterateKeyboardLayout(search)) ||
|
|
1082
|
+
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
1083
|
+
search.replace(/-/gi, '').includes(title));
|
|
1084
|
+
}), 'title'));
|
|
1085
|
+
}
|
|
1086
|
+
flattenSubPages(items) {
|
|
1087
|
+
return items.reduce((array, item) => [
|
|
1088
|
+
...array,
|
|
1089
|
+
item.reduce((pages, page) => 'subPages' in page
|
|
1090
|
+
? [...pages, ...page.subPages]
|
|
1091
|
+
: [...pages, page], []),
|
|
1092
|
+
], []);
|
|
1093
|
+
}
|
|
1094
|
+
isActiveRoute(route) {
|
|
1095
|
+
return this.router.isActive(route, false);
|
|
1096
|
+
}
|
|
1097
|
+
handleAnchorLink(hash) {
|
|
1098
|
+
setTimeout(() => {
|
|
1099
|
+
this.navigateToAnchorLink(hash);
|
|
1100
|
+
}, SCROLL_INTO_VIEW_DELAY);
|
|
1101
|
+
}
|
|
1102
|
+
openActivePageGroup() {
|
|
1103
|
+
this.items.forEach((pages, pagesIndex) => {
|
|
1104
|
+
pages.forEach((page, pageIndex) => {
|
|
1105
|
+
if ('route' in page && this.isActiveRoute(page.route)) {
|
|
1106
|
+
this.openPagesArr[pagesIndex] = true;
|
|
1107
|
+
this.active = page.route;
|
|
1108
|
+
}
|
|
1109
|
+
if ('subPages' in page) {
|
|
1110
|
+
page.subPages.forEach(subPage => {
|
|
1111
|
+
if (this.isActiveRoute(subPage.route)) {
|
|
1112
|
+
this.openPagesArr[pagesIndex] = true;
|
|
1113
|
+
this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
|
|
1114
|
+
this.active = subPage.route;
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
navigateToAnchorLink(fragment) {
|
|
1122
|
+
const element = fragment && this.documentRef.querySelector(`#${fragment}`);
|
|
1123
|
+
if (!element) {
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
element.classList.add('tui-doc-animated-example');
|
|
1127
|
+
element.scrollIntoView({
|
|
1128
|
+
block: 'start',
|
|
1129
|
+
inline: 'nearest',
|
|
1130
|
+
behavior: 'smooth',
|
|
1131
|
+
});
|
|
1097
1132
|
}
|
|
1098
1133
|
};
|
|
1099
|
-
|
|
1100
|
-
{ type:
|
|
1101
|
-
{ type:
|
|
1102
|
-
{ type:
|
|
1103
|
-
{ type:
|
|
1104
|
-
{ type:
|
|
1105
|
-
{ type:
|
|
1106
|
-
{ type:
|
|
1107
|
-
{ type: undefined, decorators: [{ type: Inject, args: [
|
|
1134
|
+
TuiDocNavigationComponent.ctorParameters = () => [
|
|
1135
|
+
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
1136
|
+
{ type: Title, decorators: [{ type: Inject, args: [Title,] }] },
|
|
1137
|
+
{ type: Observable, decorators: [{ type: Inject, args: [NAVIGATION_TITLE,] }] },
|
|
1138
|
+
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
1139
|
+
{ type: TuiModeDirective, decorators: [{ type: Inject, args: [TuiModeDirective,] }] },
|
|
1140
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TuiSidebarDirective,] }] },
|
|
1141
|
+
{ type: Array, decorators: [{ type: Inject, args: [NAVIGATION_LABELS,] }] },
|
|
1142
|
+
{ type: undefined, decorators: [{ type: Inject, args: [NAVIGATION_ITEMS,] }] },
|
|
1143
|
+
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
|
|
1144
|
+
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
1145
|
+
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] }
|
|
1108
1146
|
];
|
|
1109
1147
|
__decorate([
|
|
1110
|
-
|
|
1111
|
-
],
|
|
1112
|
-
__decorate([
|
|
1113
|
-
Input()
|
|
1114
|
-
], TuiDocExampleComponent.prototype, "description", void 0);
|
|
1148
|
+
HostBinding('class._open')
|
|
1149
|
+
], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
|
|
1115
1150
|
__decorate([
|
|
1116
|
-
|
|
1117
|
-
],
|
|
1151
|
+
tuiPure
|
|
1152
|
+
], TuiDocNavigationComponent.prototype, "filterItems", null);
|
|
1118
1153
|
__decorate([
|
|
1119
|
-
|
|
1120
|
-
],
|
|
1121
|
-
|
|
1154
|
+
tuiPure
|
|
1155
|
+
], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
|
|
1156
|
+
TuiDocNavigationComponent = __decorate([
|
|
1122
1157
|
Component({
|
|
1123
|
-
selector: 'tui-doc-
|
|
1124
|
-
template: "<
|
|
1158
|
+
selector: 'tui-doc-navigation',
|
|
1159
|
+
template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n class=\"input\"\n [autoFocus]=\"!!sidebar\"\n [content]=\"dropdown\"\n [canOpen]=\"canOpen\"\n [(open)]=\"open\"\n>\n <tui-primitive-textfield\n iconAlign=\"left\"\n tuiTextfieldSize=\"m\"\n iconContent=\"tuiIconSearch\"\n [pseudoFocused]=\"open || null\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n [value]=\"search\"\n (valueChange)=\"onSearchChange($event)\"\n >\n {{ searchText }}\n </tui-primitive-textfield>\n <ng-template #dropdown let-activeZone>\n <tui-data-list>\n <tui-opt-group\n *ngFor=\"let group of filtered; let index = index\"\n [label]=\"labels[index] || ''\"\n >\n <a\n *ngFor=\"let item of group\"\n tuiOption\n [routerLink]=\"item.route\"\n (click)=\"onClick()\"\n >\n {{ item.title }}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-template>\n</tui-hosted-dropdown>\n\n<nav class=\"navigation\">\n <tui-scrollbar class=\"scrollbar\" [tuiMode]=\"mode$ | async\">\n <tui-accordion [closeOthers]=\"false\" [rounded]=\"false\">\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"tui-space_left-2\">\n <strong>{{ label }}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: index * 100 + subIndex}\"\n ></ng-container>\n </ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n >\n <ng-container\n *ngTemplateOutlet=\"pages; context: {item: item, index: items.length - 1 + index}\"\n ></ng-container>\n </ng-container>\n </div>\n\n <ng-template #pages let-item=\"item\" let-index=\"index\">\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{ item.title }}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"sublink sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"chevron\"\n [class.chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{ item.title }}\n </button>\n <tui-expand\n class=\"tui-space_left-1\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"section section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n routerLinkActive=\"sublink_active\"\n class=\"sublink sublink_small\"\n [routerLink]=\"subPage.route\"\n [scrollIntoView]=\"isActive(subPage.route)\"\n (click)=\"closeMenu()\"\n >\n {{ subPage.title }}\n </a>\n </div>\n </tui-expand>\n </div>\n </ng-template>\n </ng-template>\n </tui-scrollbar>\n</nav>\n\n<ng-content></ng-content>\n",
|
|
1160
|
+
providers: NAVIGATION_PROVIDERS,
|
|
1125
1161
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1126
|
-
styles: [":host{
|
|
1162
|
+
styles: [":host{z-index:1;display:flex;flex-direction:column;text-align:center;background:var(--tui-base-01)}.input{display:block;margin:1.25rem}.navigation{display:flex;max-height:100%;min-height:0;flex:1 1 0;text-align:left}.scrollbar{width:100%;scroll-behavior:smooth}.items-container{display:flex;flex-direction:column;padding:0 16px}.section{display:flex;flex-direction:column;align-items:flex-start;margin:-1rem 0 -.5rem}.section_bordered{margin:.5rem 0;border-left:1px solid var(--tui-base-03)}.subsection{margin-left:.5rem}.sublink{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;font:var(--tui-font-text-m);margin-left:.5rem;line-height:2.75rem}.sublink_small{margin-left:1rem;line-height:1.5rem}.sublink_small:not(:first-child){margin-top:1rem}.sublink_subsection{margin-left:0;line-height:2.75rem}.sublink_active{color:var(--tui-text-01)}.chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:1rem;height:1rem;margin:-.25rem .25rem 0 -.1875rem}.chevron_active{transform:rotate(90deg)}"]
|
|
1127
1163
|
}),
|
|
1128
|
-
__param(0,
|
|
1129
|
-
__param(1, Inject(
|
|
1130
|
-
__param(2, Inject(
|
|
1131
|
-
__param(3, Inject(
|
|
1132
|
-
__param(4, Inject(
|
|
1133
|
-
__param(5,
|
|
1134
|
-
__param(
|
|
1135
|
-
__param(6, Inject(
|
|
1136
|
-
__param(7, Inject(
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
return [defaultTab, ...Object.keys(content)];
|
|
1142
|
-
}
|
|
1143
|
-
};
|
|
1144
|
-
TuiDocExampleGetTabsPipe = __decorate([
|
|
1145
|
-
Pipe({ name: 'tuiDocExampleGetTabs' })
|
|
1146
|
-
], TuiDocExampleGetTabsPipe);
|
|
1164
|
+
__param(0, Inject(ChangeDetectorRef)),
|
|
1165
|
+
__param(1, Inject(Title)),
|
|
1166
|
+
__param(2, Inject(NAVIGATION_TITLE)),
|
|
1167
|
+
__param(3, Inject(DOCUMENT)),
|
|
1168
|
+
__param(4, Inject(TuiModeDirective)),
|
|
1169
|
+
__param(5, Optional()),
|
|
1170
|
+
__param(5, Inject(TuiSidebarDirective)),
|
|
1171
|
+
__param(6, Inject(NAVIGATION_LABELS)),
|
|
1172
|
+
__param(7, Inject(NAVIGATION_ITEMS)),
|
|
1173
|
+
__param(8, Inject(TUI_DOC_SEARCH_TEXT)),
|
|
1174
|
+
__param(9, Inject(Router)),
|
|
1175
|
+
__param(10, Inject(ActivatedRoute))
|
|
1176
|
+
], TuiDocNavigationComponent);
|
|
1147
1177
|
|
|
1148
|
-
let
|
|
1178
|
+
let TuiDocNavigationModule = class TuiDocNavigationModule {
|
|
1149
1179
|
};
|
|
1150
|
-
|
|
1180
|
+
TuiDocNavigationModule = __decorate([
|
|
1151
1181
|
NgModule({
|
|
1152
1182
|
imports: [
|
|
1153
1183
|
CommonModule,
|
|
1154
|
-
|
|
1155
|
-
|
|
1184
|
+
FormsModule,
|
|
1185
|
+
RouterModule,
|
|
1186
|
+
ScrollIntoViewModule,
|
|
1156
1187
|
TuiButtonModule,
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1188
|
+
TuiPrimitiveTextfieldModule,
|
|
1189
|
+
TuiTextfieldControllerModule,
|
|
1190
|
+
TuiActiveZoneModule,
|
|
1191
|
+
TuiLetModule,
|
|
1192
|
+
TuiModeModule,
|
|
1193
|
+
TuiLinkModule,
|
|
1194
|
+
TuiExpandModule,
|
|
1195
|
+
TuiHostedDropdownModule,
|
|
1196
|
+
TuiDropdownControllerModule,
|
|
1197
|
+
TuiAccordionModule,
|
|
1198
|
+
TuiScrollbarModule,
|
|
1199
|
+
TuiSvgModule,
|
|
1200
|
+
TuiDataListModule,
|
|
1201
|
+
TuiAutoFocusModule,
|
|
1160
1202
|
],
|
|
1161
|
-
declarations: [
|
|
1162
|
-
exports: [
|
|
1203
|
+
declarations: [TuiDocNavigationComponent],
|
|
1204
|
+
exports: [TuiDocNavigationComponent],
|
|
1163
1205
|
})
|
|
1164
|
-
],
|
|
1165
|
-
|
|
1166
|
-
var TuiDocMainComponent_1;
|
|
1167
|
-
// @dynamic
|
|
1168
|
-
let TuiDocMainComponent = TuiDocMainComponent_1 = class TuiDocMainComponent {
|
|
1169
|
-
constructor(storage, windowRef) {
|
|
1170
|
-
this.storage = storage;
|
|
1171
|
-
this.windowRef = windowRef;
|
|
1172
|
-
this.night = this.storage.getItem('night') === 'true' ||
|
|
1173
|
-
(this.storage.getItem('night') === null &&
|
|
1174
|
-
this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
1175
|
-
this.change$ = new Subject();
|
|
1176
|
-
}
|
|
1177
|
-
get mode() {
|
|
1178
|
-
return this.night ? 'onDark' : null;
|
|
1179
|
-
}
|
|
1180
|
-
onMode(night) {
|
|
1181
|
-
this.night = night;
|
|
1182
|
-
this.change$.next();
|
|
1183
|
-
this.storage.setItem('night', String(night));
|
|
1184
|
-
}
|
|
1185
|
-
};
|
|
1186
|
-
TuiDocMainComponent.ctorParameters = () => [
|
|
1187
|
-
{ type: Storage, decorators: [{ type: Inject, args: [LOCAL_STORAGE,] }] },
|
|
1188
|
-
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
1189
|
-
];
|
|
1190
|
-
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
1191
|
-
Component({
|
|
1192
|
-
selector: 'tui-doc-main',
|
|
1193
|
-
template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-space_left-2\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
|
|
1194
|
-
encapsulation: ViewEncapsulation.None,
|
|
1195
|
-
providers: [
|
|
1196
|
-
{
|
|
1197
|
-
provide: TuiModeDirective,
|
|
1198
|
-
useExisting: forwardRef(() => TuiDocMainComponent_1),
|
|
1199
|
-
},
|
|
1200
|
-
TuiSwipeService,
|
|
1201
|
-
],
|
|
1202
|
-
styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls{top:4rem!important}@-webkit-keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}@keyframes tuiShaking{from,to{transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{transform:translate3d(-.3125rem,0,0)}20%,40%,60%,80%{transform:translate3d(.3125rem,0,0)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(.hljs):not(.exception){transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;background:var(--tui-base-02);color:var(--tui-text-02);vertical-align:middle;box-shadow:inset 0 -2px var(--tui-secondary);padding:.375rem .5rem;font-size:.875rem;border-radius:.5rem}:focus code:not(.exception){background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width:47.9375em){tui-doc-navigation.tui-doc-navigation{display:none}.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{-webkit-animation:1s .3s tuiShaking;animation:1s .3s tuiShaking}label.night-mode{cursor:pointer}.hljs-tag{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear-disabled)}.hljs-subst,.hljs-title{font-weight:400;color:var(--tui-text-01)}.hljs-comment,.hljs-quote{color:var(--tui-text-03);font-style:italic}.hljs-meta{color:#e38162}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-selector-tag,.hljs-type{font-weight:700;color:var(--tui-link)}.hljs-attribute,.hljs-link,.hljs-number,.hljs-regexp{font-weight:700;color:var(--tui-support-06)}.hljs-link,.hljs-number,.hljs-regexp{font-weight:400}.hljs-string{color:var(--tui-positive);font-weight:700}.hljs-bullet,.hljs-formula,.hljs-symbol{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}.hljs-doctag{text-decoration:underline}.hljs-template-variable,.hljs-variable{color:var(--tui-warning-fill)}.hljs-addition{background:var(--tui-success-bg)}.hljs-deletion{background:var(--tui-error-bg)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs .hljs-line-numbers{padding:0}.hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}"]
|
|
1203
|
-
}),
|
|
1204
|
-
__param(0, Inject(LOCAL_STORAGE)),
|
|
1205
|
-
__param(1, Inject(WINDOW))
|
|
1206
|
-
], TuiDocMainComponent);
|
|
1206
|
+
], TuiDocNavigationModule);
|
|
1207
1207
|
|
|
1208
1208
|
const TUI_DOC_LOGO = new InjectionToken('Main logo', {
|
|
1209
1209
|
factory: () => '',
|
|
@@ -1288,25 +1288,6 @@ const TUI_DOC_DEFAULT_TABS = new InjectionToken('Array of default tab names', {
|
|
|
1288
1288
|
factory: () => [],
|
|
1289
1289
|
});
|
|
1290
1290
|
|
|
1291
|
-
let TuiDocPageTabConnectorDirective = class TuiDocPageTabConnectorDirective {
|
|
1292
|
-
constructor(template) {
|
|
1293
|
-
this.template = template;
|
|
1294
|
-
}
|
|
1295
|
-
};
|
|
1296
|
-
TuiDocPageTabConnectorDirective.ctorParameters = () => [
|
|
1297
|
-
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
1298
|
-
];
|
|
1299
|
-
__decorate([
|
|
1300
|
-
Input(),
|
|
1301
|
-
tuiDefaultProp()
|
|
1302
|
-
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1303
|
-
TuiDocPageTabConnectorDirective = __decorate([
|
|
1304
|
-
Directive({
|
|
1305
|
-
selector: '[pageTab]',
|
|
1306
|
-
}),
|
|
1307
|
-
__param(0, Inject(TemplateRef))
|
|
1308
|
-
], TuiDocPageTabConnectorDirective);
|
|
1309
|
-
|
|
1310
1291
|
const TUI_DOC_SEE_ALSO = new InjectionToken('Array of arrays of related pages', {
|
|
1311
1292
|
factory: () => [],
|
|
1312
1293
|
});
|
|
@@ -1328,6 +1309,25 @@ function seeAlsoProviderFactory({ nativeElement }, seeAlsoGroups) {
|
|
|
1328
1309
|
return Array.from(seeAlsoSet);
|
|
1329
1310
|
}
|
|
1330
1311
|
|
|
1312
|
+
let TuiDocPageTabConnectorDirective = class TuiDocPageTabConnectorDirective {
|
|
1313
|
+
constructor(template) {
|
|
1314
|
+
this.template = template;
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
TuiDocPageTabConnectorDirective.ctorParameters = () => [
|
|
1318
|
+
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
1319
|
+
];
|
|
1320
|
+
__decorate([
|
|
1321
|
+
Input(),
|
|
1322
|
+
tuiDefaultProp()
|
|
1323
|
+
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1324
|
+
TuiDocPageTabConnectorDirective = __decorate([
|
|
1325
|
+
Directive({
|
|
1326
|
+
selector: '[pageTab]',
|
|
1327
|
+
}),
|
|
1328
|
+
__param(0, Inject(TemplateRef))
|
|
1329
|
+
], TuiDocPageTabConnectorDirective);
|
|
1330
|
+
|
|
1331
1331
|
// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
|
|
1332
1332
|
// @dynamic
|
|
1333
1333
|
let TuiDocPageComponent = class TuiDocPageComponent {
|
|
@@ -1339,8 +1339,8 @@ let TuiDocPageComponent = class TuiDocPageComponent {
|
|
|
1339
1339
|
this.package = '';
|
|
1340
1340
|
this.type = '';
|
|
1341
1341
|
this.path = '';
|
|
1342
|
-
this.activeItemIndex = NaN;
|
|
1343
1342
|
this.tabConnectors = EMPTY_QUERY;
|
|
1343
|
+
this.activeItemIndex = NaN;
|
|
1344
1344
|
}
|
|
1345
1345
|
get showSeeAlso() {
|
|
1346
1346
|
return !!this.seeAlso.length && this.activeItemIndex === 0;
|
|
@@ -1552,6 +1552,20 @@ const TUI_DOC_RUSSIAN = [
|
|
|
1552
1552
|
},
|
|
1553
1553
|
];
|
|
1554
1554
|
|
|
1555
|
+
let TuiAddonDocModule = class TuiAddonDocModule {
|
|
1556
|
+
};
|
|
1557
|
+
TuiAddonDocModule = __decorate([
|
|
1558
|
+
NgModule({
|
|
1559
|
+
exports: [
|
|
1560
|
+
TuiDocCodeModule,
|
|
1561
|
+
TuiDocDemoModule,
|
|
1562
|
+
TuiDocDocumentationModule,
|
|
1563
|
+
TuiDocPageModule,
|
|
1564
|
+
TuiDocExampleModule,
|
|
1565
|
+
],
|
|
1566
|
+
})
|
|
1567
|
+
], TuiAddonDocModule);
|
|
1568
|
+
|
|
1555
1569
|
/**
|
|
1556
1570
|
* Generates typical page routing structure
|
|
1557
1571
|
*/
|
|
@@ -1570,20 +1584,6 @@ function generateRoutes(type) {
|
|
|
1570
1584
|
];
|
|
1571
1585
|
}
|
|
1572
1586
|
|
|
1573
|
-
let TuiAddonDocModule = class TuiAddonDocModule {
|
|
1574
|
-
};
|
|
1575
|
-
TuiAddonDocModule = __decorate([
|
|
1576
|
-
NgModule({
|
|
1577
|
-
exports: [
|
|
1578
|
-
TuiDocCodeModule,
|
|
1579
|
-
TuiDocDemoModule,
|
|
1580
|
-
TuiDocDocumentationModule,
|
|
1581
|
-
TuiDocPageModule,
|
|
1582
|
-
TuiDocExampleModule,
|
|
1583
|
-
],
|
|
1584
|
-
})
|
|
1585
|
-
], TuiAddonDocModule);
|
|
1586
|
-
|
|
1587
1587
|
/**
|
|
1588
1588
|
* Public API Surface of @taiga-ui/addon-doc
|
|
1589
1589
|
*/
|
|
@@ -1592,5 +1592,5 @@ TuiAddonDocModule = __decorate([
|
|
|
1592
1592
|
* Generated bundle index. Do not edit.
|
|
1593
1593
|
*/
|
|
1594
1594
|
|
|
1595
|
-
export { DEMO_TEXTS, DOC_TEXTS, EXAMPLE_TEXTS, ScrollIntoViewDirective, ScrollIntoViewModule, 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_RUSSIAN, 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, TuiAddonDocModule, TuiDocCodeComponent, TuiDocCodeModule, TuiDocCopyComponent, TuiDocCopyModule, TuiDocDemoComponent, TuiDocDemoModule, TuiDocDocumentationComponent, TuiDocDocumentationModule, TuiDocDocumentationPropertyConnectorDirective, TuiDocExampleComponent, TuiDocExampleModule, TuiDocMainComponent, TuiDocMainModule, TuiDocNavigationComponent, TuiDocNavigationModule, TuiDocPageComponent, TuiDocPageModule, TuiDocPageTabConnectorDirective, generateRoutes,
|
|
1595
|
+
export { DEMO_TEXTS, DOC_TEXTS, EXAMPLE_TEXTS, ScrollIntoViewDirective, ScrollIntoViewModule, 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_RUSSIAN, 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, TuiAddonDocModule, TuiDocCodeComponent, TuiDocCodeModule, TuiDocCopyComponent, TuiDocCopyModule, TuiDocDemoComponent, TuiDocDemoModule, TuiDocDocumentationComponent, TuiDocDocumentationModule, TuiDocDocumentationPropertyConnectorDirective, TuiDocExampleComponent, TuiDocExampleModule, TuiDocMainComponent, TuiDocMainModule, TuiDocNavigationComponent, TuiDocNavigationModule, TuiDocPageComponent, TuiDocPageModule, TuiDocPageTabConnectorDirective, generateRoutes, TuiInputOpacityModule as ɵa, TuiInputOpacityDirective as ɵb, TuiDocExampleGetTabsPipe as ɵc, TuiDocHeaderModule as ɵd, NAVIGATION_TITLE as ɵe, NAVIGATION_LABELS as ɵf, NAVIGATION_ITEMS as ɵg, NAVIGATION_PROVIDERS as ɵh, titleProviderFactory as ɵi, labelsProviderFactory as ɵj, itemsProviderFactory as ɵk, TuiDocHeaderComponent as ɵl, PAGE_SEE_ALSO as ɵm, PAGE_PROVIDERS as ɵn, seeAlsoProviderFactory as ɵo, TuiDocSeeAlsoModule as ɵp, TuiDocSeeAlsoComponent as ɵq, TuiDocSourceCodeModule as ɵr, TuiDocSourceCodeComponent as ɵs };
|
|
1596
1596
|
//# sourceMappingURL=taiga-ui-addon-doc.js.map
|