Skip to content

Commit

Permalink
feat: reorder form fields; add spacing b/w each
Browse files Browse the repository at this point in the history
  • Loading branch information
grantwforsythe committed May 22, 2024
1 parent b1541cc commit 7b74495
Showing 1 changed file with 71 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,78 +1,76 @@
<div class="flex justify-center">
<form>
<mat-form-field>
<mat-label>Chart Type</mat-label>
<mat-select [formControl]="chartType">
@for (group of chartTypeGroups; track group) {
<mat-optgroup [label]="group.name">
@for (chartType of group.chartTypes; track chartType) {
<mat-option [value]="chartType.value">{{ chartType.name }}</mat-option>
}
</mat-optgroup>
}
</mat-select>
</mat-form-field>

<mat-form-field>
<mat-label>Enter a date range</mat-label>
<mat-date-range-input
[formGroup]="range"
[rangePicker]="picker"
[min]="minDate$ | async"
[max]="maxDate"
>
<input matStartDate placeholder="Start date" formControlName="start" />
<input matEndDate placeholder="End date" formControlName="end" />
</mat-date-range-input>
<mat-hint>MM/DD/YYYY – MM/DD/YYYY</mat-hint>
<mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
<mat-date-range-picker #picker>
<mat-date-range-picker-actions>
<button mat-button matDateRangePickerCancel>Cancel</button>
<button mat-raised-button color="primary" matDateRangePickerApply>Apply</button>
</mat-date-range-picker-actions>
</mat-date-range-picker>
</mat-form-field>
<form class="flex justify-center space-x-8">
<mat-form-field>
<mat-label>Chart Type</mat-label>
<mat-select [formControl]="chartType">
@for (group of chartTypeGroups; track group) {
<mat-optgroup [label]="group.name">
@for (chartType of group.chartTypes; track chartType) {
<mat-option [value]="chartType.value">{{ chartType.name }}</mat-option>
}
</mat-optgroup>
}
</mat-select>
</mat-form-field>

<mat-form-field>
<mat-label>Sorting</mat-label>
<mat-select [formControl]="sort">
<mat-option>None</mat-option>
<mat-option value="desc">Descending</mat-option>
<mat-option value="asc">Ascending</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>Enter a date range</mat-label>
<mat-date-range-input
[formGroup]="range"
[rangePicker]="picker"
[min]="minDate$ | async"
[max]="maxDate"
>
<input matStartDate placeholder="Start date" formControlName="start" />
<input matEndDate placeholder="End date" formControlName="end" />
</mat-date-range-input>
<mat-hint>MM/DD/YYYY – MM/DD/YYYY</mat-hint>
<mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
<mat-date-range-picker #picker>
<mat-date-range-picker-actions>
<button mat-button matDateRangePickerCancel>Cancel</button>
<button mat-raised-button color="primary" matDateRangePickerApply>Apply</button>
</mat-date-range-picker-actions>
</mat-date-range-picker>
</mat-form-field>

<mat-form-field>
<mat-label>Accounts</mat-label>
<mat-select [formControl]="account" multiple>
<mat-select-trigger>
@if (account.value?.length === (accounts$ | async)?.length) {
<span>All Accounts</span>
} @else {
<span>Some Accounts</span>
}
</mat-select-trigger>
@for (account of accounts$ | async; track account.id) {
<mat-option [value]="account.id">{{ account.name }}</mat-option>
<mat-form-field>
<mat-label>Accounts</mat-label>
<mat-select [formControl]="account" multiple>
<mat-select-trigger>
@if (account.value?.length === (accounts$ | async)?.length) {
<span>All Accounts</span>
} @else {
<span>Some Accounts</span>
}
</mat-select>
</mat-form-field>
</mat-select-trigger>
@for (account of accounts$ | async; track account.id) {
<mat-option [value]="account.id">{{ account.name }}</mat-option>
}
</mat-select>
</mat-form-field>

<mat-form-field>
<mat-label>Categories</mat-label>
<mat-select [formControl]="category" multiple>
<mat-select-trigger>
@if (category.value?.length === (categories$ | async)?.length) {
<span>All categories</span>
} @else {
<span>Some categories</span>
}
</mat-select-trigger>
@for (category of categories$ | async; track category?.id) {
<mat-option [value]="category?.id">{{ category?.name }}</mat-option>
<mat-form-field>
<mat-label>Categories</mat-label>
<mat-select [formControl]="category" multiple>
<mat-select-trigger>
@if (category.value?.length === (categories$ | async)?.length) {
<span>All categories</span>
} @else {
<span>Some categories</span>
}
</mat-select>
</mat-form-field>
</form>
</div>
</mat-select-trigger>
@for (category of categories$ | async; track category?.id) {
<mat-option [value]="category?.id">{{ category?.name }}</mat-option>
}
</mat-select>
</mat-form-field>

<mat-form-field>
<mat-label>Sorting</mat-label>
<mat-select [formControl]="sort">
<mat-option>None</mat-option>
<mat-option value="desc">Descending</mat-option>
<mat-option value="asc">Ascending</mat-option>
</mat-select>
</mat-form-field>
</form>

0 comments on commit 7b74495

Please sign in to comment.