viewkitjs 0.37.0 → 0.38.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/package.json +1 -1
  3. package/views/dist/contract.d.ts +6 -3
  4. package/views/dist/contract.js +4 -0
  5. package/views/dist/controls/field/looks.d.ts +1 -1
  6. package/views/dist/controls/field/looks.js +5 -3
  7. package/views/dist/controls/field.css +60 -1
  8. package/views/dist/controls/glyphs/glyphs.js +2 -0
  9. package/views/dist/controls/inline-input.css +3 -2
  10. package/views/dist/controls/internal/read-token.d.ts +2 -1
  11. package/views/dist/controls/internal/read-token.js +2 -1
  12. package/views/dist/controls/number-editor/tokens.d.ts +8 -0
  13. package/views/dist/controls/number-editor/tokens.js +2 -0
  14. package/views/dist/controls/number-editor.css +20 -0
  15. package/views/dist/controls/text-editor/tokens.d.ts +8 -0
  16. package/views/dist/controls/text-editor/tokens.js +2 -0
  17. package/views/dist/controls/text-editor.css +24 -2
  18. package/views/dist/controls/tooltip/tooltip.js +2 -1
  19. package/views/dist/field-row/FieldRow.js +15 -6
  20. package/views/dist/field-row/field-row-button.d.ts +12 -0
  21. package/views/dist/field-row/field-row-button.js +5 -0
  22. package/views/dist/fields/binding.d.ts +4 -0
  23. package/views/dist/grid/chrome/GridCellEditors.d.ts +1 -1
  24. package/views/dist/grid/chrome/GridCellOutline.d.ts +13 -1
  25. package/views/dist/grid/chrome/GridCellOutline.js +17 -0
  26. package/views/dist/grid/chrome/GridNumberEditor.js +2 -1
  27. package/views/dist/grid/chrome/GridRowCells.js +1 -1
  28. package/views/dist/grid/chrome/GridStructure.js +3 -3
  29. package/views/dist/grid/chrome/GridTextEditor.js +3 -1
  30. package/views/dist/grid/chrome/grid-body-place.js +2 -1
  31. package/views/dist/grid/chrome/grid-edit-session.d.ts +7 -3
  32. package/views/dist/grid/chrome/grid-edit-session.js +12 -3
  33. package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -4
  34. package/views/dist/grid/chrome/grid-row-props.d.ts +1 -1
  35. package/views/dist/grid/chrome/useGridKeyboard.d.ts +5 -1
  36. package/views/dist/grid/chrome/useGridKeyboard.js +9 -5
  37. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
  38. package/views/dist/grid/chrome/useGridTableInteractionModel.js +8 -3
  39. package/views/dist/internal/length.d.ts +2 -0
  40. package/views/dist/internal/length.js +16 -0
  41. package/views/dist/provider/components.d.ts +2 -1
  42. package/views/dist/selection/bar-overflow.d.ts +2 -0
  43. package/views/dist/selection/bar-overflow.js +2 -1
  44. package/views/dist/selection/bar-props.d.ts +1 -1
  45. package/views/dist/selection/verbs.d.ts +2 -2
  46. package/views/dist/styles.css +165 -5
  47. package/views/dist/styles.unlayered.css +165 -5
  48. package/views/docs/contract.md +9 -3
  49. package/views/docs/controls/number-editor.md +2 -0
  50. package/views/docs/controls/text-editor.md +2 -0
  51. package/views/docs/guides/selection.md +1 -1
  52. package/views/docs/guides/the-grid.md +1 -1
  53. package/views/docs/reference/field-row.md +1 -1
  54. package/views/docs/reference/looks.md +1 -1
  55. package/views/docs/reference/selection.md +1 -1
  56. package/views/docs/reference/views.md +1 -1
@@ -15,7 +15,7 @@ Guide: [selection](../guides/selection.md).
15
15
 
16
16
  ## The bar
17
17
 
