viewkitjs 0.34.0 → 0.36.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 (272) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/MIGRATION.md +7 -0
  3. package/package.json +1 -1
  4. package/views/README.md +1 -1
  5. package/views/dist/atoms/Avatar.js +2 -1
  6. package/views/dist/atoms/RelationChip.d.ts +2 -0
  7. package/views/dist/atoms/RelationChip.js +5 -0
  8. package/views/dist/atoms/RowMenu.d.ts +1 -1
  9. package/views/dist/atoms/RowMenu.js +15 -3
  10. package/views/dist/atoms/defaults.js +2 -0
  11. package/views/dist/atoms/types.d.ts +40 -4
  12. package/views/dist/cells/relation-wrap.js +9 -2
  13. package/views/dist/contract.d.ts +27 -7
  14. package/views/dist/contract.js +25 -2
  15. package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
  16. package/views/dist/controls/avatar/avatar-mark.js +5 -0
  17. package/views/dist/controls/avatar/avatar.d.ts +10 -5
  18. package/views/dist/controls/avatar/avatar.js +12 -6
  19. package/views/dist/controls/avatar/looks.d.ts +1 -1
  20. package/views/dist/controls/avatar/looks.js +3 -0
  21. package/views/dist/controls/avatar/record-mark.d.ts +16 -0
  22. package/views/dist/controls/avatar/record-mark.js +13 -0
  23. package/views/dist/controls/avatar/tokens.d.ts +12 -0
  24. package/views/dist/controls/avatar/tokens.js +3 -0
  25. package/views/dist/controls/avatar.css +54 -17
  26. package/views/dist/controls/bulk-bar/bulk-bar.js +4 -5
  27. package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
  28. package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
  29. package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
  30. package/views/dist/controls/compound-editor/map-parts-body.js +8 -1
  31. package/views/dist/controls/compound-editor/name-parts.js +3 -2
  32. package/views/dist/controls/compound-editor/place-parts.js +3 -3
  33. package/views/dist/controls/compound-editor/range-parts.js +11 -10
  34. package/views/dist/controls/compound-editor/words.d.ts +3 -0
  35. package/views/dist/controls/compound-editor/words.js +2 -0
  36. package/views/dist/controls/customize/customize.d.ts +22 -6
  37. package/views/dist/controls/customize/customize.js +154 -73
  38. package/views/dist/controls/customize/items.d.ts +49 -0
  39. package/views/dist/controls/customize/items.js +104 -0
  40. package/views/dist/controls/customize/map-customize-body.js +19 -15
  41. package/views/dist/controls/customize/words.d.ts +5 -3
  42. package/views/dist/controls/customize/words.js +1 -0
  43. package/views/dist/controls/filter-editor/block.js +5 -2
  44. package/views/dist/controls/filter-editor/filter-editor.d.ts +16 -1
  45. package/views/dist/controls/filter-editor/filter-editor.js +22 -16
  46. package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -2
  47. package/views/dist/controls/filter-editor/map-filter-body.js +16 -2
  48. package/views/dist/controls/filter-editor/map-rules.d.ts +9 -2
  49. package/views/dist/controls/filter-editor/map-rules.js +18 -13
  50. package/views/dist/controls/filter-editor/parts.d.ts +1 -1
  51. package/views/dist/controls/filter-editor/parts.js +16 -15
  52. package/views/dist/controls/filter-editor/rules.d.ts +4 -4
  53. package/views/dist/controls/filter-editor/rules.js +6 -3
  54. package/views/dist/controls/filter-editor/words.d.ts +2 -0
  55. package/views/dist/controls/filter-editor/words.js +1 -0
  56. package/views/dist/controls/group-editor/group-editor.d.ts +3 -0
  57. package/views/dist/controls/group-editor/group-editor.js +21 -15
  58. package/views/dist/controls/group-editor/map-group-body.js +1 -0
  59. package/views/dist/controls/index.d.ts +1 -1
  60. package/views/dist/controls/internal/kit-words.d.ts +11 -0
  61. package/views/dist/controls/internal/kit-words.js +7 -0
  62. package/views/dist/controls/internal/map-panel-controls.d.ts +4 -1
  63. package/views/dist/controls/internal/map-panel-controls.js +23 -6
  64. package/views/dist/controls/internal/menu-items.d.ts +9 -0
  65. package/views/dist/controls/internal/menu-items.js +97 -0
  66. package/views/dist/controls/internal/panel-controls.d.ts +27 -3
  67. package/views/dist/controls/internal/panel-controls.js +142 -13
  68. package/views/dist/controls/links-editor/links-editor.js +5 -7
  69. package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
  70. package/views/dist/controls/links-editor/map-links-body.js +5 -1
  71. package/views/dist/controls/menu/menu.d.ts +4 -1
  72. package/views/dist/controls/menu/menu.js +3 -2
  73. package/views/dist/controls/number-editor/map-number-body.js +2 -0
  74. package/views/dist/controls/number-editor/number-editor.js +1 -1
  75. package/views/dist/controls/number-editor/words.d.ts +3 -0
  76. package/views/dist/controls/number-editor/words.js +2 -0
  77. package/views/dist/controls/picker/fields-frame.d.ts +5 -0
  78. package/views/dist/controls/picker/fields-frame.js +30 -0
  79. package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
  80. package/views/dist/controls/picker/map-fields-body.js +7 -26
  81. package/views/dist/controls/picker/map-picker.d.ts +9 -3
  82. package/views/dist/controls/picker/map-picker.js +16 -3
  83. package/views/dist/controls/picker/picker.js +20 -10
  84. package/views/dist/controls/picker/rows.d.ts +9 -2
  85. package/views/dist/controls/picker.css +2 -0
  86. package/views/dist/controls/quick-filters/map-quick-filters-body.js +2 -1
  87. package/views/dist/controls/quick-filters/quick-filters.js +4 -4
  88. package/views/dist/controls/quick-filters/reminder.js +2 -2
  89. package/views/dist/controls/quick-filters/rules.d.ts +4 -1
  90. package/views/dist/controls/quick-filters/words.d.ts +2 -0
  91. package/views/dist/controls/quick-filters/words.js +1 -0
  92. package/views/dist/controls/select/map-select.d.ts +1 -1
  93. package/views/dist/controls/select/map-select.js +4 -1
  94. package/views/dist/controls/select/select.d.ts +5 -0
  95. package/views/dist/controls/select/select.js +11 -3
  96. package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
  97. package/views/dist/controls/sheet/bottom-sheet.js +3 -3
  98. package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
  99. package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
  100. package/views/dist/controls/sort-editor/sort-editor.js +9 -8
  101. package/views/dist/controls/tag/tag.js +4 -2
  102. package/views/dist/controls/text-editor/map-text-body.js +4 -1
  103. package/views/dist/controls/text-editor/text-editor.js +2 -2
  104. package/views/dist/controls/text-editor/words.d.ts +3 -0
  105. package/views/dist/controls/text-editor/words.js +1 -1
  106. package/views/dist/controls/toolbar/toolbar.d.ts +31 -12
  107. package/views/dist/controls/toolbar/toolbar.js +15 -20
  108. package/views/dist/controls/toolbar.css +0 -5
  109. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  110. package/views/dist/controls/tooltip/map-tooltip.js +4 -2
  111. package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
  112. package/views/dist/controls/values-editor/map-values-body.js +5 -1
  113. package/views/dist/controls/values-editor/values-editor.js +8 -7
  114. package/views/dist/controls/views-list/map-views-list-body.js +9 -1
  115. package/views/dist/controls/views-list/rules.d.ts +1 -0
  116. package/views/dist/controls/views-list/rules.js +2 -2
  117. package/views/dist/controls/views-list/view-menu.js +2 -2
  118. package/views/dist/controls/views-list/words.d.ts +4 -0
  119. package/views/dist/controls/views-list/words.js +2 -1
  120. package/views/dist/display/option-badges.d.ts +17 -0
  121. package/views/dist/display/option-badges.js +11 -0
  122. package/views/dist/display/relation-link.d.ts +12 -0
  123. package/views/dist/display/relation-link.js +17 -0
  124. package/views/dist/display/relation.d.ts +1 -1
  125. package/views/dist/display/relation.js +10 -3
  126. package/views/dist/display/select.js +1 -8
  127. package/views/dist/editors/EditorPanel.js +1 -1
  128. package/views/dist/editors/RangeEditor.d.ts +3 -0
  129. package/views/dist/editors/RangeEditor.js +2 -2
  130. package/views/dist/editors/SelectEditor.d.ts +2 -2
  131. package/views/dist/editors/SelectEditor.js +1 -1
  132. package/views/dist/editors/TextEditor.js +4 -2
  133. package/views/dist/editors/ValueListEditor.js +2 -1
  134. package/views/dist/field-row/FieldRow.js +32 -5
  135. package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
  136. package/views/dist/grid/chrome/GridAddColumn.d.ts +7 -2
  137. package/views/dist/grid/chrome/GridAddColumn.js +13 -9
  138. package/views/dist/grid/chrome/GridCellEditors.js +1 -1
  139. package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
  140. package/views/dist/grid/chrome/GridCellOutline.js +16 -6
  141. package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
  142. package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
  143. package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
  144. package/views/dist/grid/chrome/GridFooter.js +4 -4
  145. package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
  146. package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
  147. package/views/dist/grid/chrome/GridHeader.js +4 -3
  148. package/views/dist/grid/chrome/GridNumberEditor.js +1 -1
  149. package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
  150. package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
  151. package/views/dist/grid/chrome/GridRow.js +11 -3
  152. package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
  153. package/views/dist/grid/chrome/GridRowActions.js +2 -2
  154. package/views/dist/grid/chrome/GridRowCells.js +3 -2
  155. package/views/dist/grid/chrome/GridStructure.js +1 -1
  156. package/views/dist/grid/chrome/GridTable.js +32 -20
  157. package/views/dist/grid/chrome/GridTableSurface.js +2 -1
  158. package/views/dist/grid/chrome/checks.d.ts +1 -1
  159. package/views/dist/grid/chrome/checks.js +4 -1
  160. package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
  161. package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
  162. package/views/dist/grid/chrome/grid-fitted-box.d.ts +5 -2
  163. package/views/dist/grid/chrome/grid-fitted-box.js +14 -4
  164. package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
  165. package/views/dist/grid/chrome/grid-hover.js +14 -4
  166. package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
  167. package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
  168. package/views/dist/grid/chrome/grid-table-props.d.ts +16 -4
  169. package/views/dist/grid/chrome/useGridScaleStyles.d.ts +9 -1
  170. package/views/dist/grid/chrome/useGridScaleStyles.js +1 -4
  171. package/views/dist/grid/grid-format-props.d.ts +1 -1
  172. package/views/dist/grid/grid-format-props.js +18 -5
  173. package/views/dist/grid/grid.css +11 -1
  174. package/views/dist/grid/looks.d.ts +3 -1
  175. package/views/dist/grid/looks.js +10 -4
  176. package/views/dist/grid/useGridTablePrefs.d.ts +1 -1
  177. package/views/dist/grid/useGridTableSettings.d.ts +1 -1
  178. package/views/dist/list/layer.d.ts +8 -0
  179. package/views/dist/list/layer.js +7 -0
  180. package/views/dist/list/list.js +2 -2
  181. package/views/dist/list/menu.d.ts +5 -4
  182. package/views/dist/list/store.d.ts +1 -1
  183. package/views/dist/list/toolbar.js +47 -20
  184. package/views/dist/list/views.js +1 -0
  185. package/views/dist/panels/availability.d.ts +5 -0
  186. package/views/dist/panels/availability.js +4 -5
  187. package/views/dist/panels/customize-body.d.ts +5 -1
  188. package/views/dist/panels/customize-body.js +21 -12
  189. package/views/dist/panels/model.d.ts +14 -4
  190. package/views/dist/panels/react/customize-body.js +15 -3
  191. package/views/dist/panels/react/customize.d.ts +8 -0
  192. package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
  193. package/views/dist/panels/react/filter/FilterEditor.js +7 -0
  194. package/views/dist/panels/react/filter/FilterFieldList.d.ts +3 -1
  195. package/views/dist/panels/react/filter/FilterFieldList.js +2 -2
  196. package/views/dist/panels/react/filter/filter-body.js +3 -1
  197. package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -1
  198. package/views/dist/panels/react/filter/filter-part-body.js +2 -2
  199. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
  200. package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
  201. package/views/dist/panels/react/sort/SortEditor.js +3 -1
  202. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -2
  203. package/views/dist/panels/react/toolbar/Toolbar.d.ts +11 -1
  204. package/views/dist/panels/react/toolbar/Toolbar.js +16 -6
  205. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +5 -3
  206. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
  207. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +12 -5
  208. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
  209. package/views/dist/panels/react/toolbar/ToolbarFilters.js +18 -8
  210. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +9 -1
  211. package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
  212. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  213. package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
  214. package/views/dist/panels/react/toolbar/ToolbarSave.js +5 -4
  215. package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
  216. package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
  217. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
  218. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +4 -4
  219. package/views/dist/panels/react/toolbar/editor-menus.d.ts +8 -0
  220. package/views/dist/panels/react/toolbar/editor-menus.js +3 -0
  221. package/views/dist/panels/react/views-row/FoldingViewRow.js +3 -5
  222. package/views/dist/panels/react/views-row/HScrollRow.d.ts +4 -2
  223. package/views/dist/panels/react/views-row/HScrollRow.js +6 -2
  224. package/views/dist/panels/react/views-row/ViewAxes.js +6 -1
  225. package/views/dist/panels/react/views-row/ViewPicker.js +8 -3
  226. package/views/dist/panels/react/views-row/new-view.d.ts +11 -0
  227. package/views/dist/panels/react/views-row/new-view.js +21 -0
  228. package/views/dist/panels/react.d.ts +1 -1
  229. package/views/dist/panels/settings/layout.js +6 -38
  230. package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
  231. package/views/dist/panels/toolbar/page-resets.js +62 -0
  232. package/views/dist/panels/toolbar/same-item.d.ts +7 -0
  233. package/views/dist/panels/toolbar/same-item.js +9 -0
  234. package/views/dist/panels/view-state.d.ts +4 -0
  235. package/views/dist/provider/ViewsProvider.d.ts +9 -4
  236. package/views/dist/provider/ViewsProvider.js +13 -2
  237. package/views/dist/provider/components.d.ts +109 -7
  238. package/views/dist/provider/components.js +1 -1
  239. package/views/dist/react.d.ts +2 -2
  240. package/views/dist/styles.css +115 -27
  241. package/views/dist/styles.unlayered.css +115 -27
  242. package/views/docs/contract.md +55 -35
  243. package/views/docs/controls/avatar.md +3 -0
  244. package/views/docs/controls/bulk-bar.md +3 -1
  245. package/views/docs/controls/compound-editor.md +2 -0
  246. package/views/docs/controls/customize.md +1 -1
  247. package/views/docs/controls/filter-editor.md +1 -1
  248. package/views/docs/controls/links-editor.md +2 -0
  249. package/views/docs/controls/pane.md +1 -1
  250. package/views/docs/controls/picker.md +2 -0
  251. package/views/docs/controls/quick-filters.md +1 -1
  252. package/views/docs/controls/text-editor.md +1 -1
  253. package/views/docs/controls/values-editor.md +2 -0
  254. package/views/docs/guides/atoms.md +54 -3
  255. package/views/docs/guides/display.md +1 -1
  256. package/views/docs/guides/looks.md +1 -1
  257. package/views/docs/guides/the-grid.md +4 -2
  258. package/views/docs/guides/the-provider.md +2 -2
  259. package/views/docs/index.md +2 -2
  260. package/views/docs/install.md +198 -104
  261. package/views/docs/reference/controls.md +27 -24
  262. package/views/docs/reference/editors-range.md +1 -1
  263. package/views/docs/reference/field-row.md +1 -1
  264. package/views/docs/reference/grid.md +6 -5
  265. package/views/docs/reference/list.md +27 -7
  266. package/views/docs/reference/looks.md +5 -5
  267. package/views/docs/reference/panels-react.md +15 -14
  268. package/views/docs/reference/panels.md +5 -5
  269. package/views/docs/reference/react.md +25 -11
  270. package/views/docs/reference/views.md +2 -2
  271. package/views/docs/reshaping.md +22 -6
  272. package/views/skills/views/SKILL.md +2 -2
