-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvaadin-upload.js
39 lines (34 loc) · 926 Bytes
/
vaadin-upload.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
import { LitElement, html, css } from 'lit-element';
import { vaadinUploadStyles } from './vaadin-upload-styles.js';
class VaadinUpload extends LitElement {
static get properties() { return {
buttonText: { type: String },
dndIcon: { type: String },
dndText: { type: String }
};}
constructor() {
super();
this.buttonText = "Upload files...";
this.dndIcon = "lumo:upload";
this.dndText = "Drop files here";
}
static get styles() {
return [vaadinUploadStyles, css``]
}
render() {
return html`
<div id="upload">
<vaadin-button>${this.buttonText}</vaadin-button>
<div id="dnd">
<iron-icon icon="${this.dndIcon}"></iron-icon>
<span>${this.dndText}</span>
</div>
</div>
<input type="file">
<ul id="filelist">
<slot></slot>
</ul>
`;
}
}
customElements.define('vaadin-upload', VaadinUpload);