viewkitjs 0.29.0 → 0.30.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 (287) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/MIGRATION.md +97 -8
  3. package/package.json +1 -1
  4. package/views/dist/cells/cell-format.d.ts +2 -2
  5. package/views/dist/cells/cell-values.js +0 -2
  6. package/views/dist/contract.d.ts +15 -18
  7. package/views/dist/contract.js +13 -27
  8. package/views/dist/controls/controls.d.ts +2 -4
  9. package/views/dist/controls/controls.js +2 -2
  10. package/views/dist/controls/customize/customize.d.ts +51 -0
  11. package/views/dist/controls/customize/customize.js +128 -23
  12. package/views/dist/controls/customize/map-customize-body.d.ts +0 -3
  13. package/views/dist/controls/customize/map-customize-body.js +46 -11
  14. package/views/dist/controls/customize/map-ranges.d.ts +23 -0
  15. package/views/dist/controls/customize/map-ranges.js +41 -0
  16. package/views/dist/controls/customize/rules.d.ts +17 -1
  17. package/views/dist/controls/customize/rules.js +2 -0
  18. package/views/dist/controls/customize/words.d.ts +7 -0
  19. package/views/dist/controls/customize/words.js +5 -0
  20. package/views/dist/controls/customize.css +3 -0
  21. package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
  22. package/views/dist/controls/filter-editor/filter-editor.js +1 -0
  23. package/views/dist/controls/filter-editor/rules.d.ts +1 -2
  24. package/views/dist/controls/index.d.ts +8 -8
  25. package/views/dist/controls/index.js +8 -8
  26. package/views/dist/controls/menu-list/menu-list.d.ts +16 -1
  27. package/views/dist/controls/menu-list/menu-list.js +26 -8
  28. package/views/dist/controls/menu-list.css +8 -0
  29. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +1 -1
  30. package/views/dist/controls/quick-filters/map-quick-filters-body.js +6 -3
  31. package/views/dist/controls/sheet/map-sheet.js +1 -1
  32. package/views/dist/controls/text-editor/map-text-body.d.ts +1 -1
  33. package/views/dist/controls/text-editor/map-text-body.js +2 -2
  34. package/views/dist/controls/text-editor/text-editor.d.ts +3 -0
  35. package/views/dist/controls/text-editor/text-editor.js +16 -2
  36. package/views/dist/controls/text-editor.css +11 -0
  37. package/views/dist/controls/values-editor/values.js +6 -2
  38. package/views/dist/display/options.d.ts +1 -1
  39. package/views/dist/display/rich-text.js +0 -1
  40. package/views/dist/editors/ChipsEditor.d.ts +4 -5
  41. package/views/dist/editors/ChipsEditor.js +12 -78
  42. package/views/dist/editors/DateEditor.d.ts +12 -16
  43. package/views/dist/editors/DateEditor.js +40 -191
  44. package/views/dist/editors/EditorPanel.d.ts +2 -6
  45. package/views/dist/editors/EditorPanel.js +2 -2
  46. package/views/dist/editors/LocationEditor.d.ts +11 -19
  47. package/views/dist/editors/LocationEditor.js +19 -211
  48. package/views/dist/editors/NameEditor.d.ts +8 -16
  49. package/views/dist/editors/NameEditor.js +11 -100
  50. package/views/dist/editors/NumberEditor.d.ts +14 -21
  51. package/views/dist/editors/NumberEditor.js +22 -49
  52. package/views/dist/editors/RangeEditor.d.ts +9 -33
  53. package/views/dist/editors/RangeEditor.js +12 -97
  54. package/views/dist/editors/RelationEditor.d.ts +6 -9
  55. package/views/dist/editors/RelationEditor.js +11 -30
  56. package/views/dist/editors/RelationSetEditor.d.ts +13 -24
  57. package/views/dist/editors/RelationSetEditor.js +33 -101
  58. package/views/dist/editors/SelectEditor.d.ts +15 -17
  59. package/views/dist/editors/SelectEditor.js +15 -94
  60. package/views/dist/editors/TextEditor.d.ts +23 -26
  61. package/views/dist/editors/TextEditor.js +11 -48
  62. package/views/dist/editors/ValueListEditor.d.ts +14 -23
  63. package/views/dist/editors/ValueListEditor.js +16 -202
  64. package/views/dist/editors/body-panel.d.ts +13 -7
  65. package/views/dist/editors/body-panel.js +3 -7
  66. package/views/dist/editors/edit-cores.d.ts +15 -15
  67. package/views/dist/editors/edit-cores.js +14 -14
  68. package/views/dist/editors/number-body.d.ts +1 -1
  69. package/views/dist/editors/number-step.d.ts +0 -34
  70. package/views/dist/editors/number-step.js +0 -37
  71. package/views/dist/editors/option-add-flow.d.ts +1 -13
  72. package/views/dist/editors/option-add-flow.js +0 -22
  73. package/views/dist/editors/relation-links-body.d.ts +2 -3
  74. package/views/dist/editors/relation-picker.d.ts +13 -3
  75. package/views/dist/editors/relation-source.d.ts +0 -22
  76. package/views/dist/editors/relation-source.js +0 -21
  77. package/views/dist/field-row/FieldRow.js +5 -6
  78. package/views/dist/field-row/FieldRowLane.js +0 -1
  79. package/views/dist/field-row/editors/RowChipsEditor.js +2 -2
  80. package/views/dist/field-row/editors/RowDateEditor.d.ts +2 -2
  81. package/views/dist/field-row/editors/RowDateEditor.js +2 -2
  82. package/views/dist/field-row/editors/RowNameEditor.d.ts +2 -5
  83. package/views/dist/field-row/editors/RowNameEditor.js +7 -12
  84. package/views/dist/field-row/editors/RowNumberEditor.d.ts +1 -1
  85. package/views/dist/field-row/editors/RowNumberEditor.js +4 -4
  86. package/views/dist/field-row/editors/RowPlaceEditor.js +3 -3
  87. package/views/dist/field-row/editors/RowRangeEditor.d.ts +2 -5
  88. package/views/dist/field-row/editors/RowRangeEditor.js +7 -14
  89. package/views/dist/field-row/editors/RowRelationEditor.js +3 -3
  90. package/views/dist/field-row/editors/RowSelectEditor.js +2 -2
  91. package/views/dist/field-row/editors/RowTextEditor.d.ts +1 -1
  92. package/views/dist/field-row/editors/RowTextEditor.js +3 -4
  93. package/views/dist/field-row/editors/RowValueListEditor.js +5 -5
  94. package/views/dist/field-row/field-row-button.d.ts +6 -9
  95. package/views/dist/field-row/field-row-button.js +1 -6
  96. package/views/dist/field-row/field-row-checkbox.d.ts +1 -1
  97. package/views/dist/field-row/row-target.d.ts +0 -7
  98. package/views/dist/field-row/row-target.js +0 -2
  99. package/views/dist/grid/chrome/GridAddColumn.d.ts +2 -1
  100. package/views/dist/grid/chrome/GridAddColumn.js +8 -66
  101. package/views/dist/grid/chrome/GridAggregateMenu.d.ts +5 -7
  102. package/views/dist/grid/chrome/GridAggregateMenu.js +20 -39
  103. package/views/dist/grid/chrome/GridCellEditors.d.ts +2 -2
  104. package/views/dist/grid/chrome/GridCellEditors.js +12 -12
  105. package/views/dist/grid/chrome/GridChipsEditor.js +3 -3
  106. package/views/dist/grid/chrome/GridColumnMenu.d.ts +11 -12
  107. package/views/dist/grid/chrome/GridColumnMenu.js +32 -93
  108. package/views/dist/grid/chrome/GridDateEditor.d.ts +6 -6
  109. package/views/dist/grid/chrome/GridDateEditor.js +3 -3
  110. package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -6
  111. package/views/dist/grid/chrome/GridGroupMenu.js +21 -62
  112. package/views/dist/grid/chrome/GridHeader.d.ts +1 -2
  113. package/views/dist/grid/chrome/GridHeader.js +2 -2
  114. package/views/dist/grid/chrome/GridLongTextEditor.d.ts +17 -38
  115. package/views/dist/grid/chrome/GridLongTextEditor.js +6 -7
  116. package/views/dist/grid/chrome/GridNameEditor.js +4 -4
  117. package/views/dist/grid/chrome/GridNumberEditor.d.ts +4 -5
  118. package/views/dist/grid/chrome/GridNumberEditor.js +3 -4
  119. package/views/dist/grid/chrome/GridPlaceEditor.d.ts +2 -5
  120. package/views/dist/grid/chrome/GridPlaceEditor.js +5 -5
  121. package/views/dist/grid/chrome/GridRangeEditor.d.ts +6 -12
  122. package/views/dist/grid/chrome/GridRangeEditor.js +7 -15
  123. package/views/dist/grid/chrome/GridRelationEditor.js +5 -5
  124. package/views/dist/grid/chrome/GridRow.js +0 -3
  125. package/views/dist/grid/chrome/GridRowActions.d.ts +1 -1
  126. package/views/dist/grid/chrome/GridRowActions.js +0 -5
  127. package/views/dist/grid/chrome/GridRowCells.js +9 -6
  128. package/views/dist/grid/chrome/GridSelectEditor.js +3 -3
  129. package/views/dist/grid/chrome/GridStructure.js +0 -1
  130. package/views/dist/grid/chrome/GridTable.js +1 -1
  131. package/views/dist/grid/chrome/GridTextEditor.d.ts +5 -7
  132. package/views/dist/grid/chrome/GridTextEditor.js +4 -17
  133. package/views/dist/grid/chrome/GridValueListEditor.js +4 -4
  134. package/views/dist/grid/chrome/grid-body-place.d.ts +2 -3
  135. package/views/dist/grid/chrome/grid-body-place.js +4 -8
  136. package/views/dist/grid/chrome/grid-button.d.ts +7 -10
  137. package/views/dist/grid/chrome/grid-button.js +1 -6
  138. package/views/dist/grid/chrome/grid-cell-classes.js +1 -1
  139. package/views/dist/grid/chrome/grid-column-menu-items.d.ts +4 -4
  140. package/views/dist/grid/chrome/grid-column-menu-items.js +10 -6
  141. package/views/dist/grid/chrome/grid-group-menu-parts.d.ts +5 -9
  142. package/views/dist/grid/chrome/grid-group-menu-parts.js +1 -3
  143. package/views/dist/grid/chrome/grid-hover.js +0 -1
  144. package/views/dist/grid/chrome/grid-menu-focus.d.ts +7 -31
  145. package/views/dist/grid/chrome/grid-menu-focus.js +7 -47
  146. package/views/dist/grid/chrome/grid-styles.d.ts +0 -3
  147. package/views/dist/grid/chrome/grid-styles.js +0 -1
  148. package/views/dist/grid/chrome/grid-table-props.d.ts +6 -10
  149. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -4
  150. package/views/dist/grid/core/editing-controller.d.ts +2 -1
  151. package/views/dist/grid/core/editing-controller.js +10 -2
  152. package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
  153. package/views/dist/grid/core/refusal-sentence.js +2 -2
  154. package/views/dist/grid/core/write-states.d.ts +3 -1
  155. package/views/dist/grid/core/write-states.js +6 -2
  156. package/views/dist/grid/grid.css +1 -1
  157. package/views/dist/model/body-frame.d.ts +0 -32
  158. package/views/dist/model/body-frame.js +1 -15
  159. package/views/dist/model/column-inspect.d.ts +5 -5
  160. package/views/dist/model/column-inspect.js +2 -2
  161. package/views/dist/panels/customize-body.d.ts +1 -10
  162. package/views/dist/panels/customize-body.js +0 -3
  163. package/views/dist/panels/filter/MenuSelect.js +0 -5
  164. package/views/dist/panels/filter/RangeFilterBody.js +0 -1
  165. package/views/dist/panels/filter/details.d.ts +1 -5
  166. package/views/dist/panels/filter/details.js +0 -13
  167. package/views/dist/panels/filter/filter-list.d.ts +0 -1
  168. package/views/dist/panels/filter/filter-list.js +1 -1
  169. package/views/dist/panels/panel-button.d.ts +10 -12
  170. package/views/dist/panels/panel-button.js +1 -6
  171. package/views/dist/panels/react/chrome.d.ts +0 -17
  172. package/views/dist/panels/react/chrome.js +0 -8
  173. package/views/dist/panels/react/customize-body.d.ts +9 -12
  174. package/views/dist/panels/react/customize-body.js +57 -11
  175. package/views/dist/panels/react/customize.d.ts +9 -12
  176. package/views/dist/panels/react/customize.js +3 -112
  177. package/views/dist/panels/react/filter/FilterEditor.d.ts +4 -18
  178. package/views/dist/panels/react/filter/FilterEditor.js +6 -330
  179. package/views/dist/panels/react/filter/FilterFieldList.d.ts +1 -1
  180. package/views/dist/panels/react/filter/FilterFieldList.js +27 -59
  181. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +1 -11
  182. package/views/dist/panels/react/filter/PhoneFilterEditor.js +8 -144
  183. package/views/dist/panels/react/filter/editor-ctx.d.ts +1 -33
  184. package/views/dist/panels/react/filter/editor-ctx.js +5 -33
  185. package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -6
  186. package/views/dist/panels/react/filter/filter-part-body.js +0 -5
  187. package/views/dist/panels/react/filter/rule-writes.d.ts +1 -26
  188. package/views/dist/panels/react/filter/rule-writes.js +4 -95
  189. package/views/dist/panels/react/order-details.d.ts +1 -26
  190. package/views/dist/panels/react/order-details.js +3 -69
  191. package/views/dist/panels/react/panel-header.js +0 -1
  192. package/views/dist/panels/react/popover.d.ts +4 -7
  193. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +2 -4
  194. package/views/dist/panels/react/quick/QuickFiltersPanel.js +16 -137
  195. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -4
  196. package/views/dist/panels/react/sort/SortEditor.js +8 -245
  197. package/views/dist/panels/react/sort/SortFieldList.d.ts +1 -1
  198. package/views/dist/panels/react/sort/SortFieldList.js +11 -25
  199. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +2 -2
  200. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -16
  201. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  202. package/views/dist/panels/react/toolbar/ToolbarSave.js +0 -4
  203. package/views/dist/panels/react/toolbar/ToolbarSearch.js +0 -1
  204. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -3
  205. package/views/dist/panels/react/view-actions.js +0 -1
  206. package/views/dist/panels/react/views-row/FoldingViewRow.js +2 -5
  207. package/views/dist/panels/react/views-row/ViewCreatePill.js +0 -1
  208. package/views/dist/panels/react/views-row/ViewPicker.js +7 -43
  209. package/views/dist/panels/react/views-row/ViewPickerRow.js +0 -2
  210. package/views/dist/panels/react/views-row/menu-classes.d.ts +0 -4
  211. package/views/dist/panels/react/views-row/menu-classes.js +0 -2
  212. package/views/dist/panels/react.d.ts +5 -12
  213. package/views/dist/panels/react.js +5 -12
  214. package/views/dist/provider/ViewsProvider.d.ts +2 -46
  215. package/views/dist/provider/ViewsProvider.js +2 -22
  216. package/views/dist/provider/components.d.ts +153 -106
  217. package/views/dist/provider/context.d.ts +1 -21
  218. package/views/dist/provider/missing-slot.d.ts +3 -7
  219. package/views/dist/provider/missing-slot.js +2 -9
  220. package/views/dist/react.d.ts +1 -2
  221. package/views/dist/selection/SelectionBar.js +2 -3
  222. package/views/dist/styles.css +40 -168
  223. package/views/dist/styles.unlayered.css +40 -168
  224. package/views/docs/contract.md +99 -123
  225. package/views/docs/getting-started.md +222 -2
  226. package/views/docs/guides/cells.md +222 -2
  227. package/views/docs/guides/display.md +1 -1
  228. package/views/docs/guides/editors.md +235 -20
  229. package/views/docs/guides/ports.md +1 -1
  230. package/views/docs/guides/selection.md +1 -1
  231. package/views/docs/guides/the-grid.md +14 -16
  232. package/views/docs/guides/the-provider.md +9 -15
  233. package/views/docs/reference/cells.md +1 -1
  234. package/views/docs/reference/controls.md +26 -13
  235. package/views/docs/reference/editors-chips.md +2 -2
  236. package/views/docs/reference/editors-date.md +4 -4
  237. package/views/docs/reference/editors-location.md +4 -7
  238. package/views/docs/reference/editors-name.md +3 -5
  239. package/views/docs/reference/editors-number.md +10 -10
  240. package/views/docs/reference/editors-panel.md +3 -3
  241. package/views/docs/reference/editors-range.md +3 -5
  242. package/views/docs/reference/editors-relation.md +4 -4
  243. package/views/docs/reference/editors-select.md +3 -3
  244. package/views/docs/reference/editors-text.md +3 -4
  245. package/views/docs/reference/editors-value-list.md +3 -3
  246. package/views/docs/reference/field-row.md +1 -1
  247. package/views/docs/reference/grid.md +2 -2
  248. package/views/docs/reference/panels-react.md +20 -34
  249. package/views/docs/reference/react.md +11 -18
  250. package/views/docs/reference/views.md +5 -5
  251. package/views/skills/views/SKILL.md +1 -1
  252. package/views/dist/editors/relation-panel.d.ts +0 -69
  253. package/views/dist/editors/relation-panel.js +0 -46
  254. package/views/dist/grid/chrome/GridColumnColorSection.d.ts +0 -13
  255. package/views/dist/grid/chrome/GridColumnColorSection.js +0 -40
  256. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +0 -28
  257. package/views/dist/grid/chrome/GridColumnDateSection.js +0 -23
  258. package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +0 -23
  259. package/views/dist/grid/chrome/GridColumnDurationSection.js +0 -24
  260. package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +0 -29
  261. package/views/dist/grid/chrome/GridColumnNumberSection.js +0 -27
  262. package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +0 -16
  263. package/views/dist/grid/chrome/GridColumnPercentSection.js +0 -16
  264. package/views/dist/grid/chrome/GridColumnSortSection.d.ts +0 -38
  265. package/views/dist/grid/chrome/GridColumnSortSection.js +0 -33
  266. package/views/dist/grid/chrome/GridFlyout.d.ts +0 -44
  267. package/views/dist/grid/chrome/GridFlyout.js +0 -80
  268. package/views/dist/grid/chrome/GridMenuRow.d.ts +0 -15
  269. package/views/dist/grid/chrome/GridMenuRow.js +0 -15
  270. package/views/dist/grid/chrome/grid-menu-search.d.ts +0 -7
  271. package/views/dist/grid/chrome/grid-menu-search.js +0 -7
  272. package/views/dist/panels/react/GroupBucketsList.d.ts +0 -16
  273. package/views/dist/panels/react/GroupBucketsList.js +0 -44
  274. package/views/dist/panels/react/LayoutColumnsList.d.ts +0 -24
  275. package/views/dist/panels/react/LayoutColumnsList.js +0 -101
  276. package/views/dist/panels/react/PopoverColumnDetail.d.ts +0 -11
  277. package/views/dist/panels/react/PopoverColumnDetail.js +0 -24
  278. package/views/dist/panels/react/drag.d.ts +0 -2
  279. package/views/dist/panels/react/drag.js +0 -5
  280. package/views/dist/panels/react/layout-detail.d.ts +0 -4
  281. package/views/dist/panels/react/layout-detail.js +0 -29
  282. package/views/dist/panels/react/root-list.d.ts +0 -6
  283. package/views/dist/panels/react/root-list.js +0 -31
  284. package/views/dist/panels/react/sort/use-sort-drag.d.ts +0 -17
  285. package/views/dist/panels/react/sort/use-sort-drag.js +0 -39
  286. package/views/dist/panels/react/view-footer.d.ts +0 -20
  287. package/views/dist/panels/react/view-footer.js +0 -41
