mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore(input): remove align input binding (#5141)
BREAKING CHANGE: The `align` input from the `<md-input-container>` component has been removed. Developers instead should use plain CSS to achieve the same effect (using `text-align: end` for example). Fixes #5140.
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
<md-toolbar color="primary">Prefix + Suffix</md-toolbar>
|
||||
<md-card-content>
|
||||
<h4>Text</h4>
|
||||
<md-input-container align="end">
|
||||
<md-input-container class="demo-text-align-end">
|
||||
<input mdInput placeholder="amount">
|
||||
<span mdPrefix>$ </span>
|
||||
<span mdSuffix>.00</span>
|
||||
@@ -301,13 +301,13 @@
|
||||
<input mdInput placeholder="Prefixed" value="example">
|
||||
<div mdPrefix>Example: </div>
|
||||
</md-input-container>
|
||||
<md-input-container align="end">
|
||||
<md-input-container class="demo-text-align-end">
|
||||
<input mdInput placeholder="Suffixed" value="123">
|
||||
<span mdSuffix>.00 €</span>
|
||||
</md-input-container>
|
||||
<br/>
|
||||
Both:
|
||||
<md-input-container align="end">
|
||||
<md-input-container class="demo-text-align-end">
|
||||
<input mdInput #email placeholder="Email Address" value="angular-core">
|
||||
<span mdPrefix><md-icon [class.primary]="email.focused">email</md-icon> </span>
|
||||
<span mdSuffix [class.primary]="email.focused"> @gmail.com</span>
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
margin: 16px;
|
||||
}
|
||||
|
||||
.demo-text-align-end {
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
.demo-textarea {
|
||||
resize: none;
|
||||
border: none;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<ng-content select="[mdPrefix], [matPrefix]"></ng-content>
|
||||
</div>
|
||||
|
||||
<div class="mat-input-infix" [class.mat-end]="align == 'end'">
|
||||
<div class="mat-input-infix">
|
||||
<ng-content selector="input, textarea"></ng-content>
|
||||
|
||||
<span class="mat-input-placeholder-wrapper">
|
||||
|
||||
@@ -88,14 +88,6 @@ $mat-input-underline-height: 1px !default;
|
||||
// Needed to make last line of the textarea line up with the baseline.
|
||||
vertical-align: bottom;
|
||||
|
||||
.mat-end & {
|
||||
text-align: right;
|
||||
|
||||
[dir='rtl'] & {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
// Undo the red box-shadow glow added by Firefox on invalid inputs.
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid
|
||||
&:-moz-ui-invalid {
|
||||
|
||||
@@ -324,9 +324,6 @@ export class MdInputDirective {
|
||||
export class MdInputContainer implements AfterViewInit, AfterContentInit, AfterContentChecked {
|
||||
private _placeholderOptions: PlaceholderOptions;
|
||||
|
||||
/** Alignment of the input container's content. */
|
||||
@Input() align: 'start' | 'end' = 'start';
|
||||
|
||||
/** Color of the input divider, based on the theme. */
|
||||
@Input() color: 'primary' | 'accent' | 'warn' = 'primary';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user