OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 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 | 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 | 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 | 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 | 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 | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --> | 9 --> |
10 | 10 |
11 <link rel="import" href="../polymer/polymer.html"> | 11 <link rel="import" href="../polymer/polymer.html"> |
12 <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> | 12 <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> |
13 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> | 13 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> |
14 <link rel="import" href="../iron-resizable-behavior/iron-resizable-behavior.html
"> | 14 <link rel="import" href="../iron-resizable-behavior/iron-resizable-behavior.html
"> |
15 <link rel="import" href="../iron-menu-behavior/iron-menubar-behavior.html"> | 15 <link rel="import" href="../iron-menu-behavior/iron-menubar-behavior.html"> |
16 <link rel="import" href="../iron-icon/iron-icon.html"> | 16 <link rel="import" href="../iron-icon/iron-icon.html"> |
17 <link rel="import" href="../paper-icon-button/paper-icon-button.html"> | 17 <link rel="import" href="../paper-icon-button/paper-icon-button.html"> |
18 <link rel="import" href="../paper-styles/color.html"> | 18 <link rel="import" href="../paper-styles/color.html"> |
19 <link rel="import" href="paper-tabs-icons.html"> | 19 <link rel="import" href="paper-tabs-icons.html"> |
20 <link rel="import" href="paper-tab.html"> | 20 <link rel="import" href="paper-tab.html"> |
21 | 21 |
22 <!-- | 22 <!-- |
| 23 Material design: [Tabs](https://www.google.com/design/spec/components/tabs.html) |
| 24 |
23 `paper-tabs` makes it easy to explore and switch between different views or func
tional aspects of | 25 `paper-tabs` makes it easy to explore and switch between different views or func
tional aspects of |
24 an app, or to browse categorized data sets. | 26 an app, or to browse categorized data sets. |
25 | 27 |
26 Use `selected` property to get or set the selected tab. | 28 Use `selected` property to get or set the selected tab. |
27 | 29 |
28 Example: | 30 Example: |
29 | 31 |
30 <paper-tabs selected="0"> | 32 <paper-tabs selected="0"> |
31 <paper-tab>TAB 1</paper-tab> | 33 <paper-tab>TAB 1</paper-tab> |
32 <paper-tab>TAB 2</paper-tab> | 34 <paper-tab>TAB 2</paper-tab> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 position: absolute; | 120 position: absolute; |
119 white-space: nowrap; | 121 white-space: nowrap; |
120 } | 122 } |
121 | 123 |
122 .hidden { | 124 .hidden { |
123 display: none; | 125 display: none; |
124 } | 126 } |
125 | 127 |
126 .not-visible { | 128 .not-visible { |
127 opacity: 0; | 129 opacity: 0; |
| 130 cursor: default; |
128 } | 131 } |
129 | 132 |
130 paper-icon-button { | 133 paper-icon-button { |
131 width: 24px; | 134 width: 24px; |
132 padding: 16px; | 135 padding: 16px; |
133 } | 136 } |
134 | 137 |
135 #selectionBar { | 138 #selectionBar { |
136 position: absolute; | 139 position: absolute; |
137 height: 2px; | 140 height: 2px; |
(...skipping 27 matching lines...) Expand all Loading... |
165 } | 168 } |
166 | 169 |
167 #tabsContent > ::content > *:not(#selectionBar) { | 170 #tabsContent > ::content > *:not(#selectionBar) { |
168 height: 100%; | 171 height: 100%; |
169 } | 172 } |
170 | 173 |
171 </style> | 174 </style> |
172 | 175 |
173 <template> | 176 <template> |
174 | 177 |
175 <paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollBu
ttonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonU
p" on-down="_onLeftScrollButtonDown"></paper-icon-button> | 178 <paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollBu
ttonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonU
p" on-down="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button> |
176 | 179 |
177 <div id="tabsContainer" class="flex" on-track="_scroll" on-down="_down"> | 180 <div id="tabsContainer" class="flex" on-track="_scroll" on-down="_down"> |
178 | 181 |
179 <div id="tabsContent" class$="[[_computeTabsContentClass(scrollable)]]"> | 182 <div id="tabsContent" class$="[[_computeTabsContentClass(scrollable)]]"> |
180 | 183 |
181 <content select="*"></content> | 184 <content select="*"></content> |
182 | 185 |
183 <div id="selectionBar" class$="[[_computeSelectionBarClass(noBar, alignB
ottom)]]" | 186 <div id="selectionBar" class$="[[_computeSelectionBarClass(noBar, alignB
ottom)]]" |
184 on-transitionend="_onBarTransitionEnd"></div> | 187 on-transitionend="_onBarTransitionEnd"></div> |
185 | 188 |
186 </div> | 189 </div> |
187 | 190 |
188 </div> | 191 </div> |
189 | 192 |
190 <paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollB
uttonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButto
nUp" on-down="_onRightScrollButtonDown"></paper-icon-button> | 193 <paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollB
uttonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButto
nUp" on-down="_onRightScrollButtonDown" tabindex="-1"></paper-icon-button> |
191 | 194 |
192 </template> | 195 </template> |
193 | 196 |
194 </dom-module> | 197 </dom-module> |
195 | 198 |
196 <script> | 199 <script> |
197 | 200 |
198 Polymer({ | 201 Polymer({ |
199 | 202 |
200 is: 'paper-tabs', | 203 is: 'paper-tabs', |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 /** | 260 /** |
258 * If true, the tabs are aligned to bottom (the selection bar appears at t
he top). | 261 * If true, the tabs are aligned to bottom (the selection bar appears at t
he top). |
259 */ | 262 */ |
260 alignBottom: { | 263 alignBottom: { |
261 type: Boolean, | 264 type: Boolean, |
262 value: false | 265 value: false |
263 }, | 266 }, |
264 | 267 |
265 /** | 268 /** |
266 * Gets or sets the selected element. The default is to use the index of t
he item. | 269 * Gets or sets the selected element. The default is to use the index of t
he item. |
267 * | |
268 * @type {string|number} | |
269 */ | 270 */ |
270 selected: { | 271 selected: { |
271 type: String, | 272 type: String, |
272 notify: true | 273 notify: true |
273 }, | 274 }, |
274 | 275 |
275 selectable: { | 276 selectable: { |
276 type: String, | 277 type: String, |
277 value: 'paper-tab' | 278 value: 'paper-tab' |
278 }, | 279 }, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 this._positionBar(this._pos.width, this._pos.left); | 503 this._positionBar(this._pos.width, this._pos.left); |
503 // bar animation done | 504 // bar animation done |
504 } else if (cl.contains('contract')) { | 505 } else if (cl.contains('contract')) { |
505 cl.remove('contract'); | 506 cl.remove('contract'); |
506 } | 507 } |
507 } | 508 } |
508 | 509 |
509 }); | 510 }); |
510 | 511 |
511 </script> | 512 </script> |
OLD | NEW |