@@ -14,13 +14,13 @@ A member that is `null` is a decision: the type has no editor of its own. A `boo
14
14
  import assert from "node:assert/strict";
15
15
  import { EDIT_CORES, hasEditCore } from "viewkitjs/views/editors";
16
16
  import { SelectEditor } from "viewkitjs/views/editors/select";
17
- import { TextEditor } from "viewkitjs/views/editors/text";
17
+ import { TextEditorHost } from "viewkitjs/views/editors/text";
18
18
 
19
19
  assert.equal(EDIT_CORES.status, EDIT_CORES.select);
20
20
  assert.equal(EDIT_CORES.select, SelectEditor);
21
21
  assert.equal(EDIT_CORES.percent, EDIT_CORES.number);
22
- assert.equal(EDIT_CORES.text, TextEditor);
23
- assert.equal(EDIT_CORES.phone, TextEditor);
22
+ assert.equal(EDIT_CORES.text, TextEditorHost);
23
+ assert.equal(EDIT_CORES.phone, TextEditorHost);
24
24
  assert.equal(EDIT_CORES.boolean, null);
25
25
 
26
26
  assert.equal(hasEditCore("currency"), true);
@@ -44,25 +44,18 @@ What an editor hands back is a commit, which is not always the shape your row st
44
44
  | `viewkitjs/views/editors/name` | `name` | `{ full, given, family }`, or `null` |
45
45
  | `viewkitjs/views/editors/location` | `location` | the place's parts, or `null` |
46
46
  | `viewkitjs/views/editors/value-list` | a `multiple` email, phone, url or domain | a list of `{ value, label, main }`, the main one first, or `null` |
47
- | `viewkitjs/views/editors/date` | `date`, `datetime` | `YYYY-MM-DD`, or `YYYY-MM-DDTHH:MM` with a time; `""` from its Clear row |
47
+ | `viewkitjs/views/editors/date` | `date`, `datetime` | `YYYY-MM-DD`, or `YYYY-MM-DDTHH:MM` with a time; `""` from No date |
48
48
  | `viewkitjs/views/editors/chips` | `multiselect` | the list of values, a `string[]` |
49
49
 
50
50
  The value-list editor has no member in `EDIT_CORES`: a list of emails is still an `email` field, whose single value is a plain input. Each editor's reference page has its props and its close rule in full: [select](../reference/editors-select.md), [text](../reference/editors-text.md), [relation](../reference/editors-relation.md), [number](../reference/editors-number.md), [range](../reference/editors-range.md), [name](../reference/editors-name.md), [location](../reference/editors-location.md), [value list](../reference/editors-value-list.md), [date](../reference/editors-date.md) and [chips](../reference/editors-chips.md).
51
51
 
52
52
  ## A text box
53
53
 
54
- `TextEditor`, from `viewkitjs/views/editors/text`, is the one box for every text-like value: text, a link, an email, a phone, a domain, long text and rich text. It tidies what was typed (trimmed; rich text tidied only at its edges, so its first line keeps its indent), answers `noop` when the tidied text equals the tidied stored value, and brings each type's own phone keyboard (`TEXT_INPUT_TYPE`: a phone `tel`, an email `email`, a link or a domain `url`). A line closes on Enter; a paragraph (`multiline`, the default for rich text) takes Enter as a newline and closes on ⌘ or Ctrl Enter. Escape discards, Tab and Shift-Tab close with their reason, and leaving the box closes it unless you pass `closeOnBlur={false}`, which a host inside a popover or a sheet does, so a tap on ✕ or ✓ is not a close. A line draws through your `Input`; a paragraph is the package's own textarea.
55
-
56
- ```tsx
57
- import { TEXT_INPUT_TYPE } from "viewkitjs/views/editors/text";
58
-
59
- assert.equal(TEXT_INPUT_TYPE.phone, "tel");
60
- assert.equal(TEXT_INPUT_TYPE.domain, "url");
61
- ```
54
+ `TextEditorHost`, from `viewkitjs/views/editors/text`, is the one editor for every text-like value: text, a link, an email, a phone, a domain, long text and rich text. It opens your `TextBody` (`CONTROLS.TextBody` is ViewKit's own), which draws the box and brings each type's own phone keyboard, and keeps the draft: it tidies what was typed (trimmed; rich text tidied only at its edges, so its first line keeps its indent) and answers `noop` when the tidied text equals the tidied stored value. A line closes on Enter; a paragraph (`multiline`, the default for rich text) takes Enter as a newline and closes on ⌘ or Ctrl Enter. Escape discards, Tab and Shift-Tab close with their reason, and leaving the body closes it unless you pass `closeOnBlur={false}`, which a host inside a popover or a sheet does, so a tap on ✕ or ✓ is not a close. A text opened only to be read (`readOnly`) has no body form: it draws ViewKit's own textarea, and every close is a `noop`.
62
55
 
63
56
  ## What an editor owns, and what you own
64
57
 
65
- An editor owns its panel and what a close means. The select editor owns its rows and decides that a pick commits and every other close discards; the date editor owns its value bar and its calendar (or opens your app's own `DateBody` in their place, keeping the draft) and decides that Escape discards and every other close commits a changed draft. You own everything around the panel: the popover it sits in, the anchor that popover opens on, where focus goes, when a close happens, and the write. Where it opens your app's own body (`Picker`, `PartsBody`, `ValuesBody` or `LinksBody`), the popover around it keeps ViewKit's width and padding, unless the provider's `bodyFrame` is `popover`: then it stands at your `Popover`'s own width, marked `data-vk-body` ([the provider](the-provider.md)).
58
+ An editor owns its panel and what a close means. The select editor owns its rows and decides that a pick commits and every other close discards; the date editor opens your app's `DateBody`, keeping the draft, and decides that Escape discards and every other close commits a changed draft. You own everything around the panel: the popover it sits in, the anchor that popover opens on, where focus goes, when a close happens, and the write. Where it opens your app's own body (`Picker`, `PartsBody`, `ValuesBody` or `LinksBody`), the popover around it stands at your `Popover`'s own width, marked `data-vk-body` ([the provider](the-provider.md)).
66
59
 
67
60
  The two speak through one handshake, the `CloseReason` and `CloseResolution` of `viewkitjs/fields`:
68
61
 
@@ -124,8 +117,9 @@ type Deal = { id: string; title: string; stage: string; industry: string | null;
124
117
  const conventions = defineConventions({ locale: "en-GB", timeZone: "Europe/Bucharest" });
125
118
 
126
119
  const components: ViewsComponents = {
127
- Button: ({ children, onClick, disabled, type = "button", className, title }) => (
128
- <button type={type} onClick={onClick} disabled={disabled} className={className} title={title}>
120
+ // It draws every button ViewKit draws itself, so it forwards the ref and every prop it is handed to its element.
121
+ Button: ({ children, variant: _variant, size: _size, type = "button", ...rest }) => (
122
+ <button type={type} {...rest}>
129
123
  {children}
130
124
  </button>
131
125
  ),
@@ -176,6 +170,227 @@ const components: ViewsComponents = {
176
170
  Sheet: ({ open, children }) => (open ? <div role="dialog">{children}</div> : null),
177
171
  AppIcon: ({ name, className }) => <i data-icon={name} className={className} />,
178
172
  Markdown: ({ source, className }) => <div className={className}>{source}</div>,
173
+ // The required bodies: a box for a text and one for a number, each handing every change as it is made, a pick list, a
174
+ // relation's links, a date, a name, a place or a range, and several values.
175
+ TextBody: ({ label, value, onValueChange, onDone }) => (
176
+ <input
177
+ aria-label={label}
178
+ value={value}
179
+ onChange={(event) => onValueChange(event.target.value)}
180
+ onKeyDown={(event) => event.key === "Enter" && onDone()}
181
+ />
182
+ ),
183
+ NumberBody: ({ label, value, onValueChange, onDone }) => (
184
+ <input
185
+ aria-label={label}
186
+ inputMode="decimal"
187
+ value={value == null || Number.isNaN(value) ? "" : String(value)}
188
+ onChange={(event) => onValueChange(event.target.value === "" ? null : Number(event.target.value))}
189
+ onKeyDown={(event) => event.key === "Enter" && onDone()}
190
+ />
191
+ ),
192
+ // A pick list: a row per item handed, a press picking one (or ticking it in a list of several).
193
+ Picker: ({ label, items, value, onValueChange, onDone, multiple }) => {
194
+ const held = Array.isArray(value) ? value : value === null ? [] : [value];
195
+ return (
196
+ <div role="listbox" aria-label={label}>
197
+ {items.map((item) => (
198
+ <div
199
+ key={item.value}
200
+ role="option"
201
+ aria-selected={held.includes(item.value)}
202
+ data-status={item.slot}
203
+ data-chosen={held.includes(item.value) || undefined}
204
+ onClick={() => {
205
+ if (!multiple) return onValueChange(item.value), onDone();
206
+ onValueChange(held.includes(item.value) ? held.filter((v) => v !== item.value) : [...held, item.value]);
207
+ }}
208
+ >
209
+ {item.label}
210
+ </div>
211
+ ))}
212
+ </div>
213
+ );
214
+ },
215
+ // A relation's links: a row per record, a press linking or unlinking it, and Done.
216
+ LinksBody: ({ label, items, links, onLinksChange, onDone }) => (
217
+ <div role="listbox" aria-label={label}>
218
+ {items.map((item) => {
219
+ const linked = links.some((link) => link.value === item.value);
220
+ return (
221
+ <div
222
+ key={item.value}
223
+ role="option"
224
+ aria-selected={linked}
225
+ onClick={() =>
226
+ onLinksChange(linked ? links.filter((link) => link.value !== item.value) : [...links, { value: item.value, roles: [] }])
227
+ }
228
+ >
229
+ {item.label}
230
+ </div>
231
+ );
232
+ })}
233
+ <button type="button" onClick={onDone}>
234
+ Done
235
+ </button>
236
+ </div>
237
+ ),
238
+ // A date: a line holding the day ("YYYY-MM-DD", or with "THH:MM"), Enter for done.
239
+ // Uncontrolled: the editor takes only a whole date, so a line it held would undo every key typed on the way to one.
240
+ DateBody: ({ label, value, onValueChange, onDone }) => (
241
+ <input
242
+ aria-label={label}
243
+ defaultValue={value ?? ""}
244
+ onChange={(event) => onValueChange(event.target.value === "" ? null : event.target.value)}
245
+ onKeyDown={(event) => event.key === "Enter" && onDone()}
246
+ />
247
+ ),
248
+ // A name, a place or a range: a box per part, Enter for done.
249
+ PartsBody: (props) => {
250
+ const done = (event: { key: string }) => event.key === "Enter" && props.onDone();
251
+ if (props.kind === "range") {
252
+ const { value, onValueChange } = props;
253
+ const end = (text: string) => (text === "" ? null : Number(text));
254
+ return (
255
+ <div role="group" aria-label={props.label}>
256
+ <input aria-label="From" value={value.low ?? ""} onChange={(event) => onValueChange({ ...value, low: end(event.target.value) })} onKeyDown={done} />
257
+ <input aria-label="To" value={value.high ?? ""} onChange={(event) => onValueChange({ ...value, high: end(event.target.value) })} onKeyDown={done} />
258
+ </div>
259
+ );
260
+ }
261
+ if (props.kind === "name") {
262
+ const { value, onValueChange } = props;
263
+ return (
264
+ <div role="group" aria-label={props.label}>
265
+ {(["given", "family", "full"] as const).map((part) => (
266
+ <input key={part} aria-label={part} value={value[part]} onChange={(event) => onValueChange({ ...value, [part]: event.target.value })} onKeyDown={done} />
267
+ ))}
268
+ </div>
269
+ );
270
+ }
271
+ const { value, onValueChange } = props;
272
+ return (
273
+ <div role="group" aria-label={props.label}>
274
+ {props.parts.map((part) => (
275
+ <input key={part} aria-label={props.words[part]} value={value[part] ?? ""} onChange={(event) => onValueChange({ ...value, [part]: event.target.value })} onKeyDown={done} />
276
+ ))}
277
+ </div>
278
+ );
279
+ },
280
+ // Several emails, phones, links or domains: a box per value, and a line that adds one on Enter (Enter on it empty is done).
281
+ ValuesBody: ({ label, value, onValueChange, onDone }) => (
282
+ <div role="group" aria-label={label}>
283
+ {value.map((line, at) => (
284
+ <input
285
+ key={at}
286
+ aria-label={label}
287
+ value={line.value}
288
+ onChange={(event) => onValueChange(value.map((each, i) => (i === at ? { ...each, value: event.target.value } : each)))}
289
+ />
290
+ ))}
291
+ <input
292
+ aria-label={`Add to ${label}`}
293
+ onKeyDown={(event) => {
294
+ if (event.key !== "Enter") return;
295
+ const text = event.currentTarget.value.trim();
296
+ if (text === "") return onDone();
297
+ onValueChange([...value, { value: text, main: value.length === 0 }]);
298
+ event.currentTarget.value = "";
299
+ }}
300
+ />
301
+ </div>
302
+ ),
303
+ // The toolbar's panels: your app draws each whole body (CONTROLS hands ViewKit's own). Here, each at its plainest.
304
+ SortBody: ({ label, options, onRulesChange, onDone }) => (
305
+ <div role="group" aria-label={label}>
306
+ {options.map((option) => (
307
+ <button key={option.value} type="button" onClick={() => onRulesChange([{ value: option.value, dir: "asc" }])}>
308
+ {option.label}
309
+ </button>
310
+ ))}
311
+ <button type="button" onClick={onDone}>
312
+ Done
313
+ </button>
314
+ </div>
315
+ ),
316
+ FilterBody: ({ label, filter, onFilterChange, onDone }) => (
317
+ <div role="group" aria-label={label}>
318
+ <button type="button" onClick={() => onFilterChange({ ...filter, items: [] })}>
319
+ Clear all
320
+ </button>
321
+ <button type="button" onClick={onDone}>
322
+ Done
323
+ </button>
324
+ </div>
325
+ ),
326
+ FilterPartBody: ({ label, rule, ways, onRuleChange, onDone }) => (
327
+ <div role="group" aria-label={label}>
328
+ {ways.map((way) => (
329
+ <button key={way.value} type="button" onClick={() => onRuleChange({ ...rule, operator: way.value })}>
330
+ {way.label}
331
+ </button>
332
+ ))}
333
+ <button type="button" onClick={onDone}>
334
+ Done
335
+ </button>
336
+ </div>
337
+ ),
338
+ FieldsBody: ({ label, fields, onPick }) => (
339
+ <div role="listbox" aria-label={label}>
340
+ {fields.map((field) => (
341
+ <div key={field.key} role="option" aria-selected={false} onClick={() => onPick(field.key)}>
342
+ {field.label}
343
+ </div>
344
+ ))}
345
+ </div>
346
+ ),
347
+ QuickFiltersBody: ({ label, fields, onHoldChange }) => (
348
+ <div role="group" aria-label={label}>
349
+ {fields.flatMap((field) =>
350
+ field.values.map((value) => (
351
+ <button
352
+ key={`${field.key}:${value.value}`}
353
+ type="button"
354
+ aria-pressed={value.held}
355
+ onClick={() => onHoldChange([{ fieldKey: field.key, values: [value.value] }])}
356
+ >
357
+ {value.label}
358
+ </button>
359
+ ))
360
+ )}
361
+ </div>
362
+ ),
363
+ ViewsListBody: ({ label, views, value, onViewChange, onDone }) => (
364
+ <div role="listbox" aria-label={label}>
365
+ {views.map((view) => (
366
+ <div
367
+ key={view.value}
368
+ role="option"
369
+ aria-selected={view.value === value}
370
+ onClick={() => {
371
+ onViewChange(view.value);
372
+ onDone();
373
+ }}
374
+ >
375
+ {view.label}
376
+ </div>
377
+ ))}
378
+ </div>
379
+ ),
380
+ // Customize: your app draws its whole body (CONTROLS.CustomizeBody is ViewKit's own). Here, its name, the layout's toggles and Done.
381
+ CustomizeBody: ({ label, layout, onDone }) => (
382
+ <div role="group" aria-label={label}>
383
+ {(layout?.toggles ?? []).map((toggle) => (
384
+ <label key={toggle.key}>
385
+ <input type="checkbox" checked={toggle.value} onChange={(event) => toggle.onChange(event.target.checked)} />
386
+ {toggle.label}
387
+ </label>
388
+ ))}
389
+ <button type="button" onClick={onDone}>
390
+ Done
391
+ </button>
392
+ </div>
393
+ ),
179
394
  };
180
395
 
181
396
  const icons = Object.fromEntries(
@@ -250,7 +465,7 @@ function DealStageEditor({
250
465
  }
251
466
  ```
