OLD | NEW |
1 <link rel="import" href="chrome://resources/polymer/polymer/polymer.html"> | 1 <link rel="import" href="chrome://resources/polymer/polymer/polymer.html"> |
2 <link rel="import" href="chrome://resources/polymer/polymer/layout.html"> | 2 <link rel="import" href="chrome://resources/polymer/polymer/layout.html"> |
3 <link rel="import" href="chrome://resources/polymer/paper-input/paper-input-deco
rator.html"> | 3 <link rel="import" href="chrome://resources/polymer/paper-input/paper-input-deco
rator.html"> |
4 | 4 |
5 <!-- | 5 <!-- |
6 A simple input form with a button. Being used for typing email or password. | 6 A simple input form with a button. Being used for typing email or password. |
7 | 7 |
8 Example: | 8 Example: |
9 <gaia-input-form id="emailInput" inputType="email" | 9 <gaia-input-form id="emailInput" inputType="email" |
10 </gaia-input-form> | 10 </gaia-input-form> |
11 | 11 |
12 Attributes: | 12 Attributes: |
13 'inputType' - type of the input (e.g. email, password). | 13 'inputType' - type of the input (e.g. email, password). |
14 'inputLabel' - label displayed on the input. (e.g. Enter you email). | 14 'inputLabel' - label displayed on the input. (e.g. Enter you email). |
15 'errorMsg' - error message which should be displayed when input is | 15 'errorMsg' - error message which should be displayed when input is |
16 incorrect. | 16 incorrect. |
17 'buttonText' - text on the button. | 17 'buttonText' - text on the button. |
| 18 'emailDomain' - autocomplete domain for the inputType="email". |
18 | 19 |
19 Events: | 20 Events: |
20 'buttonclick' - fired on button click. | 21 'buttonclick' - fired on button click. |
21 | 22 |
22 Methods: | 23 Methods: |
23 'focus' - focuses input field. | 24 'focus' - focuses input field. |
24 'setValid' - accept boolean argument |isValid|. Set validity state on | 25 'setValid' - accept boolean argument |isValid|. Set validity state on |
25 the form. | 26 the form. |
26 'checkValidity' - returns current validity state of the input form. Calls | 27 'checkValidity' - returns current validity state of the input form. Calls |
27 setValid at the end. | 28 setValid at the end. |
28 --> | 29 --> |
29 <polymer-element name="gaia-input-form" vertical start-justified layout | 30 <polymer-element name="gaia-input-form" vertical start-justified layout |
30 attributes="inputType errorMsg inputLabel buttonText"> | 31 attributes="inputType errorMsg inputLabel buttonText emailDomain"> |
31 <template> | 32 <template> |
32 <link rel="stylesheet" href="gaia_input_form.css"> | 33 <link rel="stylesheet" href="gaia_input_form.css"> |
33 <paper-input-decorator id="paperInputDecorator" error="{{errorMsg}}" | 34 <paper-input-decorator id="paperInputDecorator" error="{{errorMsg}}" |
34 label="{{inputLabel}}" on-tap="{{onTap}}" | 35 label="{{inputLabel}}" on-tap="{{onTap}}" |
35 floatingLabel autoValidate> | 36 floatingLabel autoValidate> |
36 <input id="inputForm" is="core-input" on-keydown="{{onKeyDown}}" | 37 <div id="inputContainer" horizontal layout> |
37 value="{{inputValue}}" required type="{{inputType}}"> | 38 <input id="inputForm" is="core-input" on-keydown="{{onKeyDown}}" |
| 39 value="{{inputValue}}" required type="{{inputType}}" flex> |
| 40 <span id="emailDomain" hidden?="{{!emailDomain}}">{{emailDomain}}</span> |
| 41 </div> |
38 </paper-input-decorator> | 42 </paper-input-decorator> |
39 <div horizontal justified layout center reverse> | 43 <div horizontal justified layout center reverse> |
40 <gaia-raised-on-focus-button id="button" class="blue-button" | 44 <gaia-raised-on-focus-button id="button" class="blue-button" |
41 on-tap="{{onButtonClicked}}" self-end> | 45 on-tap="{{onButtonClicked}}" self-end> |
42 {{buttonText}} | 46 {{buttonText}} |
43 </gaia-raised-on-focus-button> | 47 </gaia-raised-on-focus-button> |
44 <content> </content> | 48 <content> </content> |
45 </div> | 49 </div> |
46 </template> | 50 </template> |
47 </polymer-element> | 51 </polymer-element> |
OLD | NEW |