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-accordion API docs to new API #10081

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
142 changes: 75 additions & 67 deletions projects/demo/src/modules/components/accordion/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,100 +91,108 @@
<tui-accordion-item [open]="true">
TuiAccordionDirective
<ng-template tuiAccordionItemContent>
<tui-doc-documentation>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="closeOthers"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="closeOthers"
<table tuiDocAPI>
<tr
name="[closeOthers]"
tuiDocAPIItem
type="boolean"
[(value)]="closeOthers"
>
Other sections are closed when user opens one
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="rounded"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="rounded"
</tr>

<tr
name="[rounded]"
tuiDocAPIItem
type="boolean"
[(value)]="rounded"
>
Rounded accordion style
</ng-template>
</tui-doc-documentation>
</tr>
</table>
</ng-template>
</tui-accordion-item>
<tui-accordion-item>
TuiAccordionItemComponent
<ng-template tuiAccordionItemContent>
<tui-doc-documentation>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="async"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="async"
<table tuiDocAPI>
<tr
name="[async]"
tuiDocAPIItem
type="boolean"
[(value)]="async"
>
Waits for a custom event
<code>TUI_EXPAND_LOADED</code>
before opening. Content is initialized when opening starts
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="borders"
documentationPropertyType="'all' | 'top-bottom' | null"
[documentationPropertyValues]="bordersVariants"
[(documentationPropertyValue)]="borders"
</tr>

<tr
name="[borders]"
tuiDocAPIItem
type="'all' | 'top-bottom' | null"
[items]="bordersVariants"
[(value)]="borders"
>
Borders variants
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="disabled"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="disabled"
</tr>

<tr
name="[disabled]"
tuiDocAPIItem
type="boolean"
[(value)]="disabled"
>
Disabled state for an item
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="noPadding"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="noPadding"
</tr>

<tr
name="[noPadding]"
tuiDocAPIItem
type="boolean"
[(value)]="noPadding"
>
Removes default paddings
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="disableHover"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="disableHover"
</tr>

<tr
name="[disableHover]"
tuiDocAPIItem
type="boolean"
[(value)]="disableHover"
>
Disabled header hover state
</ng-template>
<ng-template
documentationPropertyMode="input-output"
documentationPropertyName="open"
documentationPropertyType="boolean"
[documentationPropertyValue]="open"
(documentationPropertyValueChange)="onOpenChange($event)"
</tr>

<tr
name="[(open)]"
tuiDocAPIItem
type="boolean"
[(value)]="open"
(valueChange)="onOpenChange($event)"
>
Open / close state of section
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="size"
documentationPropertyType="TuiSizeS"
[documentationPropertyValues]="sizeVariants"
[(documentationPropertyValue)]="size"
</tr>

<tr
name="[size]"
tuiDocAPIItem
type="TuiSizeS"
[items]="sizeVariants"
[(value)]="size"
>
Size of an accordion item
</ng-template>
<ng-template
documentationPropertyMode="input"
documentationPropertyName="showArrow"
documentationPropertyType="boolean"
[(documentationPropertyValue)]="showArrow"
</tr>

<tr
name="[showArrow]"
tuiDocAPIItem
type="boolean"
[(value)]="showArrow"
>
Show / hide an arrow
</ng-template>
</tui-doc-documentation>
</tr>
</table>
</ng-template>
</tui-accordion-item>
</tui-accordion>
Expand Down
3 changes: 2 additions & 1 deletion projects/demo/src/modules/components/accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import {Component, DestroyRef, inject, ViewChild} from '@angular/core';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {changeDetection} from '@demo/emulate/change-detection';
import {TuiDemo} from '@demo/utils';
import {TuiDocAPI, TuiDocAPIItem} from '@taiga-ui/addon-doc';
import type {TuiSizeS} from '@taiga-ui/core';
import {TUI_EXPAND_LOADED} from '@taiga-ui/core';
import {TuiAccordion} from '@taiga-ui/kit';
import {timer} from 'rxjs';

@Component({
standalone: true,
imports: [TuiAccordion, TuiDemo],
imports: [TuiAccordion, TuiDemo, TuiDocAPI, TuiDocAPIItem],
templateUrl: './index.html',
changeDetection,
})
Expand Down
Loading