viewkitjs 0.31.0 → 0.32.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 (289) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/MIGRATION.md +40 -6
  3. package/README.md +1 -1
  4. package/fields/dist/query/index.d.ts +2 -0
  5. package/fields/dist/query/index.js +2 -0
  6. package/fields/dist/query/list-request.d.ts +148 -0
  7. package/fields/dist/query/list-request.js +125 -0
  8. package/fields/dist/query/saved-view.d.ts +15 -0
  9. package/fields/dist/query/saved-view.js +11 -0
  10. package/fields/dist/query/settings.d.ts +9 -0
  11. package/fields/dist/query/settings.js +9 -0
  12. package/fields/docs/reference/query.md +66 -0
  13. package/package.json +5 -1
  14. package/postgres/README.md +1 -0
  15. package/postgres/dist/handler.d.ts +53 -0
  16. package/postgres/dist/handler.js +211 -0
  17. package/postgres/dist/ids.d.ts +1 -1
  18. package/postgres/dist/ids.js +19 -1
  19. package/postgres/dist/index.d.ts +1 -0
  20. package/postgres/dist/index.js +1 -0
  21. package/postgres/dist/limits.d.ts +3 -1
  22. package/postgres/dist/limits.js +1 -1
  23. package/postgres/dist/list-fields.d.ts +10 -0
  24. package/postgres/dist/list-fields.js +36 -0
  25. package/postgres/dist/readable.d.ts +4 -0
  26. package/postgres/dist/readable.js +4 -0
  27. package/postgres/dist/refusals.d.ts +9 -2
  28. package/postgres/dist/refusals.js +6 -0
  29. package/postgres/docs/guides/field-map.md +2 -2
  30. package/postgres/docs/guides/list-handler.md +99 -0
  31. package/postgres/docs/index.md +1 -0
  32. package/postgres/docs/reference/postgres.md +11 -3
  33. package/views/README.md +2 -2
  34. package/views/dist/atoms/RowMenu.d.ts +7 -0
  35. package/views/dist/atoms/RowMenu.js +18 -16
  36. package/views/dist/atoms/carried.d.ts +5 -0
  37. package/views/dist/atoms/carried.js +7 -0
  38. package/views/dist/atoms/types.d.ts +3 -0
  39. package/views/dist/contract.d.ts +26 -6
  40. package/views/dist/contract.js +25 -0
  41. package/views/dist/controls/alert-dialog/alert-dialog.js +2 -1
  42. package/views/dist/controls/atoms.d.ts +2 -0
  43. package/views/dist/controls/atoms.js +2 -0
  44. package/views/dist/controls/avatar/avatar.d.ts +3 -3
  45. package/views/dist/controls/avatar/avatar.js +1 -1
  46. package/views/dist/controls/avatar/tokens.d.ts +44 -0
  47. package/views/dist/controls/avatar/tokens.js +11 -0
  48. package/views/dist/controls/avatar.css +22 -5
  49. package/views/dist/controls/choice/tokens.d.ts +0 -4
  50. package/views/dist/controls/choice/tokens.js +0 -1
  51. package/views/dist/controls/choice.css +3 -3
  52. package/views/dist/controls/controls.d.ts +6 -0
  53. package/views/dist/controls/controls.js +10 -2
  54. package/views/dist/controls/customize/map-customize-body.js +1 -1
  55. package/views/dist/controls/field/field.d.ts +19 -4
  56. package/views/dist/controls/field/field.js +63 -5
  57. package/views/dist/controls/field/tokens.d.ts +4 -0
  58. package/views/dist/controls/field/tokens.js +1 -0
  59. package/views/dist/controls/field.css +41 -16
  60. package/views/dist/controls/glyphs/glyphs.d.ts +10 -0
  61. package/views/dist/controls/glyphs/glyphs.js +173 -0
  62. package/views/dist/controls/index.d.ts +2 -1
  63. package/views/dist/controls/index.js +2 -1
  64. package/views/dist/controls/input/input.js +5 -2
  65. package/views/dist/controls/input/tokens.d.ts +4 -0
  66. package/views/dist/controls/input/tokens.js +1 -0
  67. package/views/dist/controls/input.css +31 -3
  68. package/views/dist/controls/internal/icons.js +10 -0
  69. package/views/dist/controls/internal/keep-focus.d.ts +2 -0
  70. package/views/dist/controls/internal/keep-focus.js +17 -0
  71. package/views/dist/controls/internal/watch-frame.d.ts +2 -0
  72. package/views/dist/controls/internal/watch-frame.js +33 -0
  73. package/views/dist/controls/markdown/map-markdown.d.ts +4 -0
  74. package/views/dist/controls/markdown/map-markdown.js +5 -0
  75. package/views/dist/controls/menu/map-menu.js +2 -2
  76. package/views/dist/controls/menu-list/menu-list.d.ts +3 -0
  77. package/views/dist/controls/menu-list/menu-list.js +5 -4
  78. package/views/dist/controls/modal/modal.js +5 -1
  79. package/views/dist/controls/pane/pane.js +2 -1
  80. package/views/dist/controls/phone-header/header-bar.d.ts +5 -1
  81. package/views/dist/controls/phone-header/header-bar.js +2 -2
  82. package/views/dist/controls/phone-header.css +11 -1
  83. package/views/dist/controls/picker/map-picker.js +3 -0
  84. package/views/dist/controls/picker/picker.d.ts +14 -0
  85. package/views/dist/controls/picker/picker.js +30 -10
  86. package/views/dist/controls/picker.css +2 -0
  87. package/views/dist/controls/popover/popover.js +2 -1
  88. package/views/dist/controls/radio/radio.d.ts +5 -3
  89. package/views/dist/controls/radio/radio.js +18 -2
  90. package/views/dist/controls/radio/tokens.d.ts +44 -0
  91. package/views/dist/controls/radio/tokens.js +11 -0
  92. package/views/dist/controls/radio.css +79 -1
  93. package/views/dist/controls/select/select.d.ts +4 -0
  94. package/views/dist/controls/select/select.js +11 -5
  95. package/views/dist/controls/select/tokens.d.ts +8 -0
  96. package/views/dist/controls/select/tokens.js +2 -0
  97. package/views/dist/controls/select.css +17 -0
  98. package/views/dist/controls/setting-row/looks.d.ts +1 -1
  99. package/views/dist/controls/setting-row/looks.js +9 -4
  100. package/views/dist/controls/setting-row/setting-row.d.ts +45 -10
  101. package/views/dist/controls/setting-row/setting-row.js +82 -15
  102. package/views/dist/controls/setting-row/tokens.d.ts +74 -2
  103. package/views/dist/controls/setting-row/tokens.js +19 -1
  104. package/views/dist/controls/setting-row.css +135 -14
  105. package/views/dist/controls/sheet/bottom-sheet.d.ts +10 -2
  106. package/views/dist/controls/sheet/bottom-sheet.js +6 -3
  107. package/views/dist/controls/sheet.css +4 -1
  108. package/views/dist/controls/sort-editor/sort-editor.js +3 -2
  109. package/views/dist/controls/sort-editor.css +8 -2
  110. package/views/dist/controls/switch-row/tokens.d.ts +0 -12
  111. package/views/dist/controls/switch-row/tokens.js +0 -3
  112. package/views/dist/controls/switch-row.css +3 -7
  113. package/views/dist/controls/switch.css +17 -7
  114. package/views/dist/controls/tag/tag.d.ts +3 -1
  115. package/views/dist/controls/tag/tag.js +2 -2
  116. package/views/dist/controls/tag/tokens.d.ts +4 -0
  117. package/views/dist/controls/tag/tokens.js +1 -0
  118. package/views/dist/controls/tag-field/tag-field.d.ts +5 -1
  119. package/views/dist/controls/tag-field/tag-field.js +11 -5
  120. package/views/dist/controls/tag-field/tokens.d.ts +16 -0
  121. package/views/dist/controls/tag-field/tokens.js +4 -0
  122. package/views/dist/controls/tag-field.css +19 -0
  123. package/views/dist/controls/tag.css +2 -0
  124. package/views/dist/controls/toolbar/toolbar.d.ts +15 -3
  125. package/views/dist/controls/toolbar/toolbar.js +22 -15
  126. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +14 -0
  127. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +51 -0
  128. package/views/dist/controls/toolbar-button/toolbar-button.d.ts +1 -1
  129. package/views/dist/controls/toolbar-button/toolbar-button.js +2 -3
  130. package/views/dist/controls/toolbar-button.css +4 -0
  131. package/views/dist/controls/toolbar.css +5 -0
  132. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -0
  133. package/views/dist/controls/views-list/map-view-menu.js +25 -0
  134. package/views/dist/controls/views-list/map-views-list-body.d.ts +28 -1
  135. package/views/dist/controls/views-list/map-views-list-body.js +39 -21
  136. package/views/dist/controls/views-list/rules.d.ts +2 -0
  137. package/views/dist/controls/views-list/view-menu.d.ts +7 -0
  138. package/views/dist/controls/views-list/view-menu.js +28 -24
  139. package/views/dist/controls/views-list/words.d.ts +2 -0
  140. package/views/dist/controls/views-list/words.js +1 -1
  141. package/views/dist/editors/EditorPanel.js +2 -1
  142. package/views/dist/editors/edit-session.js +2 -5
  143. package/views/dist/field-row/FieldRow.d.ts +4 -2
  144. package/views/dist/field-row/FieldRow.js +67 -20
  145. package/views/dist/field-row/FieldRowLane.d.ts +7 -2
  146. package/views/dist/field-row/FieldRowLane.js +4 -3
  147. package/views/dist/field-row/editors/RowEditor.d.ts +12 -0
  148. package/views/dist/field-row/editors/RowEditor.js +31 -1
  149. package/views/dist/field-row/editors/RowValueListEditor.d.ts +5 -1
  150. package/views/dist/field-row/editors/RowValueListEditor.js +4 -1
  151. package/views/dist/field-row/field-row-button.d.ts +5 -0
  152. package/views/dist/field-row/field-row-button.js +2 -0
  153. package/views/dist/fields/binding.d.ts +3 -2
  154. package/views/dist/fields/binding.js +38 -5
  155. package/views/dist/grid/chrome/GridColumnMenu.d.ts +4 -2
  156. package/views/dist/grid/chrome/GridColumnMenu.js +3 -2
  157. package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -1
  158. package/views/dist/grid/chrome/GridGroupMenu.js +4 -3
  159. package/views/dist/grid/chrome/GridHeader.d.ts +4 -1
  160. package/views/dist/grid/chrome/GridHeader.js +2 -2
  161. package/views/dist/grid/chrome/GridRow.js +6 -5
  162. package/views/dist/grid/chrome/GridRowCells.js +6 -9
  163. package/views/dist/grid/chrome/GridStructure.d.ts +4 -1
  164. package/views/dist/grid/chrome/GridStructure.js +4 -4
  165. package/views/dist/grid/chrome/GridTable.js +5 -2
  166. package/views/dist/grid/chrome/grid-column-menu-items.js +1 -1
  167. package/views/dist/grid/chrome/grid-row-menu-items.d.ts +27 -3
  168. package/views/dist/grid/chrome/grid-row-menu-items.js +92 -6
  169. package/views/dist/grid/chrome/grid-row-props.d.ts +7 -2
  170. package/views/dist/grid/chrome/grid-rows-menu.js +34 -6
  171. package/views/dist/grid/chrome/grid-table-props.d.ts +38 -7
  172. package/views/dist/grid/chrome/useGridBatchApi.d.ts +3 -1
  173. package/views/dist/grid/chrome/useGridBatchApi.js +4 -2
  174. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -2
  175. package/views/dist/grid/chrome/useGridKeyboard.js +15 -9
  176. package/views/dist/grid/chrome/useGridPendingReconciliation.js +1 -2
  177. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
  178. package/views/dist/grid/chrome/useGridTableInteractionModel.js +11 -5
  179. package/views/dist/grid/core/commit-model.d.ts +20 -2
  180. package/views/dist/grid/core/editing-controller.d.ts +18 -0
  181. package/views/dist/grid/core/editing-controller.js +188 -42
  182. package/views/dist/grid/core/editing-model.d.ts +3 -0
  183. package/views/dist/grid/core/editing-model.js +3 -0
  184. package/views/dist/grid/core/save-path.d.ts +24 -0
  185. package/views/dist/grid/core/save-path.js +122 -0
  186. package/views/dist/grid/core/spreadsheet-operations.d.ts +3 -0
  187. package/views/dist/grid/core/spreadsheet-operations.js +23 -0
  188. package/views/dist/grid/index.d.ts +3 -2
  189. package/views/dist/grid/index.js +1 -0
  190. package/views/dist/internal/field-rows.d.ts +26 -0
  191. package/views/dist/internal/field-rows.js +8 -0
  192. package/views/dist/internal/page-close.d.ts +7 -0
  193. package/views/dist/internal/page-close.js +43 -0
  194. package/views/dist/list/browser-views-store.d.ts +10 -0
  195. package/views/dist/list/browser-views-store.js +182 -0
  196. package/views/dist/list/index.d.ts +23 -0
  197. package/views/dist/list/index.js +8 -0
  198. package/views/dist/list/menu.d.ts +31 -0
  199. package/views/dist/list/menu.js +76 -0
  200. package/views/dist/list/parts.d.ts +6 -0
  201. package/views/dist/list/parts.js +59 -0
  202. package/views/dist/list/registry.d.ts +11 -0
  203. package/views/dist/list/registry.js +31 -0
  204. package/views/dist/list/root.d.ts +40 -0
  205. package/views/dist/list/root.js +128 -0
  206. package/views/dist/list/slot.d.ts +14 -0
  207. package/views/dist/list/slot.js +22 -0
  208. package/views/dist/list/source.d.ts +11 -0
  209. package/views/dist/list/source.js +31 -0
  210. package/views/dist/list/store.d.ts +87 -0
  211. package/views/dist/list/store.js +115 -0
  212. package/views/dist/list/toolbar.d.ts +6 -0
  213. package/views/dist/list/toolbar.js +359 -0
  214. package/views/dist/list/views-axis.d.ts +5 -0
  215. package/views/dist/list/views-axis.js +96 -0
  216. package/views/dist/list/views-store.d.ts +41 -0
  217. package/views/dist/list/views-store.js +1 -0
  218. package/views/dist/list/views.d.ts +67 -0
  219. package/views/dist/list/views.js +400 -0
  220. package/views/dist/model/preferences.js +1 -1
  221. package/views/dist/model/prefs-buckets.js +1 -1
  222. package/views/dist/panels/index.d.ts +3 -1
  223. package/views/dist/panels/index.js +1 -0
  224. package/views/dist/panels/react/customize-body.js +1 -0
  225. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +41 -4
  226. package/views/dist/panels/react/toolbar/ReadyToolbar.js +6 -326
  227. package/views/dist/panels/react/toolbar/Toolbar.d.ts +9 -1
  228. package/views/dist/panels/react/toolbar/Toolbar.js +34 -23
  229. package/views/dist/panels/react/toolbar/ToolbarButton.js +4 -1
  230. package/views/dist/panels/react/toolbar/ToolbarNew.js +1 -1
  231. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +2 -2
  232. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +3 -1
  233. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  234. package/views/dist/panels/react/toolbar/context.d.ts +10 -2
  235. package/views/dist/panels/react/toolbar/context.js +3 -1
  236. package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +1 -1
  237. package/views/dist/panels/react/views-row/FoldingViewRow.js +15 -4
  238. package/views/dist/panels/react/views-row/PillGroup.d.ts +5 -2
  239. package/views/dist/panels/react/views-row/PillGroup.js +16 -7
  240. package/views/dist/panels/react/views-row/ViewPicker.js +2 -12
  241. package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +4 -2
  242. package/views/dist/panels/react/views-row/ViewPickerRow.js +9 -5
  243. package/views/dist/panels/react.d.ts +2 -2
  244. package/views/dist/panels/toolbar/edit-view.d.ts +7 -1
  245. package/views/dist/panels/toolbar/edit-view.js +14 -0
  246. package/views/dist/panels/toolbar/model.d.ts +5 -0
  247. package/views/dist/panels/toolbar/model.js +7 -3
  248. package/views/dist/panels/view-state.d.ts +5 -3
  249. package/views/dist/panels/views-row/model.d.ts +19 -2
  250. package/views/dist/panels/views-row/model.js +14 -0
  251. package/views/dist/provider/ViewsProvider.d.ts +16 -7
  252. package/views/dist/provider/ViewsProvider.js +23 -5
  253. package/views/dist/provider/components.d.ts +43 -2
  254. package/views/dist/provider/context.d.ts +2 -1
  255. package/views/dist/provider/context.js +1 -1
  256. package/views/dist/provider/ports.d.ts +19 -12
  257. package/views/dist/provider/ports.js +69 -1
  258. package/views/dist/react.d.ts +1 -1
  259. package/views/dist/styles.css +418 -59
  260. package/views/dist/styles.unlayered.css +418 -59
  261. package/views/docs/contract.md +42 -31
  262. package/views/docs/controls/avatar.md +11 -0
  263. package/views/docs/controls/choice.md +0 -1
  264. package/views/docs/controls/field.md +3 -0
  265. package/views/docs/controls/input.md +1 -0
  266. package/views/docs/controls/radio.md +16 -1
  267. package/views/docs/controls/select.md +2 -0
  268. package/views/docs/controls/setting-row.md +18 -0
  269. package/views/docs/controls/switch-row.md +0 -3
  270. package/views/docs/controls/tag-field.md +4 -0
  271. package/views/docs/controls/tag.md +1 -0
  272. package/views/docs/getting-started.md +2 -2
  273. package/views/docs/guides/atoms.md +2 -2
  274. package/views/docs/guides/columns.md +1 -1
  275. package/views/docs/guides/ports.md +1 -1
  276. package/views/docs/guides/the-grid.md +34 -7
  277. package/views/docs/guides/the-provider.md +4 -2
  278. package/views/docs/index.md +1 -0
  279. package/views/docs/reference/controls.md +35 -25
  280. package/views/docs/reference/editors-session.md +1 -1
  281. package/views/docs/reference/field-row.md +9 -1
  282. package/views/docs/reference/grid.md +14 -8
  283. package/views/docs/reference/list.md +227 -0
  284. package/views/docs/reference/looks.md +1 -1
  285. package/views/docs/reference/panels-react.md +17 -12
  286. package/views/docs/reference/panels.md +8 -5
  287. package/views/docs/reference/react.md +11 -9
  288. package/views/docs/reference/views.md +2 -2
  289. package/views/skills/views/SKILL.md +9 -6
