Skip to content

Commit 8640bb7

Browse files
committed
Merge branch 'WebReflection-uhtml'
2 parents 8a16d84 + f68e0ab commit 8640bb7

File tree

4 files changed

+91
-70
lines changed

4 files changed

+91
-70
lines changed

frameworks/keyed/uhtml/package-lock.json

Lines changed: 60 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/keyed/uhtml/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "uhtml demo",
55
"main": "index.js",
66
"js-framework-benchmark": {
7-
"frameworkVersionFromPackage": "uhtml",
8-
"issues": [
9-
801
10-
]
7+
"frameworkVersionFromPackage": "uhtml"
118
},
129
"scripts": {
1310
"build-dev": "rollup -c -w",
@@ -27,13 +24,13 @@
2724
},
2825
"homepage": "https://github.com/krausest/js-framework-benchmark#readme",
2926
"dependencies": {
30-
"js-framework-benchmark-utils": "^0.2.5",
31-
"uhtml": "^2.7.5"
27+
"js-framework-benchmark-utils": "^0.3.2",
28+
"uhtml": "^2.7.6"
3229
},
3330
"devDependencies": {
3431
"@rollup/plugin-node-resolve": "^13.0.0",
35-
"@ungap/degap": "^0.2.6",
36-
"rollup": "^2.52.1",
32+
"@ungap/degap": "^0.2.7",
33+
"rollup": "^2.52.6",
3734
"rollup-plugin-includepaths": "^0.2.4",
3835
"rollup-plugin-minify-html-literals": "^1.2.6",
3936
"rollup-plugin-terser": "^7.0.2"

frameworks/keyed/uhtml/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import {State} from 'js-framework-benchmark-utils';
22
import {html, render} from 'uhtml';
33

44
import Jumbotron from './jumbotron.js';
5-
import Table from './table-delegate.js';
5+
import Table from './table.js';
66

7-
const state = State(Table);
7+
const state = State(Table, false, html.for);
88

99
render(document.getElementById('container'), html`
1010
<div class="container">

frameworks/keyed/uhtml/src/table.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import {html} from 'uhtml';
2+
3+
export default (state) => {
4+
const {data, selected, selectRow, removeRow} = state;
5+
return html.for(state)`
6+
<table class="table table-hover table-striped test-data" .state=${state}>
7+
<tbody>${
8+
data.map(({id, label, html}) => html`
9+
<tr id=${id} class=${id === selected ? 'danger' : ''}>
10+
<td class="col-md-1">${id}</td>
11+
<td class="col-md-4">
12+
<a @click=${selectRow}>${label}</a>
13+
</td>
14+
<td class="col-md-1">
15+
<a @click=${removeRow}>
16+
<span class="glyphicon glyphicon-remove" aria-hidden="true" />
17+
</a>
18+
</td>
19+
<td class="col-md-6" />
20+
</tr>`
21+
)}</tbody>
22+
</table>
23+
`;
24+
};

0 commit comments

Comments
 (0)