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="paper-input-behavior.html"> | 12 <link rel="import" href="paper-input-behavior.html"> |
12 <link rel="import" href="paper-input-container.html"> | 13 <link rel="import" href="paper-input-container.html"> |
13 <link rel="import" href="paper-input-error.html"> | 14 <link rel="import" href="paper-input-error.html"> |
14 <link rel="import" href="paper-input-char-counter.html"> | 15 <link rel="import" href="paper-input-char-counter.html"> |
15 | 16 |
16 <!-- | 17 <!-- |
17 `<paper-input>` is a text field. | 18 `<paper-input>` is a single-line text field with Material Design styling. |
| 19 |
| 20 <paper-input label="Input label"></paper-input> |
| 21 |
| 22 It may include an optional error message or character counter. |
| 23 |
| 24 <paper-input error-message="Invalid input!" label="Input label"></paper-inpu
t> |
| 25 <paper-input char-counter label="Input label"></paper-input> |
| 26 |
| 27 See `Polymer.PaperInputBehavior` for more API docs. |
| 28 |
| 29 ### Styling |
| 30 |
| 31 See `Polymer.PaperInputContainer` for a list of custom properties used to |
| 32 style this element. |
| 33 |
| 34 @group Paper Elements |
| 35 @element paper-input |
| 36 @hero hero.svg |
| 37 @demo demo/index.html |
18 --> | 38 --> |
19 | 39 |
20 </head><body><dom-module id="paper-input"> | 40 </head><body><dom-module id="paper-input"> |
21 | 41 |
| 42 <style> |
| 43 |
| 44 :host { |
| 45 display: block; |
| 46 } |
| 47 |
| 48 input::-webkit-input-placeholder { |
| 49 color: var(--paper-input-container-color, --secondary-text-color); |
| 50 } |
| 51 |
| 52 input:-moz-placeholder { |
| 53 color: var(--paper-input-container-color, --secondary-text-color); |
| 54 } |
| 55 |
| 56 input::-moz-placeholder { |
| 57 color: var(--paper-input-container-color, --secondary-text-color); |
| 58 } |
| 59 |
| 60 input:-ms-input-placeholder { |
| 61 color: var(--paper-input-container-color, --secondary-text-color); |
| 62 } |
| 63 |
| 64 </style> |
| 65 |
22 <template> | 66 <template> |
23 | 67 |
24 <paper-input-container no-label-float$="[[noLabelFloat]]" auto-validate$="[[
autoValidate]]" disabled$="[[disabled]]"> | 68 <paper-input-container no-label-float="[[noLabelFloat]]" always-float-label=
"[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[a
utoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"> |
25 | 69 |
26 <template is="x-if" if="[[label]]"> | 70 <label hidden$="[[!label]]">[[label]]</label> |
27 <label>[[parent.label]]</label> | 71 |
| 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
lowedpattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pat
tern$="[[pattern]]" maxlength$="[[maxlength]]" required$="[[required]]" autocomp
lete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" m
inlength$="[[minlength]]" name$="[[name]]" placeholder$="[[placeholder]]" readon
ly$="[[readonly]]" size$="[[size]]"> |
| 73 |
| 74 <template is="dom-if" if="[[errorMessage]]"> |
| 75 <paper-input-error>[[errorMessage]]</paper-input-error> |
28 </template> | 76 </template> |
29 | 77 |
30 <input is="iron-input" id="input" bind-value="{{value}}" prevent-invalid-i
nput="[[preventInvalidInput]]" type$="[[type]]" pattern$="[[pattern]]" maxlength
$="[[maxlength]]" required$="[[required]]" disabled$="[[disabled]]"> | 78 <template is="dom-if" if="[[charCounter]]"> |
31 | |
32 <template is="x-if" if="[[errorMessage]]"> | |
33 <paper-input-error>[[parent.errorMessage]]</paper-input-error> | |
34 </template> | |
35 | |
36 <template is="x-if" if="[[charCounter]]"> | |
37 <paper-input-char-counter></paper-input-char-counter> | 79 <paper-input-char-counter></paper-input-char-counter> |
38 </template> | 80 </template> |
39 | 81 |
40 </paper-input-container> | 82 </paper-input-container> |
41 | 83 |
42 </template> | 84 </template> |
43 | 85 |
44 </dom-module> | 86 </dom-module> |
45 | 87 |
46 <script src="paper-input-extracted.js"></script></body></html> | 88 <script src="paper-input-extracted.js"></script></body></html> |
OLD | NEW |