viewkitjs 0.26.0 → 0.28.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 (294) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/MIGRATION.md +122 -7
  3. package/package.json +1 -1
  4. package/views/dist/cells/cell-format.d.ts +3 -1
  5. package/views/dist/cells/cell-format.js +2 -2
  6. package/views/dist/cells/use-cell-format.d.ts +8 -1
  7. package/views/dist/cells/use-cell-format.js +13 -2
  8. package/views/dist/contract.d.ts +240 -3
  9. package/views/dist/contract.js +238 -0
  10. package/views/dist/controls/alert/alert.d.ts +46 -0
  11. package/views/dist/controls/alert/alert.js +11 -0
  12. package/views/dist/controls/alert/looks.d.ts +4 -0
  13. package/views/dist/controls/alert/looks.js +19 -0
  14. package/views/dist/controls/alert/tokens.d.ts +92 -0
  15. package/views/dist/controls/alert/tokens.js +25 -0
  16. package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
  17. package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
  18. package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
  19. package/views/dist/controls/alert-dialog/confirm.js +11 -0
  20. package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
  21. package/views/dist/controls/alert-dialog/looks.js +17 -0
  22. package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
  23. package/views/dist/controls/alert-dialog/tokens.js +32 -0
  24. package/views/dist/controls/alert-dialog.css +95 -0
  25. package/views/dist/controls/alert.css +51 -0
  26. package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
  27. package/views/dist/controls/collapsible/collapsible.js +18 -0
  28. package/views/dist/controls/collapsible/looks.d.ts +4 -0
  29. package/views/dist/controls/collapsible/looks.js +5 -0
  30. package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
  31. package/views/dist/controls/collapsible/map-collapse.js +6 -0
  32. package/views/dist/controls/collapsible/tokens.d.ts +68 -0
  33. package/views/dist/controls/collapsible/tokens.js +19 -0
  34. package/views/dist/controls/collapsible.css +83 -0
  35. package/views/dist/controls/compound-editor/map-parts-body.js +2 -1
  36. package/views/dist/controls/compound-editor/name-parts.js +10 -2
  37. package/views/dist/controls/compound-editor/place-parts.js +5 -1
  38. package/views/dist/controls/compound-editor/place.d.ts +2 -1
  39. package/views/dist/controls/compound-editor/place.js +2 -0
  40. package/views/dist/controls/controls.d.ts +17 -0
  41. package/views/dist/controls/controls.js +17 -0
  42. package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
  43. package/views/dist/controls/date-editor/map-calendar.js +3 -1
  44. package/views/dist/controls/filter-editor/filter-editor.d.ts +56 -0
  45. package/views/dist/controls/filter-editor/filter-editor.js +208 -0
  46. package/views/dist/controls/filter-editor/how.d.ts +23 -0
  47. package/views/dist/controls/filter-editor/how.js +13 -0
  48. package/views/dist/controls/filter-editor/map-filter-body.d.ts +18 -0
  49. package/views/dist/controls/filter-editor/map-filter-body.js +164 -0
  50. package/views/dist/controls/filter-editor/map-rules.d.ts +85 -0
  51. package/views/dist/controls/filter-editor/map-rules.js +273 -0
  52. package/views/dist/controls/filter-editor/parts.d.ts +46 -0
  53. package/views/dist/controls/filter-editor/parts.js +75 -0
  54. package/views/dist/controls/filter-editor/rules.d.ts +104 -0
  55. package/views/dist/controls/filter-editor/rules.js +148 -0
  56. package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
  57. package/views/dist/controls/filter-editor/tokens.js +23 -0
  58. package/views/dist/controls/filter-editor/words.d.ts +59 -0
  59. package/views/dist/controls/filter-editor/words.js +40 -0
  60. package/views/dist/controls/filter-editor.css +124 -0
  61. package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
  62. package/views/dist/controls/group-editor/group-editor.js +126 -0
  63. package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
  64. package/views/dist/controls/group-editor/map-group-body.js +106 -0
  65. package/views/dist/controls/group-editor/rules.d.ts +48 -0
  66. package/views/dist/controls/group-editor/rules.js +41 -0
  67. package/views/dist/controls/group-editor/tokens.d.ts +15 -0
  68. package/views/dist/controls/group-editor/tokens.js +6 -0
  69. package/views/dist/controls/group-editor/words.d.ts +39 -0
  70. package/views/dist/controls/group-editor/words.js +21 -0
  71. package/views/dist/controls/group-editor.css +20 -0
  72. package/views/dist/controls/index.d.ts +35 -1
  73. package/views/dist/controls/index.js +35 -1
  74. package/views/dist/controls/internal/editor-parts.d.ts +47 -0
  75. package/views/dist/controls/internal/editor-parts.js +48 -0
  76. package/views/dist/controls/internal/step-return.d.ts +9 -0
  77. package/views/dist/controls/internal/step-return.js +27 -0
  78. package/views/dist/controls/links-editor/links-editor.d.ts +80 -0
  79. package/views/dist/controls/links-editor/links-editor.js +329 -0
  80. package/views/dist/controls/links-editor/links.d.ts +62 -0
  81. package/views/dist/controls/links-editor/links.js +50 -0
  82. package/views/dist/controls/links-editor/map-links-body.d.ts +10 -0
  83. package/views/dist/controls/links-editor/map-links-body.js +74 -0
  84. package/views/dist/controls/links-editor/tokens.d.ts +71 -0
  85. package/views/dist/controls/links-editor/tokens.js +20 -0
  86. package/views/dist/controls/links-editor/words.d.ts +56 -0
  87. package/views/dist/controls/links-editor/words.js +33 -0
  88. package/views/dist/controls/links-editor.css +132 -0
  89. package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
  90. package/views/dist/controls/menu-list/menu-list.js +25 -16
  91. package/views/dist/controls/modal/looks.d.ts +4 -0
  92. package/views/dist/controls/modal/looks.js +25 -0
  93. package/views/dist/controls/modal/modal.d.ts +69 -0
  94. package/views/dist/controls/modal/modal.js +62 -0
  95. package/views/dist/controls/modal/tokens.d.ts +192 -0
  96. package/views/dist/controls/modal/tokens.js +50 -0
  97. package/views/dist/controls/modal.css +130 -0
  98. package/views/dist/controls/notice/notice.d.ts +49 -0
  99. package/views/dist/controls/notice/notice.js +35 -0
  100. package/views/dist/controls/notice/tokens.d.ts +99 -0
  101. package/views/dist/controls/notice/tokens.js +27 -0
  102. package/views/dist/controls/notice.css +100 -0
  103. package/views/dist/controls/number-editor/format.d.ts +31 -0
  104. package/views/dist/controls/number-editor/format.js +79 -0
  105. package/views/dist/controls/number-editor/looks.d.ts +14 -0
  106. package/views/dist/controls/number-editor/looks.js +17 -0
  107. package/views/dist/controls/number-editor/map-number-body.d.ts +16 -0
  108. package/views/dist/controls/number-editor/map-number-body.js +57 -0
  109. package/views/dist/controls/number-editor/number-editor.d.ts +72 -0
  110. package/views/dist/controls/number-editor/number-editor.js +202 -0
  111. package/views/dist/controls/number-editor/tokens.d.ts +28 -0
  112. package/views/dist/controls/number-editor/tokens.js +9 -0
  113. package/views/dist/controls/number-editor/words.d.ts +23 -0
  114. package/views/dist/controls/number-editor/words.js +13 -0
  115. package/views/dist/controls/number-editor.css +37 -0
  116. package/views/dist/controls/number-field/number-field.js +57 -5
  117. package/views/dist/controls/pane/looks.d.ts +4 -0
  118. package/views/dist/controls/pane/looks.js +11 -0
  119. package/views/dist/controls/pane/pane.d.ts +63 -0
  120. package/views/dist/controls/pane/pane.js +98 -0
  121. package/views/dist/controls/pane/state.d.ts +14 -0
  122. package/views/dist/controls/pane/state.js +7 -0
  123. package/views/dist/controls/pane/tokens.d.ts +79 -0
  124. package/views/dist/controls/pane/tokens.js +22 -0
  125. package/views/dist/controls/pane.css +104 -0
  126. package/views/dist/controls/picker/rows.d.ts +4 -2
  127. package/views/dist/controls/picker/rows.js +4 -3
  128. package/views/dist/controls/radio/radio.d.ts +33 -0
  129. package/views/dist/controls/radio/radio.js +19 -0
  130. package/views/dist/controls/radio/tokens.d.ts +127 -0
  131. package/views/dist/controls/radio/tokens.js +34 -0
  132. package/views/dist/controls/radio.css +104 -0
  133. package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
  134. package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
  135. package/views/dist/controls/sort-editor/rules.d.ts +48 -0
  136. package/views/dist/controls/sort-editor/rules.js +24 -0
  137. package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
  138. package/views/dist/controls/sort-editor/sort-editor.js +180 -0
  139. package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
  140. package/views/dist/controls/sort-editor/tokens.js +22 -0
  141. package/views/dist/controls/sort-editor/words.d.ts +48 -0
  142. package/views/dist/controls/sort-editor/words.js +25 -0
  143. package/views/dist/controls/sort-editor.css +96 -0
  144. package/views/dist/controls/text-editor/phone-number.d.ts +4 -0
  145. package/views/dist/controls/text-editor/phone-number.js +20 -0
  146. package/views/dist/controls/text-editor/text-editor.js +2 -19
  147. package/views/dist/controls/toast/toast.d.ts +75 -0
  148. package/views/dist/controls/toast/toast.js +99 -0
  149. package/views/dist/controls/toast/tokens.d.ts +100 -0
  150. package/views/dist/controls/toast/tokens.js +27 -0
  151. package/views/dist/controls/toast.css +93 -0
  152. package/views/dist/controls/tokens.js +30 -0
  153. package/views/dist/controls/values-editor/looks.d.ts +16 -0
  154. package/views/dist/controls/values-editor/looks.js +19 -0
  155. package/views/dist/controls/values-editor/map-values-body.d.ts +12 -0
  156. package/views/dist/controls/values-editor/map-values-body.js +71 -0
  157. package/views/dist/controls/values-editor/tokens.d.ts +132 -0
  158. package/views/dist/controls/values-editor/tokens.js +35 -0
  159. package/views/dist/controls/values-editor/values-editor.d.ts +62 -0
  160. package/views/dist/controls/values-editor/values-editor.js +441 -0
  161. package/views/dist/controls/values-editor/values.d.ts +71 -0
  162. package/views/dist/controls/values-editor/values.js +59 -0
  163. package/views/dist/controls/values-editor/words.d.ts +50 -0
  164. package/views/dist/controls/values-editor/words.js +29 -0
  165. package/views/dist/controls/values-editor.css +207 -0
  166. package/views/dist/controls/views-list/looks.d.ts +13 -0
  167. package/views/dist/controls/views-list/looks.js +12 -0
  168. package/views/dist/controls/views-list/map-views-list-body.d.ts +19 -0
  169. package/views/dist/controls/views-list/map-views-list-body.js +65 -0
  170. package/views/dist/controls/views-list/rules.d.ts +72 -0
  171. package/views/dist/controls/views-list/rules.js +4 -0
  172. package/views/dist/controls/views-list/tokens.d.ts +11 -0
  173. package/views/dist/controls/views-list/tokens.js +5 -0
  174. package/views/dist/controls/views-list/views-list.d.ts +44 -0
  175. package/views/dist/controls/views-list/views-list.js +57 -0
  176. package/views/dist/controls/views-list/words.d.ts +22 -0
  177. package/views/dist/controls/views-list/words.js +3 -0
  178. package/views/dist/controls/views-list.css +8 -0
  179. package/views/dist/display/date.js +2 -2
  180. package/views/dist/display/format.js +10 -2
  181. package/views/dist/display/options.d.ts +3 -1
  182. package/views/dist/display/use-display-options.d.ts +3 -0
  183. package/views/dist/display/use-display-options.js +10 -2
  184. package/views/dist/display/viewer.d.ts +1 -1
  185. package/views/dist/display/viewer.js +1 -1
  186. package/views/dist/editors/DateEditor.js +11 -9
  187. package/views/dist/editors/NumberEditor.js +3 -1
  188. package/views/dist/editors/relation-panel.js +7 -1
  189. package/views/dist/editors/relation-picker.d.ts +2 -1
  190. package/views/dist/editors/relation-picker.js +4 -3
  191. package/views/dist/editors/relation-source.d.ts +4 -1
  192. package/views/dist/editors/relation-source.js +5 -2
  193. package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
  194. package/views/dist/fields/number-edit.d.ts +6 -0
  195. package/views/dist/fields/number-edit.js +8 -1
  196. package/views/dist/grid/chrome/GridCellEditors.js +3 -3
  197. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
  198. package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
  199. package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
  200. package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
  201. package/views/dist/grid/chrome/GridDateEditor.d.ts +3 -1
  202. package/views/dist/grid/chrome/GridDateEditor.js +2 -1
  203. package/views/dist/grid/chrome/GridFooter.js +2 -2
  204. package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
  205. package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
  206. package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
  207. package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
  208. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
  209. package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
  210. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
  211. package/views/dist/grid/core/commit-model.d.ts +7 -0
  212. package/views/dist/grid/core/commit-model.js +5 -1
  213. package/views/dist/grid/core/editing-controller.js +10 -2
  214. package/views/dist/grid/core/editing-model.js +3 -7
  215. package/views/dist/grid/core/undo-owner.d.ts +6 -0
  216. package/views/dist/grid/core/undo-owner.js +13 -0
  217. package/views/dist/grid/core/useGridEditing.d.ts +2 -0
  218. package/views/dist/grid/core/useGridEditing.js +4 -0
  219. package/views/dist/looks/index.d.ts +8 -0
  220. package/views/dist/looks/index.js +8 -0
  221. package/views/dist/looks/pieces.js +16 -0
  222. package/views/dist/panels/model.d.ts +6 -1
  223. package/views/dist/panels/react/customize-body.d.ts +4 -2
  224. package/views/dist/panels/react/customize-body.js +3 -3
  225. package/views/dist/panels/react/customize.js +4 -2
  226. package/views/dist/panels/react/filter/FilterEditor.js +2 -2
  227. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
  228. package/views/dist/panels/react/filter/PhoneFilterEditor.js +9 -6
  229. package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
  230. package/views/dist/panels/react/filter/filter-body.js +17 -6
  231. package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
  232. package/views/dist/panels/react/filter/filter-part-body.js +3 -1
  233. package/views/dist/panels/react/panel-sheet.d.ts +5 -1
  234. package/views/dist/panels/react/panel-sheet.js +6 -2
  235. package/views/dist/panels/react/panel-step.d.ts +12 -0
  236. package/views/dist/panels/react/panel-step.js +26 -0
  237. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
  238. package/views/dist/panels/react/sort/SortEditor.js +5 -2
  239. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +8 -0
  240. package/views/dist/panels/react/toolbar/ReadyToolbar.js +84 -2
  241. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +2 -2
  242. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
  243. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +49 -0
  244. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
  245. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
  246. package/views/dist/panels/react/toolbar/ToolbarFilters.js +36 -21
  247. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
  248. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
  249. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  250. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
  251. package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
  252. package/views/dist/panels/react/toolbar/panel-part.js +2 -2
  253. package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
  254. package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
  255. package/views/dist/panels/react.d.ts +1 -0
  256. package/views/dist/panels/react.js +1 -0
  257. package/views/dist/panels/settings/filter-groups.js +35 -1
  258. package/views/dist/panels/settings/group-buckets.js +1 -0
  259. package/views/dist/provider/ViewsProvider.d.ts +7 -1
  260. package/views/dist/provider/ViewsProvider.js +23 -3
  261. package/views/dist/provider/components.d.ts +34 -4
  262. package/views/dist/provider/moment.d.ts +6 -0
  263. package/views/dist/provider/moment.js +10 -0
  264. package/views/dist/styles.css +1276 -51
  265. package/views/dist/styles.unlayered.css +1277 -51
  266. package/views/docs/contract.md +23 -15
  267. package/views/docs/controls/alert-dialog.md +37 -0
  268. package/views/docs/controls/alert.md +30 -0
  269. package/views/docs/controls/collapsible.md +22 -0
  270. package/views/docs/controls/filter-editor.md +28 -0
  271. package/views/docs/controls/group-editor.md +11 -0
  272. package/views/docs/controls/links-editor.md +25 -0
  273. package/views/docs/controls/modal.md +55 -0
  274. package/views/docs/controls/notice.md +32 -0
  275. package/views/docs/controls/number-editor.md +12 -0
  276. package/views/docs/controls/pane.md +25 -0
  277. package/views/docs/controls/radio.md +39 -0
  278. package/views/docs/controls/sort-editor.md +27 -0
  279. package/views/docs/controls/toast.md +32 -0
  280. package/views/docs/controls/values-editor.md +40 -0
  281. package/views/docs/controls/views-list.md +8 -0
  282. package/views/docs/guides/cells.md +1 -1
  283. package/views/docs/guides/display.md +1 -1
  284. package/views/docs/guides/the-grid.md +1 -1
  285. package/views/docs/guides/the-provider.md +19 -0
  286. package/views/docs/reference/cells.md +2 -2
  287. package/views/docs/reference/controls.md +326 -8
  288. package/views/docs/reference/display.md +2 -2
  289. package/views/docs/reference/editors-relation.md +1 -1
  290. package/views/docs/reference/looks.md +20 -3
  291. package/views/docs/reference/panels-react.md +7 -6
  292. package/views/docs/reference/panels.md +1 -1
  293. package/views/docs/reference/react.md +8 -8
  294. package/views/docs/reference/views.md +1 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,101 @@ Until 0.19.0 ViewKit shipped as three packages; their changes are in [fields/CHA
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.28.0] — 2026-11-29
9
+
10
+ ### Added
11
+
12
+ - `ToolbarSortPill`'s `row`: Sort on a toolbar row, holding the sort (lit, counted, opening the sort editor).
13
+ - `ToolbarFilterAdd`: Filter on a toolbar row's right. It opens your field list (`FieldsBody`) as Filter on the bar does, and a pick adds the filter to the bar, or holds a yes/no until its value is picked.
14
+ - `ReadyToolbarProps.sortFilter` (`"right" | "bar"`): where the sort and Filter stand in the kit arrangement.
15
+ - `ReadyToolbarProps.bar` (`"added" | "always"`): when the kit arrangement's filter bar shows.
16
+ - `ToolbarFilters`' `emptyPlace` (`false`: nothing until a filter is set or held, where Filter stands on the row).
17
+ - `ToolbarQuickFilters`' `word` (`null`: its icon alone).
18
+ - `viewkitjs/views/controls`: the filter editor (`useFilterEditorParts`, `FilterPartBody`, with its rules, ways and words). `CONTROLS.FilterBody` draws ViewKit's filter body with it: each rule Where or its join, its field, how it compares and its value in its type's own box, ⋮ to make a group or delete it; groups three deep; Add filter and Clear all filters; a set-aside rule in its place, saying why; ViewKit's own words and value body for a way the kit has no word for; on a phone, each box's list, a date and Add filter as a step of the same sheet. `CONTROLS.FilterPartBody` draws a filter's way and value on the bar. Its stylesheet is `viewkitjs/views/controls/filter-editor.css`.
19
+ - `ViewsFilterBodyField.options`: a choice field's values, where ViewKit holds them, for a filter body or part to list.
20
+ - `ViewsFilterBodyProps.ruleWords`: ViewKit's own words for a rule's field, way and value.
21
+ - `ViewsFilterBodyProps.onStepChange`: on a phone, a filter body may tell the sheet it stands on a step of its own; the sheet's head shows the step's title and Back, and Escape goes back a step.
22
+ - `viewkitjs/views/controls`: the sort editor (`useSortEditorParts`, `sortableFields`, with its rules and words). `CONTROLS.SortBody` draws ViewKit's sort body with it: the rules in order, each its grip, its field and its direction in a Select, and ×; Add sort at the foot where the pill has no +, and Clear all sorts; the set-aside sorts after the rules, each re-pointed, put back or deleted; on a phone, a card per rule, and Add sort, a rule's direction and a set-aside sort's field as a step of the same sheet. Its stylesheet is `viewkitjs/views/controls/sort-editor.css`.
23
+ - `ViewsSortBodyProps.onStepChange`: on a phone, a sort body may tell the sheet it stands on a step of its own; the sheet's head shows the step's title and Back, and Escape goes back a step.
24
+ - `useSortEditor` (`viewkitjs/views/panels/react`) also returns `title` and `escapeBack()`, and its `head` gains `back` while an app's `SortBody` stands on a step: a holder of its own draws the step's title and Back, and calls `escapeBack()` on Escape before closing.
25
+ - `ViewsProvider`'s `now`: the moment every date counts from (relative dates, a short date's year, the column menu's date samples, the date editors' quick days and today). Hand the server's, and the server and the browser draw the same text on first load. Absent, the provider reads the clock after mount, then once a minute and when the tab comes back into view, never while rendering; until the first read a date that needs it draws its full form. A handed moment is kept as it is. A new moment redraws only what draws a date (the date cells, the column menu's date samples, the date editors and the calendar), never the rest of a view, and `useViews()` doesn't carry it.
26
+ - `formatDate` (`viewkitjs/views/cells`) takes the app's presentation as an optional sixth argument.
27
+ - `viewkitjs/views/controls`: the Notice (`Notice`, `NOTICE_ICONS`), a sentence set into the page on its meaning's ground, with its actions, a title, Retry and a ×; its root marks a phone (`data-vk-phone`).
28
+ - `viewkitjs/views/controls`: the Alert (`Alert`), what an app asks before something happens, and the alert dialog it stands in (`AlertDialog`, `AlertDialogPanel`), the Sheet on a phone where the Alert's Opens as is `sheet`. `confirm()` asks from anywhere through the one `AlertDialogHost`, one question at a time: a newer one answers the older one no.
29
+ - `viewkitjs/views/controls`: the Modal (`Modal`), what holds a form, a quick create or a long read: every way out asks first while something typed is unsaved, nothing closes it while it saves, and on a phone it is the Sheet at full height.
30
+ - `viewkitjs/views/controls`: the Toast (`Toast`, `useToast`, `createToastManager`, `ToastShown`), one at a time, a working toast turned into its result where it stands, Undo and ⌘Z while it shows. It stays `--vk-toast-duration`, four seconds where nothing declares it.
31
+ - Each control that draws a word takes `words`, the English as its defaults: `NOTICE_WORDS`, `ALERT_WORDS`, `ALERT_DIALOG_WORDS`, `MODAL_WORDS`, `TOAST_WORDS` (`ToastShown`'s as its `said`, since its `words` are what it says).
32
+ - The stylesheets `notice.css`, `alert.css`, `alert-dialog.css`, `modal.css` and `toast.css`; new names `--vk-backdrop-modal-*`, `--vk-backdrop-modal-veil-*`, `--vk-backdrop-alert-*`, `--vk-backdrop-veil*`, `--vk-border-modal-edge`, `--vk-border-modal-ring`, `--vk-blur-lg` and `--vk-container-*`.
33
+ - `viewkitjs/views/looks`: `ALERT_LOOKS` (with its looks Even, Plain and Marked), `ALERT_DIALOG_LOOKS` and `MODAL_LOOKS` (with its looks Framed and Outlined). The Alert's buttons stand at the end by default, and the alert dialog's corners are smooth.
34
+ - `viewkitjs/views/controls`: the Pane, a list's panel at its right edge on a computer (`Pane`, `PaneHead`, `PaneBody`, `PaneFoot`, `PaneTitle`, `PaneClose`, and its holder `usePane` with `paneAfter`), and the Collapsible (`Collapsible`, `CollapsibleTrigger`, `CollapsiblePanel`), with their stylesheets `pane.css` and `collapsible.css`. An app that imports the controls' stylesheets one by one adds both.
35
+ - `viewkitjs/views/controls`: `CONTROLS.Collapse` draws the Collapsible, so an app that spreads `CONTROLS` hands no `Collapse` of its own. Its content fades in and out with its height by default. An app's own `Collapse`, spread after `CONTROLS`, still wins.
36
+ - `viewkitjs/views/looks`: `PANE_LOOKS` (where it stands, its corners, smoothing, shadow, edge, gap (8 by default) and padding) and `COLLAPSIBLE_LOOKS` (its content, fading by default, and its curve).
37
+ - `viewkitjs/views`: `numberEditInitial`, what a number editor opens on: the number, or a stored decimal's text read as one (`"120.50"` → 120.5); anything else opens empty.
38
+ - `viewkitjs/views/controls`: `PickerItem.also`, words the Picker's search finds a row by besides its name, never drawn; an exact one comes first.
39
+ - `viewkitjs/views/controls`: the group editor (`useGroupEditor`, with its rules and words). `CONTROLS.GroupBody` draws ViewKit's group body with it: Group by, Order, Direction, a date field's Date step and Hide empty groups, each opening its choices in place; the groups with their Switch, dragged into your own order; Remove grouping. On a phone each level is a step of the same sheet. Its stylesheet is `viewkitjs/views/controls/group-editor.css`.
40
+ - `ViewsGroupEntry.count`: how many records a group holds, where the list counts them.
41
+ - `ViewsGroupBodyProps.onStepChange`: a group body may tell what holds it the level it stands on; ViewKit's Customize shows its name and Back in its head.
42
+ - The menu list's rows (`MenuList`, `MenuListPanelRows`) take `words` (`MenuListWords`): a grip's name, how the rows move, a move said, and a Switch's two words.
43
+
44
+ ### Changed
45
+
46
+ - The ready toolbar handed no arrangement draws one row at rest, the views and Customize at its start, then Sort and Filter on its right with their words, the quick filters' button and the search, each its icon alone, and New. Sort holds the list's sort: lit while one stands, a view's saved one included, it opens the sort editor to change or remove the rules, and with none, the fields. The filter bar is the filters' line: it comes under the row only while a filter stands or waits for its value, holding the filters, + and Clear and Save; while it doesn't, an unsaved change waits in Customize's foot (Clear and Save; on a shared view, with Customize's dot), as on a phone. With `severalSorts={false}`, Sort keeps its one-rule list. On a phone, in either form, the quick filters' button stands after Filter and before Customize (it stood after Customize). A second axis of views stands on the bar's line, which then always shows. To keep the old two lines, the filter bar always drawn with its empty Sort and Filter:
47
+
48
+ ```tsx
49
+ <ReadyToolbar {...list} columns={columns} /> // now: one row, the bar for the filters
50
+ <ReadyToolbar {...list} columns={columns} sortFilter="bar" bar="always" /> // the old two lines
51
+ ```
52
+
53
+ The `row` arrangement is unchanged.
54
+ - `FieldViewerContext.now` is optional: old `context.now: Date` → new `context.now?: Date`, absent until the provider has a moment. A `presentation` whose `calendarDay` or `instant` reads it handles a viewer with none; its relative formatters are only called with one. To keep a fixed moment, hand it as `<ViewsProvider now={…}>`, not through `presentation`.
55
+ - `viewerFrom`'s third argument also takes `null`: a viewer with no moment yet. Left out, it is still the current moment.
56
+ - With no `now` handed, the provider keeps a one-minute timer and a `visibilitychange` listener while mounted. A test that runs every timer (`vi.runAllTimers()`) under a provider with no `now` never ends, and one that counts document listeners sees the provider's: hand `now` in such tests. A test that counts renders sees the provider's first read of the clock, and each minute's, redraw the dates and nothing else.
57
+ - `viewkitjs/views/controls`: on a phone, the Links editor opens a link's roles, and a link's fields, as a step of its own Sheet with Back, never a second Sheet on top. `useLinksEditor`'s parts hand the step's `title` and a `head` with `onBack`; a shell that draws the Sheet itself shows them, and takes Escape on a step as Back (`head.onBack`). `CONTROLS.LinksBody` tells ViewKit's sheet of the step (`onStepChange`).
58
+ - In an app that spreads `CONTROLS`, Customize's Group now draws the group editor in place of ViewKit's own group pages. To keep ViewKit's own pages:
59
+
60
+ Before: `components={CONTROLS}`
61
+
62
+ After: `components={{ ...CONTROLS, GroupBody: undefined }}`
63
+
64
+ ### Fixed
65
+
66
+ - With two editable grids on one page, ⌘Z undoes only in the grid holding the focus, or, with the focus in neither, in the one edited last. A grid inside a drawer or a sheet still leaves ⌘Z to the dialog, as before.
67
+ - A column whose id holds `:` shows its pending value on its own row: a cell's key is read back whole, never split at a character.
68
+ - The controls' date body (`useDateEditor`, its `<piece>/date-editor.tsx`) imports nothing from the provider again: ViewKit's own date body is handed `today` from the provider's moment by the date editor, through its map, and a page that draws the body itself and hands no `today` takes the browser's day. A design app that builds the controls' bodies alone (its `tsc` rooted at the views source) no longer reaches the contract and fields' source through it.
69
+ - Nothing in the grid reads the clock while rendering, so a fresh Next.js app (Cache Components on) builds a page with the grid and no `<Suspense>`.
70
+ - The column menu's date samples go through the app's `presentation` and count from the provider's moment, as the cells do.
71
+ - The date editors' quick days and today, and the calendar's today, count from the provider's moment.
72
+ - A number, money or percent field stored as decimal text (`"120.50"`) opens its editor on the amount in a grid cell and a field row, where it opened empty; closing it untouched writes nothing.
73
+ - `viewkitjs/views/editors/relation`: a remote list says it is searching from the keystroke, not when the search leaves after its pause, so an Enter pressed before the typed query answers picks or links nothing from the last query's rows. In `CONTROLS`' Picker and links body, the list shows Searching… with no rows from the keystroke, 200 ms sooner than before; ViewKit's own list keeps the last rows under Searching… and Enter there picks nothing until the answer. No next page is asked for a query not yet answered.
74
+ - The Number editor's currency and unit lists find a currency or a unit by its code (GBP) as by its name.
75
+ - `viewkitjs/views`: while a remote relation list searches, an app's own Picker and Links body are handed only the held records that match the typed query, never a row of the last answer, and a pick of any other record is refused.
76
+ - `viewkitjs/views/controls`: on a phone, leaving a list step (Back, Escape, or a pick that ends the list) puts the focus back on the row or button that opened it, in the Links, Values and Compound editors and the sort, filter and group editors.
77
+ - `viewkitjs/views`: the Links editor shows no record to add and lights none while a remote list searches, so its "Searching…" stands right under the linked records, on a computer and a phone; a press on a phone can no longer link a record of the last answer.
78
+
79
+ ## [0.27.0] — 2026-11-27
80
+
81
+ ### Added
82
+
83
+ - `viewkitjs/views/controls`: the Number editor (`useNumberEditor`, with its rules for what is typed and what a cell shows), on Base UI's number field. `CONTROLS.NumberBody` draws ViewKit's number, money and percent bodies with it: the amount over its cell with up and down arrows at its end while it is edited, a percent's %, and money's or a unit's code a press away from a searchable list of each currency's sign and name, in the app's language. On a phone the Sheet holds the amount with the number pad, the currencies a step of the Sheet. Its stylesheet is `viewkitjs/views/controls/number-editor.css`; its options and looks (`NUMBER_EDITOR_LOOKS`: Arrows, Units, In the Sheet; Attio and Mihai's) are on `viewkitjs/views/looks`.
84
+ - `ViewsNumberBodyProps.onStepChange`, optional: a number body in the phone's sheet tells it of a step of its own (a currency list), as the text, parts, values and links bodies do.
85
+ - An app that takes `CONTROLS.NumberBody` edits a number in the number field: Home and End move the cursor; a letter can't be typed; ↑ and ↓ step by one, Shift by ten, as before; ↓ in the currency list goes on from the held currency; Page Up and Page Down step by ten, Alt and an arrow by a tenth, rounded to the field's decimals as it closes; a single currency shows the bare amount while it is edited; Shift+Tab from the amount reaches the currency's button before it leaves.
86
+ - `viewkitjs/views/controls`: the Values editor (`ValuesEditor`, `useValuesEditor`, with its list's rules), on Base UI. `CONTROLS.ValuesBody` draws ViewKit's bodies for several emails, phones, links or domains with it: each value a pill with copy and trash, edited in place, moved by its grip (the first is the main one), its label picked from Work, Personal, Mobile and Other or typed, and a line at the foot to add one (a phone's country, its code and its pattern). Its stylesheet is `viewkitjs/views/controls/values-editor.css`; its options and looks (`VALUES_EDITOR_LOOKS`: The values, The main one, The line to add one, A label's or a country's list, On a phone; Attio and Mihai's) are on `viewkitjs/views/looks`.
87
+ - An app that takes `CONTROLS.ValuesBody`: Enter in the line adds a value and keeps the editor open, Enter on the empty line saves, and Enter on a value being edited finishes it first; a new value takes Work, Mobile or Other; a value is made the main one by moving it first; the editor opens on the line, not in the first value. A value that doesn't read, left in the line or in a value being edited, keeps the editor open with the reason on Tab, a press away or ✓.
88
+ - A phone's first country in the Text and Values editors is the record's, else the last one kept, else the browser's region, else US.
89
+ - `viewkitjs/views/controls`: the Links editor (`LinksEditor`, `useLinksEditor`, with its rules) and the `Radio` (`Radio`, `RadioGroup`), on Base UI. `CONTROLS.LinksBody` draws ViewKit's links body with it: for a many relation whose field declares `links`, a search over the records, the linked ones as rows under the field's name, Roles and Lead, a link's roles ticked in the Picker under its button, the lead a radio, ✕ to unlink, and the records to add under Add; on a phone, a card per link and the roles on top. It hands every query to the editor and draws its searching, failed, more and create rows. Its stylesheets are `viewkitjs/views/controls/links-editor.css` and `radio.css`; its words are new `views.editors.links-*` keys (MIGRATION.md lists them).
90
+ - An app that takes `CONTROLS.LinksBody` edits a links field's roles where it edited only its records and lead in the Picker. A relation with no `links` still opens the Picker.
91
+ - `viewkitjs/views/controls`: the views list (`useViewsList`, `ViewsList`, with `listed`, `LOCK` and its words), and its options on `viewkitjs/views/looks` (`VIEWS_LIST_LOOKS`: Private views, Favorites). `CONTROLS.ViewsListBody` draws it where the view switcher opens: a search over the views, each with its glyph, its count and its ⋮ where the app hands it a menu; Shared and the reader's own under their headings, a lock on each of the reader's own; a view moved by a drag or ⌥↑ ⌥↓ within its block; New view where the axis grows. On a phone, the view in use held in its place, the search at the foot, New view under the list. Its stylesheet is `viewkitjs/views/controls/views-list.css`.
92
+ - An app that takes `CONTROLS.ViewsListBody` gets the search on every list (not only from six views), each view's ⋮ always shown where it has a menu, ↓ and ↑ going on from the view in use, and views it can move in the list itself. An app that hands no `ViewsListBody` keeps ViewKit's own list.
93
+ - A new message key, `views.panels.views-find` ("Find a view"), the views list's search on a phone.
94
+
95
+ ### Fixed
96
+
97
+ - The number field: one ⌘Z takes back a typed run. Base UI's hidden form input beside the box was written on every key, which ends the run in Chromium, so ⌘Z took back a digit a press; while a value is typed it now keeps what it held until the typing stops (the box left, Enter, or a change that isn't typing). A named field, which a form reads, is written as it comes.
98
+ - `MIGRATION.md`: `CONTROLS`' list names the Number editor (`NumberBody`) for a number, money or a percent. It was left out when the editor joined it.
99
+ - `viewkitjs/views`: Enter in a grid's date or date-and-time cell saves and moves the focus one row down, as a text or number cell does, through ViewKit's own panel and an app's `CONTROLS.DateBody` alike. It saved and left the focus on the cell. `GridDateEditor` takes `onEnter`.
100
+ - `viewkitjs/views/controls`: the Compound editor's street box, one box holding a place's line 1 and line 2 in Attio's look (`CONTROLS.PartsBody`), says "Street address" (`views.editors.place-street`) whatever the country. With a country picked it took the field's word for line 1, "Address line 1" at ViewKit's defaults, and changed as the country was picked. The country's own words still name its other parts (ZIP code, County). `wordOf` gives Attio's word for `line1` and `line2` in Attio's look.
101
+ - `viewkitjs/views/controls`: a name of its own opened by typing a letter on its cell follows its parts at once, as after any change, with the full name hidden (`CONTROLS.PartsBody`): "Dr. Ana Pérez", opened by typing "J", saves "J Pérez". It saved "Dr. Ana Pérez" with "J" as its first name, until a second change. The Compound editor's name body, handed `typing`, compares its parts against no opening name.
102
+
8
103
  ## [0.26.0] — 2026-11-27
9
104
 
10
105
  Every word ViewKit's default controls draw is now the app's: an app that spreads `CONTROLS` and words every message key sees no English from them. `MIGRATION.md` gains a part that takes an app on the three old packages at views 0.9, fields 0.15 and postgres 0.6 to this release step by step, with every message key to word since.
package/MIGRATION.md CHANGED
@@ -251,16 +251,16 @@ import { CONTROLS } from "viewkitjs/views/controls";
251
251
 
252
252
  It holds `Button`, `Tooltip`, `Popover`, `Sheet`, `Input`, `Checkbox` and `Menu`; the Text editor
253
253
  (`TextBody`); the Picker (`Picker`, and `FieldsBody`, the sort's and the filter's field lists); the Date editor
254
- (`DateBody`); the month the filter panel picks a day in (`Calendar`); and the Compound editor (`PartsBody`) for
255
- a name, a place and a range. **An app that spreads it hands no `Calendar`:** the filter panel's date, its date
254
+ (`DateBody`); the month the filter panel picks a day in (`Calendar`); the Compound editor (`PartsBody`) for
255
+ a name, a place and a range; the Number editor (`NumberBody`) for a number, money or a percent; the Values editor (`ValuesBody`) for several emails, phones, links or domains; the Links editor (`LinksBody`) for a relation whose field declares `links`, where an app that hands none edits it in the Picker; the views list (`ViewsListBody`), what the view switcher opens, where an app that hands none keeps ViewKit's own list; and the group editor (`GroupBody`), what Customize's Group opens, where an app that hands none keeps ViewKit's own group pages; and the Collapsible (`Collapse`), the fold a grid's group, a field's note and the selection sheet open in. **An app that spreads it hands no `Calendar`:** the filter panel's date, its date
256
256
  ranges and its custom time scope open ViewKit's own month. An app's own `Calendar` or `RangeCalendar` atom is
257
- kept. You still hand `Collapse`, `AppIcon` and `Markdown`, and `Command` unless you set `menus: "menu"`: the
257
+ kept. You still hand `AppIcon` and `Markdown`, and `Command` unless you set `menus: "menu"`: the
258
258
  grid's + Add column and a group's menu search still draw through it. `CONTROL_ATOMS` (0.23) does the same for the atoms
259
259
  (`Tag`, `StatusBadge`, `CellMore`): `atoms={{ ...CONTROL_ATOMS, ...ownAtoms }}`.
260
260
 
261
261
  The controls' stylesheet is in `viewkitjs/views/styles.css` (step 9). An app that imports the controls'
262
262
  stylesheets one by one instead imports `smooth.css` first, then each control's own, and now adds
263
- `picker.css`, `text-editor.css`, `date-editor.css`, `compound-editor.css` and `flag.css`.
263
+ `picker.css`, `text-editor.css`, `date-editor.css`, `compound-editor.css`, `flag.css`, `number-editor.css`, `values-editor.css`, `radio.css`, `links-editor.css`, `sort-editor.css`, `views-list.css`, `filter-editor.css`, `group-editor.css`, `pane.css` and `collapsible.css`.
264
264
 
265
265
  What an app meets when it moves from its own editors, or ViewKit's older ones, to these:
266
266
 
@@ -282,8 +282,17 @@ What an app meets when it moves from its own editors, or ViewKit's older ones, t
282
282
  "Dr. Ana Pérez". A place uses one order for every country (street, city, state and postal code, the country
283
283
  last with its flag), its street is one box of several lines, and it has no Clear row: clear the boxes and
284
284
  pick No country. A range's bands are a list under its ends.
285
-
286
- The keys, Escape, Tab, the save and the grid's undo of a save are the same as before in each of them.
285
+ - **The Values editor.** Several emails, phones, links or domains open on a line at the foot to add one, not
286
+ in the first value's box. Each value is a pill with copy and trash, pressed to edit it in place, moved by its
287
+ grip; the first is the main one, where the older editor had a mark on each row. Enter in the line adds the
288
+ value and keeps the editor open, Enter on the empty line saves, and Enter on a value being edited finishes it
289
+ first: two Enters where the older editor saved on one. A new value takes the label Work, Mobile or Other (a
290
+ domain none), picked from Work, Personal, Mobile and Other or typed; a column with `labels: false` saves none.
291
+ A value that doesn't read, left in the line or in a value being edited, keeps the editor open with the reason
292
+ on Tab, a press away, Enter or ✓. A phone is added with its country, its dial code and its pattern.
293
+
294
+ The keys, Escape, Tab, the save and the grid's undo of a save are the same as before in each of them, but for
295
+ Enter in the Values editor, which takes two.
287
296
 
288
297
  ### 7. Hand in your phone line
289
298
 
@@ -407,7 +416,7 @@ what the new editors say:
407
416
  The keys added since views 0.9 and fields 0.15, with their English. A word in braces is a value ViewKit hands
408
417
  the message.
409
418
 
410
- The Compound editor, the Menu and the number box (`CONTROLS.PartsBody`, `CONTROLS.Menu`):
419
+ The Compound editor, the Number editor, the Menu and the number box (`CONTROLS.PartsBody`, `CONTROLS.NumberBody`, `CONTROLS.Menu`):
411
420
 
412
421
  | Key | English |
413
422
  | --- | --- |
@@ -431,6 +440,12 @@ The Compound editor, the Menu and the number box (`CONTROLS.PartsBody`, `CONTROL
431
440
  | `views.editors.number-increase` | Increase |
432
441
  | `views.editors.number-decrease` | Decrease |
433
442
  | `views.editors.number-field` | Number field |
443
+ | `views.editors.number-unit` | Unit |
444
+ | `views.editors.number-find-currency` | Find a currency |
445
+ | `views.editors.number-search-currency` | Search for a currency |
446
+ | `views.editors.number-find-unit` | Find a unit |
447
+ | `views.editors.number-search-unit` | Search for a unit |
448
+ | `views.editors.number-unit-named` | {unit}: {name} (the code button's name: "Currency: Euro") |
434
449
  | `views.menus.not-now` | Not now |
435
450
 
436
451
  The Picker (`CONTROLS.Picker`, `CONTROLS.FieldsBody`):
@@ -459,6 +474,106 @@ The Picker (`CONTROLS.Picker`, `CONTROLS.FieldsBody`):
459
474
  | `views.picker.row-actions` | Actions for {label} |
460
475
  | `views.picker.you` | you |
461
476
 
477
+ The Values editor (`CONTROLS.ValuesBody`):
478
+
479
+ | Key | English |
480
+ | --- | --- |
481
+ | `views.editors.values-line-email` | Add email… |
482
+ | `views.editors.values-line-link` | Add link… |
483
+ | `views.editors.values-line-domain` | Add domain… |
484
+ | `views.editors.values-card-line-email` | Add email |
485
+ | `views.editors.values-card-line-link` | Add link |
486
+ | `views.editors.values-card-line-domain` | Add domain |
487
+ | `views.editors.values-add-email` | Add an email |
488
+ | `views.editors.values-add-phone` | Add a phone |
489
+ | `views.editors.values-add-link` | Add a link |
490
+ | `views.editors.values-add-domain` | Add a domain |
491
+ | `views.editors.values-nth-email` | email {n} |
492
+ | `views.editors.values-nth-phone` | phone {n} |
493
+ | `views.editors.values-nth-link` | link {n} |
494
+ | `views.editors.values-nth-domain` | domain {n} |
495
+ | `views.editors.values-change` | Change {value} |
496
+ | `views.editors.values-copy` | Copy {value} |
497
+ | `views.editors.values-move` | Move {value} |
498
+ | `views.editors.values-label-is` | Label: {label} |
499
+ | `views.editors.values-no-label` | none |
500
+ | `views.editors.values-label-search` | Search or type a label |
501
+ | `views.editors.values-label-find` | Find or type a label |
502
+ | `views.editors.values-country-code` | Country code |
503
+ | `views.editors.values-country-is` | Country: {country} |
504
+ | `views.editors.values-country-code-is` | Country code: {country} |
505
+ | `views.editors.values-back-to` | Back to {label} |
506
+ | `views.editors.values-label-work` | Work |
507
+ | `views.editors.values-label-personal` | Personal |
508
+ | `views.editors.values-label-mobile` | Mobile |
509
+ | `views.editors.values-label-other` | Other |
510
+
511
+ The Links editor (`CONTROLS.LinksBody`):
512
+
513
+ | Key | English |
514
+ | --- | --- |
515
+ | `views.editors.links-search` | Search… |
516
+ | `views.editors.links-roles` | Roles |
517
+ | `views.editors.links-add` | Add |
518
+ | `views.editors.links-add-to` | Add to {label} |
519
+ | `views.editors.links-link` | Link {label} |
520
+ | `views.editors.links-unlink` | Unlink |
521
+ | `views.editors.links-unlink-record` | Unlink {label} |
522
+ | `views.editors.links-is-lead` | {label} is the {lead}, its English lowering the lead's word ("Acme is the lead") |
523
+ | `views.editors.links-edit` | Edit the link to {label} |
524
+ | `views.editors.links-menu` | the link to {label} |
525
+ | `views.editors.links-field-at` | {field} at {label} |
526
+ | `views.editors.links-search-roles` | Search roles… |
527
+ | `views.editors.links-none` | None |
528
+ | `views.editors.links-no-details` | No details |
529
+ | `views.editors.links-yes` | Yes |
530
+ | `views.editors.links-no` | No |
531
+ | `views.editors.links-all-linked` | Everything is linked. |
532
+ | `views.editors.links-done` | Done |
533
+
534
+ The sort editor (`CONTROLS.SortBody`):
535
+
536
+ | Key | English |
537
+ | --- | --- |
538
+ | `views.panels.sort-field` | Field |
539
+ | `views.panels.sort-clear-all-sorts` | Clear all sorts |
540
+ | `views.panels.sort-by-named` | the sort by {label} |
541
+
542
+ The views list (`CONTROLS.ViewsListBody`; its other words are ViewKit's own list's keys, worded already):
543
+
544
+ | Key | English |
545
+ | --- | --- |
546
+ | `views.panels.views-find` | Find a view |
547
+
548
+ The filter editor (`CONTROLS.FilterBody`, `CONTROLS.FilterPartBody`; its other words are ViewKit's own editor's keys, worded already):
549
+
550
+ | Key | English |
551
+ | --- | --- |
552
+ | `views.panels.filter-group-list` | Group |
553
+ | `views.panels.filter-rule-named` | {label}'s rule |
554
+ | `views.panels.filter-way-named` | How {label} compares |
555
+ | `views.panels.filter-choose-date` | Choose a date |
556
+ | `views.panels.filter-type-number` | Type a number |
557
+ | `views.panels.filter-type-value` | Type a value |
558
+ | `views.panels.filter-from-named` | {label} from |
559
+ | `views.panels.filter-to-named` | {label} to |
560
+ | `views.panels.filter-checked` | Checked |
561
+ | `views.panels.filter-unchecked` | Unchecked |
562
+ | `views.panels.filter-kit-way` | the kit's way in its words, by its value: is any of, less than, any part between… |
563
+
564
+ The group editor (`CONTROLS.GroupBody`; its other words are ViewKit's own group pages' and the sort editor's keys, worded already):
565
+
566
+ | Key | English |
567
+ | --- | --- |
568
+ | `views.panels.group-order` | Order |
569
+ | `views.panels.group-date-step` | Date step |
570
+ | `views.panels.group-order-own` | Your own |
571
+ | `views.panels.group-own-no-direction` | Your own order has no direction |
572
+ | `views.panels.group-no-value` | No value |
573
+ | `views.panels.list-move-keys` | Left arrow for its grip, then up or down arrow to move it |
574
+ | `views.panels.list-move-hold` | Hold, then drag to move it |
575
+ | `views.panels.list-moved` | {label}, {at} of {of} |
576
+
462
577
  Adding an option to a select:
463
578
 
464
579
  | Key | English |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewkitjs",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "ViewKit — typed fields, the grid and its editors, and a list's SQL for record lists, in one package: viewkitjs/fields, viewkitjs/views and viewkitjs/postgres. By Sheaf.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -136,7 +136,9 @@ export type GridCellOptions = {
136
136
  export declare function resolveRowCurrency<Row>(col: ListColumn<Row>, row: Row, opts?: GridCellOptions): GridCellOptions | undefined;
137
137
  /** A date column's value as text — the column's `dateStyle`/`withTime` with the
138
138
  * user's overrides on top, handed to the one date formatter, in the caller's viewer. */
139
- export declare function formatDate(value: unknown, col: ListColumn<never>, override: ListDateStyle | undefined, withTimeOverride: boolean | undefined, viewer: FieldViewerContext): string;
139
+ export declare function formatDate(value: unknown, col: ListColumn<never>, override: ListDateStyle | undefined, withTimeOverride: boolean | undefined, viewer: FieldViewerContext,
140
+ /** The app's presentation (`useCellFormat`'s), so a sample reads as the cells do. */
141
+ presentation?: FieldPresentation): string;
140
142
  /** Exported for the footer aggregates — sum/avg/min/max print with the same
141
143
  * format (currency, decimals, display-currency override) as the cells. The
142
144
  * column's format is read in the display layer's wider vocabulary, so a legacy
@@ -8,8 +8,8 @@ export function resolveRowCurrency(col, row, opts) {
8
8
  const code = shownCodeOf(col, row);
9
9
  return code ? { ...opts, currency: code } : opts;
10
10
  }
11
- export function formatDate(value, col, override, withTimeOverride, viewer) {
12
- return formatDateValue(value, override ?? col.format?.dateStyle, withTimeOverride ?? col.format?.withTime, temporalKindOf(col), { viewer });
11
+ export function formatDate(value, col, override, withTimeOverride, viewer, presentation) {
12
+ return formatDateValue(value, override ?? col.format?.dateStyle, withTimeOverride ?? col.format?.withTime, temporalKindOf(col), { viewer, presentation });
13
13
  }
14
14
  export function formatNumber(value, col, opts) {
15
15
  return formatNumberValue(value, legacyNumberLikeFormat(col), opts);
@@ -1,5 +1,12 @@
1
1
  import type { FieldPresentation, FieldViewerContext } from "../display/options.js";
2
- export declare function useCellFormat(): {
2
+ type CellFormat = {
3
3
  viewer: FieldViewerContext;
4
4
  presentation: FieldPresentation | undefined;
5
5
  };
6
+ export declare function useCellFormat(): CellFormat;
7
+ /** The cell format with no moment, for what draws no date (a total, a duration sample): a minute's read of the clock
8
+ * doesn't redraw it. Internal. */
9
+ export declare function useUndatedCellFormat(): CellFormat;
10
+ /** `format` counting from `now`: what reads the moment only while it is open (the column menu) hands it here. */
11
+ export declare function cellFormatAt(format: CellFormat, now: Date | null): CellFormat;
12
+ export {};
@@ -3,8 +3,19 @@ import { useMemo } from "react";
3
3
  import { DEFAULT_FIELD_PRESENTATION } from "../display/format.js";
4
4
  import { viewerFrom } from "../display/viewer.js";
5
5
  import { useViews } from "../provider/context.js";
6
- export function useCellFormat() {
6
+ import { useMoment } from "../provider/moment.js";
7
+ function useCellFormatAt(now) {
7
8
  const { conventions, messages, presentation } = useViews();
8
9
  const applied = useMemo(() => presentation?.(DEFAULT_FIELD_PRESENTATION), [presentation]);
9
- return { viewer: viewerFrom(conventions, messages), presentation: applied };
10
+ const viewer = useMemo(() => viewerFrom(conventions, messages, now), [conventions, messages, now]);
11
+ return { viewer, presentation: applied };
12
+ }
13
+ export function useCellFormat() {
14
+ return useCellFormatAt(useMoment());
15
+ }
16
+ export function useUndatedCellFormat() {
17
+ return useCellFormatAt(null);
18
+ }
19
+ export function cellFormatAt(format, now) {
20
+ return now ? { ...format, viewer: { ...format.viewer, now } } : format;
10
21
  }