@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, __generator, __decorate, __param, __assign, __spread, __read, __values } 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 () {
|
|
@@ -39,8 +39,8 @@ function rawLoad(content) {
|
|
|
39
39
|
var TuiDocCodeComponent = /** @class */ (function () {
|
|
40
40
|
function TuiDocCodeComponent() {
|
|
41
41
|
this.rawLoader$$ = new BehaviorSubject('');
|
|
42
|
-
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
|
|
43
42
|
this.filename = '';
|
|
43
|
+
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
|
|
44
44
|
}
|
|
45
45
|
Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
|
|
46
46
|
set: function (code) {
|
|
@@ -199,6 +199,8 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
199
199
|
this.destroy$ = destroy$;
|
|
200
200
|
this.renderer = renderer;
|
|
201
201
|
this.texts = texts;
|
|
202
|
+
this.initialX = 0;
|
|
203
|
+
this.wrapperWidth = 0;
|
|
202
204
|
this.control = null;
|
|
203
205
|
this.updateOnVariants = ['change', 'blur', 'submit'];
|
|
204
206
|
this.updateOn = 'change';
|
|
@@ -208,8 +210,6 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
208
210
|
this.mode = null;
|
|
209
211
|
this.change$ = new Subject();
|
|
210
212
|
this.items = ['onLight', 'onDark'];
|
|
211
|
-
this.initialX = 0;
|
|
212
|
-
this.wrapperWidth = 0;
|
|
213
213
|
this.isBrowser = isPlatformBrowser(platformId);
|
|
214
214
|
var parsedMode = locationRef.path().match(/tui-mode=(onDark|onLight)/);
|
|
215
215
|
if (parsedMode !== null && parsedMode.length > 0) {
|
|
@@ -226,6 +226,9 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
TuiDocDemoComponent_1 = TuiDocDemoComponent;
|
|
229
|
+
TuiDocDemoComponent.prototype.onResize = function () {
|
|
230
|
+
this.setResizerTextContent();
|
|
231
|
+
};
|
|
229
232
|
TuiDocDemoComponent.prototype.ngOnInit = function () {
|
|
230
233
|
this.createForm();
|
|
231
234
|
};
|
|
@@ -242,9 +245,6 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
242
245
|
var offsetWidth = this.content.nativeElement.offsetWidth;
|
|
243
246
|
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
|
|
244
247
|
};
|
|
245
|
-
TuiDocDemoComponent.prototype.onResize = function () {
|
|
246
|
-
this.setResizerTextContent();
|
|
247
|
-
};
|
|
248
248
|
TuiDocDemoComponent.prototype.onDragStart = function (event) {
|
|
249
249
|
event.preventDefault();
|
|
250
250
|
this.initialX = event.clientX;
|
|
@@ -288,12 +288,6 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
288
288
|
{ type: UrlSerializer, decorators: [{ type: Inject, args: [UrlSerializer,] }] },
|
|
289
289
|
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
|
|
290
290
|
]; };
|
|
291
|
-
__decorate([
|
|
292
|
-
Input()
|
|
293
|
-
], TuiDocDemoComponent.prototype, "control", void 0);
|
|
294
|
-
__decorate([
|
|
295
|
-
ContentChild(TemplateRef)
|
|
296
|
-
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
297
291
|
__decorate([
|
|
298
292
|
ViewChild('content')
|
|
299
293
|
], TuiDocDemoComponent.prototype, "content", void 0);
|
|
@@ -303,6 +297,12 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
303
297
|
__decorate([
|
|
304
298
|
ViewChild('resizerText')
|
|
305
299
|
], TuiDocDemoComponent.prototype, "resizerText", void 0);
|
|
300
|
+
__decorate([
|
|
301
|
+
Input()
|
|
302
|
+
], TuiDocDemoComponent.prototype, "control", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
ContentChild(TemplateRef)
|
|
305
|
+
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
306
306
|
__decorate([
|
|
307
307
|
HostListener('window:resize')
|
|
308
308
|
], TuiDocDemoComponent.prototype, "onResize", null);
|
|
@@ -364,1012 +364,1012 @@ var TuiDocDemoModule = /** @class */ (function () {
|
|
|
364
364
|
return TuiDocDemoModule;
|
|
365
365
|
}());
|
|
366
366
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
с: 'c',
|
|
387
|
-
т: 'n',
|
|
388
|
-
у: 'e',
|
|
389
|
-
ф: 'a',
|
|
390
|
-
х: '[',
|
|
391
|
-
ц: 'w',
|
|
392
|
-
ч: 'x',
|
|
393
|
-
ш: 'i',
|
|
394
|
-
щ: 'o',
|
|
395
|
-
ъ: ']',
|
|
396
|
-
ы: 's',
|
|
397
|
-
ь: 'm',
|
|
398
|
-
ю: '.',
|
|
399
|
-
я: 'z',
|
|
400
|
-
};
|
|
401
|
-
/**
|
|
402
|
-
* Translates text mistakenly typed in the Russian layout into English
|
|
403
|
-
* @param string string with Russian layout characters
|
|
404
|
-
* @return string with English layout characters
|
|
405
|
-
*/
|
|
406
|
-
function transliterateKeyboardLayout(string) {
|
|
407
|
-
var newStr = '';
|
|
408
|
-
for (var i = 0; i < string.length; i++) {
|
|
409
|
-
newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
|
|
410
|
-
}
|
|
411
|
-
return newStr;
|
|
367
|
+
function rgbToHex(r, g, b) {
|
|
368
|
+
return ('#' +
|
|
369
|
+
[r, g, b]
|
|
370
|
+
.map(function (x) {
|
|
371
|
+
var hex = x.toString(16);
|
|
372
|
+
return hex.length === 1 ? '0' + hex : hex;
|
|
373
|
+
})
|
|
374
|
+
.join(''));
|
|
375
|
+
}
|
|
376
|
+
function hexToRgb(hex) {
|
|
377
|
+
var matches = hex
|
|
378
|
+
.replace('#', '')
|
|
379
|
+
.split('')
|
|
380
|
+
.map(function (char, _, array) { return (array.length === 3 ? char + char : char); })
|
|
381
|
+
.join('')
|
|
382
|
+
.match(/.{2}/g);
|
|
383
|
+
return matches
|
|
384
|
+
? matches.map(function (x) { return Number.parseInt(x, 16); })
|
|
385
|
+
: [0, 0, 0];
|
|
412
386
|
}
|
|
413
387
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
var
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
useFactory: titleProviderFactory,
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
provide: NAVIGATION_LABELS,
|
|
434
|
-
deps: [TUI_DOC_PAGES],
|
|
435
|
-
useFactory: labelsProviderFactory,
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
provide: NAVIGATION_ITEMS,
|
|
439
|
-
deps: [TUI_DOC_PAGES],
|
|
440
|
-
useFactory: itemsProviderFactory,
|
|
441
|
-
},
|
|
442
|
-
];
|
|
443
|
-
function titleProviderFactory(router, activatedRoute, titlePrefix, destroy$) {
|
|
444
|
-
return router.events.pipe(filter(function (event) { return event instanceof NavigationEnd; }), map(function () { return activatedRoute.firstChild; }), filter(isPresent), mergeMap(function (_a) {
|
|
445
|
-
var data = _a.data;
|
|
446
|
-
return data;
|
|
447
|
-
}), map(function (_a) {
|
|
448
|
-
var title = _a.title;
|
|
449
|
-
return titlePrefix + title;
|
|
450
|
-
}), takeUntil(destroy$));
|
|
388
|
+
function inspectArray(array, depth) {
|
|
389
|
+
if (depth === 0) {
|
|
390
|
+
return '[…]';
|
|
391
|
+
}
|
|
392
|
+
var result = '';
|
|
393
|
+
var first = true;
|
|
394
|
+
for (var index = 0; index < array.length; index++) {
|
|
395
|
+
if (first) {
|
|
396
|
+
first = false;
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
result += ', ';
|
|
400
|
+
}
|
|
401
|
+
result += index in array ? inspectAny(array[index], depth - 1) : 'empty';
|
|
402
|
+
}
|
|
403
|
+
return "[" + result + "]";
|
|
451
404
|
}
|
|
452
|
-
function
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
405
|
+
function inspectObject(object, depth) {
|
|
406
|
+
if (depth === 0) {
|
|
407
|
+
return "{\u2026}";
|
|
408
|
+
}
|
|
409
|
+
var result = '';
|
|
410
|
+
var first = true;
|
|
411
|
+
for (var key in object) {
|
|
412
|
+
if (!object.hasOwnProperty(key)) {
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (first) {
|
|
416
|
+
first = false;
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
result += ', ';
|
|
420
|
+
}
|
|
421
|
+
result += key + ": " + inspectAny(object[key], depth - 1);
|
|
422
|
+
}
|
|
423
|
+
return "{" + result + "}";
|
|
460
424
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
425
|
+
// @bad TODO add more types
|
|
426
|
+
/**
|
|
427
|
+
* Returns readable JS entity
|
|
428
|
+
* @param data
|
|
429
|
+
* @param depth
|
|
430
|
+
* @return readable JS entity
|
|
431
|
+
*/
|
|
432
|
+
function inspectAny(data, depth) {
|
|
433
|
+
if (data === null) {
|
|
434
|
+
return 'null';
|
|
435
|
+
}
|
|
436
|
+
switch (typeof data) {
|
|
437
|
+
case 'string':
|
|
438
|
+
return "'" + data + "'";
|
|
439
|
+
case 'undefined':
|
|
440
|
+
case 'number':
|
|
441
|
+
case 'boolean':
|
|
442
|
+
case 'function':
|
|
443
|
+
return String(data);
|
|
444
|
+
}
|
|
445
|
+
if (data instanceof RegExp) {
|
|
446
|
+
return data.toString();
|
|
447
|
+
}
|
|
448
|
+
if (Array.isArray(data)) {
|
|
449
|
+
return inspectArray(data, depth);
|
|
450
|
+
}
|
|
451
|
+
return inspectObject(data, depth);
|
|
469
452
|
}
|
|
470
453
|
|
|
471
|
-
var
|
|
472
|
-
// @
|
|
473
|
-
var
|
|
474
|
-
function
|
|
475
|
-
|
|
476
|
-
this.
|
|
477
|
-
this.mode = mode;
|
|
478
|
-
this.sidebar = sidebar;
|
|
479
|
-
this.labels = labels;
|
|
480
|
-
this.items = items;
|
|
481
|
-
this.searchText = searchText;
|
|
482
|
-
this.router = router;
|
|
454
|
+
var SERIALIZED_SUFFIX = '$';
|
|
455
|
+
// @bad TODO: refactor output and value sync
|
|
456
|
+
var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
457
|
+
function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
|
|
458
|
+
this.template = template;
|
|
459
|
+
this.locationRef = locationRef;
|
|
483
460
|
this.activatedRoute = activatedRoute;
|
|
484
|
-
this.
|
|
485
|
-
this.
|
|
486
|
-
this.
|
|
487
|
-
this.
|
|
488
|
-
this.
|
|
489
|
-
this.
|
|
490
|
-
this.
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
changeDetectorRef.markForCheck();
|
|
495
|
-
titleService.setTitle(title);
|
|
496
|
-
_this.openActivePageGroup();
|
|
497
|
-
_this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
|
|
498
|
-
});
|
|
461
|
+
this.urlSerializer = urlSerializer;
|
|
462
|
+
this.documentationPropertyName = '';
|
|
463
|
+
this.documentationPropertyMode = null;
|
|
464
|
+
this.documentationPropertyType = '';
|
|
465
|
+
this.documentationPropertyValue = null;
|
|
466
|
+
this.documentationPropertyDeprecated = false;
|
|
467
|
+
this.documentationPropertyValues = null;
|
|
468
|
+
this.documentationPropertyValueChange = new EventEmitter();
|
|
469
|
+
this.changed$ = new Subject();
|
|
470
|
+
this.emits$ = new BehaviorSubject(1);
|
|
499
471
|
}
|
|
500
|
-
|
|
472
|
+
TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnInit = function () {
|
|
473
|
+
this.parseParams(this.activatedRoute.snapshot.queryParams);
|
|
474
|
+
};
|
|
475
|
+
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
|
|
501
476
|
get: function () {
|
|
502
|
-
|
|
477
|
+
switch (this.documentationPropertyMode) {
|
|
478
|
+
case 'input':
|
|
479
|
+
return "[" + this.documentationPropertyName + "]";
|
|
480
|
+
case 'output':
|
|
481
|
+
return "(" + this.documentationPropertyName + ")";
|
|
482
|
+
case 'input-output':
|
|
483
|
+
return "[(" + this.documentationPropertyName + ")]";
|
|
484
|
+
default:
|
|
485
|
+
return this.documentationPropertyName;
|
|
486
|
+
}
|
|
503
487
|
},
|
|
504
488
|
enumerable: true,
|
|
505
489
|
configurable: true
|
|
506
490
|
});
|
|
507
|
-
Object.defineProperty(
|
|
491
|
+
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
|
|
508
492
|
get: function () {
|
|
509
|
-
return this.
|
|
493
|
+
return !!this.documentationPropertyValues;
|
|
510
494
|
},
|
|
511
495
|
enumerable: true,
|
|
512
496
|
configurable: true
|
|
513
497
|
});
|
|
514
|
-
Object.defineProperty(
|
|
498
|
+
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
|
|
515
499
|
get: function () {
|
|
516
|
-
return this.
|
|
500
|
+
return this.documentationPropertyMode !== 'output';
|
|
517
501
|
},
|
|
518
502
|
enumerable: true,
|
|
519
503
|
configurable: true
|
|
520
504
|
});
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
};
|
|
524
|
-
TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
|
|
525
|
-
this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
|
|
526
|
-
};
|
|
527
|
-
TuiDocNavigationComponent.prototype.closeMenu = function () {
|
|
528
|
-
this.menuOpen = false;
|
|
529
|
-
};
|
|
530
|
-
TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
|
|
531
|
-
this.search = search;
|
|
532
|
-
this.open = this.canOpen;
|
|
533
|
-
};
|
|
534
|
-
TuiDocNavigationComponent.prototype.onClick = function () {
|
|
535
|
-
this.open = false;
|
|
536
|
-
this.menuOpen = false;
|
|
537
|
-
this.search = '';
|
|
538
|
-
this.openActivePageGroup();
|
|
539
|
-
};
|
|
540
|
-
TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
|
|
541
|
-
return items.map(function (section) {
|
|
542
|
-
return uniqBy(section.filter(function (_a) {
|
|
543
|
-
var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
|
|
544
|
-
title = title.toLowerCase();
|
|
545
|
-
search = search.toLowerCase();
|
|
546
|
-
keywords = keywords.toLowerCase();
|
|
547
|
-
return (title.includes(search) ||
|
|
548
|
-
keywords.includes(search) ||
|
|
549
|
-
title.includes(transliterateKeyboardLayout(search)) ||
|
|
550
|
-
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
551
|
-
search.replace(/-/gi, '').includes(title));
|
|
552
|
-
}), 'title');
|
|
553
|
-
});
|
|
554
|
-
};
|
|
555
|
-
TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
|
|
556
|
-
return items.reduce(function (array, item) { return __spread(array, [
|
|
557
|
-
item.reduce(function (pages, page) {
|
|
558
|
-
return 'subPages' in page
|
|
559
|
-
? __spread(pages, page.subPages) : __spread(pages, [page]);
|
|
560
|
-
}, []),
|
|
561
|
-
]); }, []);
|
|
562
|
-
};
|
|
563
|
-
TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
|
|
564
|
-
return this.router.isActive(route, false);
|
|
505
|
+
TuiDocDocumentationPropertyConnectorDirective.prototype.ngOnChanges = function () {
|
|
506
|
+
this.changed$.next();
|
|
565
507
|
};
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}, SCROLL_INTO_VIEW_DELAY);
|
|
508
|
+
TuiDocDocumentationPropertyConnectorDirective.prototype.onValueChange = function (value) {
|
|
509
|
+
this.documentationPropertyValue = value;
|
|
510
|
+
this.documentationPropertyValueChange.emit(value);
|
|
511
|
+
this.setQueryParam(value);
|
|
571
512
|
};
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
this.
|
|
575
|
-
|
|
576
|
-
if ('route' in page && _this.isActiveRoute(page.route)) {
|
|
577
|
-
_this.openPagesArr[pagesIndex] = true;
|
|
578
|
-
_this.active = page.route;
|
|
579
|
-
}
|
|
580
|
-
if ('subPages' in page) {
|
|
581
|
-
page.subPages.forEach(function (subPage) {
|
|
582
|
-
if (_this.isActiveRoute(subPage.route)) {
|
|
583
|
-
_this.openPagesArr[pagesIndex] = true;
|
|
584
|
-
_this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
|
|
585
|
-
_this.active = subPage.route;
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
});
|
|
590
|
-
});
|
|
513
|
+
TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
|
|
514
|
+
// For more convenient debugging
|
|
515
|
+
console.log(this.attrName, event);
|
|
516
|
+
this.emits$.next(this.emits$.value + 1);
|
|
591
517
|
};
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
518
|
+
TuiDocDocumentationPropertyConnectorDirective.prototype.parseParams = function (params) {
|
|
519
|
+
if (!params[this.documentationPropertyName] &&
|
|
520
|
+
!params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
|
|
595
521
|
return;
|
|
596
522
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
523
|
+
var isValueAvailableByKey = !!params[this.documentationPropertyName + SERIALIZED_SUFFIX];
|
|
524
|
+
if (isValueAvailableByKey && this.documentationPropertyValues) {
|
|
525
|
+
this.onValueChange(this.documentationPropertyValues[params[this.documentationPropertyName + SERIALIZED_SUFFIX]]);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
this.onValueChange(!isNaN(Number(params[this.documentationPropertyName]))
|
|
529
|
+
? Number(params[this.documentationPropertyName])
|
|
530
|
+
: params[this.documentationPropertyName]);
|
|
603
531
|
};
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
532
|
+
TuiDocDocumentationPropertyConnectorDirective.prototype.setQueryParam = function (value) {
|
|
533
|
+
var _a;
|
|
534
|
+
var tree = this.urlSerializer.parse(this.locationRef.path());
|
|
535
|
+
var isValueAvailableByKey = value instanceof Object;
|
|
536
|
+
var computedValue = isValueAvailableByKey && this.documentationPropertyValues
|
|
537
|
+
? this.documentationPropertyValues.indexOf(value)
|
|
538
|
+
: value;
|
|
539
|
+
var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
|
|
540
|
+
var propName = this.documentationPropertyName + suffix;
|
|
541
|
+
tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
|
|
542
|
+
this.locationRef.go(String(tree));
|
|
543
|
+
};
|
|
544
|
+
TuiDocDocumentationPropertyConnectorDirective.ctorParameters = function () { return [
|
|
545
|
+
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] },
|
|
546
|
+
{ type: Location$1, decorators: [{ type: Inject, args: [Location$1,] }] },
|
|
547
|
+
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] },
|
|
548
|
+
{ type: UrlSerializer, decorators: [{ type: Inject, args: [UrlSerializer,] }] }
|
|
616
549
|
]; };
|
|
617
550
|
__decorate([
|
|
618
|
-
|
|
619
|
-
],
|
|
551
|
+
Input()
|
|
552
|
+
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyName", void 0);
|
|
620
553
|
__decorate([
|
|
621
|
-
|
|
622
|
-
],
|
|
554
|
+
Input()
|
|
555
|
+
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyMode", void 0);
|
|
623
556
|
__decorate([
|
|
624
|
-
|
|
625
|
-
],
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
557
|
+
Input()
|
|
558
|
+
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyType", void 0);
|
|
559
|
+
__decorate([
|
|
560
|
+
Input()
|
|
561
|
+
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValue", void 0);
|
|
562
|
+
__decorate([
|
|
563
|
+
Input()
|
|
564
|
+
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyDeprecated", void 0);
|
|
565
|
+
__decorate([
|
|
566
|
+
Input()
|
|
567
|
+
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValues", void 0);
|
|
568
|
+
__decorate([
|
|
569
|
+
Output()
|
|
570
|
+
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
|
|
571
|
+
TuiDocDocumentationPropertyConnectorDirective = __decorate([
|
|
572
|
+
Directive({
|
|
573
|
+
selector: 'ng-template[documentationPropertyName]',
|
|
574
|
+
exportAs: 'documentationProperty',
|
|
633
575
|
}),
|
|
634
|
-
__param(0, Inject(
|
|
635
|
-
__param(1, Inject(
|
|
636
|
-
__param(2, Inject(
|
|
637
|
-
__param(3, Inject(
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
__param(5, Inject(TuiSidebarDirective)),
|
|
641
|
-
__param(6, Inject(NAVIGATION_LABELS)),
|
|
642
|
-
__param(7, Inject(NAVIGATION_ITEMS)),
|
|
643
|
-
__param(8, Inject(TUI_DOC_SEARCH_TEXT)),
|
|
644
|
-
__param(9, Inject(Router)),
|
|
645
|
-
__param(10, Inject(ActivatedRoute))
|
|
646
|
-
], TuiDocNavigationComponent);
|
|
647
|
-
return TuiDocNavigationComponent;
|
|
576
|
+
__param(0, Inject(TemplateRef)),
|
|
577
|
+
__param(1, Inject(Location$1)),
|
|
578
|
+
__param(2, Inject(ActivatedRoute)),
|
|
579
|
+
__param(3, Inject(UrlSerializer))
|
|
580
|
+
], TuiDocDocumentationPropertyConnectorDirective);
|
|
581
|
+
return TuiDocDocumentationPropertyConnectorDirective;
|
|
648
582
|
}());
|
|
649
583
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
584
|
+
// @bad TODO subscribe propertiesConnectors changes
|
|
585
|
+
// @bad TODO refactor to make more flexible
|
|
586
|
+
// @dynamic
|
|
587
|
+
var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
588
|
+
function TuiDocDocumentationComponent(changeDetectorRef, texts) {
|
|
589
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
590
|
+
this.texts = texts;
|
|
591
|
+
this.heading = '';
|
|
592
|
+
this.showValues = true;
|
|
593
|
+
this.isAPI = false;
|
|
594
|
+
this.propertiesConnectors = EMPTY_QUERY;
|
|
595
|
+
this.activeItemIndex = 0;
|
|
659
596
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
597
|
+
TuiDocDocumentationComponent.prototype.ngAfterContentInit = function () {
|
|
598
|
+
itemsQueryListObservable(this.propertiesConnectors)
|
|
599
|
+
.pipe(switchMap(function (items) { return merge.apply(void 0, __spread(items.map(function (_a) {
|
|
600
|
+
var changed$ = _a.changed$;
|
|
601
|
+
return changed$;
|
|
602
|
+
}))); }), watch(this.changeDetectorRef))
|
|
603
|
+
.subscribe();
|
|
604
|
+
};
|
|
605
|
+
Object.defineProperty(TuiDocDocumentationComponent.prototype, "type", {
|
|
606
|
+
get: function () {
|
|
607
|
+
return this.isAPI ? this.texts[0] : this.texts[1];
|
|
663
608
|
},
|
|
664
609
|
enumerable: true,
|
|
665
610
|
configurable: true
|
|
666
611
|
});
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
612
|
+
TuiDocDocumentationComponent.prototype.getColor = function (color) {
|
|
613
|
+
if (color.length === 4) {
|
|
614
|
+
return color
|
|
615
|
+
.split('')
|
|
616
|
+
.reduce(function (result, current) { return __spread(result, [current, current]); }, [])
|
|
617
|
+
.join('')
|
|
618
|
+
.replace('#', '');
|
|
619
|
+
}
|
|
620
|
+
if (color.startsWith('#')) {
|
|
621
|
+
return color;
|
|
622
|
+
}
|
|
623
|
+
if (color === 'transparent') {
|
|
624
|
+
return '#000000';
|
|
625
|
+
}
|
|
626
|
+
var parsed = color
|
|
627
|
+
.replace('rgb(', '')
|
|
628
|
+
.replace('rgba(', '')
|
|
629
|
+
.replace(')', '')
|
|
630
|
+
.replace(' ', '')
|
|
631
|
+
.split(',')
|
|
632
|
+
.map(function (v) { return Number.parseInt(v, 10); });
|
|
633
|
+
return rgbToHex.apply(void 0, __spread(parsed));
|
|
634
|
+
};
|
|
635
|
+
TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
|
|
636
|
+
if (color.startsWith('#') || color.startsWith('rgb(')) {
|
|
637
|
+
return 100;
|
|
638
|
+
}
|
|
639
|
+
if (color === 'transparent') {
|
|
640
|
+
return 0;
|
|
641
|
+
}
|
|
642
|
+
var lastComma = color.lastIndexOf(',');
|
|
643
|
+
var parsed = color
|
|
644
|
+
.substr(lastComma)
|
|
645
|
+
.replace(')', '')
|
|
646
|
+
.replace(' ', '')
|
|
647
|
+
.replace(',', '');
|
|
648
|
+
return Math.round(Number.parseFloat(parsed) * 100);
|
|
649
|
+
};
|
|
650
|
+
TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
|
|
651
|
+
var opacity = this.getOpacity(connector.documentationPropertyValue || '');
|
|
652
|
+
if (opacity === 100) {
|
|
653
|
+
connector.onValueChange(color);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
var rgb = hexToRgb(color).join(', ');
|
|
657
|
+
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
658
|
+
connector.onValueChange(result);
|
|
659
|
+
};
|
|
660
|
+
TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
|
|
661
|
+
var hex = this.getColor(connector.documentationPropertyValue || '');
|
|
662
|
+
var rgb = hexToRgb(hex);
|
|
663
|
+
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
664
|
+
connector.onValueChange(result);
|
|
665
|
+
};
|
|
666
|
+
TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
|
|
667
|
+
return name.replace('?', '');
|
|
668
|
+
};
|
|
669
|
+
TuiDocDocumentationComponent.prototype.isOptional = function (name) {
|
|
670
|
+
return name.includes('?');
|
|
671
|
+
};
|
|
672
|
+
TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
|
|
673
|
+
return type.includes('null');
|
|
674
|
+
};
|
|
675
|
+
TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
|
|
676
|
+
return type.includes('PolymorpheusContent');
|
|
677
|
+
};
|
|
678
|
+
TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
|
|
679
|
+
return inspectAny(data, 2);
|
|
680
|
+
};
|
|
681
|
+
TuiDocDocumentationComponent.ctorParameters = function () { return [
|
|
682
|
+
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
683
|
+
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DOCUMENTATION_TEXTS,] }] }
|
|
684
|
+
]; };
|
|
685
|
+
__decorate([
|
|
686
|
+
Input()
|
|
687
|
+
], TuiDocDocumentationComponent.prototype, "heading", void 0);
|
|
688
|
+
__decorate([
|
|
689
|
+
Input()
|
|
690
|
+
], TuiDocDocumentationComponent.prototype, "showValues", void 0);
|
|
691
|
+
__decorate([
|
|
692
|
+
Input()
|
|
693
|
+
], TuiDocDocumentationComponent.prototype, "isAPI", void 0);
|
|
694
|
+
__decorate([
|
|
695
|
+
ContentChildren(TuiDocDocumentationPropertyConnectorDirective)
|
|
696
|
+
], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
|
|
697
|
+
TuiDocDocumentationComponent = __decorate([
|
|
698
|
+
Component({
|
|
699
|
+
selector: 'tui-doc-documentation',
|
|
700
|
+
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",
|
|
701
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
702
|
+
animations: [
|
|
703
|
+
trigger('emitEvent', [
|
|
704
|
+
transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
|
|
705
|
+
]),
|
|
706
|
+
],
|
|
707
|
+
styles: [":host{display:block;min-width:100%}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}@media screen and (max-width:47.9375em){.t-row{display:flex;flex-wrap:wrap}.t-row_header{display:none}.t-cell_value{width:9.375rem}.t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content}.t-output{text-align:left;opacity:0}"]
|
|
708
|
+
}),
|
|
709
|
+
__param(0, Inject(ChangeDetectorRef)),
|
|
710
|
+
__param(1, Inject(TUI_DOC_DOCUMENTATION_TEXTS))
|
|
711
|
+
], TuiDocDocumentationComponent);
|
|
712
|
+
return TuiDocDocumentationComponent;
|
|
713
|
+
}());
|
|
714
|
+
|
|
715
|
+
var TuiInputOpacityDirective = /** @class */ (function () {
|
|
716
|
+
function TuiInputOpacityDirective(renderer, tuiFocusableComponent) {
|
|
717
|
+
this.renderer = renderer;
|
|
718
|
+
this.tuiFocusableComponent = tuiFocusableComponent;
|
|
719
|
+
}
|
|
720
|
+
Object.defineProperty(TuiInputOpacityDirective.prototype, "tuiInputOpacity", {
|
|
721
|
+
set: function (opacity) {
|
|
722
|
+
var nativeFocusableElement = this.tuiFocusableComponent.nativeFocusableElement;
|
|
723
|
+
if (nativeFocusableElement) {
|
|
724
|
+
this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
enumerable: true,
|
|
728
|
+
configurable: true
|
|
729
|
+
});
|
|
730
|
+
TuiInputOpacityDirective.ctorParameters = function () { return [
|
|
731
|
+
{ type: Renderer2, decorators: [{ type: Inject, args: [Renderer2,] }] },
|
|
732
|
+
{ type: undefined, decorators: [{ type: Inject, args: [TUI_FOCUSABLE_ITEM_ACCESSOR,] }] }
|
|
733
|
+
]; };
|
|
734
|
+
__decorate([
|
|
735
|
+
Input()
|
|
736
|
+
], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
|
|
737
|
+
TuiInputOpacityDirective = __decorate([
|
|
738
|
+
Directive({
|
|
739
|
+
selector: '[tuiInputOpacity]',
|
|
740
|
+
}),
|
|
741
|
+
__param(0, Inject(Renderer2)),
|
|
742
|
+
__param(1, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR))
|
|
743
|
+
], TuiInputOpacityDirective);
|
|
744
|
+
return TuiInputOpacityDirective;
|
|
745
|
+
}());
|
|
746
|
+
|
|
747
|
+
var TuiInputOpacityModule = /** @class */ (function () {
|
|
748
|
+
function TuiInputOpacityModule() {
|
|
749
|
+
}
|
|
750
|
+
TuiInputOpacityModule = __decorate([
|
|
689
751
|
NgModule({
|
|
690
|
-
declarations: [
|
|
691
|
-
exports: [
|
|
752
|
+
declarations: [TuiInputOpacityDirective],
|
|
753
|
+
exports: [TuiInputOpacityDirective],
|
|
692
754
|
})
|
|
693
|
-
],
|
|
694
|
-
return
|
|
755
|
+
], TuiInputOpacityModule);
|
|
756
|
+
return TuiInputOpacityModule;
|
|
695
757
|
}());
|
|
696
758
|
|
|
697
|
-
var
|
|
698
|
-
function
|
|
759
|
+
var TuiDocDocumentationModule = /** @class */ (function () {
|
|
760
|
+
function TuiDocDocumentationModule() {
|
|
699
761
|
}
|
|
700
|
-
|
|
762
|
+
TuiDocDocumentationModule = __decorate([
|
|
701
763
|
NgModule({
|
|
702
764
|
imports: [
|
|
703
765
|
CommonModule,
|
|
704
766
|
FormsModule,
|
|
705
767
|
RouterModule,
|
|
706
|
-
|
|
707
|
-
|
|
768
|
+
TuiBadgeModule,
|
|
769
|
+
TuiSelectModule,
|
|
770
|
+
TuiToggleModule,
|
|
771
|
+
TuiTooltipModule,
|
|
772
|
+
TuiLinkModule,
|
|
773
|
+
TuiInputCountModule,
|
|
774
|
+
TuiModeModule,
|
|
775
|
+
TuiGroupModule,
|
|
776
|
+
TuiInputOpacityModule,
|
|
708
777
|
TuiPrimitiveTextfieldModule,
|
|
709
778
|
TuiTextfieldControllerModule,
|
|
710
|
-
|
|
711
|
-
TuiLetModule,
|
|
712
|
-
TuiModeModule,
|
|
713
|
-
TuiLinkModule,
|
|
714
|
-
TuiExpandModule,
|
|
715
|
-
TuiHostedDropdownModule,
|
|
779
|
+
TuiHintControllerModule,
|
|
716
780
|
TuiDropdownControllerModule,
|
|
717
|
-
TuiAccordionModule,
|
|
718
|
-
TuiScrollbarModule,
|
|
719
|
-
TuiSvgModule,
|
|
720
781
|
TuiDataListModule,
|
|
721
|
-
|
|
782
|
+
TuiDataListWrapperModule,
|
|
783
|
+
TuiNotificationModule,
|
|
784
|
+
],
|
|
785
|
+
declarations: [
|
|
786
|
+
TuiDocDocumentationComponent,
|
|
787
|
+
TuiDocDocumentationPropertyConnectorDirective,
|
|
788
|
+
],
|
|
789
|
+
exports: [
|
|
790
|
+
TuiDocDocumentationComponent,
|
|
791
|
+
TuiDocDocumentationPropertyConnectorDirective,
|
|
722
792
|
],
|
|
723
|
-
declarations: [TuiDocNavigationComponent],
|
|
724
|
-
exports: [TuiDocNavigationComponent],
|
|
725
793
|
})
|
|
726
|
-
],
|
|
727
|
-
return
|
|
794
|
+
], TuiDocDocumentationModule);
|
|
795
|
+
return TuiDocDocumentationModule;
|
|
728
796
|
}());
|
|
729
797
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
798
|
+
var TUI_DOC_CODE_EDITOR = new InjectionToken('Contains service for opening online IDE e.g. Stackblitz');
|
|
799
|
+
|
|
800
|
+
var TUI_DOC_EXAMPLE_CONTENT_PROCESSOR = new InjectionToken('Processes content in example', { factory: function () { return identity; } });
|
|
801
|
+
|
|
802
|
+
function rawLoadRecord(example) {
|
|
803
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
804
|
+
var processedContent, _a, _b, _c, key, content, _d, _e, e_1_1;
|
|
805
|
+
var e_1, _f;
|
|
806
|
+
return __generator(this, function (_g) {
|
|
807
|
+
switch (_g.label) {
|
|
808
|
+
case 0:
|
|
809
|
+
processedContent = {};
|
|
810
|
+
_g.label = 1;
|
|
811
|
+
case 1:
|
|
812
|
+
_g.trys.push([1, 6, 7, 8]);
|
|
813
|
+
_a = __values(Object.entries(example)), _b = _a.next();
|
|
814
|
+
_g.label = 2;
|
|
815
|
+
case 2:
|
|
816
|
+
if (!!_b.done) return [3 /*break*/, 5];
|
|
817
|
+
_c = __read(_b.value, 2), key = _c[0], content = _c[1];
|
|
818
|
+
_d = processedContent;
|
|
819
|
+
_e = key;
|
|
820
|
+
return [4 /*yield*/, rawLoad(content)];
|
|
821
|
+
case 3:
|
|
822
|
+
_d[_e] = _g.sent();
|
|
823
|
+
_g.label = 4;
|
|
824
|
+
case 4:
|
|
825
|
+
_b = _a.next();
|
|
826
|
+
return [3 /*break*/, 2];
|
|
827
|
+
case 5: return [3 /*break*/, 8];
|
|
828
|
+
case 6:
|
|
829
|
+
e_1_1 = _g.sent();
|
|
830
|
+
e_1 = { error: e_1_1 };
|
|
831
|
+
return [3 /*break*/, 8];
|
|
832
|
+
case 7:
|
|
833
|
+
try {
|
|
834
|
+
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
835
|
+
}
|
|
836
|
+
finally { if (e_1) throw e_1.error; }
|
|
837
|
+
return [7 /*endfinally*/];
|
|
838
|
+
case 8: return [2 /*return*/, processedContent];
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
});
|
|
749
842
|
}
|
|
750
843
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
for (var key in object) {
|
|
775
|
-
if (!object.hasOwnProperty(key)) {
|
|
776
|
-
continue;
|
|
777
|
-
}
|
|
778
|
-
if (first) {
|
|
779
|
-
first = false;
|
|
780
|
-
}
|
|
781
|
-
else {
|
|
782
|
-
result += ', ';
|
|
783
|
-
}
|
|
784
|
-
result += key + ": " + inspectAny(object[key], depth - 1);
|
|
785
|
-
}
|
|
786
|
-
return "{" + result + "}";
|
|
787
|
-
}
|
|
788
|
-
// @bad TODO add more types
|
|
789
|
-
/**
|
|
790
|
-
* Returns readable JS entity
|
|
791
|
-
* @param data
|
|
792
|
-
* @param depth
|
|
793
|
-
* @return readable JS entity
|
|
794
|
-
*/
|
|
795
|
-
function inspectAny(data, depth) {
|
|
796
|
-
if (data === null) {
|
|
797
|
-
return 'null';
|
|
798
|
-
}
|
|
799
|
-
switch (typeof data) {
|
|
800
|
-
case 'string':
|
|
801
|
-
return "'" + data + "'";
|
|
802
|
-
case 'undefined':
|
|
803
|
-
case 'number':
|
|
804
|
-
case 'boolean':
|
|
805
|
-
case 'function':
|
|
806
|
-
return String(data);
|
|
807
|
-
}
|
|
808
|
-
if (data instanceof RegExp) {
|
|
809
|
-
return data.toString();
|
|
810
|
-
}
|
|
811
|
-
if (Array.isArray(data)) {
|
|
812
|
-
return inspectArray(data, depth);
|
|
813
|
-
}
|
|
814
|
-
return inspectObject(data, depth);
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
var SERIALIZED_SUFFIX = '$';
|
|
818
|
-
// @bad TODO: refactor output and value sync
|
|
819
|
-
var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
820
|
-
function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
|
|
821
|
-
this.template = template;
|
|
822
|
-
this.locationRef = locationRef;
|
|
823
|
-
this.activatedRoute = activatedRoute;
|
|
824
|
-
this.urlSerializer = urlSerializer;
|
|
825
|
-
this.documentationPropertyName = '';
|
|
826
|
-
this.documentationPropertyMode = null;
|
|
827
|
-
this.documentationPropertyType = '';
|
|
828
|
-
this.documentationPropertyValue = null;
|
|
829
|
-
this.documentationPropertyDeprecated = false;
|
|
830
|
-
this.documentationPropertyValues = null;
|
|
831
|
-
this.documentationPropertyValueChange = new EventEmitter();
|
|
832
|
-
this.changed$ = new Subject();
|
|
833
|
-
this.emits$ = new BehaviorSubject(1);
|
|
844
|
+
// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
|
|
845
|
+
// @dynamic
|
|
846
|
+
var TuiDocExampleComponent = /** @class */ (function () {
|
|
847
|
+
function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent) {
|
|
848
|
+
this.id = id;
|
|
849
|
+
this.clipboard = clipboard;
|
|
850
|
+
this.notifications = notifications;
|
|
851
|
+
this.location = location;
|
|
852
|
+
this.copyTexts$ = copyTexts$;
|
|
853
|
+
this.texts = texts;
|
|
854
|
+
this.codeEditor = codeEditor;
|
|
855
|
+
this.processContent = processContent;
|
|
856
|
+
this.rawLoader$$ = new BehaviorSubject({});
|
|
857
|
+
this.heading = '';
|
|
858
|
+
this.description = '';
|
|
859
|
+
this.componentName = this.location.pathname.slice(1);
|
|
860
|
+
this.activeItemIndex = 0;
|
|
861
|
+
this.defaultTab = this.texts[0];
|
|
862
|
+
this.copy$ = this.copyTexts$.pipe(map(function (_a) {
|
|
863
|
+
var _b = __read(_a, 1), copy = _b[0];
|
|
864
|
+
return copy;
|
|
865
|
+
}));
|
|
866
|
+
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoadRecord), map(this.processContent));
|
|
834
867
|
}
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
|
|
839
|
-
get: function () {
|
|
840
|
-
switch (this.documentationPropertyMode) {
|
|
841
|
-
case 'input':
|
|
842
|
-
return "[" + this.documentationPropertyName + "]";
|
|
843
|
-
case 'output':
|
|
844
|
-
return "(" + this.documentationPropertyName + ")";
|
|
845
|
-
case 'input-output':
|
|
846
|
-
return "[(" + this.documentationPropertyName + ")]";
|
|
847
|
-
default:
|
|
848
|
-
return this.documentationPropertyName;
|
|
849
|
-
}
|
|
850
|
-
},
|
|
851
|
-
enumerable: true,
|
|
852
|
-
configurable: true
|
|
853
|
-
});
|
|
854
|
-
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "hasItems", {
|
|
855
|
-
get: function () {
|
|
856
|
-
return !!this.documentationPropertyValues;
|
|
857
|
-
},
|
|
858
|
-
enumerable: true,
|
|
859
|
-
configurable: true
|
|
860
|
-
});
|
|
861
|
-
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
|
|
862
|
-
get: function () {
|
|
863
|
-
return this.documentationPropertyMode !== 'output';
|
|
868
|
+
Object.defineProperty(TuiDocExampleComponent.prototype, "content", {
|
|
869
|
+
set: function (content) {
|
|
870
|
+
this.rawLoader$$.next(content);
|
|
864
871
|
},
|
|
865
872
|
enumerable: true,
|
|
866
873
|
configurable: true
|
|
867
874
|
});
|
|
868
|
-
|
|
869
|
-
this.
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
this.
|
|
874
|
-
this.
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
var isValueAvailableByKey = !!params[this.documentationPropertyName + SERIALIZED_SUFFIX];
|
|
882
|
-
if (isValueAvailableByKey && this.documentationPropertyValues) {
|
|
883
|
-
this.onValueChange(this.documentationPropertyValues[params[this.documentationPropertyName + SERIALIZED_SUFFIX]]);
|
|
884
|
-
return;
|
|
885
|
-
}
|
|
886
|
-
this.onValueChange(!isNaN(Number(params[this.documentationPropertyName]))
|
|
887
|
-
? Number(params[this.documentationPropertyName])
|
|
888
|
-
: params[this.documentationPropertyName]);
|
|
889
|
-
};
|
|
890
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.setQueryParam = function (value) {
|
|
891
|
-
var _a;
|
|
892
|
-
var tree = this.urlSerializer.parse(this.locationRef.path());
|
|
893
|
-
var isValueAvailableByKey = value instanceof Object;
|
|
894
|
-
var computedValue = isValueAvailableByKey && this.documentationPropertyValues
|
|
895
|
-
? this.documentationPropertyValues.indexOf(value)
|
|
896
|
-
: value;
|
|
897
|
-
var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
|
|
898
|
-
var propName = this.documentationPropertyName + suffix;
|
|
899
|
-
tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
|
|
900
|
-
this.locationRef.go(String(tree));
|
|
901
|
-
};
|
|
902
|
-
TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
|
|
903
|
-
// For more convenient debugging
|
|
904
|
-
console.log(this.attrName, event);
|
|
905
|
-
this.emits$.next(this.emits$.value + 1);
|
|
875
|
+
TuiDocExampleComponent.prototype.copyExampleLink = function () {
|
|
876
|
+
var hashPosition = this.location.href.indexOf('#');
|
|
877
|
+
var currentUrl = hashPosition > -1
|
|
878
|
+
? this.location.href.substr(0, hashPosition)
|
|
879
|
+
: this.location.href;
|
|
880
|
+
var url = currentUrl + "#" + this.id;
|
|
881
|
+
this.clipboard.copy(url);
|
|
882
|
+
this.notifications
|
|
883
|
+
.show(this.texts[1], {
|
|
884
|
+
label: this.texts[2],
|
|
885
|
+
status: "success" /* Success */,
|
|
886
|
+
})
|
|
887
|
+
.subscribe();
|
|
906
888
|
};
|
|
907
|
-
|
|
908
|
-
{ type:
|
|
909
|
-
{ type:
|
|
910
|
-
{ type:
|
|
911
|
-
{ type:
|
|
889
|
+
TuiDocExampleComponent.ctorParameters = function () { return [
|
|
890
|
+
{ type: String, decorators: [{ type: Attribute, args: ['id',] }] },
|
|
891
|
+
{ type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
|
|
892
|
+
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
|
|
893
|
+
{ type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
|
|
894
|
+
{ type: Observable, decorators: [{ type: Inject, args: [TUI_COPY_TEXTS,] }] },
|
|
895
|
+
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_TEXTS,] }] },
|
|
896
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
|
|
897
|
+
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] }
|
|
912
898
|
]; };
|
|
913
899
|
__decorate([
|
|
914
900
|
Input()
|
|
915
|
-
],
|
|
916
|
-
__decorate([
|
|
917
|
-
Input()
|
|
918
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyMode", void 0);
|
|
919
|
-
__decorate([
|
|
920
|
-
Input()
|
|
921
|
-
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyType", void 0);
|
|
901
|
+
], TuiDocExampleComponent.prototype, "heading", void 0);
|
|
922
902
|
__decorate([
|
|
923
903
|
Input()
|
|
924
|
-
],
|
|
904
|
+
], TuiDocExampleComponent.prototype, "description", void 0);
|
|
925
905
|
__decorate([
|
|
926
906
|
Input()
|
|
927
|
-
],
|
|
907
|
+
], TuiDocExampleComponent.prototype, "content", null);
|
|
928
908
|
__decorate([
|
|
929
909
|
Input()
|
|
930
|
-
],
|
|
931
|
-
__decorate([
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
exportAs: 'documentationProperty',
|
|
910
|
+
], TuiDocExampleComponent.prototype, "componentName", void 0);
|
|
911
|
+
TuiDocExampleComponent = __decorate([
|
|
912
|
+
Component({
|
|
913
|
+
selector: 'tui-doc-example',
|
|
914
|
+
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",
|
|
915
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
916
|
+
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}"]
|
|
938
917
|
}),
|
|
939
|
-
__param(0,
|
|
940
|
-
__param(1, Inject(
|
|
941
|
-
__param(2, Inject(
|
|
942
|
-
__param(3, Inject(
|
|
943
|
-
|
|
944
|
-
|
|
918
|
+
__param(0, Attribute('id')),
|
|
919
|
+
__param(1, Inject(Clipboard)),
|
|
920
|
+
__param(2, Inject(TuiNotificationsService)),
|
|
921
|
+
__param(3, Inject(LOCATION)),
|
|
922
|
+
__param(4, Inject(TUI_COPY_TEXTS)),
|
|
923
|
+
__param(5, Inject(TUI_DOC_EXAMPLE_TEXTS)),
|
|
924
|
+
__param(6, Optional()),
|
|
925
|
+
__param(6, Inject(TUI_DOC_CODE_EDITOR)),
|
|
926
|
+
__param(7, Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR))
|
|
927
|
+
], TuiDocExampleComponent);
|
|
928
|
+
return TuiDocExampleComponent;
|
|
945
929
|
}());
|
|
946
930
|
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
// @dynamic
|
|
950
|
-
var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
951
|
-
function TuiDocDocumentationComponent(changeDetectorRef, texts) {
|
|
952
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
953
|
-
this.texts = texts;
|
|
954
|
-
this.heading = '';
|
|
955
|
-
this.showValues = true;
|
|
956
|
-
this.isAPI = false;
|
|
957
|
-
this.propertiesConnectors = EMPTY_QUERY;
|
|
958
|
-
this.activeItemIndex = 0;
|
|
931
|
+
var TuiDocExampleGetTabsPipe = /** @class */ (function () {
|
|
932
|
+
function TuiDocExampleGetTabsPipe() {
|
|
959
933
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
.pipe(switchMap(function (items) { return merge.apply(void 0, __spread(items.map(function (_a) {
|
|
963
|
-
var changed$ = _a.changed$;
|
|
964
|
-
return changed$;
|
|
965
|
-
}))); }), watch(this.changeDetectorRef))
|
|
966
|
-
.subscribe();
|
|
934
|
+
TuiDocExampleGetTabsPipe.prototype.transform = function (content, defaultTab) {
|
|
935
|
+
return __spread([defaultTab], Object.keys(content));
|
|
967
936
|
};
|
|
968
|
-
|
|
937
|
+
TuiDocExampleGetTabsPipe = __decorate([
|
|
938
|
+
Pipe({ name: 'tuiDocExampleGetTabs' })
|
|
939
|
+
], TuiDocExampleGetTabsPipe);
|
|
940
|
+
return TuiDocExampleGetTabsPipe;
|
|
941
|
+
}());
|
|
942
|
+
|
|
943
|
+
var TuiDocExampleModule = /** @class */ (function () {
|
|
944
|
+
function TuiDocExampleModule() {
|
|
945
|
+
}
|
|
946
|
+
TuiDocExampleModule = __decorate([
|
|
947
|
+
NgModule({
|
|
948
|
+
imports: [
|
|
949
|
+
CommonModule,
|
|
950
|
+
ClipboardModule,
|
|
951
|
+
TuiTabsModule,
|
|
952
|
+
TuiButtonModule,
|
|
953
|
+
TuiDocCopyModule,
|
|
954
|
+
TuiDocCodeModule,
|
|
955
|
+
PolymorpheusModule,
|
|
956
|
+
],
|
|
957
|
+
declarations: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
|
|
958
|
+
exports: [TuiDocExampleComponent, TuiDocExampleGetTabsPipe],
|
|
959
|
+
})
|
|
960
|
+
], TuiDocExampleModule);
|
|
961
|
+
return TuiDocExampleModule;
|
|
962
|
+
}());
|
|
963
|
+
|
|
964
|
+
// @dynamic
|
|
965
|
+
var TuiDocMainComponent = /** @class */ (function () {
|
|
966
|
+
function TuiDocMainComponent(storage, windowRef) {
|
|
967
|
+
this.storage = storage;
|
|
968
|
+
this.windowRef = windowRef;
|
|
969
|
+
this.night = this.storage.getItem('night') === 'true' ||
|
|
970
|
+
(this.storage.getItem('night') === null &&
|
|
971
|
+
this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
972
|
+
this.change$ = new Subject();
|
|
973
|
+
}
|
|
974
|
+
TuiDocMainComponent_1 = TuiDocMainComponent;
|
|
975
|
+
Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
|
|
969
976
|
get: function () {
|
|
970
|
-
return this.
|
|
977
|
+
return this.night ? 'onDark' : null;
|
|
971
978
|
},
|
|
972
979
|
enumerable: true,
|
|
973
980
|
configurable: true
|
|
974
981
|
});
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
.reduce(function (result, current) { return __spread(result, [current, current]); }, [])
|
|
980
|
-
.join('')
|
|
981
|
-
.replace('#', '');
|
|
982
|
-
}
|
|
983
|
-
if (color.startsWith('#')) {
|
|
984
|
-
return color;
|
|
985
|
-
}
|
|
986
|
-
if (color === 'transparent') {
|
|
987
|
-
return '#000000';
|
|
988
|
-
}
|
|
989
|
-
var parsed = color
|
|
990
|
-
.replace('rgb(', '')
|
|
991
|
-
.replace('rgba(', '')
|
|
992
|
-
.replace(')', '')
|
|
993
|
-
.replace(' ', '')
|
|
994
|
-
.split(',')
|
|
995
|
-
.map(function (v) { return Number.parseInt(v, 10); });
|
|
996
|
-
return rgbToHex.apply(void 0, __spread(parsed));
|
|
997
|
-
};
|
|
998
|
-
TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
|
|
999
|
-
if (color.startsWith('#') || color.startsWith('rgb(')) {
|
|
1000
|
-
return 100;
|
|
1001
|
-
}
|
|
1002
|
-
if (color === 'transparent') {
|
|
1003
|
-
return 0;
|
|
1004
|
-
}
|
|
1005
|
-
var lastComma = color.lastIndexOf(',');
|
|
1006
|
-
var parsed = color
|
|
1007
|
-
.substr(lastComma)
|
|
1008
|
-
.replace(')', '')
|
|
1009
|
-
.replace(' ', '')
|
|
1010
|
-
.replace(',', '');
|
|
1011
|
-
return Math.round(Number.parseFloat(parsed) * 100);
|
|
1012
|
-
};
|
|
1013
|
-
TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
|
|
1014
|
-
var opacity = this.getOpacity(connector.documentationPropertyValue || '');
|
|
1015
|
-
if (opacity === 100) {
|
|
1016
|
-
connector.onValueChange(color);
|
|
1017
|
-
return;
|
|
1018
|
-
}
|
|
1019
|
-
var rgb = hexToRgb(color).join(', ');
|
|
1020
|
-
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
1021
|
-
connector.onValueChange(result);
|
|
1022
|
-
};
|
|
1023
|
-
TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
|
|
1024
|
-
var hex = this.getColor(connector.documentationPropertyValue || '');
|
|
1025
|
-
var rgb = hexToRgb(hex);
|
|
1026
|
-
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
1027
|
-
connector.onValueChange(result);
|
|
1028
|
-
};
|
|
1029
|
-
TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
|
|
1030
|
-
return name.replace('?', '');
|
|
1031
|
-
};
|
|
1032
|
-
TuiDocDocumentationComponent.prototype.isOptional = function (name) {
|
|
1033
|
-
return name.includes('?');
|
|
1034
|
-
};
|
|
1035
|
-
TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
|
|
1036
|
-
return type.includes('null');
|
|
1037
|
-
};
|
|
1038
|
-
TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
|
|
1039
|
-
return type.includes('PolymorpheusContent');
|
|
1040
|
-
};
|
|
1041
|
-
TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
|
|
1042
|
-
return inspectAny(data, 2);
|
|
982
|
+
TuiDocMainComponent.prototype.onMode = function (night) {
|
|
983
|
+
this.night = night;
|
|
984
|
+
this.change$.next();
|
|
985
|
+
this.storage.setItem('night', String(night));
|
|
1043
986
|
};
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
{ type:
|
|
987
|
+
var TuiDocMainComponent_1;
|
|
988
|
+
TuiDocMainComponent.ctorParameters = function () { return [
|
|
989
|
+
{ type: Storage, decorators: [{ type: Inject, args: [LOCAL_STORAGE,] }] },
|
|
990
|
+
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
1047
991
|
]; };
|
|
1048
|
-
__decorate([
|
|
1049
|
-
Input()
|
|
1050
|
-
], TuiDocDocumentationComponent.prototype, "heading", void 0);
|
|
1051
|
-
__decorate([
|
|
1052
|
-
Input()
|
|
1053
|
-
], TuiDocDocumentationComponent.prototype, "showValues", void 0);
|
|
1054
|
-
__decorate([
|
|
1055
|
-
Input()
|
|
1056
|
-
], TuiDocDocumentationComponent.prototype, "isAPI", void 0);
|
|
1057
|
-
__decorate([
|
|
1058
|
-
ContentChildren(TuiDocDocumentationPropertyConnectorDirective)
|
|
1059
|
-
], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
|
|
1060
|
-
TuiDocDocumentationComponent = __decorate([
|
|
992
|
+
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
1061
993
|
Component({
|
|
1062
|
-
selector: 'tui-doc-
|
|
1063
|
-
template: "<
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
994
|
+
selector: 'tui-doc-main',
|
|
995
|
+
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",
|
|
996
|
+
encapsulation: ViewEncapsulation.None,
|
|
997
|
+
providers: [
|
|
998
|
+
{
|
|
999
|
+
provide: TuiModeDirective,
|
|
1000
|
+
useExisting: forwardRef(function () { return TuiDocMainComponent_1; }),
|
|
1001
|
+
},
|
|
1002
|
+
TuiSwipeService,
|
|
1069
1003
|
],
|
|
1070
|
-
styles: [":
|
|
1004
|
+
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}"]
|
|
1071
1005
|
}),
|
|
1072
|
-
__param(0, Inject(
|
|
1073
|
-
__param(1, Inject(
|
|
1074
|
-
],
|
|
1075
|
-
return
|
|
1006
|
+
__param(0, Inject(LOCAL_STORAGE)),
|
|
1007
|
+
__param(1, Inject(WINDOW))
|
|
1008
|
+
], TuiDocMainComponent);
|
|
1009
|
+
return TuiDocMainComponent;
|
|
1076
1010
|
}());
|
|
1077
1011
|
|
|
1078
|
-
var
|
|
1079
|
-
function
|
|
1080
|
-
|
|
1081
|
-
this.
|
|
1012
|
+
var ScrollIntoViewDirective = /** @class */ (function () {
|
|
1013
|
+
function ScrollIntoViewDirective(destroy$, _a) {
|
|
1014
|
+
var nativeElement = _a.nativeElement;
|
|
1015
|
+
this.scroll$ = new Subject();
|
|
1016
|
+
this.scroll$
|
|
1017
|
+
.pipe(debounceTime(750), filter(function (shallWe) { return shallWe && !!getElementObscurers(nativeElement); }), takeUntil(destroy$))
|
|
1018
|
+
.subscribe(function () {
|
|
1019
|
+
nativeElement.scrollIntoView();
|
|
1020
|
+
});
|
|
1082
1021
|
}
|
|
1083
|
-
Object.defineProperty(
|
|
1084
|
-
set: function (
|
|
1085
|
-
|
|
1086
|
-
if (nativeFocusableElement) {
|
|
1087
|
-
this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
|
|
1088
|
-
}
|
|
1022
|
+
Object.defineProperty(ScrollIntoViewDirective.prototype, "scrollIntoView", {
|
|
1023
|
+
set: function (shallWe) {
|
|
1024
|
+
this.scroll$.next(shallWe);
|
|
1089
1025
|
},
|
|
1090
1026
|
enumerable: true,
|
|
1091
1027
|
configurable: true
|
|
1092
1028
|
});
|
|
1093
|
-
|
|
1094
|
-
{ type:
|
|
1095
|
-
{ type:
|
|
1029
|
+
ScrollIntoViewDirective.ctorParameters = function () { return [
|
|
1030
|
+
{ type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
1031
|
+
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] }
|
|
1096
1032
|
]; };
|
|
1097
1033
|
__decorate([
|
|
1098
1034
|
Input()
|
|
1099
|
-
],
|
|
1100
|
-
|
|
1035
|
+
], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
|
|
1036
|
+
ScrollIntoViewDirective = __decorate([
|
|
1101
1037
|
Directive({
|
|
1102
|
-
selector: '[
|
|
1038
|
+
selector: '[scrollIntoView]',
|
|
1039
|
+
providers: [TuiDestroyService],
|
|
1103
1040
|
}),
|
|
1104
|
-
__param(0, Inject(
|
|
1105
|
-
__param(1, Inject(
|
|
1106
|
-
],
|
|
1107
|
-
return
|
|
1041
|
+
__param(0, Inject(TuiDestroyService)),
|
|
1042
|
+
__param(1, Inject(ElementRef))
|
|
1043
|
+
], ScrollIntoViewDirective);
|
|
1044
|
+
return ScrollIntoViewDirective;
|
|
1108
1045
|
}());
|
|
1109
1046
|
|
|
1110
|
-
var
|
|
1111
|
-
function
|
|
1047
|
+
var ScrollIntoViewModule = /** @class */ (function () {
|
|
1048
|
+
function ScrollIntoViewModule() {
|
|
1112
1049
|
}
|
|
1113
|
-
|
|
1050
|
+
ScrollIntoViewModule = __decorate([
|
|
1114
1051
|
NgModule({
|
|
1115
|
-
declarations: [
|
|
1116
|
-
exports: [
|
|
1052
|
+
declarations: [ScrollIntoViewDirective],
|
|
1053
|
+
exports: [ScrollIntoViewDirective],
|
|
1117
1054
|
})
|
|
1118
|
-
],
|
|
1119
|
-
return
|
|
1055
|
+
], ScrollIntoViewModule);
|
|
1056
|
+
return ScrollIntoViewModule;
|
|
1120
1057
|
}());
|
|
1121
1058
|
|
|
1122
|
-
var
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1059
|
+
var MAP = {
|
|
1060
|
+
а: 'f',
|
|
1061
|
+
б: ',',
|
|
1062
|
+
в: 'd',
|
|
1063
|
+
г: 'u',
|
|
1064
|
+
д: 'l',
|
|
1065
|
+
е: 't',
|
|
1066
|
+
ё: '`',
|
|
1067
|
+
ж: ';',
|
|
1068
|
+
з: 'p',
|
|
1069
|
+
и: 'b',
|
|
1070
|
+
й: 'q',
|
|
1071
|
+
к: 'r',
|
|
1072
|
+
л: 'k',
|
|
1073
|
+
м: 'v',
|
|
1074
|
+
н: 'y',
|
|
1075
|
+
о: 'j',
|
|
1076
|
+
п: 'g',
|
|
1077
|
+
р: 'h',
|
|
1078
|
+
с: 'c',
|
|
1079
|
+
т: 'n',
|
|
1080
|
+
у: 'e',
|
|
1081
|
+
ф: 'a',
|
|
1082
|
+
х: '[',
|
|
1083
|
+
ц: 'w',
|
|
1084
|
+
ч: 'x',
|
|
1085
|
+
ш: 'i',
|
|
1086
|
+
щ: 'o',
|
|
1087
|
+
ъ: ']',
|
|
1088
|
+
ы: 's',
|
|
1089
|
+
ь: 'm',
|
|
1090
|
+
ю: '.',
|
|
1091
|
+
я: 'z',
|
|
1092
|
+
};
|
|
1093
|
+
/**
|
|
1094
|
+
* Translates text mistakenly typed in the Russian layout into English
|
|
1095
|
+
* @param string string with Russian layout characters
|
|
1096
|
+
* @return string with English layout characters
|
|
1097
|
+
*/
|
|
1098
|
+
function transliterateKeyboardLayout(string) {
|
|
1099
|
+
var newStr = '';
|
|
1100
|
+
for (var i = 0; i < string.length; i++) {
|
|
1101
|
+
newStr += string.charAt(i) in MAP ? MAP[string.charAt(i)] : string.charAt(i);
|
|
1102
|
+
}
|
|
1103
|
+
return newStr;
|
|
1104
|
+
}
|
|
1160
1105
|
|
|
1161
|
-
var
|
|
1106
|
+
var TUI_DOC_PAGES = new InjectionToken('Documentation pages', {
|
|
1107
|
+
factory: function () { return []; },
|
|
1108
|
+
});
|
|
1162
1109
|
|
|
1163
|
-
var
|
|
1110
|
+
var TUI_DOC_TITLE = new InjectionToken('Page title', {
|
|
1111
|
+
factory: function () { return ''; },
|
|
1112
|
+
});
|
|
1164
1113
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1114
|
+
var NAVIGATION_TITLE = new InjectionToken('Page title');
|
|
1115
|
+
var NAVIGATION_LABELS = new InjectionToken('Navigation sections labels for search');
|
|
1116
|
+
var NAVIGATION_ITEMS = new InjectionToken('Navigation pages');
|
|
1117
|
+
var NAVIGATION_PROVIDERS = [
|
|
1118
|
+
TuiDestroyService,
|
|
1119
|
+
{
|
|
1120
|
+
provide: NAVIGATION_TITLE,
|
|
1121
|
+
deps: [Router, ActivatedRoute, TUI_DOC_TITLE, TuiDestroyService],
|
|
1122
|
+
useFactory: titleProviderFactory,
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
provide: NAVIGATION_LABELS,
|
|
1126
|
+
deps: [TUI_DOC_PAGES],
|
|
1127
|
+
useFactory: labelsProviderFactory,
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
provide: NAVIGATION_ITEMS,
|
|
1131
|
+
deps: [TUI_DOC_PAGES],
|
|
1132
|
+
useFactory: itemsProviderFactory,
|
|
1133
|
+
},
|
|
1134
|
+
];
|
|
1135
|
+
function titleProviderFactory(router, activatedRoute, titlePrefix, destroy$) {
|
|
1136
|
+
return router.events.pipe(filter(function (event) { return event instanceof NavigationEnd; }), map(function () { return activatedRoute.firstChild; }), filter(isPresent), mergeMap(function (_a) {
|
|
1137
|
+
var data = _a.data;
|
|
1138
|
+
return data;
|
|
1139
|
+
}), map(function (_a) {
|
|
1140
|
+
var title = _a.title;
|
|
1141
|
+
return titlePrefix + title;
|
|
1142
|
+
}), takeUntil(destroy$));
|
|
1143
|
+
}
|
|
1144
|
+
function labelsProviderFactory(pages) {
|
|
1145
|
+
return pages
|
|
1146
|
+
.map(function (_a) {
|
|
1147
|
+
var section = _a.section;
|
|
1148
|
+
return section;
|
|
1149
|
+
})
|
|
1150
|
+
.filter(isPresent)
|
|
1151
|
+
.filter(function (item, index, array) { return array.indexOf(item) === index; });
|
|
1152
|
+
}
|
|
1153
|
+
function itemsProviderFactory(pages) {
|
|
1154
|
+
var labels = labelsProviderFactory(pages);
|
|
1155
|
+
return __spread(labels.map(function (label) { return pages.filter(function (_a) {
|
|
1156
|
+
var section = _a.section;
|
|
1157
|
+
return section === label;
|
|
1158
|
+
}); }), [
|
|
1159
|
+
pages.filter(function (page) { return !page.section; }),
|
|
1160
|
+
]);
|
|
1205
1161
|
}
|
|
1206
1162
|
|
|
1207
|
-
|
|
1163
|
+
var SCROLL_INTO_VIEW_DELAY = 200;
|
|
1208
1164
|
// @dynamic
|
|
1209
|
-
var
|
|
1210
|
-
function
|
|
1211
|
-
|
|
1212
|
-
this.
|
|
1213
|
-
this.
|
|
1214
|
-
this.
|
|
1215
|
-
this.
|
|
1216
|
-
this.
|
|
1217
|
-
this.
|
|
1218
|
-
this.
|
|
1219
|
-
this.
|
|
1220
|
-
this.
|
|
1221
|
-
this.
|
|
1222
|
-
this.
|
|
1223
|
-
this.
|
|
1224
|
-
this.
|
|
1225
|
-
this.
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1165
|
+
var TuiDocNavigationComponent = /** @class */ (function () {
|
|
1166
|
+
function TuiDocNavigationComponent(changeDetectorRef, titleService, title$, documentRef, mode, sidebar, labels, items, searchText, router, activatedRoute) {
|
|
1167
|
+
var _this = this;
|
|
1168
|
+
this.documentRef = documentRef;
|
|
1169
|
+
this.mode = mode;
|
|
1170
|
+
this.sidebar = sidebar;
|
|
1171
|
+
this.labels = labels;
|
|
1172
|
+
this.items = items;
|
|
1173
|
+
this.searchText = searchText;
|
|
1174
|
+
this.router = router;
|
|
1175
|
+
this.activatedRoute = activatedRoute;
|
|
1176
|
+
this.menuOpen = false;
|
|
1177
|
+
this.search = '';
|
|
1178
|
+
this.open = false;
|
|
1179
|
+
this.openPagesArr = [];
|
|
1180
|
+
this.openPagesGroupsArr = [];
|
|
1181
|
+
this.active = '';
|
|
1182
|
+
this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode || 'onLight'; }));
|
|
1183
|
+
// Angular can't navigate no anchor links
|
|
1184
|
+
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
1185
|
+
title$.subscribe(function (title) {
|
|
1186
|
+
changeDetectorRef.markForCheck();
|
|
1187
|
+
titleService.setTitle(title);
|
|
1188
|
+
_this.openActivePageGroup();
|
|
1189
|
+
_this.handleAnchorLink(_this.activatedRoute.snapshot.fragment);
|
|
1190
|
+
});
|
|
1230
1191
|
}
|
|
1231
|
-
Object.defineProperty(
|
|
1232
|
-
|
|
1233
|
-
this.
|
|
1192
|
+
Object.defineProperty(TuiDocNavigationComponent.prototype, "canOpen", {
|
|
1193
|
+
get: function () {
|
|
1194
|
+
return this.search.length > 2;
|
|
1234
1195
|
},
|
|
1235
1196
|
enumerable: true,
|
|
1236
1197
|
configurable: true
|
|
1237
1198
|
});
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1199
|
+
Object.defineProperty(TuiDocNavigationComponent.prototype, "filteredItems", {
|
|
1200
|
+
get: function () {
|
|
1201
|
+
return this.filterItems(this.flattenSubPages(this.items), this.search);
|
|
1202
|
+
},
|
|
1203
|
+
enumerable: true,
|
|
1204
|
+
configurable: true
|
|
1205
|
+
});
|
|
1206
|
+
Object.defineProperty(TuiDocNavigationComponent.prototype, "itemsWithoutSections", {
|
|
1207
|
+
get: function () {
|
|
1208
|
+
return this.items[this.items.length - 1];
|
|
1209
|
+
},
|
|
1210
|
+
enumerable: true,
|
|
1211
|
+
configurable: true
|
|
1212
|
+
});
|
|
1213
|
+
TuiDocNavigationComponent.prototype.isActive = function (route) {
|
|
1214
|
+
return route === this.active;
|
|
1215
|
+
};
|
|
1216
|
+
TuiDocNavigationComponent.prototype.onGroupClick = function (index) {
|
|
1217
|
+
this.openPagesGroupsArr[index] = !this.openPagesGroupsArr[index];
|
|
1218
|
+
};
|
|
1219
|
+
TuiDocNavigationComponent.prototype.closeMenu = function () {
|
|
1220
|
+
this.menuOpen = false;
|
|
1221
|
+
};
|
|
1222
|
+
TuiDocNavigationComponent.prototype.onSearchChange = function (search) {
|
|
1223
|
+
this.search = search;
|
|
1224
|
+
this.open = this.canOpen;
|
|
1225
|
+
};
|
|
1226
|
+
TuiDocNavigationComponent.prototype.onClick = function () {
|
|
1227
|
+
this.open = false;
|
|
1228
|
+
this.menuOpen = false;
|
|
1229
|
+
this.search = '';
|
|
1230
|
+
this.openActivePageGroup();
|
|
1231
|
+
};
|
|
1232
|
+
TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
|
|
1233
|
+
return items.map(function (section) {
|
|
1234
|
+
return uniqBy(section.filter(function (_a) {
|
|
1235
|
+
var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
|
|
1236
|
+
title = title.toLowerCase();
|
|
1237
|
+
search = search.toLowerCase();
|
|
1238
|
+
keywords = keywords.toLowerCase();
|
|
1239
|
+
return (title.includes(search) ||
|
|
1240
|
+
keywords.includes(search) ||
|
|
1241
|
+
title.includes(transliterateKeyboardLayout(search)) ||
|
|
1242
|
+
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
1243
|
+
search.replace(/-/gi, '').includes(title));
|
|
1244
|
+
}), 'title');
|
|
1245
|
+
});
|
|
1246
|
+
};
|
|
1247
|
+
TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
|
|
1248
|
+
return items.reduce(function (array, item) { return __spread(array, [
|
|
1249
|
+
item.reduce(function (pages, page) {
|
|
1250
|
+
return 'subPages' in page
|
|
1251
|
+
? __spread(pages, page.subPages) : __spread(pages, [page]);
|
|
1252
|
+
}, []),
|
|
1253
|
+
]); }, []);
|
|
1254
|
+
};
|
|
1255
|
+
TuiDocNavigationComponent.prototype.isActiveRoute = function (route) {
|
|
1256
|
+
return this.router.isActive(route, false);
|
|
1257
|
+
};
|
|
1258
|
+
TuiDocNavigationComponent.prototype.handleAnchorLink = function (hash) {
|
|
1259
|
+
var _this = this;
|
|
1260
|
+
setTimeout(function () {
|
|
1261
|
+
_this.navigateToAnchorLink(hash);
|
|
1262
|
+
}, SCROLL_INTO_VIEW_DELAY);
|
|
1263
|
+
};
|
|
1264
|
+
TuiDocNavigationComponent.prototype.openActivePageGroup = function () {
|
|
1265
|
+
var _this = this;
|
|
1266
|
+
this.items.forEach(function (pages, pagesIndex) {
|
|
1267
|
+
pages.forEach(function (page, pageIndex) {
|
|
1268
|
+
if ('route' in page && _this.isActiveRoute(page.route)) {
|
|
1269
|
+
_this.openPagesArr[pagesIndex] = true;
|
|
1270
|
+
_this.active = page.route;
|
|
1271
|
+
}
|
|
1272
|
+
if ('subPages' in page) {
|
|
1273
|
+
page.subPages.forEach(function (subPage) {
|
|
1274
|
+
if (_this.isActiveRoute(subPage.route)) {
|
|
1275
|
+
_this.openPagesArr[pagesIndex] = true;
|
|
1276
|
+
_this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true;
|
|
1277
|
+
_this.active = subPage.route;
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
});
|
|
1251
1283
|
};
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
{
|
|
1259
|
-
|
|
1260
|
-
|
|
1284
|
+
TuiDocNavigationComponent.prototype.navigateToAnchorLink = function (fragment) {
|
|
1285
|
+
var element = fragment && this.documentRef.querySelector("#" + fragment);
|
|
1286
|
+
if (!element) {
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
element.classList.add('tui-doc-animated-example');
|
|
1290
|
+
element.scrollIntoView({
|
|
1291
|
+
block: 'start',
|
|
1292
|
+
inline: 'nearest',
|
|
1293
|
+
behavior: 'smooth',
|
|
1294
|
+
});
|
|
1295
|
+
};
|
|
1296
|
+
TuiDocNavigationComponent.ctorParameters = function () { return [
|
|
1297
|
+
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
1298
|
+
{ type: Title, decorators: [{ type: Inject, args: [Title,] }] },
|
|
1299
|
+
{ type: Observable, decorators: [{ type: Inject, args: [NAVIGATION_TITLE,] }] },
|
|
1300
|
+
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
1301
|
+
{ type: TuiModeDirective, decorators: [{ type: Inject, args: [TuiModeDirective,] }] },
|
|
1302
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [TuiSidebarDirective,] }] },
|
|
1303
|
+
{ type: Array, decorators: [{ type: Inject, args: [NAVIGATION_LABELS,] }] },
|
|
1304
|
+
{ type: undefined, decorators: [{ type: Inject, args: [NAVIGATION_ITEMS,] }] },
|
|
1305
|
+
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEARCH_TEXT,] }] },
|
|
1306
|
+
{ type: Router, decorators: [{ type: Inject, args: [Router,] }] },
|
|
1307
|
+
{ type: ActivatedRoute, decorators: [{ type: Inject, args: [ActivatedRoute,] }] }
|
|
1261
1308
|
]; };
|
|
1262
1309
|
__decorate([
|
|
1263
|
-
|
|
1264
|
-
],
|
|
1265
|
-
__decorate([
|
|
1266
|
-
Input()
|
|
1267
|
-
], TuiDocExampleComponent.prototype, "description", void 0);
|
|
1310
|
+
HostBinding('class._open')
|
|
1311
|
+
], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
|
|
1268
1312
|
__decorate([
|
|
1269
|
-
|
|
1270
|
-
],
|
|
1313
|
+
tuiPure
|
|
1314
|
+
], TuiDocNavigationComponent.prototype, "filterItems", null);
|
|
1271
1315
|
__decorate([
|
|
1272
|
-
|
|
1273
|
-
],
|
|
1274
|
-
|
|
1316
|
+
tuiPure
|
|
1317
|
+
], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
|
|
1318
|
+
TuiDocNavigationComponent = __decorate([
|
|
1275
1319
|
Component({
|
|
1276
|
-
selector: 'tui-doc-
|
|
1277
|
-
template: "<
|
|
1320
|
+
selector: 'tui-doc-navigation',
|
|
1321
|
+
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",
|
|
1322
|
+
providers: NAVIGATION_PROVIDERS,
|
|
1278
1323
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1279
|
-
styles: [":host{
|
|
1324
|
+
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)}"]
|
|
1280
1325
|
}),
|
|
1281
|
-
__param(0,
|
|
1282
|
-
__param(1, Inject(
|
|
1283
|
-
__param(2, Inject(
|
|
1284
|
-
__param(3, Inject(
|
|
1285
|
-
__param(4, Inject(
|
|
1286
|
-
__param(5,
|
|
1287
|
-
__param(
|
|
1288
|
-
__param(6, Inject(
|
|
1289
|
-
__param(7, Inject(
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
function TuiDocExampleGetTabsPipe() {
|
|
1296
|
-
}
|
|
1297
|
-
TuiDocExampleGetTabsPipe.prototype.transform = function (content, defaultTab) {
|
|
1298
|
-
return __spread([defaultTab], Object.keys(content));
|
|
1299
|
-
};
|
|
1300
|
-
TuiDocExampleGetTabsPipe = __decorate([
|
|
1301
|
-
Pipe({ name: 'tuiDocExampleGetTabs' })
|
|
1302
|
-
], TuiDocExampleGetTabsPipe);
|
|
1303
|
-
return TuiDocExampleGetTabsPipe;
|
|
1326
|
+
__param(0, Inject(ChangeDetectorRef)),
|
|
1327
|
+
__param(1, Inject(Title)),
|
|
1328
|
+
__param(2, Inject(NAVIGATION_TITLE)),
|
|
1329
|
+
__param(3, Inject(DOCUMENT)),
|
|
1330
|
+
__param(4, Inject(TuiModeDirective)),
|
|
1331
|
+
__param(5, Optional()),
|
|
1332
|
+
__param(5, Inject(TuiSidebarDirective)),
|
|
1333
|
+
__param(6, Inject(NAVIGATION_LABELS)),
|
|
1334
|
+
__param(7, Inject(NAVIGATION_ITEMS)),
|
|
1335
|
+
__param(8, Inject(TUI_DOC_SEARCH_TEXT)),
|
|
1336
|
+
__param(9, Inject(Router)),
|
|
1337
|
+
__param(10, Inject(ActivatedRoute))
|
|
1338
|
+
], TuiDocNavigationComponent);
|
|
1339
|
+
return TuiDocNavigationComponent;
|
|
1304
1340
|
}());
|
|
1305
1341
|
|
|
1306
|
-
var
|
|
1307
|
-
function
|
|
1342
|
+
var TuiDocNavigationModule = /** @class */ (function () {
|
|
1343
|
+
function TuiDocNavigationModule() {
|
|
1308
1344
|
}
|
|
1309
|
-
|
|
1345
|
+
TuiDocNavigationModule = __decorate([
|
|
1310
1346
|
NgModule({
|
|
1311
1347
|
imports: [
|
|
1312
1348
|
CommonModule,
|
|
1313
|
-
|
|
1314
|
-
|
|
1349
|
+
FormsModule,
|
|
1350
|
+
RouterModule,
|
|
1351
|
+
ScrollIntoViewModule,
|
|
1315
1352
|
TuiButtonModule,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1353
|
+
TuiPrimitiveTextfieldModule,
|
|
1354
|
+
TuiTextfieldControllerModule,
|
|
1355
|
+
TuiActiveZoneModule,
|
|
1356
|
+
TuiLetModule,
|
|
1357
|
+
TuiModeModule,
|
|
1358
|
+
TuiLinkModule,
|
|
1359
|
+
TuiExpandModule,
|
|
1360
|
+
TuiHostedDropdownModule,
|
|
1361
|
+
TuiDropdownControllerModule,
|
|
1362
|
+
TuiAccordionModule,
|
|
1363
|
+
TuiScrollbarModule,
|
|
1364
|
+
TuiSvgModule,
|
|
1365
|
+
TuiDataListModule,
|
|
1366
|
+
TuiAutoFocusModule,
|
|
1319
1367
|
],
|
|
1320
|
-
declarations: [
|
|
1321
|
-
exports: [
|
|
1368
|
+
declarations: [TuiDocNavigationComponent],
|
|
1369
|
+
exports: [TuiDocNavigationComponent],
|
|
1322
1370
|
})
|
|
1323
|
-
],
|
|
1324
|
-
return
|
|
1325
|
-
}());
|
|
1326
|
-
|
|
1327
|
-
// @dynamic
|
|
1328
|
-
var TuiDocMainComponent = /** @class */ (function () {
|
|
1329
|
-
function TuiDocMainComponent(storage, windowRef) {
|
|
1330
|
-
this.storage = storage;
|
|
1331
|
-
this.windowRef = windowRef;
|
|
1332
|
-
this.night = this.storage.getItem('night') === 'true' ||
|
|
1333
|
-
(this.storage.getItem('night') === null &&
|
|
1334
|
-
this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
1335
|
-
this.change$ = new Subject();
|
|
1336
|
-
}
|
|
1337
|
-
TuiDocMainComponent_1 = TuiDocMainComponent;
|
|
1338
|
-
Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
|
|
1339
|
-
get: function () {
|
|
1340
|
-
return this.night ? 'onDark' : null;
|
|
1341
|
-
},
|
|
1342
|
-
enumerable: true,
|
|
1343
|
-
configurable: true
|
|
1344
|
-
});
|
|
1345
|
-
TuiDocMainComponent.prototype.onMode = function (night) {
|
|
1346
|
-
this.night = night;
|
|
1347
|
-
this.change$.next();
|
|
1348
|
-
this.storage.setItem('night', String(night));
|
|
1349
|
-
};
|
|
1350
|
-
var TuiDocMainComponent_1;
|
|
1351
|
-
TuiDocMainComponent.ctorParameters = function () { return [
|
|
1352
|
-
{ type: Storage, decorators: [{ type: Inject, args: [LOCAL_STORAGE,] }] },
|
|
1353
|
-
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
1354
|
-
]; };
|
|
1355
|
-
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
1356
|
-
Component({
|
|
1357
|
-
selector: 'tui-doc-main',
|
|
1358
|
-
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",
|
|
1359
|
-
encapsulation: ViewEncapsulation.None,
|
|
1360
|
-
providers: [
|
|
1361
|
-
{
|
|
1362
|
-
provide: TuiModeDirective,
|
|
1363
|
-
useExisting: forwardRef(function () { return TuiDocMainComponent_1; }),
|
|
1364
|
-
},
|
|
1365
|
-
TuiSwipeService,
|
|
1366
|
-
],
|
|
1367
|
-
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}"]
|
|
1368
|
-
}),
|
|
1369
|
-
__param(0, Inject(LOCAL_STORAGE)),
|
|
1370
|
-
__param(1, Inject(WINDOW))
|
|
1371
|
-
], TuiDocMainComponent);
|
|
1372
|
-
return TuiDocMainComponent;
|
|
1371
|
+
], TuiDocNavigationModule);
|
|
1372
|
+
return TuiDocNavigationModule;
|
|
1373
1373
|
}());
|
|
1374
1374
|
|
|
1375
1375
|
var TUI_DOC_LOGO = new InjectionToken('Main logo', {
|
|
@@ -1462,26 +1462,6 @@ var TUI_DOC_DEFAULT_TABS = new InjectionToken('Array of default tab names', {
|
|
|
1462
1462
|
factory: function () { return []; },
|
|
1463
1463
|
});
|
|
1464
1464
|
|
|
1465
|
-
var TuiDocPageTabConnectorDirective = /** @class */ (function () {
|
|
1466
|
-
function TuiDocPageTabConnectorDirective(template) {
|
|
1467
|
-
this.template = template;
|
|
1468
|
-
}
|
|
1469
|
-
TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
|
|
1470
|
-
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
1471
|
-
]; };
|
|
1472
|
-
__decorate([
|
|
1473
|
-
Input(),
|
|
1474
|
-
tuiDefaultProp()
|
|
1475
|
-
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1476
|
-
TuiDocPageTabConnectorDirective = __decorate([
|
|
1477
|
-
Directive({
|
|
1478
|
-
selector: '[pageTab]',
|
|
1479
|
-
}),
|
|
1480
|
-
__param(0, Inject(TemplateRef))
|
|
1481
|
-
], TuiDocPageTabConnectorDirective);
|
|
1482
|
-
return TuiDocPageTabConnectorDirective;
|
|
1483
|
-
}());
|
|
1484
|
-
|
|
1485
1465
|
var TUI_DOC_SEE_ALSO = new InjectionToken('Array of arrays of related pages', {
|
|
1486
1466
|
factory: function () { return []; },
|
|
1487
1467
|
});
|
|
@@ -1504,6 +1484,26 @@ function seeAlsoProviderFactory(_a, seeAlsoGroups) {
|
|
|
1504
1484
|
return Array.from(seeAlsoSet);
|
|
1505
1485
|
}
|
|
1506
1486
|
|
|
1487
|
+
var TuiDocPageTabConnectorDirective = /** @class */ (function () {
|
|
1488
|
+
function TuiDocPageTabConnectorDirective(template) {
|
|
1489
|
+
this.template = template;
|
|
1490
|
+
}
|
|
1491
|
+
TuiDocPageTabConnectorDirective.ctorParameters = function () { return [
|
|
1492
|
+
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
1493
|
+
]; };
|
|
1494
|
+
__decorate([
|
|
1495
|
+
Input(),
|
|
1496
|
+
tuiDefaultProp()
|
|
1497
|
+
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1498
|
+
TuiDocPageTabConnectorDirective = __decorate([
|
|
1499
|
+
Directive({
|
|
1500
|
+
selector: '[pageTab]',
|
|
1501
|
+
}),
|
|
1502
|
+
__param(0, Inject(TemplateRef))
|
|
1503
|
+
], TuiDocPageTabConnectorDirective);
|
|
1504
|
+
return TuiDocPageTabConnectorDirective;
|
|
1505
|
+
}());
|
|
1506
|
+
|
|
1507
1507
|
// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
|
|
1508
1508
|
// @dynamic
|
|
1509
1509
|
var TuiDocPageComponent = /** @class */ (function () {
|
|
@@ -1515,8 +1515,8 @@ var TuiDocPageComponent = /** @class */ (function () {
|
|
|
1515
1515
|
this.package = '';
|
|
1516
1516
|
this.type = '';
|
|
1517
1517
|
this.path = '';
|
|
1518
|
-
this.activeItemIndex = NaN;
|
|
1519
1518
|
this.tabConnectors = EMPTY_QUERY;
|
|
1519
|
+
this.activeItemIndex = NaN;
|
|
1520
1520
|
}
|
|
1521
1521
|
Object.defineProperty(TuiDocPageComponent.prototype, "showSeeAlso", {
|
|
1522
1522
|
get: function () {
|
|
@@ -1749,6 +1749,23 @@ var TUI_DOC_RUSSIAN = [
|
|
|
1749
1749
|
},
|
|
1750
1750
|
];
|
|
1751
1751
|
|
|
1752
|
+
var TuiAddonDocModule = /** @class */ (function () {
|
|
1753
|
+
function TuiAddonDocModule() {
|
|
1754
|
+
}
|
|
1755
|
+
TuiAddonDocModule = __decorate([
|
|
1756
|
+
NgModule({
|
|
1757
|
+
exports: [
|
|
1758
|
+
TuiDocCodeModule,
|
|
1759
|
+
TuiDocDemoModule,
|
|
1760
|
+
TuiDocDocumentationModule,
|
|
1761
|
+
TuiDocPageModule,
|
|
1762
|
+
TuiDocExampleModule,
|
|
1763
|
+
],
|
|
1764
|
+
})
|
|
1765
|
+
], TuiAddonDocModule);
|
|
1766
|
+
return TuiAddonDocModule;
|
|
1767
|
+
}());
|
|
1768
|
+
|
|
1752
1769
|
/**
|
|
1753
1770
|
* Generates typical page routing structure
|
|
1754
1771
|
*/
|
|
@@ -1767,23 +1784,6 @@ function generateRoutes(type) {
|
|
|
1767
1784
|
];
|
|
1768
1785
|
}
|
|
1769
1786
|
|
|
1770
|
-
var TuiAddonDocModule = /** @class */ (function () {
|
|
1771
|
-
function TuiAddonDocModule() {
|
|
1772
|
-
}
|
|
1773
|
-
TuiAddonDocModule = __decorate([
|
|
1774
|
-
NgModule({
|
|
1775
|
-
exports: [
|
|
1776
|
-
TuiDocCodeModule,
|
|
1777
|
-
TuiDocDemoModule,
|
|
1778
|
-
TuiDocDocumentationModule,
|
|
1779
|
-
TuiDocPageModule,
|
|
1780
|
-
TuiDocExampleModule,
|
|
1781
|
-
],
|
|
1782
|
-
})
|
|
1783
|
-
], TuiAddonDocModule);
|
|
1784
|
-
return TuiAddonDocModule;
|
|
1785
|
-
}());
|
|
1786
|
-
|
|
1787
1787
|
/**
|
|
1788
1788
|
* Public API Surface of @taiga-ui/addon-doc
|
|
1789
1789
|
*/
|
|
@@ -1792,5 +1792,5 @@ var TuiAddonDocModule = /** @class */ (function () {
|
|
|
1792
1792
|
* Generated bundle index. Do not edit.
|
|
1793
1793
|
*/
|
|
1794
1794
|
|
|
1795
|
-
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,
|
|
1795
|
+
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 };
|
|
1796
1796
|
//# sourceMappingURL=taiga-ui-addon-doc.js.map
|