@@ -161,9 +161,9 @@ A list whose rows come a page at a time from a database runs the same view there
161
161
  The header's menu offers Sort ascending, Sort descending and Clear sort, and Group by and Ungroup; on a place column Sort ascending and Sort descending each open its parts beside the menu (City, Region, Country, Postal code), and the pick is the part key `partKey(fieldKey, part)`, which you read with `parsePartKey`; a group's band offers its own Sort rows. The grid holds none of that state: it shows what you hand it and calls you with what the person picked.
162
162
 
163
163
  - `sort`, a `GridSortState`: the sort key in force (`value`, a place's part key while a place sorts by one of its parts), its direction (`dir`, `"asc"` or `"desc"`), and `onChange`, called with the pick. Clear sort calls it with an empty `value`.
164
- - `groupBy`, a `GridGroupByState`: the field key the list is grouped by, or `null`, and `onChange`, called with a field key, or `null` to ungroup.
164
+ - `groupBy`, a `GridGroupByState`: the field key the list is grouped by, or `null`, and `onChange`, called with a field key, or `null` to ungroup. Handed, the header offers Group by on every field whose type can split a list, and Ungroup on the one in force, wherever you keep the group: a saved view, the page's address, the page's own state.
165
165
  - `sortOptions`, the `GridGroupSortOption`s a group's band offers: each a sort key, its label and the direction it opens in.
166
- - `viewBacked`: the list is a saved view over your fields. The header then offers Sort on every bound column (a column with a declared `sortKey` offers it anywhere) and Group by on every field whose type can split a list.
166
+ - `viewBacked`: the list is a saved view over your fields. The header then offers Sort on every bound column (a column with a declared `sortKey` offers it anywhere). It doesn't decide Group by: `groupBy` does.
167
167
 
168
168
  `sortableColumns` from the root door lists the keys a saved view can sort by, one per key in the columns' order, and `sortDirFor` the direction a field opens in: a number, a date or a yes/no largest or newest first, text and options A to Z.
169
169
 
@@ -240,10 +240,10 @@ Collapsing is yours too: `isCollapsed` answers for a group's key and `onToggleGr
240
240
 
241
241
  ## Writes
242
242
 
243
- Editing turns on with `onCellCommit`: without it the grid is read-only, and invites no edit. It is called with the row, the column's id, the value the editor committed and, for an undo or a redo, a `GridCommitContext`. An editor still open when the page goes (`pagehide`) or the grid goes while the page stays commits as a press outside would, so it can be called inside `pagehide`: send a write that must outlive the page with `keepalive`. The grid shows the value at once and keeps it while the write runs; how your function ends decides what happens next.
243
+ Editing turns on with `onCellCommit`: without it the grid is read-only, and invites no edit. It is called with the row, the column's id, the value the editor committed and, for an undo or a redo or any write sent while the page goes, a `GridCommitContext` (`closing: true` on the latter: send it with `keepalive`, every one of them started inside the call, or a request still waiting for a connection is dropped with the page; the grid reference's `ListChange` says why). An editor still open when the page goes (`pagehide`) or the grid goes while the page stays commits as a press outside would, so it can be called inside `pagehide`: send a write that must outlive the page with `keepalive`. The grid shows the value at once and keeps it while the write runs; how your function ends decides what happens next.
244
244
 
245
245
  - It resolves with nothing, or `{ status: "confirmed" }`: the write landed, and ⌘Z can undo it. `history: { prev, next }` records what undo and redo put back, when what was stored is not what the cell sent; `history: false` keeps no step for this write. `settlement: "requested"` says the row holds the value but the provider behind it has not accepted it yet: the cell keeps its value and wears the pending look until your rows carry it.
246
- - It resolves with `{ status: "confirmed", stored }`: the write landed, but what your server kept isn't what the cell sent (it stripped an invisible character, read a label as its key, kept `""` as `null`). `stored` is the value as your rows will read it in this column. The cell shows it at once in place of what was typed, ⌘Z restores from it (unless `history` says otherwise), and when your rows carry it the cell clears without a "changed elsewhere". Leave `stored` out and nothing changes: the cell holds what was typed until your rows carry exactly that. On an undo or a redo it is ignored.
246
+ - It resolves with `{ status: "confirmed", stored }`: the write landed, but what your server kept isn't what the cell sent (it stripped an invisible character, read a label as its key, kept `""` as `null`). `stored` is the value as your rows will read it in this column. The cell shows it at once in place of what was typed, ⌘Z restores from it (unless `history` says otherwise), and when your rows carry it the cell clears without a "changed elsewhere". Leave `stored` out and nothing changes: the cell holds what was typed until your rows carry exactly that. On an undo or a redo the cell shows it until your rows carry it, and the history is left as it was.
247
247
  - It resolves with `{ status: "unconfirmed", history: false }`: nothing says the write landed, and it leaves no step to undo.
248
248
  - It rejects (or throws): the cell rolls back to the value it held. Never swallow a failed request, since the rejection is what rolls the cell back.
249
249
 
@@ -392,13 +392,13 @@ function DealsWithPrefs({ onOpen }: { onOpen: (deal: Deal) => void }) {
392
392
  }
