-
Notifications
You must be signed in to change notification settings - Fork 171
/
cr-domain.html
95 lines (89 loc) · 2.85 KB
/
cr-domain.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<link rel="import" href="/bower_components/polymer/polymer.html">
<link rel="import" href="cr-domain-experimental.html">
<link rel="import" href="cr-domain-details.html">
<link rel="import" href="/styles/custom-paper-material-styles.html">
<dom-module id="cr-domain">
<template>
<style include="custom-paper-material-styles">
h3 {
font-size: 20px;
line-height: 28px;
}
/* Small */
@media (max-width: 600px) {
h3 {
margin-left: 7px;
}
}
</style>
<div id="header">
<div class="paper-material" elevation="1" class="heading-domain">
<h2 class="heading"><span>[[domain.domain]]</span> Domain</h2>
<p class="description" hidden$="[[!domain.description]]" inner-h-t-m-l="[[domain.description]]">
</p>
<cr-domain-experimental item="[[domain]]"></cr-domain-experimental>
</div>
<div hidden$="[[!domain.commands.length]]">
<h3 id="methods">Methods</h3>
<div class="paper-material" elevation="1">
<template is="dom-repeat" items="[[domain.commands]]">
<cr-domain-details
domain="[[domain.domain]]"
details="[[item]]"
version="[[version]]"
type="method"
></cr-domain-details>
</template>
</div>
</div>
<div hidden$="[[!domain.events.length]]">
<h3 id="events">Events</h3>
<div class="paper-material" elevation="1">
<template is="dom-repeat" items="[[domain.events]]">
<cr-domain-details
domain="[[domain.domain]]"
details="[[item]]"
version="[[version]]"
type="event"
></cr-domain-details>
</template>
</div>
</div>
<div hidden$="[[!domain.types.length]]">
<h3 id="types">Types</h3>
<div class="paper-material" elevation="1">
<template is="dom-repeat" items="[[domain.types]]">
<cr-domain-details
domain="[[domain.domain]]"
details="[[item]]"
version="[[version]]"
type="type"
></cr-domain-details>
</template>
</div>
</div>
</div>
</template>
<script>
customElements.define('cr-domain', class extends Polymer.Element {
static get is() { return 'cr-domain'; }
static get properties() {
return {
domain: {
type: Object,
observer: '_domainChanged'
},
data: Array,
version: String
}
}
_domainChanged(newDomain) {
if (newDomain.experimental) {
this.$.header.classList.add('domain-experimental');
} else {
this.$.header.classList.remove('domain-experimental');
}
}
});
</script>
</dom-module>