@taiga-ui/addon-doc 2.75.0 → 2.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-addon-doc.umd.js +173 -128
- package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-doc.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-doc.umd.min.js.map +1 -1
- package/components/demo/demo.component.d.ts +2 -2
- package/components/documentation/documentation-property-connector.directive.d.ts +1 -1
- package/esm2015/components/code/code.component.js +6 -6
- package/esm2015/components/copy/copy.component.js +2 -2
- package/esm2015/components/demo/demo.component.js +12 -12
- package/esm2015/components/documentation/documentation-property-connector.directive.js +11 -11
- package/esm2015/components/documentation/documentation.component.js +30 -30
- package/esm2015/components/example/example.component.js +9 -9
- package/esm2015/components/language-switcher/language-switcher.component.js +16 -16
- package/esm2015/components/main/main.component.js +8 -8
- package/esm2015/components/navigation/navigation.component.js +16 -16
- package/esm2015/components/page/page-tab.directive.js +2 -2
- package/esm2015/components/page/page.component.js +10 -10
- package/esm2015/directives/scroll-into-view/scroll-into-view.directive.js +3 -3
- package/esm2015/internal/header/header.component.js +3 -3
- package/esm2015/internal/input-opacity/input-opacity.directive.js +3 -3
- package/esm2015/internal/see-also/see-also.component.js +4 -4
- package/esm2015/internal/source-code/source-code.component.js +6 -6
- package/esm2015/utils/coerce-value.js +3 -3
- package/esm5/components/code/code.component.js +6 -6
- package/esm5/components/copy/copy.component.js +2 -2
- package/esm5/components/demo/demo.component.js +12 -12
- package/esm5/components/documentation/documentation-property-connector.directive.js +11 -11
- package/esm5/components/documentation/documentation.component.js +30 -30
- package/esm5/components/example/example.component.js +9 -9
- package/esm5/components/language-switcher/language-switcher.component.js +16 -16
- package/esm5/components/main/main.component.js +8 -8
- package/esm5/components/navigation/navigation.component.js +16 -16
- package/esm5/components/page/page-tab.directive.js +2 -2
- package/esm5/components/page/page.component.js +10 -10
- package/esm5/directives/scroll-into-view/scroll-into-view.directive.js +3 -3
- package/esm5/internal/header/header.component.js +3 -3
- package/esm5/internal/input-opacity/input-opacity.directive.js +3 -3
- package/esm5/internal/see-also/see-also.component.js +4 -4
- package/esm5/internal/source-code/source-code.component.js +6 -6
- package/esm5/utils/coerce-value.js +3 -3
- package/fesm2015/taiga-ui-addon-doc.js +127 -127
- package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
- package/fesm5/taiga-ui-addon-doc.js +127 -127
- package/fesm5/taiga-ui-addon-doc.js.map +1 -1
- package/internal/see-also/see-also.component.d.ts +1 -1
- package/package.json +5 -5
- package/taiga-ui-addon-doc.metadata.json +1 -1
- package/utils/coerce-value.d.ts +1 -1
|
@@ -44,8 +44,8 @@ const tuiTryParseMarkdownCodeBlock = tryParseMarkdownCodeBlock;
|
|
|
44
44
|
|
|
45
45
|
let TuiDocCodeComponent = class TuiDocCodeComponent {
|
|
46
46
|
constructor() {
|
|
47
|
-
this.rawLoader$$ = new BehaviorSubject(
|
|
48
|
-
this.filename =
|
|
47
|
+
this.rawLoader$$ = new BehaviorSubject('');
|
|
48
|
+
this.filename = '';
|
|
49
49
|
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad), map(tryParseMarkdownCodeBlock));
|
|
50
50
|
}
|
|
51
51
|
set code(code) {
|
|
@@ -62,12 +62,12 @@ __decorate([
|
|
|
62
62
|
Input()
|
|
63
63
|
], TuiDocCodeComponent.prototype, "code", null);
|
|
64
64
|
__decorate([
|
|
65
|
-
HostBinding(
|
|
65
|
+
HostBinding('class._has-filename')
|
|
66
66
|
], TuiDocCodeComponent.prototype, "hasFilename", null);
|
|
67
67
|
TuiDocCodeComponent = __decorate([
|
|
68
68
|
Component({
|
|
69
|
-
selector:
|
|
70
|
-
template: "<p\n *ngIf=\"filename\"\n class=\"t-header\"\n>\n {{ filename }}\n</p>\n<pre\n *ngFor=\"let content of processor$ | async\"\n class=\"t-code\"\n
|
|
69
|
+
selector: 'tui-doc-code',
|
|
70
|
+
template: "<p\n *ngIf=\"filename\"\n class=\"t-header\"\n>\n {{ filename }}\n</p>\n<pre\n *ngFor=\"let content of processor$ | async\"\n class=\"t-code\"\n>\n<code [lineNumbers]=\"true\" [highlight]=\"content\"></code>\n</pre>\n",
|
|
71
71
|
styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:700}.t-code{margin:0}.t-code+.t-code{margin-top:1rem}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear-disabled);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.hljs:not(:empty)::-webkit-scrollbar,.hljs:not(:empty)::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.hljs:not(:empty)::-webkit-scrollbar{background-color:transparent}.hljs:not(:empty)::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.hljs:not(:empty)::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.hljs:not(:empty)::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host._has-filename .hljs:not(:empty){border-radius:.75rem}:host-context(tui-root._mobile) .hljs:not(:empty){padding:1rem}"]
|
|
72
72
|
})
|
|
73
73
|
], TuiDocCodeComponent);
|
|
@@ -104,7 +104,7 @@ __decorate([
|
|
|
104
104
|
], TuiDocCopyComponent.prototype, "copied$", null);
|
|
105
105
|
TuiDocCopyComponent = __decorate([
|
|
106
106
|
Component({
|
|
107
|
-
selector:
|
|
107
|
+
selector: 'tui-doc-copy',
|
|
108
108
|
template: "<button\n *ngIf=\"texts$ | async as texts\"\n tuiButton\n type=\"button\"\n appearance=\"\"\n size=\"s\"\n class=\"t-copy\"\n [title]=\"texts[0]\"\n (click)=\"onClick()\"\n>\n <span\n class=\"t-content\"\n [class.t-content_moved]=\"copied$ | async\"\n >\n <span\n class=\"t-initial\"\n [attr.data-text]=\"texts[0]\"\n >\n <ng-content></ng-content>\n </span>\n {{ texts[1] }}\n </span>\n</button>\n",
|
|
109
109
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
110
110
|
providers: [TuiDestroyService],
|
|
@@ -189,14 +189,14 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
|
|
|
189
189
|
this.wrapperWidth = 0;
|
|
190
190
|
this.control = null;
|
|
191
191
|
this.template = null;
|
|
192
|
-
this.updateOnVariants = [
|
|
193
|
-
this.updateOn =
|
|
192
|
+
this.updateOnVariants = ['change', 'blur', 'submit'];
|
|
193
|
+
this.updateOn = 'change';
|
|
194
194
|
this.expanded = false;
|
|
195
195
|
this.opaque = true;
|
|
196
196
|
this.modeControl = new FormControl();
|
|
197
197
|
this.mode = null;
|
|
198
198
|
this.change$ = new Subject();
|
|
199
|
-
this.items = [
|
|
199
|
+
this.items = ['onLight', 'onDark'];
|
|
200
200
|
this.isBrowser = isPlatformBrowser(platformId);
|
|
201
201
|
const parsedMode = locationRef.path().match(/tuiMode=(onDark|onLight)/);
|
|
202
202
|
if (parsedMode !== null && parsedMode.length > 0) {
|
|
@@ -227,9 +227,9 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
|
|
|
227
227
|
}
|
|
228
228
|
const paddingLeft = this.isBrowser
|
|
229
229
|
? getComputedStyle(this.content.nativeElement).paddingLeft
|
|
230
|
-
:
|
|
230
|
+
: '0';
|
|
231
231
|
const { offsetWidth } = this.content.nativeElement;
|
|
232
|
-
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft ||
|
|
232
|
+
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
|
|
233
233
|
}
|
|
234
234
|
onDragStart(event) {
|
|
235
235
|
event.preventDefault();
|
|
@@ -262,7 +262,7 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
|
|
|
262
262
|
if (!this.wrapper) {
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
|
-
this.renderer.setStyle(this.wrapper.nativeElement,
|
|
265
|
+
this.renderer.setStyle(this.wrapper.nativeElement, 'width', px(Math.max(this.wrapperWidth - delta, MIN_COMPONENT_WIDTH)));
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
TuiDocDemoComponent.ctorParameters = () => [
|
|
@@ -275,13 +275,13 @@ TuiDocDemoComponent.ctorParameters = () => [
|
|
|
275
275
|
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
|
|
276
276
|
];
|
|
277
277
|
__decorate([
|
|
278
|
-
ViewChild(
|
|
278
|
+
ViewChild('content')
|
|
279
279
|
], TuiDocDemoComponent.prototype, "content", void 0);
|
|
280
280
|
__decorate([
|
|
281
|
-
ViewChild(
|
|
281
|
+
ViewChild('wrapper')
|
|
282
282
|
], TuiDocDemoComponent.prototype, "wrapper", void 0);
|
|
283
283
|
__decorate([
|
|
284
|
-
ViewChild(
|
|
284
|
+
ViewChild('resizerText')
|
|
285
285
|
], TuiDocDemoComponent.prototype, "resizerText", void 0);
|
|
286
286
|
__decorate([
|
|
287
287
|
Input()
|
|
@@ -290,11 +290,11 @@ __decorate([
|
|
|
290
290
|
ContentChild(TemplateRef)
|
|
291
291
|
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
292
292
|
__decorate([
|
|
293
|
-
HostListener(
|
|
293
|
+
HostListener('window:resize')
|
|
294
294
|
], TuiDocDemoComponent.prototype, "onResize", null);
|
|
295
295
|
TuiDocDemoComponent = TuiDocDemoComponent_1 = __decorate([
|
|
296
296
|
Component({
|
|
297
|
-
selector:
|
|
297
|
+
selector: 'tui-doc-demo',
|
|
298
298
|
template: "<div\n class=\"t-bg-toggle\"\n [tuiMode]=\"null\"\n>\n <ng-template #tooltip>\n {{ texts[0] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n routerLink=\"/directives/mode\"\n >\n <code>tuiMode</code>\n </a>\n </ng-template>\n <ng-container *ngIf=\"isMobile; else desktop\">\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-mode\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiHintContent]=\"tooltip\"\n [formControl]=\"modeControl\"\n >\n tuiMode\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"items\"\n ></tui-data-list-wrapper>\n </tui-select>\n </ng-container>\n <ng-template #desktop>\n tuiMode:\n <tui-tooltip\n describeId=\"form\"\n [content]=\"tooltip\"\n ></tui-tooltip>\n <div\n tuiGroup\n class=\"t-group\"\n [collapsed]=\"true\"\n >\n <tui-radio-block\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n null\n </tui-radio-block>\n <tui-radio-block\n item=\"onDark\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onDark\n </tui-radio-block>\n <tui-radio-block\n item=\"onLight\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n size=\"m\"\n class=\"t-checkbox\"\n [(ngModel)]=\"opaque\"\n >\n {{ texts[1] }}\n </tui-checkbox-labeled>\n</div>\n<div\n #wrapper\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"modeControl.value === 'onDark'\"\n [class.t-wrapper_gray]=\"modeControl.value === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div\n #content\n id=\"demoContent\"\n class=\"t-content\"\n >\n <form\n *ngIf=\"testForm\"\n class=\"t-form\"\n [formGroup]=\"testForm\"\n >\n <div class=\"t-input-wrapper\">\n <ng-container [ngTemplateOutlet]=\"template\"></ng-container>\n </div>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n class=\"t-button\"\n [iconRight]=\"icon\"\n (click)=\"toggleDetails()\"\n >\n {{ texts[2] }}\n </button>\n <ng-template #icon>\n <tui-svg\n src=\"tuiIconChevronDown\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"expanded\"\n ></tui-svg>\n </ng-template>\n <tui-expand\n class=\"t-expand\"\n [expanded]=\"expanded\"\n >\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">Form data: {{ testForm.value | json }}</pre>\n <div\n tuiGroup\n class=\"t-form-controls\"\n >\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-select\"\n [ngModel]=\"updateOn\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"updateOnChange($event)\"\n >\n updateOn\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"updateOnVariants\"\n ></tui-data-list-wrapper>\n </tui-select>\n <button\n tuiButton\n type=\"reset\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Reset\n </button>\n <button\n tuiButton\n type=\"submit\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Submit\n </button>\n </div>\n </ng-template>\n </tui-expand>\n </form>\n <ng-content></ng-content>\n </div>\n <button\n tabindex=\"-1\"\n class=\"t-resizer\"\n (tuiDragStart)=\"onDragStart($event)\"\n (tuiDragContinues)=\"onDragContinues($event)\"\n (tuiDragEnd)=\"onDragEnd()\"\n >\n <span\n #resizerText\n class=\"t-resizer-text\"\n ></span>\n </button>\n</div>\n",
|
|
299
299
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
300
300
|
providers: [
|
|
@@ -449,10 +449,10 @@ function coerceValue(value) {
|
|
|
449
449
|
if (isEmptyParamValue(prepared)) {
|
|
450
450
|
return null;
|
|
451
451
|
}
|
|
452
|
-
|
|
452
|
+
if (isBooleanParamValue(prepared)) {
|
|
453
453
|
return String(prepared) === `true`;
|
|
454
454
|
}
|
|
455
|
-
|
|
455
|
+
if (isNumberParamValue(prepared)) {
|
|
456
456
|
return Number(prepared);
|
|
457
457
|
}
|
|
458
458
|
const decodedValue = decodeURIComponent(prepared);
|
|
@@ -484,7 +484,7 @@ function isPossibleObject(value) {
|
|
|
484
484
|
return value.startsWith(`{`) && value.endsWith(`}`);
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
const SERIALIZED_SUFFIX =
|
|
487
|
+
const SERIALIZED_SUFFIX = '$';
|
|
488
488
|
// @bad TODO: refactor output and value sync
|
|
489
489
|
let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPropertyConnectorDirective {
|
|
490
490
|
constructor(template, locationRef, activatedRoute, urlSerializer) {
|
|
@@ -492,9 +492,9 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
|
|
|
492
492
|
this.locationRef = locationRef;
|
|
493
493
|
this.activatedRoute = activatedRoute;
|
|
494
494
|
this.urlSerializer = urlSerializer;
|
|
495
|
-
this.documentationPropertyName =
|
|
495
|
+
this.documentationPropertyName = '';
|
|
496
496
|
this.documentationPropertyMode = null;
|
|
497
|
-
this.documentationPropertyType =
|
|
497
|
+
this.documentationPropertyType = '';
|
|
498
498
|
this.documentationPropertyDeprecated = false;
|
|
499
499
|
this.documentationPropertyValues = null;
|
|
500
500
|
this.documentationPropertyValueChange = new EventEmitter();
|
|
@@ -506,11 +506,11 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
|
|
|
506
506
|
}
|
|
507
507
|
get attrName() {
|
|
508
508
|
switch (this.documentationPropertyMode) {
|
|
509
|
-
case
|
|
509
|
+
case 'input':
|
|
510
510
|
return `[${this.documentationPropertyName}]`;
|
|
511
|
-
case
|
|
511
|
+
case 'output':
|
|
512
512
|
return `(${this.documentationPropertyName})`;
|
|
513
|
-
case
|
|
513
|
+
case 'input-output':
|
|
514
514
|
return `[(${this.documentationPropertyName})]`;
|
|
515
515
|
default:
|
|
516
516
|
return this.documentationPropertyName;
|
|
@@ -520,7 +520,7 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
|
|
|
520
520
|
return !!this.documentationPropertyValues;
|
|
521
521
|
}
|
|
522
522
|
get shouldShowValues() {
|
|
523
|
-
return this.documentationPropertyMode !==
|
|
523
|
+
return this.documentationPropertyMode !== 'output';
|
|
524
524
|
}
|
|
525
525
|
ngOnChanges() {
|
|
526
526
|
this.changed$.next();
|
|
@@ -552,7 +552,7 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
|
|
|
552
552
|
const computedValue = isValueAvailableByKey && this.documentationPropertyValues
|
|
553
553
|
? this.documentationPropertyValues.indexOf(value)
|
|
554
554
|
: value;
|
|
555
|
-
const suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX :
|
|
555
|
+
const suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
|
|
556
556
|
const propName = this.documentationPropertyName + suffix;
|
|
557
557
|
tree.queryParams = Object.assign(Object.assign({}, tree.queryParams), { [propName]: computedValue });
|
|
558
558
|
this.locationRef.go(String(tree));
|
|
@@ -587,8 +587,8 @@ __decorate([
|
|
|
587
587
|
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
|
|
588
588
|
TuiDocDocumentationPropertyConnectorDirective = __decorate([
|
|
589
589
|
Directive({
|
|
590
|
-
selector:
|
|
591
|
-
exportAs:
|
|
590
|
+
selector: 'ng-template[documentationPropertyName]',
|
|
591
|
+
exportAs: 'documentationProperty',
|
|
592
592
|
}),
|
|
593
593
|
__param(0, Inject(TemplateRef)),
|
|
594
594
|
__param(1, Inject(Location$1)),
|
|
@@ -603,7 +603,7 @@ let TuiDocDocumentationComponent = class TuiDocDocumentationComponent {
|
|
|
603
603
|
constructor(changeDetectorRef, texts) {
|
|
604
604
|
this.changeDetectorRef = changeDetectorRef;
|
|
605
605
|
this.texts = texts;
|
|
606
|
-
this.heading =
|
|
606
|
+
this.heading = '';
|
|
607
607
|
this.showValues = true;
|
|
608
608
|
this.isAPI = false;
|
|
609
609
|
this.propertiesConnectors = EMPTY_QUERY;
|
|
@@ -620,71 +620,71 @@ let TuiDocDocumentationComponent = class TuiDocDocumentationComponent {
|
|
|
620
620
|
getColor(color) {
|
|
621
621
|
if (color.length === 4) {
|
|
622
622
|
return color
|
|
623
|
-
.split(
|
|
623
|
+
.split('')
|
|
624
624
|
.reduce((result, current) => [...result, current, current], [])
|
|
625
|
-
.join(
|
|
626
|
-
.replace(
|
|
625
|
+
.join('')
|
|
626
|
+
.replace('#', '');
|
|
627
627
|
}
|
|
628
|
-
if (color.startsWith(
|
|
628
|
+
if (color.startsWith('#')) {
|
|
629
629
|
return color;
|
|
630
630
|
}
|
|
631
|
-
if (color ===
|
|
632
|
-
return
|
|
631
|
+
if (color === 'transparent') {
|
|
632
|
+
return '#000000';
|
|
633
633
|
}
|
|
634
634
|
const parsed = color
|
|
635
|
-
.replace(
|
|
636
|
-
.replace(
|
|
637
|
-
.replace(
|
|
638
|
-
.replace(
|
|
639
|
-
.split(
|
|
635
|
+
.replace('rgb(', '')
|
|
636
|
+
.replace('rgba(', '')
|
|
637
|
+
.replace(')', '')
|
|
638
|
+
.replace(' ', '')
|
|
639
|
+
.split(',')
|
|
640
640
|
.map(v => Number.parseInt(v, 10));
|
|
641
641
|
return rgbToHex(...parsed);
|
|
642
642
|
}
|
|
643
643
|
getOpacity(color) {
|
|
644
|
-
if (color.startsWith(
|
|
644
|
+
if (color.startsWith('#') || color.startsWith('rgb(')) {
|
|
645
645
|
return 100;
|
|
646
646
|
}
|
|
647
|
-
if (color ===
|
|
647
|
+
if (color === 'transparent') {
|
|
648
648
|
return 0;
|
|
649
649
|
}
|
|
650
|
-
const lastComma = color.lastIndexOf(
|
|
650
|
+
const lastComma = color.lastIndexOf(',');
|
|
651
651
|
const parsed = color
|
|
652
652
|
.slice(lastComma)
|
|
653
|
-
.replace(
|
|
654
|
-
.replace(
|
|
655
|
-
.replace(
|
|
653
|
+
.replace(')', '')
|
|
654
|
+
.replace(' ', '')
|
|
655
|
+
.replace(',', '');
|
|
656
656
|
return Math.round(Number.parseFloat(parsed) * 100);
|
|
657
657
|
}
|
|
658
658
|
onColorChange(connector, color) {
|
|
659
|
-
const opacity = this.getOpacity(connector.documentationPropertyValue ||
|
|
659
|
+
const opacity = this.getOpacity(connector.documentationPropertyValue || '');
|
|
660
660
|
if (opacity === 100) {
|
|
661
661
|
connector.onValueChange(color);
|
|
662
662
|
return;
|
|
663
663
|
}
|
|
664
|
-
const rgb = hexToRgb(color).join(
|
|
664
|
+
const rgb = hexToRgb(color).join(', ');
|
|
665
665
|
const result = `rgba(${rgb}, ${opacity / 100})`;
|
|
666
666
|
connector.onValueChange(result);
|
|
667
667
|
}
|
|
668
668
|
onOpacityChange(connector, opacity) {
|
|
669
|
-
const hex = this.getColor(connector.documentationPropertyValue ||
|
|
669
|
+
const hex = this.getColor(connector.documentationPropertyValue || '');
|
|
670
670
|
const rgb = hexToRgb(hex);
|
|
671
671
|
const result = `rgba(${rgb}, ${opacity / 100})`;
|
|
672
672
|
connector.onValueChange(result);
|
|
673
673
|
}
|
|
674
674
|
stripOptional(name) {
|
|
675
|
-
return name.replace(
|
|
675
|
+
return name.replace('?', '');
|
|
676
676
|
}
|
|
677
677
|
isOptional(name) {
|
|
678
|
-
return name.includes(
|
|
678
|
+
return name.includes('?');
|
|
679
679
|
}
|
|
680
680
|
isPrimitivePolymorpheusContent(value) {
|
|
681
|
-
return typeof value ===
|
|
681
|
+
return typeof value === 'string' || typeof value === 'number';
|
|
682
682
|
}
|
|
683
683
|
showCleaner(type) {
|
|
684
|
-
return type.includes(
|
|
684
|
+
return type.includes('null');
|
|
685
685
|
}
|
|
686
686
|
showContentTooltip(type) {
|
|
687
|
-
return type.includes(
|
|
687
|
+
return type.includes('PolymorpheusContent');
|
|
688
688
|
}
|
|
689
689
|
inspectAny(data) {
|
|
690
690
|
return inspectAny(data, 2);
|
|
@@ -708,12 +708,12 @@ __decorate([
|
|
|
708
708
|
], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
|
|
709
709
|
TuiDocDocumentationComponent = __decorate([
|
|
710
710
|
Component({
|
|
711
|
-
selector:
|
|
711
|
+
selector: 'tui-doc-documentation',
|
|
712
712
|
template: "<h1\n *ngIf=\"heading\"\n class=\"t-heading\"\n>\n {{ heading }}\n</h1>\n<ng-content></ng-content>\n<table class=\"t-table\">\n <tr class=\"t-row t-row_header\">\n <th class=\"t-th t-cell t-cell_prop\">{{ texts[2] }}</th>\n <th class=\"t-th\">{{ type }}</th>\n <th\n *ngIf=\"showValues && !isAPI\"\n class=\"t-th t-cell t-cell_value\"\n >\n {{ texts[3] }}\n </th>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors\"\n class=\"t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n >\n <td class=\"t-cell\">\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container [ngTemplateOutlet]=\"propertyConnector.template\"></ng-container>\n </td>\n <td class=\"t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/tinkoff/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"t-cell\"\n >\n <ng-container *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\">\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template\n #selectContent\n let-data\n >\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container [ngSwitch]=\"propertyConnector.documentationPropertyType\">\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div\n *ngSwitchCase=\"'color'\"\n tuiGroup\n >\n <tui-primitive-textfield\n tuiTextfieldType=\"text\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n\n <ng-container *ngSwitchCase=\"'PolymorpheusContent'\">\n <tui-primitive-textfield\n *ngIf=\"isPrimitivePolymorpheusContent(propertyConnector.documentationPropertyValue)\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue.toString()\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n >\n Default content\n </tui-primitive-textfield>\n </ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
|
|
713
713
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
714
714
|
animations: [
|
|
715
|
-
trigger(
|
|
716
|
-
transition(
|
|
715
|
+
trigger('emitEvent', [
|
|
716
|
+
transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
|
|
717
717
|
]),
|
|
718
718
|
],
|
|
719
719
|
styles: [":host{display:block;min-width:100%}.t-table{width:100%;table-layout:fixed}.t-row:not(:last-child){border-bottom:1px solid var(--tui-base-03)}:host-context(tui-root._mobile) .t-row{display:flex;flex-wrap:wrap}:host-context(tui-root._mobile) .t-row_header{display:none}.t-cell{padding:1rem 1rem .875rem}.t-cell:first-child{padding-left:0}.t-cell:last-child{padding-right:0;text-align:right}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}:host-context(tui-root._mobile) .t-cell_value{width:9.375rem}:host-context(tui-root._mobile) .t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}.t-th{padding:.5rem 1rem;color:var(--tui-text-02);font-weight:400;text-align:left}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}:host-context(tui-root._mobile) .t-property{padding:.5rem 0}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg);box-shadow:-1rem 0 var(--tui-error-bg),1rem 0 var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content}.t-output{text-align:left;opacity:0}.t-heading{font:var(--tui-font-heading-4)}"]
|
|
@@ -730,7 +730,7 @@ let TuiInputOpacityDirective = class TuiInputOpacityDirective {
|
|
|
730
730
|
set tuiInputOpacity(opacity) {
|
|
731
731
|
const { nativeFocusableElement } = this.tuiFocusableComponent;
|
|
732
732
|
if (nativeFocusableElement) {
|
|
733
|
-
this.renderer.setStyle(nativeFocusableElement,
|
|
733
|
+
this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
};
|
|
@@ -743,7 +743,7 @@ __decorate([
|
|
|
743
743
|
], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
|
|
744
744
|
TuiInputOpacityDirective = __decorate([
|
|
745
745
|
Directive({
|
|
746
|
-
selector:
|
|
746
|
+
selector: '[tuiInputOpacity]',
|
|
747
747
|
}),
|
|
748
748
|
__param(0, Inject(Renderer2)),
|
|
749
749
|
__param(1, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR))
|
|
@@ -837,8 +837,8 @@ let TuiDocExampleComponent = class TuiDocExampleComponent {
|
|
|
837
837
|
this.route = route;
|
|
838
838
|
this.ngLocation = ngLocation;
|
|
839
839
|
this.rawLoader$$ = new BehaviorSubject({});
|
|
840
|
-
this.heading =
|
|
841
|
-
this.description =
|
|
840
|
+
this.heading = '';
|
|
841
|
+
this.description = '';
|
|
842
842
|
this.componentName = this.location.pathname.slice(1);
|
|
843
843
|
this.defaultTabIndex = 0;
|
|
844
844
|
this.defaultTab = this.texts[this.defaultTabIndex];
|
|
@@ -851,7 +851,7 @@ let TuiDocExampleComponent = class TuiDocExampleComponent {
|
|
|
851
851
|
this.rawLoader$$.next(content);
|
|
852
852
|
}
|
|
853
853
|
copyExampleLink() {
|
|
854
|
-
const hashPosition = this.location.href.indexOf(
|
|
854
|
+
const hashPosition = this.location.href.indexOf('#');
|
|
855
855
|
const currentUrl = hashPosition > -1
|
|
856
856
|
? this.location.href.slice(0, Math.max(0, hashPosition))
|
|
857
857
|
: this.location.href;
|
|
@@ -868,17 +868,17 @@ let TuiDocExampleComponent = class TuiDocExampleComponent {
|
|
|
868
868
|
edit(files) {
|
|
869
869
|
var _a, _b;
|
|
870
870
|
this.loading$.next(true);
|
|
871
|
-
(_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, (_b = this.id) !== null && _b !== void 0 ? _b :
|
|
871
|
+
(_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, (_b = this.id) !== null && _b !== void 0 ? _b : '', files).finally(() => this.loading$.next(false));
|
|
872
872
|
}
|
|
873
873
|
setFragmentWithoutRedirect(id) {
|
|
874
874
|
const url = this.router
|
|
875
|
-
.createUrlTree([], { relativeTo: this.route, fragment: id ||
|
|
875
|
+
.createUrlTree([], { relativeTo: this.route, fragment: id || '' })
|
|
876
876
|
.toString();
|
|
877
877
|
this.ngLocation.go(url);
|
|
878
878
|
}
|
|
879
879
|
};
|
|
880
880
|
TuiDocExampleComponent.ctorParameters = () => [
|
|
881
|
-
{ type: String, decorators: [{ type: Attribute, args: [
|
|
881
|
+
{ type: String, decorators: [{ type: Attribute, args: ['id',] }] },
|
|
882
882
|
{ type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
|
|
883
883
|
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
|
|
884
884
|
{ type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
|
|
@@ -906,12 +906,12 @@ __decorate([
|
|
|
906
906
|
], TuiDocExampleComponent.prototype, "componentName", void 0);
|
|
907
907
|
TuiDocExampleComponent = __decorate([
|
|
908
908
|
Component({
|
|
909
|
-
selector:
|
|
909
|
+
selector: 'tui-doc-example',
|
|
910
910
|
template: "<h3\n *ngIf=\"heading\"\n class=\"t-title\"\n>\n <span\n polymorpheus-outlet\n [content]=\"heading | tuiDocExampleCapitalize\"\n ></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n polymorpheus-outlet\n class=\"t-description\"\n [content]=\"description | tuiDocExampleCapitalize\"\n></h4>\n\n<div\n *ngIf=\"processor$ | async as files\"\n class=\"t-example\"\n>\n <ng-container *ngIf=\"files | tuiDocExampleGetTabs: defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button\n *tuiTab\n tuiTab\n >\n {{ tab }}\n </button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n [showLoader]=\"!!(loading$ | async)\"\n (click)=\"edit(files)\"\n >\n Edit on {{ codeEditor.name }}\n </button>\n </div>\n\n <div\n *ngFor=\"let tab of tabs; let index = index\"\n class=\"t-content\"\n [class.t-content_animated]=\"!isCypress\"\n [class.t-content_visible]=\"activeItemIndex === index\"\n >\n <ng-container\n *ngIf=\"index === defaultTabIndex; else anotherTab\"\n [ngTemplateOutlet]=\"preview\"\n ></ng-container>\n <ng-template #anotherTab>\n <ng-container\n [ngTemplateOutlet]=\"codeSection\"\n [ngTemplateOutletContext]=\"{$implicit: files[tabs[activeItemIndex]] || ''}\"\n ></ng-container>\n </ng-template>\n </div>\n </ng-container>\n</div>\n\n<ng-template #preview>\n <div\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n</ng-template>\n\n<ng-template\n #codeSection\n let-code\n>\n <section class=\"t-code-actions\">\n <ng-container *ngFor=\"let action of codeActions\">\n <div\n polymorpheus-outlet\n [content]=\"action\"\n [context]=\"{$implicit: code}\"\n ></div>\n </ng-container>\n <tui-doc-copy [cdkCopyToClipboard]=\"code\"></tui-doc-copy>\n </section>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n</ng-template>\n",
|
|
911
911
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
912
912
|
styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}:host :host-context(tui-root._mobile){padding-top:2rem}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}:host-context(tui-root._mobile) .t-title{font:var(--tui-font-heading-6)}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}:host-context(tui-root._mobile) .t-example{margin-top:.75rem}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}:host-context(tui-root._mobile) .t-tabs-wrapper{padding:0 1rem}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host-context(tui-root._mobile) .t-demo{padding:1rem}.t-code-actions{position:absolute;top:4.375rem;right:1rem;display:flex;justify-content:flex-end;align-items:center}.t-code-actions>*{margin-left:.5rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}.t-content{will-change:opacity;height:0;visibility:hidden;opacity:0}.t-content_animated{transition:opacity .3s ease-in-out}.t-content_visible{height:auto;visibility:visible;opacity:1}"]
|
|
913
913
|
}),
|
|
914
|
-
__param(0, Attribute(
|
|
914
|
+
__param(0, Attribute('id')),
|
|
915
915
|
__param(1, Inject(Clipboard)),
|
|
916
916
|
__param(2, Inject(TuiNotificationsService)),
|
|
917
917
|
__param(3, Inject(LOCATION)),
|
|
@@ -975,22 +975,22 @@ let TuiLanguageSwitcherComponent = class TuiLanguageSwitcherComponent {
|
|
|
975
975
|
constructor(switcher, iconsPath) {
|
|
976
976
|
this.switcher = switcher;
|
|
977
977
|
this.iconsPath = iconsPath;
|
|
978
|
-
this.path = this.iconsPath(
|
|
978
|
+
this.path = this.iconsPath('tuiIcon').replace('tuiIcon.svg#tuiIcon', '');
|
|
979
979
|
this.language = new FormControl(tuiCapitalizeFirstLetter(this.switcher.language));
|
|
980
980
|
this.flags = new Map([
|
|
981
|
-
[
|
|
982
|
-
[
|
|
983
|
-
[
|
|
984
|
-
[
|
|
985
|
-
[
|
|
986
|
-
[
|
|
987
|
-
[
|
|
988
|
-
[
|
|
989
|
-
[
|
|
990
|
-
[
|
|
991
|
-
[
|
|
992
|
-
[
|
|
993
|
-
[
|
|
981
|
+
['chinese', TuiCountryIsoCode.CN],
|
|
982
|
+
['dutch', TuiCountryIsoCode.NL],
|
|
983
|
+
['english', TuiCountryIsoCode.GB],
|
|
984
|
+
['french', TuiCountryIsoCode.FR],
|
|
985
|
+
['german', TuiCountryIsoCode.DE],
|
|
986
|
+
['italian', TuiCountryIsoCode.IT],
|
|
987
|
+
['polish', TuiCountryIsoCode.PL],
|
|
988
|
+
['portuguese', TuiCountryIsoCode.PT],
|
|
989
|
+
['russian', TuiCountryIsoCode.RU],
|
|
990
|
+
['spanish', TuiCountryIsoCode.ES],
|
|
991
|
+
['turkish', TuiCountryIsoCode.TR],
|
|
992
|
+
['ukrainian', TuiCountryIsoCode.UA],
|
|
993
|
+
['vietnamese', TuiCountryIsoCode.VN],
|
|
994
994
|
]);
|
|
995
995
|
this.names = Array.from(this.flags.keys());
|
|
996
996
|
}
|
|
@@ -1004,7 +1004,7 @@ TuiLanguageSwitcherComponent.ctorParameters = () => [
|
|
|
1004
1004
|
];
|
|
1005
1005
|
TuiLanguageSwitcherComponent = __decorate([
|
|
1006
1006
|
Component({
|
|
1007
|
-
selector:
|
|
1007
|
+
selector: 'tui-language-switcher',
|
|
1008
1008
|
template: "<tui-select [formControl]=\"language\">\n <ng-content></ng-content>\n <tui-data-list *tuiDataList>\n <button\n *ngFor=\"let name of names\"\n tuiOption\n [value]=\"name | titlecase\"\n (click)=\"switcher.setLanguage(name)\"\n >\n <img\n alt=\"\"\n class=\"t-flag\"\n [src]=\"getFlagPath(flags.get(name))\"\n />\n {{ name | titlecase }}\n </button>\n </tui-data-list>\n</tui-select>\n",
|
|
1009
1009
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1010
1010
|
styles: [".t-flag{width:1.75rem;height:1.25rem;margin-right:.5rem}"]
|
|
@@ -1029,18 +1029,18 @@ let TuiDocMainComponent = TuiDocMainComponent_1 = class TuiDocMainComponent {
|
|
|
1029
1029
|
constructor(storage, windowRef) {
|
|
1030
1030
|
this.storage = storage;
|
|
1031
1031
|
this.windowRef = windowRef;
|
|
1032
|
-
this.night = this.storage.getItem(
|
|
1033
|
-
(this.storage.getItem(
|
|
1034
|
-
this.windowRef.matchMedia(
|
|
1032
|
+
this.night = this.storage.getItem('night') === 'true' ||
|
|
1033
|
+
(this.storage.getItem('night') === null &&
|
|
1034
|
+
this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
1035
1035
|
this.change$ = new Subject();
|
|
1036
1036
|
}
|
|
1037
1037
|
get mode() {
|
|
1038
|
-
return this.night ?
|
|
1038
|
+
return this.night ? 'onDark' : null;
|
|
1039
1039
|
}
|
|
1040
1040
|
onMode(night) {
|
|
1041
1041
|
this.night = night;
|
|
1042
1042
|
this.change$.next();
|
|
1043
|
-
this.storage.setItem(
|
|
1043
|
+
this.storage.setItem('night', String(night));
|
|
1044
1044
|
}
|
|
1045
1045
|
};
|
|
1046
1046
|
TuiDocMainComponent.ctorParameters = () => [
|
|
@@ -1048,11 +1048,11 @@ TuiDocMainComponent.ctorParameters = () => [
|
|
|
1048
1048
|
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
1049
1049
|
];
|
|
1050
1050
|
__decorate([
|
|
1051
|
-
HostBinding(
|
|
1051
|
+
HostBinding('attr.data-mode')
|
|
1052
1052
|
], TuiDocMainComponent.prototype, "mode", null);
|
|
1053
1053
|
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
1054
1054
|
Component({
|
|
1055
|
-
selector:
|
|
1055
|
+
selector: 'tui-doc-main',
|
|
1056
1056
|
template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-toggle\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverAlerts\">\n <ng-content select=\"tuiOverAlerts\"></ng-content>\n </ng-container>\n <!-- TODO: 3.0 Remove-->\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
|
|
1057
1057
|
encapsulation: ViewEncapsulation.None,
|
|
1058
1058
|
providers: [
|
|
@@ -1100,7 +1100,7 @@ __decorate([
|
|
|
1100
1100
|
], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
|
|
1101
1101
|
ScrollIntoViewDirective = __decorate([
|
|
1102
1102
|
Directive({
|
|
1103
|
-
selector:
|
|
1103
|
+
selector: '[scrollIntoView]',
|
|
1104
1104
|
providers: [TuiDestroyService],
|
|
1105
1105
|
})
|
|
1106
1106
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -1113,7 +1113,7 @@ let TuiScrollIntoViewLinkDirective = class TuiScrollIntoViewLinkDirective extend
|
|
|
1113
1113
|
};
|
|
1114
1114
|
TuiScrollIntoViewLinkDirective = __decorate([
|
|
1115
1115
|
Directive({
|
|
1116
|
-
selector:
|
|
1116
|
+
selector: '[tuiScrollIntoViewLink]',
|
|
1117
1117
|
providers: [TuiDestroyService],
|
|
1118
1118
|
})
|
|
1119
1119
|
], TuiScrollIntoViewLinkDirective);
|
|
@@ -1258,12 +1258,12 @@ let TuiDocNavigationComponent = class TuiDocNavigationComponent {
|
|
|
1258
1258
|
this.readyToScroll$ = readyToScroll$;
|
|
1259
1259
|
this.scrollBehavior = scrollBehavior;
|
|
1260
1260
|
this.menuOpen = false;
|
|
1261
|
-
this.search =
|
|
1261
|
+
this.search = '';
|
|
1262
1262
|
this.open = false;
|
|
1263
1263
|
this.openPagesArr = [];
|
|
1264
1264
|
this.openPagesGroupsArr = [];
|
|
1265
|
-
this.active =
|
|
1266
|
-
this.mode$ = this.mode.change$.pipe(startWith(null), map(() => this.mode.mode ||
|
|
1265
|
+
this.active = '';
|
|
1266
|
+
this.mode$ = this.mode.change$.pipe(startWith(null), map(() => this.mode.mode || 'onLight'));
|
|
1267
1267
|
// Angular can't navigate no anchor links
|
|
1268
1268
|
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
1269
1269
|
title$.subscribe(title => {
|
|
@@ -1298,11 +1298,11 @@ let TuiDocNavigationComponent = class TuiDocNavigationComponent {
|
|
|
1298
1298
|
onClick() {
|
|
1299
1299
|
this.open = false;
|
|
1300
1300
|
this.menuOpen = false;
|
|
1301
|
-
this.search =
|
|
1301
|
+
this.search = '';
|
|
1302
1302
|
this.openActivePageGroup();
|
|
1303
1303
|
}
|
|
1304
1304
|
filterItems(items, search) {
|
|
1305
|
-
return items.map(section => uniqBy(section.filter(({ title, keywords =
|
|
1305
|
+
return items.map(section => uniqBy(section.filter(({ title, keywords = '' }) => {
|
|
1306
1306
|
title = title.toLowerCase();
|
|
1307
1307
|
search = search.toLowerCase();
|
|
1308
1308
|
keywords = keywords.toLowerCase();
|
|
@@ -1310,13 +1310,13 @@ let TuiDocNavigationComponent = class TuiDocNavigationComponent {
|
|
|
1310
1310
|
keywords.includes(search) ||
|
|
1311
1311
|
title.includes(transliterateKeyboardLayout(search)) ||
|
|
1312
1312
|
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
1313
|
-
search.replace(/-/gi,
|
|
1314
|
-
}),
|
|
1313
|
+
search.replace(/-/gi, '').includes(title));
|
|
1314
|
+
}), 'title'));
|
|
1315
1315
|
}
|
|
1316
1316
|
flattenSubPages(items) {
|
|
1317
1317
|
return items.reduce((array, item) => [
|
|
1318
1318
|
...array,
|
|
1319
|
-
item.reduce((pages, page) =>
|
|
1319
|
+
item.reduce((pages, page) => 'subPages' in page
|
|
1320
1320
|
? [...pages, ...page.subPages]
|
|
1321
1321
|
: [...pages, page], []),
|
|
1322
1322
|
], []);
|
|
@@ -1332,11 +1332,11 @@ let TuiDocNavigationComponent = class TuiDocNavigationComponent {
|
|
|
1332
1332
|
openActivePageGroup() {
|
|
1333
1333
|
this.items.forEach((pages, pagesIndex) => {
|
|
1334
1334
|
pages.forEach((page, pageIndex) => {
|
|
1335
|
-
if (
|
|
1335
|
+
if ('route' in page && this.isActiveRoute(page.route)) {
|
|
1336
1336
|
this.openPagesArr[pagesIndex] = true;
|
|
1337
1337
|
this.active = page.route;
|
|
1338
1338
|
}
|
|
1339
|
-
if (
|
|
1339
|
+
if ('subPages' in page) {
|
|
1340
1340
|
page.subPages.forEach(subPage => {
|
|
1341
1341
|
if (this.isActiveRoute(subPage.route)) {
|
|
1342
1342
|
this.openPagesArr[pagesIndex] = true;
|
|
@@ -1354,10 +1354,10 @@ let TuiDocNavigationComponent = class TuiDocNavigationComponent {
|
|
|
1354
1354
|
if (!element) {
|
|
1355
1355
|
return;
|
|
1356
1356
|
}
|
|
1357
|
-
element.classList.add(
|
|
1357
|
+
element.classList.add('tui-doc-animated-example');
|
|
1358
1358
|
element.scrollIntoView({
|
|
1359
|
-
block:
|
|
1360
|
-
inline:
|
|
1359
|
+
block: 'start',
|
|
1360
|
+
inline: 'nearest',
|
|
1361
1361
|
behavior: this.scrollBehavior,
|
|
1362
1362
|
});
|
|
1363
1363
|
}
|
|
@@ -1379,7 +1379,7 @@ TuiDocNavigationComponent.ctorParameters = () => [
|
|
|
1379
1379
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_SCROLL_BEHAVIOR,] }] }
|
|
1380
1380
|
];
|
|
1381
1381
|
__decorate([
|
|
1382
|
-
HostBinding(
|
|
1382
|
+
HostBinding('class._open')
|
|
1383
1383
|
], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
|
|
1384
1384
|
__decorate([
|
|
1385
1385
|
tuiPure
|
|
@@ -1389,7 +1389,7 @@ __decorate([
|
|
|
1389
1389
|
], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
|
|
1390
1390
|
TuiDocNavigationComponent = __decorate([
|
|
1391
1391
|
Component({
|
|
1392
|
-
selector:
|
|
1392
|
+
selector: 'tui-doc-navigation',
|
|
1393
1393
|
template: "<tui-hosted-dropdown\n *tuiLet=\"filteredItems as filtered\"\n tuiAutoFocus\n tuiDropdownLimitWidth=\"fixed\"\n class=\"t-input\"\n [autoFocus]=\"!!sidebar\"\n [content]=\"dropdown\"\n [canOpen]=\"canOpen\"\n [(open)]=\"open\"\n>\n <tui-primitive-textfield\n iconAlign=\"left\"\n tuiTextfieldSize=\"m\"\n iconContent=\"tuiIconSearch\"\n [pseudoFocused]=\"open || null\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiTextfieldLabelOutside]=\"true\"\n [value]=\"search\"\n (valueChange)=\"onSearchChange($event)\"\n >\n {{ searchText }}\n </tui-primitive-textfield>\n <ng-template\n #dropdown\n let-activeZone\n >\n <tui-data-list>\n <tui-opt-group\n *ngFor=\"let group of filtered; let index = index\"\n [label]=\"labels[index] || ''\"\n >\n <a\n *ngFor=\"let item of group\"\n tuiOption\n [routerLink]=\"item.route\"\n (click)=\"onClick()\"\n >\n {{ item.title }}\n </a>\n </tui-opt-group>\n </tui-data-list>\n </ng-template>\n</tui-hosted-dropdown>\n\n<nav class=\"t-navigation\">\n <tui-scrollbar\n class=\"t-scrollbar\"\n [tuiMode]=\"mode$ | async\"\n >\n <tui-accordion\n [closeOthers]=\"false\"\n [rounded]=\"false\"\n >\n <tui-accordion-item\n *ngFor=\"let label of labels; index as index\"\n size=\"s\"\n [borders]=\"null\"\n [(open)]=\"!!openPagesArr[index]\"\n >\n <span class=\"t-label\">\n <strong>{{ label }}</strong>\n </span>\n <ng-template tuiAccordionItemContent>\n <div class=\"t-section\">\n <ng-container\n *ngFor=\"let item of items[index]; index as subIndex\"\n [ngTemplateOutlet]=\"pages\"\n [ngTemplateOutletContext]=\"{item: item, index: index * 100 + subIndex}\"\n ></ng-container>\n </div>\n </ng-template>\n </tui-accordion-item>\n </tui-accordion>\n <div class=\"t-items-container\">\n <ng-container\n *ngFor=\"let item of itemsWithoutSections; let index = index\"\n [ngTemplateOutlet]=\"pages\"\n [ngTemplateOutletContext]=\"{item: item, index: items.length - 1 + index}\"\n ></ng-container>\n </div>\n\n <ng-template\n #pages\n let-item=\"item\"\n let-index=\"index\"\n >\n <a\n *ngIf=\"!item.subPages; else subPages\"\n tuiLink\n routerLinkActive=\"t-sublink_active\"\n class=\"t-sublink\"\n [routerLink]=\"item.route\"\n [scrollIntoView]=\"isActive(item.route)\"\n (click)=\"closeMenu()\"\n >\n {{ item.title }}\n </a>\n <ng-template #subPages>\n <div\n routerLinkActive\n class=\"t-subsection\"\n [routerLinkActiveOptions]=\"{exact: false}\"\n >\n <button\n *ngIf=\"item.subPages\"\n tuiLink\n type=\"button\"\n class=\"t-sublink t-sublink_subsection\"\n (click)=\"onGroupClick(index)\"\n >\n <tui-svg\n src=\"tuiIconChevronRight\"\n class=\"t-chevron\"\n [class.t-chevron_active]=\"!!openPagesGroupsArr[index]\"\n ></tui-svg>\n {{ item.title }}\n </button>\n <tui-expand\n class=\"t-expand\"\n [expanded]=\"!!openPagesGroupsArr[index]\"\n >\n <div class=\"t-section t-section_bordered\">\n <a\n *ngFor=\"let subPage of item.subPages\"\n tuiLink\n routerLinkActive=\"t-sublink_active\"\n class=\"t-sublink t-sublink_small\"\n [routerLink]=\"subPage.route\"\n [scrollIntoView]=\"isActive(subPage.route)\"\n (click)=\"closeMenu()\"\n >\n {{ subPage.title }}\n </a>\n </div>\n </tui-expand>\n </div>\n </ng-template>\n </ng-template>\n </tui-scrollbar>\n</nav>\n\n<ng-content></ng-content>\n",
|
|
1394
1394
|
providers: NAVIGATION_PROVIDERS,
|
|
1395
1395
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -1454,7 +1454,7 @@ let TuiDocHeaderComponent = class TuiDocHeaderComponent {
|
|
|
1454
1454
|
this.router = router;
|
|
1455
1455
|
this.swipes$ = swipes$;
|
|
1456
1456
|
this.stream$ = new Subject();
|
|
1457
|
-
this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$, this.swipes$.pipe(filter(swipe => swipe.direction ===
|
|
1457
|
+
this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$, this.swipes$.pipe(filter(swipe => swipe.direction === 'left' || swipe.direction === 'right'), map(swipe => swipe.direction === 'right'))).pipe(startWith(false), distinctUntilChanged());
|
|
1458
1458
|
}
|
|
1459
1459
|
onClick() {
|
|
1460
1460
|
this.stream$.next(true);
|
|
@@ -1473,7 +1473,7 @@ TuiDocHeaderComponent.ctorParameters = () => [
|
|
|
1473
1473
|
];
|
|
1474
1474
|
TuiDocHeaderComponent = __decorate([
|
|
1475
1475
|
Component({
|
|
1476
|
-
selector:
|
|
1476
|
+
selector: 'header[tuiDocHeader]',
|
|
1477
1477
|
template: "<button\n tuiIconButton\n icon=\"tuiIconMenuLarge\"\n appearance=\"icon\"\n class=\"t-menu\"\n [title]=\"menu\"\n (click)=\"onClick()\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-doc-navigation\n *tuiSidebar=\"!!(open$ | async)\"\n class=\"t-navigation\"\n ></tui-doc-navigation>\n</button>\n<div\n polymorpheus-outlet\n class=\"t-logo\"\n [content]=\"logo\"\n>\n <ng-template let-src>\n <img\n alt=\"Logo\"\n class=\"t-img\"\n [src]=\"src\"\n />\n </ng-template>\n</div>\n<ng-content></ng-content>\n",
|
|
1478
1478
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1479
1479
|
styles: [":host{box-shadow:0 .125rem 1rem rgba(0,0,0,.08);position:fixed;top:0;left:0;right:0;z-index:1;display:flex;height:3.9375rem;align-items:center;padding:0 1.25rem;background:var(--tui-base-01);border-bottom:1px solid var(--tui-base-03)}.t-logo{margin-right:auto;font:var(--tui-font-heading-5)}.t-img{display:block}.t-menu{margin-left:-1.25rem}@media screen and (min-width:48em){.t-menu{display:none}}.t-navigation{min-height:100%}"]
|
|
@@ -1563,7 +1563,7 @@ __decorate([
|
|
|
1563
1563
|
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1564
1564
|
TuiDocPageTabConnectorDirective = __decorate([
|
|
1565
1565
|
Directive({
|
|
1566
|
-
selector:
|
|
1566
|
+
selector: '[pageTab]',
|
|
1567
1567
|
}),
|
|
1568
1568
|
__param(0, Inject(TemplateRef))
|
|
1569
1569
|
], TuiDocPageTabConnectorDirective);
|
|
@@ -1575,22 +1575,22 @@ let TuiDocPageComponent = class TuiDocPageComponent {
|
|
|
1575
1575
|
this.deprecated = deprecated;
|
|
1576
1576
|
this.defaultTabs = defaultTabs;
|
|
1577
1577
|
this.seeAlso = seeAlso;
|
|
1578
|
-
this.header =
|
|
1579
|
-
this.package =
|
|
1580
|
-
this.type =
|
|
1581
|
-
this.path =
|
|
1578
|
+
this.header = '';
|
|
1579
|
+
this.package = '';
|
|
1580
|
+
this.type = '';
|
|
1581
|
+
this.path = '';
|
|
1582
1582
|
this.tabConnectors = EMPTY_QUERY;
|
|
1583
1583
|
this.activeItemIndex = NaN;
|
|
1584
1584
|
}
|
|
1585
1585
|
get showSeeAlso() {
|
|
1586
1586
|
return !!this.seeAlso.length && this.activeItemIndex === 0;
|
|
1587
1587
|
}
|
|
1588
|
-
getRouterLink(tab =
|
|
1589
|
-
return `./${tab.replace(/ /g,
|
|
1588
|
+
getRouterLink(tab = '') {
|
|
1589
|
+
return `./${tab.replace(/ /g, '_')}`;
|
|
1590
1590
|
}
|
|
1591
1591
|
};
|
|
1592
1592
|
TuiDocPageComponent.ctorParameters = () => [
|
|
1593
|
-
{ type: String, decorators: [{ type: Attribute, args: [
|
|
1593
|
+
{ type: String, decorators: [{ type: Attribute, args: ['deprecated',] }] },
|
|
1594
1594
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_DEFAULT_TABS,] }] },
|
|
1595
1595
|
{ type: undefined, decorators: [{ type: Inject, args: [PAGE_SEE_ALSO,] }] }
|
|
1596
1596
|
];
|
|
@@ -1611,13 +1611,13 @@ __decorate([
|
|
|
1611
1611
|
], TuiDocPageComponent.prototype, "tabConnectors", void 0);
|
|
1612
1612
|
TuiDocPageComponent = __decorate([
|
|
1613
1613
|
Component({
|
|
1614
|
-
selector:
|
|
1614
|
+
selector: 'tui-doc-page',
|
|
1615
1615
|
template: "<header class=\"t-header\">\n <h1 class=\"t-title\">\n {{ header }}\n <tui-tag\n *ngIf=\"deprecated !== null\"\n value=\"deprecated\"\n status=\"custom\"\n class=\"t-tag t-tag_deprecated\"\n ></tui-tag>\n <tui-tag\n *ngIf=\"package\"\n status=\"custom\"\n class=\"t-tag t-tag_package\"\n [value]=\"package\"\n [autoColor]=\"true\"\n ></tui-tag>\n </h1>\n <tui-tabs-with-more\n *ngIf=\"tabConnectors.length\"\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabConnectors; first as first; index as index\">\n <ng-container *ngIf=\"first; else dynamicTab\">\n <a\n *tuiTab\n tuiTab\n routerLink=\"./\"\n routerLinkActive\n [routerLinkActiveOptions]=\"{exact: true}\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-container>\n <ng-template #dynamicTab>\n <a\n *tuiTab\n tuiTab\n routerLinkActive\n [routerLink]=\"getRouterLink(tab.pageTab || defaultTabs[index])\"\n >\n {{ tab.pageTab || defaultTabs[index] }}\n </a>\n </ng-template>\n </ng-container>\n </tui-tabs-with-more>\n <tui-doc-source-code\n class=\"t-source-code\"\n [header]=\"header\"\n [package]=\"package\"\n [type]=\"type\"\n [path]=\"path\"\n ></tui-doc-source-code>\n</header>\n<div class=\"t-content\">\n <ng-content></ng-content>\n <tui-doc-see-also\n *ngIf=\"showSeeAlso\"\n class=\"t-see-also\"\n [seeAlso]=\"seeAlso\"\n ></tui-doc-see-also>\n <ng-container *ngFor=\"let tab of tabConnectors; index as index\">\n <ng-container\n *ngIf=\"index === activeItemIndex\"\n [ngTemplateOutlet]=\"tab.template\"\n ></ng-container>\n </ng-container>\n</div>\n",
|
|
1616
1616
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1617
1617
|
providers: PAGE_PROVIDERS,
|
|
1618
1618
|
styles: [":host{display:flex;flex-direction:column;min-height:0;flex-basis:0;flex-grow:1}.t-header{display:flex;font:var(--tui-font-heading-3);flex-wrap:wrap;min-height:7.25rem;color:var(--tui-text-01);box-shadow:inset 0 -1px 0 0 var(--tui-base-03);padding:3.75rem 0 0;box-sizing:border-box;flex-shrink:0;margin:0 min(10vw,8.75rem)}:host-context(tui-root._mobile) .t-header{font:var(--tui-font-heading-4);min-height:4.5rem;padding:1.25rem 1.25rem 0;margin:0}.t-title{min-width:100%;font-size:inherit;margin:0}.t-tag{vertical-align:middle;text-transform:uppercase;margin-right:.5rem}.t-tag_deprecated{background-color:var(--tui-error-fill)}.t-tag.t-tag_package{color:#000}.t-tabs{flex:1;margin:1.125rem .3125rem 0 0}:host-context(tui-root._mobile) .t-tabs{margin-top:.25rem}.t-content{padding:2rem 0;margin:0 min(10vw,8.75rem)}:host-context(tui-root._mobile) .t-content{padding:2rem 1.25rem;margin:0}.t-see-also{min-width:18.75rem;width:30%;float:right;margin-left:1.5rem}:host-context(tui-root._mobile) .t-see-also{float:none;width:100%;margin:0 0 1.5rem}.t-source-code{align-self:flex-end;line-height:2.75rem}"]
|
|
1619
1619
|
}),
|
|
1620
|
-
__param(0, Attribute(
|
|
1620
|
+
__param(0, Attribute('deprecated')),
|
|
1621
1621
|
__param(1, Inject(TUI_DOC_DEFAULT_TABS)),
|
|
1622
1622
|
__param(2, Inject(PAGE_SEE_ALSO))
|
|
1623
1623
|
], TuiDocPageComponent);
|
|
@@ -1632,14 +1632,14 @@ let TuiDocSeeAlsoComponent = class TuiDocSeeAlsoComponent {
|
|
|
1632
1632
|
getRouterLink(pageTitle) {
|
|
1633
1633
|
for (let i = 0; i < this.pages.length; i++) {
|
|
1634
1634
|
const page = this.pages
|
|
1635
|
-
.map(page => (
|
|
1635
|
+
.map(page => ('subPages' in page ? page.subPages : [page]))
|
|
1636
1636
|
.reduce((pages, subPages) => [...pages, ...subPages], [])
|
|
1637
1637
|
.find((page) => page.title === pageTitle);
|
|
1638
1638
|
if (page === null || page === void 0 ? void 0 : page.route) {
|
|
1639
1639
|
return page.route;
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
|
-
return
|
|
1642
|
+
return '';
|
|
1643
1643
|
}
|
|
1644
1644
|
};
|
|
1645
1645
|
TuiDocSeeAlsoComponent.ctorParameters = () => [
|
|
@@ -1651,7 +1651,7 @@ __decorate([
|
|
|
1651
1651
|
], TuiDocSeeAlsoComponent.prototype, "seeAlso", void 0);
|
|
1652
1652
|
TuiDocSeeAlsoComponent = __decorate([
|
|
1653
1653
|
Component({
|
|
1654
|
-
selector:
|
|
1654
|
+
selector: 'tui-doc-see-also',
|
|
1655
1655
|
template: "<h5 class=\"t-header\">{{ text }}</h5>\n<ng-container *ngFor=\"let item of seeAlso; last as last\">\n <a\n tuiLink\n [routerLink]=\"getRouterLink(item)\"\n >\n {{ item }}\n </a>\n <ng-container *ngIf=\"!last\">{{ ', ' }}</ng-container>\n</ng-container>\n",
|
|
1656
1656
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1657
1657
|
styles: [":host{display:block}.t-header{font-size:.6875rem;line-height:1rem;text-transform:uppercase;letter-spacing:.075em;color:var(--tui-text-02);margin:0 0 .5rem;white-space:nowrap}"]
|
|
@@ -1678,10 +1678,10 @@ let TuiDocSourceCodeComponent = class TuiDocSourceCodeComponent {
|
|
|
1678
1678
|
constructor(sourceCode, text) {
|
|
1679
1679
|
this.sourceCode = sourceCode;
|
|
1680
1680
|
this.text = text;
|
|
1681
|
-
this.header =
|
|
1682
|
-
this.package =
|
|
1683
|
-
this.type =
|
|
1684
|
-
this.path =
|
|
1681
|
+
this.header = '';
|
|
1682
|
+
this.package = '';
|
|
1683
|
+
this.type = '';
|
|
1684
|
+
this.path = '';
|
|
1685
1685
|
}
|
|
1686
1686
|
get pathOptions() {
|
|
1687
1687
|
return this.getPathOptions(this.header, this.package, this.type, this.path);
|
|
@@ -1716,7 +1716,7 @@ __decorate([
|
|
|
1716
1716
|
], TuiDocSourceCodeComponent.prototype, "getPathOptions", null);
|
|
1717
1717
|
TuiDocSourceCodeComponent = __decorate([
|
|
1718
1718
|
Component({
|
|
1719
|
-
selector:
|
|
1719
|
+
selector: 'tui-doc-source-code',
|
|
1720
1720
|
template: "<div\n *ngIf=\"!!sourceCode\"\n polymorpheus-outlet\n [content]=\"sourceCode\"\n [context]=\"pathOptions\"\n>\n <ng-template let-link>\n <a\n *ngIf=\"link\"\n tuiIconButton\n type=\"button\"\n icon=\"tuiIconCodeLarge\"\n appearance=\"icon\"\n target=\"_blank\"\n size=\"s\"\n [title]=\"text\"\n [href]=\"link\"\n ></a>\n </ng-template>\n</div>\n",
|
|
1721
1721
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1722
1722
|
}),
|