Files
barker/bookie/src/app/sales/discount/discount.component.html
Amritanshu efa2af396d Chore: Moved from css to sass, god knows what to do now.
Chore: Prettier line length changed to 120 from 100
Fix: Hard coded the face as the primary color to make the buttons stand out
2023-03-13 23:52:44 +05:30

33 lines
1.5 KiB
HTML

<h2 mat-dialog-title>Discount</h2>
<mat-dialog-content>
<form [formGroup]="form" class="flex flex-col">
<mat-table #table [dataSource]="dataSource" formArrayName="discounts">
<!-- Name Column -->
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.name }}</mat-cell>
</ng-container>
<!-- Discount Column -->
<ng-container matColumnDef="discount">
<mat-header-cell *matHeaderCellDef class="center" class="flex-auto">Discount</mat-header-cell>
<mat-cell *matCellDef="let row; let i = index" class="center" [formGroupName]="i" class="flex-auto">
<mat-form-field class="flex-auto">
<input matInput type="number" formControlName="discount" autocomplete="off" />
<span matSuffix>%</span>
<mat-hint>Cust: {{ row.customer | percent : '1.2-2' }}</mat-hint>
<mat-hint align="end">Max: {{ row.limit | percent : '1.2-2' }}</mat-hint>
</mat-form-field>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
</mat-table>
</form>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button [mat-dialog-close]="false">Cancel</button>
<button mat-button (click)="accept()" color="primary">Ok</button>
</mat-dialog-actions>