-
Notifications
You must be signed in to change notification settings - Fork 1
/
bio-link-text.js
71 lines (65 loc) · 1.52 KB
/
bio-link-text.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
59
60
61
62
63
64
65
66
67
68
69
70
71
import { LitElement, html } from "lit-element";
import { BioLinkMixin } from "./bio-link-mixin.js";
import "@polymer/iron-icon/iron-icon";
{
/* <link rel="import" href="/bower_components/iron-icon/iron-icon.html">
<link rel="import" href="../bio-icons/bio-icons.html"> */
}
/**
* `bio-link-text` This component displays PubMed link
*
* Example:
<bio-link-text id="1234" type="pubmed" label="PMID"></bio-link-text>
*
* @customElement
* @polymer
* @demo
*
*/
class BioLinkText extends BioLinkMixin(LitElement) {
static get properties() {
return {
/** The label to be displayed. */
label: {
type: String,
value: "PMID:"
}
};
}
/**
* Implement to describe the element's DOM using lit-html.
* Use the element current props to return a lit-html template result
* to render into the element.
*/
_render() {
return html`
<style>
:host {
display: block;
}
div {
@apply --layout-horizontal;
}
label {
color: #909090;
}
iron-icon {
margin-left: 10px;
}
</style>
<div>
<label>[[label]]</label><span>[[id]]</span
><iron-icon icon="bio:launch" on-click="_handleTap"></iron-icon>
</div>
`;
}
/**
* Instance of the element is created/upgraded. Use: initializing state,
* set up event listeners, create shadow dom.
* @constructor
*/
constructor() {
super();
}
}
customElements.define("bio-link-text", BioLinkText);