This repository was 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
fix: inline form support #11983
Merged
Merged
fix: inline form support #11983
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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: '[email protected]', | ||
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why this is returning
6
instead of7
, but it's not an critical check in the test and manual testing shows that a textarea with this value has 7 rows.