Skip to content

Commit

Permalink
feat(appearance): 'fill' | 'outline'
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Balet committed Apr 16, 2024
1 parent e4d0258 commit ba01963
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ <h1>Mat birthday Input example</h1>
</form>

<form #f2="ngForm" [formGroup]="emptyBirthdayForm">
<mat-form-field floatLabel="always">
<mat-form-field floatLabel="always" appearance="outline">
<mat-label>Birthday</mat-label>

<!-- @TODO : add min & max -->
<ngx-mat-birthday-input formControlName="birthday" id="birthday"></ngx-mat-birthday-input>
<ngx-mat-birthday-input
formControlName="birthday"
id="birthday"
appearance="outline"
></ngx-mat-birthday-input>

<mat-icon matSuffix>event</mat-icon>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form class="birthday-form" [formGroup]="itemForm" [autocomplete]="autocomplete">
<mat-form-field class="day-input" subscriptSizing="dynamic">
<mat-form-field class="day-input" subscriptSizing="dynamic" [appearance]="appearance">
<mat-label *ngIf="labels">{{ labels[0] }}</mat-label>
<input
matInput
Expand All @@ -12,7 +12,7 @@
[placeholder]="placeholders[0]"
/>
</mat-form-field>
<mat-form-field class="month-input" subscriptSizing="dynamic">
<mat-form-field class="month-input" subscriptSizing="dynamic" [appearance]="appearance">
<mat-label *ngIf="labels">{{ labels[1] }}</mat-label>
<input
matInput
Expand All @@ -26,7 +26,7 @@
#monthInput
/>
</mat-form-field>
<mat-form-field class="year-input" subscriptSizing="dynamic">
<mat-form-field class="year-input" subscriptSizing="dynamic" [appearance]="appearance">
<mat-label *ngIf="labels">{{ labels[2] }}</mat-label>
<input
matInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ import {
ReactiveFormsModule,
} from '@angular/forms'
import { ErrorStateMatcher, _AbstractConstructor, mixinErrorState } from '@angular/material/core'
import { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field'
import {
MatFormFieldAppearance,
MatFormFieldControl,
MatFormFieldModule,
} from '@angular/material/form-field'
import { MatInputModule } from '@angular/material/input'
import { Subject, takeUntil } from 'rxjs'

Expand Down Expand Up @@ -92,6 +96,7 @@ export class NgxMatBirthdayInputComponent
@Input() labels: [string, string, string] = ['DD', 'MM', 'YYYY']
@Input() placeholders: [string, string, string] = ['', '', '']
@Input() name?: string
@Input() appearance: MatFormFieldAppearance = 'fill'

@Output() dateChanged: EventEmitter<Date> = new EventEmitter<Date>()

Expand Down

0 comments on commit ba01963

Please sign in to comment.