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 --> |
| 10 |
| 11 <link rel="import" href="../polymer/polymer.html"> |
| 12 <link rel="import" href="../paper-styles/paper-styles.html"> |
| 13 |
| 14 <!-- |
| 15 `<paper-input-error>` is an error message for use with `<paper-input-container>`
. |
| 16 --> |
| 17 <dom-module id="paper-input-error"> |
| 18 |
| 19 <style> |
| 20 |
| 21 :host { |
| 22 /* need to use display: none for role="alert" */ |
| 23 display: none; |
| 24 float: left; |
| 25 |
| 26 color: var(--paper-input-container-invalid-color); |
| 27 |
| 28 mixin(--paper-input-container-add-on); |
| 29 mixin(--paper-input-container-add-on-font); |
| 30 |
| 31 mixin(--paper-input-error); |
| 32 } |
| 33 |
| 34 :host([invalid]) { |
| 35 display: inline-block; |
| 36 }; |
| 37 |
| 38 </style> |
| 39 |
| 40 <template> |
| 41 |
| 42 <content></content> |
| 43 |
| 44 </template> |
| 45 |
| 46 </dom-module> |
| 47 |
| 48 <script> |
| 49 |
| 50 (function() { |
| 51 |
| 52 Polymer({ |
| 53 |
| 54 is: 'paper-input-error', |
| 55 |
| 56 enableCustomStyleProperties: true, |
| 57 |
| 58 hostAttributes: { |
| 59 'add-on': '', |
| 60 'role': 'alert' |
| 61 }, |
| 62 |
| 63 properties: { |
| 64 |
| 65 /** |
| 66 * Set to true to show the error. |
| 67 */ |
| 68 invalid: { |
| 69 reflectToAttribute: true, |
| 70 type: Boolean |
| 71 } |
| 72 |
| 73 }, |
| 74 |
| 75 attached: function() { |
| 76 this.fire('addon-attached'); |
| 77 } |
| 78 |
| 79 }) |
| 80 |
| 81 })(); |
| 82 |
| 83 </script> |
OLD | NEW |