viewkitjs 0.38.0 → 0.40.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 (309) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/MIGRATION.md +32 -0
  3. package/fields/dist/derived.d.ts +7 -0
  4. package/fields/dist/derived.js +4 -0
  5. package/fields/dist/index.d.ts +1 -1
  6. package/fields/dist/index.js +1 -1
  7. package/fields/dist/messages.d.ts +5 -1
  8. package/fields/dist/messages.js +3 -0
  9. package/fields/dist/query/evaluate.d.ts +7 -1
  10. package/fields/dist/query/evaluate.js +8 -5
  11. package/fields/dist/query/figure-kinds.d.ts +2 -2
  12. package/fields/dist/query/figure-kinds.js +3 -0
  13. package/fields/dist/query/figures.d.ts +5 -3
  14. package/fields/dist/query/figures.js +13 -0
  15. package/fields/dist/query/filter.d.ts +7 -0
  16. package/fields/dist/query/filter.js +7 -1
  17. package/fields/dist/query/kit.d.ts +3 -2
  18. package/fields/dist/query/kit.js +1 -1
  19. package/fields/dist/query/layer.d.ts +6 -0
  20. package/fields/dist/query/layer.js +3 -0
  21. package/fields/dist/query/number.d.ts +3 -2
  22. package/fields/dist/query/number.js +5 -3
  23. package/fields/dist/query/read-rule.d.ts +1 -1
  24. package/fields/dist/query/read-rule.js +3 -0
  25. package/fields/docs/guides/queries.md +28 -24
  26. package/fields/docs/reference/fields.md +1 -0
  27. package/fields/docs/reference/query.md +9 -7
  28. package/package.json +2 -4
  29. package/postgres/dist/check.js +3 -1
  30. package/postgres/dist/definitions/storage.d.ts +3 -1
  31. package/postgres/dist/definitions/storage.js +3 -1
  32. package/postgres/dist/definitions/stored.js +13 -2
  33. package/postgres/dist/map.d.ts +5 -1
  34. package/postgres/dist/map.js +4 -0
  35. package/postgres/dist/records.js +6 -1
  36. package/postgres/docs/guides/definitions.md +1 -1
  37. package/postgres/docs/guides/field-map.md +3 -3
  38. package/postgres/docs/reference/postgres.md +1 -1
  39. package/views/dist/atoms/HeaderChrome.d.ts +7 -0
  40. package/views/dist/atoms/HeaderChrome.js +15 -0
  41. package/views/dist/atoms/ToolbarButton.d.ts +1 -1
  42. package/views/dist/atoms/ToolbarButton.js +2 -2
  43. package/views/dist/atoms/defaults.js +4 -0
  44. package/views/dist/atoms/types.d.ts +39 -2
  45. package/views/dist/contract.d.ts +38 -9
  46. package/views/dist/contract.js +64 -6
  47. package/views/dist/controls/avatar.css +1 -1
  48. package/views/dist/controls/customize/map-customize-body.js +1 -1
  49. package/views/dist/controls/field/field.d.ts +2 -14
  50. package/views/dist/controls/field/field.js +4 -9
  51. package/views/dist/controls/field/looks.d.ts +1 -1
  52. package/views/dist/controls/field/looks.js +7 -3
  53. package/views/dist/controls/field/tokens.d.ts +4 -0
  54. package/views/dist/controls/field/tokens.js +1 -0
  55. package/views/dist/controls/field.css +33 -0
  56. package/views/dist/controls/filter-editor/block.d.ts +3 -1
  57. package/views/dist/controls/filter-editor/block.js +4 -3
  58. package/views/dist/controls/filter-editor/filter-editor.d.ts +15 -2
  59. package/views/dist/controls/filter-editor/filter-editor.js +49 -16
  60. package/views/dist/controls/filter-editor/how.d.ts +11 -1
  61. package/views/dist/controls/filter-editor/map-filter-body.d.ts +4 -2
  62. package/views/dist/controls/filter-editor/map-filter-body.js +21 -11
  63. package/views/dist/controls/filter-editor/map-rules.d.ts +6 -4
  64. package/views/dist/controls/filter-editor/map-rules.js +7 -4
  65. package/views/dist/controls/filter-editor/parts.d.ts +14 -1
  66. package/views/dist/controls/filter-editor/parts.js +14 -0
  67. package/views/dist/controls/filter-editor.css +4 -1
  68. package/views/dist/controls/index.d.ts +0 -3
  69. package/views/dist/controls/index.js +0 -3
  70. package/views/dist/controls/input.css +1 -1
  71. package/views/dist/controls/internal/menu-items.d.ts +2 -0
  72. package/views/dist/controls/internal/menu-items.js +1 -1
  73. package/views/dist/controls/internal/part-slot.d.ts +1 -1
  74. package/views/dist/controls/internal/part-slot.js +1 -1
  75. package/views/dist/controls/internal/row-actions.d.ts +33 -0
  76. package/views/dist/controls/internal/row-actions.js +28 -0
  77. package/views/dist/controls/menu/map-menu.js +1 -1
  78. package/views/dist/controls/menu-list.css +1 -1
  79. package/views/dist/controls/picker/looks.d.ts +1 -1
  80. package/views/dist/controls/picker.css +2 -2
  81. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  82. package/views/dist/controls/popover/map-popover.js +2 -2
  83. package/views/dist/controls/press.css +0 -1
  84. package/views/dist/controls/radio/radio.d.ts +1 -1
  85. package/views/dist/controls/radio/radio.js +1 -16
  86. package/views/dist/controls/sheet/bottom-sheet.d.ts +2 -2
  87. package/views/dist/controls/sheet/bottom-sheet.js +31 -24
  88. package/views/dist/controls/sheet/map-sheet.js +9 -6
  89. package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
  90. package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
  91. package/views/dist/controls/sort-editor/sort-editor.js +41 -13
  92. package/views/dist/controls/text-editor.css +22 -0
  93. package/views/dist/controls/tokens.js +0 -6
  94. package/views/dist/controls/toolbar/toolbar.js +2 -2
  95. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +1 -1
  96. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +2 -2
  97. package/views/dist/editors/EditorPanel.js +1 -1
  98. package/views/dist/field-row/FieldRow.js +38 -16
  99. package/views/dist/field-row/editors/RowChipsEditor.js +3 -1
  100. package/views/dist/field-row/editors/RowDateEditor.js +3 -1
  101. package/views/dist/field-row/editors/RowNameEditor.js +3 -1
  102. package/views/dist/field-row/editors/RowPlaceEditor.js +4 -2
  103. package/views/dist/field-row/editors/RowRangeEditor.js +3 -1
  104. package/views/dist/field-row/editors/RowRelationEditor.js +5 -2
  105. package/views/dist/field-row/editors/RowSelectEditor.js +3 -1
  106. package/views/dist/field-row/editors/RowTextEditor.d.ts +7 -1
  107. package/views/dist/field-row/editors/RowTextEditor.js +28 -4
  108. package/views/dist/field-row/editors/RowValueListEditor.js +4 -4
  109. package/views/dist/field-row/editors/row-place.d.ts +33 -0
  110. package/views/dist/field-row/editors/row-place.js +141 -0
  111. package/views/dist/field-row/field-row-button.d.ts +9 -6
  112. package/views/dist/field-row/field-row-button.js +3 -3
  113. package/views/dist/field-row/row-target.d.ts +4 -1
  114. package/views/dist/field-row/row-target.js +1 -1
  115. package/views/dist/filters/duration-bound.d.ts +7 -0
  116. package/views/dist/filters/duration-bound.js +9 -0
  117. package/views/dist/filters/filter-model.d.ts +4 -0
  118. package/views/dist/filters/number-refused.d.ts +8 -0
  119. package/views/dist/filters/number-refused.js +4 -0
  120. package/views/dist/grid/chrome/GridAggregateMenu.d.ts +12 -11
  121. package/views/dist/grid/chrome/GridAggregateMenu.js +4 -3
  122. package/views/dist/grid/chrome/GridFooter.d.ts +12 -4
  123. package/views/dist/grid/chrome/GridFooter.js +11 -9
  124. package/views/dist/grid/chrome/GridHeader.js +4 -3
  125. package/views/dist/grid/chrome/GridResizeHandle.d.ts +7 -3
  126. package/views/dist/grid/chrome/GridResizeHandle.js +2 -3
  127. package/views/dist/grid/chrome/GridTable.js +1 -1
  128. package/views/dist/grid/chrome/GridTableSurface.js +1 -1
  129. package/views/dist/grid/chrome/grid-body-place.d.ts +2 -4
  130. package/views/dist/grid/chrome/grid-body-place.js +4 -5
  131. package/views/dist/grid/chrome/grid-figure-value.js +10 -4
  132. package/views/dist/grid/chrome/grid-table-props.d.ts +15 -4
  133. package/views/dist/grid/chrome/useGridTableInteractionModel.js +12 -2
  134. package/views/dist/grid/core/clipboard-model.js +42 -8
  135. package/views/dist/grid/core/commit-model.d.ts +3 -0
  136. package/views/dist/grid/core/editing-controller.d.ts +29 -1
  137. package/views/dist/grid/core/editing-controller.js +142 -12
  138. package/views/dist/grid/core/pending-reconciliation.d.ts +14 -0
  139. package/views/dist/grid/core/pending-reconciliation.js +20 -8
  140. package/views/dist/grid/core/save-path.d.ts +4 -2
  141. package/views/dist/grid/core/save-path.js +1 -1
  142. package/views/dist/grid/core/spreadsheet-operations.js +43 -5
  143. package/views/dist/grid/core/useGridEditing.d.ts +5 -1
  144. package/views/dist/grid/core/useGridEditing.js +4 -4
  145. package/views/dist/grid/core/written-alongside.d.ts +16 -0
  146. package/views/dist/grid/core/written-alongside.js +30 -0
  147. package/views/dist/grid/grid.css +8 -4
  148. package/views/dist/grid/index.d.ts +1 -1
  149. package/views/dist/grid/looks.d.ts +2 -2
  150. package/views/dist/internal/before-paint.d.ts +5 -0
  151. package/views/dist/internal/before-paint.js +17 -0
  152. package/views/dist/internal/field-rows.d.ts +0 -8
  153. package/views/dist/internal/field-rows.js +1 -3
  154. package/views/dist/internal/over-cell.d.ts +8 -0
  155. package/views/dist/internal/over-cell.js +5 -0
  156. package/views/dist/list/bar-keys.d.ts +8 -0
  157. package/views/dist/list/bar-keys.js +3 -0
  158. package/views/dist/list/bar-parts.d.ts +27 -0
  159. package/views/dist/list/bar-parts.js +38 -0
  160. package/views/dist/list/buttons/clear-save.d.ts +7 -0
  161. package/views/dist/list/buttons/clear-save.js +19 -0
  162. package/views/dist/list/buttons/customize.d.ts +28 -0
  163. package/views/dist/list/buttons/customize.js +31 -0
  164. package/views/dist/list/buttons/filter.d.ts +32 -0
  165. package/views/dist/list/buttons/filter.js +60 -0
  166. package/views/dist/list/buttons/new.d.ts +18 -0
  167. package/views/dist/list/buttons/new.js +21 -0
  168. package/views/dist/list/buttons/quick.d.ts +15 -0
  169. package/views/dist/list/buttons/quick.js +24 -0
  170. package/views/dist/list/buttons/search.d.ts +18 -0
  171. package/views/dist/list/buttons/search.js +17 -0
  172. package/views/dist/list/buttons/shared.d.ts +97 -0
  173. package/views/dist/list/buttons/shared.js +137 -0
  174. package/views/dist/list/buttons/sort-filter.d.ts +6 -0
  175. package/views/dist/list/buttons/sort-filter.js +16 -0
  176. package/views/dist/list/buttons/sort.d.ts +17 -0
  177. package/views/dist/list/buttons/sort.js +34 -0
  178. package/views/dist/list/buttons/views.d.ts +21 -0
  179. package/views/dist/list/buttons/views.js +38 -0
  180. package/views/dist/list/editor-menus.d.ts +13 -0
  181. package/views/dist/list/editor-menus.js +13 -0
  182. package/views/dist/list/edits.d.ts +3 -1
  183. package/views/dist/list/index.d.ts +41 -0
  184. package/views/dist/list/index.js +19 -0
  185. package/views/dist/list/layer.d.ts +13 -3
  186. package/views/dist/list/layer.js +13 -3
  187. package/views/dist/list/line.d.ts +58 -0
  188. package/views/dist/list/line.js +229 -0
  189. package/views/dist/list/list.d.ts +7 -1
  190. package/views/dist/list/list.js +2 -2
  191. package/views/dist/list/pane-box.d.ts +6 -0
  192. package/views/dist/list/pane-box.js +15 -0
  193. package/views/dist/list/panels/customize.d.ts +8 -0
  194. package/views/dist/list/panels/customize.js +23 -0
  195. package/views/dist/list/panels/filter-bar.d.ts +12 -0
  196. package/views/dist/list/panels/filter-bar.js +73 -0
  197. package/views/dist/list/panels/filter.d.ts +8 -0
  198. package/views/dist/list/panels/filter.js +23 -0
  199. package/views/dist/list/panels/quick.d.ts +7 -0
  200. package/views/dist/list/panels/quick.js +16 -0
  201. package/views/dist/list/panels/shared.d.ts +26 -0
  202. package/views/dist/list/panels/shared.js +36 -0
  203. package/views/dist/list/panels/sort.d.ts +8 -0
  204. package/views/dist/list/panels/sort.js +19 -0
  205. package/views/dist/list/panels/views.d.ts +13 -0
  206. package/views/dist/list/panels/views.js +27 -0
  207. package/views/dist/list/ready.d.ts +35 -0
  208. package/views/dist/list/ready.js +7 -0
  209. package/views/dist/list/root-base.d.ts +19 -1
  210. package/views/dist/list/root-base.js +13 -3
  211. package/views/dist/list/root.d.ts +1 -1
  212. package/views/dist/list/root.js +2 -2
  213. package/views/dist/list/store.d.ts +29 -0
  214. package/views/dist/list/store.js +48 -2
  215. package/views/dist/list/toolbar-model.d.ts +99 -0
  216. package/views/dist/list/toolbar-model.js +195 -0
  217. package/views/dist/list/toolbar.js +142 -329
  218. package/views/dist/list/views-axis.js +15 -4
  219. package/views/dist/list/views.d.ts +1 -1
  220. package/views/dist/list/views.js +4 -1
  221. package/views/dist/looks/index.d.ts +0 -1
  222. package/views/dist/looks/index.js +0 -1
  223. package/views/dist/looks/looks.d.ts +1 -1
  224. package/views/dist/looks/pieces.js +0 -2
  225. package/views/dist/model/aggregates.d.ts +18 -8
  226. package/views/dist/model/aggregates.js +16 -22
  227. package/views/dist/model/column-filters.js +10 -3
  228. package/views/dist/model/view-rules.js +1 -0
  229. package/views/dist/panels/filter/NumberFilterBody.js +6 -8
  230. package/views/dist/panels/labels.js +7 -2
  231. package/views/dist/panels/model.d.ts +3 -0
  232. package/views/dist/panels/react/filter/FilterEditor.d.ts +3 -1
  233. package/views/dist/panels/react/filter/FilterEditor.js +2 -2
  234. package/views/dist/panels/react/filter/filter-body.d.ts +3 -1
  235. package/views/dist/panels/react/filter/filter-body.js +7 -3
  236. package/views/dist/panels/react/sort/SortEditor.d.ts +3 -1
  237. package/views/dist/panels/react/sort/SortEditor.js +4 -4
  238. package/views/dist/panels/react/toolbar/Toolbar.d.ts +80 -3
  239. package/views/dist/panels/react/toolbar/Toolbar.js +85 -52
  240. package/views/dist/panels/react/toolbar/ToolbarBarSorts.d.ts +9 -0
  241. package/views/dist/panels/react/toolbar/ToolbarBarSorts.js +84 -0
  242. package/views/dist/panels/react/toolbar/ToolbarButton.d.ts +1 -1
  243. package/views/dist/panels/react/toolbar/ToolbarButton.js +5 -3
  244. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +4 -1
  245. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -2
  246. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +30 -0
  247. package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -1
  248. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  249. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
  250. package/views/dist/panels/react/toolbar/ToolbarViews.d.ts +7 -1
  251. package/views/dist/panels/react/toolbar/ToolbarViews.js +4 -4
  252. package/views/dist/panels/react/toolbar/context.d.ts +4 -0
  253. package/views/dist/panels/react/toolbar/context.js +1 -0
  254. package/views/dist/panels/react/toolbar/sheet-host.d.ts +3 -0
  255. package/views/dist/panels/react/toolbar/sheet-host.js +6 -0
  256. package/views/dist/panels/react/toolbar/use-give-way.d.ts +6 -0
  257. package/views/dist/panels/react/toolbar/use-give-way.js +10 -3
  258. package/views/dist/panels/react/views-row/ViewPicker.d.ts +8 -1
  259. package/views/dist/panels/react/views-row/ViewPicker.js +12 -7
  260. package/views/dist/panels/settings/filter-groups.js +12 -0
  261. package/views/dist/panels/settings/input.d.ts +11 -0
  262. package/views/dist/panels/settings/layout.js +26 -0
  263. package/views/dist/panels/settings/person.d.ts +15 -0
  264. package/views/dist/panels/settings/person.js +6 -0
  265. package/views/dist/panels/toolbar/page-resets.js +14 -3
  266. package/views/dist/provider/components.d.ts +47 -4
  267. package/views/dist/react.d.ts +1 -1
  268. package/views/dist/styles.css +116 -257
  269. package/views/dist/styles.unlayered.css +116 -257
  270. package/views/docs/contract.md +28 -18
  271. package/views/docs/controls/field.md +2 -1
  272. package/views/docs/controls/filter-editor.md +1 -1
  273. package/views/docs/controls/menu.md +1 -1
  274. package/views/docs/controls/sort-editor.md +1 -1
  275. package/views/docs/guides/atoms.md +1 -0
  276. package/views/docs/guides/looks.md +1 -1
  277. package/views/docs/guides/the-grid.md +6 -4
  278. package/views/docs/guides/toolbar-parts.md +337 -0
  279. package/views/docs/index.md +4 -0
  280. package/views/docs/reference/controls.md +6 -44
  281. package/views/docs/reference/field-row.md +1 -1
  282. package/views/docs/reference/grid.md +8 -7
  283. package/views/docs/reference/list.md +184 -11
  284. package/views/docs/reference/looks.md +13 -16
  285. package/views/docs/reference/panels-react.md +7 -7
  286. package/views/docs/reference/panels.md +1 -1
  287. package/views/docs/reference/react.md +14 -11
  288. package/views/docs/reference/views.md +9 -7
  289. package/views/skills/views/SKILL.md +2 -1
  290. package/views/dist/controls/setting-row/looks.d.ts +0 -10
  291. package/views/dist/controls/setting-row/looks.js +0 -22
  292. package/views/dist/controls/setting-row/setting-row.d.ts +0 -102
  293. package/views/dist/controls/setting-row/setting-row.js +0 -135
  294. package/views/dist/controls/setting-row/tokens.d.ts +0 -156
  295. package/views/dist/controls/setting-row/tokens.js +0 -41
  296. package/views/dist/controls/setting-row.css +0 -216
  297. package/views/dist/controls/switch-row/switch-row.d.ts +0 -1
  298. package/views/dist/controls/switch-row/switch-row.js +0 -1
  299. package/views/dist/controls/switch-row/tokens.d.ts +0 -39
  300. package/views/dist/controls/switch-row/tokens.js +0 -12
  301. package/views/dist/controls/switch-row.css +0 -35
  302. package/views/dist/controls/tag-field/tag-field.d.ts +0 -24
  303. package/views/dist/controls/tag-field/tag-field.js +0 -25
  304. package/views/dist/controls/tag-field/tokens.d.ts +0 -23
  305. package/views/dist/controls/tag-field/tokens.js +0 -8
  306. package/views/dist/controls/tag-field.css +0 -32
  307. package/views/docs/controls/setting-row.md +0 -44
  308. package/views/docs/controls/switch-row.md +0 -15
  309. package/views/docs/controls/tag-field.md +0 -11
