• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!--
2@license
3Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7Code distributed by Google as part of the polymer project is also
8subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9-->
10
11<link rel="import" href="../iron-dropdown.html">
12<link rel="import" href="../../neon-animation/neon-animations.html">
13<link rel="import" href="grow-height-animation.html">
14
15<dom-module id="x-select">
16  <template>
17    <style>
18      :host {
19        display: inline-block;
20        margin: 1em;
21      }
22    </style>
23    <div on-tap="open">
24      <content select=".dropdown-trigger"></content>
25    </div>
26    <iron-dropdown id="dropdown"
27      vertical-align="[[verticalAlign]]"
28      horizontal-align="[[horizontalAlign]]"
29      disabled="[[disabled]]"
30      open-animation-config="[[openAnimationConfig]]"
31      close-animation-config="[[closeAnimationConfig]]">
32      <content select=".dropdown-content"></content>
33    </iron-dropdown>
34  </template>
35  <script>
36    Polymer({
37      is: 'x-select',
38
39      properties: {
40        verticalAlign: String,
41        horizontalAlign: String,
42        disabled: Boolean,
43        openAnimationConfig: {
44          type: Array,
45          value: function() {
46            return [{
47              name: 'fade-in-animation',
48              timing: {
49                delay: 150,
50                duration: 50
51              }
52            }, {
53              name: 'expand-animation',
54              timing: {
55                delay: 150,
56                duration: 200
57              }
58            }];
59          }
60        },
61
62        closeAnimationConfig: {
63          type: Array,
64          value: function() {
65            return [{
66              name: 'fade-out-animation',
67              timing: {
68                duration: 200
69              }
70            }];
71          }
72        }
73      },
74
75      open: function() {
76        this.$.dropdown.open();
77      }
78    });
79  </script>
80</dom-module>
81