@taiga-ui/addon-doc 2.26.0 → 2.27.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.
Files changed (28) hide show
  1. package/README.md +121 -121
  2. package/bundles/taiga-ui-addon-doc.umd.js +20 -20
  3. package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
  4. package/bundles/taiga-ui-addon-doc.umd.min.js +1 -1
  5. package/bundles/taiga-ui-addon-doc.umd.min.js.map +1 -1
  6. package/components/code/code.component.d.ts +1 -1
  7. package/components/demo/demo.component.d.ts +8 -8
  8. package/components/documentation/documentation-property-connector.directive.d.ts +1 -1
  9. package/components/navigation/navigation.component.d.ts +1 -1
  10. package/components/page/page.component.d.ts +1 -1
  11. package/esm2015/components/code/code.component.js +2 -2
  12. package/esm2015/components/demo/demo.component.js +12 -12
  13. package/esm2015/components/documentation/documentation-property-connector.directive.js +6 -6
  14. package/esm2015/components/documentation/documentation.component.js +2 -2
  15. package/esm2015/components/navigation/navigation.component.js +2 -2
  16. package/esm2015/components/page/page.component.js +2 -2
  17. package/esm5/components/code/code.component.js +2 -2
  18. package/esm5/components/demo/demo.component.js +12 -12
  19. package/esm5/components/documentation/documentation-property-connector.directive.js +6 -6
  20. package/esm5/components/documentation/documentation.component.js +2 -2
  21. package/esm5/components/navigation/navigation.component.js +2 -2
  22. package/esm5/components/page/page.component.js +2 -2
  23. package/fesm2015/taiga-ui-addon-doc.js +21 -21
  24. package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
  25. package/fesm5/taiga-ui-addon-doc.js +21 -21
  26. package/fesm5/taiga-ui-addon-doc.js.map +1 -1
  27. package/package.json +5 -5
  28. package/taiga-ui-addon-doc.metadata.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { __awaiter, __generator, __decorate, __param, __assign, __spread, __read, __values } from 'tslib';
2
- import { Input, HostBinding, Component, NgModule, Inject, ChangeDetectionStrategy, InjectionToken, Renderer2, PLATFORM_ID, ContentChild, TemplateRef, ViewChild, HostListener, forwardRef, EventEmitter, Output, Directive, ChangeDetectorRef, ContentChildren, Attribute, Optional, Pipe, ViewEncapsulation, ElementRef } from '@angular/core';
2
+ import { Input, HostBinding, Component, NgModule, Inject, ChangeDetectionStrategy, InjectionToken, Renderer2, PLATFORM_ID, ViewChild, ContentChild, TemplateRef, HostListener, forwardRef, EventEmitter, Output, Directive, ChangeDetectorRef, ContentChildren, Attribute, Optional, Pipe, ViewEncapsulation, ElementRef } from '@angular/core';
3
3
  import { BehaviorSubject, Subject, timer, Observable, merge } from 'rxjs';
4
4
  import { switchMap, switchMapTo, mapTo, startWith, takeUntil, map, debounceTime, filter, mergeMap, distinctUntilChanged } from 'rxjs/operators';
5
5
  import { CommonModule, isPlatformBrowser, Location as Location$1, DOCUMENT } from '@angular/common';
