Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / paper-input / paper-input.html
blobe3ccb4fe0e9c9a95b3a80010a1ff11f98b386da8
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.github.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/CONTRIBUTORS.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/PATENTS.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-behavior.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">
17 <!--
18 `<paper-input>` is a single-line text field with Material Design styling.
20 <paper-input label="Input label"></paper-input>
22 It may include an optional error message or character counter.
24 <paper-input error-message="Invalid input!" label="Input label"></paper-input>
25 <paper-input char-counter label="Input label"></paper-input>
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`).
32 <paper-input label="total">
33 <div prefix>$</div>
34 <paper-icon-button suffix icon="clear"></paper-icon-button>
35 </paper-input>
37 See `Polymer.PaperInputBehavior` for more API docs.
39 ### Styling
41 See `Polymer.PaperInputContainer` for a list of custom properties used to
42 style this element.
44 @group Paper Elements
45 @element paper-input
46 @hero hero.svg
47 @demo demo/index.html
48 -->
50 </head><body><dom-module id="paper-input">
51 <template>
53 <style>
54 :host {
55 display: block;
58 input::-webkit-input-placeholder {
59 color: var(--paper-input-container-color, --secondary-text-color);
62 input:-moz-placeholder {
63 color: var(--paper-input-container-color, --secondary-text-color);
66 input::-moz-placeholder {
67 color: var(--paper-input-container-color, --secondary-text-color);
70 input:-ms-input-placeholder {
71 color: var(--paper-input-container-color, --secondary-text-color);
73 </style>
75 <paper-input-container no-label-float="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
77 <content select="[prefix]"></content>
79 <label hidden$="[[!label]]">[[label]]</label>
81 <input is="iron-input" id="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[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$="[[autocorrect]]" on-change="_onChange">
83 <content select="[suffix]"></content>
85 <template is="dom-if" if="[[errorMessage]]">
86 <paper-input-error>[[errorMessage]]</paper-input-error>
87 </template>
89 <template is="dom-if" if="[[charCounter]]">
90 <paper-input-char-counter></paper-input-char-counter>
91 </template>
93 </paper-input-container>
95 </template>
96 </dom-module>
98 <script src="paper-input-extracted.js"></script></body></html>