Newer
Older
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
import {i18n} from './i18n';
import {html, LitElement} from 'lit-element';
import './vpu-fileupload';
import * as commonUtils from 'vpu-common/utils';
class FileUploadDemo extends LitElement {
constructor() {
super();
this.lang = 'de';
this.url = '';
}
static get properties() {
return {
lang: { type: String },
url: { type: String },
};
}
update(changedProperties) {
changedProperties.forEach((oldValue, propName) => {
if (propName === "lang") {
i18n.changeLanguage(this.lang);
}
});
super.update(changedProperties);
}
render() {
return html`
<style>
vpu-fileupload.clean {
--FUBorder: initial;
--FUBorderRadius: initial;
--FUMargin: initial;
--FUPadding: initial;
}
vpu-fileupload.opt {
--FUBorder: 2px solid blue;
}
</style>
<section class="section">
<div class="content">
<h1 class="title">File-Upload-Demo</h1>
<p>You need an upload server listening at <tt>${this.url}</tt> to receive the files...</p>
</div>
<div class="content">
<h2 class="subtitle">Send to Server</h2>
<p>Drop some files here:</p>
<vpu-fileupload lang="de" url="${this.url}"></vpu-fileupload>
</div>
<div class="content">
<h2>Log of uploads</h2>
<ul id="log"></ul>
</div>
</section>
`;
}
}
commonUtils.defineCustomElement('vpu-fileupload-demo', FileUploadDemo);