@loadbare/app 0.7.3 → 0.8.0
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/dist/build/assemble.d.ts.map +1 -1
- package/dist/build/assemble.js +67 -6
- package/dist/build/assemble.js.map +1 -1
- package/dist/core/lb-constants.d.ts +2 -2
- package/dist/core/lb-constants.d.ts.map +1 -1
- package/dist/core/lb-constants.js +28 -14
- package/dist/core/lb-constants.js.map +1 -1
- package/dist/core/lb-types.d.ts +4 -10
- package/dist/core/lb-types.d.ts.map +1 -1
- package/dist/core/lb-types.js.map +1 -1
- package/dist/hub/lb-apply.d.ts +2 -2
- package/dist/hub/lb-apply.d.ts.map +1 -1
- package/dist/hub/lb-apply.js +98 -8
- package/dist/hub/lb-apply.js.map +1 -1
- package/dist/hub/lb-hub.browser.d.ts.map +1 -1
- package/dist/hub/lb-hub.browser.js +61 -26
- package/dist/hub/lb-hub.browser.js.map +1 -1
- package/dist/server/lb-express.d.ts.map +1 -1
- package/dist/server/lb-express.js +2 -7
- package/dist/server/lb-express.js.map +1 -1
- package/dist/server/lb-server.d.ts +8 -15
- package/dist/server/lb-server.d.ts.map +1 -1
- package/dist/server/lb-server.js +0 -3
- package/dist/server/lb-server.js.map +1 -1
- package/docs/TECHREF-1.0.md +141 -100
- package/docs/analysis-closed-set.md +210 -0
- package/docs/comparison.md +1124 -0
- package/docs/prior-art.md +216 -0
- package/docs/reference/custom-elements.md +21 -6
- package/docs/reference/data-binding.md +120 -40
- package/docs/reference/page-files.md +13 -9
- package/docs/reference/widgets.md +2 -2
- package/docs/roadmap.md +1 -1
- package/docs/testing.md +7 -1
- package/docs/theory.md +737 -408
- package/docs/tutorials/080-widget-requests.md +9 -28
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ class NoteInput extends HTMLElement {
|
|
|
37
37
|
this.dispatchEvent(
|
|
38
38
|
new CustomEvent(LB_EVENT_NAME, {
|
|
39
39
|
bubbles: true,
|
|
40
|
-
detail: { action: "lb-
|
|
40
|
+
detail: { action: "lb-row-update", value: input.value },
|
|
41
41
|
}),
|
|
42
42
|
);
|
|
43
43
|
});
|
|
@@ -49,9 +49,9 @@ customElements.define("note-input", NoteInput);
|
|
|
49
49
|
|
|
50
50
|
A widget with both a `.html` and a `.browser.ts` file shares one tag name; the
|
|
51
51
|
build finds each half independently. On change, it dispatches a
|
|
52
|
-
`lb-
|
|
53
|
-
of the row it is in and
|
|
54
|
-
`lb-
|
|
52
|
+
`lb-row-update` carrying the input's value. The hub adds the list and the key
|
|
53
|
+
of the row it is in, and turns the value into a `values` map holding only
|
|
54
|
+
the widget's own `lb-cell`.
|
|
55
55
|
|
|
56
56
|
## Using it
|
|
57
57
|
|
|
@@ -72,30 +72,11 @@ every change, so there's nothing left to batch.
|
|
|
72
72
|
|
|
73
73
|
## Answering it server-side
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// ...onPageEnter and actions unchanged...
|
|
81
|
-
crud: {
|
|
82
|
-
notes: {
|
|
83
|
-
// ...rowInsert, rowDelete, rowUpdate unchanged...
|
|
84
|
-
cellChange: {
|
|
85
|
-
run: async (ctx, { key, value }) => {
|
|
86
|
-
const note = await ctx.db.updateNote(key, value);
|
|
87
|
-
return { notes: patch({ rows: [note] }) };
|
|
88
|
-
},
|
|
89
|
-
refresh: [],
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
`cellChange` reuses `updateNote` from [Updating a List Item](./076-updating-a-list-item.md)
|
|
97
|
-
— the database doesn't care whether the edit came from a form's values
|
|
98
|
-
map or one widget's value.
|
|
75
|
+
There is nothing to add. The request is the same `lb-row-update` the form
|
|
76
|
+
sent in [Updating a List Item](./076-updating-a-list-item.md), with `values`
|
|
77
|
+
holding only `text`, so the `rowUpdate` written there answers it unchanged.
|
|
78
|
+
A `rowUpdate` sets the columns `values` names and leaves the rest alone, as
|
|
79
|
+
an SQL `UPDATE` does, so one handler serves a form and a widget alike.
|
|
99
80
|
|
|
100
81
|
## Run it
|
|
101
82
|
|