@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, __decorate, __param } 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';
@@ -25,8 +25,8 @@ function rawLoad(content) {
25
25
  let TuiDocCodeComponent = class TuiDocCodeComponent {
26
26
  constructor() {
27
27
  this.rawLoader$$ = new BehaviorSubject('');
28
- this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
29
28
  this.filename = '';
29
+ this.processor$ = this.rawLoader$$.pipe(switchMap(rawLoad));
30
30
  }
31
31
  set code(code) {
32
32
  this.rawLoader$$.next(code);
@@ -165,6 +165,8 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
165
165
  this.destroy$ = destroy$;
166
166
  this.renderer = renderer;
167
167
  this.texts = texts;
168
+ this.initialX = 0;
169
+ this.wrapperWidth = 0;
168
170
  this.control = null;
169
171
  this.updateOnVariants = ['change', 'blur', 'submit'];
170
172
  this.updateOn = 'change';
@@ -174,8 +176,6 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
174
176
  this.mode = null;
175
177
  this.change$ = new Subject();
176
178
  this.items = ['onLight', 'onDark'];
177
- this.initialX = 0;
178
- this.wrapperWidth = 0;
179
179
  this.isBrowser = isPlatformBrowser(platformId);
180
180
  const parsedMode = locationRef.path().match(/tui-mode=(onDark|onLight)/);
181
181
  if (parsedMode !== null && parsedMode.length > 0) {
@@ -191,6 +191,9 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
191
191
  this.change$.next();
192
192
  });
193
193
  }
194
+ onResize() {
195
+ this.setResizerTextContent();
196
+ }
194
197
  ngOnInit() {
195
198
  this.createForm();
196
199
  }
@@ -207,9 +210,6 @@ let TuiDocDemoComponent = TuiDocDemoComponent_1 = class TuiDocDemoComponent {
207
210
  const { offsetWidth } = this.content.nativeElement;
208
211
  this.resizerText.nativeElement.textContent = String(offsetWidth - parseInt(paddingLeft || '0', 10) * 2);
209
212
  }
210
- onResize() {
211
- this.setResizerTextContent();
212
- }
213
213
  onDragStart(event) {
214
214
  event.preventDefault();
215
215
  this.initialX = event.clientX;
@@ -253,12 +253,6 @@ TuiDocDemoComponent.ctorParameters = () => [
253
253
  { type: UrlSerializer, decorators: [{ type: Inject, args: [UrlSerializer,] }] },
254
254
  { type: Array, decorators: [{ type: Inject, args: [TUI_DOC_DEMO_TEXTS,] }] }
255
255
  ];
256
- __decorate([
257
- Input()
258
- ], TuiDocDemoComponent.prototype, "control", void 0);
259
- __decorate([
260
- ContentChild(TemplateRef)
261
- ], TuiDocDemoComponent.prototype, "template", void 0);
262
256
  __decorate([
263
257
  ViewChild('content')
264
258
  ], TuiDocDemoComponent.prototype, "content", void 0);
@@ -268,6 +262,12 @@ __decorate([
268
262
  __decorate([
269
263
  ViewChild('resizerText')
270
264
  ], TuiDocDemoComponent.prototype, "resizerText", void 0);
265
+ __decorate([
266
+ Input()
267
+ ], TuiDocDemoComponent.prototype, "control", void 0);
268
+ __decorate([
269
+ ContentChild(TemplateRef)
270
+ ], TuiDocDemoComponent.prototype, "template", void 0);
271
271
  __decorate([
272
272
  HostListener('window:resize')
273
273
  ], TuiDocDemoComponent.prototype, "onResize", null);
@@ -458,6 +458,11 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
458
458
  this.documentationPropertyValueChange.emit(value);
459
459
  this.setQueryParam(value);
460
460
  }
461
+ emitEvent(event) {
462
+ // For more convenient debugging
463
+ console.log(this.attrName, event);
464
+ this.emits$.next(this.emits$.value + 1);
465
+ }
461
466
  parseParams(params) {
462
467
  if (!params[this.documentationPropertyName] &&
463
468
  !params[this.documentationPropertyName + SERIALIZED_SUFFIX]) {
@@ -483,11 +488,6 @@ let TuiDocDocumentationPropertyConnectorDirective = class TuiDocDocumentationPro
483
488
  tree.queryParams = Object.assign(Object.assign({}, tree.queryParams), { [propName]: computedValue });
484
489
  this.locationRef.go(String(tree));
485
490
  }
486
- emitEvent(event) {
487
- // For more convenient debugging
488
- console.log(this.attrName, event);
489
- this.emits$.next(this.emits$.value + 1);
490
- }
491
491
  };
492
492
  TuiDocDocumentationPropertyConnectorDirective.ctorParameters = () => [
493
493
  { type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] },
@@ -637,7 +637,7 @@ __decorate([
637
637
  TuiDocDocumentationComponent = __decorate([
638
638
  Component({
639
639
  selector: 'tui-doc-documentation',
640
- template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"\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",
640
+ template: "<h1 *ngIf=\"heading\" class=\"tui-text_h4\">{{ heading }}</h1>\n<ng-content></ng-content>\n<table class=\"tui-table tui-table_layout_fixed tui-table_font-size_s\">\n <tr class=\"tui-table__tr tui-table__tr_hover_disabled t-row t-row_header\">\n <th class=\"tui-table__th tui-table__th_first t-cell t-cell_prop\">\n {{ texts[2] }}\n </th>\n <td class=\"tui-table__th\">{{ type }}</td>\n <td\n *ngIf=\"showValues && !isAPI\"\n class=\"tui-table__th tui-table__th_last tui-table__th_text_right t-cell t-cell_value\"\n >\n {{ texts[3] }}\n </td>\n </tr>\n <tr\n *ngFor=\"let propertyConnector of propertiesConnectors; last as lastItem\"\n class=\"tui-table__tr tui-table__tr_hover_disabled t-row\"\n [class.t-deprecated]=\"propertyConnector.documentationPropertyDeprecated\"\n [class.tui-table__tr_border_none]=\"lastItem\"\n >\n <td\n class=\"tui-table__td tui-table__td_first tui-table__td_align_center t-cell\"\n >\n <div\n automation-id=\"tui-documentation__property-name\"\n class=\"t-property t-cell\"\n >\n {{ stripOptional(propertyConnector.attrName) }}\n <tui-badge\n *ngIf=\"isOptional(propertyConnector.attrName)\"\n size=\"s\"\n value=\"Optional\"\n ></tui-badge>\n </div>\n <span\n *ngIf=\"propertyConnector.documentationPropertyDeprecated\"\n class=\"t-deprecated-label\"\n >\n deprecated\n </span>\n <ng-container\n *ngTemplateOutlet=\"propertyConnector.template\"\n ></ng-container>\n </td>\n <td class=\"tui-table__td tui-table__td_align_center t-cell\">\n <span class=\"type\">\n {{ propertyConnector.documentationPropertyType }}\n <tui-tooltip\n *ngIf=\"showContentTooltip(propertyConnector.documentationPropertyType)\"\n [describeId]=\"propertyConnector.attrName\"\n [content]=\"content\"\n >\n <ng-template #content>\n {{ texts[4] }}\n <a\n tuiLink\n tuiMode=\"onDark\"\n target=\"_blank\"\n href=\"https://github.com/TinkoffCreditSystems/ng-polymorpheus\"\n >\n <code>ng-polymorpheus</code>\n </a>\n </ng-template>\n </tui-tooltip>\n </span>\n </td>\n <td\n *ngIf=\"showValues\"\n class=\"tui-table__td tui-table__td_align_center tui-table__td_last tui-table__td_text_right t-cell\"\n >\n <ng-container\n *ngIf=\"propertyConnector.shouldShowValues; else elseEmitter\"\n >\n <tui-select\n *ngIf=\"propertyConnector.hasItems; else noItems\"\n tuiTextfieldSize=\"m\"\n tuiDropdownLimitWidth=\"min\"\n [tuiTextfieldCleaner]=\"showCleaner(propertyConnector.documentationPropertyType)\"\n [tuiTextfieldLabelOutside]=\"true\"\n [nativeId]=\"propertyConnector.attrName\"\n [valueContent]=\"selectContent\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n >\n <code class=\"t-exception\">null</code>\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"propertyConnector.documentationPropertyValues\"\n [itemContent]=\"selectContent\"\n ></tui-data-list-wrapper>\n </tui-select>\n <ng-template #selectContent let-data>\n <code>{{ inspectAny(data) }}</code>\n </ng-template>\n\n <ng-template #noItems>\n <ng-container\n [ngSwitch]=\"propertyConnector.documentationPropertyType\"\n >\n <tui-toggle\n *ngSwitchCase=\"'boolean'\"\n size=\"l\"\n [nativeId]=\"propertyConnector.attrName\"\n [showIcons]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-toggle>\n\n <tui-primitive-textfield\n *ngSwitchCase=\"'string'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiTextfieldCleaner]=\"true\"\n [value]=\"propertyConnector.documentationPropertyValue || ''\"\n (valueChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-primitive-textfield>\n\n <div *ngSwitchCase=\"'color'\" tuiGroup>\n <tui-primitive-textfield\n tuiTextfieldType=\"color\"\n tuiTextfieldSize=\"m\"\n [attr.id]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [tuiInputOpacity]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n [value]=\"getColor(propertyConnector.documentationPropertyValue)\"\n (valueChange)=\"onColorChange(propertyConnector, $event)\"\n ></tui-primitive-textfield>\n <tui-input-count\n tuiTextfieldSize=\"m\"\n [max]=\"100\"\n [ngModel]=\"getOpacity(propertyConnector.documentationPropertyValue)\"\n (ngModelChange)=\"onOpacityChange(propertyConnector, $event)\"\n >\n Opacity\n </tui-input-count>\n </div>\n\n <tui-input-count\n *ngSwitchCase=\"'number'\"\n tuiTextfieldSize=\"m\"\n [nativeId]=\"propertyConnector.attrName\"\n [tuiTextfieldLabelOutside]=\"true\"\n [ngModel]=\"propertyConnector.documentationPropertyValue\"\n (ngModelChange)=\"propertyConnector.onValueChange($event)\"\n ></tui-input-count>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #elseEmitter>\n <tui-notification\n class=\"t-output\"\n [@emitEvent]=\"propertyConnector.emits$ | async\"\n >\n Emit!\n </tui-notification>\n </ng-template>\n </td>\n </tr>\n</table>\n",
641
641
  changeDetection: ChangeDetectionStrategy.OnPush,
642
642
  animations: [
643
643
  trigger('emitEvent', [
@@ -1027,12 +1027,12 @@ let TuiDocNavigationComponent = class TuiDocNavigationComponent {
1027
1027
  this.searchText = searchText;
1028
1028
  this.router = router;
1029
1029
  this.activatedRoute = activatedRoute;
1030
+ this.menuOpen = false;
1030
1031
  this.search = '';
1031
1032
  this.open = false;
1032
1033
  this.openPagesArr = [];
1033
1034
  this.openPagesGroupsArr = [];
1034
1035
  this.active = '';
1035
- this.menuOpen = false;
1036
1036
  this.mode$ = this.mode.change$.pipe(startWith(null), map(() => this.mode.mode || 'onLight'));
1037
1037
  // Angular can't navigate no anchor links
1038
1038
  // https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
@@ -1339,8 +1339,8 @@ let TuiDocPageComponent = class TuiDocPageComponent {
1339
1339
  this.package = '';
1340
1340
  this.type = '';
1341
1341
  this.path = '';
1342
- this.activeItemIndex = NaN;
1343
1342
  this.tabConnectors = EMPTY_QUERY;
1343
+ this.activeItemIndex = NaN;
1344
1344
  }
1345
1345
  get showSeeAlso() {
1346
1346
  return !!this.seeAlso.length && this.activeItemIndex === 0;