@loadbare/app 0.23.0 → 0.25.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 +78 -1
- package/dist/build/assemble.js.map +1 -1
- package/dist/core/lb-constants.d.ts +8 -5
- package/dist/core/lb-constants.d.ts.map +1 -1
- package/dist/core/lb-constants.js +20 -11
- package/dist/core/lb-constants.js.map +1 -1
- package/dist/core/lb-types.d.ts +19 -3
- package/dist/core/lb-types.d.ts.map +1 -1
- package/dist/core/lb-types.js +35 -5
- package/dist/core/lb-types.js.map +1 -1
- package/dist/hub/lb-apply.d.ts +31 -22
- package/dist/hub/lb-apply.d.ts.map +1 -1
- package/dist/hub/lb-apply.js +186 -52
- 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 +59 -28
- package/dist/hub/lb-hub.browser.js.map +1 -1
- package/dist/server/lb-server.d.ts +2 -2
- package/dist/server/lb-server.d.ts.map +1 -1
- package/dist/server/lb-server.js +29 -9
- package/dist/server/lb-server.js.map +1 -1
- package/docs/comparison.md +13 -11
- package/docs/miswarts.md +4 -3
- package/docs/reference/chrome.md +42 -0
- package/docs/reference/custom-elements.md +9 -4
- package/docs/reference/data-binding.md +143 -67
- package/docs/reference/names.md +11 -8
- package/docs/reference/page-files.md +11 -6
- package/docs/testing.md +3 -3
- package/package.json +1 -1
- package/skills/loadbare-app/SKILL.md +38 -15
- package/skills/loadbare-app/references/chrome.md +42 -0
- package/skills/loadbare-app/references/custom-elements.md +9 -4
- package/skills/loadbare-app/references/data-binding.md +143 -67
- package/skills/loadbare-app/references/miswarts.md +4 -3
- package/skills/loadbare-app/references/names.md +11 -8
- package/skills/loadbare-app/references/page-files.md +11 -6
- package/docs/temp-proposals.md +0 -251
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A page shows server data by naming queries and columns in its HTML, and asks
|
|
4
4
|
the server to change that data by naming requests. The developer writes
|
|
5
|
-
|
|
5
|
+
eighteen `lb-` attributes. The server declares every query a page may show and
|
|
6
6
|
every request it may send, and refuses anything it has not declared.
|
|
7
7
|
|
|
8
8
|
Everything is a query. A query is a name for rows, of kind `row` or `rows`,
|
|
@@ -67,10 +67,10 @@ builder writes a stamp, and a stylesheet or a custom element reads it.
|
|
|
67
67
|
| `lb-key-value` | The key of a live row, or of a `row` landed on an element |
|
|
68
68
|
| `lb-row-live` | The element is a live row |
|
|
69
69
|
| `lb-query-row-count` | The number of live rows an element shows |
|
|
70
|
-
| `lb-query-
|
|
70
|
+
| `lb-query-unplaced-count` | The number of them out of place; see [Placing by hand](#placing-by-hand) |
|
|
71
71
|
| `lb-query-order` | The order placing them; see [Order](#order) |
|
|
72
72
|
| `lb-group-live`, `lb-group-column`, `lb-group-value` | A group, the column it breaks on, and its value; see [Groups](#groups) |
|
|
73
|
-
| `lb-row-created`, `lb-row-changed`, `lb-row-moved`, `lb-row-requested`, `lb-row-
|
|
73
|
+
| `lb-row-created`, `lb-row-changed`, `lb-row-moved`, `lb-row-requested`, `lb-row-unplaced` | What happened to a row; see [What happened to a row](#what-happened-to-a-row) |
|
|
74
74
|
| `lb-row-leaving`, `lb-group-leaving` | A row or group on its way out |
|
|
75
75
|
| `lb-row-editing` | The row a form is pointed at; see [Editing a row in one form](#editing-a-row-in-one-form) |
|
|
76
76
|
| `lb-row-selected` | A row whose `lb-select` is ticked |
|
|
@@ -146,6 +146,7 @@ no row fills.
|
|
|
146
146
|
| `<input>`, `<select>`, `<textarea>` | Its `value`, and `lb-column-value` |
|
|
147
147
|
| `<input type="checkbox">` | Its `checked`, and `lb-column-value` |
|
|
148
148
|
| `<input type="radio">` | Its `checked`, and `lb-column-value` |
|
|
149
|
+
| `<select multiple>` | Its selected options, and `lb-column-value` |
|
|
149
150
|
| A form-associated custom element with `value` | Its `value`, and `lb-column-value` |
|
|
150
151
|
| Any other custom element | `lb-column-value` only |
|
|
151
152
|
| Any other element | Its text content, and `lb-column-value` |
|
|
@@ -186,8 +187,9 @@ A checkbox lands what it sends, so it shows the same state after a round
|
|
|
186
187
|
trip through a query whose values are strings, such as `lb-url` or
|
|
187
188
|
`lb-choices`. A query parm the URL does not carry lands as `""`, so the
|
|
188
189
|
checkbox is unchecked. Unchecked sends `"false"` rather than nothing, so a
|
|
189
|
-
flag can be set back.
|
|
190
|
-
|
|
190
|
+
flag can be set back. A checkbox carrying a `value` attribute is not a flag
|
|
191
|
+
but one of a set, holding a query parm the URL repeats; see
|
|
192
|
+
[Several values](./chrome.md#several-values).
|
|
191
193
|
|
|
192
194
|
### Radio buttons
|
|
193
195
|
|
|
@@ -228,9 +230,9 @@ places it immediately before the template:
|
|
|
228
230
|
The hub matches each row to a live row by its key. All rows decide
|
|
229
231
|
membership: a live row whose key did not arrive leaves. A patch changes only
|
|
230
232
|
the rows it names, and every other live row keeps its content. The hub
|
|
231
|
-
places live rows by the query's order, except
|
|
232
|
-
|
|
233
|
-
[
|
|
233
|
+
places live rows by the query's order, except where the list's `lb-manual`
|
|
234
|
+
leaves them where they stand; see [Order](#order) and
|
|
235
|
+
[Placing by hand](#placing-by-hand). A row that
|
|
234
236
|
does not pass the user's filter is `hidden`; see [Filters](#filters).
|
|
235
237
|
|
|
236
238
|
A live row whose values arrive as it already shows them is not filled
|
|
@@ -310,41 +312,50 @@ Rows that compare equal keep the order they arrived in, a patch's new rows
|
|
|
310
312
|
after the rows already showing. A row moves only when the order
|
|
311
313
|
puts it somewhere else, so all rows landing again unchanged move nothing.
|
|
312
314
|
|
|
313
|
-
###
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
315
|
+
### Placing by hand
|
|
316
|
+
|
|
317
|
+
By default the hub places a list's rows by the order and the filter on
|
|
318
|
+
every landing. Write `lb-manual` on the element carrying `lb-query` to leave
|
|
319
|
+
one side or both to the user, so rows do not jump about or vanish while the
|
|
320
|
+
user works through them. It names `order`, `filter` or both, separated by a
|
|
321
|
+
space:
|
|
322
|
+
|
|
323
|
+
```html
|
|
324
|
+
<lb-table lb-query="entries" lb-order="entries_order"
|
|
325
|
+
lb-filter="description, is_unmatched" lb-manual="order filter">
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
A landing that answers a request leaves alone each side the list names,
|
|
329
|
+
wherever the request was sent from: a control in a live row, a ghost row, a
|
|
330
|
+
form `--lb-edit` pointed at a row, or a form elsewhere on the page.
|
|
331
|
+
|
|
332
|
+
| The answer | Under `lb-manual`, the row | Side |
|
|
333
|
+
|----------------------------------------|---------------------------------------------------|----------|
|
|
334
|
+
| Changes a column the order reads | Stays where it stands | `order` |
|
|
335
|
+
| Creates a row | Goes after the last row of its group, or last of all | `order` |
|
|
336
|
+
| Changes the column its group breaks on | Stays under its group's heading | `order` |
|
|
337
|
+
| Changes a row so the filter hides it | Stays showing | `filter` |
|
|
338
|
+
| Drops a row | Leaves, under either side | |
|
|
339
|
+
|
|
340
|
+
A side not named is placed on every landing. A list that names only
|
|
341
|
+
`filter` moves an edited row into the order and keeps it showing; one that
|
|
342
|
+
names only `order` leaves it where it stands and hides it once the filter
|
|
343
|
+
says so.
|
|
344
|
+
|
|
345
|
+
A patch and all rows answering the same edit land the same way. A showing
|
|
346
|
+
row left where the order or the filter would not leave it is stamped
|
|
347
|
+
`lb-row-unplaced`, and the element carrying `lb-query` carries
|
|
348
|
+
`lb-query-unplaced-count`, the number of such rows. One stamp covers both
|
|
349
|
+
sides. Each element naming the query places by its own `lb-manual`.
|
|
350
|
+
|
|
351
|
+
The rows are placed by the order and the filter again, and every
|
|
352
|
+
`lb-row-unplaced` is cleared, when the page loads, when the user's order or
|
|
353
|
+
filter changes, or on `--lb-place`. A button names the list with HTML's
|
|
343
354
|
`commandfor`, and a stylesheet shows it only while it has something to do:
|
|
344
355
|
|
|
345
356
|
```html
|
|
346
|
-
<div id="roster" lb-query="roster">
|
|
347
|
-
<button type="button" class="
|
|
357
|
+
<div id="roster" lb-query="roster" lb-manual="order">
|
|
358
|
+
<button type="button" class="place" commandfor="roster" command="--lb-place">Re-sort</button>
|
|
348
359
|
<ul>
|
|
349
360
|
<template><li><input lb-column="name" lb-request="lb-row-update" /></li></template>
|
|
350
361
|
</ul>
|
|
@@ -352,19 +363,19 @@ filter changes, or on `--lb-sort`. A button names the list with HTML's
|
|
|
352
363
|
```
|
|
353
364
|
|
|
354
365
|
```css
|
|
355
|
-
.
|
|
366
|
+
.place {
|
|
356
367
|
display: none;
|
|
357
368
|
}
|
|
358
|
-
[lb-query-
|
|
369
|
+
[lb-query-unplaced-count]:not([lb-query-unplaced-count="0"]) .place {
|
|
359
370
|
display: revert;
|
|
360
371
|
}
|
|
361
372
|
```
|
|
362
373
|
|
|
363
|
-
`--lb-
|
|
374
|
+
`--lb-place` places the rows the hub holds, with no round trip. Aimed at an
|
|
364
375
|
element that carries no `lb-query`, or shows no rows the hub holds, it is
|
|
365
376
|
reported to the console. A custom element that reorders rows by a request of
|
|
366
377
|
its own dispatches the same command on the list once the answer lands, with
|
|
367
|
-
`new CommandEvent("command", { command: "--lb-
|
|
378
|
+
`new CommandEvent("command", { command: "--lb-place" })`: the user asked for
|
|
368
379
|
the move.
|
|
369
380
|
|
|
370
381
|
### Filters
|
|
@@ -384,9 +395,9 @@ its rows the user may filter, separated by commas. The column of
|
|
|
384
395
|
```
|
|
385
396
|
|
|
386
397
|
A row that does not pass every filter is `hidden`, and a ticked `lb-select`
|
|
387
|
-
in it is cleared.
|
|
388
|
-
until the rows are placed again; see
|
|
389
|
-
[
|
|
398
|
+
in it is cleared. Under `lb-manual="filter"`, a row an answer changed stays
|
|
399
|
+
showing until the rows are placed again; see
|
|
400
|
+
[Placing by hand](#placing-by-hand). A group whose rows are all hidden is hidden too
|
|
390
401
|
([miswart](../miswarts.md#rows-hidden-by-a-filter)). An empty
|
|
391
402
|
choice filters nothing.
|
|
392
403
|
|
|
@@ -469,7 +480,7 @@ where a group's footer goes.
|
|
|
469
480
|
|
|
470
481
|
A heading is filled from its group's first row as an element in a row is,
|
|
471
482
|
`href`s from `lb-url-parm` included, so it may show a column other than the
|
|
472
|
-
one the group breaks on.
|
|
483
|
+
one the group breaks on. Under `lb-manual="order"`, a row an answer
|
|
473
484
|
moved to another group stays under its old heading, and the heading shows
|
|
474
485
|
the row as it stood, until the rows are placed again. The hub stamps each top-level
|
|
475
486
|
element of a group with `lb-group-live`, `lb-group-column` and
|
|
@@ -520,7 +531,7 @@ Every change to a list is one a stylesheet can see:
|
|
|
520
531
|
| `lb-row-changed` | Its values changed when the hub last touched it |
|
|
521
532
|
| `lb-row-moved` | Its values changed, and it now stands elsewhere |
|
|
522
533
|
| `lb-row-requested` | `created`, `changed` or `moved` by this page's request |
|
|
523
|
-
| `lb-row-
|
|
534
|
+
| `lb-row-unplaced` | Stands where the order or the filter would not leave it |
|
|
524
535
|
| `lb-row-leaving` | A row on its way out |
|
|
525
536
|
| `lb-group-leaving` | A group on its way out |
|
|
526
537
|
|
|
@@ -529,9 +540,9 @@ The hub touches a row when an answer names it. `lb-row-created`,
|
|
|
529
540
|
applied again is removed and added as two changes, so an animation keyed to
|
|
530
541
|
it plays again. `lb-row-requested` is cleared at every landing of the row's
|
|
531
542
|
query, and set only by a landing that answers a request from the page.
|
|
532
|
-
`lb-row-
|
|
533
|
-
placed
|
|
534
|
-
[
|
|
543
|
+
`lb-row-unplaced` is a state, not an event: it stays until the rows are
|
|
544
|
+
placed again; see
|
|
545
|
+
[Placing by hand](#placing-by-hand).
|
|
535
546
|
|
|
536
547
|
A row or a group that leaves loses `lb-row-live` or `lb-group-live`, takes
|
|
537
548
|
`lb-row-leaving` or `lb-group-leaving` and `inert`
|
|
@@ -580,9 +591,9 @@ insert form above: it sits inside `lb-query="roster"` so its request is for
|
|
|
580
591
|
|
|
581
592
|
The hub stamps every element that holds a row template with
|
|
582
593
|
`lb-query-row-count`, the number of live rows it shows. A row a filter
|
|
583
|
-
hides is not counted. Beside it, `lb-query-
|
|
584
|
-
rows out of
|
|
585
|
-
[
|
|
594
|
+
hides is not counted. Beside it, `lb-query-unplaced-count` is the number of
|
|
595
|
+
rows out of place; see
|
|
596
|
+
[Placing by hand](#placing-by-hand). An empty query is a stylesheet rule:
|
|
586
597
|
|
|
587
598
|
```html
|
|
588
599
|
<div lb-query="roster">
|
|
@@ -793,6 +804,10 @@ carrying `lb-request`:
|
|
|
793
804
|
3. The element is in a live row: every control in that live row.
|
|
794
805
|
4. Otherwise: every control whose form owner is the element's form owner.
|
|
795
806
|
|
|
807
|
+
A control that holds several values, a `<select multiple>` or a set of
|
|
808
|
+
checkboxes carrying `value`, gathers an array of strings; see
|
|
809
|
+
[Several values](./chrome.md#several-values).
|
|
810
|
+
|
|
796
811
|
The hub gathers from controls only, and skips a control that belongs to a
|
|
797
812
|
query nested inside the group, except that a form gathers the rows of a
|
|
798
813
|
query nested in its own; see [A form over a set of rows](#a-form-over-a-set-of-rows).
|
|
@@ -887,18 +902,66 @@ the master and its details together; see [crud](./page-files.md#crud). The
|
|
|
887
902
|
server checks that `rows` holds string keys and string values by query, and
|
|
888
903
|
ignores a request whose `rows` does not.
|
|
889
904
|
|
|
905
|
+
#### Rows not yet entered in a list
|
|
906
|
+
|
|
907
|
+
A detail the master does not have yet is entered with it. `--lb-new` aimed
|
|
908
|
+
at the nested list, rather than at a form, puts a row not yet entered into
|
|
909
|
+
it, and sends nothing:
|
|
910
|
+
|
|
911
|
+
```html
|
|
912
|
+
<form lb-query="flight" lb-request="lb-row-insert">
|
|
913
|
+
<input lb-column="code" />
|
|
914
|
+
<ul id="arrivals" lb-query="arrivals">
|
|
915
|
+
<template>
|
|
916
|
+
<li>
|
|
917
|
+
<input lb-column="gate" />
|
|
918
|
+
<input lb-column="qty" value="1" />
|
|
919
|
+
<button type="button" lb-request="lb-row-delete">Remove</button>
|
|
920
|
+
</li>
|
|
921
|
+
</template>
|
|
922
|
+
</ul>
|
|
923
|
+
<button type="button" commandfor="arrivals" command="--lb-new">Add arrival</button>
|
|
924
|
+
<button type="submit">Save</button>
|
|
925
|
+
</form>
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
- The row is a live row with the empty key, copied from the row template.
|
|
929
|
+
Its controls start at their HTML defaults, and its `lb-show` branches are
|
|
930
|
+
as for a row whose every column is null.
|
|
931
|
+
- It stands after every row of the list, in the order added, and is not
|
|
932
|
+
ordered, filtered or aggregated, since it holds no data. It counts in
|
|
933
|
+
`lb-query-row-count`.
|
|
934
|
+
- The form's submit carries it in `rows`, with `key: ""`, beside the rows on
|
|
935
|
+
record: an insert while the master is not on record, an update once it
|
|
936
|
+
is. The handler inserts each row with no key.
|
|
937
|
+
- Once the submit succeeds, the rows not yet entered leave, and the rows its
|
|
938
|
+
answer lands take their place. A refusal leaves them, with a column's
|
|
939
|
+
message on its control.
|
|
940
|
+
- A delete from one takes it out of the list and sends nothing, and an
|
|
941
|
+
update from one is not sent, as for any [row not yet
|
|
942
|
+
entered](#a-row-not-yet-entered).
|
|
943
|
+
|
|
944
|
+
The form needs a submit: a row not yet entered never sends on its own, so
|
|
945
|
+
one in a form that only saves control by control waits for nothing. The
|
|
946
|
+
list is a query nested directly in the form's own, as for any set of rows
|
|
947
|
+
the form gathers; the builder refuses `--lb-new` aimed at any other list.
|
|
948
|
+
Aimed at a `<form>`, `--lb-new` points the form, as below.
|
|
949
|
+
|
|
890
950
|
A nested query answers once for the page, so its rows are the same wherever
|
|
891
951
|
they show. The form enters a new master with its details, or edits the
|
|
892
952
|
master the page shows, whose details the nested query reads from the same
|
|
893
953
|
query parm. A form [pointed at a row](#editing-a-row-in-one-form) fills its
|
|
894
|
-
own controls from that row; its nested rows stay the nested query's answer
|
|
954
|
+
own controls from that row; its nested rows stay the nested query's answer,
|
|
955
|
+
so the pointed row's own details come as its columns.
|
|
895
956
|
|
|
896
957
|
### A row not yet entered
|
|
897
958
|
|
|
898
|
-
A row whose key is empty is a new one, not yet entered. It arises
|
|
899
|
-
a `row` query answers with an empty key, as one showing the master a
|
|
900
|
-
parm names does when the parm is empty
|
|
901
|
-
[Editing a row in one form](#editing-a-row-in-one-form))
|
|
959
|
+
A row whose key is empty is a new one, not yet entered. It arises three
|
|
960
|
+
ways: a `row` query answers with an empty key, as one showing the master a
|
|
961
|
+
query parm names does when the parm is empty; New points a form (see
|
|
962
|
+
[Editing a row in one form](#editing-a-row-in-one-form)); or New aimed at a
|
|
963
|
+
list adds one to it (see
|
|
964
|
+
[Rows not yet entered in a list](#rows-not-yet-entered-in-a-list)). Either way the
|
|
902
965
|
element carries `lb-key-value=""`.
|
|
903
966
|
|
|
904
967
|
| Request | From a row not yet entered |
|
|
@@ -984,7 +1047,7 @@ row. Buttons point it with HTML's `commandfor` and `command`:
|
|
|
984
1047
|
| Command | On a button | The hub |
|
|
985
1048
|
|----------------|-------------------------------------|---------------------------------------------|
|
|
986
1049
|
| `--lb-edit` | In a live row of the form's query | Fills the form from that row, keyed by it |
|
|
987
|
-
| `--lb-new` | Anywhere | Starts the form empty, for an insert
|
|
1050
|
+
| `--lb-new` | Anywhere | Starts the form empty, for an insert; aimed at a list, see [Rows not yet entered in a list](#rows-not-yet-entered-in-a-list) |
|
|
988
1051
|
| `--lb-release` | Anywhere | Lets the form go without saving |
|
|
989
1052
|
|
|
990
1053
|
HTML requires a custom command to begin with `--`.
|
|
@@ -1017,6 +1080,13 @@ round trip, including columns no element in the table shows. The user
|
|
|
1017
1080
|
edits a row they can see, so the row is on the page. A row that has to be
|
|
1018
1081
|
fetched to be edited is another page, with that row as its master.
|
|
1019
1082
|
|
|
1083
|
+
A pointed form edits what the row it points at holds. Details the form
|
|
1084
|
+
shows for that row come as columns of the row, one per detail when the
|
|
1085
|
+
details are a fixed set, or from a master the page shows by a query parm,
|
|
1086
|
+
whose nested query reads the same parm. A query nested in a pointed form
|
|
1087
|
+
shows the page's answer, whichever row the form points at; see
|
|
1088
|
+
[A form over a set of rows](#a-form-over-a-set-of-rows).
|
|
1089
|
+
|
|
1020
1090
|
Pointing a form first empties it: every column it names lands as null, and
|
|
1021
1091
|
the form resets, so each control returns to its default. Edit then lands
|
|
1022
1092
|
the row on the form, stamps the form with the row's key, so the form's
|
|
@@ -1044,11 +1114,9 @@ An `lb-show` in the form reads from the row it was pointed at. With no row,
|
|
|
1044
1114
|
every column is null, so `lb-show="!id"` shows only while entering a new
|
|
1045
1115
|
row.
|
|
1046
1116
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
[Rows the user is working in](#rows-the-user-is-working-in). A form New
|
|
1051
|
-
pointed is not inside any list, and its rows are placed by the order.
|
|
1117
|
+
The rows a form's answer lands are placed by the list's `lb-manual`, as any
|
|
1118
|
+
answer's are, whether the form was pointed by Edit or by New; see
|
|
1119
|
+
[Placing by hand](#placing-by-hand).
|
|
1052
1120
|
|
|
1053
1121
|
A successful request from the form lets it go, as Cancel does: the form
|
|
1054
1122
|
empties, its controls return to their defaults, and the stamps go. A failed
|
|
@@ -1324,7 +1392,7 @@ The developer writes `lb-` attributes in markup, and script never assigns
|
|
|
1324
1392
|
them. The builder checks the markup of the chrome and of every page, after
|
|
1325
1393
|
expansion, and refuses to build:
|
|
1326
1394
|
|
|
1327
|
-
- an `lb-` attribute that is not one of the
|
|
1395
|
+
- an `lb-` attribute that is not one of the eighteen the developer writes;
|
|
1328
1396
|
`lb-exp-slot` and `lb-exp-template` are consumed by expansion and never
|
|
1329
1397
|
reach the check
|
|
1330
1398
|
- `lb-request` naming an `lb-` request other than the three Loadbare provides
|
|
@@ -1341,16 +1409,24 @@ expansion, and refuses to build:
|
|
|
1341
1409
|
column, naming columns not separated by commas or one beginning `lb-`, or
|
|
1342
1410
|
with no row around it
|
|
1343
1411
|
- `lb-url-push` on an element without `lb-request`
|
|
1412
|
+
- `lb-column` on an element carrying `multiple`, or on a checkbox carrying
|
|
1413
|
+
`value`, with any query but `lb-url` around it: only a query parm holds
|
|
1414
|
+
several values
|
|
1344
1415
|
- `lb-url-unknown` on anything but a `<dialog>`, or outside `<lb-hub>`
|
|
1345
1416
|
- `lb-show` on a `<template>`, or on a row template's root
|
|
1346
1417
|
- `lb-show` with no `lb-query` around it
|
|
1347
1418
|
- `lb-show="!"` or `lb-show="!!column"`, which reverse no column
|
|
1348
1419
|
- `lb-order` or `lb-filter` on an element not carrying `lb-query`, or naming
|
|
1349
1420
|
no column
|
|
1421
|
+
- `lb-manual` on an element not carrying `lb-query`, or naming anything but
|
|
1422
|
+
`order`, `filter` or both
|
|
1350
1423
|
- `lb-select` on anything but `<input type="checkbox">`, outside a row
|
|
1351
1424
|
template, or beside `lb-column` or `lb-request`
|
|
1352
1425
|
- a `command` beginning `--lb-` that is not one of the four commands
|
|
1353
1426
|
- one of the four commands with no `commandfor`
|
|
1427
|
+
- `--lb-new` aimed at an element the markup holds that is neither a
|
|
1428
|
+
`<form>` nor a list carrying `lb-query` nested directly in a form's own
|
|
1429
|
+
query
|
|
1354
1430
|
- `lb-group` on anything but a `<template>`, or on one holding no
|
|
1355
1431
|
`<template>` for its contents
|
|
1356
1432
|
- an aggregate on a `<template>`, or any but `lb-count` naming no column
|
package/docs/reference/names.md
CHANGED
|
@@ -66,7 +66,7 @@ A widget package declares these. An application never does.
|
|
|
66
66
|
|
|
67
67
|
## Attributes
|
|
68
68
|
|
|
69
|
-
The developer writes
|
|
69
|
+
The developer writes eighteen attributes in pages and the chrome, and the
|
|
70
70
|
builder refuses any other `lb-` attribute there. `lb-exp-slot` and
|
|
71
71
|
`lb-exp-template` are written for expansion, which removes them before the
|
|
72
72
|
check. The hub and the builder write the rest, as stamps, and script never
|
|
@@ -79,6 +79,7 @@ assigns one.
|
|
|
79
79
|
| `lb-show` | Developer | [Conditional rendering](./data-binding.md#conditional-rendering) |
|
|
80
80
|
| `lb-order` | Developer | [Order](./data-binding.md#order) |
|
|
81
81
|
| `lb-filter` | Developer | [Filters](./data-binding.md#filters) |
|
|
82
|
+
| `lb-manual` | Developer | [Placing by hand](./data-binding.md#placing-by-hand) |
|
|
82
83
|
| `lb-group` | Developer | [Groups](./data-binding.md#groups) |
|
|
83
84
|
| `lb-count`, `lb-sum`, `lb-avg`, `lb-min`, `lb-max` | Developer | [Aggregates](./data-binding.md#aggregates) |
|
|
84
85
|
| `lb-select` | Developer | [Selecting rows](./data-binding.md#selecting-rows) |
|
|
@@ -93,7 +94,7 @@ assigns one.
|
|
|
93
94
|
| `lb-key-value` | Hub | [Landing](./data-binding.md#landing), [Editing a row in one form](./data-binding.md#editing-a-row-in-one-form) |
|
|
94
95
|
| `lb-row-live` | Hub | [Landing](./data-binding.md#landing) |
|
|
95
96
|
| `lb-query-row-count` | Hub | [Counting rows](./data-binding.md#counting-rows) |
|
|
96
|
-
| `lb-query-
|
|
97
|
+
| `lb-query-unplaced-count`, `lb-row-unplaced` | Hub | [Placing by hand](./data-binding.md#placing-by-hand) |
|
|
97
98
|
| `lb-query-order` | Hub | [Order](./data-binding.md#order) |
|
|
98
99
|
| `lb-group-live`, `lb-group-column`, `lb-group-value` | Hub | [Groups](./data-binding.md#groups) |
|
|
99
100
|
| `lb-row-created`, `lb-row-changed`, `lb-row-moved`, `lb-row-requested` | Hub | [What happened to a row](./data-binding.md#what-happened-to-a-row) |
|
|
@@ -138,9 +139,9 @@ Loadbare/app owns every value of HTML's `command` attribute beginning with
|
|
|
138
139
|
| Command | Defined in |
|
|
139
140
|
| -------------- | ------------------------------------------------------------------------ |
|
|
140
141
|
| `--lb-edit` | [Editing a row in one form](./data-binding.md#editing-a-row-in-one-form) |
|
|
141
|
-
| `--lb-new` | [Editing a row in one form](./data-binding.md#editing-a-row-in-one-form) |
|
|
142
|
+
| `--lb-new` | [Editing a row in one form](./data-binding.md#editing-a-row-in-one-form), [Rows not yet entered in a list](./data-binding.md#rows-not-yet-entered-in-a-list) |
|
|
142
143
|
| `--lb-release` | [Editing a row in one form](./data-binding.md#editing-a-row-in-one-form) |
|
|
143
|
-
| `--lb-
|
|
144
|
+
| `--lb-place` | [Placing by hand](./data-binding.md#placing-by-hand) |
|
|
144
145
|
|
|
145
146
|
## Reserved tags
|
|
146
147
|
|
|
@@ -199,7 +200,7 @@ imports them rather than writing a string.
|
|
|
199
200
|
| `ATTR_ROW_LIVE` | `lb-row-live` |
|
|
200
201
|
| `LIVE_ROW` | `[lb-row-live]`, the selector for a live row |
|
|
201
202
|
| `ATTR_QUERY_ROW_COUNT` | `lb-query-row-count` |
|
|
202
|
-
| `
|
|
203
|
+
| `ATTR_QUERY_UNPLACED_COUNT` | `lb-query-unplaced-count` |
|
|
203
204
|
| `ATTR_QUERY_ORDER` | `lb-query-order` |
|
|
204
205
|
| `ATTR_GROUP` | `lb-group` |
|
|
205
206
|
| `ATTR_GROUP_LIVE` | `lb-group-live` |
|
|
@@ -213,13 +214,15 @@ imports them rather than writing a string.
|
|
|
213
214
|
| `CHOICES_QUERY` | `lb-choices` |
|
|
214
215
|
| `ATTR_ORDER` | `lb-order` |
|
|
215
216
|
| `ATTR_FILTER` | `lb-filter` |
|
|
217
|
+
| `ATTR_MANUAL` | `lb-manual` |
|
|
218
|
+
| `MANUAL_ORDER`, `MANUAL_FILTER` | `order`, `filter`: the sides `lb-manual` names |
|
|
216
219
|
| `FILTER_OPERATORS` | Every filter operator, the longer first |
|
|
217
220
|
| `ATTR_ROW_CREATED` | `lb-row-created` |
|
|
218
221
|
| `ATTR_ROW_CHANGED` | `lb-row-changed` |
|
|
219
222
|
| `ATTR_ROW_MOVED` | `lb-row-moved` |
|
|
220
223
|
| `ATTR_ROW_REQUESTED` | `lb-row-requested` |
|
|
221
224
|
| `REQUESTED_CREATED`, `REQUESTED_CHANGED`, `REQUESTED_MOVED` | `created`, `changed`, `moved` |
|
|
222
|
-
| `
|
|
225
|
+
| `ATTR_ROW_UNPLACED` | `lb-row-unplaced` |
|
|
223
226
|
| `ATTR_ROW_LEAVING` | `lb-row-leaving` |
|
|
224
227
|
| `ATTR_GROUP_LEAVING` | `lb-group-leaving` |
|
|
225
228
|
| `ATTR_REQUEST` | `lb-request` |
|
|
@@ -229,7 +232,7 @@ imports them rather than writing a string.
|
|
|
229
232
|
| `ATTR_REQUEST_ERROR` | `lb-request-error` |
|
|
230
233
|
| `ATTR_REQUEST_REFUSED` | `lb-request-refused` |
|
|
231
234
|
| `LB_REFUSAL_STATUS` | `422` |
|
|
232
|
-
| `COMMAND_EDIT`, `COMMAND_NEW`, `COMMAND_RELEASE`, `
|
|
235
|
+
| `COMMAND_EDIT`, `COMMAND_NEW`, `COMMAND_RELEASE`, `COMMAND_PLACE` | `--lb-edit`, `--lb-new`, `--lb-release`, `--lb-place` |
|
|
233
236
|
| `LB_COMMANDS` | All four commands |
|
|
234
237
|
| `LB_COMMAND_PREFIX` | `--lb-` |
|
|
235
238
|
| `ATTR_ROW_EDITING` | `lb-row-editing` |
|
|
@@ -265,7 +268,7 @@ imports them rather than writing a string.
|
|
|
265
268
|
| `ATTR_EXP_TEMPLATE` | `lb-exp-template` |
|
|
266
269
|
| `ATTR_PAGE` | `lb-page` |
|
|
267
270
|
| `ATTR_PAGE_TITLE` | `lb-page-title` |
|
|
268
|
-
| `DEVELOPER_ATTRIBUTES` | The
|
|
271
|
+
| `DEVELOPER_ATTRIBUTES` | The eighteen attributes a developer writes |
|
|
269
272
|
| `HUB_TAG_NAME` | `lb-hub` |
|
|
270
273
|
| `LB_ENDPOINT` | `/lb` |
|
|
271
274
|
| `LB_REQUEST_TIMEOUT_MS` | `10000` |
|
|
@@ -273,8 +273,9 @@ reported and ignored. A declared request receives `keys` as it is.
|
|
|
273
273
|
`rows` holds the rows of a query nested in the form the request came from,
|
|
274
274
|
by query name, each with its `key` and the `values` of its own controls; see
|
|
275
275
|
[A form over a set of rows](./data-binding.md#a-form-over-a-set-of-rows).
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
A row with `key: ""` is one not yet entered, added by `--lb-new`; insert
|
|
277
|
+
it. The handler writes the master and its details together, deciding what
|
|
278
|
+
each row's values mean, such as an empty amount being no row at all:
|
|
278
279
|
|
|
279
280
|
```ts
|
|
280
281
|
rowInsert: {
|
|
@@ -382,8 +383,9 @@ one row dropped, one row edited — and leave `refresh` empty. A refreshed
|
|
|
382
383
|
A change that seems to need a refresh usually has a patch:
|
|
383
384
|
|
|
384
385
|
- A row whose position changes: the hub places it by the query's
|
|
385
|
-
[order](./data-binding.md#order), or leaves it where
|
|
386
|
-
|
|
386
|
+
[order](./data-binding.md#order), or leaves it where it stands under the
|
|
387
|
+
list's [`lb-manual`](./data-binding.md#placing-by-hand); a refresh would do
|
|
388
|
+
the same.
|
|
387
389
|
- A group that appears or goes: the hub makes a group with its first row
|
|
388
390
|
and removes it with its last, so no row stands in for an empty one.
|
|
389
391
|
- A row whose other columns change with the edit: re-read the row and patch
|
|
@@ -445,7 +447,9 @@ export const requests: Requests = {
|
|
|
445
447
|
```
|
|
446
448
|
|
|
447
449
|
A column other than `lb-path` is a query parm: set, or taken out when its
|
|
448
|
-
value is an empty string. Name at least one column, and give each a string
|
|
450
|
+
value is an empty string. Name at least one column, and give each a string,
|
|
451
|
+
or an array of strings to repeat the parm; see
|
|
452
|
+
[Several values](./chrome.md#several-values).
|
|
449
453
|
With `lb-path` naming another page, the page is entered with only the parms
|
|
450
454
|
named:
|
|
451
455
|
|
|
@@ -462,7 +466,8 @@ nothing else `run` returned is sent, since both answered for the URL the page
|
|
|
462
466
|
left. The loaded page reads the new parms through `contextFor`; see
|
|
463
467
|
[the Express server](./server.md#database-layer).
|
|
464
468
|
|
|
465
|
-
- A `url()` naming no column, or holding a value that is
|
|
469
|
+
- A `url()` naming no column, or holding a value that is neither a string
|
|
470
|
+
nor an array of strings, is
|
|
466
471
|
warned about on the server console and ignored, and the refresh set runs
|
|
467
472
|
as usual.
|
|
468
473
|
- If loading the page fails, the write has still happened. The response
|
package/docs/testing.md
CHANGED
|
@@ -208,9 +208,9 @@ evidence here.
|
|
|
208
208
|
- `lb-query-row-count` counts the rows showing, so all rows and a patch
|
|
209
209
|
ending in the same state report the same number, and a row a filter hides
|
|
210
210
|
is not counted
|
|
211
|
-
- the order
|
|
212
|
-
|
|
213
|
-
|
|
211
|
+
- the order and the filter place all rows and a patch alike, except where
|
|
212
|
+
the list's `lb-manual` leaves a side to the user, which keeps its rows
|
|
213
|
+
standing and stamped until they are placed again; groups come and go with
|
|
214
214
|
their rows to any depth, aggregates follow every landing, and every change
|
|
215
215
|
leaves a stamp a stylesheet can see (`lb-order.test.ts`)
|
|
216
216
|
- a filter's text reads and passes values as documented, and a choice of
|