Skip to content
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
Expand Up @@ -20,7 +20,6 @@ import {
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { ChangeDetectionStrategy, Component, output } from '@angular/core';
import { ChangeDetectionStrategy, Component, model } from '@angular/core';
import { FormField, FormRoot } from '@angular/forms/signals';
import { RecipeFilterCriteria } from './recipe-filter-criteria';
import {
createDefaultRecipeFilterCriteria,
RecipeFilterCriteria,
} from './recipe-filter-criteria';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
Expand All @@ -9,5 +12,5 @@ import { RecipeFilterCriteria } from './recipe-filter-criteria';
template: ` &lt;🚧 wm-recipe-filter&gt; `,
})
export class RecipeFilter {
filterChange = output<RecipeFilterCriteria>();
filter = model<RecipeFilterCriteria>(createDefaultRecipeFilterCriteria());
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChangeDetectionStrategy, Component, model } from '@angular/core';
import { form, FormField, FormRoot } from '@angular/forms/signals';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import {
createDefaultRecipeFilterCriteria,
RecipeFilterCriteria,
Expand All @@ -8,33 +10,35 @@ import {
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'wm-recipe-filter',
imports: [FormField, FormRoot],
imports: [FormField, FormRoot, MatFormField, MatInput, MatLabel],
template: `
<form [formRoot]="filterForm">
<input
[formField]="filterForm.keywords"
aria-label="Keywords"
placeholder="keywords"
type="text"
/>
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
<input
[formField]="filterForm.maxStepCount"
aria-label="Max Steps"
placeholder="max steps"
type="number"
/>
<form class="filter-form" [formRoot]="filterForm">
<mat-form-field>
<mat-label>Keywords</mat-label>
<input [formField]="filterForm.keywords" matInput type="text" />
</mat-form-field>
<mat-form-field>
<mat-label>Max Ingredients</mat-label>
<input
[formField]="filterForm.maxIngredientCount"
matInput
type="number"
/>
</mat-form-field>
<mat-form-field>
<mat-label>Max Steps</mat-label>
<input [formField]="filterForm.maxStepCount" matInput type="number" />
</mat-form-field>
</form>
`,
styles: `
:host {
text-align: center;
.filter-form {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;

margin-top: 1rem;
}
`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChangeDetectionStrategy, Component, model } from '@angular/core';
import { form, FormField, FormRoot } from '@angular/forms/signals';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import {
createDefaultRecipeFilterCriteria,
RecipeFilterCriteria,
Expand All @@ -8,33 +10,35 @@ import {
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'wm-recipe-filter',
imports: [FormField, FormRoot],
imports: [FormField, FormRoot, MatFormField, MatInput, MatLabel],
template: `
<form [formRoot]="filterForm">
<input
[formField]="filterForm.keywords"
aria-label="Keywords"
placeholder="keywords"
type="text"
/>
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
<input
[formField]="filterForm.maxStepCount"
aria-label="Max Steps"
placeholder="max steps"
type="number"
/>
<form class="filter-form" [formRoot]="filterForm">
<mat-form-field>
<mat-label>Keywords</mat-label>
<input [formField]="filterForm.keywords" matInput type="text" />
</mat-form-field>
<mat-form-field>
<mat-label>Max Ingredients</mat-label>
<input
[formField]="filterForm.maxIngredientCount"
matInput
type="number"
/>
</mat-form-field>
<mat-form-field>
<mat-label>Max Steps</mat-label>
<input [formField]="filterForm.maxStepCount" matInput type="number" />
</mat-form-field>
</form>
`,
styles: `
:host {
text-align: center;
.filter-form {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;

margin-top: 1rem;
}
`,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChangeDetectionStrategy, Component, model } from '@angular/core';
import { form, FormField, FormRoot } from '@angular/forms/signals';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import {
createDefaultRecipeFilterCriteria,
RecipeFilterCriteria,
Expand All @@ -8,33 +10,35 @@ import {
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'wm-recipe-filter',
imports: [FormField, FormRoot],
imports: [FormField, FormRoot, MatFormField, MatInput, MatLabel],
template: `
<form [formRoot]="filterForm">
<input
[formField]="filterForm.keywords"
aria-label="Keywords"
placeholder="keywords"
type="text"
/>
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
<input
[formField]="filterForm.maxStepCount"
aria-label="Max Steps"
placeholder="max steps"
type="number"
/>
<form class="filter-form" [formRoot]="filterForm">
<mat-form-field>
<mat-label>Keywords</mat-label>
<input [formField]="filterForm.keywords" matInput type="text" />
</mat-form-field>
<mat-form-field>
<mat-label>Max Ingredients</mat-label>
<input
[formField]="filterForm.maxIngredientCount"
matInput
type="number"
/>
</mat-form-field>
<mat-form-field>
<mat-label>Max Steps</mat-label>
<input [formField]="filterForm.maxStepCount" matInput type="number" />
</mat-form-field>
</form>
`,
styles: `
:host {
text-align: center;
.filter-form {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;

margin-top: 1rem;
}
`,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChangeDetectionStrategy, Component, model } from '@angular/core';
import { form, FormField, FormRoot } from '@angular/forms/signals';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import {
createDefaultRecipeFilterCriteria,
RecipeFilterCriteria,
Expand All @@ -8,33 +10,35 @@ import {
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'wm-recipe-filter',
imports: [FormField, FormRoot],
imports: [FormField, FormRoot, MatFormField, MatInput, MatLabel],
template: `
<form [formRoot]="filterForm">
<input
[formField]="filterForm.keywords"
aria-label="Keywords"
placeholder="keywords"
type="text"
/>
<input
[formField]="filterForm.maxIngredientCount"
aria-label="Max Ingredients"
formControlName="maxIngredientCount"
placeholder="max ingredients"
type="number"
/>
<input
[formField]="filterForm.maxStepCount"
aria-label="Max Steps"
placeholder="max steps"
type="number"
/>
<form class="filter-form" [formRoot]="filterForm">
<mat-form-field>
<mat-label>Keywords</mat-label>
<input [formField]="filterForm.keywords" matInput type="text" />
</mat-form-field>
<mat-form-field>
<mat-label>Max Ingredients</mat-label>
<input
[formField]="filterForm.maxIngredientCount"
matInput
type="number"
/>
</mat-form-field>
<mat-form-field>
<mat-label>Max Steps</mat-label>
<input [formField]="filterForm.maxStepCount" matInput type="number" />
</mat-form-field>
</form>
`,
styles: `
:host {
text-align: center;
.filter-form {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;

margin-top: 1rem;
}
`,
})
Expand Down
Loading
Loading