Skip to content

Commit

Permalink
refactor: post comments (#8601)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Aug 20, 2024
1 parent abfba9e commit 237019b
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import {Directive, Input} from '@angular/core';

/**
* @deprecated: use [textContent]="code"
*/
@Directive({
standalone: true,
selector: 'code[tuiDocText]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {TuiSidebarDirective} from './sidebar.directive';
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [tuiSlideIn],
host: {
class: '"t-" + direction',
'[class]': '"t-" + direction',
'[@tuiSlideIn]': 'animation',
},
})
Expand Down
1 change: 0 additions & 1 deletion projects/core/components/expand/expand.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export class TuiExpandComponent {
}
}

// noinspection JSUnusedGlobalSymbols
protected onExpandLoaded(event: Event): void {
event.stopPropagation();

Expand Down
2 changes: 0 additions & 2 deletions projects/core/components/scrollbar/scrollbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ export class TuiScrollbar {
return this.browserScrollRef.nativeElement !== this.el;
}

// noinspection JSUnusedGlobalSymbols
protected onScrollable(element: HTMLElement): void {
this.browserScrollRef.nativeElement = element;
}

// noinspection JSUnusedGlobalSymbols
protected scrollIntoView(detail: HTMLElement): void {
if (this.delegated) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MOVE_THRESHOLD = 15;
'onTouchStart($event.touches[0].clientX, $event.touches[0].clientY)',
'(document:pointerdown.silent)': 'closeDropdown($event.target)',
'(document:contextmenu.capture.silent)': 'closeDropdown($event.target)',
'(document:keydown.esc)': 'closeDropdown($event.target)',
'(document:keydown.esc)': 'closeDropdown($event.currentTarget)',
'(contextmenu.prevent.stop)': 'onContextMenu($event.clientX, $event.clientY)',
},
})
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/components/alert/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
[(documentationPropertyValue)]="data"
>
Input data of notification, type:
<code tuiDocText="<I>"></code>
<code [textContent]="'<I>'"></code>
</ng-template>
<ng-template
documentationPropertyName="autoClose"
Expand Down Expand Up @@ -138,7 +138,7 @@
You can also customize notification logic with a component. Inject
<code>POLYMORPHEUS_CONTEXT</code>
into the component to get context input data and to output results. It has the following interface:
<code tuiDocText="TuiPopover<TuiAlertOptions<I>, O>"></code>
<code [textContent]="'TuiPopover<TuiAlertOptions<I>, O>'"></code>
, where
<code>O</code>
is output data type and
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/components/combo-box/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
[(documentationPropertyValue)]="strict"
>
Value must only be an item of suggestions&nbsp;
<code tuiDocText="<T>"></code>
<code [textContent]="'<T>'"></code>

<p>
<strong>
Expand All @@ -232,7 +232,7 @@
can handle
<code>string</code>
value, as well as
<code tuiDocText="<T>"></code>
<code [textContent]="'<T>'"></code>
</strong>
</p>
</ng-template>
Expand Down
10 changes: 5 additions & 5 deletions projects/demo/src/modules/components/dialog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ <h2 *ngIf="size === 'xl'">Template can be customized</h2>

<p>
Pass
<code tuiDocText="Observable<boolean>"></code>
<code [textContent]="'Observable<boolean>'"></code>
if you want prevent closing, for example, with a confirmation prompt. Be careful, passing
<code tuiDocText="Observable<boolean>"></code>
<code [textContent]="'Observable<boolean>'"></code>
will always display cross button even if it emits
<code>false</code>
value!
Expand All @@ -223,7 +223,7 @@ <h2 *ngIf="size === 'xl'">Template can be customized</h2>
[(documentationPropertyValue)]="dismissible"
>
Dialog can be canceled with Escape key or with a click outside. Pass
<code tuiDocText="Observable<boolean>"></code>
<code [textContent]="'Observable<boolean>'"></code>
if you want prevent closing, for example, with a confirmation prompt.
</ng-template>
<ng-template
Expand All @@ -232,7 +232,7 @@ <h2 *ngIf="size === 'xl'">Template can be customized</h2>
[(documentationPropertyValue)]="data"
>
Input data for dialog, type:
<code tuiDocText="<T>"></code>
<code [textContent]="'<T>'"></code>
</ng-template>
<ng-template
documentationPropertyName="header"
Expand Down Expand Up @@ -298,7 +298,7 @@ <h2 *ngIf="size === 'xl'">Template can be customized</h2>
in it. Dialog will provide this token with some useful options:
<code>$implicit</code>
with
<code tuiDocText="Observer<O>"></code>
<code [textContent]="'Observer<O>'"></code>
and
<code>completeWith</code>
hook to call
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/src/modules/components/input/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
[(documentationPropertyValue)]="placeholder"
>
Placeholder (use external
<code tuiDocText="<input tuiTextfieldLegacy />"></code>
<code [textContent]="'<input tuiTextfieldLegacy />'"></code>
to set it)
</ng-template>
</tui-doc-documentation>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h6 class="description">Single color</h6>
<p>
Use
<code tuiDocText="<progress />"></code>
<code [textContent]="'<progress />'"></code>
's CSS-property
<code>color</code>
to set solid color of progress indicator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import {AsyncPipe, isPlatformServer} from '@angular/common';
import {Component, inject, PLATFORM_ID} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiDocText} from '@taiga-ui/addon-doc';
import {TUI_IS_E2E} from '@taiga-ui/cdk';
import {TuiProgress} from '@taiga-ui/kit';
import {of, timer} from 'rxjs';

