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(doc/table): added the possibility of controlling the display of the column #241

Merged
merged 2 commits into from
May 11, 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
@@ -1,11 +1,17 @@
<h3>Base example</h3>
<div>
show amount column
<prizm-toggle size="m" [(ngModel)]="showFormatNumber" [ngModelOptions]="{ standalone: true }">
</prizm-toggle>
</div>
<br />
<prizm-scrollbar class="scrollable">
<table prizmTable class="table" size="s">
<thead>
<tr prizmThGroup>
<th prizmTh>Наименование</th>
<th prizmTh>Категория</th>
<th prizmTh>Количество</th>
<th prizmTh *ngIf="showFormatNumber">Количество</th>
</tr>
</thead>

Expand Down Expand Up @@ -44,7 +50,7 @@ <h3>Base example</h3>
{{ first ? '#first' : '' }}
{{ last ? '#last' : '' }}
</td>
<td class="format__number" prizmTd>
<td *ngIf="showFormatNumber" class="format__number" prizmTd>
{{ item.count | spaceNumber : '0.0-0' }}
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface ITableProduct {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TableTreeExampleComponent {
showFormatNumber = true;
public columns: string[] = ['code', 'name', 'category', 'count'];

public products: ITableProduct[] = TABLE_EXAMPLE_TREE_DATA_1;
Expand Down
2 changes: 2 additions & 0 deletions apps/doc/src/app/components/table/table-example.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
PrizmScrollbarModule,
PrizmStickyModule,
PrizmTableModule,
PrizmToggleModule,
} from '@prizm-ui/components';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TableSelectableExampleComponent } from './examples/table-selectable-example/table-selectable-example.component';
Expand Down Expand Up @@ -57,6 +58,7 @@ import { TableDataSourceExampleComponent } from './examples/table-data-source-ex
],
imports: [
CommonModule,
PrizmToggleModule,
PrizmAddonDocModule,
PrizmStickyModule,
PrizmTableModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ <h2>Size M</h2>
<div class="box prizm-font-main-body-14">
<div>
simple
<prizm-toggle size="m" [(ngModel)]="value" [ngModelOptions]="{ standalone: true }"
<prizm-toggle
size="m"
[ngModel]="value"
(ngModelChange)="value = $event"
[ngModelOptions]="{ standalone: true }"
>Ng Model</prizm-toggle
>
</div>
Expand Down Expand Up @@ -63,3 +67,8 @@ <h2>Size L</h2>
</div>
</div>
</div>

<br /><br />
<div>
Value: <b>{{ value ? 'TRUE' : 'FALSE' }}</b>
</div>