@taiga-ui/addon-doc 2.75.0 → 2.77.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
|
@@ -65,8 +65,8 @@ var tuiTryParseMarkdownCodeBlock = tryParseMarkdownCodeBlock;
|
|
|
65
65
|
|
|
66
66
|
var TuiDocCodeComponent = /** @class */ (function () {
|
|
67
67
|
function TuiDocCodeComponent() {
|
|
68
|
-
this.rawLoader$$ = new BehaviorSubject(
|
|
69
|
-
this.filename =
|
|
68
|
+
this.rawLoader$$ = new BehaviorSubject('');
|
|
69
|
+
this.filename = '';
|
|
70
70
|
this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad), map(tryParseMarkdownCodeBlock));
|
|
71
71
|
}
|
|
72
72
|
Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
|
|
@@ -90,12 +90,12 @@ var TuiDocCodeComponent = /** @class */ (function () {
|
|
|
90
90
|
Input()
|
|
91
91
|
], TuiDocCodeComponent.prototype, "code", null);
|
|
92
92
|
__decorate([
|
|
93
|
-
HostBinding(
|
|
93
|
+
HostBinding('class._has-filename')
|
|
94
94
|
], TuiDocCodeComponent.prototype, "hasFilename", null);
|
|
95
95
|
TuiDocCodeComponent = __decorate([
|
|
96
96
|
Component({
|
|
97
|
-
selector:
|
|
98
|
-
template: "<p\n *ngIf=\"filename\"\n class=\"t-header\"\n>\n {{ filename }}\n</p>\n<pre\n *ngFor=\"let content of processor$ | async\"\n class=\"t-code\"\n
|
|
97
|
+
selector: 'tui-doc-code',
|
|
98
|
+
template: "<p\n *ngIf=\"filename\"\n class=\"t-header\"\n>\n {{ filename }}\n</p>\n<pre\n *ngFor=\"let content of processor$ | async\"\n class=\"t-code\"\n>\n<code [lineNumbers]=\"true\" [highlight]=\"content\"></code>\n</pre>\n",
|
|
99
99
|
styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:700}.t-code{margin:0}.t-code+.t-code{margin-top:1rem}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear-disabled);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.hljs:not(:empty)::-webkit-scrollbar,.hljs:not(:empty)::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.hljs:not(:empty)::-webkit-scrollbar{background-color:transparent}.hljs:not(:empty)::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.hljs:not(:empty)::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.hljs:not(:empty)::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host._has-filename .hljs:not(:empty){border-radius:.75rem}:host-context(tui-root._mobile) .hljs:not(:empty){padding:1rem}"]
|
|
100
100
|
})
|
|
101
101
|
], TuiDocCodeComponent);
|
|
@@ -140,7 +140,7 @@ var TuiDocCopyComponent = /** @class */ (function () {
|
|
|
140
140
|
], TuiDocCopyComponent.prototype, "copied$", null);
|
|
141
141
|
TuiDocCopyComponent = __decorate([
|
|
142
142
|
Component({
|
|
143
|
-
selector:
|
|
143
|
+
selector: 'tui-doc-copy',
|
|
144
144
|
template: "<button\n *ngIf=\"texts$ | async as texts\"\n tuiButton\n type=\"button\"\n appearance=\"\"\n size=\"s\"\n class=\"t-copy\"\n [title]=\"texts[0]\"\n (click)=\"onClick()\"\n>\n <span\n class=\"t-content\"\n [class.t-content_moved]=\"copied$ | async\"\n >\n <span\n class=\"t-initial\"\n [attr.data-text]=\"texts[0]\"\n >\n <ng-content></ng-content>\n </span>\n {{ texts[1] }}\n </span>\n</button>\n",
|
|
145
145
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
146
146
|
providers: [TuiDestroyService],
|
|
@@ -230,14 +230,14 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
230
230
|
this.wrapperWidth = 0;
|
|
231
231
|
this.control = null;
|
|
232
232
|
this.template = null;
|
|
233
|
-
this.updateOnVariants = [
|
|
234
|
-
this.updateOn =
|
|
233
|
+
this.updateOnVariants = ['change', 'blur', 'submit'];
|
|
234
|
+
this.updateOn = 'change';
|
|
235
235
|
this.expanded = false;
|
|
236
236
|
this.opaque = true;
|
|
237
237
|
this.modeControl = new FormControl();
|
|
238
238
|
this.mode = null;
|
|
239
239
|
this.change$ = new Subject();
|
|
240
|
-
this.items = [
|
|
240
|
+
this.items = ['onLight', 'onDark'];
|
|
241
241
|
this.isBrowser = isPlatformBrowser(platformId);
|
|
242
242
|
var parsedMode = locationRef.path().match(/tuiMode=(onDark|onLight)/);
|
|
243
243
|
if (parsedMode !== null && parsedMode.length > 0) {
|
|
@@ -269,9 +269,9 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
269
269
|
}
|
|
270
270
|
var paddingLeft = this.isBrowser
|
|
271
271
|
? getComputedStyle(this.content.nativeElement).paddingLeft
|
|
272
|
-
:
|
|
272
|
+
: '0';
|
|
273
273
|
var offsetWidth = this.content.nativeElement.offsetWidth;
|
|
274
|
-
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft ||
|
|
274
|
+
this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
|
|
275
275
|
};
|
|
276
276
|
TuiDocDemoComponent.prototype.onDragStart = function (event) {
|
|
277
277
|
event.preventDefault();
|
|
@@ -304,7 +304,7 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
304
304
|
if (!this.wrapper) {
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
this.renderer.setStyle(this.wrapper.nativeElement,
|
|
307
|
+
this.renderer.setStyle(this.wrapper.nativeElement, 'width', px(Math.max(this.wrapperWidth - delta, MIN_COMPONENT_WIDTH)));
|
|
308
308
|
};
|
|
309
309
|
var TuiDocDemoComponent_1;
|
|
310
310
|
TuiDocDemoComponent.ctorParameters = function () { return [
|
|
@@ -317,13 +317,13 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
317
317
|
{ type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
|
|
318
318
|
]; };
|
|
319
319
|
__decorate([
|
|
320
|
-
ViewChild(
|
|
320
|
+
ViewChild('content')
|
|
321
321
|
], TuiDocDemoComponent.prototype, "content", void 0);
|
|
322
322
|
__decorate([
|
|
323
|
-
ViewChild(
|
|
323
|
+
ViewChild('wrapper')
|
|
324
324
|
], TuiDocDemoComponent.prototype, "wrapper", void 0);
|
|
325
325
|
__decorate([
|
|
326
|
-
ViewChild(
|
|
326
|
+
ViewChild('resizerText')
|
|
327
327
|
], TuiDocDemoComponent.prototype, "resizerText", void 0);
|
|
328
328
|
__decorate([
|
|
329
329
|
Input()
|
|
@@ -332,11 +332,11 @@ var TuiDocDemoComponent = /** @class */ (function () {
|
|
|
332
332
|
ContentChild(TemplateRef)
|
|
333
333
|
], TuiDocDemoComponent.prototype, "template", void 0);
|
|
334
334
|
__decorate([
|
|
335
|
-
HostListener(
|
|
335
|
+
HostListener('window:resize')
|
|
336
336
|
], TuiDocDemoComponent.prototype, "onResize", null);
|
|
337
337
|
TuiDocDemoComponent = TuiDocDemoComponent_1 = __decorate([
|
|
338
338
|
Component({
|
|
339
|
-
selector:
|
|
339
|
+
selector: 'tui-doc-demo',
|
|
340
340
|
template: "<div\n class=\"t-bg-toggle\"\n [tuiMode]=\"null\"\n>\n <ng-template #tooltip>\n {{ texts[0] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n routerLink=\"/directives/mode\"\n >\n <code>tuiMode</code>\n </a>\n </ng-template>\n <ng-container *ngIf=\"isMobile; else desktop\">\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-mode\"\n [tuiTextfieldCleaner]=\"true\"\n [tuiHintContent]=\"tooltip\"\n [formControl]=\"modeControl\"\n >\n tuiMode\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"items\"\n ></tui-data-list-wrapper>\n </tui-select>\n </ng-container>\n <ng-template #desktop>\n tuiMode:\n <tui-tooltip\n describeId=\"form\"\n [content]=\"tooltip\"\n ></tui-tooltip>\n <div\n tuiGroup\n class=\"t-group\"\n [collapsed]=\"true\"\n >\n <tui-radio-block\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [item]=\"null\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n null\n </tui-radio-block>\n <tui-radio-block\n item=\"onDark\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onDark\n </tui-radio-block>\n <tui-radio-block\n item=\"onLight\"\n size=\"s\"\n nativeId=\"form\"\n class=\"tui-group__auto-width-item\"\n [hideRadio]=\"true\"\n [formControl]=\"modeControl\"\n >\n onLight\n </tui-radio-block>\n </div>\n </ng-template>\n <tui-checkbox-labeled\n size=\"m\"\n class=\"t-checkbox\"\n [(ngModel)]=\"opaque\"\n >\n {{ texts[1] }}\n </tui-checkbox-labeled>\n</div>\n<div\n #wrapper\n class=\"t-wrapper\"\n [class.t-wrapper_dark]=\"modeControl.value === 'onDark'\"\n [class.t-wrapper_gray]=\"modeControl.value === 'onLight'\"\n [class.t-wrapper_transparent]=\"!opaque\"\n>\n <div\n #content\n id=\"demoContent\"\n class=\"t-content\"\n >\n <form\n *ngIf=\"testForm\"\n class=\"t-form\"\n [formGroup]=\"testForm\"\n >\n <div class=\"t-input-wrapper\">\n <ng-container [ngTemplateOutlet]=\"template\"></ng-container>\n </div>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n class=\"t-button\"\n [iconRight]=\"icon\"\n (click)=\"toggleDetails()\"\n >\n {{ texts[2] }}\n </button>\n <ng-template #icon>\n <tui-svg\n src=\"tuiIconChevronDown\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"expanded\"\n ></tui-svg>\n </ng-template>\n <tui-expand\n class=\"t-expand\"\n [expanded]=\"expanded\"\n >\n <ng-template tuiExpandContent>\n <pre class=\"t-value\">Form data: {{ testForm.value | json }}</pre>\n <div\n tuiGroup\n class=\"t-form-controls\"\n >\n <tui-select\n tuiTextfieldSize=\"s\"\n class=\"t-select\"\n [ngModel]=\"updateOn\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"updateOnChange($event)\"\n >\n updateOn\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"updateOnVariants\"\n ></tui-data-list-wrapper>\n </tui-select>\n <button\n tuiButton\n type=\"reset\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Reset\n </button>\n <button\n tuiButton\n type=\"submit\"\n size=\"s\"\n class=\"tui-group__auto-width-item\"\n >\n Submit\n </button>\n </div>\n </ng-template>\n </tui-expand>\n </form>\n <ng-content></ng-content>\n </div>\n <button\n tabindex=\"-1\"\n class=\"t-resizer\"\n (tuiDragStart)=\"onDragStart($event)\"\n (tuiDragContinues)=\"onDragContinues($event)\"\n (tuiDragEnd)=\"onDragEnd()\"\n >\n <span\n #resizerText\n class=\"t-resizer-text\"\n ></span>\n </button>\n</div>\n",
|
|
341
341
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
342
342
|
providers: [
|
|
@@ -496,10 +496,10 @@ function coerceValue(value) {
|
|
|
496
496
|
if (isEmptyParamValue(prepared)) {
|
|
497
497
|
return null;
|
|
498
498
|
}
|
|
499
|
-
|
|
499
|
+
if (isBooleanParamValue(prepared)) {
|
|
500
500
|
return String(prepared) === "true";
|
|
501
501
|
}
|
|
502
|
-
|
|
502
|
+
if (isNumberParamValue(prepared)) {
|
|
503
503
|
return Number(prepared);
|
|
504
504
|
}
|
|
505
505
|
var decodedValue = decodeURIComponent(prepared);
|
|
@@ -531,7 +531,7 @@ function isPossibleObject(value) {
|
|
|
531
531
|
return value.startsWith("{") && value.endsWith("}");
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
var SERIALIZED_SUFFIX =
|
|
534
|
+
var SERIALIZED_SUFFIX = '$';
|
|
535
535
|
// @bad TODO: refactor output and value sync
|
|
536
536
|
var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
537
537
|
function TuiDocDocumentationPropertyConnectorDirective(template, locationRef, activatedRoute, urlSerializer) {
|
|
@@ -539,9 +539,9 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
539
539
|
this.locationRef = locationRef;
|
|
540
540
|
this.activatedRoute = activatedRoute;
|
|
541
541
|
this.urlSerializer = urlSerializer;
|
|
542
|
-
this.documentationPropertyName =
|
|
542
|
+
this.documentationPropertyName = '';
|
|
543
543
|
this.documentationPropertyMode = null;
|
|
544
|
-
this.documentationPropertyType =
|
|
544
|
+
this.documentationPropertyType = '';
|
|
545
545
|
this.documentationPropertyDeprecated = false;
|
|
546
546
|
this.documentationPropertyValues = null;
|
|
547
547
|
this.documentationPropertyValueChange = new EventEmitter();
|
|
@@ -554,11 +554,11 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
554
554
|
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "attrName", {
|
|
555
555
|
get: function () {
|
|
556
556
|
switch (this.documentationPropertyMode) {
|
|
557
|
-
case
|
|
557
|
+
case 'input':
|
|
558
558
|
return "[" + this.documentationPropertyName + "]";
|
|
559
|
-
case
|
|
559
|
+
case 'output':
|
|
560
560
|
return "(" + this.documentationPropertyName + ")";
|
|
561
|
-
case
|
|
561
|
+
case 'input-output':
|
|
562
562
|
return "[(" + this.documentationPropertyName + ")]";
|
|
563
563
|
default:
|
|
564
564
|
return this.documentationPropertyName;
|
|
@@ -576,7 +576,7 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
576
576
|
});
|
|
577
577
|
Object.defineProperty(TuiDocDocumentationPropertyConnectorDirective.prototype, "shouldShowValues", {
|
|
578
578
|
get: function () {
|
|
579
|
-
return this.documentationPropertyMode !==
|
|
579
|
+
return this.documentationPropertyMode !== 'output';
|
|
580
580
|
},
|
|
581
581
|
enumerable: true,
|
|
582
582
|
configurable: true
|
|
@@ -612,7 +612,7 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
612
612
|
var computedValue = isValueAvailableByKey && this.documentationPropertyValues
|
|
613
613
|
? this.documentationPropertyValues.indexOf(value)
|
|
614
614
|
: value;
|
|
615
|
-
var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX :
|
|
615
|
+
var suffix = isValueAvailableByKey ? SERIALIZED_SUFFIX : '';
|
|
616
616
|
var propName = this.documentationPropertyName + suffix;
|
|
617
617
|
tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
|
|
618
618
|
this.locationRef.go(String(tree));
|
|
@@ -646,8 +646,8 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
|
|
|
646
646
|
], TuiDocDocumentationPropertyConnectorDirective.prototype, "documentationPropertyValueChange", void 0);
|
|
647
647
|
TuiDocDocumentationPropertyConnectorDirective = __decorate([
|
|
648
648
|
Directive({
|
|
649
|
-
selector:
|
|
650
|
-
exportAs:
|
|
649
|
+
selector: 'ng-template[documentationPropertyName]',
|
|
650
|
+
exportAs: 'documentationProperty',
|
|
651
651
|
}),
|
|
652
652
|
__param(0, Inject(TemplateRef)),
|
|
653
653
|
__param(1, Inject(Location$1)),
|
|
@@ -664,7 +664,7 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
|
664
664
|
function TuiDocDocumentationComponent(changeDetectorRef, texts) {
|
|
665
665
|
this.changeDetectorRef = changeDetectorRef;
|
|
666
666
|
this.texts = texts;
|
|
667
|
-
this.heading =
|
|
667
|
+
this.heading = '';
|
|
668
668
|
this.showValues = true;
|
|
669
669
|
this.isAPI = false;
|
|
670
670
|
this.propertiesConnectors = EMPTY_QUERY;
|
|
@@ -688,71 +688,71 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
|
688
688
|
TuiDocDocumentationComponent.prototype.getColor = function (color) {
|
|
689
689
|
if (color.length === 4) {
|
|
690
690
|
return color
|
|
691
|
-
.split(
|
|
691
|
+
.split('')
|
|
692
692
|
.reduce(function (result, current) { return __spread(result, [current, current]); }, [])
|
|
693
|
-
.join(
|
|
694
|
-
.replace(
|
|
693
|
+
.join('')
|
|
694
|
+
.replace('#', '');
|
|
695
695
|
}
|
|
696
|
-
if (color.startsWith(
|
|
696
|
+
if (color.startsWith('#')) {
|
|
697
697
|
return color;
|
|
698
698
|
}
|
|
699
|
-
if (color ===
|
|
700
|
-
return
|
|
699
|
+
if (color === 'transparent') {
|
|
700
|
+
return '#000000';
|
|
701
701
|
}
|
|
702
702
|
var parsed = color
|
|
703
|
-
.replace(
|
|
704
|
-
.replace(
|
|
705
|
-
.replace(
|
|
706
|
-
.replace(
|
|
707
|
-
.split(
|
|
703
|
+
.replace('rgb(', '')
|
|
704
|
+
.replace('rgba(', '')
|
|
705
|
+
.replace(')', '')
|
|
706
|
+
.replace(' ', '')
|
|
707
|
+
.split(',')
|
|
708
708
|
.map(function (v) { return Number.parseInt(v, 10); });
|
|
709
709
|
return rgbToHex.apply(void 0, __spread(parsed));
|
|
710
710
|
};
|
|
711
711
|
TuiDocDocumentationComponent.prototype.getOpacity = function (color) {
|
|
712
|
-
if (color.startsWith(
|
|
712
|
+
if (color.startsWith('#') || color.startsWith('rgb(')) {
|
|
713
713
|
return 100;
|
|
714
714
|
}
|
|
715
|
-
if (color ===
|
|
715
|
+
if (color === 'transparent') {
|
|
716
716
|
return 0;
|
|
717
717
|
}
|
|
718
|
-
var lastComma = color.lastIndexOf(
|
|
718
|
+
var lastComma = color.lastIndexOf(',');
|
|
719
719
|
var parsed = color
|
|
720
720
|
.slice(lastComma)
|
|
721
|
-
.replace(
|
|
722
|
-
.replace(
|
|
723
|
-
.replace(
|
|
721
|
+
.replace(')', '')
|
|
722
|
+
.replace(' ', '')
|
|
723
|
+
.replace(',', '');
|
|
724
724
|
return Math.round(Number.parseFloat(parsed) * 100);
|
|
725
725
|
};
|
|
726
726
|
TuiDocDocumentationComponent.prototype.onColorChange = function (connector, color) {
|
|
727
|
-
var opacity = this.getOpacity(connector.documentationPropertyValue ||
|
|
727
|
+
var opacity = this.getOpacity(connector.documentationPropertyValue || '');
|
|
728
728
|
if (opacity === 100) {
|
|
729
729
|
connector.onValueChange(color);
|
|
730
730
|
return;
|
|
731
731
|
}
|
|
732
|
-
var rgb = hexToRgb(color).join(
|
|
732
|
+
var rgb = hexToRgb(color).join(', ');
|
|
733
733
|
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
734
734
|
connector.onValueChange(result);
|
|
735
735
|
};
|
|
736
736
|
TuiDocDocumentationComponent.prototype.onOpacityChange = function (connector, opacity) {
|
|
737
|
-
var hex = this.getColor(connector.documentationPropertyValue ||
|
|
737
|
+
var hex = this.getColor(connector.documentationPropertyValue || '');
|
|
738
738
|
var rgb = hexToRgb(hex);
|
|
739
739
|
var result = "rgba(" + rgb + ", " + opacity / 100 + ")";
|
|
740
740
|
connector.onValueChange(result);
|
|
741
741
|
};
|
|
742
742
|
TuiDocDocumentationComponent.prototype.stripOptional = function (name) {
|
|
743
|
-
return name.replace(
|
|
743
|
+
return name.replace('?', '');
|
|
744
744
|
};
|
|
745
745
|
TuiDocDocumentationComponent.prototype.isOptional = function (name) {
|
|
746
|
-
return name.includes(
|
|
746
|
+
return name.includes('?');
|
|
747
747
|
};
|
|
748
748
|
TuiDocDocumentationComponent.prototype.isPrimitivePolymorpheusContent = function (value) {
|
|
749
|
-
return typeof value ===
|
|
749
|
+
return typeof value === 'string' || typeof value === 'number';
|
|
750
750
|
};
|
|
751
751
|
TuiDocDocumentationComponent.prototype.showCleaner = function (type) {
|
|
752
|
-
return type.includes(
|
|
752
|
+
return type.includes('null');
|
|
753
753
|
};
|
|
754
754
|
TuiDocDocumentationComponent.prototype.showContentTooltip = function (type) {
|
|
755
|
-
return type.includes(
|
|
755
|
+
return type.includes('PolymorpheusContent');
|
|
756
756
|
};
|
|
757
757
|
TuiDocDocumentationComponent.prototype.inspectAny = function (data) {
|
|
758
758
|
return inspectAny(data, 2);
|
|
@@ -775,12 +775,12 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
|
|
|
775
775
|
], TuiDocDocumentationComponent.prototype, "propertiesConnectors", void 0);
|
|
776
776
|
TuiDocDocumentationComponent = __decorate([
|
|
777
777
|
Component({
|
|
778
|
-
selector:
|
|
778
|
+
selector: 'tui-doc-documentation',
|
|
779
779
|
template: "<h1\n *ngIf=\"heading\"\n class=\"t-heading\"\n>\n {{ heading }}\n</h1>\n<ng-content></ng-content>\n<table class=\"t-table\">\n <tr class=\"t-row t-row_header\">\n <th class=\"t-th t-cell t-cell_prop\">{{ texts[2] }}</th>\n <th class=\"t-th\">{{ type }}</th>\n <th\n *ngIf=\"showValues && !isAPI\"\n class=\"t-th t-cell t-cell_value\"\n >\n {{ texts[3] }}\n </th>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors\"\n class=\"t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n >\n <td class=\"t-cell\">\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container [ngTemplateOutlet]=\"propertyConnector.template\"></ng-container>\n </td>\n <td class=\"t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/tinkoff/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"t-cell\"\n >\n <ng-container *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\">\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template\n #selectContent\n let-data\n >\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container [ngSwitch]=\"propertyConnector.documentationPropertyType\">\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div\n *ngSwitchCase=\"'color'\"\n tuiGroup\n >\n <tui-primitive-textfield\n tuiTextfieldType=\"text\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n\n <ng-container *ngSwitchCase=\"'PolymorpheusContent'\">\n <tui-primitive-textfield\n *ngIf=\"isPrimitivePolymorpheusContent(propertyConnector.documentationPropertyValue)\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue.toString()\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n >\n Default content\n </tui-primitive-textfield>\n </ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
|
|
780
780
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
781
781
|
animations: [
|
|
782
|
-
trigger(
|
|
783
|
-
transition(
|
|
782
|
+
trigger('emitEvent', [
|
|
783
|
+
transition(':increment', [style({ opacity: 1 }), animate('500ms ease-in')]),
|
|
784
784
|
]),
|
|
785
785
|
],
|
|
786
786
|
styles: [":host{display:block;min-width:100%}.t-table{width:100%;table-layout:fixed}.t-row:not(:last-child){border-bottom:1px solid var(--tui-base-03)}:host-context(tui-root._mobile) .t-row{display:flex;flex-wrap:wrap}:host-context(tui-root._mobile) .t-row_header{display:none}.t-cell{padding:1rem 1rem .875rem}.t-cell:first-child{padding-left:0}.t-cell:last-child{padding-right:0;text-align:right}.t-cell_prop{width:40%}.t-cell_value{max-width:20rem}:host-context(tui-root._mobile) .t-cell_value{width:9.375rem}:host-context(tui-root._mobile) .t-cell{width:100%;height:auto;padding:.5rem 0;text-align:left}.t-th{padding:.5rem 1rem;color:var(--tui-text-02);font-weight:400;text-align:left}.t-property{font:var(--tui-font-text-m);margin-bottom:.25rem;font-family:monospace;color:#8f75d1}:host-context(tui-root._mobile) .t-property{padding:.5rem 0}.t-type{font-family:monospace}.t-deprecated{background-color:var(--tui-error-bg);box-shadow:-1rem 0 var(--tui-error-bg),1rem 0 var(--tui-error-bg)}.t-deprecated-label{margin-right:.125rem;color:var(--tui-error-fill)}.t-exception{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content}.t-output{text-align:left;opacity:0}.t-heading{font:var(--tui-font-heading-4)}"]
|
|
@@ -800,7 +800,7 @@ var TuiInputOpacityDirective = /** @class */ (function () {
|
|
|
800
800
|
set: function (opacity) {
|
|
801
801
|
var nativeFocusableElement = this.tuiFocusableComponent.nativeFocusableElement;
|
|
802
802
|
if (nativeFocusableElement) {
|
|
803
|
-
this.renderer.setStyle(nativeFocusableElement,
|
|
803
|
+
this.renderer.setStyle(nativeFocusableElement, 'opacity', opacity / 100);
|
|
804
804
|
}
|
|
805
805
|
},
|
|
806
806
|
enumerable: true,
|
|
@@ -815,7 +815,7 @@ var TuiInputOpacityDirective = /** @class */ (function () {
|
|
|
815
815
|
], TuiInputOpacityDirective.prototype, "tuiInputOpacity", null);
|
|
816
816
|
TuiInputOpacityDirective = __decorate([
|
|
817
817
|
Directive({
|
|
818
|
-
selector:
|
|
818
|
+
selector: '[tuiInputOpacity]',
|
|
819
819
|
}),
|
|
820
820
|
__param(0, Inject(Renderer2)),
|
|
821
821
|
__param(1, Inject(TUI_FOCUSABLE_ITEM_ACCESSOR))
|
|
@@ -949,8 +949,8 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
949
949
|
this.route = route;
|
|
950
950
|
this.ngLocation = ngLocation;
|
|
951
951
|
this.rawLoader$$ = new BehaviorSubject({});
|
|
952
|
-
this.heading =
|
|
953
|
-
this.description =
|
|
952
|
+
this.heading = '';
|
|
953
|
+
this.description = '';
|
|
954
954
|
this.componentName = this.location.pathname.slice(1);
|
|
955
955
|
this.defaultTabIndex = 0;
|
|
956
956
|
this.defaultTab = this.texts[this.defaultTabIndex];
|
|
@@ -970,7 +970,7 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
970
970
|
configurable: true
|
|
971
971
|
});
|
|
972
972
|
TuiDocExampleComponent.prototype.copyExampleLink = function () {
|
|
973
|
-
var hashPosition = this.location.href.indexOf(
|
|
973
|
+
var hashPosition = this.location.href.indexOf('#');
|
|
974
974
|
var currentUrl = hashPosition > -1
|
|
975
975
|
? this.location.href.slice(0, Math.max(0, hashPosition))
|
|
976
976
|
: this.location.href;
|
|
@@ -988,16 +988,16 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
988
988
|
var _this = this;
|
|
989
989
|
var _a, _b;
|
|
990
990
|
this.loading$.next(true);
|
|
991
|
-
(_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, (_b = this.id) !== null && _b !== void 0 ? _b :
|
|
991
|
+
(_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, (_b = this.id) !== null && _b !== void 0 ? _b : '', files).finally(function () { return _this.loading$.next(false); });
|
|
992
992
|
};
|
|
993
993
|
TuiDocExampleComponent.prototype.setFragmentWithoutRedirect = function (id) {
|
|
994
994
|
var url = this.router
|
|
995
|
-
.createUrlTree([], { relativeTo: this.route, fragment: id ||
|
|
995
|
+
.createUrlTree([], { relativeTo: this.route, fragment: id || '' })
|
|
996
996
|
.toString();
|
|
997
997
|
this.ngLocation.go(url);
|
|
998
998
|
};
|
|
999
999
|
TuiDocExampleComponent.ctorParameters = function () { return [
|
|
1000
|
-
{ type: String, decorators: [{ type: Attribute, args: [
|
|
1000
|
+
{ type: String, decorators: [{ type: Attribute, args: ['id',] }] },
|
|
1001
1001
|
{ type: Clipboard, decorators: [{ type: Inject, args: [Clipboard,] }] },
|
|
1002
1002
|
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] },
|
|
1003
1003
|
{ type: Location, decorators: [{ type: Inject, args: [LOCATION,] }] },
|
|
@@ -1025,12 +1025,12 @@ var TuiDocExampleComponent = /** @class */ (function () {
|
|
|
1025
1025
|
], TuiDocExampleComponent.prototype, "componentName", void 0);
|
|
1026
1026
|
TuiDocExampleComponent = __decorate([
|
|
1027
1027
|
Component({
|
|
1028
|
-
selector:
|
|
1028
|
+
selector: 'tui-doc-example',
|
|
1029
1029
|
template: "<h3\n *ngIf=\"heading\"\n class=\"t-title\"\n>\n <span\n polymorpheus-outlet\n [content]=\"heading | tuiDocExampleCapitalize\"\n ></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n polymorpheus-outlet\n class=\"t-description\"\n [content]=\"description | tuiDocExampleCapitalize\"\n></h4>\n\n<div\n *ngIf=\"processor$ | async as files\"\n class=\"t-example\"\n>\n <ng-container *ngIf=\"files | tuiDocExampleGetTabs: defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button\n *tuiTab\n tuiTab\n >\n {{ tab }}\n </button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n [showLoader]=\"!!(loading$ | async)\"\n (click)=\"edit(files)\"\n >\n Edit on {{ codeEditor.name }}\n </button>\n </div>\n\n <div\n *ngFor=\"let tab of tabs; let index = index\"\n class=\"t-content\"\n [class.t-content_animated]=\"!isCypress\"\n [class.t-content_visible]=\"activeItemIndex === index\"\n >\n <ng-container\n *ngIf=\"index === defaultTabIndex; else anotherTab\"\n [ngTemplateOutlet]=\"preview\"\n ></ng-container>\n <ng-template #anotherTab>\n <ng-container\n [ngTemplateOutlet]=\"codeSection\"\n [ngTemplateOutletContext]=\"{$implicit: files[tabs[activeItemIndex]] || ''}\"\n ></ng-container>\n </ng-template>\n </div>\n </ng-container>\n</div>\n\n<ng-template #preview>\n <div\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n</ng-template>\n\n<ng-template\n #codeSection\n let-code\n>\n <section class=\"t-code-actions\">\n <ng-container *ngFor=\"let action of codeActions\">\n <div\n polymorpheus-outlet\n [content]=\"action\"\n [context]=\"{$implicit: code}\"\n ></div>\n </ng-container>\n <tui-doc-copy [cdkCopyToClipboard]=\"code\"></tui-doc-copy>\n </section>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n</ng-template>\n",
|
|
1030
1030
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1031
1031
|
styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}:host :host-context(tui-root._mobile){padding-top:2rem}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}:host-context(tui-root._mobile) .t-title{font:var(--tui-font-heading-6)}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}:host-context(tui-root._mobile) .t-example{margin-top:.75rem}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}:host-context(tui-root._mobile) .t-tabs-wrapper{padding:0 1rem}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host-context(tui-root._mobile) .t-demo{padding:1rem}.t-code-actions{position:absolute;top:4.375rem;right:1rem;display:flex;justify-content:flex-end;align-items:center}.t-code-actions>*{margin-left:.5rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}.t-content{will-change:opacity;height:0;visibility:hidden;opacity:0}.t-content_animated{transition:opacity .3s ease-in-out}.t-content_visible{height:auto;visibility:visible;opacity:1}"]
|
|
1032
1032
|
}),
|
|
1033
|
-
__param(0, Attribute(
|
|
1033
|
+
__param(0, Attribute('id')),
|
|
1034
1034
|
__param(1, Inject(Clipboard)),
|
|
1035
1035
|
__param(2, Inject(TuiNotificationsService)),
|
|
1036
1036
|
__param(3, Inject(LOCATION)),
|
|
@@ -1105,22 +1105,22 @@ var TuiLanguageSwitcherComponent = /** @class */ (function () {
|
|
|
1105
1105
|
function TuiLanguageSwitcherComponent(switcher, iconsPath) {
|
|
1106
1106
|
this.switcher = switcher;
|
|
1107
1107
|
this.iconsPath = iconsPath;
|
|
1108
|
-
this.path = this.iconsPath(
|
|
1108
|
+
this.path = this.iconsPath('tuiIcon').replace('tuiIcon.svg#tuiIcon', '');
|
|
1109
1109
|
this.language = new FormControl(tuiCapitalizeFirstLetter(this.switcher.language));
|
|
1110
1110
|
this.flags = new Map([
|
|
1111
|
-
[
|
|
1112
|
-
[
|
|
1113
|
-
[
|
|
1114
|
-
[
|
|
1115
|
-
[
|
|
1116
|
-
[
|
|
1117
|
-
[
|
|
1118
|
-
[
|
|
1119
|
-
[
|
|
1120
|
-
[
|
|
1121
|
-
[
|
|
1122
|
-
[
|
|
1123
|
-
[
|
|
1111
|
+
['chinese', TuiCountryIsoCode.CN],
|
|
1112
|
+
['dutch', TuiCountryIsoCode.NL],
|
|
1113
|
+
['english', TuiCountryIsoCode.GB],
|
|
1114
|
+
['french', TuiCountryIsoCode.FR],
|
|
1115
|
+
['german', TuiCountryIsoCode.DE],
|
|
1116
|
+
['italian', TuiCountryIsoCode.IT],
|
|
1117
|
+
['polish', TuiCountryIsoCode.PL],
|
|
1118
|
+
['portuguese', TuiCountryIsoCode.PT],
|
|
1119
|
+
['russian', TuiCountryIsoCode.RU],
|
|
1120
|
+
['spanish', TuiCountryIsoCode.ES],
|
|
1121
|
+
['turkish', TuiCountryIsoCode.TR],
|
|
1122
|
+
['ukrainian', TuiCountryIsoCode.UA],
|
|
1123
|
+
['vietnamese', TuiCountryIsoCode.VN],
|
|
1124
1124
|
]);
|
|
1125
1125
|
this.names = Array.from(this.flags.keys());
|
|
1126
1126
|
}
|
|
@@ -1133,7 +1133,7 @@ var TuiLanguageSwitcherComponent = /** @class */ (function () {
|
|
|
1133
1133
|
]; };
|
|
1134
1134
|
TuiLanguageSwitcherComponent = __decorate([
|
|
1135
1135
|
Component({
|
|
1136
|
-
selector:
|
|
1136
|
+
selector: 'tui-language-switcher',
|
|
1137
1137
|
template: "<tui-select [formControl]=\"language\">\n <ng-content></ng-content>\n <tui-data-list *tuiDataList>\n <button\n *ngFor=\"let name of names\"\n tuiOption\n [value]=\"name | titlecase\"\n (click)=\"switcher.setLanguage(name)\"\n >\n <img\n alt=\"\"\n class=\"t-flag\"\n [src]=\"getFlagPath(flags.get(name))\"\n />\n {{ name | titlecase }}\n </button>\n </tui-data-list>\n</tui-select>\n",
|
|
1138
1138
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1139
1139
|
styles: [".t-flag{width:1.75rem;height:1.25rem;margin-right:.5rem}"]
|
|
@@ -1162,15 +1162,15 @@ var TuiDocMainComponent = /** @class */ (function () {
|
|
|
1162
1162
|
function TuiDocMainComponent(storage, windowRef) {
|
|
1163
1163
|
this.storage = storage;
|
|
1164
1164
|
this.windowRef = windowRef;
|
|
1165
|
-
this.night = this.storage.getItem(
|
|
1166
|
-
(this.storage.getItem(
|
|
1167
|
-
this.windowRef.matchMedia(
|
|
1165
|
+
this.night = this.storage.getItem('night') === 'true' ||
|
|
1166
|
+
(this.storage.getItem('night') === null &&
|
|
1167
|
+
this.windowRef.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
1168
1168
|
this.change$ = new Subject();
|
|
1169
1169
|
}
|
|
1170
1170
|
TuiDocMainComponent_1 = TuiDocMainComponent;
|
|
1171
1171
|
Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
|
|
1172
1172
|
get: function () {
|
|
1173
|
-
return this.night ?
|
|
1173
|
+
return this.night ? 'onDark' : null;
|
|
1174
1174
|
},
|
|
1175
1175
|
enumerable: true,
|
|
1176
1176
|
configurable: true
|
|
@@ -1178,7 +1178,7 @@ var TuiDocMainComponent = /** @class */ (function () {
|
|
|
1178
1178
|
TuiDocMainComponent.prototype.onMode = function (night) {
|
|
1179
1179
|
this.night = night;
|
|
1180
1180
|
this.change$.next();
|
|
1181
|
-
this.storage.setItem(
|
|
1181
|
+
this.storage.setItem('night', String(night));
|
|
1182
1182
|
};
|
|
1183
1183
|
var TuiDocMainComponent_1;
|
|
1184
1184
|
TuiDocMainComponent.ctorParameters = function () { return [
|
|
@@ -1186,11 +1186,11 @@ var TuiDocMainComponent = /** @class */ (function () {
|
|
|
1186
1186
|
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] }
|
|
1187
1187
|
]; };
|
|
1188
1188
|
__decorate([
|
|
1189
|
-
HostBinding(
|
|
1189
|
+
HostBinding('attr.data-mode')
|
|
1190
1190
|
], TuiDocMainComponent.prototype, "mode", null);
|
|
1191
1191
|
TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
|
|
1192
1192
|
Component({
|
|
1193
|
-
selector:
|
|
1193
|
+
selector: 'tui-doc-main',
|
|
1194
1194
|
template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-toggle\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverAlerts\">\n <ng-content select=\"tuiOverAlerts\"></ng-content>\n </ng-container>\n <!-- TODO: 3.0 Remove-->\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
|
|
1195
1195
|
encapsulation: ViewEncapsulation.None,
|
|
1196
1196
|
providers: [
|
|
@@ -1242,7 +1242,7 @@ var ScrollIntoViewDirective = /** @class */ (function () {
|
|
|
1242
1242
|
], ScrollIntoViewDirective.prototype, "scrollIntoView", null);
|
|
1243
1243
|
ScrollIntoViewDirective = __decorate([
|
|
1244
1244
|
Directive({
|
|
1245
|
-
selector:
|
|
1245
|
+
selector: '[scrollIntoView]',
|
|
1246
1246
|
providers: [TuiDestroyService],
|
|
1247
1247
|
})
|
|
1248
1248
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -1260,7 +1260,7 @@ var TuiScrollIntoViewLinkDirective = /** @class */ (function (_super) {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
TuiScrollIntoViewLinkDirective = __decorate([
|
|
1262
1262
|
Directive({
|
|
1263
|
-
selector:
|
|
1263
|
+
selector: '[tuiScrollIntoViewLink]',
|
|
1264
1264
|
providers: [TuiDestroyService],
|
|
1265
1265
|
})
|
|
1266
1266
|
], TuiScrollIntoViewLinkDirective);
|
|
@@ -1424,12 +1424,12 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1424
1424
|
this.readyToScroll$ = readyToScroll$;
|
|
1425
1425
|
this.scrollBehavior = scrollBehavior;
|
|
1426
1426
|
this.menuOpen = false;
|
|
1427
|
-
this.search =
|
|
1427
|
+
this.search = '';
|
|
1428
1428
|
this.open = false;
|
|
1429
1429
|
this.openPagesArr = [];
|
|
1430
1430
|
this.openPagesGroupsArr = [];
|
|
1431
|
-
this.active =
|
|
1432
|
-
this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode ||
|
|
1431
|
+
this.active = '';
|
|
1432
|
+
this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode || 'onLight'; }));
|
|
1433
1433
|
// Angular can't navigate no anchor links
|
|
1434
1434
|
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
1435
1435
|
title$.subscribe(function (title) {
|
|
@@ -1476,13 +1476,13 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1476
1476
|
TuiDocNavigationComponent.prototype.onClick = function () {
|
|
1477
1477
|
this.open = false;
|
|
1478
1478
|
this.menuOpen = false;
|
|
1479
|
-
this.search =
|
|
1479
|
+
this.search = '';
|
|
1480
1480
|
this.openActivePageGroup();
|
|
1481
1481
|
};
|
|
1482
1482
|
TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
|
|
1483
1483
|
return items.map(function (section) {
|
|
1484
1484
|
return uniqBy(section.filter(function (_a) {
|
|
1485
|
-
var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ?
|
|
1485
|
+
var title = _a.title, _b = _a.keywords, keywords = _b === void 0 ? '' : _b;
|
|
1486
1486
|
title = title.toLowerCase();
|
|
1487
1487
|
search = search.toLowerCase();
|
|
1488
1488
|
keywords = keywords.toLowerCase();
|
|
@@ -1490,14 +1490,14 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1490
1490
|
keywords.includes(search) ||
|
|
1491
1491
|
title.includes(transliterateKeyboardLayout(search)) ||
|
|
1492
1492
|
keywords.includes(transliterateKeyboardLayout(search)) ||
|
|
1493
|
-
search.replace(/-/gi,
|
|
1494
|
-
}),
|
|
1493
|
+
search.replace(/-/gi, '').includes(title));
|
|
1494
|
+
}), 'title');
|
|
1495
1495
|
});
|
|
1496
1496
|
};
|
|
1497
1497
|
TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
|
|
1498
1498
|
return items.reduce(function (array, item) { return __spread(array, [
|
|
1499
1499
|
item.reduce(function (pages, page) {
|
|
1500
|
-
return
|
|
1500
|
+
return 'subPages' in page
|
|
1501
1501
|
? __spread(pages, page.subPages) : __spread(pages, [page]);
|
|
1502
1502
|
}, []),
|
|
1503
1503
|
]); }, []);
|
|
@@ -1515,11 +1515,11 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1515
1515
|
var _this = this;
|
|
1516
1516
|
this.items.forEach(function (pages, pagesIndex) {
|
|
1517
1517
|
pages.forEach(function (page, pageIndex) {
|
|
1518
|
-
if (
|
|
1518
|
+
if ('route' in page && _this.isActiveRoute(page.route)) {
|
|
1519
1519
|
_this.openPagesArr[pagesIndex] = true;
|
|
1520
1520
|
_this.active = page.route;
|
|
1521
1521
|
}
|
|
1522
|
-
if (
|
|
1522
|
+
if ('subPages' in page) {
|
|
1523
1523
|
page.subPages.forEach(function (subPage) {
|
|
1524
1524
|
if (_this.isActiveRoute(subPage.route)) {
|
|
1525
1525
|
_this.openPagesArr[pagesIndex] = true;
|
|
@@ -1537,10 +1537,10 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1537
1537
|
if (!element) {
|
|
1538
1538
|
return;
|
|
1539
1539
|
}
|
|
1540
|
-
element.classList.add(
|
|
1540
|
+
element.classList.add('tui-doc-animated-example');
|
|
1541
1541
|
element.scrollIntoView({
|
|
1542
|
-
block:
|
|
1543
|
-
inline:
|
|
1542
|
+
block: 'start',
|
|
1543
|
+
inline: 'nearest',
|
|
1544
1544
|
behavior: this.scrollBehavior,
|
|
1545
1545
|
});
|
|
1546
1546
|
};
|
|
@@ -1561,7 +1561,7 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1561
1561
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_SCROLL_BEHAVIOR,] }] }
|
|
1562
1562
|
]; };
|
|
1563
1563
|
__decorate([
|
|
1564
|
-
HostBinding(
|
|
1564
|
+
HostBinding('class._open')
|
|
1565
1565
|
], TuiDocNavigationComponent.prototype, "menuOpen", void 0);
|
|
1566
1566
|
__decorate([
|
|
1567
1567
|
tuiPure
|
|
@@ -1571,7 +1571,7 @@ var TuiDocNavigationComponent = /** @class */ (function () {
|
|
|
1571
1571
|
], TuiDocNavigationComponent.prototype, "flattenSubPages", null);
|
|
1572
1572
|
TuiDocNavigationComponent = __decorate([
|
|
1573
1573
|
Component({
|
|
1574
|
-
selector:
|
|
1574
|
+
selector: 'tui-doc-navigation',
|
|
1575
1575
|
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",
|
|
1576
1576
|
providers: NAVIGATION_PROVIDERS,
|
|
1577
1577
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -1641,7 +1641,7 @@ var TuiDocHeaderComponent = /** @class */ (function () {
|
|
|
1641
1641
|
this.router = router;
|
|
1642
1642
|
this.swipes$ = swipes$;
|
|
1643
1643
|
this.stream$ = new Subject();
|
|
1644
|
-
this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$, this.swipes$.pipe(filter(function (swipe) { return swipe.direction ===
|
|
1644
|
+
this.open$ = merge(this.router.events.pipe(mapTo(false)), this.stream$, this.swipes$.pipe(filter(function (swipe) { return swipe.direction === 'left' || swipe.direction === 'right'; }), map(function (swipe) { return swipe.direction === 'right'; }))).pipe(startWith(false), distinctUntilChanged());
|
|
1645
1645
|
}
|
|
1646
1646
|
TuiDocHeaderComponent.prototype.onClick = function () {
|
|
1647
1647
|
this.stream$.next(true);
|
|
@@ -1659,7 +1659,7 @@ var TuiDocHeaderComponent = /** @class */ (function () {
|
|
|
1659
1659
|
]; };
|
|
1660
1660
|
TuiDocHeaderComponent = __decorate([
|
|
1661
1661
|
Component({
|
|
1662
|
-
selector:
|
|
1662
|
+
selector: 'header[tuiDocHeader]',
|
|
1663
1663
|
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",
|
|
1664
1664
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1665
1665
|
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%}"]
|
|
@@ -1757,7 +1757,7 @@ var TuiDocPageTabConnectorDirective = /** @class */ (function () {
|
|
|
1757
1757
|
], TuiDocPageTabConnectorDirective.prototype, "pageTab", void 0);
|
|
1758
1758
|
TuiDocPageTabConnectorDirective = __decorate([
|
|
1759
1759
|
Directive({
|
|
1760
|
-
selector:
|
|
1760
|
+
selector: '[pageTab]',
|
|
1761
1761
|
}),
|
|
1762
1762
|
__param(0, Inject(TemplateRef))
|
|
1763
1763
|
], TuiDocPageTabConnectorDirective);
|
|
@@ -1771,10 +1771,10 @@ var TuiDocPageComponent = /** @class */ (function () {
|
|
|
1771
1771
|
this.deprecated = deprecated;
|
|
1772
1772
|
this.defaultTabs = defaultTabs;
|
|
1773
1773
|
this.seeAlso = seeAlso;
|
|
1774
|
-
this.header =
|
|
1775
|
-
this.package =
|
|
1776
|
-
this.type =
|
|
1777
|
-
this.path =
|
|
1774
|
+
this.header = '';
|
|
1775
|
+
this.package = '';
|
|
1776
|
+
this.type = '';
|
|
1777
|
+
this.path = '';
|
|
1778
1778
|
this.tabConnectors = EMPTY_QUERY;
|
|
1779
1779
|
this.activeItemIndex = NaN;
|
|
1780
1780
|
}
|
|
@@ -1786,11 +1786,11 @@ var TuiDocPageComponent = /** @class */ (function () {
|
|
|
1786
1786
|
configurable: true
|
|
1787
1787
|
});
|
|
1788
1788
|
TuiDocPageComponent.prototype.getRouterLink = function (tab) {
|
|
1789
|
-
if (tab === void 0) { tab =
|
|
1790
|
-
return "./" + tab.replace(/ /g,
|
|
1789
|
+
if (tab === void 0) { tab = ''; }
|
|
1790
|
+
return "./" + tab.replace(/ /g, '_');
|
|
1791
1791
|
};
|
|
1792
1792
|
TuiDocPageComponent.ctorParameters = function () { return [
|
|
1793
|
-
{ type: String, decorators: [{ type: Attribute, args: [
|
|
1793
|
+
{ type: String, decorators: [{ type: Attribute, args: ['deprecated',] }] },
|
|
1794
1794
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_DOC_DEFAULT_TABS,] }] },
|
|
1795
1795
|
{ type: undefined, decorators: [{ type: Inject, args: [PAGE_SEE_ALSO,] }] }
|
|
1796
1796
|
]; };
|
|
@@ -1811,13 +1811,13 @@ var TuiDocPageComponent = /** @class */ (function () {
|
|
|
1811
1811
|
], TuiDocPageComponent.prototype, "tabConnectors", void 0);
|
|
1812
1812
|
TuiDocPageComponent = __decorate([
|
|
1813
1813
|
Component({
|
|
1814
|
-
selector:
|
|
1814
|
+
selector: 'tui-doc-page',
|
|
1815
1815
|
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",
|
|
1816
1816
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1817
1817
|
providers: PAGE_PROVIDERS,
|
|
1818
1818
|
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}"]
|
|
1819
1819
|
}),
|
|
1820
|
-
__param(0, Attribute(
|
|
1820
|
+
__param(0, Attribute('deprecated')),
|
|
1821
1821
|
__param(1, Inject(TUI_DOC_DEFAULT_TABS)),
|
|
1822
1822
|
__param(2, Inject(PAGE_SEE_ALSO))
|
|
1823
1823
|
], TuiDocPageComponent);
|
|
@@ -1834,14 +1834,14 @@ var TuiDocSeeAlsoComponent = /** @class */ (function () {
|
|
|
1834
1834
|
TuiDocSeeAlsoComponent.prototype.getRouterLink = function (pageTitle) {
|
|
1835
1835
|
for (var i = 0; i < this.pages.length; i++) {
|
|
1836
1836
|
var page = this.pages
|
|
1837
|
-
.map(function (page) { return (
|
|
1837
|
+
.map(function (page) { return ('subPages' in page ? page.subPages : [page]); })
|
|
1838
1838
|
.reduce(function (pages, subPages) { return __spread(pages, subPages); }, [])
|
|
1839
1839
|
.find(function (page) { return page.title === pageTitle; });
|
|
1840
1840
|
if (page === null || page === void 0 ? void 0 : page.route) {
|
|
1841
1841
|
return page.route;
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
|
-
return
|
|
1844
|
+
return '';
|
|
1845
1845
|
};
|
|
1846
1846
|
TuiDocSeeAlsoComponent.ctorParameters = function () { return [
|
|
1847
1847
|
{ type: String, decorators: [{ type: Inject, args: [TUI_DOC_SEE_ALSO_TEXT,] }] },
|
|
@@ -1852,7 +1852,7 @@ var TuiDocSeeAlsoComponent = /** @class */ (function () {
|
|
|
1852
1852
|
], TuiDocSeeAlsoComponent.prototype, "seeAlso", void 0);
|
|
1853
1853
|
TuiDocSeeAlsoComponent = __decorate([
|
|
1854
1854
|
Component({
|
|
1855
|
-
selector:
|
|
1855
|
+
selector: 'tui-doc-see-also',
|
|
1856
1856
|
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",
|
|
1857
1857
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1858
1858
|
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}"]
|
|
@@ -1884,10 +1884,10 @@ var TuiDocSourceCodeComponent = /** @class */ (function () {
|
|
|
1884
1884
|
function TuiDocSourceCodeComponent(sourceCode, text) {
|
|
1885
1885
|
this.sourceCode = sourceCode;
|
|
1886
1886
|
this.text = text;
|
|
1887
|
-
this.header =
|
|
1888
|
-
this.package =
|
|
1889
|
-
this.type =
|
|
1890
|
-
this.path =
|
|
1887
|
+
this.header = '';
|
|
1888
|
+
this.package = '';
|
|
1889
|
+
this.type = '';
|
|
1890
|
+
this.path = '';
|
|
1891
1891
|
}
|
|
1892
1892
|
Object.defineProperty(TuiDocSourceCodeComponent.prototype, "pathOptions", {
|
|
1893
1893
|
get: function () {
|
|
@@ -1925,7 +1925,7 @@ var TuiDocSourceCodeComponent = /** @class */ (function () {
|
|
|
1925
1925
|
], TuiDocSourceCodeComponent.prototype, "getPathOptions", null);
|
|
1926
1926
|
TuiDocSourceCodeComponent = __decorate([
|
|
1927
1927
|
Component({
|
|
1928
|
-
selector:
|
|
1928
|
+
selector: 'tui-doc-source-code',
|
|
1929
1929
|
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",
|
|
1930
1930
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1931
1931
|
}),
|