@loadbare/app 0.11.0 → 0.13.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 +61 -1
- package/dist/build/assemble.js.map +1 -1
- package/dist/build/cli.js +2 -1
- package/dist/build/cli.js.map +1 -1
- package/dist/build/elements.d.ts +9 -1
- package/dist/build/elements.d.ts.map +1 -1
- package/dist/build/elements.js +50 -0
- package/dist/build/elements.js.map +1 -1
- package/dist/build/origins.d.ts +2 -0
- package/dist/build/origins.d.ts.map +1 -1
- package/dist/build/origins.js +1 -1
- package/dist/build/origins.js.map +1 -1
- package/dist/core/lb-constants.d.ts +26 -1
- package/dist/core/lb-constants.d.ts.map +1 -1
- package/dist/core/lb-constants.js +79 -0
- package/dist/core/lb-constants.js.map +1 -1
- package/dist/core/lb-types.d.ts +58 -18
- package/dist/core/lb-types.d.ts.map +1 -1
- package/dist/core/lb-types.js +74 -11
- package/dist/core/lb-types.js.map +1 -1
- package/dist/hub/lb-apply.d.ts +44 -16
- package/dist/hub/lb-apply.d.ts.map +1 -1
- package/dist/hub/lb-apply.js +694 -49
- 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 +168 -36
- package/dist/hub/lb-hub.browser.js.map +1 -1
- package/dist/server/lb-express.d.ts +6 -4
- package/dist/server/lb-express.d.ts.map +1 -1
- package/dist/server/lb-express.js +32 -14
- package/dist/server/lb-express.js.map +1 -1
- package/dist/server/lb-server.d.ts +49 -10
- package/dist/server/lb-server.d.ts.map +1 -1
- package/dist/server/lb-server.js +87 -28
- package/dist/server/lb-server.js.map +1 -1
- package/docs/TECHREF-1.0.md +364 -72
- package/docs/comparison.md +16 -10
- package/docs/possible-ideas.md +188 -0
- package/docs/reference/chrome.md +22 -1
- package/docs/reference/custom-elements.md +90 -29
- package/docs/reference/data-binding.md +132 -7
- package/docs/reference/page-files.md +48 -11
- package/docs/reference/server.md +4 -0
- package/docs/reference/widgets.md +94 -24
- package/docs/roadmap.md +10 -6
- package/docs/testing.md +21 -10
- package/package.json +2 -3
- package/skills/loadbare-app/SKILL.md +85 -12
- package/skills/loadbare-app/references/TECHREF-1.0.md +364 -72
- package/skills/loadbare-app/references/chrome.md +22 -1
- package/skills/loadbare-app/references/custom-elements.md +90 -29
- package/skills/loadbare-app/references/data-binding.md +132 -7
- package/skills/loadbare-app/references/page-files.md +48 -11
- package/skills/loadbare-app/references/server.md +4 -0
- package/skills/loadbare-app/references/widgets.md +94 -24
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# The Basic Widget Library
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`lb-unknown-page
|
|
3
|
+
Ten widgets: `lb-input`, `lb-select`, `lb-options`, `lb-picker`, `lb-table`,
|
|
4
|
+
`lb-unknown-page`, `lb-confirm`, `lb-form`, `lb-insert-dialog` and
|
|
5
|
+
`lb-master`. Every one of them is an ordinary custom element, written
|
|
5
6
|
against the contracts in [Custom Elements](./custom-elements.md#html) for its
|
|
6
7
|
definition and [Custom Elements](./custom-elements.md#code) for its class.
|
|
7
8
|
|
|
@@ -43,6 +44,7 @@ write the same edit twice.
|
|
|
43
44
|
| Parameter | Fills |
|
|
44
45
|
|----------------|----------------------------------|
|
|
45
46
|
| `exp-label` | The visible `<label>` text |
|
|
47
|
+
| `exp-type` | The input's `type`, `text` when absent |
|
|
46
48
|
| `exp-readonly` | The input's `readonly` attribute |
|
|
47
49
|
|
|
48
50
|
## `lb-select`
|
|
@@ -67,9 +69,7 @@ writes the row template inside the widget:
|
|
|
67
69
|
|
|
68
70
|
```html
|
|
69
71
|
<lb-options lb-query="statuses" lb-column="status" lb-request="lb-row-update" exp-label="Status">
|
|
70
|
-
<template
|
|
71
|
-
<option lb-column="label"></option>
|
|
72
|
-
</template>
|
|
72
|
+
<template><option lb-column="label"></option></template>
|
|
73
73
|
</lb-options>
|
|
74
74
|
```
|
|
75
75
|
|
|
@@ -79,9 +79,15 @@ writes the row template inside the widget:
|
|
|
79
79
|
|
|
80
80
|
- Each option's `value` is its row's key, the `lb-key-value` the hub stamps
|
|
81
81
|
on the live row, so the widget holds a key and shows a label.
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
- A group template holding an `<optgroup>` puts the options in groups, one
|
|
83
|
+
per run of the query's order's leading term. The widget labels each
|
|
84
|
+
`<optgroup>` from the `lb-group-value` the hub stamps on it:
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<template lb-group>
|
|
88
|
+
<optgroup><template><option lb-column="label"></option></template></optgroup>
|
|
89
|
+
</template>
|
|
90
|
+
```
|
|
85
91
|
- Its `value` selects the option with that key, including an option that
|
|
86
92
|
arrives after the value did.
|
|
87
93
|
|
|
@@ -100,7 +106,6 @@ one option showing one column:
|
|
|
100
106
|
lb-request="lb-row-update"
|
|
101
107
|
exp-label="Status"
|
|
102
108
|
exp-column="label"
|
|
103
|
-
exp-group="category"
|
|
104
109
|
></lb-picker>
|
|
105
110
|
```
|
|
106
111
|
|
|
@@ -108,10 +113,9 @@ one option showing one column:
|
|
|
108
113
|
|--------------|-----------------------------------------|
|
|
109
114
|
| `exp-label` | The visible `<label>` text |
|
|
110
115
|
| `exp-column` | The column each option shows |
|
|
111
|
-
| `exp-group` | The row template's `data-group` |
|
|
112
116
|
|
|
113
|
-
An option built from two columns,
|
|
114
|
-
`lb-options` with the page's own
|
|
117
|
+
An option built from two columns, a row with a second element, or options
|
|
118
|
+
in groups, is `lb-options` with the page's own templates.
|
|
115
119
|
|
|
116
120
|
## `lb-table`
|
|
117
121
|
|
|
@@ -123,11 +127,14 @@ row, the row template, and optionally a footer, each as a `<template>`:
|
|
|
123
127
|
<template lb-exp-template="head">
|
|
124
128
|
<tr><th>Date</th><th>Amount</th></tr>
|
|
125
129
|
</template>
|
|
126
|
-
<template
|
|
127
|
-
<tr><
|
|
130
|
+
<template lb-group>
|
|
131
|
+
<tr><th colspan="2" lb-column="month"></th></tr>
|
|
132
|
+
<template>
|
|
133
|
+
<tr><td lb-column="date"></td><td lb-column="amount"></td></tr>
|
|
134
|
+
</template>
|
|
128
135
|
</template>
|
|
129
136
|
<template lb-exp-template="foot">
|
|
130
|
-
<tr
|
|
137
|
+
<tr><td>Total</td><td lb-sum="amount"></td></tr>
|
|
131
138
|
</template>
|
|
132
139
|
</lb-table>
|
|
133
140
|
```
|
|
@@ -140,15 +147,78 @@ row, the row template, and optionally a footer, each as a `<template>`:
|
|
|
140
147
|
|-----------------------------------|-----------------------------------------|
|
|
141
148
|
| `<template lb-exp-template="head">` | The `<thead>` |
|
|
142
149
|
| `<template lb-exp-template="foot">` | The `<tfoot>` |
|
|
143
|
-
| Any other `<template>` | The row template, in the `<tbody>`
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
| Any other `<template>` | The row or group template, in the `<tbody>` |
|
|
151
|
+
|
|
152
|
+
- The hub places the rows by the query's order and builds its groups. The
|
|
153
|
+
rows land in the one `<tbody>`, so a group here is a heading row with its
|
|
154
|
+
rows after it.
|
|
155
|
+
- The footer is not a row of `ledger`. An aggregate there covers every row;
|
|
156
|
+
a figure that is not a sum of the rows, such as a budget, is a `<tr>`
|
|
157
|
+
naming a `row` query of its own.
|
|
158
|
+
- A `<template lb-exp-template="ghost">` is a blank row for entering a new
|
|
159
|
+
one, in a `<tbody>` of its own. The widget joins its controls to a form
|
|
160
|
+
outside the table, since a `<form>` cannot wrap a `<tr>`, and puts the
|
|
161
|
+
cursor back in it once an insert from it succeeds.
|
|
162
|
+
- After rows land, the widget scrolls the row the page's own request created
|
|
163
|
+
or moved into view.
|
|
164
|
+
|
|
165
|
+
## `lb-confirm`
|
|
166
|
+
|
|
167
|
+
A button that asks before it sends. The page writes the question inside the
|
|
168
|
+
tag, and the request goes on the dialog's confirm button, so nothing reaches
|
|
169
|
+
the hub until the user says yes:
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<lb-confirm exp-label="Delete" exp-request="lb-row-delete">
|
|
173
|
+
Delete <b lb-column="name"></b>?
|
|
174
|
+
</lb-confirm>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
| Parameter | Fills |
|
|
178
|
+
|---------------|--------------------------------------------------|
|
|
179
|
+
| `exp-label` | The text of the button that opens the dialog |
|
|
180
|
+
| `exp-request` | The confirm button's `lb-request` |
|
|
181
|
+
| `exp-confirm` | The confirm button's text, `Confirm` when absent |
|
|
182
|
+
|
|
183
|
+
The widget closes the dialog once `lb-request-done` says the request
|
|
184
|
+
succeeded, and leaves it open on a refusal.
|
|
185
|
+
|
|
186
|
+
## `lb-form`
|
|
187
|
+
|
|
188
|
+
A `<form>` over one row's controls. A row with a key saves each control's
|
|
189
|
+
column on `change`; a row whose key is empty is new, and the widget stops an
|
|
190
|
+
`lb-row-update` that carries no key, so its controls wait for a submit.
|
|
191
|
+
|
|
192
|
+
| Parameter | Fills |
|
|
193
|
+
|-----------|-----------------|
|
|
194
|
+
| `exp-id` | The form's `id` |
|
|
195
|
+
|
|
196
|
+
## `lb-insert-dialog`
|
|
197
|
+
|
|
198
|
+
A row entered in a modal dialog, written once outside every row and opened
|
|
199
|
+
with `commandfor` and `command="show-modal"`. Save is the form's
|
|
200
|
+
`lb-row-insert`; on success the widget chooses the new row in the nearest
|
|
201
|
+
`lb-options` around the button that opened it, and closes. The handler
|
|
202
|
+
answers with a patch holding the new row.
|
|
203
|
+
|
|
204
|
+
| Parameter | Fills |
|
|
205
|
+
|-------------|---------------------------------------------------|
|
|
206
|
+
| `exp-id` | The dialog's `id` |
|
|
207
|
+
| `exp-title` | The dialog's heading |
|
|
208
|
+
| `exp-query` | The form's `lb-query`, which it inserts into |
|
|
209
|
+
| `exp-save` | The Save button's text, `Save` when absent |
|
|
210
|
+
|
|
211
|
+
## `lb-master`
|
|
212
|
+
|
|
213
|
+
A set, one of its rows, and the buttons that act on the set: Copy, Delete,
|
|
214
|
+
Save new and Cancel, each shown only for a row on record or a new one. A
|
|
215
|
+
definition only, built from `lb-form` and `lb-confirm`. Copy sends `copy`, a
|
|
216
|
+
request the page declares.
|
|
217
|
+
|
|
218
|
+
| Parameter | Fills |
|
|
219
|
+
|---------------|--------------------------------------------|
|
|
220
|
+
| `exp-row` | The `lb-query` of the row the form shows |
|
|
221
|
+
| `exp-form-id` | The form's `id`, `master-form` when absent |
|
|
152
222
|
|
|
153
223
|
## `lb-unknown-page`
|
|
154
224
|
|