393
393
  ```
394
394
 
395
- The columns' widths, order and visibility travel as `columnState`, a `ListColumnState` (`widths` by column id, `hidden` ids, `visible` ids of columns hidden by default that the person turned on, and `order`), and every change as `onColumnStateChange`; `gridProps` carries both. Resizing, moving and hiding a column, and the header's "+ Add column", which lists the hidden columns, appear only where `onColumnStateChange` is passed, since there would be nowhere to keep them. `renderAddColumn` replaces that last cell (or the + in the title's header, under `addColumnAt`) with your own; answering `null` draws none and keeps no room for it, so column state needs no Add column. Your rows (Edit field, say) stand in a column's menu above Hide. Hand them as data through `columnMenuItems(fieldKey)`, keyed apart from the grid's own (it is called while the grid renders, for every column, so keep it pure and cheap). `renderColumnMenuRows` is deprecated and read by nothing: a row drawn as a node has nowhere to stand in your `Menu`. On a phone the header ends with nothing unless you pass `addColumnOnPhone`: then "+ Add column" ends it there too, its list in your `Menu`, where a person brings back a column they hid on the phone. To keep it in reach while the columns scroll, pass `addColumnAt: "title"`: it stands as a lone + at the right edge of the title column's header (pinned with `freezeIdentity`), and the header's end keeps no room for it; with no title column shown it stays at the end.
395
+ The columns' widths, order and visibility travel as `columnState`, a `ListColumnState` (`widths` by column id, `hidden` ids, `visible` ids of columns hidden by default that the person turned on, and `order`), and every change as `onColumnStateChange`; `gridProps` carries both. Resizing, moving and hiding a column, and the header's "+ Add column", which lists the hidden columns, appear only where `onColumnStateChange` is passed, since there would be nowhere to keep them. `renderAddColumn` replaces that last cell (or the + in the title's header, under `addColumnAt`) with your own; answering `null` draws none and keeps no room for it, so column state needs no Add column. Your rows (Edit field, say) stand in a column's menu above Hide. Hand them as data through `columnMenuItems(fieldKey)`, keyed apart from the grid's own (it is called while the grid renders, for every column, so keep it pure and cheap). To drop, rename or move the grid's own rows too, hand `menus.column` ([Menus as data](../reference/list.md#menus-as-data)). On a phone the header ends with nothing unless you pass `addColumnOnPhone`: then "+ Add column" ends it there too, its list in your `Menu`, where a person brings back a column they hid on the phone. To keep it in reach while the columns scroll, pass `addColumnAt: "title"`: it stands as a lone + at the right edge of the title column's header (pinned with `freezeIdentity`), and the header's end keeps no room for it; with no title column shown it stays at the end.
396
396
 
397
397
  ### A column per part
398
398
 
399
399
  With `parts`, a name, a place or a range offers a column per part beside its whole column: a place's country, region, city and postal code, a name's given and family names, a range's low and high ends. Each starts hidden; "+ Add column" lists a field with parts as one group beside your `Menu`, holding the field (when hidden) and its hidden parts, its count as `detail`, as Attio's does, on a phone too. A part column's id is `partKey(columnId, part)`, the key its Filter row has when your panels pass `parts: true`, so that row filters what the column shows; its sort value is `partKey(fieldKey, part)`, which `parsePartKey` turns into a sort's `fieldKey` and `by`. It reads and copies its part, and it edits and pastes as its part, in a box of its own: text for a name's part and a place's region, city and postal code, a number for a range's end, and the select over every country by name, searchable, for a place's country. A paste or a fill into a country cell takes a country's name, in the app's names language (the conventions' `language`), its locale or English, or its code. A part is locked, refused and read-only as its whole is, and it may be emptied unless its whole declares `clearable: false`; emptying the last part is judged by the field. A box refuses a value the whole field would refuse, such as a range's low end above its high end, and stays open with the field's reason. Your `onCellCommit` and `onCellsCommit` receive the whole column's id and the whole value with that part replaced, so a place keeps its other parts, a range its other end and a name its other part. A name's full name follows its given or family name only when it was empty or exactly the two joined by a space; "Nagy Imre" is kept. A place's other country clears its region and its code, and another region clears its code. A paste over two parts of one field in one row lands as one edit of the whole, and a part edit made while the field's earlier ones are still in flight builds on them. Like every composite value's, the commit goes without a pending overlay; the refetch repaints. Escape in a part's box follows the box's own type, text or number, not the field's, so `escape={{ name: "keep" }}` on the provider does not reach a given name's box. A place field limited to some `parts` offers part columns only for those. Its menu offers no Group row. Keep part columns out of your panels: they belong to the grid, and your panels take the columns you declare.
400
400
 
401
- `gridProps` also carries the per-person switches: `verticalBorders`, `showRowIcon` (the `rowIcon` you declare, in the title cell), `freezeIdentity` (every column through the title pinned at the left edge; off in `LIST_VIEW_PREF_DEFAULTS`, so start your prefs with `gridFreezeIdentity: true` to open it on), `alwaysCheckboxes` and `scale`, the density. Every row is one height, and a cell's text stays on one line.
401
+ `gridProps` also carries the per-person switches: `verticalBorders`, `showRowIcon` (the `rowIcon` you declare, in the title cell), `freezeIdentity` (every column through the title pinned at the left edge; on by default, on the bare grid and in `LIST_VIEW_PREF_DEFAULTS` alike, so start your prefs with `gridFreezeIdentity: false` to open it unpinned), `alwaysCheckboxes` and `scale`, the density. Every row is one height, and a cell's text stays on one line.
402
402
 
403
403
  `fillWidth` is your app's choice, not a preference `gridProps` carries. On, the columns share the grid's whole width: each grows in proportion to its own width and never gets narrower than it, the header, the rows, the footer and a group's head alike, and while any column grows "+ Add column" stands right after the last one. A table already wider than the grid draws and scrolls sideways as it does without it. A column with a width set, by the person's resize or by the view, keeps it while the others take the rest, and a double-click on its edge clears a width the person set, giving it back its share; a column that declares `grid.maxWidth` keeps its own width. When no column can grow, the space after the last one stays empty, as without the option.
404
404
 
@@ -474,6 +474,31 @@ function DealsWithDrawer() {
474
474
 
475
475
  The row's menu opens on a right-click and from the row's ⋯ at its end. It holds the cell's Copy, Cut, Paste and Clear (a disabled one says why as its `disabledReason`: the column's own reason, nothing to paste, or the paste's refusal), the rows your `rowMenu` builds, and Delete when you pass `onRowDelete`. Delete asks your `confirm` port first, with `deleteLabel` as what is deleted, and a delete that rejects says so through your toast port. `contextMenu` replaces `rowMenu` on right-click when the two must differ.
476
476
 
477
+ When a row's verbs depend on the row and your server says which (who may delete it, what it may still become), answer them as its menu opens with `menus.row`: it is handed the menu's rows, Open page (`row-open`) and Delete (`row-delete`) among them, and the row, and may hand back a promise. It is asked once each time a row's menu opens, never for a row drawn or pressed, so a page of fifty rows asks nothing until a person opens one. While it waits, the menu holds one greyed row with your `loading` glyph, "Loading…", and nothing the answer may take away; an answer a later opening has outrun is dropped, and one that fails draws the grid's own rows. Drop `row-delete` for a row the reader may not delete:
478
+
479
+ ```tsx
480
+ import { menu } from "viewkitjs/views/list";
481
+
482
+ /** Your server's answer for one record: may this reader delete it? */
483
+ declare function mayDeleteDeal(id: string): Promise<boolean>;
484
+
485
+ function DealsDeletedPerRow({ onOpen }: { onOpen: (deal: Deal) => void }) {
486
+ return (
487
+ <GridTable
488
+ groups={allDeals}
489
+ grouped={false}
490
+ getRowId={(deal) => deal.id}
491
+ columns={columns}
492
+ onOpenRow={onOpen}
493
+ onRowDelete={deleteDeal}
494
+ menus={{
495
+ row: async (items, { row }) => ((await mayDeleteDeal(row.id)) ? items : menu.drop(items, "row-delete")),
496
+ }}
497
+ />
498
+ );
499
+ }
500
+ ```
501
+
477
502
  `onOpenRelation` makes relation chips open what they point at; it receives the chip's value, so `value.entity` says which kind of record to open. Without it, a chip goes where your `RelationLink` atom says ([atoms](atoms.md)). `entityIcon` gives each kind of record its glyph in relation cells that carry none.
478
503
 
479
504
  A field whose changes carry rules of their own (a lost deal needs a reason) is changed through verbs, not an editor: its column is a `command` column, and its cell opens the verbs `commands` names for its field key. The same map serves a record's panel and a card, so each verb is declared once. Without it, a command column is a read-only badge.
@@ -537,6 +562,8 @@ assert.equal(fieldKeyOf(valueColumn), "value");
537
562
 
538
563
  Three layers decide whether a cell may be written, and each only takes away from the one before: the column's declaration, your workspace's settings for the list, and a person's preferences. The settings are a `ListSettingsConfig` you store and hand the grid as `listConfig`: `readOnly` for the whole list, or a lock per field under `columns`. A locked column refuses every write, by every route, and still sorts, hides and resizes; a read-only list says so with a badge in its header. `toggleListColumnLock` and `toggleListReadOnly` build the config, sparse.
539
564
 
565
+ A reader who may edit some records and not others is answered per row: hand the grid `rowWritable`, `(row) => boolean`. A row it refuses opens no editor and takes no typing, paste, fill, clear, cut or bulk-bar write, its cells marked `aria-readonly` and a person's try answered "Cell is read-only"; a range over it writes the other rows and says how many cells it refused. It only takes away, and your API still guards its own writes.
566
+
540
567
  ```tsx
541
568
  import {
542
569
  columnEffectiveWritable,
@@ -612,7 +639,7 @@ On a phone the rail is as wide as your gutter, so with none it shows no box. Pas
612
639
 
613
640
  **Which editor.** A column marked `editable` mounts the editor its type names, as `gridEditorKind` answers; a single email or domain mounts the value list holding one value where the provider's `oneValue` says `list` for its type. A column carrying `multiple` (several emails, phones, links or domains) mounts the value list editor and pastes as a list; on any other type `multiple` mounts nothing. `editable` on a type with no editor mounts nothing.
614
641
 
615
- **Two questions, not one.** `gridColumnHasEditor` answers whether a column mounts an editor: what a click on the focused cell, a double-click, Enter and typing ask. `columnWritable` answers whether it can be written at all, by any route: an editor, Delete, Clear, a fill, a paste, a boolean's own button. It refuses a derived (`custom`) or `command` column first. A boolean has no editor and is still writable. The grid asks `columnEffectiveWritable`, which adds the list's locks, and so should anything of yours that gates a write.
642
+ **Two questions, not one.** `gridColumnHasEditor` answers whether a column mounts an editor: what a click on the focused cell, a double-click, Enter and typing ask. `columnWritable` answers whether it can be written at all, by any route: an editor, Delete, Clear, a fill, a paste, a boolean's own button. It refuses a derived (`custom`) or `command` column first. A boolean has no editor and is still writable. The grid asks `columnEffectiveWritable`, which adds the list's locks, and so should anything of yours that gates a write; a row your `rowWritable` refuses is refused on top of it.
616
643
 
617
644
  ```ts
618
645
  import { gridColumnHasEditor, gridEditorKind, gridNormalizeWrite } from "viewkitjs/views";
@@ -4,7 +4,7 @@ Every view reads what it takes from its app, other than its own props, from one
4
4
 
5
5
  ## Mount it once
6
6
 
7
- `ViewsProvider` sits once at your app's client root, above every view. It takes four things and the children: `components` (your primitives), `icons` (your glyphs by meaning), `ports` (your haptics, clipboard and per-device store, and, optionally, a toast and a confirm dialog; [ports](ports.md)) and `conventions`. Ten more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `severalValues`, `selectionBar` and `datePicks`.
7
+ `ViewsProvider` sits once at your app's client root, above every view. It needs one thing and the children: `components` (your primitives; `components={CONTROLS}` is ViewKit's own, every slot filled). Three more have defaults, so you hand them only to draw your own: `icons` (your glyphs by meaning; absent, each drawn through your `AppIcon` by its name, which `CONTROLS.AppIcon` draws with ViewKit's own glyphs), `ports` (your haptics, clipboard, per-device store, toast and confirm dialog, each optional; [ports](ports.md)) and `conventions` (absent, `en-US` in `UTC`). Ten more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `severalValues`, `selectionBar` and `datePicks`.
8
8
 
9
9
  `desktopQuery` says which screens are desktops: there an editor opens as a popover, and elsewhere as a sheet; so do the toolbar's panels and the views picker outside a `Toolbar` (inside one, the toolbar's phone form decides), and the grid's own chrome: a row's and a group's ⋯ and the row actions show on hover on a desktop, and a row's and a group's ⋯ always elsewhere, where the row actions don't show. It defaults to `DEFAULT_DESKTOP_QUERY`, `(min-width: 1024px)`; hand in the query your own shell switches on, so the editors and your layout change at the same width. A server render counts as a desktop.
10
10
 
@@ -59,7 +59,7 @@ The provider hands its views one value for each distinct set of inputs, so pass
59
59
 
60
60
  ## Conventions
61
61
 
62
- `conventions` is the same `FieldConventions` object you hand `viewkitjs/fields`. Every value a view draws reads through it: numbers, dates and durations in its `locale`, instants in its `timeZone`, a phone of its `region` written as at home. Fields' own words, such as how long ago something was, resolve through its `messages`; only the strings the views package owns go through the provider's `messages` (below).
62
+ `conventions` is the same `FieldConventions` object you hand `viewkitjs/fields`; hand none and the provider reads `en-US` in `UTC`, one object, the same on the server and in the browser. Every value a view draws reads through it: numbers, dates and durations in its `locale`, instants in its `timeZone`, a phone of its `region` written as at home. Fields' own words, such as how long ago something was, resolve through its `messages`; only the strings the views package owns go through the provider's `messages` (below).
63
63
 
64
64
  A request that carries its own locale adds it with `with`, which returns a new object and keeps everything it doesn't name:
65
65
 
@@ -331,6 +331,8 @@ The contract's [Writing an adapter](../contract.md#writing-an-adapter) holds the
331
331
 
332
332
  The rendering asks for its glyphs by what they mean (`sortAsc`, `relation`, `more`, `warning`), never by a library's name. `ICON_NAMES`, from `viewkitjs/views`, lists them all, and `ViewsIcons` is a record with one component per name, each taking a `className`. Because it is a full record, a meaning the contract adds fails your compile until you map it.
333
333
 
334
+ Hand none and the provider draws each meaning through your components map's `AppIcon` by its name: `CONTROLS.AppIcon` draws ViewKit's own glyphs, Tabler's as the Outright kit draws them (`CONTROL_ICONS`, from `viewkitjs/views/controls`). An app with icons of its own maps them as below; one with its own `AppIcon` that keeps ViewKit's glyphs hands `icons={CONTROL_ICONS}`.
335
+
334
336
  Most libraries name many of these the same way; spell out the ones yours names differently.
335
337
 
336
338
  ```tsx
@@ -55,3 +55,4 @@ One page per door. Each lists every name the door exports.
55
55
  - [`viewkitjs/views/controls`](reference/controls.md): ViewKit's default controls on Base UI, the Button and the Spinner, and `CONTROLS` for the components map
56
56
  - [`viewkitjs/views/panels`](reference/panels.md): what a list's panels read and say, built from its settings, and the toolbar's arrangement, with no React
57
57
  - [`viewkitjs/views/panels/react`](reference/panels-react.md): the panels as they draw, the toolbar's frame, its parts and the ready toolbar
58
+ - [`viewkitjs/views/list`](reference/list.md): a list's source, the request it sends and the answer it reads; its root, which holds its state, and the toolbar that reads it
@@ -4,7 +4,8 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
4
4
 
5
5
  ## The defaults
6
6
 
7
- - `CONTROLS` — the components map's defaults, for each control an app leaves out: each control below that fills a slot of the map. An app spreads it first and its own controls after, `components={{ ...CONTROLS, ...own }}`. Its `Button` draws ViewKit's buttons (`variant`, `size`) as the kit's Button's kinds and sizes, stands a glyph handed before the words as the Button's icon, and one handed after them as its end icon.
7
+ - `CONTROLS` — the components map's defaults, for each control an app leaves out: each control below that fills a slot of the map. An app spreads it first and its own controls after, `components={{ ...CONTROLS, ...own }}`. Handed as it stands, `components={CONTROLS}`, it brings `CONTROL_ATOMS` too, under the provider's `atoms`; a map spread from it brings none. Its `Button` draws ViewKit's buttons (`variant`, `size`) as the kit's Button's kinds and sizes, stands a glyph handed before the words as the Button's icon, and one handed after them as its end icon. Its `AppIcon` draws ViewKit's own glyph of each name (`CONTROL_ICONS`), and nothing for a name it doesn't draw; a provider handed no `icons` draws every meaning through it. Its `Markdown` draws the stored text as it stands, its line breaks kept, with no renderer.
8
+ - `CONTROL_ICONS` — ViewKit's default glyphs by meaning, a `ViewsIcons` over every `ICON_NAMES` meaning, each a Tabler icon as the Outright kit draws it (a line of 2 in the colour of its words; the carets filled; `loading` the Spinner): what `CONTROLS.AppIcon` draws, for an app with an `AppIcon` of its own that keeps ViewKit's glyphs, `icons={CONTROL_ICONS}`.
8
9
  - `leadingGlyph` — `leadingGlyph(children, glyphs)`: a glyph before a button's words (an svg, or one of the app's icons or its `AppIcon` in `glyphs`) as `icon`, one after them as `iconEnd`, and the words as `label`; a glyph alone, or another component, stays `{ label }`.
9
10
 
10
11
  <!-- One block per lane of control moves, each opened by its comment: a move adds its controls' sections inside its own block alone. -->
@@ -76,7 +77,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
76
77
 
77
78
  ## The phone's header bar
78
79
 
