@viewkitjs/views 0.1.0 → 0.3.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 (390) hide show
  1. package/CHANGELOG.md +767 -1
  2. package/README.md +92 -41
  3. package/dist/atoms/LoadMore.js +11 -1
  4. package/dist/atoms/Row.js +1 -1
  5. package/dist/atoms/RowMenu.d.ts +1 -1
  6. package/dist/atoms/RowMenu.js +20 -6
  7. package/dist/atoms/types.d.ts +4 -4
  8. package/dist/cells/cell-format.d.ts +3 -3
  9. package/dist/cells/cell-title.d.ts +1 -2
  10. package/dist/cells/cell-title.js +2 -2
  11. package/dist/cells/cell-values.js +6 -3
  12. package/dist/contract.d.ts +79 -8
  13. package/dist/contract.js +55 -8
  14. package/dist/display/converted.d.ts +19 -0
  15. package/dist/display/converted.js +12 -0
  16. package/dist/display/format.d.ts +16 -1
  17. package/dist/display/format.js +10 -1
  18. package/dist/display/index.d.ts +2 -1
  19. package/dist/display/index.js +2 -1
  20. package/dist/display/link-click.d.ts +11 -0
  21. package/dist/display/link-click.js +3 -0
  22. package/dist/display/link.js +12 -6
  23. package/dist/display/location.d.ts +4 -3
  24. package/dist/display/location.js +12 -5
  25. package/dist/display/multi-value.d.ts +1 -1
  26. package/dist/display/multi-value.js +1 -1
  27. package/dist/display/options.d.ts +8 -2
  28. package/dist/display/percent.js +10 -3
  29. package/dist/display/phone.d.ts +2 -1
  30. package/dist/display/phone.js +11 -2
  31. package/dist/display/relation.js +1 -1
  32. package/dist/editors/ChipsEditor.d.ts +9 -4
  33. package/dist/editors/ChipsEditor.js +7 -3
  34. package/dist/editors/DateEditor.d.ts +21 -6
  35. package/dist/editors/DateEditor.js +118 -30
  36. package/dist/editors/EditorPanel.d.ts +61 -0
  37. package/dist/editors/EditorPanel.js +54 -0
  38. package/dist/editors/LocationEditor.d.ts +3 -0
  39. package/dist/editors/LocationEditor.js +28 -21
  40. package/dist/editors/NameEditor.d.ts +3 -0
  41. package/dist/editors/NameEditor.js +15 -10
  42. package/dist/editors/NumberEditor.d.ts +3 -0
  43. package/dist/editors/NumberEditor.js +7 -7
  44. package/dist/editors/RangeEditor.d.ts +16 -1
  45. package/dist/editors/RangeEditor.js +22 -6
  46. package/dist/editors/RelationEditor.d.ts +13 -28
  47. package/dist/editors/RelationEditor.js +17 -40
  48. package/dist/editors/RelationSetEditor.d.ts +53 -0
  49. package/dist/editors/RelationSetEditor.js +112 -0
  50. package/dist/editors/SelectEditor.d.ts +21 -3
  51. package/dist/editors/SelectEditor.js +55 -9
  52. package/dist/editors/TextEditor.d.ts +51 -0
  53. package/dist/editors/TextEditor.js +81 -0
  54. package/dist/editors/ValueListEditor.d.ts +5 -2
  55. package/dist/editors/ValueListEditor.js +11 -9
  56. package/dist/editors/edit-cores.d.ts +13 -10
  57. package/dist/editors/edit-cores.js +7 -6
  58. package/dist/editors/edit-session.d.ts +21 -11
  59. package/dist/editors/edit-session.js +19 -5
  60. package/dist/editors/keep-inside.d.ts +12 -0
  61. package/dist/editors/keep-inside.js +20 -0
  62. package/dist/editors/open-value.d.ts +21 -0
  63. package/dist/editors/open-value.js +36 -0
  64. package/dist/editors/open-values.d.ts +4 -0
  65. package/dist/editors/open-values.js +7 -0
  66. package/dist/editors/relation-kinds.d.ts +7 -0
  67. package/dist/editors/relation-kinds.js +21 -0
  68. package/dist/editors/relation-panel.d.ts +69 -0
  69. package/dist/editors/relation-panel.js +40 -0
  70. package/dist/field-row/FieldNoteLine.d.ts +14 -0
  71. package/dist/field-row/FieldNoteLine.js +14 -0
  72. package/dist/field-row/FieldRow.d.ts +73 -0
  73. package/dist/field-row/FieldRow.js +157 -0
  74. package/dist/field-row/FieldRowLane.d.ts +19 -0
  75. package/dist/field-row/FieldRowLane.js +11 -0
  76. package/dist/field-row/editors/RowChipsEditor.d.ts +11 -0
  77. package/dist/field-row/editors/RowChipsEditor.js +25 -0
  78. package/dist/field-row/editors/RowDateEditor.d.ts +16 -0
  79. package/dist/field-row/editors/RowDateEditor.js +18 -0
  80. package/dist/field-row/editors/RowEditor.d.ts +39 -0
  81. package/dist/field-row/editors/RowEditor.js +64 -0
  82. package/dist/field-row/editors/RowNameEditor.d.ts +4 -0
  83. package/dist/field-row/editors/RowNameEditor.js +15 -0
  84. package/dist/field-row/editors/RowNumberEditor.d.ts +12 -0
  85. package/dist/field-row/editors/RowNumberEditor.js +18 -0
  86. package/dist/field-row/editors/RowPlaceEditor.d.ts +8 -0
  87. package/dist/field-row/editors/RowPlaceEditor.js +18 -0
  88. package/dist/field-row/editors/RowRangeEditor.d.ts +4 -0
  89. package/dist/field-row/editors/RowRangeEditor.js +15 -0
  90. package/dist/field-row/editors/RowRelationEditor.d.ts +20 -0
  91. package/dist/field-row/editors/RowRelationEditor.js +77 -0
  92. package/dist/field-row/editors/RowSelectEditor.d.ts +13 -0
  93. package/dist/field-row/editors/RowSelectEditor.js +23 -0
  94. package/dist/field-row/editors/RowTextEditor.d.ts +15 -0
  95. package/dist/field-row/editors/RowTextEditor.js +16 -0
  96. package/dist/field-row/editors/RowValueListEditor.d.ts +4 -0
  97. package/dist/field-row/editors/RowValueListEditor.js +21 -0
  98. package/dist/field-row/editors/host.d.ts +59 -0
  99. package/dist/field-row/editors/host.js +1 -0
  100. package/dist/field-row/editors/row-session.d.ts +49 -0
  101. package/dist/field-row/editors/row-session.js +49 -0
  102. package/dist/field-row/index.d.ts +5 -0
  103. package/dist/field-row/index.js +5 -0
  104. package/dist/field-row/row-target.d.ts +20 -0
  105. package/dist/field-row/row-target.js +3 -0
  106. package/dist/field-row/useFieldWrite.d.ts +45 -0
  107. package/dist/field-row/useFieldWrite.js +190 -0
  108. package/dist/field-row/useRowSettlement.d.ts +33 -0
  109. package/dist/field-row/useRowSettlement.js +23 -0
  110. package/dist/fields/binding.d.ts +7 -2
  111. package/dist/fields/binding.js +13 -6
  112. package/dist/fields/currency.d.ts +0 -10
  113. package/dist/fields/currency.js +0 -14
  114. package/dist/fields/edit-core-types.d.ts +9 -9
  115. package/dist/fields/edit-core-types.js +6 -6
  116. package/dist/fields/money.d.ts +6 -0
  117. package/dist/fields/money.js +11 -0
  118. package/dist/fields/number-edit.d.ts +6 -0
  119. package/dist/fields/number-edit.js +4 -0
  120. package/dist/fields/prepare-write.js +6 -1
  121. package/dist/fields/relation-source-types.d.ts +12 -0
  122. package/dist/fields/write-target.d.ts +50 -0
  123. package/dist/fields/write-target.js +10 -0
  124. package/dist/filters/filter-model.d.ts +0 -1
  125. package/dist/filters/registry.d.ts +3 -36
  126. package/dist/filters/registry.js +0 -38
  127. package/dist/grid/chrome/GridAddColumn.d.ts +11 -0
  128. package/dist/grid/chrome/GridAddColumn.js +29 -0
  129. package/dist/grid/chrome/GridAggregateMenu.d.ts +31 -0
  130. package/dist/grid/chrome/GridAggregateMenu.js +29 -0
  131. package/dist/grid/chrome/GridCellEditors.d.ts +71 -0
  132. package/dist/grid/chrome/GridCellEditors.js +126 -0
  133. package/dist/grid/chrome/GridCellOutline.d.ts +49 -0
  134. package/dist/grid/chrome/GridCellOutline.js +16 -0
  135. package/dist/grid/chrome/GridChipsEditor.d.ts +38 -0
  136. package/dist/grid/chrome/GridChipsEditor.js +35 -0
  137. package/dist/grid/chrome/GridColumnColorSection.d.ts +11 -0
  138. package/dist/grid/chrome/GridColumnColorSection.js +40 -0
  139. package/dist/grid/chrome/GridColumnDateSection.d.ts +23 -0
  140. package/dist/grid/chrome/GridColumnDateSection.js +23 -0
  141. package/dist/grid/chrome/GridColumnDurationSection.d.ts +19 -0
  142. package/dist/grid/chrome/GridColumnDurationSection.js +24 -0
  143. package/dist/grid/chrome/GridColumnMenu.d.ts +101 -0
  144. package/dist/grid/chrome/GridColumnMenu.js +103 -0
  145. package/dist/grid/chrome/GridColumnNumberSection.d.ts +25 -0
  146. package/dist/grid/chrome/GridColumnNumberSection.js +27 -0
  147. package/dist/grid/chrome/GridColumnPercentSection.d.ts +15 -0
  148. package/dist/grid/chrome/GridColumnPercentSection.js +16 -0
  149. package/dist/grid/chrome/GridColumnSortSection.d.ts +18 -0
  150. package/dist/grid/chrome/GridColumnSortSection.js +16 -0
  151. package/dist/grid/chrome/GridDateEditor.d.ts +34 -0
  152. package/dist/grid/chrome/GridDateEditor.js +19 -0
  153. package/dist/grid/chrome/GridFlyout.d.ts +44 -0
  154. package/dist/grid/chrome/GridFlyout.js +80 -0
  155. package/dist/grid/chrome/GridFooter.d.ts +33 -0
  156. package/dist/grid/chrome/GridFooter.js +85 -0
  157. package/dist/grid/chrome/GridGroupMenu.d.ts +37 -0
  158. package/dist/grid/chrome/GridGroupMenu.js +64 -0
  159. package/dist/grid/chrome/GridHeader.d.ts +66 -0
  160. package/dist/grid/chrome/GridHeader.js +42 -0
  161. package/dist/grid/chrome/GridLongTextEditor.d.ts +55 -0
  162. package/dist/grid/chrome/GridLongTextEditor.js +69 -0
  163. package/dist/grid/chrome/GridMenuRow.d.ts +15 -0
  164. package/dist/grid/chrome/GridMenuRow.js +15 -0
  165. package/dist/grid/chrome/GridNameEditor.d.ts +24 -0
  166. package/dist/grid/chrome/GridNameEditor.js +21 -0
  167. package/dist/grid/chrome/GridNumberEditor.d.ts +49 -0
  168. package/dist/grid/chrome/GridNumberEditor.js +51 -0
  169. package/dist/grid/chrome/GridPlaceEditor.d.ts +26 -0
  170. package/dist/grid/chrome/GridPlaceEditor.js +22 -0
  171. package/dist/grid/chrome/GridRangeEditor.d.ts +30 -0
  172. package/dist/grid/chrome/GridRangeEditor.js +21 -0
  173. package/dist/grid/chrome/GridRelationEditor.d.ts +45 -0
  174. package/dist/grid/chrome/GridRelationEditor.js +92 -0
  175. package/dist/grid/chrome/GridResizeHandle.d.ts +19 -0
  176. package/dist/grid/chrome/GridResizeHandle.js +19 -0
  177. package/dist/grid/chrome/GridRow.d.ts +31 -0
  178. package/dist/grid/chrome/GridRow.js +179 -0
  179. package/dist/grid/chrome/GridRowActions.d.ts +32 -0
  180. package/dist/grid/chrome/GridRowActions.js +25 -0
  181. package/dist/grid/chrome/GridRowCells.d.ts +4 -0
  182. package/dist/grid/chrome/GridRowCells.js +128 -0
  183. package/dist/grid/chrome/GridRowGlyph.d.ts +12 -0
  184. package/dist/grid/chrome/GridRowGlyph.js +13 -0
  185. package/dist/grid/chrome/GridSelectEditor.d.ts +33 -0
  186. package/dist/grid/chrome/GridSelectEditor.js +43 -0
  187. package/dist/grid/chrome/GridStructure.d.ts +47 -0
  188. package/dist/grid/chrome/GridStructure.js +41 -0
  189. package/dist/grid/chrome/GridTable.d.ts +4 -0
  190. package/dist/grid/chrome/GridTable.js +192 -0
  191. package/dist/grid/chrome/GridTableSurface.d.ts +52 -0
  192. package/dist/grid/chrome/GridTableSurface.js +15 -0
  193. package/dist/grid/chrome/GridTextEditor.d.ts +45 -0
  194. package/dist/grid/chrome/GridTextEditor.js +38 -0
  195. package/dist/grid/chrome/GridValueListEditor.d.ts +30 -0
  196. package/dist/grid/chrome/GridValueListEditor.js +19 -0
  197. package/dist/grid/chrome/StuckMarker.d.ts +16 -0
  198. package/dist/grid/chrome/StuckMarker.js +34 -0
  199. package/dist/grid/chrome/cell-clipboard.d.ts +9 -0
  200. package/dist/grid/chrome/cell-clipboard.js +28 -0
  201. package/dist/grid/chrome/cell-cut-off.d.ts +11 -0
  202. package/dist/grid/chrome/cell-cut-off.js +20 -0
  203. package/dist/grid/chrome/cells.d.ts +21 -0
  204. package/dist/grid/chrome/cells.js +19 -0
  205. package/dist/grid/chrome/checks.d.ts +32 -0
  206. package/dist/grid/chrome/checks.js +32 -0
  207. package/dist/grid/chrome/column-glyph.d.ts +14 -0
  208. package/dist/grid/chrome/column-glyph.js +44 -0
  209. package/dist/grid/chrome/editors.d.ts +9 -0
  210. package/dist/grid/chrome/editors.js +10 -0
  211. package/dist/grid/chrome/grid-cell-classes.d.ts +53 -0
  212. package/dist/grid/chrome/grid-cell-classes.js +32 -0
  213. package/dist/grid/chrome/grid-cell-link.d.ts +13 -0
  214. package/dist/grid/chrome/grid-cell-link.js +9 -0
  215. package/dist/grid/chrome/grid-edit-session.d.ts +63 -0
  216. package/dist/grid/chrome/grid-edit-session.js +118 -0
  217. package/dist/grid/chrome/grid-hover.d.ts +60 -0
  218. package/dist/grid/chrome/grid-hover.js +81 -0
  219. package/dist/grid/chrome/grid-menu-focus.d.ts +43 -0
  220. package/dist/grid/chrome/grid-menu-focus.js +93 -0
  221. package/dist/grid/chrome/grid-menu-search.d.ts +7 -0
  222. package/dist/grid/chrome/grid-menu-search.js +7 -0
  223. package/dist/grid/chrome/grid-row-menu-key.d.ts +15 -0
  224. package/dist/grid/chrome/grid-row-menu-key.js +36 -0
  225. package/dist/grid/chrome/grid-row-props.d.ts +143 -0
  226. package/dist/grid/chrome/grid-row-props.js +1 -0
  227. package/dist/grid/chrome/grid-row-window.d.ts +61 -0
  228. package/dist/grid/chrome/grid-row-window.js +212 -0
  229. package/dist/grid/chrome/grid-scroll-owner.d.ts +38 -0
  230. package/dist/grid/chrome/grid-scroll-owner.js +75 -0
  231. package/dist/grid/chrome/grid-styles.d.ts +40 -0
  232. package/dist/grid/chrome/grid-styles.js +9 -0
  233. package/dist/grid/chrome/grid-table-props.d.ts +172 -0
  234. package/dist/grid/chrome/grid-table-props.js +1 -0
  235. package/dist/grid/chrome/useGridBatchApi.d.ts +34 -0
  236. package/dist/grid/chrome/useGridBatchApi.js +35 -0
  237. package/dist/grid/chrome/useGridColumnLayout.d.ts +30 -0
  238. package/dist/grid/chrome/useGridColumnLayout.js +206 -0
  239. package/dist/grid/chrome/useGridFocus.d.ts +45 -0
  240. package/dist/grid/chrome/useGridFocus.js +122 -0
  241. package/dist/grid/chrome/useGridHeaderDrag.d.ts +20 -0
  242. package/dist/grid/chrome/useGridHeaderDrag.js +37 -0
  243. package/dist/grid/chrome/useGridKeyboard.d.ts +64 -0
  244. package/dist/grid/chrome/useGridKeyboard.js +450 -0
  245. package/dist/grid/chrome/useGridPendingReconciliation.d.ts +12 -0
  246. package/dist/grid/chrome/useGridPendingReconciliation.js +32 -0
  247. package/dist/grid/chrome/useGridRailReveal.d.ts +57 -0
  248. package/dist/grid/chrome/useGridRailReveal.js +67 -0
  249. package/dist/grid/chrome/useGridRangeActions.d.ts +51 -0
  250. package/dist/grid/chrome/useGridRangeActions.js +195 -0
  251. package/dist/grid/chrome/useGridRangeGestures.d.ts +32 -0
  252. package/dist/grid/chrome/useGridRangeGestures.js +237 -0
  253. package/dist/grid/chrome/useGridRowContextMenu.d.ts +37 -0
  254. package/dist/grid/chrome/useGridRowContextMenu.js +153 -0
  255. package/dist/grid/chrome/useGridScaleStyles.d.ts +3 -0
  256. package/dist/grid/chrome/useGridScaleStyles.js +28 -0
  257. package/dist/grid/chrome/useGridScrollArea.d.ts +21 -0
  258. package/dist/grid/chrome/useGridScrollArea.js +65 -0
  259. package/dist/grid/chrome/useGridTableInteractionModel.d.ts +78 -0
  260. package/dist/grid/chrome/useGridTableInteractionModel.js +249 -0
  261. package/dist/grid/chrome/useGridTableSelection.d.ts +29 -0
  262. package/dist/grid/chrome/useGridTableSelection.js +55 -0
  263. package/dist/grid/chrome/useHeaderDragReorder.d.ts +21 -0
  264. package/dist/grid/chrome/useHeaderDragReorder.js +216 -0
  265. package/dist/grid/core/clipboard-model.d.ts +83 -0
  266. package/dist/grid/core/clipboard-model.js +291 -0
  267. package/dist/grid/core/column-values.d.ts +27 -0
  268. package/dist/grid/core/column-values.js +76 -0
  269. package/dist/grid/core/commit-model.d.ts +41 -0
  270. package/dist/grid/core/commit-model.js +3 -0
  271. package/dist/grid/core/coordinates.d.ts +48 -0
  272. package/dist/grid/core/coordinates.js +27 -0
  273. package/dist/grid/core/edge-scroll.d.ts +21 -0
  274. package/dist/grid/core/edge-scroll.js +23 -0
  275. package/dist/grid/core/edit-values.d.ts +9 -0
  276. package/dist/grid/core/edit-values.js +1 -0
  277. package/dist/grid/core/editing-controller.d.ts +60 -0
  278. package/dist/grid/core/editing-controller.js +266 -0
  279. package/dist/grid/core/editing-model.d.ts +87 -0
  280. package/dist/grid/core/editing-model.js +148 -0
  281. package/dist/grid/core/flat-rows.d.ts +35 -0
  282. package/dist/grid/core/flat-rows.js +20 -0
  283. package/dist/grid/core/grid-aria.d.ts +27 -0
  284. package/dist/grid/core/grid-aria.js +39 -0
  285. package/dist/grid/core/grid-focus.d.ts +54 -0
  286. package/dist/grid/core/grid-focus.js +148 -0
  287. package/dist/grid/core/grid-scale.d.ts +14 -0
  288. package/dist/grid/core/grid-scale.js +8 -0
  289. package/dist/grid/core/nav.d.ts +94 -0
  290. package/dist/grid/core/nav.js +92 -0
  291. package/dist/grid/core/pending-reconciliation.d.ts +53 -0
  292. package/dist/grid/core/pending-reconciliation.js +51 -0
  293. package/dist/grid/core/range-model.d.ts +25 -0
  294. package/dist/grid/core/range-model.js +59 -0
  295. package/dist/grid/core/row-window.d.ts +40 -0
  296. package/dist/grid/core/row-window.js +43 -0
  297. package/dist/grid/core/spreadsheet-operations.d.ts +101 -0
  298. package/dist/grid/core/spreadsheet-operations.js +280 -0
  299. package/dist/grid/core/useGridEditing.d.ts +46 -0
  300. package/dist/grid/core/useGridEditing.js +93 -0
  301. package/dist/grid/core/useGridRange.d.ts +20 -0
  302. package/dist/grid/core/useGridRange.js +24 -0
  303. package/dist/grid/core/value-equality.d.ts +54 -0
  304. package/dist/grid/core/value-equality.js +80 -0
  305. package/dist/grid/index.d.ts +18 -0
  306. package/dist/grid/index.js +5 -0
  307. package/dist/grid/useGridTablePrefs.d.ts +49 -0
  308. package/dist/grid/useGridTablePrefs.js +99 -0
  309. package/dist/index.d.ts +1 -1
  310. package/dist/index.js +1 -1
  311. package/dist/internal/viewport.d.ts +3 -0
  312. package/dist/internal/viewport.js +15 -0
  313. package/dist/model/column-capabilities.d.ts +3 -2
  314. package/dist/model/column-capabilities.js +28 -8
  315. package/dist/model/column-from.js +3 -0
  316. package/dist/model/column-inspect.d.ts +10 -2
  317. package/dist/model/column-inspect.js +9 -0
  318. package/dist/model/column-schema.d.ts +6 -1
  319. package/dist/model/column-state.d.ts +1 -1
  320. package/dist/model/column-types.d.ts +3 -1
  321. package/dist/model/column-types.js +1 -1
  322. package/dist/model/density.js +3 -3
  323. package/dist/model/filter-capabilities.d.ts +1 -1
  324. package/dist/model/filter-capabilities.js +1 -1
  325. package/dist/model/index.d.ts +4 -6
  326. package/dist/model/index.js +0 -1
  327. package/dist/model/preferences.d.ts +7 -7
  328. package/dist/model/preferences.js +0 -1
  329. package/dist/model/prefs-buckets.d.ts +0 -1
  330. package/dist/model/prefs-buckets.js +0 -3
  331. package/dist/model/render-count.d.ts +6 -0
  332. package/dist/model/render-count.js +11 -0
  333. package/dist/provider/ViewsProvider.d.ts +6 -2
  334. package/dist/provider/ViewsProvider.js +12 -2
  335. package/dist/provider/components.d.ts +35 -9
  336. package/dist/provider/components.js +4 -2
  337. package/dist/provider/context.d.ts +8 -4
  338. package/dist/provider/desktop.d.ts +9 -0
  339. package/dist/provider/desktop.js +22 -0
  340. package/dist/provider/menu-groups.d.ts +8 -0
  341. package/dist/provider/menu-groups.js +38 -0
  342. package/dist/provider/plain-input.d.ts +8 -0
  343. package/dist/provider/plain-input.js +5 -0
  344. package/dist/provider/ports.d.ts +22 -0
  345. package/dist/provider/ports.js +1 -0
  346. package/dist/react.d.ts +3 -2
  347. package/dist/react.js +1 -0
  348. package/dist/selection/SelectCheckbox.d.ts +3 -1
  349. package/dist/selection/SelectCheckbox.js +2 -2
  350. package/dist/selection/useCheckDragSelect.js +6 -5
  351. package/docs/contract.md +202 -72
  352. package/docs/getting-started.md +250 -0
  353. package/docs/guides/atoms.md +245 -0
  354. package/docs/guides/cells.md +302 -0
  355. package/docs/guides/columns.md +413 -0
  356. package/docs/guides/display.md +204 -0
  357. package/docs/guides/editors.md +462 -0
  358. package/docs/guides/ports.md +246 -0
  359. package/docs/guides/selection.md +270 -0
  360. package/docs/guides/the-grid.md +696 -0
  361. package/docs/guides/the-provider.md +448 -0
  362. package/docs/index.md +52 -0
  363. package/docs/install.md +9 -47
  364. package/docs/reference/cells.md +28 -0
  365. package/docs/reference/display.md +44 -0
  366. package/docs/reference/editors-chips.md +6 -0
  367. package/docs/reference/editors-date.md +6 -0
  368. package/docs/reference/editors-location.md +10 -0
  369. package/docs/reference/editors-name.md +6 -0
  370. package/docs/reference/editors-number.md +11 -0
  371. package/docs/reference/editors-open-values.md +10 -0
  372. package/docs/reference/editors-panel.md +12 -0
  373. package/docs/reference/editors-range.md +6 -0
  374. package/docs/reference/editors-relation.md +12 -0
  375. package/docs/reference/editors-select.md +9 -0
  376. package/docs/reference/editors-session.md +11 -0
  377. package/docs/reference/editors-text.md +9 -0
  378. package/docs/reference/editors-value-list.md +6 -0
  379. package/docs/reference/editors.md +5 -0
  380. package/docs/reference/field-row.md +16 -0
  381. package/docs/reference/grid.md +39 -0
  382. package/docs/reference/react.md +89 -0
  383. package/docs/reference/selection.md +33 -0
  384. package/docs/reference/views.md +622 -0
  385. package/package.json +27 -4
  386. package/skills/views/SKILL.md +20 -5
  387. package/dist/filters/types.d.ts +0 -27
  388. package/dist/filters/types.js +0 -1
  389. package/dist/model/filter-pushdown.d.ts +0 -106
  390. package/dist/model/filter-pushdown.js +0 -147
