OLD | NEW |
1 <link rel="import" href="chrome://resources/polymer/polymer/polymer.html"> | 1 <!-- Copyright 2015 The Chromium Authors. All rights reserved. |
2 <link rel="import" href="chrome://resources/polymer/polymer/layout.html"> | 2 Use of this source code is governed by a BSD-style license that can be |
| 3 found in the LICENSE file. --> |
| 4 |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe
s/iron-flex-layout.html"> |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html"> |
3 | 7 |
4 <!-- | 8 <!-- |
5 A simple input form with a button. Being used for typing email or password. | 9 A simple input form with a button. Being used for typing email or password. |
6 User should put one or more <gaia-input>s inside. | 10 User should put one or more <gaia-input>s inside. |
7 | 11 |
8 Example: | 12 Example: |
9 <gaia-input-form buttonText="Submit"> | 13 <gaia-input-form button-text="Submit"> |
10 <gaia-input label="Email" type="email"></gaia-input> | 14 <gaia-input label="Email" type="email"></gaia-input> |
11 <gaia-input label="Password" type="password"></gaia-input> | 15 <gaia-input label="Password" type="password"></gaia-input> |
12 <gaia-input label="OTP"></gaia-input> | 16 <gaia-input label="OTP"></gaia-input> |
13 </gaia-input-form> | 17 </gaia-input-form> |
14 | 18 |
15 Attributes: | 19 Attributes: |
16 'buttonText' - text on the button. | 20 'button-text' - text on the button. |
17 | 21 |
18 Events: | 22 Events: |
19 'submit' - fired on button click or "Enter" press inside input field. | 23 'submit' - fired on button click or "Enter" press inside input field. |
20 | 24 |
21 Methods: | |
22 'focus' - focuses input field. | |
23 --> | 25 --> |
24 <polymer-element name="gaia-input-form" vertical start-justified layout | 26 <dom-module name="gaia-input-form"> |
25 attributes="buttonText" | 27 <link rel="stylesheet" href="gaia_input_form.css"> |
26 on-keydown="{{onKeyDown}}"> | 28 |
27 <template> | 29 <template> |
28 <link rel="stylesheet" href="gaia_input_form.css"> | 30 <div on-keydown="onKeyDown_"> |
29 <content id="inputs" select="gaia-input"></content> | 31 <content id="inputs" select="gaia-input"></content> |
30 <div horizontal justified layout center reverse> | 32 <div class="horizontal-reverse justified layout center"> |
31 <gaia-button id="button" on-tap="{{onButtonClicked}}" self-end> | 33 <gaia-button id="button" on-tap="onButtonClicked_" class="self-end"> |
32 {{buttonText}} | 34 <span>[[buttonText]]</span> |
33 </gaia-button> | 35 </gaia-button> |
34 <content> </content> | 36 <content> </content> |
| 37 </div> |
35 </div> | 38 </div> |
36 </template> | 39 </template> |
37 </polymer-element> | 40 </dom-module> |
| 41 |
OLD | NEW |