OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --><html><head><link rel="import" href="../polymer/polymer.html"> | 9 --><html><head><link rel="import" href="../polymer/polymer.html"> |
10 <link rel="import" href="../iron-input/iron-input.html"> | 10 <link rel="import" href="../iron-input/iron-input.html"> |
11 <link rel="import" href="../iron-form-element-behavior/iron-form-element-behavio
r.html"> | 11 <link rel="import" href="../iron-form-element-behavior/iron-form-element-behavio
r.html"> |
12 <link rel="import" href="paper-input-behavior.html"> | 12 <link rel="import" href="paper-input-behavior.html"> |
13 <link rel="import" href="paper-input-container.html"> | 13 <link rel="import" href="paper-input-container.html"> |
14 <link rel="import" href="paper-input-error.html"> | 14 <link rel="import" href="paper-input-error.html"> |
15 <link rel="import" href="paper-input-char-counter.html"> | 15 <link rel="import" href="paper-input-char-counter.html"> |
16 | 16 |
17 <!-- | 17 <!-- |
18 `<paper-input>` is a single-line text field with Material Design styling. | 18 `<paper-input>` is a single-line text field with Material Design styling. |
19 | 19 |
20 <paper-input label="Input label"></paper-input> | 20 <paper-input label="Input label"></paper-input> |
21 | 21 |
22 It may include an optional error message or character counter. | 22 It may include an optional error message or character counter. |
23 | 23 |
24 <paper-input error-message="Invalid input!" label="Input label"></paper-inpu
t> | 24 <paper-input error-message="Invalid input!" label="Input label"></paper-inpu
t> |
25 <paper-input char-counter label="Input label"></paper-input> | 25 <paper-input char-counter label="Input label"></paper-input> |
26 | 26 |
| 27 It can also include custom prefix or suffix elements, which are displayed |
| 28 before or after the text input itself. In order for an element to be |
| 29 considered as a prefix, it must have the `prefix` attribute (and similarly |
| 30 for `suffix`). |
| 31 |
| 32 <paper-input label="total"> |
| 33 <div prefix>$</div> |
| 34 <paper-icon-button suffix icon="clear"></paper-icon-button> |
| 35 </paper-input> |
| 36 |
27 See `Polymer.PaperInputBehavior` for more API docs. | 37 See `Polymer.PaperInputBehavior` for more API docs. |
28 | 38 |
29 ### Styling | 39 ### Styling |
30 | 40 |
31 See `Polymer.PaperInputContainer` for a list of custom properties used to | 41 See `Polymer.PaperInputContainer` for a list of custom properties used to |
32 style this element. | 42 style this element. |
33 | 43 |
34 @group Paper Elements | 44 @group Paper Elements |
35 @element paper-input | 45 @element paper-input |
36 @hero hero.svg | 46 @hero hero.svg |
(...skipping 23 matching lines...) Expand all Loading... |
60 input:-ms-input-placeholder { | 70 input:-ms-input-placeholder { |
61 color: var(--paper-input-container-color, --secondary-text-color); | 71 color: var(--paper-input-container-color, --secondary-text-color); |
62 } | 72 } |
63 | 73 |
64 </style> | 74 </style> |
65 | 75 |
66 <template> | 76 <template> |
67 | 77 |
68 <paper-input-container no-label-float="[[noLabelFloat]]" always-float-label=
"[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[a
utoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"> | 78 <paper-input-container no-label-float="[[noLabelFloat]]" always-float-label=
"[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[a
utoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"> |
69 | 79 |
| 80 <content select="[prefix]"></content> |
| 81 |
70 <label hidden$="[[!label]]">[[label]]</label> | 82 <label hidden$="[[!label]]">[[label]]</label> |
71 | 83 |
72 <input is="iron-input" id="input" aria-labelledby$="[[_ariaLabelledBy]]" a
ria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" bind-value="{{v
alue}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" al
lowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pa
ttern$="[[pattern]]" maxlength$="[[maxlength]]" required$="[[required]]" autocom
plete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]"
minlength$="[[minlength]]" name$="[[name]]" placeholder$="[[placeholder]]" reado
nly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocap
italize]]" autocorrect$="[[autocorrect]]"> | 84 <input is="iron-input" id="input" aria-labelledby$="[[_ariaLabelledBy]]" a
ria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" bind-value="{{v
alue}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" al
lowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pa
ttern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" a
utofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]"
maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$=
"[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list
]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autoco
rrect]]"> |
| 85 |
| 86 <content select="[suffix]"></content> |
73 | 87 |
74 <template is="dom-if" if="[[errorMessage]]"> | 88 <template is="dom-if" if="[[errorMessage]]"> |
75 <paper-input-error>[[errorMessage]]</paper-input-error> | 89 <paper-input-error>[[errorMessage]]</paper-input-error> |
76 </template> | 90 </template> |
77 | 91 |
78 <template is="dom-if" if="[[charCounter]]"> | 92 <template is="dom-if" if="[[charCounter]]"> |
79 <paper-input-char-counter></paper-input-char-counter> | 93 <paper-input-char-counter></paper-input-char-counter> |
80 </template> | 94 </template> |
81 | 95 |
82 </paper-input-container> | 96 </paper-input-container> |
83 | 97 |
84 </template> | 98 </template> |
85 | 99 |
86 </dom-module> | 100 </dom-module> |
87 | 101 |
88 <script src="paper-input-extracted.js"></script></body></html> | 102 <script src="paper-input-extracted.js"></script></body></html> |
OLD | NEW |