252
467
 
253
- Rendered inside the provider, the panel draws each option as your status badge and marks the stage the deal holds.
468
+ Rendered inside the provider, the panel hands your `Picker` each option with its status slot and the stage the deal holds.
254
469
 
255
470
  ```tsx
256
471
  import { renderToStaticMarkup } from "react-dom/server";
@@ -265,8 +480,8 @@ const stageHtml = renderToStaticMarkup(
265
480
  );
266
481
 
267
482
  assert.ok(stageHtml.includes("Won") && stageHtml.includes("Lost"));
268
- assert.ok(stageHtml.includes('data-status="success"')); // each option wears its slot
269
- assert.ok(stageHtml.includes("data-chosen")); // the stage the deal holds is checked
483
+ assert.ok(stageHtml.includes('data-status="success"')); // each option is handed its slot
484
+ assert.ok(stageHtml.includes("data-chosen")); // and the stage the deal holds
270
485
  ```
271
486
 
272
487
  A pick of Won calls `close("pick")`; the editor answers `{ kind: "commit", payload: "won" }`, `saveDeal` sends `{ stage: "won" }`, and 160 milliseconds later `onClosed` runs. A pick of New, which the deal already holds, answers `noop`, and an outside press or Escape answers `cancel`: nothing is sent either way, and the popover still closes.
