Home | History | Annotate | Download | only in demo
      1 <!doctype html>
      2 <!--
      3 @license
      4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
      5 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
      6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
      7 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
      8 Code distributed by Google as part of the polymer project is also
      9 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
     10 -->
     11 <html>
     12 <head>
     13 
     14   <meta charset="utf-8">
     15   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     16   <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
     17 
     18   <title>iron-validatable-behavior demo</title>
     19 
     20   <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
     21 
     22   <link rel="import" href="../../paper-styles/demo-pages.html">
     23   <link rel="import" href="cats-only.html">
     24   <link rel="import" href="validatable-input.html">
     25 
     26   <style is="custom-style">
     27 
     28     .valid {
     29       color: var(--google-green-500);
     30     }
     31 
     32     .invalid {
     33       color: var(--google-red-500);
     34     }
     35 
     36   </style>
     37 
     38 </head>
     39 <body>
     40   <div class="vertical-section vertical-section-container centered">
     41   <h1>&lt;iron-validatable-behavior&gt;</h1>
     42 
     43   <template is="dom-bind">
     44 
     45     <cats-only></cats-only>
     46 
     47     <section>
     48 
     49       <p>
     50         only type <code>cats</code>:
     51 
     52         <input is="validatable-input" invalid="{{invalid}}" validator="cats-only">
     53 
     54         <span class="valid" hidden$="[[invalid]]">valid</span>
     55         <span class="invalid" hidden$="[[!invalid]]">invalid</span>
     56       </p>
     57 
     58     </section>
     59 
     60   </template>
     61 
     62   </div>
     63 
     64   <script>
     65 
     66     document.querySelector('template[is="dom-bind"]').invalid = false;
     67 
     68   </script>
     69 
     70 </body>
     71 </html>
     72