forked from web-platform-tests/wpt.fyi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
channel-picker.js
58 lines (54 loc) · 1.79 KB
/
channel-picker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import '../node_modules/@polymer/paper-dropdown-menu/paper-dropdown-menu.js';
import '../node_modules/@polymer/paper-item/paper-icon-item.js';
import '../node_modules/@polymer/paper-checkbox/paper-checkbox.js';
import '../node_modules/@polymer/paper-listbox/paper-listbox.js';
import '../node_modules/@polymer/polymer/lib/elements/dom-repeat.js';
import { html, PolymerElement } from '../node_modules/@polymer/polymer/polymer-element.js';
import './display-logo.js';
import { Channels, DefaultBrowserNames, ProductInfo } from './product-info.js';
class ChannelPicker extends ProductInfo(PolymerElement) {
static get is() {
return 'channel-picker';
}
static get template() {
return html`
<paper-dropdown-menu label="Channel" no-animations>
<paper-listbox slot="dropdown-content" selected="{{ channel }}" attr-for-selected="value">
<paper-item value="any">Any</paper-item>
<template is="dom-repeat" items="[[channels]]" as="channel">
<paper-icon-item value="[[channel]]">
<display-logo slot="item-icon" product="[[productWithChannel(browser, channel)]]" small></display-logo>
[[displayName(channel)]]
</paper-icon-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
`;
}
static get properties() {
return {
browser: {
type: String,
value: DefaultBrowserNames[0],
notify: true,
},
channel: {
type: String,
value: 'stable',
notify: true,
},
channels: {
type: Array,
value: Array.from(Channels),
}
};
}
productWithChannel(browser, channel) {
return {
browser_name: browser,
labels: [channel],
};
}
}
window.customElements.define(ChannelPicker.is, ChannelPicker);
export { ChannelPicker };