-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
63 lines (62 loc) · 2.45 KB
/
index.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
<!doctype html>
<html>
<head>
<script type="module" src="./src/wawa-table.js"></script>
<script>
setTimeout(() => {
document.querySelector("wawa-table").fetchData = async (pageNumber, pageSize) => {
await new Promise((resolve, reject) => {
// simulate network call
setTimeout(() => {
resolve();
}, 200);
});
let items = [];
for(let i = 0; i < pageSize; i++) {
items.push({name: "name " + (pageNumber * pageSize + i)});
if(i == 5) {
setTimeout(() => {
items[5].name = "NOOOOOO";
}, 6000);
}
}
return items;
}
}, 2000);
</script>
<link href="https://fonts.googleapis.com/css?family=Varela&display=swap" rel="stylesheet">
<style>
wawa-table {
font-size: 18px;
font-family: Varela;
}
</style>
</head>
<body>
<wawa-table monitor="true" rowHeight="50">
<template is="header-template">
<tr is="wawa-header-tr" style="font-weight:bold;background-color:#6c7ae0;color:white;height:60px;text-align:left;">
<th resizable>Name</span></th>
<th>Info (table scroll offset: ${table.scrollOffset})</th>
<th resizable>Wawa</th>
</tr>
</template>
<template is="row-template">
<tr style="height:50px;color:gray;background-color:${index % 2 === 0 ? 'white' : '#f8f6ff'};">
<td @click="${item.wawa}" style="padding-left:40px;">
${item.name}
</td>
<td style="padding-left:40px;">
${index}
</td>
<td style="padding-left:40px;">
${index}
</td>
</tr>
</template>
<template is="loading-template">
<div style='position:relative;bottom: 0px;width:100%;text-align:center;font-style:italic;color:#757575;'>WAWA...</div>
</template>
</wawa-table>
</body>
</html>