18
- - `SelectionBar` — the bar a selection opens, portalled to the body and placed by the provider's `selectionBar`. On a desktop, an island: the count chip (a press clears the selection; its tooltip names Escape; ViewKit's own, or your `Button` with `selectionBar`'s `chip: "button"`), the first four verbs, the trash when `onDelete` is handed, a hairline and More, always drawn (when nothing spills into it, a Tab stop that opens nothing, `aria-disabled`, saying why in your `Tooltip`: `views.selection.more-none`), holding the rest (a group or an options verb opening its rows beside it). On a phone, a pill reading the count, Actions and ✕; Actions opens the `SelectionSheet` atom. It draws nothing while `count` is zero. Handed a `SelectionBar` in the components map (`CONTROLS`: the Outright bulk bar), it draws that one in its place instead, in the box that holds it, at every count; `noun` and `deleteLine` are for that bar.
18
+ - `SelectionBar` — the bar a selection opens, portalled to the body and placed by the provider's `selectionBar`. On a desktop, an island: the count chip (a press clears the selection; its tooltip names Escape; ViewKit's own, or your `Button` with `selectionBar`'s `chip: "button"`), the first four verbs not marked `more`, the trash when `onDelete` is handed, a hairline and More, always drawn (when nothing spills into it, a Tab stop that opens nothing, `aria-disabled`, saying why in your `Tooltip`: `views.selection.more-none`), holding the verbs marked `more`, then the rest (a group or an options verb opening its rows beside it). On a phone, a pill reading the count, Actions and ✕; Actions opens the `SelectionSheet` atom. It draws nothing while `count` is zero. Handed a `SelectionBar` in the components map (`CONTROLS`: the Outright bulk bar), it draws that one in its place instead, in the box that holds it, at every count; `noun` and `deleteLine` are for that bar.
19
19
  - `SelectionBarProps` — what `SelectionBar` takes: `count`, `onClear`, `verbs` (`SelectionVerb`s, in order), optional `busy` (disables every control), `onDelete` (the bar's own verb, the trailing trash; never a verb in `verbs`) and `deleteLabel` (the trash's name; default the `views.selection.delete` message).
20
20
  - `SelectionVerb` — one verb, as data: `{ kind: "action" }` with a `SelectionVerbItem`'s fields; `{ kind: "group", label, icon?, disabled?, disabledReason?, items }`, a button opening a menu of `SelectionVerbItem`s, whose rows that give no reason carry the group's; or a `SelectionOptionsVerb`.
21
21
  - `SelectionVerbItem` — an action: `label`, optional `icon` (your glyph), `onClick`, `destructive` (the danger colour), `disabled`, and `disabledReason`, why it is disabled: More's row, the bar's button and the phone's sheet carry it.
@@ -267,7 +267,7 @@ A binding says how one field reads and writes on one entity's row. Your app decl
267
267
  - what it binds and reads: `field`, the field; `read`, the display value (a relation reads its resolved value); and `editRead`, the stored value when it differs (a relation's id, the raw value behind a fallback);
268
268
  - how it writes: `write` maps a commit onto a `FieldPatch`, the request body or a refusal with the reason the surface shows, and absent, the field is never writable on any surface; `history`, a `FieldHistoryAdapter`, covers a write that also moves companion state;
269
269
  - what its editor needs: `unit`, a `FieldUnit`, for an amount whose code is the row's (the number editor's unit chip is a picker only with it); `region`, the record's country read off the row, where a phone typed without its country code is read (absent, the conventions' region); `relation`, a writable relation's candidates as a `RelationSource`; `create`, a relation's `RelationCellCreate` (refused on a member field, on any field but a relation, and without a `write`); `addOption`, a select's or multiselect's `OptionAdd`, which + Add in its cells and its field row asks for an option made from a typed word (refused on any other field and without a `write`; hand it only to the readers who may add, and `columnFrom` carries it to the column's `addOption`). A writable relation that stores refs or links binds, and the grid and a record's field row save it in its stored shape; a surface built on `RelationEditor` alone (a card, a form field) commits one bare id, so it can't save such a relation yet; and `labels: false` on a field holding several values that keeps only the values, so its editor offers no label box;
270
- - how it draws and totals: `icon`, your app's own icon name for the field, drawn by the host (the type's glyph when absent); and `ratio`, a ratio formula's two parts read off the row, which a footer sums.
270
+ - how it draws and totals: `icon`, your app's own icon name for the field, drawn by the host (the type's glyph when absent); `action` (`none`, `edit` or `expand`), the one icon a record's field row shows at its box's end under the Field's Action (`row-action: icon`), where absent the row answers by the field's type; and `ratio`, a ratio formula's two parts read off the row, which a footer sums.
271
271
  - `FieldBindingSpec` — a `FieldBinding` without its `field`: what `bindField` and `bindFields` take for each field.
272
272
  - `BoundFields` — what `bindFields` returns: a frozen binding for every key of the registry, each typed to its own field.
273
273
  - `FieldUnit` — a per-row unit: `read`, the row's code (the unit chip's value), and `options`, the codes the chip offers. With `rates`, the row's own multipliers into every readable currency, a surface may read the field in another currency: the binding then states every accessor in the row's own currency, never converted, and the list converts (`readMoneyColumn`). Without it the field is read in its own currency only.