UNPKG

five-bells-visualization

Version:
192 lines (147 loc) 4.6 kB
<!doctype html> <!-- Copyright (c) 2014 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> <title>core-dropdown-menu</title> <script src="../webcomponentsjs/webcomponents.js"></script> <link href="../core-collapse/core-collapse.html" rel="import"> <link href="../core-dropdown/core-dropdown.html" rel="import"> <link href="../core-icons/core-icons.html" rel="import"> <link href="../core-icon-button/core-icon-button.html" rel="import"> <link href="../core-item/core-item.html" rel="import"> <link href="../core-menu/core-menu.html" rel="import"> <link href="core-dropdown-menu.html" rel="import"> <style shim-shadowdom> body { font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial; font-size: 14px; margin: 0; padding: 24px; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-touch-callout: none; } section { padding: 20px 0; } section > div { padding: 14px; font-size: 16px; } html /deep/ core-dropdown-menu { box-sizing: border-box; width: 170px; } html /deep/ core-dropdown { box-sizing: border-box; min-width: 170px; background-color: #eee; color: #000; border: 1px solid #ccc; border-radius: 3px; } core-item { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } html /deep/ core-collapse { border: 1px solid #ccc; padding: 8px; } .constrained-height { height: 150px; } .colored { border: 1px solid #0f9d58; background-color: #b7e1cd; color: #0f9d58; } </style> </head> <body> <template is="auto-binding"> <section> <div>Absolutely positioned dropdowns</div> <core-dropdown-menu label="Your favorite pastry"> <core-dropdown class="dropdown"> <core-menu> <template repeat="{{pastries}}"> <core-item>{{}}</core-item> </template> </core-menu> </core-dropdown> </core-dropdown-menu> <br><br> <core-dropdown-menu label="Disabled" disabled> <core-dropdown class="dropdown"> <core-menu> <core-item>Should not see this</core-item> </core-menu> </core-dropdown> </core-dropdown-menu> </section> <section> <div>Layered dropdowns</div> <button onclick="document.getElementById('collapse').toggle()">toggle core-collapse</button> <br> <core-collapse id="collapse"> <core-dropdown-menu label="Your favorite pastry"> <core-dropdown layered class="dropdown"> <core-menu> <template repeat="{{pastries}}"> <core-item>{{}}</core-item> </template> </core-menu> </core-dropdown> </core-dropdown-menu> </core-collapse> </section> <section> <div>Custom styling</div> <core-dropdown-menu label="Constrained height"> <core-dropdown class="dropdown constrained-height"> <core-menu> <template repeat="{{pastries}}"> <core-item>{{}}</core-item> </template> </core-menu> </core-dropdown> </core-dropdown-menu> <br><br> <core-dropdown-menu label="Colored"> <core-dropdown class="dropdown colored"> <core-menu> <template repeat="{{pastries}}"> <core-item>{{}}</core-item> </template> </core-menu> </core-dropdown> </core-dropdown-menu> </section> </template> <script> scope = document.querySelector('template[is=auto-binding]'); scope.pastries = [ 'Apple fritter', 'Croissant', 'Donut', 'Financier', 'Jello', 'Madeleine', 'Pound cake', 'Pretzel', 'Sfogliatelle' ]; </script> </body> </html>