@@ -0,0 +1,99 @@
1
+ "use client";
2
+ import { useCallback, useMemo } from "react";
3
+ import { fieldKeyOf } from "../model/view-rules.js";
4
+ import { GRID_SCALE_MULTIPLIER } from "./core/grid-scale.js";
5
+ import { normalizeGroupSummary, setAggregate, setDateStyle, setCurrency, setDecimals, setDurationStyle, setOptionColor, setPercentDisplay, setShowTime, } from "../model/preferences.js";
6
+ import { moneyReadingOf } from "../fields/money.js";
7
+ import { isMoneyReading, MONEY_READING_OPTIONS } from "../fields/currency.js";
8
+ export function useGridTablePrefs({ prefs, setPrefs, columns, viewBacked = false, }) {
9
+ const { gridVerticalBorders, gridRowIcon, gridFreezeIdentity, gridAlwaysCheckboxes, gridOptionColors, gridDateStyles, gridDurationStyles, gridShowTime, gridPercentDisplays, gridDecimals, gridCurrencies, gridAggregates, gridColumns, gridScale, groupSummary, } = prefs;
10
+ const onOptionColorChange = useCallback((key, value, color) => {
11
+ setPrefs({ gridOptionColors: setOptionColor(gridOptionColors, key, value, color) });
12
+ }, [gridOptionColors, setPrefs]);
13
+ const onDateStyleChange = useCallback((key, style) => setPrefs({ gridDateStyles: setDateStyle(gridDateStyles, key, style) }), [gridDateStyles, setPrefs]);
14
+ const onDurationStyleChange = useCallback((key, style) => setPrefs({ gridDurationStyles: setDurationStyle(gridDurationStyles, key, style) }), [gridDurationStyles, setPrefs]);
15
+ const onShowTimeChange = useCallback((key, show) => setPrefs({ gridShowTime: setShowTime(gridShowTime, key, show) }), [gridShowTime, setPrefs]);
16
+ const onPercentDisplayChange = useCallback((key, display) => setPrefs({ gridPercentDisplays: setPercentDisplay(gridPercentDisplays, key, display) }), [gridPercentDisplays, setPrefs]);
17
+ const onColumnStateChange = useCallback((next) => setPrefs({ gridColumns: next }), [setPrefs]);
18
+ const summaryParts = useMemo(() => normalizeGroupSummary(groupSummary), [groupSummary]);
19
+ const onGroupSummaryChange = useCallback((part, next) => setPrefs({
20
+ groupSummary: next
21
+ ? Array.from(new Set([...normalizeGroupSummary(groupSummary), part]))
22
+ : normalizeGroupSummary(groupSummary).filter((p) => p !== part),
23
+ }), [groupSummary, setPrefs]);
24
+ const onAggregateChange = useCallback((columnId, kind) => setPrefs({ gridAggregates: setAggregate(gridAggregates, columnId, kind) }), [gridAggregates, setPrefs]);
25
+ const numberFormats = useMemo(() => {
26
+ const out = {};
27
+ for (const col of columns) {
28
+ const key = fieldKeyOf(col);
29
+ const reading = moneyReadingOf(col);
30
+ if (gridDecimals[key] === undefined && !reading)
31
+ continue;
32
+ out[key] = {
33
+ decimals: gridDecimals[key],
34
+ ...(reading ? { currency: reading, currencyOptions: MONEY_READING_OPTIONS } : {}),
35
+ };
36
+ }
37
+ return out;
38
+ }, [columns, gridDecimals]);
39
+ const onNumberFormatChange = useCallback((key, patch) => {
40
+ if (patch.currency != null && isMoneyReading(patch.currency))
41
+ setPrefs({ gridCurrencies: setCurrency(gridCurrencies, key, patch.currency) });
42
+ if (patch.decimals === null)
43
+ setPrefs({ gridDecimals: { [key]: null } });
44
+ else if (patch.decimals !== undefined)
45
+ setPrefs({ gridDecimals: setDecimals(gridDecimals, key, patch.decimals) });
46
+ }, [gridCurrencies, gridDecimals, setPrefs]);
47
+ const gridProps = useMemo(() => ({
48
+ verticalBorders: gridVerticalBorders,
49
+ showRowIcon: gridRowIcon,
50
+ freezeIdentity: gridFreezeIdentity,
51
+ alwaysCheckboxes: gridAlwaysCheckboxes,
52
+ scale: GRID_SCALE_MULTIPLIER[gridScale],
53
+ optionColors: gridOptionColors,
54
+ onOptionColorChange,
55
+ dateStyles: gridDateStyles,
56
+ onDateStyleChange,
57
+ durationStyles: gridDurationStyles,
58
+ onDurationStyleChange,
59
+ showTimeOverrides: gridShowTime,
60
+ onShowTimeChange,
61
+ percentDisplays: gridPercentDisplays,
62
+ onPercentDisplayChange,
63
+ columnState: gridColumns,
64
+ onColumnStateChange,
65
+ groupSummary: summaryParts,
66
+ onGroupSummaryChange,
67
+ aggregates: gridAggregates,
68
+ onAggregateChange,
69
+ viewBacked,
70
+ numberFormats,
71
+ onNumberFormatChange,
72
+ }), [
73
+ gridVerticalBorders,
74
+ gridRowIcon,
75
+ gridFreezeIdentity,
76
+ gridAlwaysCheckboxes,
77
+ gridScale,
78
+ gridOptionColors,
79
+ onOptionColorChange,
80
+ gridDateStyles,
81
+ onDateStyleChange,
82
+ gridDurationStyles,
83
+ onDurationStyleChange,
84
+ gridShowTime,
85
+ onShowTimeChange,
86
+ gridPercentDisplays,
87
+ onPercentDisplayChange,
88
+ gridColumns,
89
+ onColumnStateChange,
90
+ summaryParts,
91
+ onGroupSummaryChange,
92
+ gridAggregates,
93
+ onAggregateChange,
94
+ viewBacked,
95
+ numberFormats,
96
+ onNumberFormatChange,
97
+ ]);
98
+ return { gridProps };
99
+ }
package/dist/index.d.ts CHANGED
@@ -6,7 +6,6 @@ export * from "./model/column-format.js";
6
6
  export * from "./model/column-inspect.js";