@@ -0,0 +1,337 @@
1
+ # The toolbar's parts
2
+
3
+ `<List />` draws a list's toolbar as it always has. That toolbar is built from parts you can place yourself: its buttons, its panels, `ListLine` and `ListGap`. Write any of them under a `ListRoot`, or in a `ListSlot` elsewhere on the page through a `ListFill`, and it reads and changes the list with nothing wired. A part has no side or line setting: where you write it is where it stands, and a `ListGap` pushes what comes after it to the end of its line.
4
+
5
+ This page names every part, its settings with the default first (the default is always what `<List />` does), the switch that lets a person pick two things in their own Customize, and how the ready toolbar's props map onto the parts. It ends with six layouts, each one a page in ViewKit's test app (`/layouts/<name>`) whose code is the code shown here. Each part's full entry is in [`viewkitjs/views/list`](../reference/list.md): [buttons](../reference/list.md#a-lists-buttons-placed-anywhere), [panels](../reference/list.md#a-lists-panels-placed-anywhere) and [lines](../reference/list.md#a-lists-lines).
6
+
7
+ ## The parts
8
+
9
+ Buttons, each opening its panel:
10
+
11
+ | Part | What it is | Its settings, default first |
12
+ |---|---|---|
13
+ | `ListViews` | the saved views | `shows`: `tabs` · `button`; `layouts`, `menu`, `moreViews` |
14
+ | `ListSearch` | the search | `shows`: `button` · `input`; `words`: `icon` · `both` · `word`; `placeholder` |
15
+ | `ListSort` | the sort | `opens`; `empty`: `fields` · `editor`; `words` |
16
+ | `ListFilter` | the filter | `opens`; `empty`: `fields` · `editor`; `words` |
17
+ | `ListQuickFilters` | the quick filters the root was handed | `opens`; `words`: `icon` · `both` · `word` |
18
+ | `ListCustomize` | Customize | `opens`; `words`; `menu` |
19
+ | `ListSortFilter` | Sort and filter: shows and hides a `ListFilterBar shows="button"` | `words` |
20
+ | `ListClearSave` | Clear and Save, while the list differs from its view | none |
21
+ | `ListNew` | New | `onAdd` or `items`; `label`; `words` |
22
+
23
+ - `opens` (`ListOpens`): `popover`, at the button · `pane`, in your `Pane` beside the grid in a `ListPaneBox` · `sheet` · `bar` (`ListSort` and `ListFilter` only: the picked rule stands on the filter bar) · a function of yours, called with the button on a press while ViewKit opens nothing.
24
+ - `empty`: what Sort and Filter open with nothing set. `fields` is the field list. `editor` is the editor saying "No sorting set up yet" or "No filtering set up yet", with Add sort or Add filter.
25
+ - `words` (`ListWords`): `both` (icon and word) · `icon` · `word`. Search and Quick filters default to `icon`, every other button to `both`.
26
+
27
+ Panels, each standing open where you write it:
28
+
29
+ | Part | What it is | Its settings, default first |
30
+ |---|---|---|
31
+ | `ListFilterBar` | the filter bar: the standing rules, edited in place, and its + | `shows`: `filled` · `always` · `button`; `sorts`: `no` · `yes` |
32
+ | `ListFilterPanel` | every filter rule, with Add filter | `shows`: `always` · `filled` · `button` |
33
+ | `ListSortPanel` | every sort rule, with Add sort | `shows`: `always` · `filled` · `button` |
34
+ | `ListViewsPanel` | the views as a standing list, for a sidebar | `shows`: `always` · `button` |
35
+ | `ListQuickFiltersPanel` | the quick filters, standing | `shows`: `always` · `button` |
36
+ | `ListCustomizePanel` | Customize, standing | `shows`: `always` · `button` |
37
+
38
+ - `shows` (`ListPanelShows`): `always`, standing open · `filled`, once it holds something (the filter bar's default) · `button`, while its button shows it.
39
+ - `sorts`: `no` shows the sort as one pill while it differs from the view. `yes` stands each sort rule on the bar, where it is added and edited, and opens no sort editor.
40
+
41
+ Placing them:
42
+
43
+ | Part | What it is | Its settings, default first |
44
+ |---|---|---|
45
+ | `ListLine` | a toolbar line: its parts in your order, folding as the ready toolbar's line folds, taking no room while none of them draws anything | `kind`: `row` · `bar`; `more`, `overflow` |
46
+ | `ListGap` | empty room, pushing what follows it to the end of its line | none |
47
+ | `ListSlot` · `ListFill` | a place outside the root's tree (your header, your sidebar), and the parts you put in it from inside the root | `name` |
48
+ | `ListPaneBox` | the box round your grid where `opens="pane"` stands | `className` |
49
+ | `ListEditorMenus` | the sort, filter and group editors' menus as data, for every part under it | `sortEditor`, `filterEditor`, `groupEditor` |
50
+
51
+ Place each part once per root. Sort, Filter and Customize need a root that holds the list's `fields`.
52
+
53
+ ## A button and its panel
54
+
55
+ When a panel is placed under the same root as its button, the button opens no popover. It shows the panel if the panel isn't standing, moves the focus to it if it stands on its own, and hides it if it stands only because the button showed it. `ListViews` does this only with `shows="button"`. On a phone, a placed panel folds behind its button, which opens it as a sheet.
56
+
57
+ Atlas's three asks are three settings:
58
+
59
+ - `<ListFilter empty="editor" />` opens the filter editor straight away, even with nothing set.
60
+ - `<ListFilterBar shows="button" />` with `<ListSortFilter />`: one button brings the bar.
61
+ - `<ListFilterBar sorts="yes" />`: sorts are added and edited on the bar, with no popover.
62
+
63
+ ## What the person picks
64
+
65
+ `personSettings={{ bar, words }}` on `List` or `ListRoot` adds two rows to Layout in the person's own Customize. Both are off by default. `bar` lets them pick when the filter bar stands (Once added or Always). `words` lets them pick how the buttons show their words (Icon and word, Icon or Word). Each pick is kept in their own layer and never changes the shared view. Where the parts stand stays yours: [The person's own toolbar](../reference/list.md#the-persons-own-toolbar).
66
+
67
+ ## From the ready toolbar's props to the parts
68
+
69
+ Every prop still works on `List`, `ListToolbar` and `ReadyToolbar`. To move a list to the parts, write `ListRoot` with the same data props (`fields`, `rows` or `source`, `views`, `quickFilters`, `save`), and then:
70
+
71
+ - `sortFilter: "right"` (the default): `ListSort` and `ListFilter` in the row. `sortFilter: "bar"`: neither in the row, and the sort and the filters on a `ListFilterBar` in a `ListLine kind="bar"`.
72
+ - `bar: "added"` or `"always"`: `ListFilterBar shows="filled"` or `shows="always"`.
73
+ - `toolbarParts`: the order is the order you write; `line` and `side` become the `ListLine` you write a part in, before or after its `ListGap`; `words` becomes the part's `words`; `node` becomes your own element written in the line. `className`, `button` and `panel` have no part form yet: they stay `toolbarParts`'.
74
+ - `customizeIn: "pane"`: `<ListCustomize opens="pane" />`, with a `ListPaneBox` round your `ListGrid`.
75
+ - `hosts`: no part form one to one. A placed button's `opens` takes your function: ViewKit draws the button, and what opens is yours.
76
+ - `onAdd`, `addItems`, `addLabel`: `ListNew`'s `onAdd`, `items`, `label`. `quickFilters`: the root's `quickFilters`, and `ListQuickFilters` where you want its button.
77
+ - `searchPlaceholder`, `searching`: `ListSearch`'s `placeholder`, `searching`. `viewName`, `onRenameView`, `onCopyLink`, `onExport`, `exportCount`, `fieldEditor`: `ListCustomize`'s, the same names.
78
+ - `menus.view` and `moreViews`: `ListViews`' `menu` and `moreViews`. `menus.customize`: `ListCustomize`'s `menu`. `menus.more` and `overflow`: `ListLine`'s `more` and `overflow`. `menus.sortEditor`, `filterEditor`, `groupEditor`: a `ListEditorMenus` around the parts. `menus.add` has no part form: hand `ListNew` its `items` already shaped.
79
+ - `arrangement: "row"`: no part form. Write the lines you want.
80
+ - `phone` and `narrow`: nothing to write. A placed part follows the phone on its own, and a `ListLine` folds as it narrows.
81
+
82
+ ## Six layouts
83
+
84
+ Each layout below is one component that takes the list's data. `YourApp` stands in for your own app: a top bar, a sidebar and a page header, each holding a `ListSlot` that a layout fills from inside its root. In the test app each layout runs as a page with a browser test.
85
+
86
+ ```tsx
87
+ import type { ReactNode } from "react";
88
+ import type { ListRow } from "viewkitjs/fields/query";
89
+ import {
90
+ List,
91
+ ListClearSave,
92
+ ListCustomize,
93
+ ListFill,
94
+ ListFilter,
95
+ ListFilterBar,
96
+ ListFilterPanel,
97
+ ListGap,
98
+ ListGrid,
99
+ ListLine,
100
+ ListNew,
101
+ ListQuickFilters,
102
+ ListRoot,
103
+ ListSearch,
104
+ ListSlot,
105
+ ListSort,
106
+ ListSortFilter,
107
+ ListSortPanel,
108
+ ListViews,
109
+ ListViewsPanel,
110
+ type ListFieldsRegistry,
111
+ type ViewSeed,
112
+ } from "viewkitjs/views/list";
113
+ import type { QuickFiltersConfig } from "viewkitjs/views/panels";
114
+ ```
115
+
116
+ ```tsx
117
+ export type DealsProps = {
118
+ fields: ListFieldsRegistry;
119
+ rows: readonly ListRow[];
120
+ views: ViewSeed[];
121
+ quickFilters: QuickFiltersConfig;
122
+ onAdd: () => void;
123
+ };
124
+
125
+ // Your app: its top bar, its sidebar, the page's header. Each holds a slot a list's parts can fill, from inside its root.
126
+ export function YourApp({ children }: { children: ReactNode }) {
127
+ return (
128
+ <div className="your-app">
129
+ <header className="your-app-bar" data-zone="app-bar">
130
+ <strong>Acme CRM</strong>
131
+ <ListSlot name="app-bar" className="your-slot" />
132
+ </header>
133
+ <div className="your-app-body">
134
+ <nav className="your-sidebar" data-zone="sidebar">
135
+ <ListSlot name="app-sidebar" />
136
+ </nav>
137
+ <main className="your-page">
138
+ <header className="your-page-header" data-zone="page-header">
139
+ <h1>Deals</h1>
140
+ <ListSlot name="page-header" className="your-slot" />
141
+ </header>
142
+ {children}
143
+ </main>
144
+ </div>
145
+ </div>
146
+ );
147
+ }
148
+ ```
149
+
150
+ **The default** (`/layouts/default`): `<List />` alone draws today's toolbar, and your app's places stay empty.
151
+
152
+ ```tsx
153
+ // The default: <List /> alone draws today's toolbar. The row: Views, Customize, then Sort, Filter, Quick filters, Search and New
154
+ // at its end; under it the filter bar once something is added, with Clear and Save at its end.
155
+ export function DefaultLayout({ fields, rows, views, quickFilters, onAdd }: DealsProps) {
156
+ return (
157
+ <YourApp>
158
+ <List
159
+ id="deals"
160
+ fields={fields}
161
+ rows={rows}
162
+ views={{ seed: views, records: "deals" }}
163
+ quickFilters={quickFilters}
164
+ onAdd={onAdd}
165
+ link={false}
166
+ />
167
+ </YourApp>
168
+ );
169
+ }
170
+ ```
171
+
172
+ **Filters in a side column** (`/layouts/side-column`): the sort and filter panels stand beside the table.
173
+
174
+ ```tsx
175
+ // Filters in a side column: the sort and filter panels stand open beside the table, so the row holds no Sort or Filter.
176
+ export function SideColumnLayout({ fields, rows, views, quickFilters, onAdd }: DealsProps) {
177
+ return (
178
+ <YourApp>
179
+ <ListRoot id="deals" fields={fields} rows={rows} views={{ seed: views, records: "deals" }} quickFilters={quickFilters}>
180
+ <ListLine>
181
+ <ListViews />
182
+ <ListGap />
183
+ <ListSearch />
184
+ <ListCustomize />
185
+ <ListNew onAdd={onAdd} />
186
+ </ListLine>
187
+ <ListLine kind="bar">
188
+ <ListFilterBar />
189
+ <ListGap />
190
+ <ListClearSave />
191
+ </ListLine>
192
+ <div className="your-list-row">
193
+ <ListGrid />
194
+ <aside className="your-side-column" data-side-column>
195
+ <ListSortPanel />
196
+ <ListFilterPanel />
197
+ </aside>
198
+ </div>
199
+ </ListRoot>
200
+ </YourApp>
201
+ );
202
+ }
203
+ ```
204
+
205
+ **Views in the app's sidebar** (`/layouts/sidebar-views`): the views as your sidebar's list, and the search and New in the page header.
206
+
207
+ ```tsx
208
+ // Views in the app's sidebar: the views as a standing list in your sidebar, the search standing as a field and New in the page's
209
+ // header, both through a ListFill; the row keeps Sort, Filter, Quick filters and Customize.
210
+ export function SidebarViewsLayout({ fields, rows, views, quickFilters, onAdd }: DealsProps) {
211
+ return (
212
+ <YourApp>
213
+ <ListRoot id="deals" fields={fields} rows={rows} views={{ seed: views, records: "deals" }} quickFilters={quickFilters}>
214
+ <ListFill name="app-sidebar">
215
+ <ListViewsPanel />
216
+ </ListFill>
217
+ <ListFill name="page-header">
218
+ <ListLine>
219
+ <ListGap />
220
+ <ListSearch shows="input" />
221
+ <ListNew onAdd={onAdd} />
222
+ </ListLine>
223
+ </ListFill>
224
+ <ListLine>
225
+ <ListSort />
226
+ <ListFilter />
227
+ <ListQuickFilters />
228
+ <ListGap />
229
+ <ListCustomize />
230
+ </ListLine>
231
+ <ListLine kind="bar">
232
+ <ListFilterBar />
233
+ <ListGap />
234
+ <ListClearSave />
235
+ </ListLine>
236
+ <ListGrid />
237
+ </ListRoot>
238
+ </YourApp>
239
+ );
240
+ }
241
+ ```
242
+
243
+ **All in the page header** (`/layouts/page-header`): one line in the page header holds everything, and no row stands under it.
244
+
245
+ ```tsx
246
+ // All in the page header: the views' tabs and every button in the page's own header, through a ListFill, Sort, Filter and
247
+ // Customize as their icon alone; no row stands under it, only the filter bar once something is added.
248
+ export function PageHeaderLayout({ fields, rows, views, quickFilters, onAdd }: DealsProps) {
249
+ return (
250
+ <YourApp>
251
+ <ListRoot id="deals" fields={fields} rows={rows} views={{ seed: views, records: "deals" }} quickFilters={quickFilters}>
252
+ <ListFill name="page-header">
253
+ <ListLine>
254
+ <ListViews />
255
+ <ListGap />
256
+ <ListSearch />
257
+ <ListSort words="icon" />
258
+ <ListFilter words="icon" />
259
+ <ListCustomize words="icon" />
260
+ <ListNew onAdd={onAdd} />
261
+ </ListLine>
262
+ </ListFill>
263
+ <ListLine kind="bar">
264
+ <ListFilterBar />
265
+ <ListGap />
266
+ <ListClearSave />
267
+ </ListLine>
268
+ <ListGrid />
269
+ </ListRoot>
270
+ </YourApp>
271
+ );
272
+ }
273
+ ```
274
+
275
+ **No popovers** (`/layouts/no-popovers`): Atlas's ask. One button brings the bar, and sorts and filters are edited on it.
276
+
277
+ ```tsx
278
+ // No popovers: one button, Sort and filter, brings the filter bar, and every sort and filter is added and edited right on it.
279
+ export function NoPopoversLayout({ fields, rows, views, quickFilters, onAdd }: DealsProps) {
280
+ return (
281
+ <YourApp>
282
+ <ListRoot id="deals" fields={fields} rows={rows} views={{ seed: views, records: "deals" }} quickFilters={quickFilters}>
283
+ <ListLine>
284
+ <ListViews />
285
+ <ListCustomize />
286
+ <ListGap />
287
+ <ListSortFilter />
288
+ <ListSearch />
289
+ <ListNew onAdd={onAdd} />
290
+ </ListLine>
291
+ <ListLine kind="bar">
292
+ <ListFilterBar shows="button" sorts="yes" />
293
+ <ListGap />
294
+ <ListClearSave />
295
+ </ListLine>
296
+ <ListGrid />
297
+ </ListRoot>
298
+ </YourApp>
299
+ );
300
+ }
301
+ ```
302
+
303
+ **Search in the app bar** (`/layouts/app-bar-search`): the search stands as a field in your app's top bar.
304
+
305
+ ```tsx
306
+ // Search in the app bar: the search stands as a field at the end of your app's top bar, through a ListFill; the row holds the
307
+ // rest, as the default's.
308
+ export function AppBarSearchLayout({ fields, rows, views, quickFilters, onAdd }: DealsProps) {
309
+ return (
310
+ <YourApp>
311
+ <ListRoot id="deals" fields={fields} rows={rows} views={{ seed: views, records: "deals" }} quickFilters={quickFilters}>
312
+ <ListFill name="app-bar">
313
+ <ListLine>
314
+ <ListGap />
315
+ <ListSearch shows="input" />
316
+ </ListLine>
317
+ </ListFill>
318
+ <ListLine>
319
+ <ListViews />
320
+ <ListCustomize />
321
+ <ListGap />
322
+ <ListSort />
323
+ <ListFilter />
324
+ <ListQuickFilters />
325
+ <ListNew onAdd={onAdd} />
326
+ </ListLine>
327
+ <ListLine kind="bar">
328
+ <ListFilterBar />
329
+ <ListGap />
330
+ <ListClearSave />
331
+ </ListLine>
332
+ <ListGrid />
333
+ </ListRoot>
334
+ </YourApp>
335
+ );
336
+ }
337
+ ```
@@ -30,6 +30,10 @@ The grid:
30
30
  - [The grid](guides/the-grid.md): grouping, sorting, writes, preferences, figures and the editing rules
31
31
  - [Looks](guides/looks.md): a piece's options and looks, and picking the grid's by name
32
32
 
33
+ A list:
34
+
35
+ - [The toolbar's parts](guides/toolbar-parts.md): every part of a list's toolbar and its settings, placed anywhere, with six layouts to copy
36
+
33
37
  Reference material:
34
38
 
35
39
  - [The rendering contract](contract.md): every public name (slots, states, tokens, the components map, atoms, ports, icons, message keys) and what each door holds
@@ -95,7 +95,7 @@ A Button's own look (`ButtonOwnLook`, `buttonOwnOptions`, `buttonOwnAttrs`) is r
95
95
  - `SheetStep` — one step of a sheet, which a row opens in its place.
96
96
  - `SheetButton` — a button in its head: the Glass button under Glass, a quiet Button under Flat.
97
97
  - `SheetClose` — a close that is a button of its own (a head's Cancel).
98
- - `useSheetCloseAll` — closes every sheet open under this one and this one: a choice that finishes the job.
98
+ - `useSheetCloseAll` — closes every sheet open under this one and this one, an app's own sheet or dialog on Base UI under it included: a choice that finishes the job.
99
99
 
100
100
  <!-- The boxes: the Input, the inline input, the Field, the Toggle, the number field, the Checkbox -->
101
101
 
@@ -210,7 +210,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
210
210
  - `MenuScroll` — what scrolls in a menu's panel: its rows alone, the Scrollbar over them.
211
211
  - `MenuEntry` — a row of a menu: an action, a link, a tick, a choice or actions one level in, a pick under a heading, a group, a separator.
212
212
  - `MenuChoice` — a choice: its value, its name, its mark, its `detail` and its public name (`slot`, a `PartSlot`).
213
- - `PartSlot` — a part's public name (`slot`, its `data-slot`) and which one of its kind it is (`key`, its `data-key`; `index`, its `data-index`): what a `MenuEntry`, a `MenuChoice` and a `PickerItem` carry as `slot`, drawn on the row in every form (VK-988). A `pick` or a `group` names its rows through its choices or entries.
213
+ - `PartSlot` — a part's public name (`slot`, its `data-slot`, optional: a row with a key and no name draws `data-key` alone) and which one of its kind it is (`key`, its `data-key`; `index`, its `data-index`): what a `MenuEntry`, a `MenuChoice` and a `PickerItem` carry as `slot`, drawn on the row in every form (VK-988). A `pick` or a `group` names its rows through its choices or entries.
214
214
  - `MenuListEntry` — a menu's entry with what a row adds: a `note` under its name, an `end` on its right, a `grip`.
215
215
  - `MenuListTile` — one of the few done most, as a tile.
216
216
  - `tilesOf` — `tilesOf(entries, allRows?)`: the first four plain actions as tiles when there are three or more, the rest as rows.
@@ -276,7 +276,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
276
276
  - `useSheetMenus` — whether menus are the Sheet here: on a phone, or in a phone's screen standing on a page.
277
277
  - `MapMenu` — the components map's default `Menu` (`CONTROLS.Menu`): ViewKit's menu rows drawn as the Menu at their anchor; a row carrying its own `slot` drawn with it as its name.
278
278
  - `MapSelect` — the components map's default `Select` (`CONTROLS.Select`): the map's `ViewsSelectProps` drawn as ViewKit's own Select, its list as wide as its rows need, its rows one level in opened in place. The panels draw ViewKit's Select itself unless your own is opted in; hand or wrap this to have ViewKit's back.
279
- - `menuEntries` — `menuEntries(items, notNow?, rowSlot?)`: ViewKit's menu rows (`ViewsMenuItem`) as the Menu's own kinds: ticks that close side by side one pick, a group beside its row a level in, a disabled row saying why; handed `rowSlot` (VK-988), each row and choice named by it, `data-key` its item's key.
279
+ - `menuEntries` — `menuEntries(items, notNow?, rowSlot?)`: ViewKit's menu rows (`ViewsMenuItem`) as the Menu's own kinds: ticks that close side by side one pick, a group beside its row a level in, a disabled row saying why; each row and choice keyed by its item (`slot: { key }`, drawn `data-key`), and handed `rowSlot` (VK-988) named by it too.
280
280
 
281
281
  ## The Avatar
282
282
 
@@ -377,7 +377,7 @@ Its name here is `ToolbarButtonControl`: `viewkitjs/views/panels/react` already
377
377
 
378
378
  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.
379
379
 
380
- - `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.
380
+ - `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`).
381
381
  - `RadioGroupProps` — its props.
382
382
  - `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.
383
383
  - `RadioProps` — its props.
@@ -476,7 +476,7 @@ What an advanced filter opens on a computer and Filter on a phone, Attio's: the
476
476
  - `HOW` — each type's ways, in the order they are offered, the first a new rule's.
477
477
  - `CHECKED` — a yes/no's two values, Checked and Unchecked.
478
478
  - `wayOf` — a type's way by its value.
479
- - `FilterField` — a field a list filters by: a Picker row with its type, a choice's values, a related record's fields one level in.
479
+ - `FilterField` — a field a list filters by: a Picker row with its type, a choice's values, a related record's fields one level in, and its public name `key`, the `data-key` a rule on it draws where its `value` can't be one (absent, its `value`).
480
480
  - `FilterWay` — one way a type compares: its value, its words, what it takes.
481
481
  - `Takes` — what a way takes: one value, several, two, or none.
482
482
  - `FILTER_DEPTH` — how many levels deep rules stand at most: three.
@@ -980,7 +980,7 @@ The grip's `moved` and `dragAt`, the list a shell is handed (`handedList`) and t
980
980
  - `LinksEditorWords` — those words, and its roles list's own (`picker`).
981
981
  - `linksWords` — the words handed, over the English.
982
982
 
983
- <!-- The press and the choice: press.css, choice.css, the TagField, the setting row -->
983
+ <!-- The press and the choice: press.css, choice.css -->
984
984
 
985
985
  ## The pressing area
986
986
 
@@ -990,44 +990,6 @@ On a phone a small target keeps the size it draws and takes taps from an invisib
990
990
 
991
991
  The label beside a Checkbox, a Radio or a Switch in a settings row (`o-choice-label`, the small text in the text colour), the line under it (`o-choice-note`, the extra-small text in the subtle colour), and a choice drawn as a card (`o-choice-card`: an edge round it, the hovered ground under the pointer, the selected edge and ground when chosen, a softer edge when off, a red edge in error). Its stylesheet is `viewkitjs/views/controls/choice.css`, in the ready stylesheet. Its names are on [its page](../controls/choice.md).
992
992
 
993
- ## The TagField
994
-
995
- 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).
996
-
997
- - `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.
998
- - `TagFieldProps` — `label`, `note`, `error`, `disabled`, `defaultValue`, `onValueChange`, `placeholder`, `className`.
999
-
1000
- ## The setting row
1001
-
1002
- 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:
1003
-
1004
- - 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`).
1005
- - A select, `select` — a Select with its own list (its props but `label` and `size`): 36 tall, 220 wide.
1006
- - 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).
1007
- - › to its page, `onOpen` — the whole row a button, its `value` before ›.
1008
-
1009
- 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.
1010
-
1011
- `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).
1012
-
1013
- `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.
1014
-
1015
- - `SettingRow` — one row.
1016
- - `SettingRowProps` — its props: `label`, `note`, `icon`, `colour`, `mark`, `state`, `locked`, `alone`, `className`, and its kind.
1017
- - `SettingIcon` — a row's icon on its own (`colour`, its glyph as children), for a list that draws its names itself.
1018
- - `SettingChevron` — the phone row's ›, 9 × 15, on its own, at the end of a list's row that stands beside setting rows.
1019
- - `SettingRows` — the card.
1020
- - `useSettingRowWorn` — the setting row's options as the frame round an element picks them, kept up to date.
1021
- - `useSettingRowsRow` — true for a part placed in a computer's card under At the end, which stands as one of its rows.
1022
- - `SettingRowsProps` — the card's props: `danger`, `form`, `className`.
1023
- - `SettingAction` — a row's button: `label`, `icon`, `onClick`, `disabled`, `kind`, `iconOnly`.
1024
- - `SettingState` — a row's word of state.
1025
- - `SwitchRow` — the switch kind.
1026
- - `SwitchRowProps` — its props: every prop of the Switch, and its `label` and `note`.
1027
- - `SwitchRows` — the card round switch rows.
1028
- - `settingRowWornOf` — the options worn round an element.
1029
- - `SETTING_ROW_ATTRS` — the attributes they are set by.
1030
-
1031
993
  ## The stylesheets