@Component({
standalone: true,
imports: [TuiDocText, TuiProgress, AsyncPipe],
imports: [TuiProgress, AsyncPipe],
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
Expand Down
10 changes: 5 additions & 5 deletions projects/demo/src/modules/components/progress-bar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
</dt>
<dd>
– attribute component for native html tag
<code tuiDocText="<progress />"></code>
<code [textContent]="'<progress />'"></code>
.
</dd>
</dl>
<p>
<strong>Usage:</strong>
<code tuiDocText='<progress tuiProgressBar value="40" max="100"></progress>'></code>
<code [textContent]="'<progress tuiProgressBar value=\'40\' max=\'100\'></progress>'"></code>
.
</p>

Expand Down Expand Up @@ -119,7 +119,7 @@
value
</a>
of
<code tuiDocText="<progress />"></code>
<code [textContent]="'<progress />'"></code>
</ng-template>

<ng-template
Expand All @@ -138,7 +138,7 @@
max
</a>
of
<code tuiDocText="<progress />"></code>
<code [textContent]="'<progress />'"></code>
</ng-template>

<ng-template
Expand All @@ -161,7 +161,7 @@
Color of the progress indicator
<p>
We recommend set solid color via
<code tuiDocText="<progress />"></code>
<code [textContent]="'<progress />'"></code>
's CSS-property
<code>color</code>
(especially, if you support old not-chromium based Edge)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ng-template pageTab>
<dl>
<dt>
<code tuiDocText="<tui-progress-circle />"></code>
<code [textContent]="'<tui-progress-circle />'"></code>
</dt>
<dd>
is a component to visually represent the completion of a process or operation (as a partially filled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<p>
Method
<strong>
<code tuiDocText="scroll$: Observable<[number, number]>"></code>
<code [textContent]="'scroll$: Observable<[number, number]>'"></code>
</strong>
<em>
(emits a tuple tuple
Expand Down
10 changes: 5 additions & 5 deletions projects/demo/src/modules/components/slider/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</dt>
<dd>
attribute component for native html tag
<code tuiDocText='<input type="range" />'></code>
<code [textContent]="'<input type=\'range\' />'"></code>
to choose a value from a limited range.
</dd>
</dl>
Expand All @@ -28,7 +28,7 @@
</p>
<p>
<strong>Usage:</strong>
<code tuiDocText='<input tuiSlider type="range" min="0" max="100" step="1" />'></code>
<code [textContent]="'<input tuiSlider type=\'range\' min=\'0\' max=\'100\' step=\'1\' />'"></code>
.
</p>

Expand Down Expand Up @@ -147,7 +147,7 @@
max
</a>
of
<code tuiDocText='<input type="range" />'></code>
<code [textContent]="'<input type=\'range\' />'"></code>
</ng-template>
<ng-template
documentationPropertyMode="input"
Expand All @@ -165,7 +165,7 @@
min
</a>
of
<code tuiDocText='<input type="range" />'></code>
<code [textContent]="'<input type=\'range\' />'"></code>
</ng-template>
<ng-template
documentationPropertyMode="input"
Expand All @@ -183,7 +183,7 @@
step
</a>
of
<code tuiDocText='<input type="range" />'></code>
<code [textContent]="'<input type=\'range\' />'"></code>
</ng-template>
<ng-template
documentationPropertyMode="input"
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/src/modules/components/textarea/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
[(documentationPropertyValue)]="maxLength"
>
Use maxLength for highlighting extra characters. If you want to limit the number of characters, add
<code tuiDocText="<textarea tuiTextfieldLegacy></textarea>"></code>
<code [textContent]="'<textarea tuiTextfieldLegacy />'"></code>
with native maxlength attribute.
</ng-template>
<ng-template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {TuiSwipe} from '@taiga-ui/cdk';
encapsulation,
changeDetection,
host: {
class: 'swiped',
'[class]': 'swiped',
},
})
export default class Example {
Expand Down
12 changes: 6 additions & 6 deletions projects/demo/src/modules/markup/spaces/examples/1/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h2 class="title">
Margin top
<code tuiDocText="tui-space_top-<value>"></code>
<code [textContent]="'tui-space_top-<value>'"></code>
</h2>
<div class="row">
<div class="example tui-space_top-1 tui-space_right-2">
Expand All @@ -21,7 +21,7 @@ <h2 class="title">
</div>
<h2 class="title">
Margin bottom
<code tuiDocText="tui-space_bottom-<value>"></code>
<code [textContent]="'tui-space_bottom-<value>'"></code>
</h2>
<div class="row row_align-items_bottom">
<div class="example tui-space_bottom-1 tui-space_right-2">
Expand All @@ -42,7 +42,7 @@ <h2 class="title">
</div>
<h2 class="title">
Margin right
<code tuiDocText="tui-space_right-<value>"></code>
<code [textContent]="'tui-space_right-<value>'"></code>
</h2>
<div class="row">
<div class="example tui-space_right-1">
Expand All @@ -64,7 +64,7 @@ <h2 class="title">
</div>
<h2 class="title">
Margin left
<code tuiDocText="tui-space_left-<value>"></code>
<code [textContent]="'tui-space_left-<value>'"></code>
</h2>
<div class="row">
<div class="example"></div>
Expand All @@ -86,9 +86,9 @@ <h2 class="title">
</div>
<h2 class="title">
Vertical and horizontal margins
<code tuiDocText="tui-space_vertical-<value>"></code>
<code [textContent]="'tui-space_vertical-<value>'"></code>
and
<code tuiDocText="tui-space_horizontal-<value>"></code>
<code [textContent]="'tui-space_horizontal-<value>'"></code>
</h2>
<div class="row">
<div class="example tui-space_vertical-4">
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/markup/spaces/examples/1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import {ClipboardModule} from '@angular/cdk/clipboard';
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiDocCopy, TuiDocText} from '@taiga-ui/addon-doc';
import {TuiDocCopy} from '@taiga-ui/addon-doc';

@Component({
standalone: true,
imports: [TuiDocText, TuiDocCopy, ClipboardModule],
imports: [TuiDocCopy, ClipboardModule],
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
Expand Down
12 changes: 6 additions & 6 deletions projects/demo/src/modules/markup/spaces/examples/2/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h2 class="title">
Margin top
<code tuiDocText=".tui-space(top, <value>);"></code>
<code [textContent]="'.tui-space(top, <value>);'"></code>
</h2>
<div class="row">
<div class="example example_top-1">
Expand All @@ -21,7 +21,7 @@ <h2 class="title">
</div>
<h2 class="title">
Margin bottom
<code tuiDocText=".tui-space(bottom, <value>);"></code>
<code [textContent]="'.tui-space(bottom, <value>);'"></code>
</h2>
<div class="row row_align-items_bottom">
<div class="example example_bottom-1">
Expand All @@ -42,7 +42,7 @@ <h2 class="title">
</div>
<h2 class="title">
Margin right
<code tuiDocText=".tui-space(right, <value>);"></code>
<code [textContent]="'.tui-space(right, <value>);'"></code>
</h2>
<div class="row">
<div class="example example_right-1">
Expand All @@ -64,7 +64,7 @@ <h2 class="title">
</div>
<h2 class="title">
Margin left
<code tuiDocText=".tui-space(left, <value>);"></code>
<code [textContent]="'.tui-space(left, <value>);'"></code>
</h2>
<div class="row">
<div class="example"></div>
Expand All @@ -86,9 +86,9 @@ <h2 class="title">
</div>
<h2 class="title">
Vertical and horizontal margins
<code tuiDocText=".tui-space(vertical, <value>);"></code>
<code [textContent]="'.tui-space(vertical, <value>);'"></code>
and
<code tuiDocText=".tui-space(horizontal, <value>);"></code>
<code [textContent]="'.tui-space(horizontal, <value>);'"></code>
</h2>
<div class="row">
<div class="example example_vertical">
Expand Down
Loading

0 comments on commit 237019b

Please sign in to comment.