@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
package/README.md CHANGED
@@ -1,51 +1,102 @@
1
1
  # ViewKit views
2
2
 
3
- The grid, board, calendar and list over typed fields: a headless engine every app installs and never
4
- edits, and a default rendering written to skin discipline — markup, classes and slots only, states as
5
- `data-*` attributes, primitives handed in by the app, geometry through `--vk-*` variables. By Sheaf.
6
-
7
- **Status: 0.1.** The rendering contract, the provider, the model, the field display, the editors, the
8
- cells and selection are here; the grid's rendering follows in 0.2, then the board.
9
-
10
- ## What is here
11
-
12
- | door | holds |
13
- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
14
- | `@viewkitjs/views` | the rendering contract: slots, states, tokens, the components map, the atom names, ports, icon names, the message keys and their English resolver — `docs/contract.md` |
15
- | `@viewkitjs/views/react` | `ViewsProvider`, `useViews`, the default atoms, and the types an adapter implements |
16
- | `@viewkitjs/views/display` | the field display: one renderer per storage type, the string formatters, the viewer |
17
- | `@viewkitjs/views/editors`, `/editors/<name>`, `/editors/session`, `/editors/open-values` | the edit registry, each field editor (select, relation, number, range, name, value list, date, chips), the anchored edit session, and an open field's values carried to its editors |
18
- | `@viewkitjs/views/cells` | a column's typed cell, and its column-shaped string formatters |
19
- | `@viewkitjs/views/selection` | a list's selection: the model, the hook, the row checkbox, drag-select and the row-click rules |
20
-
21
- ## Actor, rich text, range, name and lookup
22
-
23
- The display draws every field type the fields package defines. An `actor` is a chip with a member's
24
- avatar, or a glyph for an automation, an API key or the system; a `rich_text` is one line in a cell and
25
- folded text in a drawer; a `range` is "11–50" with its unit and period; a `name` is the full name as
26
- written, else the given and family names, else the words the host gives an empty one
27
- (`DisplayOptions.nameFallback`, or a column's `nameFallback(row)`), and it may be a record's title; a
28
- `lookup` is drawn as the field it shows; a rollup with a breakdown is a segmented bar or a sparkline
29
- beside its headline. The range has its own editor at `@viewkitjs/views/editors/range` (two boxes) and a
30
- range filter; the name has its own at `@viewkitjs/views/editors/name` (given, family and full, the full
31
- box filled from the parts once one is edited, until a person types in it); a place has its own at
32
- `@viewkitjs/views/editors/location` (the country first, then that country's parts in its order, a region picked
33
- from its list). An app hands the
34
- provider a `Markdown` component in the components map, its own markdown renderer, which draws rich
35
- text; the package renders no markdown itself.
3
+ The grid, its cells, the field display and the editors over typed fields: a headless engine every app installs and never edits, and a default rendering written to skin discipline — markup, classes and slots only, states as `data-*` attributes, primitives handed in by the app, geometry through `--vk-*` variables. By Sheaf.
4
+
5
+ `@viewkitjs/fields` says what a value is; this package draws it and edits it. It ships no UI library of its own: your app hands in its button, popover, menu, command list and calendar through a components map, its icons by meaning, its toast, clipboard and per-device store as ports, and its wording as messages, so every view wears your app's look.
36
6
 
37
7
  ## Install
38
8
 
39
- See `docs/install.md`: pin the package, add one `@source` line, mount `ViewsProvider` once with your
40
- primitives, your icons, your field conventions and four small ports; your own atoms and wording are
41
- optional.
9
+ ```sh
10
+ pnpm add @viewkitjs/views @viewkitjs/fields zod
11
+ ```
12
+
13
+ ESM only. Node 20 or later. `react` and `react-dom` 19 and `@viewkitjs/fields` are peer dependencies. Add one `@source` line so Tailwind sees the package, and map its colours onto your theme: [docs/install.md](./docs/install.md).
14
+
15
+ ## Getting started
16
+
17
+ Fields bound to your rows become the grid's columns. This block runs as written; [the getting-started page](./docs/getting-started.md) carries on from it to your primitives, the provider and the grid on screen.
18
+
19
+ ```ts
20
+ import assert from "node:assert/strict";
21
+ import { defineFields } from "@viewkitjs/fields";
22
+ import { bindFields, columnFrom, columnWritable } from "@viewkitjs/views";
23
+
24
+ const DEAL_FIELDS = defineFields({
25
+ entity: "deal",
26
+ identity: "title",
27
+ fields: {
28
+ title: { type: "text", label: "Title", required: true },
29
+ value: { type: "currency", label: "Value", code: { fixed: "EUR" } },
30
+ },
31
+ });
32
+
33
+ type Deal = { id: string; title: string; value: number };
34
+
35
+ // How each field reads on your row, and how an edit maps onto your request's body.
36
+ const DEAL_BINDINGS = bindFields<Deal, typeof DEAL_FIELDS>(DEAL_FIELDS, {
37
+ title: { read: (deal) => deal.title, write: (_deal, commit) => ({ body: { title: commit } }) },
38
+ value: { read: (deal) => deal.value },
39
+ });
40
+
41
+ // A column is what the grid draws: its type, format and edits come from the field and the binding.
42
+ const title = columnFrom(DEAL_BINDINGS.title, { id: "title", width: 240, editable: true });
43
+ const value = columnFrom(DEAL_BINDINGS.value, { id: "value", width: 120 });
44
+
45
+ assert.equal(title.type, "title");
46
+ assert.equal(columnWritable(title), true);
47
+ assert.equal(columnWritable(value), false); // no write: read-only on every surface
48
+ ```
49
+
50
+ Then mount `ViewsProvider` once with your primitives and draw `GridTable` from `@viewkitjs/views/grid` with the rows, the columns, each row's id and what opening a row does.
42
51
 
43
- ## Reshape
52
+ ## Documentation
44
53
 
45
- See `docs/reshaping.md`: a theme preset first, then `--vk-*` values, then wrappers and `data-slot`
46
- selectors, then a copy of the rendering when the copy mode ships.
54
+ The package ships its documentation in `docs/`, starting at [docs/index.md](./docs/index.md). Every example in it is compiled and run against the packed package before each release.
55
+
56
+ - [Getting started](./docs/getting-started.md): install, fields bound to your rows, columns, your primitives, the provider and the grid.
57
+ - [Install](./docs/install.md): the Tailwind line and the colour block.
58
+
59
+ Guides:
60
+
61
+ - [The provider](./docs/guides/the-provider.md): mounting it once, your adapter over your own primitives, icons, messages and presentation.
62
+ - [Ports](./docs/guides/ports.md): your toast, haptics, clipboard, per-device store and confirm dialog.
63
+ - [Atoms](./docs/guides/atoms.md): the small pieces every view is built from, and swapping them for your own.
64
+ - [The display](./docs/guides/display.md): one renderer per field type, and the string formatters.
65
+ - [Editors and the edit session](./docs/guides/editors.md): one editor per field type, what an editor owns and what its host owns.
66
+ - [Columns](./docs/guides/columns.md): a field bound to your row, the column built from it, and what may be done to it.
67
+ - [Cells](./docs/guides/cells.md): a column's value drawn in a cell, outside the grid too.
68
+ - [Selection](./docs/guides/selection.md): a list's selection, its checkbox, drag-select and the row-click rules.
69
+ - [The grid](./docs/guides/the-grid.md): grouping, sorting, writes, preferences, figures and the editing rules.
70
+ - [The rendering contract](./docs/contract.md): every public name and what each door holds; [reshaping a view](./docs/reshaping.md): the cheapest change first.
71
+
72
+ References, one per door, each naming every export: [`@viewkitjs/views`](./docs/reference/views.md), [`/react`](./docs/reference/react.md), [`/display`](./docs/reference/display.md), [`/editors`](./docs/reference/editors.md), [`/editors/select`](./docs/reference/editors-select.md), [`/editors/text`](./docs/reference/editors-text.md), [`/editors/relation`](./docs/reference/editors-relation.md), [`/editors/number`](./docs/reference/editors-number.md), [`/editors/range`](./docs/reference/editors-range.md), [`/editors/name`](./docs/reference/editors-name.md), [`/editors/location`](./docs/reference/editors-location.md), [`/editors/value-list`](./docs/reference/editors-value-list.md), [`/editors/date`](./docs/reference/editors-date.md), [`/editors/chips`](./docs/reference/editors-chips.md), [`/editors/session`](./docs/reference/editors-session.md), [`/editors/panel`](./docs/reference/editors-panel.md), [`/editors/open-values`](./docs/reference/editors-open-values.md), [`/field-row`](./docs/reference/field-row.md), [`/cells`](./docs/reference/cells.md), [`/selection`](./docs/reference/selection.md), [`/grid`](./docs/reference/grid.md).
73
+
74
+ ## Doors
75
+
76
+ | Import | Holds |
77
+ | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
78
+ | `@viewkitjs/views` | the rendering contract (slots, states, tokens, the components map, atom and icon names, ports, message keys and their English resolver) and the model: columns, preferences, filters, figures, groups, bindings and money. No React at runtime |
79
+ | `@viewkitjs/views/react` | `ViewsProvider`, `useViews`, the default atoms, and the types an adapter implements |
80
+ | `@viewkitjs/views/display` | the field display: one renderer per storage type, the string formatters, the viewer |
81
+ | `@viewkitjs/views/editors` | the edit registry: which editor each type opens |
82
+ | `@viewkitjs/views/editors/<name>` | one editor each: `select`, `text`, `relation`, `number`, `range`, `name`, `location`, `value-list`, `date`, `chips` |
83
+ | `@viewkitjs/views/editors/session`, `/editors/open-values` | the anchored edit session every host shares, and an open field's values carried to its editors |
84
+ | `@viewkitjs/views/editors/panel` | an editor opened as your popover on the desktop and your sheet on the phone |
85
+ | `@viewkitjs/views/field-row` | a record's field row: its label, its value and its editor in place, with the write path that admits, queues and settles each edit |
86
+ | `@viewkitjs/views/cells` | a column's typed cell, and its column-shaped string formatters |
87
+ | `@viewkitjs/views/selection` | a list's selection: the model, the hook, the row checkbox, drag-select and the row-click rules |
88
+ | `@viewkitjs/views/grid` | the grid: the table, its props, its preferences, and the helpers a host shares with it |
89
+
90
+ Twenty-one doors; there are no other subpaths.
47
91
 
48
92
  ## For coding agents
49
93
 
50
- The package ships a usage skill at `skills/views/SKILL.md`; its examples compile against the packed
51
- artifact on every check.
94
+ The package ships a usage skill at `skills/views/SKILL.md`. Its example is compiled against the published artifact on every release.
95
+
96
+ ## Status
97
+
98
+ `0.x`: the API may change between minor versions.
99
+
100
+ ## Licence
101
+
102
+ Proprietary. See [LICENSE.md](./LICENSE.md).
@@ -2,6 +2,16 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useEffect, useRef } from "react";
4
4
  import { useViews } from "../provider/context.js";
