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

fix (docs/navigation) Правки в примере live demo #5

Merged
merged 2 commits into from
Feb 2, 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 @@ -49,3 +49,4 @@
</div>
</div>
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class NavigationBasicExampleComponent {
public currentNavElementIdx = 0;

public readonly logoPath$ = this.themeSwitcher.change$.pipe(
map(theme => `assets/example/logo-${theme}.png`)
map(theme => `assets/example/logo-${theme.theme}.png`)
);

constructor(private readonly themeSwitcher: PrizmThemeService) {}
Expand All @@ -32,3 +32,4 @@ export class NavigationBasicExampleComponent {
this.currentNavElementIdx = idx;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@
</ng-template>

<ng-template prizmDocPageTab prizmDocHost>
<!-- <h2>PrizmNavigationComponent</h2>
<prizm-doc-demo>
<prizm-navigation
[data]="navigationTree"
[activeElement]="activeElement"
#element
[prizmDocHostElement]="element"
></prizm-navigation>
</prizm-doc-demo>

<prizm-doc-documentation>
<ng-template
documentationPropertyName="data"
Expand All @@ -39,86 +47,7 @@
>
Изменение активного элемента
</ng-template>
</prizm-doc-documentation> -->

<h2>PrizmHeaderModuleBtnComponent</h2>

<prizm-doc-demo>
<prizm-header-module-btn
#element
[prizmDocHostElement]="element"
[icon]="$any(icon)"
[alertsCount]="alertsCount"
[title]="title"
[status]="status"
></prizm-header-module-btn>
</prizm-doc-demo>
<prizm-doc-documentation>
<ng-template
documentationPropertyName="icon"
documentationPropertyType="PrizmContent"
documentationPropertyMode="input"
[documentationPropertyValues]="iconVariants"
[(documentationPropertyValue)]="icon"
>
Иконка
</ng-template>

<ng-template
documentationPropertyName="alertsCount"
documentationPropertyType="number"
documentationPropertyMode="input"
[(documentationPropertyValue)]="alertsCount"
>
Количество уведомлений
</ng-template>

<ng-template
documentationPropertyName="title"
documentationPropertyType="string"
documentationPropertyMode="input"
[(documentationPropertyValue)]="title"
>
Название на кнопке
</ng-template>

<ng-template
documentationPropertyName="status"
documentationPropertyType="IndicatorStatus"
documentationPropertyMode="input"
[documentationPropertyValues]="statusVariants"
[(documentationPropertyValue)]="status"
>
Статус уведомлений
</ng-template>
</prizm-doc-documentation>

<!-- <h2>PrizmHeaderDropdownComponent</h2>
<prizm-doc-documentation>
<ng-template
documentationPropertyName="data"
documentationPropertyType="IScreen[]"
documentationPropertyMode="input"
>
Содержимое выпадающего меню
</ng-template>

<ng-template
documentationPropertyName="currentScreenIdx"
documentationPropertyType="number"
documentationPropertyMode="input"
>
Индекс текущего активного элемента
</ng-template>

<ng-template
documentationPropertyName="screenIdxChange"
documentationPropertyType="EventEmitter<number>"
documentationPropertyMode="output"
>
Изменение текущего активного элемента
</ng-template>
</prizm-doc-documentation> -->
</ng-template>

<ng-template prizmDocPageTab>
Expand All @@ -134,3 +63,4 @@ <h2>PrizmHeaderModuleBtnComponent</h2>
</ol>
</ng-template>
</prizm-doc-page>

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { RawLoaderContent, TuiDocExample } from '@taiga-ui/addon-doc';
import { IconDefs, IndicatorStatus, PrizmContent } from '@prizm-ui/components';
import { IconDefs, INavigationTree, IndicatorStatus, PrizmContent } from '@prizm-ui/components';
import { NAVIGATION_EXAMPLE } from './navigation-example.const';

@Component({
selector: 'prizm-navigation-example',
Expand All @@ -17,14 +18,7 @@ export class NavigationExampleComponent {

public readonly setupModule: RawLoaderContent = import('!!raw-loader!./examples/setup-module.md');

// Navigation module btn
iconVariants: ReadonlyArray<PrizmContent> = ['', ...IconDefs.reduce((a, c) => a.concat(c.data), [])];
public icon: PrizmContent = this.iconVariants[1];
public alertsCount = 3;
public title = 'Название';
public readonly statusVariants: IndicatorStatus[] = ['info', 'secondary', 'success', 'warning', 'danger'];
public status: IndicatorStatus = this.statusVariants[2];

// Navigation menu btn
public isActive = false;
public navigationTree: INavigationTree[] = NAVIGATION_EXAMPLE;
activeElement = NAVIGATION_EXAMPLE[1];
}