-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Nelson
committed
Apr 14, 2024
1 parent
35c208e
commit d595e26
Showing
6 changed files
with
143 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<html> | ||
|
||
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"lit": "https://ga.jspm.io/npm:[email protected]/index.js", | ||
"phx-live-state": "https://ga.jspm.io/npm:[email protected]/build/src/index.js", | ||
"sprae": "https://ga.jspm.io/npm:[email protected]/sprae.js", | ||
"wc-context": "https://ga.jspm.io/npm:[email protected]/core.js" | ||
}, | ||
"scopes": { | ||
"https://ga.jspm.io/": { | ||
"@lit/reactive-element": "https://ga.jspm.io/npm:@lit/[email protected]/development/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]/development/lit-element.js", | ||
"lit-html": "https://ga.jspm.io/npm:[email protected]/development/lit-html.js", | ||
"lit-html/is-server.js": "https://ga.jspm.io/npm:[email protected]/development/is-server.js", | ||
"phoenix": "https://ga.jspm.io/npm:[email protected]/priv/static/phoenix.mjs", | ||
"process": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/process.js", | ||
"reflect-metadata": "https://ga.jspm.io/npm:[email protected]/Reflect.js", | ||
"subscript": "https://ga.jspm.io/npm:[email protected]/subscript.js", | ||
"subscript/justin": "https://ga.jspm.io/npm:[email protected]/justin.js", | ||
"swapdom": "https://ga.jspm.io/npm:[email protected]/inflate.js", | ||
"ulive": "https://ga.jspm.io/npm:[email protected]/dist/ulive.es.js" | ||
} | ||
} | ||
} | ||
</script> | ||
<script type="module"> | ||
import './src/live-template.js'; | ||
import './simple-field.js'; | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<live-template url="ws://localhost:4000/live_state" topic="people:all"> | ||
<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>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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters