-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
97 lines (94 loc) · 3.94 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<html>
<head>
<!-- Generated by @jspm/generator VSCode Extension - https://github.com/jspm/jspm-vscode -->
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script>
<script type="importmap">
{
"imports": {
"@github/combobox-nav": "https://ga.jspm.io/npm:@github/[email protected]/dist/index.js",
"@launchscout/live-template": "https://ga.jspm.io/npm:@launchscout/[email protected]/index.js",
"lit": "https://ga.jspm.io/npm:[email protected]/index.js"
},
"scopes": {
"https://ga.jspm.io/": {
"@lit/reactive-element": "https://ga.jspm.io/npm:@lit/[email protected]/reactive-element.js",
"json-joy/esm/json-patch": "https://ga.jspm.io/npm:[email protected]/esm/json-patch/index.js",
"lit-element/lit-element.js": "https://ga.jspm.io/npm:[email protected]/lit-element.js",
"lit-html": "https://ga.jspm.io/npm:[email protected]/lit-html.js",
"lit-html/is-server.js": "https://ga.jspm.io/npm:[email protected]/is-server.js",
"phoenix": "https://ga.jspm.io/npm:[email protected]/priv/static/phoenix.mjs",
"phx-live-state": "https://ga.jspm.io/npm:[email protected]/build/src/index.js",
"process": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/process.js",
"reflect-metadata": "https://ga.jspm.io/npm:[email protected]/Reflect.js",
"sprae": "https://ga.jspm.io/npm:[email protected]/sprae.js",
"subscript": "https://ga.jspm.io/npm:[email protected]/subscript.js",
"swapdom/deflate": "https://ga.jspm.io/npm:[email protected]/deflate.js",
"wc-context": "https://ga.jspm.io/npm:[email protected]/core.js"
}
}
}
</script>
<style>
autocomplete-input [aria-selected] {
background-color: aquamarine;
}
autocomplete-input:state(selected)::part(input) {
border: none;
}
</style>
<script type="module">
import '@launchscout/live-template';
import './src/autocomplete-input.js';
</script>
</head>
<body>
<live-template url="ws://localhost:4000/live_state" topic="people:all" custom-events="autocomplete-commit,autocomplete-search">
<table>
<thead>
<tr>
<th><a :sendclick="sort" data-sort-key="last_name">Last name</a></th>
<th>First name</th>
</tr>
</thead>
<tbody>
<tr :each="person in people">
<td><a :sendclick="edit-person" :data-id="person.id" :text="person.last_name"></a></td>
<td :text="person.first_name"></td>
<td :text="person.birth_date"></td>
</tr>
</tbody>
</table>
<button :sendclick="add-person">Add Person</button>
<dialog :open="editing">
<form :sendsubmit="save-person">
<div>
<label>First name</label>
<input name="first_name" :value="person.first_name" />
<span :text="errors.first_name"></span>
</div>
<div>
<label>Last name</label>
<input name="last_name" :value="person.last_name" />
<span :text="errors.last_name"></span>
</div>
<div>
<label>Organizations</label>
<autocomplete-input :sendautocomplete-search="search_organizations" :sendautocomplete-commit="choose_organization" name="organization_id" :value="person.organization && person.organization.id">
<span :text="person.organization && person.organization.name"></span>
<ul slot="list">
<li :each="organization in organizations" :data-value="organization.id" role="option" :text="organization.name"></li>
</ul>
</autocomplete-input>
<span :text="errors.organizations_id"></span>
</div>
<div>
<label>Birth date</label>
<input name="birth_date" type="date" :value="person.birth_date" />
<span :text="errors.birth_date"></span>
</div>
<button>Save</button>
</form>
</dialog>
</live-template>
</body>
</html>