Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#9057 - Migrate tui-alert API docs to new API #10083

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 54 additions & 41 deletions projects/demo/src/modules/components/alert/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,62 +48,75 @@
Show
</button>
</tui-doc-demo>
<tui-doc-documentation>
<ng-template
documentationPropertyName="content"
documentationPropertyType="PolymorpheusContent"
[documentationPropertyValues]="contentVariants"
[(documentationPropertyValue)]="content"
<table tuiDocAPI>
<tr
name="[content]"
tuiDocAPIItem
type="PolymorpheusContent"
[items]="contentVariants"
[(value)]="content"
>
Content
</ng-template>
<ng-template
documentationPropertyName="appearance"
documentationPropertyType="string"
[documentationPropertyValues]="appearanceVariants"
[(documentationPropertyValue)]="appearance"
</tr>

<tr
name="[appearance]"
tuiDocAPIItem
type="string"
[items]="appearanceVariants"
[(value)]="appearance"
>
Appearance
</ng-template>
<ng-template
documentationPropertyName="label"
documentationPropertyType="string"
[(documentationPropertyValue)]="label"
</tr>

<tr
name="[label]"
tuiDocAPIItem
type="string"
[(value)]="label"
>
Heading
</ng-template>
<ng-template
documentationPropertyName="data"
documentationPropertyType="number"
[(documentationPropertyValue)]="data"
</tr>

<tr
name="[data]"
tuiDocAPIItem
type="number"
[(value)]="data"
>
Input data of notification, type:
<code [textContent]="'<I>'"></code>
</ng-template>
<ng-template
documentationPropertyName="autoClose"
documentationPropertyType="TuiHandler | number"
[documentationPropertyValues]="autoCloseVariants"
[(documentationPropertyValue)]="autoClose"
</tr>

<tr
name="[autoClose]"
tuiDocAPIItem
type="TuiHandler | number"
[items]="autoCloseVariants"
[(value)]="autoClose"
>
Auto close timeout, 0 for no auto close
</ng-template>
<ng-template
documentationPropertyName="closeable"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="closeable"
</tr>

<tr
name="[closeable]"
tuiDocAPIItem
type="boolean"
[(value)]="closeable"
>
Has close button
</ng-template>
<ng-template
documentationPropertyName="icon"
documentationPropertyType="PolymorpheusContent"
[documentationPropertyValues]="iconVariants"
[(documentationPropertyValue)]="icon"
</tr>

<tr
name="[icon]"
tuiDocAPIItem
type="PolymorpheusContent"
[items]="iconVariants"
[(value)]="icon"
>
Icon
</ng-template>
</tui-doc-documentation>
</tr>
</table>
</ng-template>
<ng-template pageTab>
<ol class="tui-list tui-list_ordered">
Expand Down
3 changes: 2 additions & 1 deletion projects/demo/src/modules/components/alert/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Component, inject, INJECTOR} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {DemoRoute} from '@demo/routes';
import {TuiDemo} from '@demo/utils';
import {TuiDocAPI, TuiDocAPIItem} from '@taiga-ui/addon-doc';
import type {TuiPopoverContext} from '@taiga-ui/cdk';
import type {TuiAlertOptions} from '@taiga-ui/core';
import {TUI_NOTIFICATION_OPTIONS, TuiAlertService, TuiButton} from '@taiga-ui/core';
Expand All @@ -13,7 +14,7 @@ import {AlertExampleWithData} from './examples/4';

@Component({
standalone: true,
imports: [TuiButton, TuiDemo],
imports: [TuiButton, TuiDemo, TuiDocAPI, TuiDocAPIItem],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved!

templateUrl: './index.html',
changeDetection,
})
Expand Down
Loading