issue-5-product-gamesystems #10
@ -1,7 +1,12 @@
|
|||||||
<table mat-table [dataSource]="datasource" class="mat-elevation-z8">
|
<table mat-table [dataSource]="datasource" class="mat-elevation-z8">
|
||||||
<ng-container *ngFor="let col of displayedColumns; let i = index" [matColumnDef]="col">
|
<ng-container *ngFor="let col of displayedColumns; let i = index" [matColumnDef]="col">
|
||||||
<th mat-header-cell *matHeaderCellDef>{{col}}</th>
|
<th mat-header-cell *matHeaderCellDef>{{col}}</th>
|
||||||
<td mat-cell *matCellDef="let state">{{getStateLabel(state, i)}}</td>
|
<td mat-cell *matCellDef="let state">
|
||||||
|
<span *ngIf="i < displayedColumns.length-1">{{getStateLabel(state, i)}}</span>
|
||||||
|
<mat-icon *ngIf="i == displayedColumns.length-1">
|
||||||
|
{{state.initial? 'done':'close'}}
|
||||||
|
</mat-icon>
|
||||||
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mat-column-Initial {
|
||||||
|
width: 32px;
|
||||||
|
}
|
||||||
|
@ -13,8 +13,9 @@ import {
|
|||||||
} from "@angular/material/table";
|
} from "@angular/material/table";
|
||||||
import {SimpleState} from "../../../../game-model/gamesystems/SimpleState";
|
import {SimpleState} from "../../../../game-model/gamesystems/SimpleState";
|
||||||
import {State} from "../../../../game-model/gamesystems/State";
|
import {State} from "../../../../game-model/gamesystems/State";
|
||||||
import {NgForOf} from "@angular/common";
|
import {NgForOf, NgIf} from "@angular/common";
|
||||||
import {ProductState} from "../../../../game-model/gamesystems/ProductState";
|
import {ProductState} from "../../../../game-model/gamesystems/ProductState";
|
||||||
|
import {MatIcon} from "@angular/material/icon";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-product-state-editor',
|
selector: 'app-product-state-editor',
|
||||||
@ -30,7 +31,9 @@ import {ProductState} from "../../../../game-model/gamesystems/ProductState";
|
|||||||
MatHeaderCellDef,
|
MatHeaderCellDef,
|
||||||
MatCell,
|
MatCell,
|
||||||
MatCellDef,
|
MatCellDef,
|
||||||
NgForOf
|
NgForOf,
|
||||||
|
NgIf,
|
||||||
|
MatIcon
|
||||||
],
|
],
|
||||||
templateUrl: './product-state-editor.component.html',
|
templateUrl: './product-state-editor.component.html',
|
||||||
styleUrl: './product-state-editor.component.scss'
|
styleUrl: './product-state-editor.component.scss'
|
||||||
@ -45,6 +48,7 @@ export class ProductStateEditorComponent implements OnInit{
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.gamesystem!.generateFromChildsystems();
|
this.gamesystem!.generateFromChildsystems();
|
||||||
this.generateColumnNamesRecursively(this.gamesystem!, "");
|
this.generateColumnNamesRecursively(this.gamesystem!, "");
|
||||||
|
this.displayedColumns.push('Initial');
|
||||||
this.datasource.data = this.gamesystem!.states;
|
this.datasource.data = this.gamesystem!.states;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user