79
- - `HeaderBar` — the phone's one header row, on a page and in a sheet's head: a `left` place, the `title` (centred, or `titleAt` `left`), an optional `description` under it (drawn by `descriptionRender` when it must be the caller's element), and a `right` place, which is the Glass button group. It stands on the soft edge under Glass, the frame's `data-phone-header-surface` (Glass unless it says `flat`); `--hd-bar-room` says how much room stands over it.
80
+ - `HeaderBar` — the phone's one header row, on a page and in a sheet's head: a `left` place, the `title` (centred, or `titleAt` `left`), an optional `mark` beside it (a record's Avatar at 24, never shrinking while the title cuts with …), an optional `description` under it (drawn by `descriptionRender` when it must be the caller's element), and a `right` place, which is the Glass button group. It stands on the soft edge under Glass, the frame's `data-phone-header-surface` (Glass unless it says `flat`); `--hd-bar-room` says how much room stands over it.
80
81
  - `HeaderBarProps` — its props.
81
82
  - `SoftEdge` — what a floating head stands on, so what passes under it melts away with no line; what it stands in sets its height and, in `--soft-edge-ground`, its ground.
82
83
 
@@ -88,7 +89,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
88
89
  - `SheetForm` — `full`, `floating`, `blend` or `edge`.
89
90
  - `SheetStop` — a height it rests at: a share of the window up to 1, px above it, or `mark`, measured under what it holds.
90
91
  - `STOPS` — the stops a sheet may be given: `small`, `middle` and `full`.
91
- - `SheetHead` — its head, the phone's header bar under its handle: Glass, its X or Back on the left, or Flat; or `left` and `right` of its own.
92
+ - `SheetHead` — its head, the phone's header bar under its handle: Glass, its X or Back on the left, or Flat; or `left` and `right` of its own; a `mark` beside its title, as `HeaderBar`'s; a `step` (`{ id, back }`, as its body's `SheetStep`) it heads, so its row is drawn afresh for each step and what stands in it slides in with it, from the left going back.
92
93
  - `SheetHeadProps` — its props.
93
94
  - `SheetBody` — what scrolls under its head; at a lower stop a drag raises the sheet instead.
94
95
  - `SheetFoot` — its foot, at the screen's foot at every stop.
@@ -134,7 +135,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
134
135
  - `FieldSet` — fields or choices that answer one question under their own `legend`, with their own note and error; `disabled` reaches every choice in it.
135
136
  - `FieldSetProps` — its props.
136
137
  - `FieldSeparator` — a line between fields, with a word on it.
137
- - `FieldRows` — Field rows' card: fields as rows of one card on a phone, or each its own card; `look` its own, whole.
138
+ - `FieldRows` — Field rows' card: fields as rows of one card on a phone, or each its own card; `look` its own, whole. A `Field` placed in it is the card's row: its label in the row's column, its Input or InputGroup typed in place beside it (no box, the caret in the brand, an InputGroup's start words its prefix and its end button in the brand), `saving` and `saved` at the row's end; its note and error stand under the card, in a foot it draws while any Field in it has one (`o-field-rows-foot`), an error in place of every note, each still describing its control. A Field inside a `FieldRowsRow` is not a row. A `FieldRow` inside it draws as one of its rows on a phone.
138
139
  - `FieldRowsProps` — its props.
139
140
  - `FieldRowsRow` — a row of Field rows: its label beside its control (`as`: `label`, `button`, `div`).
140
141
  - `FieldRowsRowProps` — its props.
@@ -186,12 +187,12 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
186
187
 
187
188
  ## The Switch
188
189
 
189
- - `Switch` — turns a setting on or off, at once, on Base UI's switch: `size` `sm`, `md` or `lg` (on a phone `md` takes `lg`'s), `saving` (its thumb turns and a press does nothing), `locked` (a lock in its thumb) and its two `words`. Give it an `aria-label`, or a label round it.
190
+ - `Switch` — turns a setting on or off, at once, on Base UI's switch: `size` `sm`, `md` or `lg` (on a phone `md` takes `lg`'s), `saving` (its thumb turns and a press does nothing), `locked` (a lock in its thumb; on a phone the switch faded, with no lock) and its two `words`. On a phone its Capsule, what nothing picked draws, is iOS 26's 28 × 63, its thumb 24 × 37. Give it an `aria-label`, or a label round it.
190
191
  - `SwitchProps` — its props: Base UI's switch's, with those above.
191
192
 
192
193
  ## The atoms drawn with them
193
194
 
