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

feat(addon-doc): support icons inside menu #5437

Merged
merged 1 commit into from
Sep 20, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
}
}

.t-icon {
margin-left: 0.5rem;
}

.t-chevron {
.transition(transform);
width: 1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
(click)="onClick(input)"
>
{{ item.title }}
<tui-svg
*polymorpheusOutlet="item.icon as icon"
class="t-icon"
[src]="icon"
></tui-svg>
</a>
</tui-opt-group>
</tui-data-list>
Expand Down Expand Up @@ -81,7 +86,13 @@
(click)="closeMenu()"
>
{{ item.title }}
<tui-svg
*polymorpheusOutlet="item.icon as icon"
class="t-icon"
[src]="icon"
></tui-svg>
</a>

<ng-template #subPagesTemplate>
<div
routerLinkActive
Expand All @@ -101,6 +112,11 @@
[src]="icons.more"
></tui-svg>
{{ item.title }}
<tui-svg
*polymorpheusOutlet="item.icon as icon"
class="t-icon"
[src]="icon"
></tui-svg>
</button>
<tui-expand
class="t-expand"
Expand All @@ -118,6 +134,11 @@
(click)="closeMenu()"
>
{{ subPage.title }}
<tui-svg
*polymorpheusOutlet="item.icon as icon"
class="t-icon"
[src]="icon"
></tui-svg>
</a>
</div>
</tui-expand>
Expand Down
3 changes: 3 additions & 0 deletions projects/addon-doc/interfaces/page.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';

export interface TuiDocPageBase {
readonly section?: string;
readonly title: string;
Expand All @@ -7,6 +9,7 @@ export interface TuiDocPage extends TuiDocPageBase {
readonly fragment?: string;
readonly keywords?: string;
readonly route: string;
readonly icon?: PolymorpheusContent;
}

export interface TuiDocPageGroup extends TuiDocPageBase {
Expand Down
4 changes: 3 additions & 1 deletion projects/demo/src/modules/app/pages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const pages = [
import {TuiDocPages} from '@taiga-ui/addon-doc';

export const pages: TuiDocPages = [
// Documentation
{
section: `Documentation`,
Expand Down