5
+ const SCROLLS_Y = new Set(["auto", "scroll", "overlay"]);
6
+ function nearestScrollArea(element) {
7
+ for (let el = element.parentElement; el; el = el.parentElement) {
8
+ if (el === document.body || el === document.documentElement)
9
+ break;
10
+ if (SCROLLS_Y.has(getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight)
11
+ return el;
12
+ }
13
+ return null;
14
+ }
5
15
  export function DefaultLoadMore({ onReveal, label }) {
6
16
  const { Loading } = useViews().atoms;
7
17
  const ref = useRef(null);
@@ -17,7 +27,7 @@ export function DefaultLoadMore({ onReveal, label }) {
17
27
  for (const entry of entries)
18
28
  if (entry.isIntersecting)
19
29
  onRevealRef.current();
20
- }, { rootMargin: "600px 0px" });
30
+ }, { root: nearestScrollArea(element), rootMargin: "600px 0px" });
21
31
  observer.observe(element);
22
32
  return () => observer.disconnect();
23
33
  }, []);
package/dist/atoms/Row.js CHANGED
@@ -26,5 +26,5 @@ export function DefaultRow({ onClick, onMouseDown, disabled, interactive = true,
26
26
  if (!interactive) {
27
27
  return (_jsx("div", { "data-slot": "vk-row", title: title, className: cx(frame, className), children: body }));
28
28
  }
29
- return (_jsx("button", { type: "button", "data-slot": "vk-row", "data-disabled": disabled || undefined, "data-open": open || undefined, "aria-haspopup": opens ? "menu" : undefined, "aria-expanded": opens ? Boolean(open) : undefined, disabled: disabled, onClick: onClick, onMouseDown: onMouseDown, title: title, role: role, "aria-selected": role ? ariaSelected : undefined, className: cx(frame, "group/row transition-colors hover:bg-(color:--vk-hovered) data-open:bg-(color:--vk-pressed) disabled:pointer-events-none disabled:opacity-50", className), children: body }));
29
+ return (_jsx("button", { type: "button", "data-slot": "vk-row", "data-disabled": disabled || undefined, "data-open": open || undefined, "aria-haspopup": opens ? "dialog" : undefined, "aria-expanded": opens ? Boolean(open) : undefined, disabled: disabled, onClick: onClick, onMouseDown: onMouseDown, title: title, role: role, "aria-selected": role ? ariaSelected : undefined, className: cx(frame, "group/row transition-colors hover:bg-(color:--vk-hovered) data-open:bg-(color:--vk-pressed) disabled:pointer-events-none disabled:opacity-50", className), children: body }));
30
30
  }
@@ -1,2 +1,2 @@
1
1
  import type { ViewsRowMenuProps } from "./types.js";
2
- export declare function DefaultRowMenu({ children, rowId, items, openHref, onDelete }: ViewsRowMenuProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function DefaultRowMenu({ children, rowId, items, openHref, onDelete, deleteLabel }: ViewsRowMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -34,8 +34,8 @@ function hostEntry(item, index) {
34
34
  },
35
35
  };
36
36
  }
37
- export function DefaultRowMenu({ children, rowId, items, openHref, onDelete }) {
38
- const { components, icons, messages } = useViews();
37
+ export function DefaultRowMenu({ children, rowId, items, openHref, onDelete, deleteLabel }) {
38
+ const { components, icons, messages, ports } = useViews();
39
39
  const { Menu } = components;
40
40
  const [point, setPoint] = useState(null);
41
41
  const openedAt = useRef(0);
@@ -68,8 +68,19 @@ export function DefaultRowMenu({ children, rowId, items, openHref, onDelete }) {
68
68
  icon: _jsx(Delete, { className: "h-4 w-4" }),
69
69
  destructive: true,
70
70
  onSelect: () => {
71
- if (window.confirm(messages({ key: "views.menus.row-delete-confirm" })))
72
- void onDelete(rowId);
71
+ const request = {
72
+ message: messages({ key: "views.menus.row-delete-confirm" }),
73
+ confirmLabel: messages({ key: "views.menus.row-delete" }),
74
+ ...(deleteLabel !== undefined && { subject: deleteLabel }),
75
+ destructive: true,
76
+ };
77
+ void new Promise((resolve) => resolve(ports.confirm(request)))
78
+ .catch(() => false)
79
+ .then((yes) => {
80
+ if (!yes)
81
+ return;
82
+ return new Promise((resolve) => resolve(onDelete(rowId))).catch(() => ports.toast.error(messages({ key: "views.menus.row-delete-failed" })));
83
+ });
73
84
  },
74
85
  },
75
86
  });
@@ -79,14 +90,17 @@ export function DefaultRowMenu({ children, rowId, items, openHref, onDelete }) {
79
90
  setPoint(null);
80
91
  return (_jsxs("div", { ref: wrapper, "data-slot": "vk-row-menu", onPointerDownCapture: (event) => {
81
92
  lastPress.current = event.pointerType;
93
+ }, onKeyDownCapture: () => {
94
+ lastPress.current = undefined;
82
95
  }, onContextMenu: (event) => {
83
96
  const fromMore = event.target.closest?.('[data-slot="vk-grid-row-more"]');
84
- const touched = lastPress.current === "touch";
97
+ const pressed = lastPress.current;
98
+ const touched = pressed === "touch";
85
99
  lastPress.current = undefined;
86
100
  if (touched && !fromMore)
87
101
  return;
88
102
  event.preventDefault();
89
- openedAt.current = performance.now();
103
+ openedAt.current = pressed === undefined ? -Infinity : performance.now();
90
104
  setPoint({ x: event.clientX, y: event.clientY });
91
105
  }, onPointerUpCapture: (event) => {
92
106
  if (!point || !inGrace())
@@ -40,7 +40,7 @@ export type ViewsRowProps = ViewsRowContentProps & {
40
40
  disabled?: boolean;
41
41
  /** Default true. False draws a line that is read, not pressed. */
42
42
  interactive?: boolean;
43
- /** The row opens a flyout beside its menu: `aria-haspopup="menu"`, and `aria-expanded` from `open`. */
43
+ /** The row opens a flyout beside its menu, a dialog: `aria-haspopup="dialog"`, and `aria-expanded` from `open`. */
44
44
  opens?: boolean;
45
45
  /** The flyout this row opens is up now: `aria-expanded`, `data-open` and the pressed ground. */
46
46
  open?: boolean;
@@ -143,8 +143,8 @@ export type ViewsRowMenuItem = {
143
143
  };
144
144
  /** The row's right-click menu, around the row it opens on. The rendering builds `items` (the cell's
145
145
  * clipboard rows, Select, the host's verbs); the menu adds the page link before them and Delete after.
146
- * The default is the components map's `Menu` at the pointer; an app swaps in its own (a dialog before
147
- * a delete, a long-press). */
146
+ * The default is the components map's `Menu` at the pointer, its Delete asking the confirm port; an
147
+ * app swaps in its own (a long-press that selects). */
148
148
  export type ViewsRowMenuProps = {
149
149
  /** The row: right-click on it, or the row's ⋯, opens the menu. */
150
150
  children: ReactNode;
@@ -155,7 +155,7 @@ export type ViewsRowMenuProps = {
155
155
  openHref?: string;
156
156
  /** Absent: no Delete row. */
157
157
  onDelete?: (rowId: string) => Promise<void>;
158
- /** What Delete removes, for an app's own confirmation; the default's confirm doesn't use it. */
158
+ /** What Delete removes, handed to the confirm port as its `subject`. */
159
159
  deleteLabel?: string;
160
160
  /** Flips the row's selection, for an app whose long-press selects. Absent when the list can't select.
161
161
  * The default doesn't use it: on a phone the ⋯ is the way in. */
@@ -36,9 +36,6 @@ export type GridCellOptions = {
36
36
  withTime?: boolean;
37
37
  /** Percent columns: the workspace's display — wins over `format.percentDisplay`. */
38
38
  percentDisplay?: PercentDisplay;
39
- /** Per-user "Wrap columns" toggle: text-bearing cells wrap instead of
40
- * truncating. See `cellTextClass` in the display. */
41
- wrap?: boolean;
42
39
  /** Optimistic pending value (Tier 3) — wins over `accessor(row)` when defined.
43
40
  * Only typed cells honor it; custom `render` columns show confirmed data. */
44
41
  valueOverride?: unknown;
@@ -105,6 +102,9 @@ export type GridCellOptions = {
105
102
  * controls inside the slot's own button would be invalid markup.
106
103
  */
107
104
  slotOwnsClick?: boolean;
105
+ /** A host whose plain click on a value is its own (the grid selects the cell): links stay links but let the
106
+ * click through, and the host follows one only on a ⌘- or Ctrl-click (`DisplayOptions.hostOwnsPlainClick`). */
107
+ hostOwnsPlainClick?: boolean;
108
108
  };
109
109
  /**
110
110
  * Fold the code a money cell is drawn in into the render options, so the
@@ -1,5 +1,4 @@
1
1
  import type { ReactNode } from "react";
2
- import type { GridCellOptions } from "./cell-format.js";
3
2
  import type { ListColumn } from "../model/column-schema.js";
4
3
  /**
5
4
  * THE TITLE CELL — the one typed cell the list owns, not a field.
@@ -14,4 +13,4 @@ import type { ListColumn } from "../model/column-schema.js";
14
13
  * generic indicator lane for this type: the adornment has to sit inside the
15
14
  * cell's own layout rules about where the click target ends.
16
15
  */
17
- export declare function renderTitleCell<Row>(col: ListColumn<Row>, row: Row, content: ReactNode, opts?: GridCellOptions): ReactNode;
16
+ export declare function renderTitleCell<Row>(col: ListColumn<Row>, row: Row, content: ReactNode): ReactNode;
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cellTextClass } from "../display/text-class.js";
4
4
  import { cx } from "../internal/cx.js";
5
- export function renderTitleCell(col, row, content, opts) {
5
+ export function renderTitleCell(col, row, content) {
6
6
  const indicator = col.indicator?.(row);
7
- return (_jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { "data-cell-open": true, className: cx("min-w-0 cursor-pointer font-medium text-(color:--vk-fg)", cellTextClass(opts?.wrap)), children: content }), indicator] }));
7
+ return (_jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { "data-cell-open": true, className: cx("min-w-0 cursor-pointer font-medium text-(color:--vk-fg)", cellTextClass()), children: content }), indicator] }));
8
8
  }
@@ -1,7 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { valueTypeOf } from "@viewkitjs/fields";
4
+ import { ConvertedFigure } from "../display/converted.js";
4
5
  import { renderFieldValue } from "../display/display-cores.js";
6
+ import { convertedFromOf } from "../fields/money.js";
5
7
  import { columnLabel } from "../model/column-capabilities.js";
6
8
  import { prettifyOptionValue } from "../model/column-state.js";
7
9
  import { useViews } from "../provider/context.js";
@@ -19,13 +21,14 @@ export function renderTypedCellValue(col, row, opts) {
19
21
  if (!col.type)
20
22
  return null;
21
23
  if (col.type === "title")
22
- return renderTitleCell(col, row, identityContent(col, row, value, opts), opts);
24
+ return renderTitleCell(col, row, identityContent(col, row, value, opts));
23
25
  const field = col.field ?? legacyFieldFromColumn(col);
24
26
  const cell = renderFieldValue(field, value, displayOptionsFor(col, row, opts));
25
27
  if (col.command && opts?.commandItems?.length) {
26
28
  return _jsx(CommandCell, { col: col, cell: cell, items: opts.commandItems });
27
29
  }
28
- return cell;
30
+ const from = cell == null ? null : convertedFromOf(col, row);
31
+ return from ? _jsx(ConvertedFigure, { from: from, children: cell }) : cell;
29
32
  }
30
33
  const TITLE_THROUGH_CORE = new Set(["number", "percent", "currency", "date", "datetime", "name"]);
31
34
  function identityContent(col, row, value, opts) {
@@ -74,7 +77,6 @@ function displayOptionsFor(col, row, opts) {
74
77
  nameFallback: col.nameFallback?.(row) ?? undefined,
75
78
  withTime: opts?.withTime,
76
79
  percentDisplay: opts?.percentDisplay,
77
- wrap: opts?.wrap,
78
80
  booleanIcon: col.format?.icon,
79
81
  marker: col.marker,
80
82
  markerReason: opts?.markerReason,
@@ -82,6 +84,7 @@ function displayOptionsFor(col, row, opts) {
82
84
  onToggle: opts?.onToggle,
83
85
  entityIcon: opts?.entityIcon,
84
86
  slotOwnsClick: opts?.slotOwnsClick,
87
+ hostOwnsPlainClick: opts?.hostOwnsPlainClick,
85
88
  relationWrap: listRelationWrap(opts),
86
89
  };
87
90
  }
@@ -10,13 +10,14 @@ export declare const VK_PREFIX: "vk";
10
10
  /** The parts of the grid, as `data-slot` values. `data-slot` is one attribute shared by
11
11
  * every component copy in an app, so each value carries the prefix. Board's arrive with
12
12
  * the board. */
13
- export declare const GRID_SLOTS: readonly ["vk-grid", "vk-grid-header", "vk-grid-header-cell", "vk-grid-row", "vk-grid-cell", "vk-grid-group", "vk-grid-group-header", "vk-grid-footer", "vk-grid-footer-cell", "vk-grid-rail", "vk-grid-tail", "vk-grid-row-more", "vk-grid-editor", "vk-grid-outline", "vk-grid-resize-handle", "vk-grid-column-menu", "vk-grid-flyout", "vk-grid-group-menu", "vk-grid-aggregate-menu"];
13
+ export declare const GRID_SLOTS: readonly ["vk-grid", "vk-grid-scroll", "vk-grid-head", "vk-grid-header", "vk-grid-header-cell", "vk-grid-row", "vk-grid-rows", "vk-grid-gap", "vk-grid-cell", "vk-grid-group", "vk-grid-group-head", "vk-grid-group-header", "vk-grid-footer", "vk-grid-footer-cell", "vk-grid-rail", "vk-grid-tail", "vk-grid-row-more", "vk-grid-editor", "vk-grid-outline", "vk-grid-resize-handle", "vk-grid-column-menu", "vk-grid-flyout", "vk-grid-group-menu", "vk-grid-aggregate-menu"];
14
14
  export type GridSlot = (typeof GRID_SLOTS)[number];
15
15
  /** The flags the rendering styles, as `data-*` attributes present when true. */
16
16
  export declare const GRID_STATES: readonly ["focused", "selected", "editing", "in-range", "range-edge", "pending", "invalid", "dragging", "empty", "frozen", "scrolled", "parked"];
17
17
  export type GridState = (typeof GRID_STATES)[number];
18
- /** The CSS variables the package owns: geometry and density. Its colours are `VK_COLOURS`, which the app declares. Today's `--grid-*` variables in the portal become these in the move. */
19
- export declare const VK_TOKENS: readonly ["--vk-scale", "--vk-row-h", "--vk-head-h", "--vk-footer-h", "--vk-label-h", "--vk-line-h", "--vk-chrome-h", "--vk-px", "--vk-cell-py", "--vk-tail-py", "--vk-rail-w", "--vk-rail-gap", "--vk-tail-w", "--vk-indent", "--vk-frozen-w", "--vk-scroll-mt", "--vk-glyph", "--vk-head-glyph", "--vk-text", "--vk-text-xs", "--vk-text-10", "--vk-head-text", "--vk-scrolled", "--vk-parked", "--vk-frozen-on"];
18
+ /** The CSS variables the package owns: geometry and density. Its colours are `VK_COLOURS`, which the app declares.
19
+ * The last three are `densityStyle`'s, written on the root of a rows view an app draws itself. */
20
+ export declare const VK_TOKENS: readonly ["--vk-scale", "--vk-row-h", "--vk-head-h", "--vk-footer-h", "--vk-label-h", "--vk-line-h", "--vk-px", "--vk-tail-pl", "--vk-rail-w", "--vk-rail-gap", "--vk-tail-w", "--vk-indent", "--vk-frozen-w", "--vk-scroll-mt", "--vk-glyph", "--vk-head-glyph", "--vk-text", "--vk-text-xs", "--vk-text-10", "--vk-head-text", "--vk-scrolled", "--vk-parked", "--vk-frozen-on", "--vk-row-py", "--vk-head-mb", "--vk-row-gap"];
20
21
  export type VkToken = (typeof VK_TOKENS)[number];
21
22
  /** The colours the rendering paints, each a CSS variable the APP declares — the package
22
23
  * sets none, and names no variable of the app's own. An app maps each onto its tokens once
@@ -31,24 +32,44 @@ export declare const VK_OPTIONAL_COLOURS: readonly ["--vk-success", "--vk-warnin
31
32
  export type VkOptionalColour = (typeof VK_OPTIONAL_COLOURS)[number];
32
33
  /** Layout the APP may declare, read with a built-in fallback. `--vk-gutter` is the side padding the
33
34
  * page gives its content: the grid's rows run edge to edge and line their content up with it.
34
- * Undeclared, it reads `0px` — a grid flush with its container. */
35
- export declare const VK_OPTIONAL_LAYOUT: readonly ["--vk-gutter"];
35
+ * Undeclared, it reads `0px` — a grid flush with its container. `--vk-scroll-inset-bottom` is how
36
+ * much of the grid's foot the app covers with something it floats there (a phone's bottom bar):
37
+ * the grid's scroll area runs underneath it and its last row scrolls clear of it. Undeclared, it
38
+ * reads `0px`. The grid's headers pin inside its own scroll area, so nothing the app pins outside
39
+ * it concerns the grid. */
40
+ export declare const VK_OPTIONAL_LAYOUT: readonly ["--vk-gutter", "--vk-scroll-inset-bottom"];
36
41
  export type VkOptionalLayout = (typeof VK_OPTIONAL_LAYOUT)[number];
42
+ /** The grid's own machinery, set and read by the grid alone: prefixed because they share the
43
+ * global namespace, and not public. An app neither sets nor reads them, and they may change in
44
+ * any release. `--vk-drag-shift` is a header cell's offset while its column is dragged;
45
+ * `--vk-cols` is the columns' template, set on the scroll area and read by every row. */
46
+ export declare const VK_INTERNAL: readonly ["--vk-drag-shift", "--vk-cols"];
47
+ export type VkInternal = (typeof VK_INTERNAL)[number];
48
+ /** Internal families: a prefix, one variable per key after it. `--vk-col-w-<id>` is one
49
+ * column's resolved width, set on the grid's root for every visible column. */
50
+ export declare const VK_INTERNAL_FAMILIES: readonly ["--vk-col-w-"];
37
51
  /** The primitives an app hands in through the provider. */
38
52
  export declare const COMPONENT_NAMES: readonly ["Button", "Popover", "Tooltip", "Checkbox", "Menu", "Command", "Calendar", "Collapse", "Sheet", "AppIcon", "Markdown"];
39
53
  export type ComponentName = (typeof COMPONENT_NAMES)[number];
54
+ /** The primitives an app may hand in, each with a plain default the provider fills: apart from
55
+ * `COMPONENT_NAMES`, which lists the ones it must. */
56
+ export declare const OPTIONAL_COMPONENT_NAMES: readonly ["Input"];
57
+ export type OptionalComponentName = (typeof OPTIONAL_COMPONENT_NAMES)[number];
40
58
  /** The pieces the rendering is built from, and the app's own pieces it cannot draw itself (a command cell's verb menu, the row's right-click menu, where a relation goes, a wait, how a list asks for more). Each ships as a default; an app swaps any of them through the provider's `atoms`. */
41
59
  export declare const ATOM_NAMES: readonly ["Row", "RowContent", "TickBox", "StatusBadge", "StatusMarker", "Tag", "List", "CommandMenu", "RelationLink", "Loading", "LoadMore", "PlatformMark", "RowMenu"];
42
60
  export type AtomName = (typeof ATOM_NAMES)[number];
43
61
  /** The default atoms' `data-slot` values: prefixed, like the grid's. */
44
62
  export declare const ATOM_SLOTS: readonly ["vk-row", "vk-row-content", "vk-tick", "vk-status", "vk-marker", "vk-tag", "vk-list", "vk-command-menu", "vk-relation-link", "vk-loading", "vk-load-more", "vk-platform", "vk-row-menu"];
45
63
  export type AtomSlot = (typeof ATOM_SLOTS)[number];
64
+ /** The editor panel's `data-slot` values: prefixed, like the grid's. */
65
+ export declare const EDITOR_SLOTS: readonly ["vk-editor-panel", "vk-editor-bar", "vk-editor-refusal", "vk-text-editor"];
66
+ export type EditorSlot = (typeof EDITOR_SLOTS)[number];
46
67
  /** The default atoms' states. `chosen`, `disabled`, `muted`, `checked` and `open` are
47
68
  * flags present when true; `status` carries the slot's name. */
48
69
  export declare const ATOM_STATES: readonly ["chosen", "disabled", "muted", "checked", "open", "status", "platform"];
49
70
  export type AtomState = (typeof ATOM_STATES)[number];
50
71
  /** The runtime services an app hands in through the provider. */
51
- export declare const PORT_NAMES: readonly ["toast", "haptics", "clipboard", "viewPrefs"];
72
+ export declare const PORT_NAMES: readonly ["toast", "haptics", "clipboard", "viewPrefs", "confirm"];
52
73
  export type PortName = (typeof PORT_NAMES)[number];
53
74
  /** The glyphs the rendering asks the app for, by what they mean, never by a
54
75
  * library's name. The app maps each to its own icon component. */
@@ -97,6 +118,25 @@ export type ViewsMessage = {
97
118
  values: {
98
119
  value: string;
99
120
  };
121
+ } | {
122
+ key: "views.editors.discard";
123
+ } | {
124
+ key: "views.editors.save";
125
+ } | {
126
+ key: "views.editors.open-email";
127
+ values: {
128
+ value: string;
129
+ };
130
+ } | {
131
+ key: "views.editors.open-phone";
132
+ values: {
133
+ value: string;
134
+ };
135
+ } | {
136
+ key: "views.editors.open-link";
137
+ values: {
138
+ value: string;
139
+ };
100
140
  } | {
101
141
  key: "views.editors.place-country";
102
142
  } | {
@@ -257,6 +297,8 @@ export type ViewsMessage = {
257
297
  key: "views.menus.row-delete";
258
298
  } | {
259
299
  key: "views.menus.row-delete-confirm";
300
+ } | {
301
+ key: "views.menus.row-delete-failed";
260
302
  } | {
261
303
  key: "views.grid.figure";
262
304
  values: {
@@ -306,6 +348,11 @@ export type ViewsMessage = {
306
348
  key: "views.grid.cell-read-only";
307
349
  } | {
308
350
  key: "views.grid.clear-none";
351
+ } | {
352
+ key: "views.grid.clear-required";
353
+ values: {
354
+ fields: string;
355
+ };
309
356
  } | {
310
357
  key: "views.grid.write-not-list";
311
358
  } | {
@@ -335,6 +382,16 @@ export type ViewsMessage = {
335
382
  values: {
336
383
  value: string;
337
384
  };
385
+ } | {
386
+ key: "views.grid.paste-ambiguous-option";
387
+ values: {
388
+ value: string;
389
+ };
390
+ } | {
391
+ key: "views.grid.paste-other-currency";
392
+ values: {
393
+ currency: string;
394
+ };
338
395
  } | {
339
396
  key: "views.grid.paste-pick";
340
397
  values: {
@@ -348,9 +405,16 @@ export type ViewsMessage = {
348
405
  } | {
349
406
  key: "views.grid.paste-not-range";
350
407
  } | {
351
- key: "views.grid.paste-failed";
408
+ key: "views.grid.paste-skipped";
352
409
  values: {
353
410
  count: number;
411
+ reason: string;
412
+ };
413
+ } | {
414
+ key: "views.grid.fill-skipped";
415
+ values: {
416
+ count: number;
417
+ reason: string;
354
418
  };
355
419
  } | {
356
420
  key: "views.grid.changed-elsewhere";
@@ -413,6 +477,13 @@ export type ViewsMessage = {
413
477
  };
414
478
  } | {
415
479
  key: "views.display.phone-as-typed";
480
+ } | {
481
+ key: "views.display.converted-from";
482
+ values: {
483
+ code: string;
484
+ };
485
+ } | {
486
+ key: "views.display.as-shown";
416
487
  };
417
488
  export type ViewsMessageKey = ViewsMessage["key"];
418
489
  /** A place's word, as a message key: the region, city or postal-code word a country's format names
@@ -422,7 +493,7 @@ export type PlaceWordKey = Extract<ViewsMessageKey, `views.editors.place-${"regi
422
493
  export declare function placeWordKey(kind: "region", word: RegionWord): PlaceWordKey;
423
494
  export declare function placeWordKey(kind: "city", word: CityWord): PlaceWordKey;
424
495
  export declare function placeWordKey(kind: "postal", word: PostalWord): PlaceWordKey;
425
- export declare const VIEWS_MESSAGE_KEYS: readonly ["views.editors.tag-remove", "views.editors.marker-resolve", "views.editors.marker-no-reason", "views.editors.range-low", "views.editors.range-high", "views.editors.name-given", "views.editors.name-family", "views.editors.name-full", "views.editors.values-add", "views.editors.values-label", "views.editors.values-main", "views.editors.values-make-main", "views.editors.values-remove", "views.editors.place-country", "views.editors.place-country-search", "views.editors.place-change-country", "views.editors.place-region-search", "views.editors.place-line1", "views.editors.place-line2", "views.editors.place-region-area", "views.editors.place-region-county", "views.editors.place-region-department", "views.editors.place-region-district", "views.editors.place-region-do-si", "views.editors.place-region-emirate", "views.editors.place-region-island", "views.editors.place-region-oblast", "views.editors.place-region-parish", "views.editors.place-region-prefecture", "views.editors.place-region-province", "views.editors.place-region-state", "views.editors.place-city-city", "views.editors.place-city-district", "views.editors.place-city-post-town", "views.editors.place-city-suburb", "views.editors.place-postal-eircode", "views.editors.place-postal-pin", "views.editors.place-postal-postal", "views.editors.place-postal-zip", "views.editors.place-required", "views.editors.place-region", "views.menus.part-row", "views.menus.sort-asc", "views.menus.sort-desc", "views.menus.sort-clear", "views.menus.group-by", "views.menus.ungroup", "views.menus.move-left", "views.menus.move-right", "views.menus.hide-column", "views.menus.format", "views.menus.date-style", "views.menus.show-time", "views.menus.duration-style", "views.menus.decimals", "views.menus.automatic", "views.menus.currency", "views.menus.percent-display", "views.menus.percent-display-option", "views.menus.colour", "views.menus.colours-reset", "views.menus.group-options", "views.menus.group-sort", "views.menus.search", "views.menus.group-show", "views.menus.group-count", "views.menus.group-hide", "views.menus.add-column-search", "views.menus.add-column-no-match", "views.menus.add-column-all-shown", "views.menus.copy", "views.menus.cut", "views.menus.paste", "views.menus.clear", "views.menus.edit", "views.menus.row-open", "views.menus.row-select", "views.menus.row-delete", "views.menus.row-delete-confirm", "views.grid.figure", "views.grid.figure-pick", "views.grid.add-column", "views.grid.loading", "views.grid.select-row", "views.grid.select-group", "views.grid.select-all", "views.grid.row-menu", "views.grid.group-expand", "views.grid.group-collapse", "views.grid.change-value", "views.grid.value", "views.grid.edit-value", "views.grid.read-only", "views.grid.read-only-why", "views.grid.locked", "views.grid.not-clearable", "views.grid.computed", "views.grid.cell-read-only", "views.grid.clear-none", "views.grid.write-not-list", "views.grid.write-not-boolean", "views.grid.write-marker", "views.grid.write-not-email", "views.grid.write-not-url", "views.grid.write-not-link", "views.grid.write-not-linkable", "views.grid.paste-refused", "views.grid.paste-empty", "views.grid.paste-not-number", "views.grid.paste-not-duration", "views.grid.paste-not-date", "views.grid.paste-not-option", "views.grid.paste-pick", "views.grid.paste-not-linkable", "views.grid.paste-not-range", "views.grid.paste-failed", "views.grid.changed-elsewhere", "views.grid.changed-elsewhere-cells", "views.grid.saved-value", "views.grid.saved-values", "views.grid.row-left", "views.display.just-now", "views.display.in", "views.display.today", "views.display.yesterday", "views.display.tomorrow", "views.display.month", "views.display.not-an-option", "views.display.needs-attention", "views.display.boolean", "views.display.show-all", "views.display.show-more", "views.display.show-less", "views.display.phone-extension", "views.display.phone-as-typed"];
496
+ export declare const VIEWS_MESSAGE_KEYS: readonly ["views.editors.tag-remove", "views.editors.marker-resolve", "views.editors.marker-no-reason", "views.editors.range-low", "views.editors.range-high", "views.editors.name-given", "views.editors.name-family", "views.editors.name-full", "views.editors.values-add", "views.editors.values-label", "views.editors.values-main", "views.editors.values-make-main", "views.editors.values-remove", "views.editors.discard", "views.editors.save", "views.editors.open-email", "views.editors.open-phone", "views.editors.open-link", "views.editors.place-country", "views.editors.place-country-search", "views.editors.place-change-country", "views.editors.place-region-search", "views.editors.place-line1", "views.editors.place-line2", "views.editors.place-region-area", "views.editors.place-region-county", "views.editors.place-region-department", "views.editors.place-region-district", "views.editors.place-region-do-si", "views.editors.place-region-emirate", "views.editors.place-region-island", "views.editors.place-region-oblast", "views.editors.place-region-parish", "views.editors.place-region-prefecture", "views.editors.place-region-province", "views.editors.place-region-state", "views.editors.place-city-city", "views.editors.place-city-district", "views.editors.place-city-post-town", "views.editors.place-city-suburb", "views.editors.place-postal-eircode", "views.editors.place-postal-pin", "views.editors.place-postal-postal", "views.editors.place-postal-zip", "views.editors.place-required", "views.editors.place-region", "views.menus.part-row", "views.menus.sort-asc", "views.menus.sort-desc", "views.menus.sort-clear", "views.menus.group-by", "views.menus.ungroup", "views.menus.move-left", "views.menus.move-right", "views.menus.hide-column", "views.menus.format", "views.menus.date-style", "views.menus.show-time", "views.menus.duration-style", "views.menus.decimals", "views.menus.automatic", "views.menus.currency", "views.menus.percent-display", "views.menus.percent-display-option", "views.menus.colour", "views.menus.colours-reset", "views.menus.group-options", "views.menus.group-sort", "views.menus.search", "views.menus.group-show", "views.menus.group-count", "views.menus.group-hide", "views.menus.add-column-search", "views.menus.add-column-no-match", "views.menus.add-column-all-shown", "views.menus.copy", "views.menus.cut", "views.menus.paste", "views.menus.clear", "views.menus.edit", "views.menus.row-open", "views.menus.row-select", "views.menus.row-delete", "views.menus.row-delete-confirm", "views.menus.row-delete-failed", "views.grid.figure", "views.grid.figure-pick", "views.grid.add-column", "views.grid.loading", "views.grid.select-row", "views.grid.select-group", "views.grid.select-all", "views.grid.row-menu", "views.grid.group-expand", "views.grid.group-collapse", "views.grid.change-value", "views.grid.value", "views.grid.edit-value", "views.grid.read-only", "views.grid.read-only-why", "views.grid.locked", "views.grid.not-clearable", "views.grid.computed", "views.grid.cell-read-only", "views.grid.clear-none", "views.grid.clear-required", "views.grid.write-not-list", "views.grid.write-not-boolean", "views.grid.write-marker", "views.grid.write-not-email", "views.grid.write-not-url", "views.grid.write-not-link", "views.grid.write-not-linkable", "views.grid.paste-refused", "views.grid.paste-empty", "views.grid.paste-not-number", "views.grid.paste-not-duration", "views.grid.paste-not-date", "views.grid.paste-not-option", "views.grid.paste-ambiguous-option", "views.grid.paste-other-currency", "views.grid.paste-pick", "views.grid.paste-not-linkable", "views.grid.paste-not-range", "views.grid.paste-skipped", "views.grid.fill-skipped", "views.grid.changed-elsewhere", "views.grid.changed-elsewhere-cells", "views.grid.saved-value", "views.grid.saved-values", "views.grid.row-left", "views.display.just-now", "views.display.in", "views.display.today", "views.display.yesterday", "views.display.tomorrow", "views.display.month", "views.display.not-an-option", "views.display.needs-attention", "views.display.boolean", "views.display.show-all", "views.display.show-more", "views.display.show-less", "views.display.phone-extension", "views.display.phone-as-typed", "views.display.converted-from", "views.display.as-shown"];
426
497
  /** What an app hands in: its wording for every message. A resolver that words
427
498
  * only some keys calls `resolveViewsMessage` for the rest; the provider does not. */
428
499
  export type ViewsMessageResolver = (message: ViewsMessage) => string;