feat: beautify case input

This commit is contained in:
Krzysztof Rudnicki 2024-03-09 18:29:05 +01:00
parent 9d7fcdc8a4
commit 8f1bc09351
3 changed files with 92 additions and 26 deletions

View File

@ -1,24 +1,25 @@
<form [formGroup]="userInputForm" (ngSubmit)="onSubmit()" fxLayout="column" fxLayoutGap="20px" fxLayoutAlign="start">
<mat-form-field appearance="fill" fxFlex>
<mat-label>Opis Sprawy</mat-label>
<textarea matInput formControlName="generic_input"> </textarea>
</mat-form-field>
<mat-form-field appearance="fill" fxFlex>
<mat-label>Wartość Przedmiotu Sporu</mat-label>
<input matInput type="number" formControlName="trial_value">
</mat-form-field>
<mat-form-field appearance="fill" fxFlex>
<mat-label>Lokacja</mat-label>
<input matInput formControlName="location">
</mat-form-field>
<div fxFlex fxLayout="column" fxLayoutGap="10px">
<mat-checkbox formControlName="experts_called">Powołani Biegli</mat-checkbox>
<mat-checkbox formControlName="witnesses_called">Powołani Świadkowie</mat-checkbox>
</div>
<button mat-raised-button color="primary" type="submit" (click)="onSubmit()" fxFlexAlign="end">Wyślij</button>
</form>
<div class="page-container">
<form [formGroup]="userInputForm" (ngSubmit)="onSubmit()" class="lawyering-form">
<mat-form-field appearance="outline" class="custom-form-field">
<mat-label>Opis Sprawy</mat-label>
<textarea matInput formControlName="generic_input" class="text-area-input"></textarea>
</mat-form-field>
<mat-form-field appearance="outline" class="custom-form-field">
<mat-label>Wartość Przedmiotu Sporu</mat-label>
<input matInput type="number" formControlName="trial_value" class="numeric-input">
</mat-form-field>
<mat-form-field appearance="outline" class="custom-form-field">
<mat-label>Lokacja</mat-label>
<input matInput formControlName="location" class="text-input">
</mat-form-field>
<div class="checkbox-group">
<mat-checkbox formControlName="experts_called" class="custom-checkbox">Powołani Biegli</mat-checkbox>
<mat-checkbox formControlName="witnesses_called" class="custom-checkbox">Powołani Świadkowie</mat-checkbox>
</div>
<button mat-raised-button color="primary" type="submit" (click)="onSubmit()" class="submit-button">Wyślij</button>
</form>
</div>

View File

@ -0,0 +1,43 @@
body, html {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
}
.lawyering-form {
display: flex;
flex-direction: column;
gap: 20px; // Same as fxLayoutGap
width: 100%;
max-width: 600px; // Adjust based on your design preferences
padding: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
background-color: #f5f5f5;
.custom-form-field {
width: 100%; // Ensures form fields take up full width of the form
appearance: outline;
.text-area-input, .numeric-input, .text-input {
width: 100%; // Ensures inputs take up full width of their form field
}
}
.checkbox-group {
display: flex;
flex-direction: column;
gap: 10px; // For spacing between checkboxes
}
.submit-button {
align-self: flex-end; // Aligns the submit button to the end of the form
background-color: #004d40;
color: #ffffff;
font-size: 16px;
font-weight: 500;
}
}

View File

@ -1,12 +1,34 @@
import { Component } from '@angular/core';
import { MatTableModule } from '@angular/material/table'
export interface PeriodicElement {
name: string;
position: number;
weight: number;
symbol: string;
}
const ELEMENT_DATA: PeriodicElement[] = [
{position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'},
{position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'},
{position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'},
{position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'},
{position: 5, name: 'Boron', weight: 10.811, symbol: 'B'},
{position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'},
{position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'},
{position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'},
{position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'},
{position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'},
];
@Component({
selector: 'app-mediators-list',
standalone: true,
imports: [],
imports: [MatTableModule],
templateUrl: './mediators-list.component.html',
styleUrl: './mediators-list.component.scss'
})
export class MediatorsListComponent {
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];
dataSource = ELEMENT_DATA;
}