@@ -39,8 +39,8 @@ function rawLoad(content) {
39
39
  var TuiDocCodeComponent = /** @class */ (function () {
40
40
  function TuiDocCodeComponent() {
41
41
  this.rawLoader$$ = new BehaviorSubject('');
42
- this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
43
42
  this.filename = '';
43
+ this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
44
44
  }
45
45
  Object.defineProperty(TuiDocCodeComponent.prototype, "code", {
46
46
  set: function (code) {
@@ -199,6 +199,8 @@ var TuiDocDemoComponent = /** @class */ (function () {
199
199
  this.destroy$ = destroy$;
200
200
  this.renderer = renderer;
201
201
  this.texts = texts;
202
+ this.initialX = 0;
203
+ this.wrapperWidth = 0;
202
204
  this.control = null;
203
205
  this.updateOnVariants = ['change', 'blur', 'submit'];
204
206
  this.updateOn = 'change';
@@ -208,8 +210,6 @@ var TuiDocDemoComponent = /** @class */ (function () {
208
210
  this.mode = null;
209
211
  this.change$ = new Subject();
210
212
  this.items = ['onLight', 'onDark'];
211
- this.initialX = 0;
212
- this.wrapperWidth = 0;
213
213
  this.isBrowser = isPlatformBrowser(platformId);
214
214
  var parsedMode = locationRef.path().match(/tui-mode=(onDark|onLight)/);
215
215
  if (parsedMode !== null && parsedMode.length > 0) {
@@ -226,6 +226,9 @@ var TuiDocDemoComponent = /** @class */ (function () {
226
226
  });
227
227
  }
228
228
  TuiDocDemoComponent_1 = TuiDocDemoComponent;
229
+ TuiDocDemoComponent.prototype.onResize = function () {
230
+ this.setResizerTextContent();
231
+ };
229
232
  TuiDocDemoComponent.prototype.ngOnInit = function () {
230
233
  this.createForm();
231
234
  };
@@ -242,9 +245,6 @@ var TuiDocDemoComponent = /** @class */ (function () {
242
245
  var offsetWidth = this.content.nativeElement.offsetWidth;
243
246
  this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
244
247
  };
245
- TuiDocDemoComponent.prototype.onResize = function () {
246
- this.setResizerTextContent();
247
- };
248
248
  TuiDocDemoComponent.prototype.onDragStart = function (event) {
249
249
  event.preventDefault();
250
250
  this.initialX = event.clientX;
@@ -288,12 +288,6 @@ var TuiDocDemoComponent = /** @class */ (function () {
288
288
  { type: UrlSerializer, decorators: [{ type: Inject, args: [UrlSerializer,] }] },
289
289
  { type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
290
290
  ]; };
291
- __decorate([
292
- Input()
293
- ], TuiDocDemoComponent.prototype, "control", void 0);
294
- __decorate([
295
- ContentChild(TemplateRef)
296
- ], TuiDocDemoComponent.prototype, "template", void 0);
297
291
  __decorate([
298
292
  ViewChild('content')
299
293
  ], TuiDocDemoComponent.prototype, "content", void 0);
@@ -303,6 +297,12 @@ var TuiDocDemoComponent = /** @class */ (function () {
303
297
  __decorate([
304
298
  ViewChild('resizerText')
305
299
  ], TuiDocDemoComponent.prototype, "resizerText", void 0);
300
+ __decorate([
301
+ Input()
302
+ ], TuiDocDemoComponent.prototype, "control", void 0);
303
+ __decorate([
304
+ ContentChild(TemplateRef)
305
+ ], TuiDocDemoComponent.prototype, "template", void 0);
306
306
  __decorate([
307
307
  HostListener('window:resize')
308
308
  ], TuiDocDemoComponent.prototype, "onResize", null);
@@ -510,6 +510,11 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
510
510
  this.documentationPropertyValueChange.emit(value);
511
511
  this.setQueryParam(value);
512
512
  };
513
+ TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
514
+ // For more convenient debugging
515
+ console.log(this.attrName, event);
516
+ this.emits$.next(this.emits$.value + 1);
517
+ };
513
518
  TuiDocDocumentationPropertyConnectorDirective.prototype.parseParams = function (params) {
514
519
  if (!params[this.documentationPropertyName] &&
515
520
  !params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
@@ -536,11 +541,6 @@ var TuiDocDocumentationPropertyConnectorDirective = /** @class */ (function () {
536
541
  tree.queryParams = __assign(__assign({}, tree.queryParams), (_a = {}, _a[propName] = computedValue, _a));
537
542
  this.locationRef.go(String(tree));
538
543
  };
539
- TuiDocDocumentationPropertyConnectorDirective.prototype.emitEvent = function (event) {
540
- // For more convenient debugging
541
- console.log(this.attrName, event);
542
- this.emits$.next(this.emits$.value + 1);
543
- };
544
544
  TuiDocDocumentationPropertyConnectorDirective.ctorParameters = function () { return [
545
545
  { type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] },
546
546
  { type: Location$1, decorators: [{ type: Inject, args: [Location$1,] }] },
@@ -697,7 +697,7 @@ var TuiDocDocumentationComponent = /** @class */ (function () {
697
697
  TuiDocDocumentationComponent = __decorate([
698
698
  Component({
699
699
  selector: 'tui-doc-documentation',
700
- template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"\n tui-table__th tui-table__th_last tui-table__th_text_right\n t-cell t-cell_value\n \"\n >\n {{ texts[3] }}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"\n tui-table__td tui-table__td_first tui-table__td_align_center\n t-cell\n \"\n >\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property t-cell\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"\n tui-table__td\n tui-table__td_align_center\n tui-table__td_last\n tui-table__td_text_right\n t-cell\n \"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
700
+ template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"tui-table__th tui-table__th_last tui-table__th_text_right t-cell t-cell_value\"\n >\n {{ texts[3] }}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"tui-table__td tui-table__td_first tui-table__td_align_center t-cell\"\n >\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property t-cell\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"tui-table__td tui-table__td_align_center tui-table__td_last tui-table__td_text_right t-cell\"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
701
701
  changeDetection: ChangeDetectionStrategy.OnPush,
702
702
  animations: [
703
703
  trigger('emitEvent', [
@@ -1173,12 +1173,12 @@ var TuiDocNavigationComponent = /** @class */ (function () {
1173
1173
  this.searchText = searchText;
1174
1174
  this.router = router;
1175
1175
  this.activatedRoute = activatedRoute;
1176
+ this.menuOpen = false;
1176
1177
  this.search = '';
1177
1178
  this.open = false;
1178
1179
  this.openPagesArr = [];
1179
1180
  this.openPagesGroupsArr = [];
1180
1181
  this.active = '';
1181
- this.menuOpen = false;
1182
1182
  this.mode$ = this.mode.change$.pipe(startWith(null), map(function () { return _this.mode.mode || 'onLight'; }));
1183
1183
  // Angular can't navigate no anchor links
1184
1184
  // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
@@ -1515,8 +1515,8 @@ var TuiDocPageComponent = /** @class */ (function () {
1515
1515
  this.package = '';
1516
1516
  this.type = '';
1517
1517
  this.path = '';
1518
- this.activeItemIndex = NaN;
1519
1518
  this.tabConnectors = EMPTY_QUERY;
1519
+ this.activeItemIndex = NaN;
1520
1520
  }
1521
1521
  Object.defineProperty(TuiDocPageComponent.prototype, "showSeeAlso", {
1522
1522
  get: function () {