7
7
  export * from "./model/column-money.js";
8
8
  export * from "./filters/registry.js";
9
- export * from "./filters/types.js";
10
9
  export * from "./filters/text-filter.js";
11
10
  export * from "./filters/number-filter.js";
12
11
  export * from "./filters/range-filter.js";
@@ -22,6 +21,7 @@ export * from "./fields/money.js";
22
21
  export * from "./fields/currency.js";
23
22
  export * from "./fields/denomination.js";
24
23
  export * from "./fields/prepare-write.js";
24
+ export * from "./fields/write-target.js";
25
25
  export * from "./fields/edit-core-types.js";
26
26
  export * from "./fields/number-edit.js";
27
27
  export * from "./fields/format-knobs.js";
package/dist/index.js CHANGED
@@ -6,7 +6,6 @@ export * from "./model/column-format.js";
6
6
  export * from "./model/column-inspect.js";
7
7
  export * from "./model/column-money.js";
8
8
  export * from "./filters/registry.js";
9
- export * from "./filters/types.js";
10
9
  export * from "./filters/text-filter.js";
11
10
  export * from "./filters/number-filter.js";
12
11
  export * from "./filters/range-filter.js";
@@ -22,6 +21,7 @@ export * from "./fields/money.js";
22
21
  export * from "./fields/currency.js";