1032
994
 
1033
995
  The ready stylesheet (`viewkitjs/views/styles.css`) carries the controls, every token they read declared at the Outright look's value ([the controls' tokens](../contract.md#the-controls-tokens)). An app on the Outright tokens imports them one by one instead, and declares each token as its own: `viewkitjs/views/controls/smooth.css` first (the smooth corner every control's outline stands on), then each control's own, `viewkitjs/views/controls/<piece>.css` (the Button's `button.css`, the Spinner's `spinner.css`), with `press.css` and `choice.css` for the pressing area and the words beside a choice; each control's names are on its page under `docs/controls/`. Their options and looks are on [`viewkitjs/views/looks`](looks.md).
@@ -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. 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. The row says its form in `data-form`: `computer` (one line), `phone` (the label above the value) or `rows` (a Field rows card's row on a phone); outside a card the two forms differ only by what reads it. A server render can't ask the screen, so a row outside a card stands in both forms, and a card stands whole in both, CSS showing the one your `desktopQuery` picks: a phone's first paint is the phone's, and as the page comes alive the screen's form is the one kept, the very elements the person saw. 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). As the editor takes the place of the row's button, the row holds the focus the button held until the editor takes it, so the focus never falls to the page: a dialog around the row that takes such a focus back to itself (Base UI's) leaves a text's or a number's editor open. 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 Tab pressed while that exit plays (a Tab at once after a pick by the keys) is the person going on: it is taken from the row's button once the button is back, so the focus lands on the next control after the row (Shift-Tab, the one before), as a later Tab does. 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. Under the Field's Action (`data-field-row-action="icon"` on a frame round the rows, `FIELD_LOOKS`), a writable row outside a card shows one icon at its box's end on hover and keyboard focus: `edit` where its editor opens in a popover, `expand` for a long text or a rich text, none where the box is the input, or the binding's `action`. 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. The row says its form in `data-form`: `computer` (one line), `phone` (the label above the value) or `rows` (a Field rows card's row on a phone); outside a card the two forms differ only by what reads it. A server render can't ask the screen, so a row outside a card stands in both forms, and a card stands whole in both, CSS showing the one your `desktopQuery` picks: a phone's first paint is the phone's, and as the page comes alive the screen's form is the one kept, the very elements the person saw. 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 (or, under the Field's Open, `data-field-row-open="over"` on a frame round the rows, on top of the row's box, its first line's words where the value's were and covering the box, nothing under it moving; flipped above, it keeps the same offsets; a name's, a range's, a place's and a single email's or domain's body open the same way) 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). As the editor takes the place of the row's button, the row holds the focus the button held until the editor takes it, so the focus never falls to the page: a dialog around the row that takes such a focus back to itself (Base UI's) leaves a text's or a number's editor open. 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 Tab pressed while that exit plays (a Tab at once after a pick by the keys) is the person going on: it is taken from the row's button once the button is back, so the focus lands on the next control after the row (Shift-Tab, the one before), as a later Tab does. 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), a long one ending before that action; under the Field's Link (`data-field-row-link="words"` on a frame round the rows, `FIELD_LOOKS` `row-link`), outside a phone's Field rows card, its words are the link instead and the rest of its box edits, the row's button laid under them as a rich text's is and named by the label alone, no action beside it; 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 value asked for one line (`opts.wrap: false`) ends in its "…" before the row's action, or at its box's end. 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. Under the Field's Action (`data-field-row-action="icon"` on a frame round the rows, `FIELD_LOOKS`), a writable row outside a card shows one icon at its box's end on hover and keyboard focus: `edit` where its editor opens in a popover, `expand` for a long text or a rich text, none where the box is the input, or the binding's `action`. 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. Under the Field's Long (`data-field-row-long="line"` on a frame round the rows, `FIELD_LOOKS` `row-long`), a writable long or rich text reads one line at rest, its end fading, and a writable text one line ending in "…"; on a desktop the long text's `TextBody` opens on top of the row's box in your `Popover` instead, its first line where the words were, growing down to `--vk-editor-max-h`, then scrolling, the row keeping its value under it; on a phone it stays in place. 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).
@@ -4,19 +4,19 @@ 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 (its ⋯ drawn only where the grid was handed something it opens: `selection`, `contextMenu`, `rowMenu`, `menus.row`, `rowHref`, `onRowDelete` or a name action), 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`.
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 (its ⋯ drawn only where the grid was handed something it opens: `selection`, `contextMenu`, `rowMenu`, `menus.row`, `rowHref`, `onRowDelete` or a name action), 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; one over a cell the rows now show holding a value that is neither side of the edit (someone wrote it since) leaves that cell as it is, sends nothing for it and says "Changed by someone since" (`views.grid.changed-since`), the rest of its cells undone as usual, and a cell whose own write or overlay is still out, or one written with no overlay (a relation, a name, a place, a range), is undone as before; 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
- - 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).
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; on a computer never pushed below its last row, so under a short table it stands right after it; on a phone an ungrouped grid's stands at the foot even when its rows don't fill the area, in pages just above the pager; a grouped grid's each pin while their group's rows run past the foot and close their group otherwise; a line along its top while rows pass under it; 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
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).
11
+ - Sort, group and figures: `sort` (`GridSortState`), `sortMark` (a sorted column's header wears `icons.sortAsc` or `icons.sortDesc` after its name, or your `HeaderSortMark` atom; 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), `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` (the lines between the columns, the last column's closing the table, in the rows and the footer, which then also draws a line under itself, pinned or not) and `scale`; and `headerVerticalBorders` (the header's columns ruled as the rows' are under `verticalBorders`, the last column's included; 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
- - Writes: `onCellCommit` (`GridCellCommitFn`) and `onCellsCommit` (`GridCellsCommitFn`).
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` (the lines between the columns, the last column's closing the table, in the rows and the footer; the footer draws a line under itself either way) and `scale`; and `headerVerticalBorders` (the header's columns ruled as the rows' are under `verticalBorders`, the last column's included; 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
+ - Writes: `onCellCommit` (`GridCellCommitFn`) and `onCellsCommit` (`GridCellsCommitFn`); `cellValues` (`GridCellValuesFn`, as `gridSave` hands it), so every column a cell's save writes beside its own shows the new value as the save is sent and rolls back with it.
15
15
  - `rowHighlight`: which row the grid tints. `"hover"`, the default, the row under the pointer, as always; `"active"`, the active row alone, `data-active`: the row a person last pressed, anywhere on it, or the picked cell's row, so the keyboard moves it too, kept through a press outside the grid and Escape until another is pressed or picked; no row tints under the pointer then, nor a `hoveredRow`, while the hover's box, ⋯ and the name's actions still show.
16
16
  - 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).
17
17
  - 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.
18
18
  - 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).
19
- - `GridMenus` — the grid's menus as data, `GridTable`'s `menus`, typed over your row: `column(items, { field, column })`, `row(items, { row })`, `group(items, { group })` and `addColumn(items, { columns })`, 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).
19
+ - `GridMenus` — the grid's menus as data, `GridTable`'s `menus`, typed over your row: `column(items, { field, column })`, `row(items, { row })`, `group(items, { group })`, `addColumn(items, { columns })` and `figure(items, { column, group, current })` (a footer cell's calculation picker), 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).
20
20
  - `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`. A format's patch hands its whole map with the field it changes present: its new setting, or `null` where it has none left (Automatic, Reset colors). A store that writes only the fields a patch names reads `null` as the clear; one that keeps the map as handed keeps the `null`, which the grid reads as no setting.
21
21
  - `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`, its patch shaped as `useGridTablePrefs`' is.
22
22
  - `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.
@@ -38,11 +38,12 @@ The spreadsheet. The door carries no client directive; every rendering file behi
38
38
 
39
39
  ## Writes
40
40
 
41
- - `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
+ - `gridSave` — the two commit functions over the one save your app gives: `gridSave(save, { getRowId, values?, read? })` returns `{ onCellCommit, onCellsCommit, cellValues }` to spread on `GridTable`: `cellValues` is the `values` below, which the grid reads every other column over, so a save that writes more than its cell's field (an amount and its direction) shows each column it changes as it is sent, and rolls them back with it. 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.
42
42
  - `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]`).
43
43
  - `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.
44
44
  - `ListSave` — the save your app gives `gridSave`: `(change) => Promise<void | { stored?: Partial<Row> }>`.
45
45
  - `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.
46
+ - `GridCellValuesFn` — one cell's change as the values its record's save sends, `(row, columnId, value, context)`: what `gridSave` hands back as `cellValues`, and `GridTable` takes as `cellValues`. The grid reads each other column (its `editAccessor`, else its `accessor`) over the row with those values, and shows, with the edit, each column whose field key they hold or whose read they change.
46
47
  - `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.
47
48
  - `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.
48
49
  - `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.