@@ -9,7 +9,7 @@ import type { ListSelectionConfig } from "../../selection/types.js";
9
9
  import type { ListSettingsConfig } from "../../model/column-capabilities.js";
10
10
  import type { ListAggregateKind, ListCellAction, ListColumn, ListOptionColorOverrides, ListRelationValue, ListSelectColor } from "../../model/column-schema.js";
11
11
  import type { ListDateStyle, ListDateStyleOverrides, ListDurationStyle, ListDurationStyleOverrides, ListNumberFormatOverrides, ListPercentDisplayOverrides, ListShowTimeOverrides } from "../../model/column-format.js";
12
- import type { ListColumnState, ListColumnsConfig } from "../../model/column-state.js";
12
+ import type { ListColumnItem, ListColumnState, ListColumnsConfig } from "../../model/column-state.js";
13
13
  import type { PercentDisplay } from "viewkitjs/fields";
14
14
  import type { ListGroupSummaryPart } from "../../model/preferences.js";
15
15
  import type { ListRowIconAccessor } from "../../model/row-icon.js";
@@ -20,7 +20,8 @@ import type { GridGroupSortOption } from "./GridGroupMenu.js";
20
20
  import type { GridGroupMenuPart } from "./grid-group-menu-parts.js";
21
21
  /** Each of the grid's menus as a function from its default items to the items it shows (`menu.drop`, `menu.rename`,
22
22
  * `menu.add` and `menu.move` on `viewkitjs/views/list` do the usual changes). `column` gets the column and its field,
23
- * `row` the row, `group` the group its band names. Each reshapes a menu the grid opens: a column or band whose menu holds
23
+ * `row` the row, `group` the group its band names, `addColumn` every column of the list, shown or hidden (+ Add column's
24
+ * rows: each hidden column `add:<id>`, a field with parts `field:<id>`, or `all-shown`). Each reshapes a menu the grid opens: a column or band whose menu holds
24
25
  * none of the grid's rows stays without one. Called while a menu draws: keep them pure and cheap.
25
26
  *
26
27
  * `row` is asked as a row's menu opens (a right-click, the row's ⋯, the menu key), never for a row drawn or pressed, and
@@ -39,6 +40,9 @@ export type GridMenus<Row> = {
39
40
  group?: (items: ViewsMenuItem[], ctx: {
40
41
  group: ListGroup<Row>;
41
42
  }) => ViewsMenuItem[];
43
+ addColumn?: (items: ViewsMenuItem[], ctx: {
44
+ columns: readonly ListColumnItem[];
45
+ }) => ViewsMenuItem[];
42
46
  };
43
47
  /** A group count's noun, singular and plural ("company", "companies"): "2 companies". None: a bare
44
48
  * count. */
@@ -178,9 +182,11 @@ export type GridTableProps<Row> = {
178
182
  /** The reader's default currency: a money column read in Original totals in it. The host's
179
183
  * answer (the portal: the reader's preference); default `DEFAULT_DISPLAY_CURRENCY`. */
180
184
  defaultCurrency?: DisplayCurrency;
181
- /** Rules between the columns: the rows' always, the header's too with `headerVerticalBorders`. Default true. */
185
+ /** Rules between the columns, the last column's closing the table: the rows' and the footer's, which then also draws a
186
+ * line under itself, pinned or not; the header's too with `headerVerticalBorders`. Default true. */
182
187
  verticalBorders?: boolean;
183
- /** The header's columns follow `verticalBorders` as the rows' do, the last bare. Default false: the header draws no
188
+ /** The header's columns follow `verticalBorders` as the rows' do, the last column's line closing the table as in the
189
+ * rows and the footer. Default false: the header draws no
184
190
  * line between its columns unless the app asks. */
185
191
  headerVerticalBorders?: boolean;
186
192
  /** The columns share the grid's whole width, each growing in proportion to its own width and never below it; a
@@ -299,6 +305,12 @@ export type GridTableProps<Row> = {
299
305
  * record a grouping draws twice. Drawn, as a hover is, only on a screen whose pointer hovers (`any-hover`). Absent
300
306
  * or null: none. */
301
307
  hoveredRow?: string | null;
308
+ /** Which row the grid tints: `"hover"` (the default), the row under the pointer, as always; or `"active"`, the active
309
+ * row alone, the row a person last pressed (anywhere on it) or the row of the picked cell, so the keyboard moves it
310
+ * too, carrying `data-active`. It stays through a press outside the grid and Escape, until another row is pressed or
311
+ * picked. Under `"active"` no row tints under the pointer, nor one held there by `hoveredRow`; the hover's other
312
+ * reveals (the row's box, its ⋯, the name's actions) stay. */
313
+ rowHighlight?: "hover" | "active";
302
314
  /** Told the row a person's pointer moves onto (its id) and off (null), on a screen whose pointer hovers. */
303
315
  onHoveredRowChange?: (id: string | null) => void;
304
316
  /** A cell drawn as picked, and its ranges, as a person's click and drag pick them; applied each time its value
@@ -1,3 +1,11 @@
1
- /** One row's height at scale 1, in px: `--vk-row-h` is built from it, and the row window counts rows by it. */
1
+ /** One row's height at scale 1, in px: `--vk-row-h`'s default (`GRID_HEIGHTS`), and the row window's count until it has
2
+ * measured a drawn row. */
2
3
  export declare const GRID_ROW_PX = 37;
4
+ /**
5
+ * The four heights an app sets on the frame (`--vk-row-h`, `--vk-head-h`, `--vk-label-h`, `--vk-footer-h`), at the
6
+ * scale: classes on the frame, never an inline declaration, which would beat the app's own rule there. Each weighs
7
+ * nothing (`:where`), so any rule on the frame wins over it: an app's, and the grid look's (its Words header's height).
8
+ * Written whole, as the stylesheet's scan reads them; the row's is `GRID_ROW_PX`.
9
+ */
10
+ export declare const GRID_HEIGHTS = "[:where(&)]:[--vk-row-h:calc(37px*var(--vk-scale))] [:where(&)]:[--vk-head-h:calc(32px*var(--vk-scale))] [:where(&)]:[--vk-label-h:calc(36px*var(--vk-scale))] [:where(&)]:[--vk-footer-h:calc(36px*var(--vk-scale))]";
3
11
  export declare function useGridScaleStyles(scale: number, grouped: boolean, phone: boolean, addColumn?: boolean): import("react").CSSProperties;
@@ -1,17 +1,14 @@
1
1
  "use client";
2
2
  import { useMemo } from "react";
3
3
  export const GRID_ROW_PX = 37;
4
+ export const GRID_HEIGHTS = "[:where(&)]:[--vk-row-h:calc(37px*var(--vk-scale))] [:where(&)]:[--vk-head-h:calc(32px*var(--vk-scale))] [:where(&)]:[--vk-label-h:calc(36px*var(--vk-scale))] [:where(&)]:[--vk-footer-h:calc(36px*var(--vk-scale))]";
4
5
  export function useGridScaleStyles(scale, grouped, phone, addColumn = false) {
5
6
  return useMemo(() => ({
6
7
  "--vk-scale": String(scale),
7
8
  "--vk-indent": phone ? "0px" : "24px",
8
- "--vk-row-h": `calc(${GRID_ROW_PX}px * var(--vk-scale))`,
9
9
  "--vk-line-h": "calc(22px * var(--vk-scale))",
10
- "--vk-head-h": "calc(32px * var(--vk-scale))",
11
10
  "--vk-head-text": "calc(12px * var(--vk-scale))",
12
11
  "--vk-head-glyph": "calc(12px * var(--vk-scale))",
13
- "--vk-footer-h": "calc(36px * var(--vk-scale))",
14
- "--vk-label-h": "calc(36px * var(--vk-scale))",
15
12
  "--vk-text": "calc(14px * var(--vk-scale))",
16
13
  "--vk-text-xs": "calc(12px * var(--vk-scale))",
17
14
  "--vk-text-10": "calc(10px * var(--vk-scale))",
@@ -8,7 +8,7 @@ export type GridFormatPrefs = Pick<ListViewPrefs, "gridOptionColors" | "gridDate
8
8
  /** The grid's format props and the handlers that write them back through `setFormats`. Every format is keyed by the
9
9
  * FIELD key (`fieldKeyOf(column)`), the name every surface shares. */
10
10
  export declare function useGridFormatProps<Row>(formats: GridFormatPrefs, setFormats: (patch: Partial<GridFormatPrefs>) => void, columns: ListColumn<Row>[]): {
11
- optionColors: import("../model/column-schema.js").ListOptionColorOverrides;
11
+ optionColors: Record<string, Record<string, import("viewkitjs/fields/design/category-colors").CategoryColor>>;
12
12
  onOptionColorChange: (key: string, value: string, color: ListSelectColor | null) => void;
13
13
  dateStyles: import("../model/column-format.js").ListDateStyleOverrides;
14
14
  onDateStyleChange: (key: string, style: ListDateStyle) => void;
@@ -1,14 +1,27 @@
1
1
  "use client";
2
- import { useCallback, useMemo } from "react";
2
+ import { useCallback, useEffect, useMemo, useRef } from "react";
3
3
  import { fieldKeyOf } from "../model/view-rules.js";
4
4
  import { setCurrency, setDateStyle, setDecimals, setDurationStyle, setOptionColor, setPercentDisplay, setShowTime, } from "../model/preferences.js";
5
5
  import { moneyReadingOf } from "../fields/money.js";
6
6
  import { isMoneyReading, MONEY_READING_OPTIONS } from "../fields/currency.js";
7
+ function settled(map) {
8
+ if (!Object.values(map).includes(null))
9
+ return map;
10
+ return Object.fromEntries(Object.entries(map).filter(([, held]) => held !== null));
11
+ }
7
12
  export function useGridFormatProps(formats, setFormats, columns) {
8
- const { gridOptionColors, gridDateStyles, gridDurationStyles, gridShowTime, gridPercentDisplays, gridDecimals, gridCurrencies, } = formats;
13
+ const { gridOptionColors: storedColors, gridDateStyles, gridDurationStyles, gridShowTime, gridPercentDisplays, gridDecimals: storedDecimals, gridCurrencies, } = formats;
14
+ const gridOptionColors = useMemo(() => settled(storedColors), [storedColors]);
15
+ const gridDecimals = useMemo(() => settled(storedDecimals), [storedDecimals]);
16
+ const colours = useRef(gridOptionColors);
17
+ useEffect(() => {
18
+ colours.current = gridOptionColors;
19
+ }, [gridOptionColors]);
9
20
  const onOptionColorChange = useCallback((key, value, color) => {
10
- setFormats({ gridOptionColors: setOptionColor(gridOptionColors, key, value, color) });
11
- }, [gridOptionColors, setFormats]);
21
+ const next = setOptionColor(colours.current, key, value, color);
22
+ colours.current = next;
23
+ setFormats({ gridOptionColors: { ...next, [key]: next[key] ?? null } });
24
+ }, [setFormats]);
12
25
  const onDateStyleChange = useCallback((key, style) => setFormats({ gridDateStyles: setDateStyle(gridDateStyles, key, style) }), [gridDateStyles, setFormats]);
13
26
  const onDurationStyleChange = useCallback((key, style) => setFormats({ gridDurationStyles: setDurationStyle(gridDurationStyles, key, style) }), [gridDurationStyles, setFormats]);
14
27
  const onShowTimeChange = useCallback((key, show) => setFormats({ gridShowTime: setShowTime(gridShowTime, key, show) }), [gridShowTime, setFormats]);
@@ -31,7 +44,7 @@ export function useGridFormatProps(formats, setFormats, columns) {
31
44
  if (patch.currency != null && isMoneyReading(patch.currency))
32
45
  setFormats({ gridCurrencies: setCurrency(gridCurrencies, key, patch.currency) });
33
46
  if (patch.decimals === null)
34
- setFormats({ gridDecimals: { [key]: null } });
47
+ setFormats({ gridDecimals: { ...gridDecimals, [key]: null } });
35
48
  else if (patch.decimals !== undefined)
36
49
  setFormats({ gridDecimals: setDecimals(gridDecimals, key, patch.decimals) });
37
50
  }, [gridCurrencies, gridDecimals, setFormats]);
@@ -28,11 +28,15 @@
28
28
  one; the grid draws them at 70% of it. */
29
29
  [data-grid-header="words"] [data-slot="vk-grid"][data-desktop] [data-slot="vk-grid-header"],
30
30
  [data-slot="vk-grid"][data-desktop] [data-slot="vk-grid-header"]:not([data-grid-header] *) {
31
- --vk-head-h: calc(var(--vk-spacing) * 9 * var(--vk-scale));
32
31
  --vk-head-text: calc(var(--vk-font-size-sm) * var(--vk-scale));
33
32
  --vk-head-glyph: calc(var(--vk-spacing) * 3.5 * var(--vk-scale));
34
33
  --vk-head-glyph-fg: var(--vk-fg-subtle);
35
34
  }
35
+ /* Its height is the frame's, where an app sets the header's own (`--vk-head-h`): weighing nothing (`:where`), so
36
+ any rule of the app's on the frame wins over the look's. */
37
+ :where([data-grid-header="words"] [data-slot="vk-grid"][data-desktop], [data-slot="vk-grid"][data-desktop]:not([data-grid-header] *)) {
38
+ --vk-head-h: calc(var(--vk-spacing) * 9 * var(--vk-scale));
39
+ }
36
40
  [data-grid-header="words"] [data-slot="vk-grid"][data-desktop] [data-slot="vk-grid-header-cell"],
37
41
  [data-slot="vk-grid"][data-desktop] [data-slot="vk-grid-header-cell"]:not([data-grid-header] *) {
38
42
  --vk-fg-subtle: var(--vk-fg);
@@ -231,6 +235,12 @@
231
235
  margin-right: var(--vk-spacing);
232
236
  }
233
237
 
238
+ /* Add calculation, Always (Attio's table): every empty footer cell (data-empty) shows its offer at rest, the words Figures
239
+ dresses, "+ Add calculation" under Value first; the pointer opens the same picker. On hover is the grid's own. */
240
+ [data-grid-offer="always"] [data-slot="vk-grid-figure-pick"] {
241
+ opacity: 1;
242
+ }
243
+
234
244
  /* Pressed while its menu is open, in every look: a header cell while its column's menu is, a footer cell while its figure
235
245
  picker is, and + Add column's corner of the header while its menu is (data-open). */
236
246
  [data-slot="vk-grid-header-cell"][data-open],
@@ -1,6 +1,6 @@
1
1
  import type { GridGroupMenuPart } from "./chrome/grid-group-menu-parts.js";
2
2
  import { type LookPicks, type PieceLooks } from "../looks/looks.js";
3
- export type GridLookOptionId = "header" | "lines" | "columns" | "density" | "phone" | "name" | "edge" | "boxes" | "icon" | "picked" | "cell" | "corners" | "hover" | "frame" | "groups" | "names" | "phones" | "typed" | "figures" | "width" | "more" | "wait" | "foot" | "add" | "picking";
3
+ export type GridLookOptionId = "header" | "lines" | "columns" | "density" | "phone" | "name" | "edge" | "boxes" | "icon" | "picked" | "cell" | "corners" | "hover" | "highlight" | "frame" | "groups" | "names" | "phones" | "typed" | "figures" | "offer" | "width" | "more" | "wait" | "foot" | "add" | "picking";
4
4
  /** The grid's options and its two looks, attio and portal. Nothing picked wears each option's default, My preset's grid look
5
5
  * (the Decisions of 25 Nov 2026: "My preset from the station is the look and ViewKit's default"), which differs from Attio's
6
6
  * in ten options: its column lines all, its pinned edge a line, its checkboxes always, picked rows tinted and lined, round
@@ -23,6 +23,7 @@ export type GridLookWorn = {
23
23
  foot: "pinned" | "rows";
24
24
  add: "name" | "end";
25
25
  picking: "press" | "rail";
26
+ highlight: "hover" | "active";
26
27
  };
27
28
  /** The options the grid's code reads, in this order. */
28
29
  export declare const GRID_LOOK_READ: readonly (keyof GridLookWorn)[];
@@ -44,6 +45,7 @@ export type GridLookProps = {
44
45
  pinFooter: boolean;
45
46
  addColumnAt: "end" | "title";
46
47
  phonePicking: boolean;
48
+ rowHighlight: "hover" | "active";
47
49
  };
48
50
  /** What a worn look hands GridTable, on a phone or a computer. */
49
51
  export declare function gridLookProps(worn: GridLookWorn, phone: boolean): GridLookProps;
@@ -13,12 +13,14 @@ const options = [
13
13
  { id: "cell", name: "Picked cell", def: "wash", values: [{ id: "wash", name: "Wash" }, { id: "ring", name: "Ring" }] },
14
14
  { id: "corners", name: "Cell corners", def: "round", values: [{ id: "square", name: "Square" }, { id: "round", name: "Round" }] },
15
15
  { id: "hover", name: "Hover frame", def: "strong", values: [{ id: "none", name: "None" }, { id: "subtle", name: "Subtle" }, { id: "strong", name: "Strong" }] },
16
+ { id: "highlight", name: "Row highlight", def: "hover", values: [{ id: "hover", name: "Hover" }, { id: "active", name: "Active row" }] },
16
17
  { id: "frame", name: "Picked cell frame", def: "brand", values: [{ id: "brand", name: "Brand" }, { id: "neutral", name: "Neutral" }] },
17
18
  { id: "groups", name: "Groups", def: "titles", values: [{ id: "compact", name: "Compact" }, { id: "titles", name: "Own titles" }] },
18
19
  { id: "names", name: "Names", def: "hover", values: [{ id: "underline", name: "Underlined" }, { id: "hover", name: "On hover" }] },
19
20
  { id: "phones", name: "Phones", def: "text", values: [{ id: "link", name: "Link" }, { id: "text", name: "As text" }] },
20
21
  { id: "typed", name: "Phones as typed", def: "dotted", values: [{ id: "none", name: "None" }, { id: "dotted", name: "Dotted line" }, { id: "subtle", name: "Subtle" }, { id: "dot", name: "Dot" }, { id: "tint", name: "Tinted" }] },
21
22
  { id: "figures", name: "Figures", def: "word", values: [{ id: "value", name: "Value first" }, { id: "word", name: "Word first" }] },
23
+ { id: "offer", name: "Add calculation", def: "hover", values: [{ id: "hover", name: "On hover" }, { id: "always", name: "Always" }] },
22
24
  { id: "width", name: "Width", def: "own", values: [{ id: "own", name: "The columns' own" }, { id: "fill", name: "Fill" }] },
23
25
  { id: "more", name: "More rows", def: "scroll", values: [{ id: "scroll", name: "As you scroll" }, { id: "pages", name: "In pages" }] },
24
26
  { id: "wait", name: "Rows changing", def: "kept", values: [{ id: "kept", name: "Kept" }, { id: "cleared", name: "Cleared" }] },
@@ -36,8 +38,9 @@ export const GRID_LOOKS = {
36
38
  name: "Attio",
37
39
  picks: {
38
40
  header: "words", lines: "on", columns: "pinned", density: "default", phone: "attio", name: "pinned", edge: "fade",
39
- boxes: "hover", icon: "on", picked: "tint", cell: "wash", corners: "square", hover: "subtle", frame: "brand",
40
- groups: "compact", names: "underline", phones: "link", typed: "dotted", figures: "value", width: "own", more: "scroll",
41
+ boxes: "hover", icon: "on", picked: "tint", cell: "wash", corners: "square", hover: "subtle", highlight: "hover",
42
+ frame: "brand", groups: "compact", names: "underline", phones: "link", typed: "dotted", figures: "value", offer: "hover",
43
+ width: "own", more: "scroll",
41
44
  wait: "kept", foot: "pinned", add: "name", picking: "press",
42
45
  },
43
46
  },
@@ -46,8 +49,9 @@ export const GRID_LOOKS = {
46
49
  name: "The portal's",
47
50
  picks: {
48
51
  header: "quiet", lines: "on", columns: "all", density: "default", phone: "computer", name: "pinned", edge: "shadow",
49
- boxes: "hover", icon: "off", picked: "line", cell: "ring", corners: "square", hover: "strong", frame: "brand",
50
- groups: "titles", names: "hover", phones: "text", typed: "subtle", figures: "word", width: "own", more: "scroll",
52
+ boxes: "hover", icon: "off", picked: "line", cell: "ring", corners: "square", hover: "strong", highlight: "hover",
53
+ frame: "brand", groups: "titles", names: "hover", phones: "text", typed: "subtle", figures: "word", offer: "hover",
54
+ width: "own", more: "scroll",
51
55
  wait: "kept", foot: "rows", add: "end", picking: "rail",
52
56
  },
53
57
  },
@@ -55,6 +59,7 @@ export const GRID_LOOKS = {
55
59
  };
56
60
  export const GRID_LOOK_READ = [
57
61
  "columns", "density", "phone", "name", "boxes", "icon", "groups", "figures", "width", "more", "wait", "foot", "add", "picking",
62
+ "highlight",
58
63
  ];
59
64
  export function gridLookWorn(picks) {
60
65
  return lookWorn(GRID_LOOKS, picks, GRID_LOOK_READ);
@@ -78,5 +83,6 @@ export function gridLookProps(worn, phone) {
78
83
  pinFooter: phone && worn.foot === "pinned",
79
84
  addColumnAt: phone && worn.add === "name" ? "title" : "end",
80
85
  phonePicking: phone && worn.picking === "press",
86
+ rowHighlight: worn.highlight,
81
87
  };
82
88
  }
@@ -24,7 +24,7 @@ export declare function useGridTablePrefs<Row>({ prefs, setPrefs, columns, viewB
24
24
  aggregates: Record<string, import("viewkitjs/fields/query").FigureKind>;
25
25
  onAggregateChange: (columnId: string, kind: ListAggregateKind) => void;
26
26
  viewBacked: boolean;
27
- optionColors: import("../model/column-schema.js").ListOptionColorOverrides;
27
+ optionColors: Record<string, Record<string, import("viewkitjs/fields/design/category-colors").CategoryColor>>;
28
28
  onOptionColorChange: (key: string, value: string, color: import("../model/column-schema.js").ListSelectColor | null) => void;
29
29
  dateStyles: import("../model/column-format.js").ListDateStyleOverrides;
30
30
  onDateStyleChange: (key: string, style: import("../model/column-format.js").ListDateStyle) => void;
@@ -36,7 +36,7 @@ export declare function useGridTableSettings<Row>({ settings, layer, columns, pa
36
36
  aggregates: Record<string, import("viewkitjs/fields/query").FigureKind>;
37
37
  onAggregateChange: (columnId: string, kind: ListAggregateKind) => void;
38
38
  viewBacked: true;
39
- optionColors: import("../model/column-schema.js").ListOptionColorOverrides;
39
+ optionColors: Record<string, Record<string, import("viewkitjs/fields/design/category-colors").CategoryColor>>;
40
40
  onOptionColorChange: (key: string, value: string, color: import("../model/column-schema.js").ListSelectColor | null) => void;
41
41
  dateStyles: import("../model/column-format.js").ListDateStyleOverrides;
42
42
  onDateStyleChange: (key: string, style: import("../model/column-format.js").ListDateStyle) => void;
@@ -0,0 +1,8 @@
1
+ import type { ListPersonalLayer } from "viewkitjs/fields/query";
2
+ /** A layer with nothing in it, every key present, so a store that merges a patch clears each one. */
3
+ export declare const EMPTY_LAYER: ListPersonalLayer;
4
+ /** Whether a person's layer holds anything that shows: a width, a fold, a look of their own, and on a phone (`phone`) their
5
+ * phone's layout. */
6
+ export declare function layerHolds(layer: ListPersonalLayer, { phone }?: {
7
+ phone?: boolean;
8
+ }): boolean;
@@ -0,0 +1,7 @@
1
+ export const EMPTY_LAYER = { look: {}, widths: {}, folded: [], phoneLayout: undefined };
2
+ export function layerHolds(layer, { phone = true } = {}) {
3
+ return (Object.keys(layer.look ?? {}).length > 0 ||
4
+ Object.keys(layer.widths ?? {}).length > 0 ||
5
+ (layer.folded ?? []).length > 0 ||
6
+ (phone && layer.phoneLayout !== undefined));
7
+ }
@@ -9,8 +9,8 @@ function handed(from) {
9
9
  return Object.fromEntries(Object.entries(from).filter(([, value]) => value !== undefined));
10
10
  }
11
11
  export function List({ id, fields, rows, source, pageSize, save, columns, views, defaults, sortFilter, bar, menus, toolbarParts, customizeIn, link = true, can, onOpenRow, rowHref, rowWritable, onAdd, addItems, quickFilters, toolbar, grid, bulk, className, }) {
12
- const toolbarMenus = { ...toolbar?.menus, ...handed({ view: menus?.view, add: menus?.add, more: menus?.more }) };
13
- const gridMenus = { ...grid?.menus, ...handed({ column: menus?.column, row: menus?.row, group: menus?.group }) };
12
+ const toolbarMenus = { ...toolbar?.menus, ...handed({ view: menus?.view, add: menus?.add, more: menus?.more, customize: menus?.customize, sortEditor: menus?.sortEditor, filterEditor: menus?.filterEditor, groupEditor: menus?.groupEditor }) };
13
+ const gridMenus = { ...grid?.menus, ...handed({ column: menus?.column, row: menus?.row, group: menus?.group, addColumn: menus?.addColumn }) };
14
14
  const [box, setBox] = useState(null);
15
15
  const inPane = (customizeIn ?? toolbar?.customizeIn) === "pane";
16
16
  const gridOf = (_jsx(ListGrid, { ...grid, ...handed({ onOpenRow, rowHref, rowWritable }), menus: gridMenus, children: grid?.children ?? _jsx(ListBulkBar, { ...bulk }) }));
@@ -1,8 +1,7 @@
1
1
  import type { GridMenus } from "../grid/chrome/grid-table-props.js";
2
2
  import type { ToolbarMenus } from "../panels/react/toolbar/ReadyToolbar.js";
3
- import type { ViewsMenuItem } from "../provider/components.js";
4
- /** Every menu of a list as data: the grid's (`column`, `row`, `group`, which `GridTable` takes as `menus`) and the toolbar's
5
- * (`view`, `add`, `more`, which `ReadyToolbar` and `ListToolbar` take as `menus`). Each is handed its default items and hands
3
+ /** Every menu of a list as data: the grid's (`column`, `row`, `group`, `addColumn`, which `GridTable` takes as `menus`) and the toolbar's
4
+ * (`view`, `add`, `more`, `customize`, which `ReadyToolbar` and `ListToolbar` take as `menus`). Each is handed its default items and hands
6
5
  * back the items it shows; a menu with no function is as ViewKit draws it. */
7
6
  export type ListMenus<Row> = GridMenus<Row> & ToolbarMenus;
8
7
  /** Where a row goes: right after the row of that key, or right before it. */
@@ -18,7 +17,9 @@ type Keyed<T> = {
18
17
  children?: T[];
19
18
  };
20
19
  declare function drop<T extends Keyed<T>>(items: T[], ...keys: string[]): T[];
21
- declare function rename(items: ViewsMenuItem[], key: string, label: string): ViewsMenuItem[];
20
+ declare function rename<T extends Keyed<T> & {
21
+ label: string;
22
+ }>(items: T[], key: string, label: string): T[];
22
23
  declare function add<T extends Keyed<T>>(items: T[], item: T, place?: MenuPlace): T[];
23
24
  declare function move<T extends Keyed<T>>(items: T[], key: string, place: MenuPlace): T[];
24
25
  /** The four changes an app's menu function makes to the items it is handed. */
@@ -26,7 +26,7 @@ export type ListState = {
26
26
  held: Pending | null;
27
27
  /** The filter bar shows (the toolbar says, as it draws). */
28
28
  barShown: boolean;
29
- /** Clear and Save stand in Customize's foot, not at the bar's end (the toolbar says, as it draws). */
29
+ /** Clear and Save stand in Customize's foot (in Mihai's look beside the bar's, VK-1046; the toolbar says, as it draws). */
30
30
  footHere: boolean;
31
31
  sortFilter: "right" | "bar";
32
32
  bar: "added" | "always";
@@ -8,6 +8,7 @@ import { useDesktop } from "../provider/desktop.js";
8
8
  import { getViewOptionAvailability } from "../panels/availability.js";
9
9
  import { settingsPanels } from "../panels/settings/settings-panels.js";
10
10
  import { settingsCleared } from "../panels/toolbar/clear.js";
11
+ import { pageResets } from "../panels/toolbar/page-resets.js";
11
12
  import { countsToggle, groupShown, showCountsChange, showCountsOf } from "../panels/toolbar/counts.js";
12
13
  import { withEditView, withViewMenu } from "../panels/toolbar/edit-view.js";
13
14
  import { splitViewAxes } from "../panels/views-row/model.js";
@@ -18,6 +19,7 @@ import { ToolbarFilterAdd } from "../panels/react/toolbar/ToolbarFilterAdd.js";
18
19
  import { ToolbarFilters, foldableFilters } from "../panels/react/toolbar/ToolbarFilters.js";
19
20
  import { ToolbarNew } from "../panels/react/toolbar/ToolbarNew.js";
20
21
  import { ToolbarOptions } from "../panels/react/toolbar/ToolbarOptions.js";
22
+ import { EditorMenus } from "../panels/react/toolbar/editor-menus.js";
21
23
  import { PaneBox, PaneHost } from "../panels/react/toolbar/pane-host.js";
22
24
  import { ToolbarQuickFilters } from "../panels/react/toolbar/ToolbarQuickFilters.js";
23
25
  import { ToolbarSave } from "../panels/react/toolbar/ToolbarSave.js";
@@ -29,11 +31,13 @@ import { ToolbarViews } from "../panels/react/toolbar/ToolbarViews.js";
29
31
  import { applyParts } from "./parts.js";
30
32
  import { useList, useListPanel, useListStore } from "./root-base.js";
31
33
  import { useListViewsAxis } from "./views-axis.js";
34
+ import { EMPTY_LAYER, layerHolds } from "./layer.js";
32
35
  export function ListToolbar(props) {
33
- return (_jsx(PaneBox.Provider, { value: props.paneBox ?? null, children: _jsx(ToolbarOfList, { ...props }) }));
36
+ const { sortEditor: sort, filterEditor: filter, groupEditor: group } = props.menus ?? {};
37
+ return (_jsx(PaneBox.Provider, { value: props.paneBox ?? null, children: _jsx(EditorMenus.Provider, { value: { ...(sort && { sort }), ...(filter && { filter }), ...(group && { group }) }, children: _jsx(ToolbarOfList, { ...props }) }) }));
34
38
  }
35
39
  function ToolbarOfList(props) {
36
- const { views: viewsHanded, viewsLayout, onAdd, addItems, addLabel, fieldEditor, searchPlaceholder, searching, hosts, narrow, className, viewName, onRenameView, onCopyLink, onExport, exportCount, menus, toolbarParts, } = props;
40
+ const { views: viewsHanded, viewsLayout, onAdd, addItems, addLabel, fieldEditor, searchPlaceholder, searching, hosts, narrow, className, viewName, onRenameView, onCopyLink, onExport, exportCount, menus, toolbarParts, overflow, } = props;
37
41
  const storeViews = useListViewsAxis(props.layouts);
38
42
  const rootColumns = useList((s) => s.columns);
39
43
  const answer = useList((s) => s.answer);
@@ -43,7 +47,7 @@ function ToolbarOfList(props) {
43
47
  const layer = useList((s) => s.view.layer);
44
48
  const onChange = useList((s) => s.setSettings);
45
49
  const onLayerChange = useList((s) => s.setLayer);
46
- const view = useList((s) => s.view.shared) ?? undefined;
50
+ const shared = useList((s) => s.view.shared) ?? undefined;
47
51
  const sortFilter = useList((s) => s.panels.sortFilter);
48
52
  const bar = useList((s) => s.panels.bar);
49
53
  const customizeOwn = {
@@ -108,6 +112,29 @@ function ToolbarOfList(props) {
108
112
  if (change)
109
113
  onChange(change);
110
114
  };
115
+ const layered = layerHolds(layer, { phone });
116
+ const resetAll = () => {
117
+ if (shared) {
118
+ if (shared.changes > 0)
119
+ shared.onReset();
120
+ }
121
+ else
122
+ clear("options")();
123
+ if (layered)
124
+ onLayerChange(EMPTY_LAYER);
125
+ };
126
+ const view = shared && { ...shared, onReset: resetAll };
127
+ const resets = shared && !shared.saved ? undefined : Object.fromEntries(Object.entries(pageResets(input, shared ? shared.saved ?? null : null, { cleared: !shared, phone })).map(([page, back]) => [
128
+ page,
129
+ () => {
130
+ if (back.change)
131
+ onChange(back.change);
132
+ if (back.layer)
133
+ onLayerChange(back.layer);
134
+ },
135
+ ]));
136
+ const differs = resets && { sort: !!resets.sort, filter: !!resets.filter };
137
+ const savedFilter = shared?.saved?.filter;
111
138
  const Edit = icons.options;
112
139
  const editable = getViewOptionAvailability(inputs).desktop
113
140
  ? withEditView(views, {
@@ -127,7 +154,7 @@ function ToolbarOfList(props) {
127
154
  if (Object.keys(change).length > 0)
128
155
  onChange(change);
129
156
  } }));
130
- const sortNode = several && panels.sorts ? (_jsx(ToolbarSortPill, { sorts: panels.sorts, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort, addAfter: props.addAfter })) : (_jsx(ToolbarSort, { sort: panels.sort, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort }));
157
+ const sortNode = several && panels.sorts ? (_jsx(ToolbarSortPill, { sorts: panels.sorts, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort, addAfter: props.addAfter, ...(differs && { changed: differs.sort }) })) : (_jsx(ToolbarSort, { sort: panels.sort, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort }));
131
158
  const filterNode = (_jsx(ToolbarFilter, { filters: panels.filters, filterTree: panels.filterTree, onClear: clear("filters"), open: filterState.open, onOpenChange: filterState.onOpenChange, page: filterState.page, onPageChange: filterState.onPageChange, host: hosts?.filter }));
132
159
  const holdCounts = answer?.holdCounts;
133
160
  const quick = props.quickFilters?.fields.length
@@ -147,14 +174,14 @@ function ToolbarOfList(props) {
147
174
  const tree = panels.filterTree;
148
175
  const mihais = sortFilter === "right" && !phone;
149
176
  const always = bar === "always";
150
- const filtered = tree ? barItemsOf(tree.tree).length > 0 || !!heldStands(held, tree.tree) : false;
151
- const barShown = always || !!stackedAxes || filtered;
152
- const footHere = phone || (mihais && !barShown);
177
+ const filtered = tree ? foldableFilters(tree.tree, null, savedFilter) > 0 || !!heldStands(held, tree.tree) : false;
178
+ const barShown = always || !!stackedAxes || filtered || (!!differs && (differs.sort || differs.filter));
179
+ const footHere = phone || mihais;
153
180
  const barPublished = kit && !phone && (sortFilter === "bar" || barShown);
154
181
  const footPublished = kit ? footHere : true;
155
182
  useLayoutEffect(() => store.patch({ panels: { barShown: barPublished, footHere: footPublished } }), [store, barPublished, footPublished]);
156
183
  if (kit) {
157
- const clearable = !view && settingsCleared(input, "options", { phone }) !== null;
184
+ const clearable = !view && (layered || settingsCleared(input, "options", { phone }) !== null);
158
185
  const tabs = !phone && viewAxes?.length === 1 ? Math.max(0, viewAxes[0].options.length - 1) : 0;
159
186
  const Sort = icons.sort;
160
187
  const Filter = icons.filter;
@@ -210,7 +237,7 @@ function ToolbarOfList(props) {
210
237
  icon: _jsx(Edit, { className: "h-4 w-4" }),
211
238
  onSelect: () => options.onOpenChange(true),
212
239
  },
213
- node: (_jsx(ToolbarOptions, { ...inputs, view: view, viewFoot: !footHere ? "none" : view ? undefined : "kit", footClear: footHere && clearable ? clear("options") : undefined, fieldEditor: fieldEditor, onClear: view ? view.onReset : clear("options"), open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: optionsHost, ...customizeOwn })),
240
+ node: (_jsx(ToolbarOptions, { ...inputs, view: view, ...(layered && { layered }), viewFoot: !footHere ? "none" : view ? undefined : "kit", footClear: footHere && clearable ? resetAll : undefined, resets: resets, customizeItems: menus?.customize, fieldEditor: fieldEditor, onClear: resetAll, open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: optionsHost, ...customizeOwn })),
214
241
  },
215
242
  ...(quickNode
216
243
  ? [
@@ -250,7 +277,7 @@ function ToolbarOfList(props) {
250
277
  key: "save",
251
278
  line: 2,
252
279
  side: "end",
253
- node: _jsx(ToolbarSave, { view: view, onClear: clearable ? clear("options") : undefined }),
280
+ node: _jsx(ToolbarSave, { view: view, layered: layered, onClear: clearable ? resetAll : undefined }),
254
281
  },
255
282
  ]
256
283
  : []),
@@ -260,10 +287,10 @@ function ToolbarOfList(props) {
260
287
  const phoneParts = quickHere
261
288
  ? [...kitParts.filter((part) => part !== quickHere), { ...quickHere, line: 2, side: "start" }]
262
289
  : kitParts;
263
- return _jsx(Toolbar, { parts: placed(phoneParts), phone: true, fold: true, more: menus?.more, className: className });
290
+ return _jsx(Toolbar, { parts: placed(phoneParts), phone: true, fold: true, more: menus?.more, overflow: overflow, className: className });
264
291
  }
265
292
  if (sortFilter === "bar")
266
- return _jsx(Toolbar, { parts: placed(kitParts), phone: phone, fold: true, more: menus?.more, className: className });
293
+ return _jsx(Toolbar, { parts: placed(kitParts), phone: phone, fold: true, more: menus?.more, overflow: overflow, className: className });
267
294
  const rowSort = {
268
295
  key: "sort",
269
296
  side: "end",
@@ -274,7 +301,7 @@ function ToolbarOfList(props) {
274
301
  icon: _jsx(Sort, { className: "h-4 w-4" }),
275
302
  onSelect: () => sortAdd.onOpenChange(true),
276
303
  },
277
- node: panels.sorts ? (_jsx(ToolbarSortPill, { row: true, sorts: panels.sorts, open: sortAdd.open, onOpenChange: sortAdd.onOpenChange, host: hosts?.sort })) : (_jsx(ToolbarSort, { sort: panels.sort, open: sortAdd.open, onOpenChange: sortAdd.onOpenChange, host: hosts?.sort })),
304
+ node: panels.sorts ? (_jsx(ToolbarSortPill, { row: true, sorts: panels.sorts, open: sortAdd.open, onOpenChange: sortAdd.onOpenChange, host: hosts?.sort, ...(differs && { changed: differs.sort }) })) : (_jsx(ToolbarSort, { sort: panels.sort, open: sortAdd.open, onOpenChange: sortAdd.onOpenChange, host: hosts?.sort, ...(differs && { changed: differs.sort }) })),
278
305
  };
279
306
  const rowFilter = tree
280
307
  ? {
@@ -283,10 +310,10 @@ function ToolbarOfList(props) {
283
310
  shed: true,
284
311
  fold: true,
285
312
  menu: { ...filterMenu, onSelect: () => filterAdd.onOpenChange(true) },
286
- node: (_jsx(ToolbarFilterAdd, { filterTree: tree, onHeldChange: setHeld, open: filterAdd.open, onOpenChange: filterAdd.onOpenChange, host: hosts?.filter })),
313
+ node: (_jsx(ToolbarFilterAdd, { filterTree: tree, onHeldChange: setHeld, open: filterAdd.open, onOpenChange: filterAdd.onOpenChange, host: hosts?.filter, changed: !!differs?.filter, opens: "filters" })),
287
314
  }
288
315
  : { key: "filter", side: "end", shed: true, fold: true, menu: filterMenu, node: filterNode };
289
- const pill = always && panels.sorts ? (_jsx(ToolbarSortPill, { sorts: panels.sorts, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort, addAfter: false })) : null;
316
+ const pill = (always || !!differs?.sort) && (panels.sorts ?? panels.sort).options.length > 0 ? (panels.sorts ? (_jsx(ToolbarSortPill, { sorts: panels.sorts, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort, addAfter: false })) : (_jsx(ToolbarSort, { bar: true, sort: panels.sort, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort }))) : null;
290
317
  const stackedPart = kitParts.find((part) => part.key === "views-stacked");
291
318
  const barParts = barShown
292
319
  ? [
@@ -298,8 +325,8 @@ function ToolbarOfList(props) {
298
325
  {
299
326
  key: "filters",
300
327
  line: 2,
301
- filters: foldableFilters(tree.tree, held),
302
- node: (_jsx(ToolbarFilters, { filterTree: tree, open: filterState.open, onOpenChange: filterState.onOpenChange, held: held, onHeldChange: setHeld, host: hosts?.filter, emptyPlace: always })),
328
+ filters: foldableFilters(tree.tree, held, always ? undefined : savedFilter),
329
+ node: (_jsx(ToolbarFilters, { filterTree: tree, open: filterState.open, onOpenChange: filterState.onOpenChange, held: held, onHeldChange: setHeld, host: hosts?.filter, emptyPlace: always, ...(!always && savedFilter && { saved: savedFilter }) })),
303
330
  },
304
331
  ]
305
332
  : []),
@@ -307,7 +334,7 @@ function ToolbarOfList(props) {
307
334
  key: "save",
308
335
  line: 2,
309
336
  side: "end",
310
- node: _jsx(ToolbarSave, { view: view, onClear: clearable ? clear("options") : undefined }),
337
+ node: _jsx(ToolbarSave, { view: view, layered: layered, onClear: clearable ? resetAll : undefined }),
311
338
  },
312
339
  ]
313
340
  : [];
@@ -330,7 +357,7 @@ function ToolbarOfList(props) {
330
357
  at("new"),
331
358
  ...barParts,
332
359
  ];
333
- return _jsx(Toolbar, { parts: placed(mihaisParts), phone: phone, fold: true, more: menus?.more, className: className });
360
+ return _jsx(Toolbar, { parts: placed(mihaisParts), phone: phone, fold: true, more: menus?.more, overflow: overflow, className: className });
334
361
  }
335
362
  const parts = [
336
363
  ...(shownViews
@@ -369,7 +396,7 @@ function ToolbarOfList(props) {
369
396
  {
370
397
  key: "options",
371
398
  side: "end",
372
- node: (_jsx(ToolbarOptions, { ...inputs, view: view, fieldEditor: fieldEditor, onClear: view ? view.onReset : clear("options"), open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: optionsHost, ...customizeOwn })),
399
+ node: (_jsx(ToolbarOptions, { ...inputs, view: view, ...(layered && { layered }), resets: resets, customizeItems: menus?.customize, fieldEditor: fieldEditor, onClear: resetAll, open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: optionsHost, ...customizeOwn })),
373
400
  },
374
401
  { key: "new", side: "end", node: _jsx(ToolbarNew, { onAdd: onAdd, items: newItems, label: addLabel }) },
375
402
  ];
@@ -372,6 +372,7 @@ export function createListViews(o) {
372
372
  canPublish: canSave(view),
373
373
  own: view.scope === "personal",
374
374
  pending: writes > 0,
375
+ saved: savedOf(),
375
376
  };
376
377
  if (shown && Object.keys(next).every((key) => shown[key] === next[key]))
377
378
  return shown;
@@ -17,7 +17,12 @@ type ResolvedPersonalSection<V extends string = string> = {
17
17
  choices: LayoutViewChoice<V>[];
18
18
  onReset?: () => void;
19
19
  };
20
+ /** @deprecated Read by nothing since Customize's Layout page ends at its toggles (VK-1033): an app's `personal` draws
21
+ * nowhere. To be removed in a later release. */
20
22
  export declare function resolvePersonalSection<V extends string>(layout: LayoutConfig<V>, messages?: ViewsMessageResolver): ResolvedPersonalSection<V> | null;
23
+ /** Whether a list's Layout stands on a phone: not marked for the computer alone, or with the phone's own value and its
24
+ * write. */
25
+ export declare function layoutStandsOnPhone(layout: LayoutConfig<string>): boolean;
21
26
  /** Desktop-only controls must not create an empty mobile View sheet. */
22
27
  export declare function getViewOptionAvailability<S extends string, G extends string, T extends string>({ filters, sort, group, timeScopeConfig, dateRangeConfigs, toggles, layout, }: ViewOptionInputs<S, G, T>): {
23
28
  desktop: boolean;
@@ -14,13 +14,12 @@ export function resolvePersonalSection(layout, messages = resolveViewsMessage) {
14
14
  onReset: personal.onReset,
15
15
  };
16
16
  }
17
+ export function layoutStandsOnPhone(layout) {
18
+ return !layout.desktopOnly || (layout.mobileValue != null && layout.onMobileChange !== undefined);
19
+ }
17
20
  export function getViewOptionAvailability({ filters, sort, group, timeScopeConfig, dateRangeConfigs, toggles, layout, }) {
18
21
  const shared = !!filters?.length || !!sort || !!group || !!timeScopeConfig || !!dateRangeConfigs?.length;
19
- const hasPersonal = layout ? resolvePersonalSection(layout) !== null : false;
20
- const mobileLayout = !!layout &&
21
- (hasPersonal ||
22
- !layout.desktopOnly ||
23
- (layout.mobileValue != null && layout.onMobileChange !== undefined));
22
+ const mobileLayout = !!layout && layoutStandsOnPhone(layout);
24
23
  return {
25
24
  desktop: shared || !!toggles?.length || !!layout,
26
25
  mobile: shared || !!toggles?.some((toggle) => !toggle.desktopOnly) || mobileLayout,
@@ -10,12 +10,16 @@ export declare function groupBodyValue(group: GroupConfig): ViewsGroupValue;
10
10
  export declare function groupBodyWrite(group: GroupConfig, next: ViewsGroupValue): (() => void) | null;
11
11
  /** What a `GroupBody` is handed, its chrome (`form`, `onDone`, `actions`) aside: a Customize body's `group` too. */
12
12
  export declare function groupBodyProps(group: GroupConfig, messages: ViewsMessageResolver): Omit<ViewsGroupBodyProps, "form" | "onDone" | "actions">;
13
- /** ViewKit's page as a Customize body's: a page under a section is that section's. */
13
+ /** ViewKit's page as a Customize body's: a page under a section is that section's; an app's own page `page:<key>`. */
14
14
  export declare function customizePageOf(panel: ActivePanel): ViewsCustomizePage;
15
15
  /** A Customize body's page as ViewKit's: its list is no page; Filter is the folded Filter page. */
16
16
  export declare function activePanelOf(page: ViewsCustomizePage): ActivePanel;
17
17
  /** A toggle as a Customize body is handed it. */
18
18
  export declare function customizeToggleOf(toggle: ToggleConfig): ViewsCustomizeToggle;
19
+ /** A list's Layout as a phone reads it (VK-900): the phone's own layout, its options and refusals, and its write, each the
20
+ * computer's where the phone has none of its own, and no toggle marked for the computer alone; null where the Layout is
21
+ * the computer's alone. The computer's layout is never written from a phone, nor the phone's from a computer. */
22
+ export declare function layoutOnPhone<V extends string>(layout: LayoutConfig<V>): LayoutConfig<V> | null;
19
23
  /** The Layout section, gated as ViewKit's own Layout page gates it: the layout's toggles only on the layout they
20
24
  * belong to (`subOptionsFor`), Density where `densityFor` names the layout, each choice on its own `views`. */
21
25
  export declare function customizeLayoutOf(layout: LayoutConfig, messages: ViewsMessageResolver): ViewsCustomizeLayout;