23
22
  export * from "./fields/denomination.js";
24
23
  export * from "./fields/prepare-write.js";
24
+ export * from "./fields/write-target.js";
25
25
  export * from "./fields/edit-core-types.js";
26
26
  export * from "./fields/number-edit.js";
27
27
  export * from "./fields/format-knobs.js";
@@ -0,0 +1,3 @@
1
+ /** True when the primary input can hover (a mouse, a trackpad); true during a server render, so
2
+ * the hover-capable rendering is what the server sends. */
3
+ export declare function useHasHover(): boolean;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ export function useHasHover() {
4
+ const [hasHover, setHasHover] = useState(true);
5
+ useEffect(() => {
6
+ if (typeof window === "undefined" || !window.matchMedia)
7
+ return;
8
+ const mq = window.matchMedia("(hover: hover) and (pointer: fine)");
9
+ setHasHover(mq.matches);
10
+ const handler = (e) => setHasHover(e.matches);
11
+ mq.addEventListener("change", handler);
12
+ return () => mq.removeEventListener("change", handler);
13
+ }, []);
14
+ return hasHover;
15
+ }
@@ -153,8 +153,9 @@ export type GridWriteResult = {
153
153
  export declare function gridNormalizeWrite<Row>(col: ListColumn<Row>, next: unknown, conventions: FieldConventions,
154
154
  /** `region`: the record's country, where a phone typed without its country code is read. A host whose rows carry
155
155
  * a country passes the row's here; absent, the conventions' region reads it. `messages`: the app's words for a
156
- * refusal, the package's English when absent. `stored`: the cell's value before this edit, as stored; a phone
157
- * that comes back as it is here is kept, never read again (fields' `stored`). */
156
+ * refusal, the package's English when absent. `stored`: the cell's value before this edit, as stored; a value
157
+ * fields keeps by `stored` (a phone, a url) that comes back as it is here is kept, never read again, and a value
158
+ * a closed multiselect already holds passes though no option names it. */
158
159
  options?: {
159
160
  region?: string | null;
160
161
  messages?: ViewsMessageResolver;
@@ -1,4 +1,4 @@
1
- import { acceptFieldCommit, isMultipleType, lockReason, valueTypeOf } from "@viewkitjs/fields";
1
+ import { acceptFieldCommit, isMultipleType, lockReason, relationIdOf, valueTypeOf, } from "@viewkitjs/fields";
2
2
  import { resolveViewsMessage } from "../contract.js";
3
3
  import { prettifyOptionValue, resolveColumnOrder } from "./column-state.js";
4
4
  import { typeRule } from "./column-types.js";
@@ -10,6 +10,8 @@ export function gridEditorKind(col) {
10
10
  return col.field && col.type && isMultipleType(col.type) ? "values" : null;
11
11
  if (col.type === "title" && col.field && valueTypeOf(col.field) === "name")
12
12
  return "name";
13
+ if (col.type === "location")
14
+ return col.field && valueTypeOf(col.field) === "location" ? "place" : null;
13
15
  return typeRule(col.type)?.editor ?? null;
14
16
  }
15
17
  export function gridColumnHasEditor(col) {
@@ -112,7 +114,9 @@ export function columnClearRefusal(col, messages = resolveViewsMessage) {
112
114
  export function columnEditRefusal(col, conventions, messages = resolveViewsMessage) {
113
115
  return (col.reasons?.editable ??
114
116
  (col.field ? lockReason(col.field, conventions) : undefined) ??
115
- (col.custom ? messages({ key: "views.grid.computed", values: { from: col.custom.from } }) : undefined));
117
+ (col.custom
118
+ ? messages({ key: "views.grid.computed", values: { from: col.custom.from } })
119
+ : undefined));
116
120
  }
117
121
  export function gridEditRefusal(col, config, conventions, messages = resolveViewsMessage) {
118
122
  if (gridColumnLocked(col, config))
@@ -186,15 +190,31 @@ function coerceWrite(col, next, messages) {
186
190
  return { ok: true, value: trimmed };
187
191
  }
188
192
  case "relation": {
193
+ const many = col.field?.type === "relation" && col.field.cardinality === "many";
189
194
  if (isCleared(next))
190
- return { ok: true, value: null };
191
- if (typeof next !== "string")
192
- return { ok: false, reason: messages({ key: "views.grid.write-not-link" }) };
195
+ return { ok: true, value: many ? [] : null };
193
196
  const known = col.relation?.options;
194
- if (known && !known.some((option) => option.id === next)) {
195
- return { ok: false, reason: messages({ key: "views.grid.write-not-linkable" }) };
197
+ const judge = (item) => {
198
+ const id = typeof item === "string" || col.field ? relationIdOf(item) : null;
199
+ if (id === null)
200
+ return messages({ key: "views.grid.write-not-link" });
201
+ if (known && !known.some((option) => option.id === id)) {
202
+ return messages({ key: "views.grid.write-not-linkable" });
203
+ }
204
+ return null;
205
+ };
206
+ if (many) {
207
+ if (!Array.isArray(next))
208
+ return { ok: false, reason: messages({ key: "views.grid.write-not-link" }) };
209
+ for (const item of next) {
210
+ const reason = judge(item);
211
+ if (reason)
212
+ return { ok: false, reason };
213
+ }
214
+ return { ok: true, value: next };
196
215
  }
197
- return { ok: true, value: next };
216
+ const reason = judge(next);
217
+ return reason ? { ok: false, reason } : { ok: true, value: next };
198
218
  }
199
219
  case "list": {
200
220
  if (isCleared(next))
@@ -146,12 +146,15 @@ export function columnFrom(binding, presentation) {
146
146
  entity: shown.type === "user" ? "user" : relationKinds(shown)[0],
147
147
  ...(source ? { source } : {}),
148
148
  ...(source?.kind === "static" ? { options: source.items } : {}),
149
+ ...(binding.create ? { create: binding.create } : {}),
149
150
  };
150
151
  }
151
152
  if (isMultipleType(shown.type) && "multiple" in shown && shown.multiple)
152
153
  column.multiple = true;
153
154
  if (binding.labels === false)
154
155
  column.labels = false;
156
+ if (binding.region)
157
+ column.region = binding.region;
155
158
  if (shown.type === "multiselect")
156
159
  column.chips = { normalize: normalizerFor(shown) };
157
160
  if (column.money)
@@ -7,8 +7,9 @@ import type { ListColumn } from "./column-schema.js";
7
7
  * editor, can it be written, in what shape). This file answers the one read
8
8
  * question the mount gestures (click-on-focused, double-click, Enter) ask
9
9
  * beside them: a long text you cannot edit is still worth reading in full, and
10
- * the anchored panel is the one reading surface the grid has. Today only long
11
- * text qualifies.
10
+ * the anchored panel is the one reading surface the grid has. A long text
11
+ * always qualifies; a plain text or a text name qualifies when its cell cuts
12
+ * it off, which only the cell can measure at the gesture.
12
13
  */
13
14
  /** A text column whose value is a paragraph, not a phrase — the field said so
14
15
  * with `format.long`. It edits (and reads) in the anchored long-text panel
@@ -16,3 +17,10 @@ import type { ListColumn } from "./column-schema.js";
16
17
  export declare function isLongTextColumn<Row>(col: ListColumn<Row>): boolean;
17
18
  /** Whether a cell opens a PANEL to be READ, whatever its write state. */
18
19
  export declare function gridColumnInspectable<Row>(col: ListColumn<Row>): boolean;
20
+ /** A text that opens WHOLE in the panel when the cell cuts it off: plain text, and a name that is
21
+ * text (not a person's name, which edits in its own boxes). Links, emails, phones and domains keep
22
+ * their one-line box. Whether it IS cut off is the cell's to measure (`gridCellCutOff`). */
23
+ export declare function isWholeTextColumn<Row>(col: ListColumn<Row>): boolean;
24
+ /** Whether an open text cell is drawn in the panel over the cell rather than in the cell: a
25
+ * paragraph always, a line when it opened `whole` (cut off when it was opened). */
26
+ export declare function gridTextOpensBox<Row>(col: ListColumn<Row>, whole: boolean): boolean;
@@ -1,6 +1,15 @@
1
+ import { valueTypeOf } from "@viewkitjs/fields";
1
2
  export function isLongTextColumn(col) {
2
3
  return (col.type === "text" && !!col.format?.long) || col.type === "rich_text";
3
4
  }
4
5
  export function gridColumnInspectable(col) {
5
6
  return isLongTextColumn(col);
6
7
  }
8
+ export function isWholeTextColumn(col) {
9
+ if (col.type === "text")
10
+ return !col.format?.long;
11
+ return col.type === "title" && !(col.field && valueTypeOf(col.field) === "name");
12
+ }
13
+ export function gridTextOpensBox(col, whole) {
14
+ return isLongTextColumn(col) || (whole && isWholeTextColumn(col));
15
+ }
@@ -1,7 +1,7 @@
1
1
  import type { MouseEvent as ReactMouseEvent, ReactNode } from "react";
2
2
  import type { FieldBinding } from "../fields/binding.js";
3
3
  import type { MoneyDeclaration } from "../fields/money.js";
4
- import type { RelationSource } from "../fields/relation-source-types.js";
4
+ import type { RelationCellCreate, RelationSource } from "../fields/relation-source-types.js";
5
5
  import type { MoneyReading } from "../fields/currency.js";
6
6
  import type { CategoryColor } from "@viewkitjs/fields/design/category-colors";
7
7
  import type { StageMark } from "@viewkitjs/fields/design/stage-marks";
@@ -159,6 +159,9 @@ export type ListColumn<Row> = {
159
159
  value: (row: Row) => string;
160
160
  options?: string[];
161
161
  };
162
+ /** The record's country, where a phone typed without its country code is read: the grid's editors and every
163
+ * write gate read it off the row. Absent, the conventions' region reads it. A binding's `region` carries here. */
164
+ region?: (row: Row) => string | null | undefined;
162
165
  type?: ListColumnType;
163
166
  /**
164
167
  * `relation` columns only — the candidates the picker offers, and the default
@@ -174,6 +177,8 @@ export type ListColumn<Row> = {
174
177
  options?: ListRelationValue[];
175
178
  /** Kind for values that don't carry their own — the monomorphic case. */
176
179
  entity?: string;
180
+ /** The app's create row, offered under the candidates (`FieldBinding.create`). */
181
+ create?: RelationCellCreate;
177
182
  };
178
183
  /**
179
184
  * This cell holds SEVERAL values, not one (an array). Declared rather than
@@ -36,7 +36,7 @@ export declare const LIST_DEFAULT_MIN_WIDTH = 60;
36
36
  /**
37
37
  * The density vocabulary, shared by every view. How a view SPENDS it differs —
38
38
  * the grid multiplies its pixel scale, the rows views widen their padding — so
39
- * only the names live here; see `grid-table/core/grid-scale.ts`.
39
+ * only the names live here; see `grid/core/grid-scale.ts`.
40
40
  */
41
41
  export type ListDensity = "compact" | "default" | "spacious";
42
42
  /**
@@ -29,7 +29,9 @@ import type { ListColumn, ListColumnType, ListRelationValue } from "./column-sch
29
29
  /** Which editor a writable column mounts when clicked, Entered or typed into. */
30
30
  export type GridEditorId = "text" | "select" | "number" | "date" | "relation" | "chips" | "range" | "name"
31
31
  /** Several values of one kind (`multiple` email, phone, url or domain), each with its label and a main one. */
32
- | "values";
32
+ | "values"
33
+ /** A place: the country first, then that country's own parts (`LocationEditor`). */
34
+ | "place";
33
35
  /** Which editor this type opens in the Filter drill-in. `none` lists the
34
36
  * column and opens nothing — a structured value with no rule to write. */
35
37
  export type ListFilterEditor = "options" | "text" | "number" | "date" | "boolean" | "range" | "none";
@@ -14,7 +14,7 @@ export const GRID_TYPE_RULES = {
14
14
  relation: { editor: "relation", filter: "options", paste: "relation", value: "relation" },
15
15
  user: { editor: "relation", filter: "options", paste: "relation", value: "relation" },
16
16
  phone: { editor: "text", filter: "text", paste: "text", value: "any" },
17
- location: { editor: null, filter: "none", paste: "none", value: "any" },
17
+ location: { editor: "place", filter: "none", paste: "none", value: "any" },
18
18
  name: { editor: "name", filter: "text", paste: "text", value: "any" },
19
19
  actor: { editor: null, filter: "options", paste: "none", value: "any" },
20
20
  rich_text: { editor: "text", filter: "text", paste: "text", value: "any" },
@@ -6,8 +6,8 @@ const DENSITY = {
6
6
  export function densityStyle(density) {
7
7
  const spec = DENSITY[density] ?? DENSITY.default;
8
8
  return {
9
- "--dt-row-py": spec.py,
10
- "--dt-head-mb": spec.headMb,
11
- "--dt-row-gap": spec.gap,
9
+ "--vk-row-py": spec.py,
10
+ "--vk-head-mb": spec.headMb,
11
+ "--vk-row-gap": spec.gap,
12
12
  };
13
13
  }
@@ -1 +1 @@
1
- export { ListFilterCapabilityError, validateFilterCapabilities, type ListFilterCapability, type ListFilterCapabilities, } from "../filters/registry.js";
1
+ export { type ListFilterCapability, type ListFilterCapabilities } from "../filters/registry.js";
@@ -1 +1 @@
1
- export { ListFilterCapabilityError, validateFilterCapabilities, } from "../filters/registry.js";
1
+ export {};
@@ -3,17 +3,16 @@
3
3
  *
4
4
  * What a list's columns ARE (`column-schema`), what may be DONE to them
5
5
  * (`column-capabilities`), which of them are shown and in what order
6
- * (`column-state`), how they narrow a cohort (`column-filters`,
7
- * `filter-pushdown`), and what a user has persisted about them
8
- * (`preferences`).
6
+ * (`column-state`), how they narrow a cohort (`column-filters`), and what a
7
+ * user has persisted about them (`preferences`).
9
8
  *
10
- * It lives OUTSIDE `grid-table/` because none of it is about a spreadsheet.
9
+ * It lives OUTSIDE `grid/` because none of it is about a spreadsheet.
11
10
  * A table view reads the same schema to align its columns; a card view reads
12
11
  * it to find the title field; a board would read a `select` column's `options`
13
12
  * to get its lanes; and all of them must ask `column-capabilities` before a
14
13
  * write, or a workspace lock would protect the grid and nothing else.
15
14
  *
16
- * What stayed behind in `grid-table/` is what only a spreadsheet does: cell
15
+ * What stayed behind in `grid/` is what only a spreadsheet does: cell
17
16
  * editors, range selection, clipboard, keyboard navigation, and the pixel
18
17
  * scale (`core/grid-scale.ts`).
19
18
  */
@@ -29,7 +28,6 @@ export * from "./column-types.js";
29
28
  export * from "./column-capabilities.js";
30
29
  export * from "./column-warnings.js";
31
30
  export * from "./column-filters.js";
32
- export * from "./filter-pushdown.js";
33
31
  export * from "./filter-capabilities.js";
34
32
  export * from "./preferences.js";
35
33
  export * from "./view-rules.js";
@@ -10,7 +10,6 @@ export * from "./column-types.js";
10
10
  export * from "./column-capabilities.js";
11
11
  export * from "./column-warnings.js";
12
12
  export * from "./column-filters.js";
13
- export * from "./filter-pushdown.js";
14
13
  export * from "./filter-capabilities.js";
15
14
  export * from "./preferences.js";
16
15
  export * from "./view-rules.js";
@@ -56,10 +56,6 @@ export type ListViewPrefs = {
56
56
  /** Pin the identity columns (everything through the title) to the left edge
57
57
  * while the rest of the table scrolls under them. */
58
58
  gridFreezeIdentity: boolean;
59
- /** Cells wrap to at most 3 lines instead of truncating to one, and rows grow
60
- * to fit their tallest cell. Off by default: one line per row is what makes
61
- * a grid scannable, and wrapping is the deliberate trade against it. */
62
- gridWrapCells: boolean;
63
59
  /** Keep every row's checkbox on screen instead of revealing it on hover.
64
60
  * Off by default: the rail is chrome, and a permanent column of empty boxes
65
61
  * is a cost every row pays for a gesture used occasionally. On for anyone
@@ -132,8 +128,10 @@ export declare function isGroupSummaryPart(value: unknown): value is ListGroupSu
132
128
  *
133
129
  * It was a single `"count" | "total"` before, so every persisted blob out there
134
130
  * still holds a bare string — parsed here rather than migrated, because a view
135
- * pref is not worth a migration and an unrecognised value should degrade to the
136
- * default instead of rendering nothing.
131
+ * pref is not worth a migration. Keeps the parts it recognises and drops the
132
+ * rest, so a value it cannot read comes back as `[]`, a bare group name, never
133
+ * the default: a caller with no stored value applies
134
+ * `LIST_VIEW_PREF_DEFAULTS.groupSummary` itself before calling.
137
135
  */
138
136
  export declare function normalizeGroupSummary(value: unknown): ListGroupSummaryPart[];
139
137
  export declare const LIST_VIEW_PREF_DEFAULTS: ListViewPrefs;
@@ -141,7 +139,9 @@ export declare const LIST_VIEW_PREF_DEFAULTS: ListViewPrefs;
141
139
  export declare function setFilterRule(current: ListFilterRuleState, columnId: string, rule: ListFilterRule | null): ListFilterRuleState;
142
140
  export declare function setOptionColor(current: ListOptionColorOverrides, columnId: string, value: string, color: ListSelectColor | null): ListOptionColorOverrides;
143
141
  export declare function setDateStyle(current: ListDateStyleOverrides, columnId: string, style: ListDateStyle): ListDateStyleOverrides;
144
- /** Set one column's duration rendering, keeping the map sparse. */
142
+ /** Set one column's duration rendering. Always writes the entry, the column's
143
+ * own style included: unlike `setFilterRule` and `setOptionColor`, it never
144
+ * drops one. */
145
145
  export declare function setDurationStyle(current: ListDurationStyleOverrides, columnId: string, style: ListDurationStyle): ListDurationStyleOverrides;
146
146
  export declare function setShowTime(current: ListShowTimeOverrides, columnId: string, show: boolean): ListShowTimeOverrides;
147
147
  export declare function setPercentDisplay(current: ListPercentDisplayOverrides, key: string, display: PercentDisplay): ListPercentDisplayOverrides;
@@ -21,7 +21,6 @@ export const LIST_VIEW_PREF_DEFAULTS = {
21
21
  gridVerticalBorders: false,
22
22
  gridRowIcon: true,
23
23
  gridFreezeIdentity: false,
24
- gridWrapCells: false,
25
24
  gridAlwaysCheckboxes: false,
26
25
  gridOptionColors: {},
27
26
  gridDateStyles: {},
@@ -45,7 +45,6 @@ export type ListViewLayout = {
45
45
  verticalBorders?: boolean;
46
46
  rowIcon?: boolean;
47
47
  freezeIdentity?: boolean;
48
- wrapCells?: boolean;
49
48
  alwaysCheckboxes?: boolean;
50
49
  /**
51
50
  * CALENDAR only — which date column positions the events, when the reader has
@@ -11,7 +11,6 @@ export const LIST_LAYOUT_DEFAULTS = {
11
11
  verticalBorders: false,
12
12
  rowIcon: true,
13
13
  freezeIdentity: false,
14
- wrapCells: false,
15
14
  alwaysCheckboxes: false,
16
15
  };
17
16
  export function verticalBordersDefault(defaults) {
@@ -29,7 +28,6 @@ export function readViewLayout(bucket, viewId, defaults) {
29
28
  verticalBorders: stored?.verticalBorders ?? verticalBordersDefault(defaults),
30
29
  rowIcon: stored?.rowIcon ?? LIST_LAYOUT_DEFAULTS.rowIcon,
31
30
  freezeIdentity: stored?.freezeIdentity ?? LIST_LAYOUT_DEFAULTS.freezeIdentity,
32
- wrapCells: stored?.wrapCells ?? LIST_LAYOUT_DEFAULTS.wrapCells,
33
31
  alwaysCheckboxes: stored?.alwaysCheckboxes ?? LIST_LAYOUT_DEFAULTS.alwaysCheckboxes,
34
32
  ...(stored?.dateColumnId ? { dateColumnId: stored.dateColumnId } : {}),
35
33
  ...(stored?.boardFieldId ? { boardFieldId: stored.boardFieldId } : {}),
@@ -61,7 +59,6 @@ export function hoistLegacyPrefs(legacy) {
61
59
  verticalBorders: pick(legacy, "gridVerticalBorders"),
62
60
  rowIcon: pick(legacy, "gridRowIcon"),
63
61
  freezeIdentity: pick(legacy, "gridFreezeIdentity"),
64
- wrapCells: pick(legacy, "gridWrapCells"),
65
62
  alwaysCheckboxes: pick(legacy, "gridAlwaysCheckboxes"),
66
63
  }),
67
64
  list: {},
@@ -1,2 +1,8 @@
1
1
  export declare function countRowRender(): void;
2
+ /**
3
+ * Counts row renders whatever `localStorage.perf` says, from zero, until the
4
+ * returned stop runs. For tests only: the package doesn't export it, and the
5
+ * browser's log never calls it.
6
+ */
7
+ export declare function countRowRendersInTest(): () => void;
2
8
  export declare function takeRowRenders(): number;
@@ -1,6 +1,9 @@
1
1
  let on = null;
2
+ let forced = 0;
2
3
  let rendered = 0;
3
4
  function counting() {
5
+ if (forced > 0)
6
+ return true;
4
7
  if (typeof window === "undefined")
5
8
  return false;
6
9
  if (on === null) {
@@ -17,6 +20,14 @@ export function countRowRender() {
17
20
  if (counting())
18
21
  rendered += 1;
19
22
  }
23
+ export function countRowRendersInTest() {
24
+ forced += 1;
25
+ rendered = 0;
26
+ return () => {
27
+ forced -= 1;
28
+ rendered = 0;
29
+ };
30
+ }
20
31
  export function takeRowRenders() {
21
32
  const count = rendered;
22
33
  rendered = 0;
@@ -5,7 +5,7 @@ import type { ViewsAtoms } from "../atoms/types.js";
5
5
  import type { FieldPresentation } from "../display/options.js";
6
6
  import type { ViewsComponents } from "./components.js";
7
7
  import type { ViewsIcons } from "./icons.js";
8
- import type { ViewsPorts } from "./ports.js";
8
+ import { type ViewsPorts } from "./ports.js";
9
9
  export { useViews, type ViewsContextValue } from "./context.js";
10
10
  export type ViewsProviderProps = {
11
11
  components: ViewsComponents;
@@ -21,6 +21,10 @@ export type ViewsProviderProps = {
21
21
  * app's. It is called where a value is drawn, so the app's provider imports none of the
22
22
  * display. Absent, the package's defaults in the conventions' locale. */
23
23
  presentation?: (defaults: FieldPresentation) => FieldPresentation;
24
+ /** The media query that means a desktop, so an editor opens as a popover there and as a sheet
25
+ * elsewhere. Hand in the one your own shell switches on. Default `DEFAULT_DESKTOP_QUERY`,
26
+ * `(min-width: 1024px)`. */
27
+ desktopQuery?: string;
24
28
  children: ReactNode;
25
29
  };
26
- export declare function ViewsProvider({ children, components, conventions, icons, ports, atoms, messages, presentation, }: ViewsProviderProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function ViewsProvider({ children, components, conventions, icons, ports, atoms, messages, presentation, desktopQuery, }: ViewsProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -4,9 +4,19 @@ import { useMemo } from "react";
4
4
  import { resolveViewsMessage } from "../contract.js";
5
5
  import { DEFAULT_VIEWS_ATOMS } from "../atoms/defaults.js";
6
6
  import { ViewsContext } from "./context.js";
7
+ import { PlainInput } from "./plain-input.js";
8
+ import { withSettledGroups } from "./menu-groups.js";
9
+ import { DEFAULT_DESKTOP_QUERY } from "./desktop.js";
10
+ import { browserConfirm } from "./ports.js";
7
11
  export { useViews } from "./context.js";
8
- export function ViewsProvider({ children, components, conventions, icons, ports, atoms, messages = resolveViewsMessage, presentation, }) {
12
+ export function ViewsProvider({ children, components, conventions, icons, ports, atoms, messages = resolveViewsMessage, presentation, desktopQuery = DEFAULT_DESKTOP_QUERY, }) {
9
13
  const merged = useMemo(() => ({ ...DEFAULT_VIEWS_ATOMS, ...atoms }), [atoms]);
10
- const value = useMemo(() => ({ components, atoms: merged, conventions, icons, ports, messages, presentation }), [components, merged, conventions, icons, ports, messages, presentation]);
14
+ const settled = useMemo(() => ({
15
+ ...components,
16
+ Menu: withSettledGroups(components.Menu),
17
+ Input: components.Input ?? PlainInput,
18
+ }), [components]);
19
+ const resolved = useMemo(() => (ports.confirm ? ports : { ...ports, confirm: browserConfirm }), [ports]);
20
+ const value = useMemo(() => ({ components: settled, atoms: merged, conventions, icons, ports: resolved, messages, presentation, desktopQuery }), [settled, merged, conventions, icons, resolved, messages, presentation, desktopQuery]);
11
21
  return _jsx(ViewsContext.Provider, { value: value, children: children });
12
22
  }