194
- - `CONTROL_ATOMS` — the atoms drawn with the default controls, for an app that takes them: it spreads them over its own, `atoms={{ ...CONTROL_ATOMS, ...own }}`. Taking none keeps ViewKit's own atoms, which need no Base UI. The rows' are `Tag` (a select's value as the Option, in its colour), `StatusBadge` (a status as the Status at its place) and `CellMore` (the rest of a cell's values as the Tag's count).
195
+ - `CONTROL_ATOMS` — the atoms drawn with the default controls, for an app that takes them. `components={CONTROLS}` brings them, its `atoms` laid over them atom by atom; an app that spreads `CONTROLS` into a map of its own spreads them over its own, `atoms={{ ...CONTROL_ATOMS, ...own }}`. Taking none keeps ViewKit's own atoms, which need no Base UI. The rows' are `Tag` (a select's value as the Option, in its colour), `StatusBadge` (a status as the Status at its place) and `CellMore` (the rest of a cell's values as the Tag's count). The panels' is `ToolbarButton`: every button the ready toolbar draws (the search's, New, the sort, Filter, View settings, a filter's joined parts, and in an app's own frame the views chip, the view tabs, "+N", "+", Clear and Save) as the toolbar button, each part dressed as the Toolbar's own and New in the form the Toolbar's New picks, read off the frame around it (nothing set, Outright's), or as its icon alone, named, where its part is placed `words: "icon"` (`word={null}`). Its count is a count, never a ✕ that clears what it counts.
195
196
  - `colourOf` — `colourOf(color)`: a value's colour as ViewKit names it, as the Option's (`gray` is `grey`).
196
197
  - `statusPlaceOf` — `statusPlaceOf(slot)`: where a status of a slot stands on the Status's path (`running` and `primary` are a step between).
197
198
  - `quartersOf` — `quartersOf(steps, at)`: a step between at its quarters (1, 2 or 3) among the steps between, in their order.
@@ -278,7 +279,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
278
279
 
279
280
  ## The Avatar
280
281
 
281
- - `Avatar` — who or what a row is about: a person a circle on their tone, a thing, the workspace or an agent a square, which a `colour` stands on one of the label hues; `size` 16 to 64, a photo or logo by `src`, its kind's `icon`, `presence` or a `badge` on its corner.
282
+ - `Avatar` — who or what a row is about: a person a circle on their tone, a thing, the workspace or an agent a square, which a `colour` stands on one of the label hues (on a phone an agent's bold, the hue under a white letter, as an app's tile); `size` 16 to 64, a photo or logo by `src`, its kind's `icon`, `presence` or a `badge` on its corner.
282
283
  - `AvatarProps` — its props.
283
284
  - `AvatarSize` — its sizes, 16, 20, 24, 32, 40, 56 and 64; a stack takes neither 16 nor 56.
284
285
  - `AvatarColour` — a square's own colour: blue, green, amber, red, purple, pink, teal or grey, the Option's list; the square on the hue's fill, what it holds in its strong ink, with no edge.
@@ -291,12 +292,12 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
291
292
 
292
293
  ## The Picker's core
293
294
 
294
- - `usePicker` — `usePicker(props)`: the Picker's parts for a shell to pour in, its body and on a phone the Sheet head's buttons: a list to pick from, with its search, the empty row, Create, several held, a row's own menu (on a phone in a frame of its own by `menuFrame`; its words, and the ⋯'s beside a phone's search, by `menuWords`), levels one in and rows put in order. Its options are read off the frame round it (`pickerWornOf`). ↓ and ↑ pass a greyed row by.
295
+ - `usePicker` — `usePicker(props)`: the Picker's parts for a shell to pour in, its body and on a phone the Sheet head's buttons: a list to pick from, with its search, the empty row, Create, + Add (`onAdd`, `adding`, `addRefused`: a row after the matches that asks the app and picks nothing, Adding… while it answers, its refusal where the row was; on a phone the bar's Add), several held, a row's own menu (on a phone in a frame of its own by `menuFrame`; its words, and the ⋯'s beside a phone's search, by `menuWords`), levels one in and rows put in order. Its options are read off the frame round it (`pickerWornOf`). ↓ and ↑ pass a greyed row by.
295
296
  - `Picker` — the Picker's body alone.
296
297
  - `PickerUnder` — the Picker under a box that opens it, on a computer (the Select's): its root round the box, its list in the box's panel.
297
298
  - `PickerProps` — its props.
298
299
  - `PickerUnderProps` — `PickerUnder`'s props.
299
- - `PickerWords` — every word the Picker draws of its own (what the list is doing, Create, Loading more, the count and Clear all, a phone's Selected card, its bar's Create and ⋯, Cancel and ✓, ‹ and a row's ⋮, and "you"), handed as `words`, each the app's where given.
300
+ - `PickerWords` — every word the Picker draws of its own (what the list is doing, Create, + Add and Adding…, Loading more, the count and Clear all, a phone's Selected card, its bar's Create, Add and ⋯, Cancel and ✓, ‹ and a row's ⋮, and "you"), handed as `words`, each the app's where given.
300
301
  - `PICKER_WORDS` — those words in English, the default.
301
302
  - `PickerParts` — what `usePicker` hands back: the body, and on a phone the Sheet head's props.
302
303
  - `PickerAction` — an action at its foot (New view…).
@@ -321,7 +322,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
321
322
 
322
323
  ## The Select
323
324
 
324
- - `Select` — a field to pick one or several from a closed list: the Input's box, its list the Picker under it on a computer and in the full Sheet on a phone; typed into (`searchIn="field"`), with chips, a search, Create, a server search, a clear row; or alone (`opens`), owning no list.
325
+ - `Select` — a field to pick one or several from a closed list: the Input's box, its list the Picker under it on a computer and in the full Sheet on a phone; typed into (`searchIn="field"`), with chips, a search, Create, a server search, a clear row; or alone (`opens`), owning no list; its label over the box, or inside it before its value on the outline Button (`labelAt`).
325
326
  - `SelectProps` — its props.
326
327
  - `SelectListProps` — its props with a list of its own.
327
328
  - `SelectAloneProps` — its props alone, owning no list.
@@ -356,7 +357,7 @@ A list's panel at its right edge, on a computer, on Base UI's dialog, not modal:
356
357
 
357
358
  ## The toolbar button
358
359
 
359
- What stands in a toolbar: the view switcher, View settings, the sort, each filter on the filter bar, a phone's round buttons. It is the Button, on Base UI's Toolbar button inside a toolbar: its ground picks the Button's kind (ghost the quiet, bordered the outline, filled the soft), its size the Button's height, its words whether it is icon-only, so every Button option an app sets reaches it. Its own options are read off the frame around it (`data-toolbar-button-<option>`), a computer's or a phone's, and change as the frame's attributes change; what it holds can say otherwise for itself. Nothing set, it is bordered, 32, its icon and word on a computer, and filled, 36, round, its icon alone on a phone. Its stylesheet is `viewkitjs/views/controls/toolbar-button.css`, after the Button's; its options and looks are `TOOLBAR_BUTTON_LOOKS`. ViewKit's own toolbar still draws its `ToolbarButton` atom: an app hands this control through its own atom.
360
+ What stands in a toolbar: the view switcher, View settings, the sort, each filter on the filter bar, a phone's round buttons. It is the Button, on Base UI's Toolbar button inside a toolbar: its ground picks the Button's kind (ghost the quiet, bordered the outline, filled the soft), its size the Button's height, its words whether it is icon-only, so every Button option an app sets reaches it. Its own options are read off the frame around it (`data-toolbar-button-<option>`), a computer's or a phone's, and change as the frame's attributes change; what it holds can say otherwise for itself. Nothing set, it is bordered, 32, its icon and word on a computer, and filled, 36, round, its icon alone on a phone. Its stylesheet is `viewkitjs/views/controls/toolbar-button.css`, after the Button's; its options and looks are `TOOLBAR_BUTTON_LOOKS`. ViewKit's own toolbar draws its `ToolbarButton` atom, which `CONTROL_ATOMS.ToolbarButton` draws with this control, under `components={CONTROLS}` or `atoms={CONTROL_ATOMS}`; an app with neither keeps ViewKit's own button.
360
361
 
361
362
  Its name here is `ToolbarButtonControl`: `viewkitjs/views/panels/react` already names the toolbar's part `ToolbarButton`, and one package holds no two public names alike.
362
363
 
@@ -367,13 +368,13 @@ Its name here is `ToolbarButtonControl`: `viewkitjs/views/panels/react` already
367
368
  - `ToolbarButtonSize` — `28`, `32`, `36` or `44`.
368
369
  - `ToolbarButtonSmoothing` — `app`, `smooth` or `round`.
369
370
  - `InToolbar` — the toolbar it stands in: `{ size, form }`, which it takes unless it says its own, and inside which it is one of the toolbar's stops.
370
- - `useToolbarButtonWorn(el, phone)` — its options as worn around `el`, kept up to date: what a toolbar reads for its row's height.
371
+ - `useToolbarButtonWorn(el, phone)` — its options as worn around `el`, kept up to date: what a toolbar reads for its row's height. Every reader on the page shares one observer, so a toolbar of buttons opens one.
371
372
 
372
373
  ## The Radio
373
374
 
374
375
  One of a few choices, all of them in sight, on Base UI's radio group: the arrow keys move the choice, a hidden input carries it in a form, and the label round a ring presses it. Its stylesheet is `viewkitjs/views/controls/radio.css`; the words beside a choice and a card's edge and ground (`o-choice-*`) are drawn by `choice.css`, as the Checkbox's are, and its ring's pressing area by `press.css`. Its group marks a phone from the device (`data-vk-phone`), where marked cards stand one under another and tiles on one card. The Links editor draws a link's lead with it.
375
376
 
376
- - `RadioGroup` — its choices, one under another: its `label` (the group a FieldSet, its name the legend; without one, give it an `aria-label`), `row` for two to four side by side, `tiles` for marked cards three across, and Base UI's group props (`value`, `defaultValue`, `onValueChange`, `disabled`).
377
+ - `RadioGroup` — its choices, one under another: its `label` (the group a FieldSet, its name the legend; without one, give it an `aria-label`), `row` for two to four side by side, `tiles` for marked cards three across, and Base UI's group props (`value`, `defaultValue`, `onValueChange`, `disabled`). At a setting row's end under At the end (a `Field` in a computer's `SettingRows`) it is a Select of its Radios, their words alone, its pick handed to `onValueChange`; a group of swatches stays swatches.
377
378
  - `RadioGroupProps` — its props.
378
379
  - `Radio` — one choice: its `value`, its `label` and `note` beside it, `card` drawn as a card, `mark` a mark in place of the ring on a marked card.
379
380
  - `RadioProps` — its props.
@@ -419,7 +420,7 @@ What the view switcher opens: the Picker over a list's views, each its layout's
419
420
  - `listed` — the views as the list shows them: as they are, or with private views on, the shared ones, then the reader's own.
420
421
  - `SHARED` — the shared views' heading's English ("Shared").
421
422
  - `JUST_ME` — the reader's own views' heading's English ("Just me").
422
- - `ListView` — a view as an app hands it: its `id`, `name`, `layout`, and `private`, `favorite`, `changed` and `count` where it has them.
423
+ - `ListView` — a view as an app hands it: its `id`, `name`, `layout`, and `private`, `favorite`, `changed`, `count` and `readOnly` (no Rename, Private view, Save or Delete in its menu) where it has them.
423
424
  - `ViewsListLayout` — a layout a view takes: its `id`, `name`, `mark`, its one `line`, and `columns` where it asks which field makes its columns.
424
425
  - `ViewsListChange` — what happened, handed on as it happens.
425
426
  - `viewsListWornOf` — the options worn round an element, `{ privateViews, favorites }`.
@@ -449,6 +450,8 @@ A view's menu and what it opens (VK-823), for an app that draws its own menu or
449
450
 
450
451
  `CONTROLS.ViewsListBody`, handed the axis's `verbs`, draws a view's menu through `useViewMenu`: on a computer the delete question goes to your `confirm` port and the deletion to your `toast` port; on a phone a view's ⋯ turns the one Sheet into its menu, with Back, and what it opens turns it again. Without `verbs` a view's menu is its `menu` rows, on a phone a step of the one Sheet too.
451
452
 
453
+ `CONTROLS.ViewMenu` is the same menu at a views row's pill or a folded view's `⋮` (VK-947): one view's items from the axis's `verbs` through `useViewMenu`, reshaped by `verbs.menu`, drawn by your `Menu`, with Rename… and New view in the Modal beside it, the delete question asked through your `confirm` port on a computer and the deletion said through your `toast` port, with Undo. Handed no `view`, it is the views row's +: New view's Modal stands as it mounts, its create handed to `verbs.onChange`.
454
+
452
455
  `CONTROLS.ViewsListBody` draws it where the view switcher opens: the axis's views, each its glyph by your `AppIcon`, its count and its menu rows as the Menu's (a row with no reason it can't be used says your `views.menus.not-now`), New view from `onCreate` in the axis's word, an order handed to `onReorder` as one whole block and never one that moves a view `canDrag` refuses, Shared and the reader's own wherever a view is private, and every word your messages'. It is internal: `CONTROLS` is the way in.
453
456
 
454
457
  ## The filter editor
@@ -577,7 +580,7 @@ What View settings opens: the view's sections as the Menu list's rows, Layout, C
577
580
  - `SheetPartsFrom` — what a Sheet holds for a body that heads it: the body hands its title, Back, ✕ and foot, drawn in place of the Sheet's head. The controls' Sheet holds it; an app's own may too.
578
581
  - `SheetParts` — what a body hands its Sheet.
579
582
 
580
- `CONTROLS.CustomizeBody` draws ViewKit's Customize body with it: the view's columns and layout, each change handed back as one write; the layout's own settings, its toggles, Columns' own Reset and the shared view's foot (Reset and Save for everyone; under the kit's foot, Clear and Save; with no shared view, the foot's Clear); its Filter, Sort and Group through the filter, sort and group editors, narrow on a computer, each step a level under its head on a phone. It draws a column's own settings one level into Columns, your field editor's rows for that column under them and its footer under Columns' rows, and on a card layout each field's new-line toggle. The view's name, Copy link and Export come through the toolbar (`ToolbarOptions`' and `ReadyToolbar`'s `viewName`, `onRenameView`, `onCopyLink`, `onExport`, `exportCount`), each drawn only where handed, and on a phone the level a section stands on (Group by's fields, Add sort's) is told as its step (`onStepChange`), so the sheet's Escape goes back a level. Every word is the app's, from its messages. It is internal: `CONTROLS` is the way in.
583
+ `CONTROLS.CustomizeBody` draws ViewKit's Customize body with it: the view's columns and layout, each change handed back as one write; the layout's own settings, its toggles, Columns' own Reset and the shared view's foot (Reset and Save for everyone, or Save on the person's own view; under the kit's foot, Clear and Save; with no shared view, the foot's Clear); its Filter, Sort and Group through the filter, sort and group editors, narrow on a computer, each step a level under its head on a phone. It draws a column's own settings one level into Columns, your field editor's rows for that column under them and its footer under Columns' rows, and on a card layout each field's new-line toggle. The view's name, Copy link and Export come through the toolbar (`ToolbarOptions`' and `ReadyToolbar`'s `viewName`, `onRenameView`, `onCopyLink`, `onExport`, `exportCount`), each drawn only where handed, and on a phone the level a section stands on (Group by's fields, Add sort's) is told as its step (`onStepChange`), so the sheet's Escape goes back a level. Every word is the app's, from its messages. It is internal: `CONTROLS` is the way in.
581
584
 
582
585
  ## The Modal
583
586
 
@@ -696,21 +699,21 @@ On a phone, a pill at the list's foot naming what quick filters hold while they
696
699
 
697
700
  ## The Toolbar
698
701
 
699
- The Outright kit's Toolbar, on Base UI's toolbar: the row and, under it, the filter bar, a step smaller; on a phone one line. Tab reaches the whole of it once, the arrows run through its lines and loop, Home and End reach its ends; in a text box the arrows move the caret and step out at its ends. Handed a list's places (`views`, `settings`, `search`, `add`, `sort`, `filter`, `filters`, `quick`, `save`), it stands each where its options pick (`TOOLBAR_LOOKS`, worn as `data-toolbar-*` on the frame round it): View settings beside the views or on the row's right, the sort and Filter on the bar or on the row's right, the filter bar always or once something is added (`added`), lines across or none, Clear and Save on the bar or in View settings, New in its form, the quick filters' button or none; on a phone the sort, Filter, the quick filters' icon and View settings beside the views or on the right, the search a button or its own line. A place may be a function of where it stands (`ToolbarAt`: `row`, `right`, `bar`, `phone`). Handed no places, it is its `children` (the row) and `bar` (the filter bar), as any row of controls. What doesn't fit gives way, each line on its own, from its end: words to icons, then the view tabs into "+N", the filters into "+N filters", then the rest into ⋯, a Menu; a line holds while a Menu holding what folded stands open, or while its holder says `holds`. What never folds: a toolbar button marked `stays`, and the Button (New). Each line's height is its toolbar buttons' (the toolbar button's Size, a phone's its own), given to the Buttons, the Toggle group and the text box in it. Every word it says of its own is handed (`words`). Its stylesheet is `viewkitjs/views/controls/toolbar.css` ([its tokens](../controls/toolbar.md)).
702
+ The Outright kit's Toolbar, on Base UI's toolbar: the row and, under it, the filter bar, a step smaller; on a phone one line. Tab reaches the whole of it once, the arrows run through its lines and loop, Home and End reach its ends; in a text box the arrows move the caret and step out at its ends. Handed a list's places (`views`, `settings`, `search`, `add`, `sort`, `filter`, `filters`, `quick`, `save`), it stands each where its options pick (`TOOLBAR_LOOKS`, worn as `data-toolbar-*` on the frame round it): View settings beside the views or on the row's right, the sort and Filter on the bar or on the row's right, the filter bar always or once something is added (`added`), lines across or none, Clear and Save on the bar or in View settings, New in its form, the quick filters' button or none; on a phone the sort, Filter, the quick filters' icon and View settings beside the views or on the right, the search a button or its own line. A place may be a function of where it stands (`ToolbarAt`: `row`, `right`, `bar`, `phone`). Handed no places, it is its `children` (the row) and `bar` (the filter bar), as any row of controls. What doesn't fit gives way, each line on its own, from its end: words to icons, then the view tabs into "+N", the filters into "+N filters", then the rest into ⋯, a Menu; a line holds while a Menu holding what folded stands open, or while its holder says `holds`. What never folds: a toolbar button marked `stays`, and the Button (New). Handed `fill`, the row's worded buttons grow to share it, the square ones keeping their width, and as it narrows the first worded button with an icon keeps its words while the others give theirs up and fold, giving way itself last; the filter bar draws as without. Handed `more`, ⋯ stands at the row's end holding those entries, what folds joining them in the row's order (an empty list: ⋯ there once something folds). Each line's height is its toolbar buttons' (the toolbar button's Size, a phone's its own), given to the Buttons, the Toggle group and the text box in it. Every word it says of its own is handed (`words`). Its stylesheet is `viewkitjs/views/controls/toolbar.css` ([its tokens](../controls/toolbar.md)).
700
703
 
701
704
  Its frame and its separator are `ToolbarControl` and `ToolbarSeparatorControl`: `viewkitjs/views/panels/react` already names the ready toolbar's frame `Toolbar` and its separator `ToolbarSeparator`, and one package holds no two public names alike. The ready toolbar keeps its own frame.
702
705
 
703
- - `ToolbarControl` — the Toolbar. Its props, `ToolbarProps`: `label` (its name to a screen reader), `children` and `bar`, the places above, `added`, `picks` (its options over the frame's), `barLabel`, `size` and `barSize` (`28`, `32` or `36`), `spacing` (in spacing steps), `fold` (default on), `holds`, `form` (`computer` or `phone`; by default a phone's in a phone's window or a `PhoneHost`), `onMoreViews` and `moreViewsOpen` (where its holder opens what "+N" opens), `words`, `className`, `style`, and Base UI's toolbar's own. Its width is its holder's to give: sized from what it holds in a pill (the bulk bar, the quick filters' reminder), so a holder that draws it as a list's toolbar gives it its width (a flex item with `min-width: 0`), or its row never runs out of room to fold.
706
+ - `ToolbarControl` — the Toolbar. Its props, `ToolbarProps`: `label` (its name to a screen reader), `children` and `bar`, the places above, `added`, `picks` (its options over the frame's), `barLabel`, `size` and `barSize` (`28`, `32` or `36`), `spacing` (in spacing steps), `fold` (default on), `holds`, `fill` (the row's worded buttons share it), `more` (Menu entries ⋯ always holds at the row's end), `form` (`computer` or `phone`; by default a phone's in a phone's window or a `PhoneHost`), `onMoreViews` and `moreViewsOpen` (where its holder opens what "+N" opens), `words`, `className`, `style`, and Base UI's toolbar's own. Its width is its holder's to give: sized from what it holds in a pill (the bulk bar, the quick filters' reminder), so a holder that draws it as a list's toolbar gives it its width (a flex item with `min-width: 0`), or its row never runs out of room to fold.
704
707
  - `ToolbarProps` — its props.
705
708
  - `ToolbarPlace` — a place: what it draws, or a function of where it stands.
706
709
  - `ToolbarAt` — where a place stands: `row`, `right`, `bar` or `phone`.
707
710
  - `ToolbarSeparatorControl` — a line between what belongs together and what doesn't.
708
711
  - `ToolbarSpacer` — room that pushes what follows to its line's far end.
709
712
  - `ToolbarInput` — the text box in a line, one of its stops, at its line's height (`icon` at its start side). In the search's place, a button the Toolbar opens: pressed, its box with the caret in it and a ✕; the ✕, Escape or leaving it empty closes it, and Escape brings the focus back to the button.
710
- - `ToolbarInputProps` — its props: the Input's, and `icon`.
713
+ - `ToolbarInputProps` — its props: the Input's, `icon`, and `words`: `"both"` shows "Search" beside the shut search's icon as the buttons on the right show their words (the Toolbar's "Buttons on the right"; on a phone its icon alone); absent or `"icon"`, its icon alone, as Mihai's look stands it.
711
714
  - `ToolbarFolds` — filters or view tabs a holder draws itself, standing in a line: the line folds them one at a time among its own (`kind`, `filters` or `tabs`; `count`) and hands `children` how many are folded.
712
715
  - `ToolbarFoldsProps` — its props.
713
- - `toolbarSteps` — the steps a line takes as it narrows, in order, for a holder's test.
716
+ - `toolbarSteps` — the steps a line takes as it narrows, in order (`fill` as its second argument), for a holder's test.
714
717
  - `useToolbarWorn` — its options as worn round an element, kept up to date as they change.
715
718
  - `toolbarWornOf` — its options as the frame round an element wears them, each its default where nothing sets it.
716
719
  - `TOOLBAR_ATTRS` — the attributes it watches.
@@ -979,27 +982,34 @@ The label beside a Checkbox, a Radio or a Switch in a settings row (`o-choice-la
979
982
 
980
983
  Tags inside the Input's field, before the caret, in a Field with its label, its note and its error: typing and Enter (or a comma) adds one, a tag already there is not added again, Backspace in an empty box takes the last one off, and each tag has its remove button; disabled, nothing is typed in and the tags have none. The field is an InputGroup, so every state and option of the Input draws it, and on a phone it takes the phone's 44. Its stylesheet is `viewkitjs/views/controls/tag-field.css`, in the ready stylesheet; it stands on the Field's, the Input's and the Tag's. Its names are on [its page](../controls/tag-field.md).
981
984
 
982
- - `TagField` — the field. Its words are its props: `placeholder` says "Add a tag" when none is handed, and each tag's remove button "Remove <tag>", as the Tag's does.
985
+ - `TagField` — the field. Placed in `FieldRows` (or a phone's `SettingRows`) it is the card's row, as iOS draws a To field: its tags tokens in the card (30 tall, a pill on `--vk-neutral`, no edge, no icon), wrapping, the caret after the last and the placeholder only while it holds none; its label names the box out of sight, for its place to title the group (`o-tag-field-row`); its note and error under the card. Its words are its props: `placeholder` says "Add a tag" when none is handed, and each tag's remove button "Remove <tag>", as the Tag's does.
983
986
  - `TagFieldProps` — `label`, `note`, `error`, `disabled`, `defaultValue`, `onValueChange`, `placeholder`, `className`.
984
987
 
985
988
  ## The setting row
986
989
 
987
990
  One setting as a row (`SettingRow`): its name and a line under it on the left (the words beside a choice), its control at its end, a mark or an icon at its start. Its kind is the prop it is given:
988
991
 
989
- - A switch, `switch` — the Switch's props: the whole row a label pressing it, the hovered ground under the pointer.
992
+ - A switch, `switch` — the Switch's props: only the Switch switches it, its words, line and mark pressing nothing, as iOS's Settings; the Switch is named by the row's name (`aria-labelledby`) and described by its line (`aria-describedby`).
990
993
  - A select, `select` — a Select with its own list (its props but `label` and `size`): 36 tall, 220 wide.
991
- - A button, `action` — a button (`SettingAction`: `label`, `icon`, `onClick`, `disabled`): the Button's outline kind, 32 tall; in a danger card its danger kind.
994
+ - A button, `action` — a button (`SettingAction`: `label`, `icon`, `onClick`, `disabled`, `kind`): the Button's outline kind, 32 tall; in a danger card its danger kind; `kind` (`outline` or `danger`) says it, an undoable one outline in the danger zone (Leave).
992
995
  - › to its page, `onOpen` — the whole row a button, its `value` before ›.
993
996
 
994
- `locked` (the reason) shuts its control, which stands greyed after the reason; a switch keeps the Switch's own locked state, a lock in its thumb. `alone` stands a lone row bare, with no card. `SettingRows` holds the rows in a card, a line between each, its corners smooth where the browser can draw them; `danger` is the danger zone's, a red edge (`o-setting-rows-danger`). On a phone (a PhoneHost screen, below the app's line, or `form="phone"`) the card and its rows are Field rows' (`field.css`): the name on the left, the value on the right, ›; a select's row opens its list in the full Sheet, a button's row is the button, a danger card's names are red, a locked row's reason stands in place of its line. Its two options, the card and the rows, are on [`viewkitjs/views/looks`](looks.md). Its stylesheet is `viewkitjs/views/controls/setting-row.css`, in the ready stylesheet; it stands on `choice.css`, the Switch's, the Select's, the Button's and the Field's. Its names are on [its page](../controls/setting-row.md).
997
+ A button's `value` stands before it on a computer, as the open kind's (an email before Change); `iconOnly` draws its `icon` alone, its `label` naming it.
998
+
999
+ `state` (`SettingState`: `label`, `colour`) is a word of state before its control on a computer, the Option in its colour (Connected, green), before the reason; on a phone the grey value before ›, the row then the press of its action. `locked` (the reason) shuts its control, which stands greyed after the reason; a switch keeps the Switch's own locked state, a lock in its thumb. `alone` stands a lone row bare, with no card; on a phone a card of its own, the row the press, its name in the link colour. `SettingRows` holds the rows in a card, a line between each, its corners smooth where the browser can draw them; `danger` is the danger zone's, a red edge (`o-setting-rows-danger`). On a phone (a PhoneHost screen, below the app's line, or `form="phone"`) the card and its rows are Field rows' (`field.css`): drawn as iOS's Settings draws them: the name on the left; the value in the quietest grey, cut with …, before iOS's ›; a select's row opens its list in the full Sheet; a button's words stand in the link colour at the row's end, a press of their own; in a danger card each row is the press, its action's `icon` first, its name and icon red; a locked row fades by `--vk-opacity-off` but for its line, where its reason stands. A `Field` placed in its card on a phone is one of its rows, as in `FieldRows`, its note and error in a foot after the card; what a `SettingRow` holds is no row of it. Its `icon` is a line icon (the Icon option's Line, nothing picked) or a white glyph on a tile (Tile), the tile on `colour`, a label colour (`OptionColour`), grey when none; `SettingIcon` draws the same icon beside a list's name outside a row. `SettingChevron` draws its phone ›, 9 × 15, at the end of a list's row outside a row, so one › stands on every settings page. One card, one way: where any of its rows has a start (an icon, or a mark), every row keeps the start's room, so their words stand in one line, and each row's rule starts at the words; each row says what starts it (`data-setting-row-start`: `icon` or `mark`). Its ›, 9 × 15, is `--vk-icon-disclosure`. On a computer it reads its options off the frame round it (its card's, or its own when it stands alone), kept up to date as they change (`useSettingRowWorn`). Under the End option's Words an action is its words (`o-setting-row-act`, red with `data-kind="danger"`), a state a dot in its colour and its words (`o-setting-row-said`), and a locked row's reason stands in its control's place, its words greyed. Under the Card option's Edged the card stands on its ground with a firm edge, its danger zone's plain, a lone row a card of its own and an icon on a grey tile; under the Rows option's Inset the rows stand 60 tall at least, the line between them inset at both ends. Under the Fields option's At the end a `Field` placed in a computer's card is one of its rows (`o-setting-row-field`): its label and note on the left, its error in the note's place, its control at the row's end (an Input 256 wide); a `RadioGroup` standing there draws as a Select of its Radios, named by the row's label, unless its Radios are swatches; and every select at a row's end is as wide as its value. `useSettingRowsRow()` tells a part of an app's own placed in such a card that it stands as one of its rows. Under the Fields option's Boxes (nothing picked) a Field in a computer's card stays a box, the rows' room round it. Its options, the card, the rows, the end and the fields (a computer's) and the icon (a phone's), are on [`viewkitjs/views/looks`](looks.md). Its stylesheet is `viewkitjs/views/controls/setting-row.css`, in the ready stylesheet; it stands on `choice.css`, the Switch's, the Select's, the Button's, the Option's and the Field's. Its names are on [its page](../controls/setting-row.md).
995
1000
 
996
1001
  `SwitchRow` and `SwitchRows` are its switch kind, with the props and the classes they always had (`o-switch-row`, `o-switch-rows`), so `switch-row.css` (its names on [its page](../controls/switch-row.md)) still draws them for an app that hasn't moved to `setting-row.css`. `SwitchRows` keeps its computer form on a phone.
997
1002
 
998
1003
  - `SettingRow` — one row.
999
- - `SettingRowProps` — its props: `label`, `note`, `icon`, `mark`, `locked`, `alone`, `className`, and its kind.
1004
+ - `SettingRowProps` — its props: `label`, `note`, `icon`, `colour`, `mark`, `state`, `locked`, `alone`, `className`, and its kind.
1005
+ - `SettingIcon` — a row's icon on its own (`colour`, its glyph as children), for a list that draws its names itself.
1006
+ - `SettingChevron` — the phone row's ›, 9 × 15, on its own, at the end of a list's row that stands beside setting rows.
1000
1007
  - `SettingRows` — the card.
1008
+ - `useSettingRowWorn` — the setting row's options as the frame round an element picks them, kept up to date.
1009
+ - `useSettingRowsRow` — true for a part placed in a computer's card under At the end, which stands as one of its rows.
1001
1010
  - `SettingRowsProps` — the card's props: `danger`, `form`, `className`.
1002
- - `SettingAction` — a row's button.
1011
+ - `SettingAction` — a row's button: `label`, `icon`, `onClick`, `disabled`, `kind`, `iconOnly`.
1012
+ - `SettingState` — a row's word of state.
1003
1013
  - `SwitchRow` — the switch kind.
1004
1014
  - `SwitchRowProps` — its props: every prop of the Switch, and its `label` and `note`.
1005
1015
  - `SwitchRows` — the card round switch rows.
@@ -6,7 +6,7 @@ Import from `viewkitjs/views/editors/session` in a client component: the door op
6
6
  - Admitted, the one to prefer: `onAttempt(answer)` is asked at once whether this answer may close and returns an `EditSessionAttempt`. A refusal keeps the session open for another try, and its `reason` comes back as `refusal` until the next attempt; an acceptance closes it and calls `onClose` after the exit gap, a timer cleared if the host unmounts. While `onAttempt` runs the session counts as answered, so a close that arrives during it (a write that moves the focus, and a box that closes on blur) is ignored; a refusal, or an `onAttempt` that throws, opens it again for the next try.
7
7
  - Deferred: the session closes at once and hands the answer to `onDone` after the exit gap, for a host whose answer still carries the write.
8
8
  - Gap: `exitMs` sets it, defaulting to `EDITOR_EXIT_MS`.
9
- - Leaving: `leave` (`"outside"` or `"discard"`, read once when the session opens; default `"discard"`) says what happens to a session still open when its page goes (`pagehide`: a reload, a closed tab, a removed frame, Back to another document), or when the grid or field row around it goes. `"outside"` asks the editor as for a press outside, so its draft is written by its own rule and a refusal writes nothing; `"discard"` asks nothing, which keeps a host of your own as it was. Pass `"outside"` to have its open editor asked; the grid and the field row pass it on a desktop and `"discard"` in a phone's sheet. Either way an answer already given and waiting out its exit is finished at once, inside the event, and the admitted mode's `onLeave` is called first. A session closed by Escape is never asked again. One `pagehide` listener per session, for its life; a page that comes back from the back-forward cache finds the session closed and its value written.
9
+ - Leaving: `leave` (`"outside"` or `"discard"`, read once when the session opens; default `"discard"`) says what happens to a session still open when its page goes (`pagehide`: a reload, a closed tab, a removed frame, Back to another document), or when the grid or field row around it goes. `"outside"` asks the editor as for a press outside, so its draft is written by its own rule and a refusal writes nothing; `"discard"` asks nothing, which keeps a host of your own as it was. Pass `"outside"` to have its open editor asked; the grid and the field row pass it on a desktop and `"discard"` in a phone's sheet. Either way an answer already given and waiting out its exit is finished at once, inside the event, and the admitted mode's `onLeave` is called first. A session closed by Escape is never asked again. At `pagehide` a session is left in the page close's first pass, before any waiting write the grid sends (an undo still waiting for the edit it takes back), so its draft lands first; a page that comes back from the back-forward cache finds the session closed and its value written.
10
10
  - `EditSession` — what the session hands its host, and what `EditorPanel` (`viewkitjs/views/editors/panel`) takes: `open`, `close(reason)`, and `refusal`, the reason the host gave for the last refused attempt until the next one, `null` otherwise and always in the deferred mode; and `keeps`, optional, true when this session's Escape keeps (an editor that checks its draft before a key closes it, the value list, checks it before Escape too).
11
11
  - `useEscapeRule(type, list?)` — the provider's `escape` for a field type (`ViewsProvider`, `viewkitjs/views/react`): `"keep"` where it names the type keep, else `"cancel"`, and `"cancel"` with no provider. For an email, a phone, a link or a domain whose rule names its editors apart (`{ box, list }`), `list` (default false) says which: true where your host opens the value list (several values, or a single one opened as a list of one), false for the text box. A host of your own reads it and hands it to its session as `escape`.
12
12
  - `EditSessionAttempt` — the host's answer to an attempt: `{ accepted: boolean; reason?: string }`. A refusal may say why; the reason is what `refusal` shows.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Import from `viewkitjs/views/field-row` in a client component, under your `ViewsProvider`: the door opens with the client directive. It holds a record's field row: one field drawn as its label, its value and, on a click, its type's editor in place, and the write path that admits each edit at once, queues one record's writes, settles each on the save's receipt and rolls a failure back. The row knows no entity, only a binding, a value and a commit, so your app builds its record's panel (its sections, its related records) around the rows. It draws with your provider's `Popover`, `Sheet`, `Collapse`, `AppIcon`, icons, `CommandMenu` atom and toast port. The shapes its writes go through (the write target, the receipt, the admission, a value's note, the reconciliation error) are the root door's, described under [A write's target](views.md#a-writes-target), and this door re-exports them. Guide: [editors](../guides/editors.md).
4
4
 
5
- - `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money) in its own box on every width; a name and a range open your `PartsBody` anchored under the value, as a place does; and a single email or domain opens the value list holding one value, anchored, where the provider's `oneValue` says `list` for its type. Escape throws the edit away, unless the provider's `escape` keeps the field's type, on a desktop, where it keeps what was typed and a refusal stays open until a second Escape throws the edit away; a sheet's swipe or ✕ changes nothing. On a desktop the date editor opens with the keyboard in your `DateBody`, as a place's or a long select's does; and with an editor open in its popover, an Escape heard from the page itself or from an element holding the row closes that editor and goes no further, so a drawer around the row hears only the next one. On a desktop, a select gives your Picker the keys however it opened, by Enter, Space or a pointer: the focus in its search, the arrows going on from the value it holds, and Enter picking the one lit (opened by a key, an Enter at once changes nothing). On a desktop, an editor closed by Tab, Shift-Tab, Escape, Enter or a pick puts the focus back on the row's own button, once its exit has played out and a write still saving has saved, so the next Tab moves on from that row; a press or a focus outside an editor's panel since the close lets that go, so a row opened meanwhile keeps its editor, and an outside press leaves the focus where it put it. A relation saves what its row stores (an id, a ref with the picked record's kind, or a set of records with its lead); a date field has no time and offers No date where it may be empty; several values read a phone typed without its code in the binding's `region`. A value of several parts inside a writable row draws its count as plain text: the row's press opens the editor, which lists them all. A single email, phone, link or domain in a writable row reads as plain text too, with an open action beside the row's button (a mail, a call, the site), and a writable rich text lies over its button, so its links and "Show more" keep their own press while a press on its text edits. A money figure its host reads in another currency than the record's own (it hands the converted figure as `value` and that currency as `opts.currency`) is marked ≈ with the currency it came from, and its editor names it under the record's own amount. A boolean commits from its own control, a `command` field opens its verbs, and a read-only row draws a lock with its reason. A refused commit keeps the editor open with the reason under it, a saved value shows at once and stays until the receipt settles it, and a failed save rolls back with a retry. A text, an email, a phone, a link, a domain, long or rich text edits in place in the row; handed the components map's `TextBody`, the row opens it there, at every width, with the field's own check and the record's country. A number, money or a percent edits in place too; handed `NumberBody`, the row opens it there, at every width, with the field's own check and its limits (a duration keeps the editor's own box).
5
+ - `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Outside a Field rows card (below), below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money) in its own box on every width; a name and a range open your `PartsBody` anchored under the value, as a place does; and a single email or domain opens the value list holding one value, anchored, where the provider's `oneValue` says `list` for its type. Escape throws the edit away, unless the provider's `escape` keeps the field's type, on a desktop, where it keeps what was typed and a refusal stays open until a second Escape throws the edit away; a sheet's swipe or ✕ changes nothing. On a desktop the date editor opens with the keyboard in your `DateBody`, as a place's or a long select's does; and with an editor open in its popover, an Escape heard from the page itself or from an element holding the row closes that editor and goes no further, so a drawer around the row hears only the next one. On a desktop, a select gives your Picker the keys however it opened, by Enter, Space or a pointer: the focus in its search, the arrows going on from the value it holds, and Enter picking the one lit (opened by a key, an Enter at once changes nothing). On a desktop, an editor closed by Tab, Shift-Tab, Escape, Enter or a pick puts the focus back on the row's own button, once its exit has played out and a write still saving has saved, so the next Tab moves on from that row; a press or a focus outside an editor's panel since the close lets that go, so a row opened meanwhile keeps its editor, and an outside press leaves the focus where it put it. A relation saves what its row stores (an id, a ref with the picked record's kind, or a set of records with its lead); a date field has no time and offers No date where it may be empty; several values read a phone typed without its code in the binding's `region`. A value of several parts inside a writable row draws its count as plain text: the row's press opens the editor, which lists them all. A single email, phone, link or domain in a writable row reads as plain text too, with an open action beside the row's button (a mail, a call, the site), and a writable rich text lies over its button, so its links and "Show more" keep their own press while a press on its text edits. A money figure its host reads in another currency than the record's own (it hands the converted figure as `value` and that currency as `opts.currency`) is marked ≈ with the currency it came from, and its editor names it under the record's own amount. A boolean commits from its own control, a `command` field opens its verbs, and a read-only row draws a lock with its reason. A refused commit keeps the editor open with the reason under it, a saved value shows at once and stays until the receipt settles it, and a failed save rolls back with a retry. A text, an email, a phone, a link, a domain, long or rich text edits in place in the row; handed the components map's `TextBody`, the row opens it there, at every width, with the field's own check and the record's country. A number, money or a percent edits in place too; handed `NumberBody`, the row opens it there, at every width, with the field's own check and its limits (a duration keeps the editor's own box).
6
6
  - `FieldRowProps` — the row's props: `binding`, `row`, `value` (the display value), `editValue` (the stored value the editor opens on), `writable`, `ready` (false refuses gestures while the record loads), `unread` (the value isn't read yet, drawn blank), `refusal` (why it's read-only here), `onCommit` (admits or refuses a draft, then settles; an editor still open when the page or the row goes is asked as for a press outside, so it can be called inside `pagehide`), `opts` (display options), `menu` (a `command` field's verbs), `meta` (a few words in the value's line), `note` (a sentence under the value, with an optional quote a tap opens) and `kindIcon` (your icon name for a record kind, the glyph a relation's candidates wear; unanswered, they wear the type's glyph).
7
7
  - `RowEditor` — the editor a row mounts for its field's type, picked from `ROW_HOSTS`.
8
8
  - `ROW_HOSTS` — the host each field type mounts in a row, or `null` for a type the row never opens (a boolean, a derived or system field).
@@ -14,3 +14,11 @@ Import from `viewkitjs/views/field-row` in a client component, under your `Views
14
14
  - `FieldWriteOptions` — `row`, `rowId`, `bindings`, `write` (an `EntityWriteTarget`), `refresh`, and optionally `locked`, `admit`, `conventions` (default: the provider's), `refusalOf` (reads a failed save's own sentence, shown after the toast's failure line and on the row) and `timing` (follows each edit from its commit to the paint, named `<noun> <fieldKey> drawer edit`).
15
15
  - `EditTiming` — what `timing` returns: `mark(step)`, `painted()` and `failed()`.
16
16
  - `FieldWriteRefusal` — the error a write rejects with when it is refused with a sentence of its own: by the server (the sentence `refusalOf` read), or at dispatch, when a queued edit is mapped again and the guard, a lock, a missing binding or the binding's write refuses it. The row shows its message.
17
+
18
+ ## The frame
19
+
20
+ A row's frame is the app's (docs/contract.md, Tokens): its label column on a desktop (`--vk-field-row-label-w`), the gap between its glyph, label, value and lane (`--vk-field-row-gap`), its least height (`--vk-field-row-h`, its content standing in the middle, a wrapped value keeping the label on its first line), its padding above and below (`--vk-field-row-py`), the line under every row but the last (`--vk-field-row-line-w`, `0px` for none, in `--vk-field-row-line`) and its label's colour (`--vk-field-row-label-fg`). Declared round a section, every row in it takes them; undeclared, the row draws as it always has. A row an app draws by hand on the same frame should read `--vk-field-row-label-w` too, so the two still line up.
21
+
22
+ ## In a Field rows card
23
+
24
+ On a phone, a row inside ViewKit's `FieldRows` card is one of the card's rows: its glyph in the card's glyph lane, its label in the card's label column and its value on the same line, the card's height, insets, line and label colour and none of the frame above. A `›` in the lane says its press opens a sheet (a pick, a date, a record, several values); a value typed in place (a text, a figure) shows none, and a read-only row keeps its lock. A press anywhere on the row opens what its edit button opens, except on a control of its own (an open value's action, the lane's `▾`), on a row whose value is a verb menu, while its write is pending or the record is loading. A writable empty row reads `views.field-row.set` ("Set source") in place of "Empty". A row's padding gives a value that wraps room above and below it; a one-line row keeps the card's height. On a computer a card holds today's rows, and ViewKit's own editor panel, Sheet and Modal opened from a card's row draw their rows as rows outside any card (an app's own dialog drawn inside the card keeps the card's form).
@@ -4,16 +4,18 @@ The spreadsheet. The door carries no client directive; every rendering file behi
4
4
 
5
5
  ## The grid
6
6
 
7
- - `GridTable` — draws the spreadsheet: rows in their groups under a header whose column menus sort, group, format and hide, a checkbox rail and a ⋯ tail on each row, editors opened over cells, a selected range with copy, paste and undo, and a footer of figures per column. An edit shows in its cell at once and goes to `onCellCommit` (a batch to `onCellsCommit`); a failed write rolls the cell back. While `transitionPending` is true, or for one commit after `transitionKey` changes, it draws your app's loading atom instead of the rows, or, handed the components map's `RowsWait` and already showing rows, keeps them, inert, as that slot's children, its column names and footer standing outside the slot, as they are. It takes a `GridTableProps`.
7
+ - `GridTable` — draws the spreadsheet: rows in their groups under a header whose column menus sort, group, format and hide, a checkbox rail and a ⋯ tail on each row, editors opened over cells, a selected range with copy, paste and undo, and a footer of figures per column. An edit shows in its cell at once and goes to `onCellCommit` (a batch to `onCellsCommit`); a failed write rolls the cell back. An undo or a redo shows its value, and takes the focus to its cell, as it is pressed; it is sent once the edit it takes back has answered, or at once when the page closes (`pagehide`), an editor still open writing its draft first. Back from the back-forward cache, an undo sent at the close may have reached the server before the edit it takes back: the cell then ends on the edit's stored value while redo still offers the undo. While `transitionPending` is true, or for one commit after `transitionKey` changes, it draws your app's loading atom instead of the rows, or, handed the components map's `RowsWait` and already showing rows, keeps them, inert, as that slot's children, its column names and footer standing outside the slot, as they are. It takes a `GridTableProps`.
8
8
  - `GridTableProps` — what `GridTable` takes, flat, typed over your row. Five are required: `groups` (the rows, as the model's `ListGroup`s), `grouped` (whether they draw as group bands), `getRowId`, `columns` (the model's `ListColumn`s) and `onOpenRow` (what opening a row does: the title's text opens it; it receives the row and a `GridRowOpenedFrom`, which brings the focus back to the row's cell once what it opened closes). The rest are optional:
9
9
  - Rows and groups: `rowHref`, `onPrefetchRow` (warm a row's detail on a pointer's intent), `rowClassName`, `rowIcon` and `showRowIcon` (the title cell's glyph, as a descriptor the grid sizes and colours, or the row's picture through your `Avatar` atom when the descriptor hands an `avatar`), `onOpenRelation` and `entityIcon` (opening the record a relation cell points at, and the glyph for a kind; without `onOpenRelation`, relation cells are inert), `isCollapsed` and `onToggleGroup` (your group collapse), `oneHeader` (a grouped grid draws one row of column names, pinned at the top over every group, in place of each group's own; each group's bar pins under it, and the row's checkbox picks every row; off by default, when each group draws its own with the box that picks its rows), `pinFooter` (the footer pins at the foot of the grid's scroll area, `--vk-scroll-inset-bottom` above its edge and, while rows are selected, a step above the bar `renderBar` draws, on a phone the rows then ending at the footer's bottom (measured where it stands; on the foot when it draws none), the rows passing under it, painted the ground and `data-stuck` only while they do; an ungrouped grid's stands at the foot even when its rows don't fill the area, in pages just above the pager, and a grouped grid's each pin while their group's rows run past the foot and close their group otherwise; off by default, when the footer stands after the last row), `renderGroupLabel`, `renderGroupFooter` (a group's paged continuation after its loaded rows), `onHideGroup`, `countOf`, `loadMore` (`hasMore`, `onReveal` and a `label`), `pages` (`GridPages`: `page` from 1, `size`, `total`, the view's count, `exact`, false for a capped count, `sizes`, the page-size pick's choices, default 25, 50 and 100, and `onPage` and `onSize`: an ungrouped grid draws the page you hand and the pager part `vk-grid-pager` under it, `loadMore` is then not drawn, picks clear on a page or size change, and the footer shows only the figures a group carries in `figures`; a grouped grid draws no pager; absent by default), `emptyState`, and `transitionKey`, `transitionPending` and `transitionLabel` (a view change: the wait paints before the new rows mount).
10
- - Row actions and menus: `rowMenu` (a row's items, on right-click and in its ⋯ tail; the same builder a list takes), `contextMenu` (a right-click menu that differs from it), `rowActions` (buttons in the title cell's action lane, before the grid's own Edit), `onRowDelete` and `deleteLabel` (a delete row in the row's menu), `commands` (the verbs a `command` column's cell opens, by field key; without it a command column is a read-only badge) and `selection` (the list's selection; its optional `renderBar` draws the bar it opens, `SelectionBar` with your verbs, and without one the rows still tick and no bar is drawn).
11
- - Sort, group and figures: `sort` (`GridSortState`), `sortMark` (a sorted column's header wears `icons.sortAsc` or `icons.sortDesc` after its name; off by default, `aria-sort` saying it either way), `groupBy` (`GridGroupByState`), `sortOptions` (the group band menu's sort, as `GridGroupSortOption`s), `groupMenu` (the parts a group band's ⋯ holds, as `GridGroupMenuPart`s: `"select"` (Select all in group, on a grid with a `selection`), `"sort"`, `"figures"`, `"hide"`), `groupSummary` and `onGroupSummaryChange` (which figures ride beside a group's name), `groupFigures` (`GridGroupFigure`s), `countNoun` (`GroupCountNoun`), `aggregates`, `onAggregateChange` and `renderAggregate` (the footer's figure per column), `viewBacked` (a saved view, which changes figures only for field-backed columns) and `defaultCurrency` (the reader's currency, which a money column read as it was entered totals in).
10
+ - Row actions and menus: `rowMenu` (a row's items, on right-click and in its ⋯ tail; the same builder a list takes), `contextMenu` (a right-click menu that differs from it), `rowActions` (buttons in the title cell's action lane, before the grid's own Edit), `onRowDelete` and `deleteLabel` (a delete row in the row's menu), `menus` (`GridMenus`: each of the grid's menus as data, reshaped by your function; `menus.row` is asked as a row's menu opens and may answer a promise, the menu waiting on one greyed row until it does, and holds Open page and Delete as `row-open` and `row-delete`, so a row's Delete is offered per row; the ready `<List>` (VK-742) hands the same `menus.row` through), `commands` (the verbs a `command` column's cell opens, by field key; without it a command column is a read-only badge) and `selection` (the list's selection; its optional `renderBar` draws the bar it opens, `SelectionBar` with your verbs, and without one the rows still tick and no bar is drawn).
11
+ - Sort, group and figures: `sort` (`GridSortState`), `sortMark` (a sorted column's header wears `icons.sortAsc` or `icons.sortDesc` after its name; off by default, `aria-sort` saying it either way), `groupBy` (`GridGroupByState`: handed, a column's menu offers Group by and Ungroup, saved view or not), `sortOptions` (the group band menu's sort, as `GridGroupSortOption`s), `groupMenu` (the parts a group band's ⋯ holds, as `GridGroupMenuPart`s: `"select"` (Select all in group, on a grid with a `selection`), `"sort"`, `"figures"`, `"hide"`), `groupSummary` and `onGroupSummaryChange` (which figures ride beside a group's name), `groupFigures` (`GridGroupFigure`s), `countNoun` (`GroupCountNoun`), `aggregates`, `onAggregateChange` and `renderAggregate` (the footer's figure per column), `viewBacked` (a saved view: Sort on every bound column, and figures only for field-backed columns; it doesn't decide Group by) and `defaultCurrency` (the reader's currency, which a money column read as it was entered totals in).
12
12
  - Format overrides and their handlers, every map keyed by field key: `optionColors`, `dateStyles`, `durationStyles`, `numberFormats` (decimals null is the field's own), `showTimeOverrides` and `percentDisplays`, each with its `on…Change` handler taking the field key first, and `formatsWritable` (false hides the stored format knobs from the column menu; default true).
13
- - Columns and preferences: `columnState` and `onColumnStateChange` (order, widths, and which columns show), `renderAddColumn` (your own add-column cell at the header's end, or in the title column's header under `addColumnAt`; without it, or answering `undefined`, `false` or `""`, the grid's own lists the hidden columns; answering `null`, none is drawn and no room is kept for it), `addColumnOnPhone` ("+ Add column" on a phone too, its list in your `Menu`; off by default), `addColumnAt` (`"title"` stands "+ Add column" as a lone + at the right edge of the title column's header, in reach while the columns scroll, and the tail keeps no room for it; `"end"`, the default, the header row's last cell; with no title column shown it stands at the end), `phonePicking` (a phone picks rows by a long press, the boxes inside the name column before the picture, and always shown on a grouped grid, its titles row's box in the name column's head; needs `selection`; off by default), `parts` (a column per part of a name, a place or a range, offered under its field in "+ Add column"; off by default), `renderColumnMenuRows` (deprecated, read by nothing: hand `columnMenuItems`), `columnMenuItems` (your rows in a column's menu, as data, above Hide), and the per-user toggles `freezeIdentity` (true on the bare prop, but a grid wired through `useGridTablePrefs` takes the preference `gridFreezeIdentity`, false in `LIST_VIEW_PREF_DEFAULTS`, so its identity columns start unfrozen until the person turns it on; start your prefs with `gridFreezeIdentity: true` to open it frozen), `alwaysCheckboxes`, `verticalBorders` and `scale`; and `headerVerticalBorders` (the header's columns ruled as the rows' are under `verticalBorders`, the last bare; off by default); and `fillWidth` (the columns share the grid's whole width, each in proportion to its own width and never below it, a column the person resized or one with a `grid.maxWidth` keeping its width; a table wider than the grid scrolls sideways as without it; off by default).
13
+ - Columns and preferences: `columnState` and `onColumnStateChange` (order, widths, and which columns show), `renderAddColumn` (your own add-column cell at the header's end, or in the title column's header under `addColumnAt`; without it, or answering `undefined`, `false` or `""`, the grid's own lists the hidden columns; answering `null`, none is drawn and no room is kept for it), `addColumnOnPhone` ("+ Add column" on a phone too, its list in your `Menu`; off by default), `addColumnAt` (`"title"` stands "+ Add column" as a lone + at the right edge of the title column's header, in reach while the columns scroll, and the tail keeps no room for it; `"end"`, the default, the header row's last cell; with no title column shown it stands at the end), `phonePicking` (a phone picks rows by a long press, the boxes inside the name column before the picture, and always shown on a grouped grid, its titles row's box in the name column's head; needs `selection`; off by default), `parts` (a column per part of a name, a place or a range, offered under its field in "+ Add column"; off by default), `columnMenuItems` (your rows in a column's menu, as data, above Hide: the old route, which adds rows only; `menus.column` reshapes the whole menu), and the per-user toggles `freezeIdentity` (the identity columns, everything through the title, pinned at the left edge; on by default, on the bare prop, in `LIST_VIEW_PREF_DEFAULTS` (`gridFreezeIdentity`), in a view's look and in the grid's look alike; hand `false`, or start your prefs with `gridFreezeIdentity: false`, to open it unpinned), `alwaysCheckboxes`, `verticalBorders` and `scale`; and `headerVerticalBorders` (the header's columns ruled as the rows' are under `verticalBorders`, the last bare; off by default); and `fillWidth` (the columns share the grid's whole width, each in proportion to its own width and never below it, a column the person resized or one with a `grid.maxWidth` keeping its width; a table wider than the grid scrolls sideways as without it; off by default).
14
14
  - Writes: `onCellCommit` (`GridCellCommitFn`) and `onCellsCommit` (`GridCellsCommitFn`).
15
15
  - States held from outside, each off when left out, as a page that shows the grid's states side by side needs them: `hoveredRow` (a row, by its id, drawn as under the pointer: its tint, its rail's box, its ⋯ and the name's actions, and `data-hovered`, while a real pointer still hovers any row beside it; drawn, as a hover is, only on a screen whose pointer hovers) and `onHoveredRowChange` (the row a person's pointer moves onto, or null off it); `cellPick` (a `GridCellPick` drawn as picked, placed each time its value changes without taking the page's focus; while it is given, null included, a press outside the grid lets go of nothing, and a person's click, drag, keys and Escape move it as always) and `onCellPickChange` (each change a person makes, or null); `openColumnMenu` (the column, by its id, whose menu stands open on the first row of column names, its header cell `data-open`; while it is given, null included, the menus open and close only as it says) and `onOpenColumnMenuChange` (the column a person's press opens, or null when a press, a row of the menu or a press outside closes it, for you to answer).
16
16
  - List config: `listConfig` (the settings layer every user of the list inherits, which may only take away from what the columns declare: the table read-only, per-column locks; a constraint on the screen, while your API guards its own writes). The grid only reads it: a surface of your own changes it.
17
+ - Per row: `rowWritable` (`(row) => boolean`, whether a row's cells write, for a reader who may edit some records and not others; a row it answers false for opens no editor, takes no typing, paste, fill, clear, cut or bulk-bar write, says "Cell is read-only" (`views.grid.cell-read-only`) when a person tries, and marks its cells `aria-readonly`; it only takes away from what the columns and `listConfig` allow; absent, every row writes as its columns say; called while the grid renders, so keep it pure and cheap; a constraint on the screen, while your API guards its own writes).
18
+ - `GridMenus` — the grid's menus as data, `GridTable`'s `menus`, typed over your row: `column(items, { field, column })`, `row(items, { row })` and `group(items, { group })`, each handed its menu's default items (`ViewsMenuItem[]`, every row keyed) and returning the items it shows. A menu with no function is as before. The helpers, the keys and the rules are [`/list`'s Menus as data](./list.md#menus-as-data).
17
19
  - `useGridTablePrefs` — wires a list's view preferences to the grid. It takes `prefs` (the list's `ListViewPrefs`), `setPrefs` (stores a patch of them), `columns` (whose money reading the number formats read) and `viewBacked`, and returns `{ gridProps }` to spread on `GridTable`: the borders, row icon, frozen identity, checkboxes and scale, the format overrides, the column state, the group figures and the footer figures, each with the handler that writes it back through `setPrefs`.
18
20
  - `useGridTableSettings` — wires a list's settings and a person's layer to the grid, for a list kept as `viewkitjs/fields/query`'s `ListSettings`. It takes `settings`, `layer` (the person's `ListPersonalLayer`), `columns` (the declared ones), `parts` (the same `parts` the grid takes, so a part column the settings place is drawn and moved as the grid draws it), `onChange` (a `ListSettingsChange`, never empty), `onLayerChange` (a layer patch), `defaults` (the reader's `ListDefaults`) and `formats` with `setFormats`, and returns `{ gridProps }` to spread on `GridTable`, as `useGridTablePrefs` does: a column hidden, moved, given a line break or a figure, and a group header's figures, come back through `onChange`; a resize through `onLayerChange` as the person's width (a width taken back by a double-click leaves it); a format through `setFormats`.
19
21
  - `GridFormatPrefs` — how a list's fields read, which `useGridTableSettings` takes apart from its settings: `gridOptionColors`, `gridDateStyles`, `gridDurationStyles`, `gridShowTime`, `gridPercentDisplays`, `gridDecimals` and `gridCurrencies`, each keyed by field key.
@@ -21,7 +23,7 @@ The spreadsheet. The door carries no client directive; every rendering file behi
21
23
  ## Sort, group and figures
22
24
 
23
25
  - `GridSortState` — the list's sort, as the header menu reads and writes it: `value` (the sort key in force; for a place column, the part key `partKey(fieldKey, part)` its menu picked, read with `parsePartKey`), `dir` and `onChange({ value, dir })`. The menu is a second control for the same stored sort your view's options drive.
24
- - `GridGroupByState` — the view's grouping, for the header menu's Group by and Ungroup: `fieldKey` (or null) and `onChange(fieldKey)`, null to ungroup. Present on lists backed by a saved view.
26
+ - `GridGroupByState` — the view's grouping, for the header menu's Group by and Ungroup: `fieldKey` (or null) and `onChange(fieldKey)`, null to ungroup. Wherever you keep the group (a saved view, the page's address), handing it offers Group by and Ungroup.
25
27
  - `GridGroupSortOption` — one sort a group band's menu offers, sorting the rows of every group at once: its `value`, `label` and an optional `defaultDir`.
26
28
  - `GridGroupFigure` — one figure a group's band can show, either a `GridDeclaredFigure` or a `GridDrawnFigure`. Both carry the summary `part` that turns it on.
27
29
  - `GridCellPick` — a picked cell and its ranges, `GridTable`'s `cellPick` and what `onCellPickChange` tells: `cell` (a `GridCellAt`) and `ranges`, optional, each `{ from, to }`, two `GridCellAt` corners, the last the active one, which carries the fill dot and the verbs. A record a grouping draws twice is picked on its first copy; a row or a column the grid doesn't draw waits until it does.
@@ -35,10 +37,14 @@ The spreadsheet. The door carries no client directive; every rendering file behi
35
37
 
36
38
  ## Writes
37
39
 
38
- - `GridCellCommitFn` — writes one cell: `(row, columnId, value, context?)`, returning a promise of nothing or a `GridCommitOutcome`. Nothing counts as confirmed; a rejection rolls the cell back. `context` is present on an undo or a redo.
40
+ - `gridSave` — the two commit functions over the one save your app gives: `gridSave(save, { getRowId, values?, read? })` returns `{ onCellCommit, onCellsCommit }` to spread on `GridTable`. Make it once per grid (at module scope, in a `useState` initializer, or a `useMemo` on a stable `save`): the queues live in what one call returns, so one made in a render starts each render with empty queues. Every write (an edit, a paste, a fill, an undo, a redo) is one `save` call per record, its cells' values merged, records in the order their first cell came. A record has one call in flight at a time; the next waits for it to settle, whatever it answered. When the page goes (`pagehide`), every change still waiting is sent at once, inside the event, with `closing: true`, and a change made while the page goes (an open editor's draft) is sent at once too, after what its record still had waiting; a call already out is not sent again, and may be dropped with the page. `values(row, columnId, value, context)` turns one cell's change into the values sent (default `{ [columnId]: value }`, fields bound by their key; two cells writing one key send the later one's); a throw there or in `getRowId` refuses that cell alone, its message said in the grid's toast, and the rest of its record still saves. A save that resolves `{ stored }` shows, in each cell one of whose keys it holds, what `read({ ...row, ...values, ...stored }, columnId)` reads (default `row[columnId]`; a `read` that throws leaves the cell as sent); a save that rejects, or throws, rolls back its record's cells with its error, the other records' cells standing. Neither function rejects.
41
+ - `GridSaveOptions` — what `gridSave` takes beside the save, typed over your row: `getRowId` (the record's id, sent as `ListChange`'s `id`), `values` (one cell's change as the values sent, `(row, columnId, value, context)`; throw to refuse that cell; default `{ [columnId]: value }`) and `read` (a column's value off a row, to read what `stored` kept; default `row[columnId]`).
42
+ - `ListChange` — one record's change, as `save` receives it: `{ id, row, values, closing? }`; `closing`: the page is going, so send it to outlive the page (`fetch(…, { keepalive: true })`, or a beacon), its request started before `save` awaits anything. Without `keepalive`, a request still waiting for a connection when the page has gone is dropped, and it often waits: the page usually goes while earlier saves still hold the browser's six connections to your server, and an undo of a fill is several saves sent at once. Two saves of one record may then be out together, the earlier one still running: a server that applies a record's writes in the order they arrive keeps the later one, the undo, last.
43
+ - `ListSave` — the save your app gives `gridSave`: `(change) => Promise<void | { stored?: Partial<Row> }>`.
44
+ - `GridCellCommitFn` — writes one cell: `(row, columnId, value, context?)`, returning a promise of nothing or a `GridCommitOutcome`. Nothing counts as confirmed; a rejection rolls the cell back. `context` is present on an undo or a redo, and on any write while the page closes.
39
45
  - `GridCellsCommitFn` — writes several cells at once (a paste, a fill, an undo of several): `(edits)`, each `{ row, columnId, value, context? }`, returning a promise of nothing or one outcome per edit, in order. A failed edit rolls its own cell back. Without it, or for a single cell, the grid calls `GridCellCommitFn` for each.
40
- - `GridCommitContext` — what a write is: `{ kind: "commit" }`, with `reload: false` when the caller reloads once after a second write, or `{ kind: "restore", expected }`, an undo or a redo writing a value back, `expected` the value the cell is held to before it.
41
- - `GridCommitOutcome` — how a write ended. `confirmed`, with an optional `history` (false keeps it out of undo, or `{ prev, next }` are the values undo and redo write instead), `settlement` (`requested`: the row holds the value but its provider has not accepted it yet, and the cell says so) and `stored` (what was kept, when it isn't what the cell sent, as the row reads it in this column: the cell shows it in place of what was typed, undo and redo restore from it, and no "changed elsewhere" follows; ignored on an undo or a redo); `unconfirmed`, never in the undo history; or `failed`, with an optional `error`, which rolls the cell back.
46
+ - `GridCommitContext` — what a write is: `{ kind: "commit" }`, with `reload: false` when the caller reloads once after a second write, or `{ kind: "restore", expected }`, an undo or a redo writing a value back, `expected` the value the cell is held to before it. Either carries `closing: true` when it is sent while the page goes (`pagehide`): send it so it outlives the page (`fetch(…, { keepalive: true })`), as `ListChange` says. An `onCellsCommit` call whose edits carry it starts every one's request inside the call, before it awaits anything: a fan-out that sends some rows only after others answer, or one row's cells one after another, sends the rest after the page has gone, where nothing carries them.
47
+ - `GridCommitOutcome` — how a write ended. `confirmed`, with an optional `history` (false keeps it out of undo, or `{ prev, next }` are the values undo and redo write instead), `settlement` (`requested`: the row holds the value but its provider has not accepted it yet, and the cell says so) and `stored` (what was kept, when it isn't what the cell sent, as the row reads it in this column: the cell shows it in place of what was typed, undo and redo restore from it, and no "changed elsewhere" follows; on an undo or a redo the cell shows it until the rows carry it, and the history is left as it was); `unconfirmed`, never in the undo history; or `failed`, with an optional `error`, which rolls the cell back.
42
48
 
43
49
  ## Helpers a binding shares
44
50