@@ -381,7 +596,7 @@ function IndustryPanel({
381
596
 
382
597
  ## Adding an option from a cell
383
598
 
384
- When a field's options belong to your app (a workspace's own list, kept in your data), a word typed in its cell that no option holds can become a new option. Hand the field's binding an `addOption`: ViewKit offers **+ Add “word”** after the matches in the select and several-values pickers, in the grid and in a record's field row, asks your add, and picks (one) or adds and checks (several) the option it returns. A word an option already names, ignoring spaces at either end, case and accents, picks that option and never asks.
599
+ When a field's options belong to your app (a workspace's own list, kept in your data), a word typed in its cell that no option holds can become a new option. Hand the field's binding an `addOption`: ViewKit hands the select's and several-values' `Picker` **+ Add** (`onAdd`, `adding`, `addRefused`), in the grid and in a record's field row, asks your add, and picks (one) or adds and checks (several) the option it returns. A word an option already names, ignoring spaces at either end, case and accents, picks that option and never asks. `CONTROLS.Picker` doesn't draw + Add yet: an app that wants it hands a Picker of its own that reads `onAdd`.
385
600
 
386
601
  ```tsx
387
602
  import { bindField, type OptionAdd } from "viewkitjs/views";
@@ -461,7 +676,7 @@ assert.equal(RELATION_PAGE_SIZE, 20); // a page, when the source names no pageSi
461
676
 
462
677
  A page shorter than `pageSize` is how the panel knows the list has ended, so `pageSize` must be what your search really asks its route for: a mismatch ends the list early, or asks once more for nothing.
463
678
 
464
- The editor itself takes the source as `candidates`, the linked id as `initial`, and `clearable` for a None row. It commits the picked id, or `null` for None, and only on a pick; every other close discards. Its host is the stage host above with `RelationEditorHandle` in place of `SelectEditorHandle`:
679
+ The editor itself takes the source as `candidates`, the linked id as `initial`, and `clearable` for the Picker's empty row. It commits the picked id, or `null` for the empty row, and only on a pick; every other close discards. Its host is the stage host above with `RelationEditorHandle` in place of `SelectEditorHandle`:
465
680
 
466
681
  ```tsx
