This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(checkbox, date-picker, input, radio-button, select, switch): md-i…
…nline-form support - add inline form demo - add `ng-messages` to `md-select` in input errors demo - consolidate SCSS variables - fix padding above `ng-messages` to align with spec - `8px` - add docs for `md-inline-form` - fix `md-radio-group` issues with inline form layout - revert some changes to and fix some issues with `md-select` SCSS from previous commit
- Loading branch information
Showing
14 changed files
with
187 additions
and
50 deletions.
There are no files selected for viewing
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<div ng-controller="DemoCtrl" layout="column" ng-cloak class="demo-inline-form-container"> | ||
<form class="md-inline-form"> | ||
<div layout="row" layout-wrap> | ||
<md-input-container> | ||
<label>First name</label> | ||
<input type="text" ng-model="user.firstName"> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>Last name</label> | ||
<input type="text" ng-model="user.lastName"> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>State</label> | ||
<md-select ng-model="user.state"> | ||
<md-option ng-repeat="state in states" value="{{state.abbrev}}"> | ||
{{state.abbrev}} | ||
</md-option> | ||
</md-select> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>Enter date</label> | ||
<md-datepicker ng-model="user.submissionDate"></md-datepicker> | ||
</md-input-container> | ||
</div> | ||
<div layout="row" layout-wrap> | ||
<md-input-container> | ||
<label>Postal Code</label> | ||
<input type="text" ng-model="user.postalCode"> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>State of Birth</label> | ||
<md-select ng-model="user.stateOfBirth"> | ||
<md-option ng-repeat="state in states" value="{{state.abbrev}}"> | ||
{{state.abbrev}} | ||
</md-option> | ||
</md-select> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>Description</label> | ||
<textarea ng-model="user.description"></textarea> | ||
</md-input-container> | ||
|
||
<md-checkbox ng-model="user.licenseAccepted"> | ||
I agree to the license terms. | ||
</md-checkbox> | ||
</div> | ||
<div layout="row" layout-wrap> | ||
<md-input-container> | ||
<label>Company</label> | ||
<input type="text" ng-model="user.company"> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>City</label> | ||
<input type="text" ng-model="user.city"> | ||
</md-input-container> | ||
|
||
<md-switch ng-model="user.marketingOptIn" aria-label="Opt-in to emails"> | ||
Opt-in to emails | ||
</md-switch> | ||
</div> | ||
<div layout="row" layout-wrap> | ||
<md-input-container> | ||
<label>Title</label> | ||
<input type="text" ng-model="user.title"> | ||
</md-input-container> | ||
|
||
<label class="demo-radio-button-label">Primary Language:</label> | ||
<md-radio-group ng-model="data.group1"> | ||
<md-radio-button value="TypeScript">TypeScript</md-radio-button> | ||
<md-radio-button value="JavaScript">JavaScript</md-radio-button> | ||
<md-radio-button value="Java">Java</md-radio-button> | ||
<md-radio-button value="C#">C#</md-radio-button> | ||
</md-radio-group> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
angular.module('inputInlineForm', ['ngMaterial', 'ngMessages']) | ||
.controller('DemoCtrl', function ($scope) { | ||
$scope.user = { | ||
title: 'Developer', | ||
email: 'ipsum@lorem.com', | ||
firstName: '', | ||
lastName: '', | ||
company: 'Google', | ||
address: '1600 Amphitheatre Pkwy', | ||
city: 'Mountain View', | ||
state: null, | ||
stateOfBirth: 'CA', | ||
description: 'Loves TypeScript 💖', | ||
postalCode: '94043', | ||
licenseAccepted: true, | ||
submissionDate: null, | ||
marketingOptIn: true | ||
}; | ||
|
||
$scope.states = ('AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS ' + | ||
'MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI ' + | ||
'WY').split(' ').map(function (state) { | ||
return {abbrev: state}; | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.demo-inline-form-container { | ||
padding: 16px; | ||
|
||
.demo-radio-button-label { | ||
margin: 18px 16px; | ||
padding-top: 6px; | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.