OLD | NEW |
| (Empty) |
1 <!-- | |
2 @license | |
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 | |
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 | |
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 | |
9 --><html><head><link rel="import" href="../polymer/polymer.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"> | |
12 <link rel="import" href="paper-input-behavior.html"> | |
13 <link rel="import" href="paper-input-container.html"> | |
14 <link rel="import" href="paper-input-error.html"> | |
15 <link rel="import" href="paper-input-char-counter.html"> | |
16 | |
17 <!-- | |
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 | |
38 --> | |
39 | |
40 </head><body><dom-module id="paper-input"> | |
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 | |
66 <template> | |
67 | |
68 <paper-input-container no-label-float="[[noLabelFloat]]" always-float-label=
"[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[a
utoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"> | |
69 | |
70 <label hidden$="[[!label]]">[[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> | |
76 </template> | |
77 | |
78 <template is="dom-if" if="[[charCounter]]"> | |
79 <paper-input-char-counter></paper-input-char-counter> | |
80 </template> | |
81 | |
82 </paper-input-container> | |
83 | |
84 </template> | |
85 | |
86 </dom-module> | |
87 | |
88 <script src="paper-input-extracted.js"></script></body></html> | |
OLD | NEW |