467
682
  function CompanyPanel({
@@ -51,7 +51,7 @@ declare function openConfirmDialog(options: {
51
51
 
52
52
  The grid speaks through two of them:
53
53
 
54
- - **`error`** when it refuses something and says why: an edit or a clear on a cell that can't take one, a value its column can't store, the cells of a paste that could not take their value, a clear over a range with nothing clearable, a delete your app rejected (`views.menus.row-delete-failed`), an edit your app refused when the provider's `sayRefusals` is on (`views.grid.commit-refused`, `views.grid.commit-refused-many`), and the row a person was editing leaving the list (`views.grid.row-left`).
54
+ - **`error`** when it refuses something and says why: an edit or a clear on a cell that can't take one, a value its column can't store, the cells of a paste that could not take their value, a clear over a range with nothing clearable, a delete your app rejected (`views.menus.row-delete-failed`), an edit your app refused (`views.grid.commit-refused`, `views.grid.commit-refused-many`), and the row a person was editing leaving the list (`views.grid.row-left`).
55
55
  - **`warning`** when a value changes that the person didn't change: a cell they had edited, saved by someone else in the meantime (`views.grid.changed-elsewhere`, or `views.grid.changed-elsewhere-cells` for several), with a second line in `description` saying the saved value is what shows.
56
56
 
57
57
  `success` and `info` complete the shape, so one object over your toast library serves your own code too.
@@ -240,7 +240,7 @@ Where the bar sits is yours, set once on the provider's `selectionBar`: its `bot
240
240
 
241
241
  ### The Outright bulk bar
242
242
 
243
- An app that spreads `CONTROLS` gets the Outright bulk bar wherever it calls `SelectionBar` (`CONTROLS.SelectionBar`): the same call, the same verbs. It stands in the box that holds it (the grid's frame), at its foot, centred, rather than at the screen's; on a phone it is the tray. It reads what ViewKit's own bar doesn't, each optional: a `noun` (`{ one: "deal", other: "deals" }`: "3 deals selected"), `deleteLine` (the line under its question), `more` on a verb (kept off the bar, in More), and on an options verb `value` (what every picked row holds, which it marks), `empty` with `onEmpty` (an empty row that clears the field) and `search`. Its Delete asks first, in ViewKit's alert dialog, then calls your `onDelete`, so yours asks nothing of its own. A press (`onClick`, `onSelect`, `onEmpty`, `onDelete`) may hand back `{ words, undo }`, a `SelectionDone`, or a promise of one: the bar says it in its own Toast, with Undo. The provider's `selectionBar` placement, `phoneQuery` and `chip` are ViewKit's own bar's. An app that wants ViewKit's own bar while spreading `CONTROLS` leaves the slot out: `{ ...CONTROLS, SelectionBar: undefined }`.
243
+ An app that spreads `CONTROLS` gets the Outright bulk bar wherever it calls `SelectionBar` (`CONTROLS.SelectionBar`): the same call, the same verbs. It stands in the box that holds it (the grid's frame), at its foot, centred, rather than at the screen's; on a phone it is the tray. It reads what ViewKit's own bar doesn't, each optional: a `noun` (`{ one: "deal", other: "deals" }`: "3 deals selected"), `deleteLine` (the line under its question), `more` on a verb (kept off the bar, in More), and on an options verb `value` (what every picked row holds, which it marks), `empty` with `onEmpty` (an empty row that clears the field) and `search`. Its Delete asks first, in ViewKit's alert dialog, then calls your `onDelete`, so yours asks nothing of its own. A press (`onClick`, `onSelect`, `onEmpty`, `onDelete`) may hand back `{ words, undo }`, a `SelectionDone`, or a promise of one: the bar says it in its own Toast, with Undo. The provider's `selectionBar` placement and `phoneQuery` are ViewKit's own bar's. An app that wants ViewKit's own bar while spreading `CONTROLS` leaves the slot out: `{ ...CONTROLS, SelectionBar: undefined }`.
244
244
 
245
245
  ## The grid takes a selection
246
246
 
@@ -247,7 +247,7 @@ Editing turns on with `onCellCommit`: without it the grid is read-only, and invi
247
247
  - It resolves with `{ status: "unconfirmed", history: false }`: nothing says the write landed, and it leaves no step to undo.
248
248
  - It rejects (or throws): the cell rolls back to the value it held. Never swallow a failed request, since the rejection is what rolls the cell back.
249
249
 
250
- A `write` that refuses, `{ skip: true, reason }`, is a rejection too: throw its reason, and the cell rolls back. With the provider's `sayRefusals` on, the grid says why through your toast's `error`: the error's own words (its `message`, shown as it is, so reject with words a person can read), or "Couldn't save Amount." when it has none, and a batch, a paste or an undo once, with its count. Off, the default, your app shows it, through its own toast; turn it on and stop toasting your own, or each says twice. Returning nothing on a refusal would count a write that was never sent as landed, with a step to undo.
250
+ A `write` that refuses, `{ skip: true, reason }`, is a rejection too: throw its reason, and the cell rolls back. The grid says why through your toast's `error`: the error's own words (its `message`, shown as it is, so reject with words a person can read), or "Couldn't save Amount." when it has none, and a batch, a paste or an undo once, with its count. Don't toast your own refusals of the grid's edits, or each says twice. Returning nothing on a refusal would count a write that was never sent as landed, with a step to undo.
251
251
 
252
252
  What a cell commits is its type's commit ([the contract](../contract.md#four-shapes-of-a-value)), with one exception: Delete, Cut, the row menu's Clear and a clear over a range commit `""` for most types (a relation `null`, a multiselect `[]`, a boolean `false`). A `write` maps `""` to what the row stores for nothing, as `closeOn` does above. An undo that empties a number, percent or money cell again writes `null`.
253
253
 
@@ -392,11 +392,11 @@ function DealsWithPrefs({ onOpen }: { onOpen: (deal: Deal) => void }) {
392
392
  }
393
393
  ```
394
394
 
395
- The columns' widths, order and visibility travel as `columnState`, a `ListColumnState` (`widths` by column id, `hidden` ids, `visible` ids of columns hidden by default that the person turned on, and `order`), and every change as `onColumnStateChange`; `gridProps` carries both. Resizing, moving and hiding a column, and the header's "+ Add column", which lists the hidden columns, appear only where `onColumnStateChange` is passed, since there would be nowhere to keep them. `renderAddColumn` replaces that last cell (or the + in the title's header, under `addColumnAt`) with your own; answering `null` draws none and keeps no room for it, so column state needs no Add column. `renderColumnMenuRows` adds your rows (Edit field, say) to a column's menu above Hide. On the `menu` route (the provider's `menus`), hand your rows as data through `columnMenuItems(fieldKey)`, keyed apart from the grid's own (it is called while the grid renders, for every column, so keep it pure and cheap); `renderColumnMenuRows` isn't drawn there. On a phone the header ends with nothing unless you pass `addColumnOnPhone`: then "+ Add column" ends it there too, its list in your `Sheet` (your `Menu` on the `menu` route), where a person brings back a column they hid on the phone. To keep it in reach while the columns scroll, pass `addColumnAt: "title"`: it stands as a lone + at the right edge of the title column's header (pinned with `freezeIdentity`), and the header's end keeps no room for it; with no title column shown it stays at the end.
395
+ The columns' widths, order and visibility travel as `columnState`, a `ListColumnState` (`widths` by column id, `hidden` ids, `visible` ids of columns hidden by default that the person turned on, and `order`), and every change as `onColumnStateChange`; `gridProps` carries both. Resizing, moving and hiding a column, and the header's "+ Add column", which lists the hidden columns, appear only where `onColumnStateChange` is passed, since there would be nowhere to keep them. `renderAddColumn` replaces that last cell (or the + in the title's header, under `addColumnAt`) with your own; answering `null` draws none and keeps no room for it, so column state needs no Add column. Your rows (Edit field, say) stand in a column's menu above Hide. Hand them as data through `columnMenuItems(fieldKey)`, keyed apart from the grid's own (it is called while the grid renders, for every column, so keep it pure and cheap). `renderColumnMenuRows` is deprecated and read by nothing: a row drawn as a node has nowhere to stand in your `Menu`. On a phone the header ends with nothing unless you pass `addColumnOnPhone`: then "+ Add column" ends it there too, its list in your `Menu`, where a person brings back a column they hid on the phone. To keep it in reach while the columns scroll, pass `addColumnAt: "title"`: it stands as a lone + at the right edge of the title column's header (pinned with `freezeIdentity`), and the header's end keeps no room for it; with no title column shown it stays at the end.
396
396
 
397
397
  ### A column per part
398
398
 
399
- With `parts`, a name, a place or a range offers a column per part beside its whole column: a place's country, region, city and postal code, a name's given and family names, a range's low and high ends. Each starts hidden; "+ Add column" lists a field with parts as one row that drills into the field (when hidden) and its hidden parts, as Attio's does, and a search lists parts by their full label ("Address · Country"). On the `menu` route (the provider's `menus`) that field is a group beside your `Menu`, its count as `detail`, with no search field, and on a phone too it is your `Menu`, not your `Sheet`. A part column's id is `partKey(columnId, part)`, the key its Filter row has when your panels pass `parts: true`, so that row filters what the column shows; its sort value is `partKey(fieldKey, part)`, which `parsePartKey` turns into a sort's `fieldKey` and `by`. It reads and copies its part, and it edits and pastes as its part, in a box of its own: text for a name's part and a place's region, city and postal code, a number for a range's end, and the select over every country by name, searchable, for a place's country. A paste or a fill into a country cell takes a country's name, in the app's names language (the conventions' `language`), its locale or English, or its code. A part is locked, refused and read-only as its whole is, and it may be emptied unless its whole declares `clearable: false`; emptying the last part is judged by the field. A box refuses a value the whole field would refuse, such as a range's low end above its high end, and stays open with the field's reason. Your `onCellCommit` and `onCellsCommit` receive the whole column's id and the whole value with that part replaced, so a place keeps its other parts, a range its other end and a name its other part. A name's full name follows its given or family name only when it was empty or exactly the two joined by a space; "Nagy Imre" is kept. A place's other country clears its region and its code, and another region clears its code. A paste over two parts of one field in one row lands as one edit of the whole, and a part edit made while the field's earlier ones are still in flight builds on them. Like every composite value's, the commit goes without a pending overlay; the refetch repaints. Escape in a part's box follows the box's own type, text or number, not the field's, so `escape={{ name: "keep" }}` on the provider does not reach a given name's box. A place field limited to some `parts` offers part columns only for those. Its menu offers no Group row. Keep part columns out of your panels: they belong to the grid, and your panels take the columns you declare.
399
+ With `parts`, a name, a place or a range offers a column per part beside its whole column: a place's country, region, city and postal code, a name's given and family names, a range's low and high ends. Each starts hidden; "+ Add column" lists a field with parts as one group beside your `Menu`, holding the field (when hidden) and its hidden parts, its count as `detail`, as Attio's does, on a phone too. A part column's id is `partKey(columnId, part)`, the key its Filter row has when your panels pass `parts: true`, so that row filters what the column shows; its sort value is `partKey(fieldKey, part)`, which `parsePartKey` turns into a sort's `fieldKey` and `by`. It reads and copies its part, and it edits and pastes as its part, in a box of its own: text for a name's part and a place's region, city and postal code, a number for a range's end, and the select over every country by name, searchable, for a place's country. A paste or a fill into a country cell takes a country's name, in the app's names language (the conventions' `language`), its locale or English, or its code. A part is locked, refused and read-only as its whole is, and it may be emptied unless its whole declares `clearable: false`; emptying the last part is judged by the field. A box refuses a value the whole field would refuse, such as a range's low end above its high end, and stays open with the field's reason. Your `onCellCommit` and `onCellsCommit` receive the whole column's id and the whole value with that part replaced, so a place keeps its other parts, a range its other end and a name its other part. A name's full name follows its given or family name only when it was empty or exactly the two joined by a space; "Nagy Imre" is kept. A place's other country clears its region and its code, and another region clears its code. A paste over two parts of one field in one row lands as one edit of the whole, and a part edit made while the field's earlier ones are still in flight builds on them. Like every composite value's, the commit goes without a pending overlay; the refetch repaints. Escape in a part's box follows the box's own type, text or number, not the field's, so `escape={{ name: "keep" }}` on the provider does not reach a given name's box. A place field limited to some `parts` offers part columns only for those. Its menu offers no Group row. Keep part columns out of your panels: they belong to the grid, and your panels take the columns you declare.
400
400
 
401
401
  `gridProps` also carries the per-person switches: `verticalBorders`, `showRowIcon` (the `rowIcon` you declare, in the title cell), `freezeIdentity` (every column through the title pinned at the left edge; off in `LIST_VIEW_PREF_DEFAULTS`, so start your prefs with `gridFreezeIdentity: true` to open it on), `alwaysCheckboxes` and `scale`, the density. Every row is one height, and a cell's text stays on one line.
402
402
 
@@ -410,7 +410,7 @@ The footer stands after the last row and scrolls with the rows. `pinFooter` pins
410
410
 
411
411
  A group's band shows its count and, beside it, the figures the person turned on. `groupSummary` is that set of parts (`"count"`, `"total"` for the list's first figure, `total:<columnId>` for each one after it), changed through `onGroupSummaryChange`, and `groupFigures` declares which figures a band can show. Declare one by its `column` and `kind` (`"sum"`, `"avg"` and the rest of the footer's picks), and the grid adds it up and writes it as that column's footer does: the same number, in the column's format and currency, a paged group's from your `figures`, or your own footer cell where `renderAggregate` draws one. Its `label` is the column's header unless you give one. To draw a figure yourself, give `label` and `render(group)` in place of `column` and `kind`. `countNoun` words the count ("2 deals"); without it the count is bare. `countOf` answers the count when a group holds more rows than are loaded.
412
412
 
413
- A band's ⋯ menu holds the sort choices (`sort` with `sortOptions`), the figure toggles (`groupFigures` with `onGroupSummaryChange`) and Hide (`onHideGroup`). By default the ⋯ opens for sort or Hide, the figure toggles come with them, and the sort list searches through your `Command` once it passes eight choices, on the `popover` route; on the `menu` route the choices open beside the menu with no search field. `groupMenu` names the parts yourself, `["sort", "figures", "hide"]` or any of them: the ⋯ then holds exactly the parts you named and passed what they need, so the figure toggles or Hide come without sort, and the sort list always searches through your `Command`, at any count (on the `popover` route). An app whose `Command` isn't ready leaves `"sort"` out (on the `popover` route; the `menu` route uses no `Command`), and knows from its props which slots the menu reaches.
413
+ A band's ⋯ menu holds the sort choices (`sort` with `sortOptions`), the figure toggles (`groupFigures` with `onGroupSummaryChange`) and Hide (`onHideGroup`). By default the ⋯ opens for sort or Hide, and the figure toggles come with them; the sort choices open beside the menu. `groupMenu` names the parts yourself, `["sort", "figures", "hide"]` or any of them: the ⋯ then holds exactly the parts you named and passed what they need, so the figure toggles or Hide come without sort, and knows from its props what the menu holds.
414
414
 
415
415
  When the rows come a page at a time, a group's `figures` are your database's over the whole group, and the footer reads its picks from them rather than from the rows in hand. `GroupFigures` in the [root reference](../reference/views.md) has the shape.
416
416
 
@@ -631,27 +631,25 @@ assert.deepEqual(gridNormalizeWrite(titleColumn, " Acme renewal ", conventions)
631
631
  assert.equal(gridNormalizeWrite(stageColumn, "maybe", conventions).ok, false);
632
632
  ```
633
633
 
634
- **One of a set.** A `select` or a `status` opens the select editor: its options, the cell's value checked, and a pick saves. A column that may be emptied (`clearable`) opens with None first; a required status shows none. Delete still clears a column that may be emptied. A closed list offers its options, and the cell's own value when no option names it, so a stray value shows on the row that holds it and on no other; an open select offers the values its records hold and a row that uses the typed text. A list of more than 8 options opens with a search on top, and a letter typed on the cell opens it already filtered by that letter; a shorter list opens as it is.
634
+ **One of a set.** A `select` or a `status` opens the select editor in your `Picker`: its options, the cell's value held, and a pick saves. A column that may be emptied (`clearable`) offers the Picker's empty row, None, while the cell holds a value; a required status offers none. Delete still clears a column that may be emptied. A closed list offers its options, and the cell's own value when no option names it, so a stray value shows on the row that holds it and on no other; an open select offers the values its records hold and creates the typed text. A list of more than 8 options shows the Picker's search, and a letter typed on the cell opens it already filtered by that letter; a shorter list shows its rows alone.
635
635
 
636
- **A set of values.** A `multiselect` opens the chips editor: the chosen values as the cell's own badges with the input among them, the candidates below. It is a draft: adds and removes commit as one write when the panel closes or Tab moves on (Shift-Tab to the cell before), closing it unchanged writes nothing, and Escape discards it. Enter adds the highlighted value and keeps the panel open. A letter typed on the cell opens it with the letter in its search, the values it holds kept. A closed multiselect offers its options alone and filters them as you type, with no row to add what was typed; a value the cell already holds that no option names stays as a chip and is saved as it is. An open one offers the values on screen and adds what is typed. A vocabulary that is not free-form declares `chips: { normalize }` on its column, the rule that turns what somebody typed into what the field stores.
636
+ **A set of values.** A `multiselect` opens the chips editor in your `Picker`, with `multiple`: the values it holds held, the candidates with them. It is a draft: adds and removes commit as one write when the panel closes or Tab moves on (Shift-Tab to the cell before), closing it unchanged writes nothing, and Escape discards it. A pick adds or removes a value and keeps the panel open. A letter typed on the cell opens it with the letter in its search, the values it holds kept. A closed multiselect offers its options alone and filters them as you type, with no row to add what was typed; a value the cell already holds that no option names stays as a chip and is saved as it is. An open one offers the values on screen and adds what is typed. A vocabulary that is not free-form declares `chips: { normalize }` on its column, the rule that turns what somebody typed into what the field stores.
637
637
 
638
- **A day or a moment.** A `date` opens the date editor with its date box and the calendar, no time: a click on a day saves it. A `datetime` keeps its time box (an empty time starts at 00:00) and stays open after a day click, so the time can be set; a click away or Enter saves both. Today, Tomorrow and Next Monday sit above the calendar, each setting its day as a click on the calendar does, a datetime's time kept. A column that may be emptied (`clearable`) ends the editor with a Clear row that empties the date; a required date shows none, and Delete still clears. A character typed on the cell opens the editor with it in the date box, and Enter saves the date it reads. On a phone the day and the time are in one sheet, and ✓ saves both.
638
+ **A day or a moment.** A date cell opens the date editor, which opens your `DateBody` (`CONTROLS.DateBody`, the Date editor, for an app that spreads `CONTROLS`) over the cell. A `date` has no time: a day picked saves it. A `datetime` keeps its time (an empty time starts at 00:00) and stays open after a day is picked, so the time can be set; a click away or Enter saves both. The quick days (`datePicks`) set their day, a datetime's time kept. A column that may be emptied (`clearable`) offers No date, which empties the date; a required date offers none, and Delete still clears. A character typed on the cell opens the editor with it in the body's line, and Enter saves the date it reads. On a phone the day and the time are in one sheet, and ✓ saves both.
639
639
 
640
- **A text cell** (text, a link, an email, a phone, a domain) types in the cell through the text editor (`viewkitjs/views/editors/text`): what was typed is trimmed, an unchanged value writes nothing, and each type brings its own phone keyboard. Enter writes and moves down, Tab writes and moves on, Escape cancels (or writes, where the provider's `escape` keeps the column's type).
640
+ **A text cell** (text, a link, an email, a phone, a domain) types in the cell through the text editor (`viewkitjs/views/editors/text`), which opens your `TextBody` over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding, and in the sheet on a phone: what was typed is trimmed, an unchanged value writes nothing, and each type brings its own phone keyboard. Enter writes and moves down, Tab writes and moves on, Escape cancels (or writes, where the provider's `escape` keeps the column's type).
641
641
 
642
- **A long text** (a `text` field with `format: { long: true }`, or rich text) opens a panel on the cell: Enter is a newline, ⌘ or Ctrl Enter commits and moves down, Tab commits and moves on, Escape cancels (or commits, where the column's type keeps), and a click away commits. Where it cannot be written, the same panel opens read-only (`gridColumnInspectable`).
642
+ **A long text** (a `text` field with `format: { long: true }`, or rich text) edits in the same body, as a paragraph: Enter is a newline, ⌘ or Ctrl Enter commits and moves down, Tab commits and moves on, Escape cancels (or commits, where the column's type keeps), and a click away commits. Where it cannot be written, a read-only panel opens on the cell instead (`gridColumnInspectable`), selectable, never written.
643
643
 
644
- **A cut-off text** (a plain text, or a title that is text) opens whole in that panel when its cell cuts it off: a second click, a double-click or Enter shows all of it over the cell, editable where the cell can be written and read-only where it can't. It stays a line: the box wraps, Enter writes and moves down, and a newline is written as a space. Typing a character still replaces the value in the cell, and a text that fits opens in the cell as above. Links, emails, phones and domains keep their one-line box.
644
+ **A cut-off text** (a plain text, or a title that is text) opens whole when its cell cuts it off: a second click, a double-click or Enter shows all of it, in the body (its box grows over the rows below) where the cell can be written and in the read-only panel where it can't. It stays a line: Enter writes and moves down, and a newline is written as a space. Typing a character still replaces the value in the cell. Links, emails, phones and domains keep a one-line box.
645
645
 
646
- **With an app's `TextBody`** (the components map), every text that can be written, long text and a cut-off text included, opens the app's body over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding, and in the sheet on a phone; the keys stay as above. A text opened only to be read still opens the panel.
647
-
648
- **With an app's `NumberBody`**, a number, money or percent cell opens the app's body over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding, lifted as a grown editor is, and in the sheet on a phone; the keys stay as the number editor's own. A duration keeps ViewKit's own box.
646
+ **A number, money or percent cell** opens your `NumberBody` over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding, lifted as a grown editor is, and in the sheet on a phone; the keys stay as the number editor's own. A duration keeps ViewKit's own box.
649
647
 
650
648
  **On a phone** (narrower than the provider's `desktopQuery`, `(min-width: 1024px)` unless you hand in your own), a text cell and a long text open in a sheet titled with the column's header instead: ✕ and a swipe change nothing, ✓ saves and closes without moving the selection, and the save lands once the sheet has slid away.
651
649
 
652
650
  **The write gate** is `gridNormalizeWrite`, which every write the grid starts passes once: a key, the row's menu, a fill, a paste, a boolean's button. It coerces the value by the column's type, then has the column's field accept it, so a type's write rules are stated once: a marker boolean refuses any write but clear, an email or a url must look like one, a multiselect commits its whole set, trimmed and without duplicates. An emptied value passes unchecked, since `clearable` decides whether a clear may run; a clear reaches you as `""`, except a relation's `null`, a multiselect's `[]` and a boolean's `false` (Writes, above). A refusal is said in a toast and nothing is sent. Undo and redo do not pass the gate: they put a recorded value back as it was.
653
651
 
654
- **A select, status, date, tags, relation, number, range, place or list-of-values editor** opens through the same panel: your `Popover` on a desktop and your `Sheet` below your `desktopQuery`. Each asks the same gate before it closes, and the list's settings too, so a column locked while its editor is open says the lock in the editor. A value the gate refuses keeps the editor open with its reason, and nothing is sent until the value changes or Escape throws the edit away (where the column's type keeps on Escape, the first Escape keeps and shows the refusal, and a second throws the edit away). Leaving the cell while the reason stands writes nothing, and says the reason in a toast. These editors share the edit session's rules: Escape discards (or keeps, where the provider's `escape` keeps the column's type), and a refused value stays open with its reason. In the place editor's country or region list, Escape first closes the list, back to its boxes. On a desktop a picker opens your `Popover` under its cell (or over it, at the provider's `gridBodyPlace` `over`, when your app hands the body it opens), and a number or a range is typed in the cell. Below your provider's `desktopQuery`, each opens in your `Sheet`, a number or a range included, titled with the column's header, with ✕ and ✓, while the cell behind it keeps showing its value. ✕, a swipe and Escape change nothing. ✓ saves, and so does a pick. A value is sent once its popover or sheet has played out; a number or a range typed in the cell is sent at once. A list of values whose every value was removed, or a place whose every part was emptied, on a column that isn't `clearable`, stays open saying the field can't be emptied (the column's `reasons.clearable` when it declares one); Escape still throws the edit away, unless the column's type keeps on Escape. The name editor still closes and says a refusal in a toast.
652
+ **A select, status, date, tags, relation, number, range, place or list-of-values editor** opens through the same panel: your `Popover` on a desktop and your `Sheet` below your `desktopQuery`. Each asks the same gate before it closes, and the list's settings too, so a column locked while its editor is open says the lock in the editor. A value the gate refuses keeps the editor open with its reason, and nothing is sent until the value changes or Escape throws the edit away (where the column's type keeps on Escape, the first Escape keeps and shows the refusal, and a second throws the edit away). Leaving the cell while the reason stands writes nothing, and says the reason in a toast. These editors share the edit session's rules: Escape discards (or keeps, where the provider's `escape` keeps the column's type), and a refused value stays open with its reason. In the place editor's country or region list, Escape first closes the list, back to its boxes. On a desktop a picker opens your `Popover` over its cell, its top on the cell's top, and a number or a range is typed in the cell. Below your provider's `desktopQuery`, each opens in your `Sheet`, a number or a range included, titled with the column's header, with ✕ and ✓, while the cell behind it keeps showing its value. ✕, a swipe and Escape change nothing. ✓ saves, and so does a pick. A value is sent once its popover or sheet has played out; a number or a range typed in the cell is sent at once. A list of values whose every value was removed, or a place whose every part was emptied, on a column that isn't `clearable`, stays open saying the field can't be emptied (the column's `reasons.clearable` when it declares one); Escape still throws the edit away, unless the column's type keeps on Escape. The name editor still closes and says a refusal in a toast.
655
653
 
656
654
  **The row's country.** A column's `region` (a binding's, carried by `columnFrom`) reads the record's country off the row, and a phone typed, pasted or filled without its country code is read in it, at the gate and in the editors' own check. Absent, the conventions' region reads it.
657
655
 
@@ -663,9 +661,9 @@ assert.equal(gridNormalizeWrite(stageColumn, "maybe", conventions).ok, false);
663
661
 
664
662
  ## The keyboard and the pointer
665
663
 
666
- Tab enters the grid at its focused cell, or at the first cell on screen, and the keyboard is a spreadsheet's: the arrows and ⇧-arrows, ⌘A, Home and End, ⌘Home and ⌘End, Tab with the row wrapping, typing to replace (on a select, a status or a multiselect, typing starts its search), Enter to edit (or to flip a boolean); a select or a status with no search, opened by Enter or a typed letter, opens with the focus on the option it holds, so ↓ and ↑ walk its options and Enter picks one, while a list opened by a click moves no focus, ⌘C, ⌘X and Delete over a range, ⌘Z and ⇧⌘Z, and pasted tab-separated text. On a desktop, a click selects a cell; a second click on it, a double-click or Enter opens its editor, or the panel of a long text or a cut-off text. An email, a phone, a url or a domain is part of its cell: a click on it selects the cell like any other, and a ⌘-click (Ctrl-click on Windows) follows the link. ⌘X and Delete over a range empty what may be emptied, then say in one toast which fields they left because those can't be empty (`views.grid.clear-required`). A drag selects a range, and the dot at its corner fills it. Below your provider's `desktopQuery`, one tap on a cell opens its editor in your `Sheet`, and a cell that opens nothing is selected and says why. The answer is read at the tap, so a test that clicks the grid answers your desktop query in its `matchMedia` stub to keep a desktop's clicks.
664
+ Tab enters the grid at its focused cell, or at the first cell on screen, and the keyboard is a spreadsheet's: the arrows and ⇧-arrows, ⌘A, Home and End, ⌘Home and ⌘End, Tab with the row wrapping, typing to replace (on a select, a status or a multiselect, typing starts its search), Enter to edit (or to flip a boolean); a select or a status gives your Picker the keys however it opened, by Enter, a typed letter or a click: the focus in its search, ↓ and ↑ go on from the option it holds, and Enter picks the one lit (opened by a key, an Enter at once changes nothing), ⌘C, ⌘X and Delete over a range, ⌘Z and ⇧⌘Z, and pasted tab-separated text. On a desktop, a click selects a cell; a second click on it, a double-click or Enter opens its editor, or the panel of a long text or a cut-off text. An email, a phone, a url or a domain is part of its cell: a click on it selects the cell like any other, and a ⌘-click (Ctrl-click on Windows) follows the link. ⌘X and Delete over a range empty what may be emptied, then say in one toast which fields they left because those can't be empty (`views.grid.clear-required`). A drag selects a range, and the dot at its corner fills it. Below your provider's `desktopQuery`, one tap on a cell opens its editor in your `Sheet`, and a cell that opens nothing is selected and says why. The answer is read at the tap, so a test that clicks the grid answers your desktop query in its `matchMedia` stub to keep a desktop's clicks.
667
665
 
668
- Every cell takes the browser's own focus, and the grid's keys listen on the grid itself; only ⌘Z listens on the window, so an undo works with the focus outside the grid too: the grid holding the focus answers, and with the focus in no grid, the grid edited last. It lands on the cell it changed: selected, and holding the focus unless something outside the grid has it, so the next key moves from there. Tab past the grid's last cell (Shift+Tab before its first) leaves it, and Escape with nothing open clears the cell and lets go of the grid: the next Tab or Shift+Tab leaves. The arrows also reach what surrounds the cells: ↑ from a group's first row lands on its column names, where Enter or Space opens a column's menu with focus on its first row; ↓ from its last row lands on its footer, where Enter or Space opens the figure picker; above the column names is the group's bar, where Enter, Space or ← collapse it and Enter, Space or → open it again, and → on an open bar reaches its ⋯ menu; ← from a row's first column reaches its checkbox, and Space ticks it (the select-all and a group's box the same way from the column names). With `oneHeader`, a group has no column names and no box of its own: ↑ from its first row lands on its bar, and above the first bar is the one row of column names. On a cell, Shift+F10, the menu key, or ⌘⇧\ (Ctrl+Shift+\ off a Mac, as in Google Sheets) opens the row's menu, the one a right-click on that cell opens, under the cell; the grid sends that right-click to your `RowMenu`, and your `Menu` puts focus on its first row. Safari may keep ⌘⇧\ for its own tab overview: there, fn+Shift+F10 opens it. In a column's menu, the figure picker and a group's ⋯ menu, ↓ and ↑ move between the rows, round at either end, and Enter picks the focused one (with the provider's `menus` set to `menu`, the figure picker, a column's menu, a group's ⋯ and Add column are your `Menu`, and their keys are your `Menu`'s). On the `popover` route, past eight sort choices, or at any count once you pass `groupMenu`, a group's menu lists them under a search (on the `menu` route they open beside the menu with no search field), whose own arrows walk its matches: ↓ past the last match goes on to the rows below it, and ↑ from the first of those comes back. That reads the match your `Command` has highlighted from its field's `aria-activedescendant`, as cmdk names it; a list that names none keeps its own arrows, and Tab leaves it. Escape, or a pick, closes a menu and puts focus back on its cell, after your `Popover` or `Menu` has played its exit and left the page. The keyboard, a range, a copy, a clear, a paste and a fill skip a collapsed group's rows, and collapsing a group keeps an edit open in it.
666
+ Every cell takes the browser's own focus, and the grid's keys listen on the grid itself; only ⌘Z listens on the window, so an undo works with the focus outside the grid too: the grid holding the focus answers, and with the focus in no grid, the grid edited last. It lands on the cell it changed: selected, and holding the focus unless something outside the grid has it, so the next key moves from there. Tab past the grid's last cell (Shift+Tab before its first) leaves it, and Escape with nothing open clears the cell and lets go of the grid: the next Tab or Shift+Tab leaves. The arrows also reach what surrounds the cells: ↑ from a group's first row lands on its column names, where Enter or Space opens a column's menu with focus on its first row; ↓ from its last row lands on its footer, where Enter or Space opens the figure picker; above the column names is the group's bar, where Enter, Space or ← collapse it and Enter, Space or → open it again, and → on an open bar reaches its ⋯ menu; ← from a row's first column reaches its checkbox, and Space ticks it (the select-all and a group's box the same way from the column names). With `oneHeader`, a group has no column names and no box of its own: ↑ from its first row lands on its bar, and above the first bar is the one row of column names. On a cell, Shift+F10, the menu key, or ⌘⇧\ (Ctrl+Shift+\ off a Mac, as in Google Sheets) opens the row's menu, the one a right-click on that cell opens, under the cell; the grid sends that right-click to your `RowMenu`, and your `Menu` puts focus on its first row. Safari may keep ⌘⇧\ for its own tab overview: there, fn+Shift+F10 opens it. The figure picker, a column's menu, a group's ⋯ and Add column are your `Menu`, and their keys are your `Menu`'s; a group's sort choices open beside it, with no search field. That reads the match your `Command` has highlighted from its field's `aria-activedescendant`, as cmdk names it; a list that names none keeps its own arrows, and Tab leaves it. Escape, or a pick, closes a menu and puts focus back on its cell, after your `Popover` or `Menu` has played its exit and left the page. The keyboard, a range, a copy, a clear, a paste and a fill skip a collapsed group's rows, and collapsing a group keeps an edit open in it.
669
667
 
670
668
  A page that shows the grid's states side by side, as a design system's does, hands each grid the state to hold, and a person's gesture beside it is told to you to answer: `hoveredRow` draws a row as under the pointer, with its actions and `data-hovered`; `cellPick` draws a picked cell and its ranges, and keeps them through a press elsewhere on the page; `openColumnMenu` stands a column's menu open, a press on a header or outside it only told through `onOpenColumnMenuChange`. Left out, a grid holds none of them, as it always has.
671
669
 
@@ -4,7 +4,7 @@ Every view reads what it takes from its app, other than its own props, from one
4
4
 
5
5
  ## Mount it once
6
6
 
7
- `ViewsProvider` sits once at your app's client root, above every view. It takes four things and the children: `components` (your primitives), `icons` (your glyphs by meaning), `ports` (your haptics, clipboard and per-device store, and, optionally, a toast and a confirm dialog; [ports](ports.md)) and `conventions`. Nineteen more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `sayRefusals`, `menus`, `gridButtons`, `gridCheckboxes`, `fieldRowButtons`, `fieldRowCheckboxes`, `panelButtons`, `severalValues`, `bodyFrame`, `gridBodyPlace`, `selectionBar` and `datePicks`.
7
+ `ViewsProvider` sits once at your app's client root, above every view. It takes four things and the children: `components` (your primitives), `icons` (your glyphs by meaning), `ports` (your haptics, clipboard and per-device store, and, optionally, a toast and a confirm dialog; [ports](ports.md)) and `conventions`. Ten more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `severalValues`, `selectionBar` and `datePicks`.
8
8
 
9
9
  `desktopQuery` says which screens are desktops: there an editor opens as a popover, and elsewhere as a sheet; so do the toolbar's panels and the views picker outside a `Toolbar` (inside one, the toolbar's phone form decides), and the grid's own chrome: a row's and a group's ⋯ and the row actions show on hover on a desktop, and a row's and a group's ⋯ always elsewhere, where the row actions don't show. It defaults to `DEFAULT_DESKTOP_QUERY`, `(min-width: 1024px)`; hand in the query your own shell switches on, so the editors and your layout change at the same width. A server render counts as a desktop.
10
10
 
@@ -12,29 +12,23 @@ Every view reads what it takes from its app, other than its own props, from one
12
12
 
13
13
  `oneValue` says how a field holding one email or one domain is edited: `{ email: "list", domain: "list" }` opens it as the value list holding one value (one line, no label, no main mark, no line to add another, × empties it), in the grid and in a field row alike, where it otherwise opens the text box in its cell. It writes the same string the text box writes, and a key typed on its cell starts its line, as it starts the text box. A type you leave out, or `"text"`, opens the text box; a phone and a link always do. With a `ValuesBody`, the list of one opens it, handed `holds: "one"` and `labels: false`. Pass a module-level object.
14
14
 
15
- `sayRefusals`, off by default, has the grid say why your app refused an edit it sent, through your toast's `error`: the error's own words, "Couldn't save Amount." when it has none, and a batch once, with its count. Turn it on and stop toasting your own refusals, or each says twice.
15
+ The grid says why your app refused an edit it sent, through your toast's `error`: the error's own words, "Couldn't save Amount." when it has none, and a batch once, with its count. Don't toast your own refusals of the grid's edits, or each says twice.
16
16
 
17
17
  `sheetActions` says where an editor's ✕ and ✓, and a toolbar panel's ✕, stand in that sheet. `bar`, the default, is the editor panel's own bar inside your `Sheet`. `head` hands them to your `Sheet` as `actions` (`close`, and `done` unless the body saves on its pick), for a sheet that draws them in its own head, and the panel draws no bar; a toolbar panel hands only `close`, and draws no ✕ of its own; the sort editor hands `close`, which takes its rules back to what they were when the sheet opened, and `done`, which keeps them, so draw both.
18
18
 
19
- `bodyFrame` says who sets the width and padding of the popover around a whole body your app hands, its `Picker`, `PartsBody`, `ValuesBody` or `LinksBody`. `views`, the default, keeps ViewKit's own, the widths it gives its own lists, whether or not you hand a body. `popover` hands that popover no width and no padding of ViewKit's, only its layer, so your `Popover` stands at its own width, and marks it with the body it holds: `data-vk-body` is `picker`, `parts`, `values` or `links`. An editor drawing ViewKit's own body keeps ViewKit's width either way, and a phone's sheet is unchanged. Before you turn it on, give the popover that opens with `chrome: "menu"` a width that doesn't follow its content (or it widens and narrows as a list filters), cap it by the room on screen, and pad it as you want; a body that needs more room, a place's parts on one line, is reached by `[data-vk-body="parts"]`.
19
+ The popover around a whole body your app hands, its `Picker`, `PartsBody`, `ValuesBody` or `LinksBody`, takes no width and no padding of ViewKit's, only its layer, so your `Popover` stands at its own width; it is marked with the body it holds: `data-vk-body` is `picker`, `parts`, `values` or `links`. A phone's sheet is unchanged. Give the popover that opens with `chrome: "menu"` a width that doesn't follow its content (or it widens and narrows as a list filters), cap it by the room on screen, and pad it as you want; a body that needs more room, a place's parts on one line, is reached by `[data-vk-body="parts"]`.
20
20
 
21
- `gridBodyPlace` says where a grid editor opens the popover around a whole body you hand, your `Picker`, `DateBody`, `PartsBody`, `ValuesBody` or `LinksBody`: `under`, the default, 4px under the cell, or `over`, its top on the cell's top, as Attio's editors and long text open. At `over`, give that popover at least the cell's width, so a press where the cell was lands inside it. ViewKit's own bodies stay under the cell, and a field row is unchanged.
21
+ A grid editor opens the popover around a whole body you hand, your `Picker`, `DateBody`, `PartsBody`, `ValuesBody` or `LinksBody`, with its top on the cell's top, as Attio's editors and long text open. Give that popover at least the cell's width, so a press where the cell was lands inside it. A field row opens its body under the value, unchanged.
22
22
 
23
- `selectionBar` says where the selection bar sits: its `bottom`, its `zIndex` and your `className` on the desktop and on the phone, and a `phoneQuery` when your shell switches to its phone layout at another width than `desktopQuery`, and a `chip`, who draws the count chip that clears the selection: ViewKit (`own`, the default) or your `Button` (`button`). An app with a bottom nav lifts the phone's pill above it; pass a module-level object.
23
+ `selectionBar` says where the selection bar sits: its `bottom`, its `zIndex` and your `className` on the desktop and on the phone, and a `phoneQuery` when your shell switches to its phone layout at another width than `desktopQuery`. An app with a bottom nav lifts the phone's pill above it; pass a module-level object.
24
24
 
25
- `menus` says how the grid opens its own menus. `popover`, the default, draws ViewKit's rows in your `Popover`. `menu` hands them to your `Menu` as rows: today the footer's figure picker, one ticked row per figure, a column's header menu, each format setting and each option's colour a group beside it, a group's ⋯, its sort choices a group beside it with no search field and its figure toggles ticks that keep the menu open, and the grid's own "+ Add column", each field with parts a group beside it, with no search field and on a phone too. The row menu and a command cell's menu always go through your `Menu`.
26
-
27
- `gridButtons` says who draws the buttons the grid draws itself: a group's fold and ⋯, "+ Add column", a row's ⋯, the name's actions (the pencil and your `rowActions`), an action column's buttons, a pick-list cell's ▾, and a command cell's ▾ and its trigger. `own`, the default, draws ViewKit's own, as on 0.5.0. `button` draws your `Button`, so they take your pointer, hover, press and focus ring: the grid hands its box (size, place, the reveal on hover) in `className`, `variant` `ghost` or `outline`, `size` `icon` or `sm`. Before you set it, make your `Button` forward `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open` to its element and let the `className` it is handed win over its own size: a `Button` that drops the ref leaves the ⋯'s and "+ Add column"'s menus with nothing to anchor on, and one that drops `tabIndex` makes every grid button a Tab stop. The example adapters on this page forward none of them; they suit the default.
25
+ The grid opens its own menus in your `Menu`, handed their rows as data, with the three hints a row may carry (`beside`, `keepOpen`, `detail`): the footer's figure picker, one ticked row per figure; a column's header menu, each format setting and each option's colour a group beside it, your rows from `columnMenuItems` above Hide; a group's ⋯, its sort choices a group beside it and its figure toggles ticks that keep the menu open; and the grid's own "+ Add column", each field with parts a group beside it, on a phone too. None has a search field. The row menu and a command cell's menu go through your `Menu` too.
28
26
 
29
27
  `severalValues` says how a cell of several values (a multiselect's options, several emails or records, a lookup's names) draws on one line. `fit`, the default, draws as many whole values as fit the cell's width, then the count, and follows a column resize; when even the first doesn't fit whole, it shows cut. `first` draws its first value and a "+N" count at any width, as on 0.5.0. A wrapped row shows three either way. Each cell measures its values once when it mounts or they change, and a resize is arithmetic over what it kept, so fitting costs no row a redraw.
30
28
 
31
- `gridCheckboxes` says who draws a yes/no cell's box in the grid. `own`, the default, draws ViewKit's tick box in its own switch button, as on 0.5.0. `checkbox` draws your `Checkbox`, the box your rail draws, so a row's two boxes are one: it is handed `checked`, the column's name, `tabIndex` -1 and `onCheckedChange`, and a press writes the value once. A cell the grid can't write is handed `readOnly` and a press that writes nothing. Before you set it, make your `Checkbox` forward `readOnly`: one that drops it shows a read-only cell that looks pressable and does nothing when pressed.
32
-
33
- `fieldRowButtons` says who draws a field row's own buttons: its edit target, the verb trigger around a value, the lane's ▾ and rich text's Show more. `own`, the default, draws ViewKit's own, as on 0.5.0. `button` draws your `Button`, `ghost`, with ViewKit's box in `className` and the row's own type kept. Before you set it, make your `Button` forward the ref and `aria-disabled` (the edit target holds its focus with it while a write is pending), render a real `<button>`, and let the `className` handed win over its own size. `gridButtons` doesn't reach a field row.
34
-
35
- `fieldRowCheckboxes` says who draws a field row's yes/no box. `own`, the default, draws ViewKit's tick box in its own switch button. `checkbox` draws your `Checkbox`, a Tab stop as the switch is, and a press writes the value once; a row that can't be written is handed `readOnly`. Forward `readOnly` before you set it. The panels' tick rows draw your `TickBox` atom, the picture of your box, whichever you set.
29
+ Your `Button` draws every button ViewKit draws itself, so each takes your pointer, hover, press and focus ring: the grid's (a group's fold and ⋯, "+ Add column", a row's ⋯, the name's actions, an action column's buttons, a pick-list cell's ▾, a command cell's ▾ and its trigger), a field row's (its edit target, the verb trigger around a value, the lane's ▾, rich text's Show more), the ones in the toolbar's panels, the search's ✕ and the views row (a filter's select, a range's presets and its clears, a panel header's back and ✕, Export, Publish, Clear and Save, the "+N" chip, the + and the views picker's chip, rows and ⋯, the quick filters' fields), and the selection bar's count chip. Each is handed ViewKit's box (its size, its place, a reveal on hover) in `className`, a `variant` (`ghost`, `outline`, or `secondary` for the views picker's chip, a filled chip with no border) and a `size` (`icon` or `sm`). Make your `Button` render a real `<button>`, take the `secondary` variant, let the `className` it is handed win over its own size, and forward `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `aria-pressed`, `aria-disabled`, `role`, `aria-selected`, `data-slot`, `data-open`, `data-state` and `data-vs-row` to its element: one that drops the ref leaves the menus these buttons open with nothing to anchor on, one that drops `tabIndex` makes every grid button a Tab stop, a field row's edit target holds its focus with `aria-disabled` while a write is pending, and a host insets Export's row through `[data-vs-row]`. The `ToolbarButton` atom's parts stay the atom's.
36
30
 
37
- `panelButtons` says who draws the buttons ViewKit draws itself in the toolbar's panels, the search's ✕ and the views row: a filter's select, a range's presets and its clears, the Columns and group lists' eyes and new-line marks, a column's opener, Clear all, Reset, show or hide every group, a panel header's back and ✕, Export, Publish, the "+N" chip, the + and the views picker's chip, rows and ⋯, and the quick filters' fields. `own`, the default, draws ViewKit's own, as on 0.6.0. `button` draws your `Button`, `ghost` (`outline` for a range's presets and the date filter's framed select, `secondary` for the views picker's chip, a filled chip with no border), `icon` or `sm`, with ViewKit's box in `className`. Before you set it, make your `Button` take the `secondary` variant, forward the ref (the select, the "+N" chip, the picker's chip and a view's ⋯ anchor their menus on it), `aria-haspopup`, `aria-expanded`, `aria-pressed`, `role`, `aria-selected`, `data-slot`, `data-state` and `data-vs-row` (Export's row, which a host insets through `[data-vs-row]` as it does Copy link and Share) to its element, and let the `className` handed win over its own size. The `ToolbarButton` atom's parts stay the atom's, and `gridButtons` and `fieldRowButtons` don't reach the panels.
31
+ Your `Checkbox` draws a yes/no cell in the grid, the box your rail draws, so a row's two boxes are one: it is handed `checked`, the column's name, `tabIndex` -1 and `onCheckedChange`, and a press writes the value once. A field row's yes/no is your `Checkbox` too, handed no `tabIndex`, so it stays a Tab stop as a switch is. A cell or a row that can't be written is handed `readOnly` and a press that writes nothing: forward `readOnly`, or a read-only box looks pressable and does nothing when pressed. The panels' tick rows draw your `TickBox` atom, the picture of your box.
38
32
 
39
33
  `datePicks` names the quick days the date editors offer, in order: any of `today`, `tomorrow`, `next-monday` and `in-a-week`, a week from today. The date editor hands exactly these to your `DateBody` and ViewKit's own panel draws the same, so a cell and your own pages offer the same days. Absent, `today`, `tomorrow` and `next-monday`, as on 0.5.0. Pass a module-level array.
40
34
 
@@ -79,7 +73,7 @@ assert.equal(conventions.locale, "en-GB"); // the app's own, untouched
79
73
 
80
74
  ## The components map
81
75
 
82
- The package draws nothing with a UI library of its own. `ViewsComponents`, from `viewkitjs/views/react`, is the map you hand it: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon` and `Markdown`, and twenty-one you may leave out: `Input`, `Command` (the command list's parts), `Picker` (a whole pick list your app draws), `LinksBody` (a whole links body: each link's roles and its lead), `Calendar` (the date editor's month), `DateBody` (a whole date body your app draws), `PartsBody` (a whole body for a name, a place or a range), `ValuesBody` (a whole body for several emails, phones, links or domains), `TextBody` (a whole body for a text typed as one string), `NumberBody` (a whole body for a number, money or a percent), `SortBody` (the sort editor's whole body), `FilterBody` (the filter editor's whole body), `FieldsBody` (the field list's whole body), `FilterPartBody` (a filter rule's way and value), `RowsWait` (what a grid's rows wait in while new ones load), `QuickFiltersBody` (the quick filters' whole body), `ViewsListBody` (the views list's whole body), `GroupBody` (the group editor's whole body), `CustomizeBody` (Customize's whole body) and `SearchField` (the toolbar's search box), `PortsHost` (what draws the `toast` and `confirm` ports you leave out). The [contract](../contract.md#the-components-map) says what each slot must accept; the [`viewkitjs/views/react` reference](../reference/react.md) lists every prop.
76
+ The package draws nothing with a UI library of its own. `ViewsComponents`, from `viewkitjs/views/react`, is the map you hand it: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody` (a whole body for a text typed as one string), `NumberBody` (a whole body for a number, money or a percent), `Picker` (a whole pick list), `LinksBody` (a whole links body: each link's roles and its lead), `DateBody` (a whole date body), `PartsBody` (a whole body for a name, a place or a range) and `ValuesBody` (a whole body for several emails, phones, links or domains), `SortBody` (the sort editor's whole body), `FilterBody` (the filter editor's whole body), `FilterPartBody` (a filter rule's way and value), `FieldsBody` (the field list's whole body), `QuickFiltersBody` (the quick filters' whole body), `ViewsListBody` (the views list's whole body) and `CustomizeBody` (Customize's whole body), and eight you may leave out: `Input`, `Command` (the command list's parts, for the grid's menus on the popover route), `Calendar` (the filter panel's month), `RowsWait` (what a grid's rows wait in while new ones load), `GroupBody` (deprecated: read by nothing), `SearchField` (the toolbar's search box), `PortsHost` (what draws the `toast` and `confirm` ports you leave out) and `SelectionBar` (the selection bar). The [contract](../contract.md#the-components-map) says what each slot must accept; the [`viewkitjs/views/react` reference](../reference/react.md) lists every prop.
83
77
 
84
78
  The shapes are Base UI's, and the types promise three things:
85
79
 
@@ -12,7 +12,7 @@ Guide: [cells](../guides/cells.md).
12
12
  - The formatting: `presentation` and `viewer`.
13
13
  - The reader's overrides: `optionColors`, `dateStyle`, `durationStyle`, `decimals`, `withTime`, `percentDisplay` and `wrap` (text wraps instead of truncating).
14
14
  - The row's answers: `currency` (the code a value is in when the caller knows it and the column does not), `valueOverride` (a pending value, which wins over the accessor; only typed cells honour it) and `markerReason`.
15
- - The verbs: `onResolve` (clears a marker), `onToggle` (flips a checkbox or icon boolean; its presence makes it clickable), `booleanCheckbox` (a checkbox control the checkbox style draws in place of the tick box and its switch; the grid hands the components map's `Checkbox` while the provider's `gridCheckboxes` is `checkbox`, and a field row while `fieldRowCheckboxes` is), `commandItems` (a command column's verbs for this row; without them the cell is a read-only badge) and `onOpenRelation` (opens the record a chip points at, handed the clicked value, for a list whose relations go somewhere your app-wide answer cannot know).
15
+ - The verbs: `onResolve` (clears a marker), `onToggle` (flips a checkbox or icon boolean; its presence makes it clickable), `booleanCheckbox` (a checkbox control the checkbox style draws in place of the tick box and its switch; the grid and a field row hand the components map's `Checkbox`), `commandItems` (a command column's verbs for this row; without them the cell is a read-only badge) and `onOpenRelation` (opens the record a chip points at, handed the clicked value, for a list whose relations go somewhere your app-wide answer cannot know).
16
16
  - The host's: `entityIcon` (your glyph for an entity kind) and `slotOwnsClick` (a host whose own element is the button: every cell draws bare content) and `hostOwnsPlainClick` (a host whose plain click on a value is its own: links stay links, marked `data-cell-link`, and let the click through).
17
17
 
18
18
  ## Column-shaped text