lightview 1.6.5-b → 1.7.2-b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/components/chart/chart.html +15 -0
- package/components/chart/example.html +32 -0
- package/components/chart.html +22 -18
- package/components/components.js +93 -0
- package/components/gantt/example.html +27 -0
- package/components/gantt/gantt.html +34 -0
- package/components/gauge/example.html +28 -0
- package/components/gauge/guage.html +19 -0
- package/components/timeline.html +81 -0
- package/examples/counter.html +1 -1
- package/examples/foreign.html +27 -13
- package/examples/forgeinform.html +29 -8
- package/examples/form.html +1 -1
- package/examples/invalid-template-literals.html +1 -4
- package/examples/medium/remote.html +2 -1
- package/examples/message.html +0 -1
- package/examples/object-bound-form.html +32 -0
- package/examples/remote.json +1 -1
- package/examples/timeline.html +21 -0
- package/examples/todo.html +38 -0
- package/examples/types.html +3 -2
- package/lightview.js +376 -243
- package/package.json +1 -1
- package/test/basic.html +8 -4
- package/test/extended.html +10 -7
- package/test/extended.test.mjs +182 -4
- package/types.js +98 -52
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>Lightview:Examples:ToDo</title>
|
|
4
|
+
<script src="../lightview.js?as=x-body"></script>
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<input type="text" value="${newItem}" placeholder="new todo item...">
|
|
8
|
+
<button l-on:click="${addToList}">Add</button>
|
|
9
|
+
<div l-for="${todoList}">
|
|
10
|
+
<input value="${item.status}" type="checkbox">
|
|
11
|
+
<span class="${item.status ? 'checked' : ''}">${item.text}</span>
|
|
12
|
+
<span l-on:click="({self}) => self.removeFromList(${index})">X>
|
|
13
|
+
<br/>
|
|
14
|
+
</div>
|
|
15
|
+
<script type="lightview/module">
|
|
16
|
+
self.variables(
|
|
17
|
+
{ todoList: Array },
|
|
18
|
+
{
|
|
19
|
+
reactive,
|
|
20
|
+
set: [
|
|
21
|
+
{text: 'Write my first post', status: true},
|
|
22
|
+
{text: 'Upload the post to the blog', status: false}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
self.addToList = () => {
|
|
27
|
+
todoList = [...todoList, {text: newItem, status: false}];
|
|
28
|
+
newItem = '';
|
|
29
|
+
};
|
|
30
|
+
self.removeFromList = (index) => {
|
|
31
|
+
todoList.splice(index, 1);
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
<style>
|
|
35
|
+
.checked { text-decoration: line-through; }
|
|
36
|
+
</style>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
package/examples/types.html
CHANGED
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
<body>
|
|
10
10
|
<div style="margin:20px">
|
|
11
11
|
<p>
|
|
12
|
-
<button l-on:click="run">Run</button>
|
|
13
|
-
<button l-on:click="clear">Clear</button>
|
|
12
|
+
<button l-on:click="${run}">Run</button>
|
|
13
|
+
<button l-on:click="${clear}">Clear</button>
|
|
14
14
|
</p>
|
|
15
15
|
<p id="console"></p>
|
|
16
16
|
</div>
|
|
17
17
|
<script type="lightview/module">
|
|
18
18
|
const {string} = await import("../types.js");
|
|
19
|
+
debugger;
|
|
19
20
|
self.run = () => {
|
|
20
21
|
self.variables({
|
|
21
22
|
err: Error,
|