-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(form-field): examples should use fill appearance by default (#18222
) - stop using the soon to be deprecated legacy appearance by default Fixes #14792 (cherry picked from commit 3168e94)
- Loading branch information
Showing
15 changed files
with
84 additions
and
97 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
...ples/material/form-field/form-field-custom-control/form-field-custom-control-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<mat-form-field> | ||
<example-tel-input placeholder="Phone number" required></example-tel-input> | ||
<mat-form-field appearance="fill"> | ||
<mat-label>Phone number</mat-label> | ||
<example-tel-input required></example-tel-input> | ||
<mat-icon matSuffix>phone</mat-icon> | ||
<mat-hint>Include area code</mat-hint> | ||
</mat-form-field> |
9 changes: 2 additions & 7 deletions
9
src/components-examples/material/form-field/form-field-error/form-field-error-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
.example-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.example-container > * { | ||
width: 100%; | ||
.example-container .mat-form-field + .mat-form-field { | ||
margin-left: 8px; | ||
} |
5 changes: 3 additions & 2 deletions
5
src/components-examples/material/form-field/form-field-error/form-field-error-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<div class="example-container"> | ||
<mat-form-field> | ||
<input matInput placeholder="Enter your email" [formControl]="email" required> | ||
<mat-form-field appearance="fill"> | ||
<mat-label>Enter your email</mat-label> | ||
<input matInput placeholder="[email protected]" [formControl]="email" required> | ||
<mat-error *ngIf="email.invalid">{{getErrorMessage()}}</mat-error> | ||
</mat-form-field> | ||
</div> |
9 changes: 2 additions & 7 deletions
9
src/components-examples/material/form-field/form-field-hint/form-field-hint-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
.example-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.example-container > * { | ||
width: 100%; | ||
.example-container .mat-form-field + .mat-form-field { | ||
margin-left: 8px; | ||
} |
10 changes: 6 additions & 4 deletions
10
src/components-examples/material/form-field/form-field-hint/form-field-hint-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
src/components-examples/material/form-field/form-field-label/form-field-label-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 22 additions & 23 deletions
45
src/components-examples/material/form-field/form-field-label/form-field-label-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
<div class="example-container"> | ||
<form class="example-container" [formGroup]="options"> | ||
<mat-checkbox formControlName="hideRequired">Hide required marker</mat-checkbox> | ||
<form [formGroup]="options"> | ||
<mat-checkbox [formControl]="hideRequiredControl">Hide required marker</mat-checkbox> | ||
<div> | ||
<label>Float label: </label> | ||
<mat-radio-group formControlName="floatLabel"> | ||
<mat-radio-group [formControl]="floatLabelControl"> | ||
<mat-radio-button value="auto">Auto</mat-radio-button> | ||
<mat-radio-button value="always">Always</mat-radio-button> | ||
<mat-radio-button value="never">Never</mat-radio-button> | ||
</mat-radio-group> | ||
</div> | ||
</form> | ||
|
||
<mat-form-field | ||
[hideRequiredMarker]="options.value.hideRequired" | ||
[floatLabel]="options.value.floatLabel"> | ||
<input matInput placeholder="Simple placeholder" required> | ||
</mat-form-field> | ||
<mat-form-field appearance="fill" | ||
[hideRequiredMarker]="hideRequiredControl.value" | ||
[floatLabel]="floatLabelControl.value"> | ||
<input matInput placeholder="Simple placeholder" required> | ||
</mat-form-field> | ||
|
||
<mat-form-field [floatLabel]="options.value.floatLabel"> | ||
<mat-label>Both a label and a placeholder</mat-label> | ||
<input matInput placeholder="Simple placeholder"> | ||
</mat-form-field> | ||
<mat-form-field appearance="fill" [floatLabel]="floatLabelControl.value"> | ||
<mat-label>Both a label and a placeholder</mat-label> | ||
<input matInput placeholder="Simple placeholder"> | ||
</mat-form-field> | ||
|
||
<mat-form-field | ||
[hideRequiredMarker]="options.value.hideRequired" | ||
[floatLabel]="options.value.floatLabel"> | ||
<mat-select required> | ||
<mat-option>-- None --</mat-option> | ||
<mat-option value="option">Option</mat-option> | ||
</mat-select> | ||
<mat-label><mat-icon>favorite</mat-icon> <b> Fancy</b> <i> label</i></mat-label> | ||
</mat-form-field> | ||
<mat-form-field appearance="fill" | ||
[hideRequiredMarker]="hideRequiredControl.value" | ||
[floatLabel]="floatLabelControl.value"> | ||
<mat-select required> | ||
<mat-option>-- None --</mat-option> | ||
<mat-option value="option">Option</mat-option> | ||
</mat-select> | ||
<mat-label><mat-icon>favorite</mat-icon> <b> Fancy</b> <i> label</i></mat-label> | ||
</mat-form-field> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 1 addition & 8 deletions
9
...mponents-examples/material/form-field/form-field-overview/form-field-overview-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
.example-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.example-container > * { | ||
width: 100%; | ||
} | ||
/** No CSS for this example */ |
21 changes: 12 additions & 9 deletions
21
...ponents-examples/material/form-field/form-field-overview/form-field-overview-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
<div class="example-container"> | ||
<mat-form-field> | ||
<input matInput placeholder="Input"> | ||
<mat-form-field appearance="fill"> | ||
<mat-label>Input</mat-label> | ||
<input matInput> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<textarea matInput placeholder="Textarea"></textarea> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<mat-select placeholder="Select"> | ||
<br> | ||
<mat-form-field appearance="fill"> | ||
<mat-label>Select</mat-label> | ||
<mat-select> | ||
<mat-option value="option">Option</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
<br> | ||
<mat-form-field appearance="fill"> | ||
<mat-label>Textarea</mat-label> | ||
<textarea matInput></textarea> | ||
</mat-form-field> | ||
</div> |
9 changes: 2 additions & 7 deletions
9
...xamples/material/form-field/form-field-prefix-suffix/form-field-prefix-suffix-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...amples/material/form-field/form-field-prefix-suffix/form-field-prefix-suffix-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
...components-examples/material/form-field/form-field-theming/form-field-theming-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
.example-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.example-container > * { | ||
width: 100%; | ||
.example-container .mat-form-field + .mat-form-field { | ||
margin-left: 8px; | ||
} |
13 changes: 8 additions & 5 deletions
13
...omponents-examples/material/form-field/form-field-theming/form-field-theming-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
<form class="example-container" [formGroup]="options" [style.fontSize.px]="getFontSize()"> | ||
<mat-form-field [color]="options.value.color"> | ||
<mat-select placeholder="Color" formControlName="color"> | ||
<mat-form-field appearance="fill" [color]="colorControl.value"> | ||
<mat-label>Color</mat-label> | ||
<mat-select [formControl]="colorControl"> | ||
<mat-option value="primary">Primary</mat-option> | ||
<mat-option value="accent">Accent</mat-option> | ||
<mat-option value="warn">Warn</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
|
||
<mat-form-field [color]="options.value.color"> | ||
<input matInput type="number" placeholder="Font size (px)" formControlName="fontSize" min="10"> | ||
<mat-error *ngIf="options.get('fontSize')?.invalid">Min size: 10px</mat-error> | ||
<mat-form-field appearance="fill" [color]="colorControl.value"> | ||
<mat-label>Font size</mat-label> | ||
<input matInput type="number" placeholder="Ex. 12" [formControl]="fontSizeControl" min="10"> | ||
<span matSuffix>px</span> | ||
<mat-error *ngIf="fontSizeControl.invalid">Min size: 10px</mat-error> | ||
</mat-form-field> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters