@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,206 @@
1
+ "use client";
2
+ import { useCallback, useMemo, useRef, useState, } from "react";
3
+ import { baseColumnOrder, columnPlacedByView, resolveViewColumnOrder, } from "../../model/column-capabilities.js";
4
+ import { gridWidthVar } from "../core/grid-scale.js";
5
+ import { clampColumnWidth, columnHideable, isColumnHidden, prettifyOptionValue, resolveColumnOrder, resolveColumnWidths, resolveVisibleColumns, toggleColumnHidden, } from "../../model/column-state.js";
6
+ import { useViews } from "../../provider/context.js";
7
+ import { gridColumnGlyph } from "./column-glyph.js";
8
+ function setBodyResizeState(active) {
9
+ document.body.style.cursor = active ? "col-resize" : "";
10
+ document.body.style.userSelect = active ? "none" : "";
11
+ }
12
+ export function useGridColumnLayout({ rootRef, columns, columnState, onColumnStateChange, scale, freezeIdentity = true, viewBacked = false, }) {
13
+ const { icons, components } = useViews();
14
+ const orderKey = columnState?.order;
15
+ const hiddenKey = columnState?.hidden;
16
+ const shownKey = columnState?.visible;
17
+ const visibleColumns = useMemo(() => {
18
+ if (!viewBacked) {
19
+ return resolveVisibleColumns(columns, {
20
+ order: orderKey,
21
+ hidden: hiddenKey,
22
+ visible: shownKey,
23
+ });
24
+ }
25
+ const managedIds = new Set(columns.filter(columnPlacedByView).map((column) => column.id));
26
+ return resolveVisibleColumns(columns, {
27
+ order: resolveViewColumnOrder(columns, orderKey),
28
+ hidden: hiddenKey?.filter((id) => managedIds.has(id)),
29
+ visible: shownKey?.filter((id) => managedIds.has(id)),
30
+ });
31
+ }, [columns, orderKey, hiddenKey, shownKey, viewBacked]);
32
+ const effectiveWidths = useMemo(() => resolveColumnWidths(visibleColumns, columnState?.widths), [visibleColumns, columnState?.widths]);
33
+ const frozenCount = useMemo(() => {
34
+ if (!freezeIdentity)
35
+ return 0;
36
+ const i = visibleColumns.findIndex((c) => c.type === "title");
37
+ if (i < 0)
38
+ return 0;
39
+ return Math.max(0, Math.min(i + 1, visibleColumns.length - 1));
40
+ }, [freezeIdentity, visibleColumns]);
41
+ const frozenLeft = useCallback((i) => `calc(var(--vk-rail-w)` +
42
+ visibleColumns
43
+ .slice(0, i)
44
+ .map((c) => ` + var(${gridWidthVar(c.id)}) * var(--vk-scale)`)
45
+ .join("") +
46
+ `)`, [visibleColumns]);
47
+ const frozenWidth = useMemo(() => frozenCount === 0
48
+ ? "0px"
49
+ : `calc((${visibleColumns
50
+ .slice(0, frozenCount)
51
+ .map((c) => `var(${gridWidthVar(c.id)})`)
52
+ .join(" + ")}) * var(--vk-scale))`, [visibleColumns, frozenCount]);
53
+ const widthVarsStyle = useMemo(() => {
54
+ const style = {};
55
+ for (const col of visibleColumns) {
56
+ style[gridWidthVar(col.id)] = `${effectiveWidths[col.id]}px`;
57
+ }
58
+ style["--vk-frozen-w"] = frozenWidth;
59
+ style["--vk-frozen-on"] = frozenCount > 0 ? "1" : "0";
60
+ return style;
61
+ }, [effectiveWidths, visibleColumns, frozenWidth, frozenCount]);
62
+ const columnManager = useMemo(() => {
63
+ if (!onColumnStateChange)
64
+ return null;
65
+ return {
66
+ items: resolveColumnOrder(columns, viewBacked ? resolveViewColumnOrder(columns, columnState?.order) : columnState?.order).map((col) => ({
67
+ id: col.id,
68
+ label: typeof col.header === "string" && col.header ? col.header : prettifyOptionValue(col.id),
69
+ icon: gridColumnGlyph({ icons, AppIcon: components.AppIcon }, col, "h-3.5 w-3.5"),
70
+ hidden: isColumnHidden(col, viewBacked && !columnPlacedByView(col) ? undefined : columnState),
71
+ hideable: !viewBacked || columnPlacedByView(col) ? columnHideable(col) : false,
72
+ fixed: viewBacked && !columnPlacedByView(col),
73
+ })),
74
+ onToggleHidden: (id, hide) => {
75
+ const col = columns.find((candidate) => candidate.id === id);
76
+ if (viewBacked && col && !columnPlacedByView(col))
77
+ return;
78
+ if (col)
79
+ onColumnStateChange(toggleColumnHidden(columnState, col, hide));
80
+ },
81
+ onReorder: (ids) => onColumnStateChange({
82
+ ...columnState,
83
+ order: viewBacked ? resolveViewColumnOrder(columns, ids) : ids,
84
+ }),
85
+ onReset: () => onColumnStateChange({}),
86
+ dirty: Object.keys(columnState ?? {}).length > 0,
87
+ };
88
+ }, [columnState, columns, components.AppIcon, icons, onColumnStateChange, viewBacked]);
89
+ const gridTemplate = useMemo(() => [
90
+ "0px",
91
+ ...visibleColumns.map((col) => `calc(var(${gridWidthVar(col.id)}) * var(--vk-scale))`),
92
+ "minmax(var(--vk-tail-w),1fr)",
93
+ ].join(" "), [visibleColumns]);
94
+ const minWidth = useMemo(() => `calc((${visibleColumns
95
+ .map((col) => `var(${gridWidthVar(col.id)})`)
96
+ .join(" + ")}) * var(--vk-scale) + 2*var(--vk-gutter,0px) + var(--vk-indent,0px) + var(--vk-tail-w))`, [visibleColumns]);
97
+ const [resizingId, setResizingId] = useState(null);
98
+ const dragRef = useRef(null);
99
+ const rafRef = useRef(null);
100
+ const pendingXRef = useRef(0);
101
+ const lastGestureMovedRef = useRef(false);
102
+ const startResize = (col, event) => {
103
+ dragRef.current = {
104
+ col,
105
+ startX: event.clientX,
106
+ startW: effectiveWidths[col.id],
107
+ lastW: null,
108
+ moved: false,
109
+ };
110
+ lastGestureMovedRef.current = false;
111
+ setResizingId(col.id);
112
+ setBodyResizeState(true);
113
+ };
114
+ const moveResize = (event) => {
115
+ if (!dragRef.current)
116
+ return;
117
+ pendingXRef.current = event.clientX;
118
+ if (rafRef.current != null)
119
+ return;
120
+ rafRef.current = requestAnimationFrame(() => {
121
+ rafRef.current = null;
122
+ const drag = dragRef.current;
123
+ if (!drag)
124
+ return;
125
+ const delta = pendingXRef.current - drag.startX;
126
+ if (Math.abs(delta) > 2)
127
+ drag.moved = true;
128
+ const width = clampColumnWidth(drag.col, drag.startW + delta / scale);
129
+ drag.lastW = width;
130
+ rootRef.current?.style.setProperty(gridWidthVar(drag.col.id), `${width}px`);
131
+ });
132
+ };
133
+ const endResize = () => {
134
+ const drag = dragRef.current;
135
+ dragRef.current = null;
136
+ if (rafRef.current != null) {
137
+ cancelAnimationFrame(rafRef.current);
138
+ rafRef.current = null;
139
+ }
140
+ setResizingId(null);
141
+ setBodyResizeState(false);
142
+ if (!drag)
143
+ return;
144
+ lastGestureMovedRef.current = drag.moved;
145
+ if (!drag.moved || drag.lastW == null || drag.lastW === effectiveWidths[drag.col.id])
146
+ return;
147
+ onColumnStateChange?.({
148
+ ...columnState,
149
+ widths: { ...(columnState?.widths ?? {}), [drag.col.id]: drag.lastW },
150
+ });
151
+ };
152
+ const resetColumnWidth = (col) => {
153
+ if (lastGestureMovedRef.current)
154
+ return;
155
+ const widths = { ...(columnState?.widths ?? {}) };
156
+ if (!(col.id in widths))
157
+ return;
158
+ delete widths[col.id];
159
+ const next = { ...columnState };
160
+ if (Object.keys(widths).length === 0)
161
+ delete next.widths;
162
+ else
163
+ next.widths = widths;
164
+ onColumnStateChange?.(next);
165
+ };
166
+ const hideColumn = (col) => {
167
+ if (viewBacked && !columnPlacedByView(col))
168
+ return;
169
+ onColumnStateChange?.(toggleColumnHidden(columnState, col, true));
170
+ };
171
+ const moveColumn = (col, direction) => {
172
+ if (viewBacked && !columnPlacedByView(col))
173
+ return;
174
+ const ordered = baseColumnOrder(columns, columnState?.order, viewBacked);
175
+ const visibleIds = visibleColumns.map((c) => c.id);
176
+ const at = visibleIds.indexOf(col.id);
177
+ const neighbour = visibleIds[at + direction];
178
+ if (at < 0 || !neighbour)
179
+ return;
180
+ if (viewBacked && !columnPlacedByView(columns.find((c) => c.id === neighbour)))
181
+ return;
182
+ const i = ordered.indexOf(col.id);
183
+ const j = ordered.indexOf(neighbour);
184
+ [ordered[i], ordered[j]] = [ordered[j], ordered[i]];
185
+ onColumnStateChange?.({
186
+ ...columnState,
187
+ order: viewBacked ? resolveViewColumnOrder(columns, ordered) : ordered,
188
+ });
189
+ };
190
+ return {
191
+ visibleColumns,
192
+ widthVarsStyle,
193
+ frozenCount,
194
+ frozenLeft,
195
+ columnManager,
196
+ gridTemplate,
197
+ minWidth,
198
+ resizingId,
199
+ startResize,
200
+ moveResize,
201
+ endResize,
202
+ resetColumnWidth,
203
+ hideColumn,
204
+ moveColumn,
205
+ };
206
+ }
@@ -0,0 +1,45 @@
1
+ import { type RefObject } from "react";
2
+ import type { GridCellPos } from "../core/coordinates.js";
3
+ import { type GridChromeTarget, type GridFocusTarget } from "../core/grid-focus.js";
4
+ /** Text entry and overlay surfaces: they own their keys and their focus wherever they live, inside the grid or out
5
+ * (an editor's input, a rename, a menu, a dialog). A checkbox is no text entry: the grid's Space ticks it. */
6
+ export declare const GRID_KEY_OWNING_SURFACES = "input:not([type=\"checkbox\"]), textarea, select, [contenteditable=\"true\"], [role=\"menu\"], [role=\"dialog\"]";
7
+ /** The element a target draws, found in the grid's own DOM; null when it isn't drawn. */
8
+ export declare function gridFocusElement(root: HTMLElement, target: GridFocusTarget): HTMLElement | null;
9
+ /**
10
+ * A mouse press on a part that takes focus (a cell, a column name, a footer cell) focuses it at once without scrolling:
11
+ * the browser's own focus on mousedown would scroll a part half under the pinned head or the frozen columns into
12
+ * view, and finds it already focused. A press in text being typed, or inside the part already holding focus (its open
13
+ * editor), is left alone.
14
+ */
15
+ export declare function gridFocusOnPress(event: {
16
+ pointerType: string;
17
+ button: number;
18
+ target: EventTarget | null;
19
+ }, part: string): void;
20
+ /**
21
+ * Where a chrome target goes when the element it stood for is gone (a column hidden or the list regrouped from its
22
+ * own menu, a group's ⋯ that no longer draws): the same row's first cell where that row is still drawn, the bar's
23
+ * name for its ⋯; null where nothing of it is left.
24
+ */
25
+ export declare function gridChromeFallback(root: HTMLElement, target: GridChromeTarget): GridChromeTarget | null;
26
+ /**
27
+ * Where real focus belongs in the grid, and the effect that puts it there. A data cell's focus stays the editing
28
+ * model's `focusedCell`; a column name, a footer cell, a bar or a checkbox is the `chrome` target beside it. After a
29
+ * render that moved the target, real focus follows it, but only while nothing else on the page has the focus (it is
30
+ * on the body, the frame, a guard or inside the grid) and no editor is open: the grid never takes focus from the
31
+ * toolbar, and an open editor keeps its own. An editor that answered by Enter or Tab and still plays its close is not
32
+ * open: the focused cell has moved on, and the focus follows it at once.
33
+ */
34
+ export declare function useGridFocus({ rootRef, focusedCell, editingCell, }: {
35
+ rootRef: RefObject<HTMLDivElement | null>;
36
+ focusedCell: GridCellPos | null;
37
+ editingCell: GridCellPos | null;
38
+ }): {
39
+ chrome: GridChromeTarget | null;
40
+ setChrome: (target: GridChromeTarget | null) => void;
41
+ target: GridFocusTarget | null;
42
+ releaseToFrame: () => void;
43
+ /** The last data cell that held the focus, for coming back in after a let-go. */
44
+ lastCellRef: RefObject<GridCellPos | null>;
45
+ };
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
+ import { GRID_ADD_COLUMN, GRID_RAIL_COLUMN, } from "../core/grid-focus.js";
4
+ const esc = (value) => CSS.escape(value);
5
+ export const GRID_KEY_OWNING_SURFACES = 'input:not([type="checkbox"]), textarea, select, [contenteditable="true"], [role="menu"], [role="dialog"]';
6
+ export function gridFocusElement(root, target) {
7
+ switch (target.kind) {
8
+ case "cell":
9
+ return root.querySelector(`[data-row-id="${esc(target.pos.rowId)}"] [data-col-id="${esc(target.pos.columnId)}"]`);
10
+ case "rail": {
11
+ const row = `[data-row-id="${esc(target.rowKey)}"] [data-slot="vk-grid-rail"]`;
12
+ return root.querySelector(`${row} button, ${row} input`);
13
+ }
14
+ case "head": {
15
+ const head = root.querySelector(`[data-slot="vk-grid-header"][data-group-key="${esc(target.groupKey)}"]`);
16
+ if (!head)
17
+ return null;
18
+ if (target.columnId === GRID_RAIL_COLUMN) {
19
+ return head.querySelector('[data-slot="vk-grid-rail"] button, [data-slot="vk-grid-rail"] input');
20
+ }
21
+ if (target.columnId === GRID_ADD_COLUMN)
22
+ return head.querySelector('[data-slot="vk-grid-tail"] button');
23
+ return head.querySelector(`[data-headcell="${esc(target.columnId)}"]`);
24
+ }
25
+ case "foot": {
26
+ const foot = root.querySelector(`[data-slot="vk-grid-footer"][data-group-key="${esc(target.groupKey)}"]`);
27
+ return foot?.querySelector(`[data-footcell="${esc(target.columnId)}"]`) ?? null;
28
+ }
29
+ case "bar": {
30
+ const group = root.querySelector(`[data-slot="vk-grid-group"][data-group-key="${esc(target.groupKey)}"]`);
31
+ if (!group)
32
+ return null;
33
+ return target.part === "name"
34
+ ? group.querySelector("[data-bar-name]")
35
+ : group.querySelector('[data-slot="vk-grid-group-header"] [aria-haspopup]');
36
+ }
37
+ }
38
+ }
39
+ export function gridFocusOnPress(event, part) {
40
+ if (event.pointerType !== "mouse" || event.button !== 0)
41
+ return;
42
+ const target = event.target;
43
+ if (!target?.closest || target.closest(GRID_KEY_OWNING_SURFACES))
44
+ return;
45
+ const element = target.closest(part);
46
+ if (!element || element.contains(document.activeElement))
47
+ return;
48
+ element.focus({ preventScroll: true });
49
+ }
50
+ export function gridChromeFallback(root, target) {
51
+ if (target.kind === "head" || target.kind === "foot") {
52
+ const slot = target.kind === "head" ? "vk-grid-header" : "vk-grid-footer";
53
+ const attr = target.kind === "head" ? "data-headcell" : "data-footcell";
54
+ const line = root.querySelector(`[data-slot="${slot}"][data-group-key="${esc(target.groupKey)}"]`);
55
+ const first = line?.querySelector(`[${attr}]`)?.getAttribute(attr);
56
+ return first != null ? { kind: target.kind, groupKey: target.groupKey, columnId: first } : null;
57
+ }
58
+ if (target.kind === "bar" && target.part === "menu") {
59
+ const name = { kind: "bar", groupKey: target.groupKey, part: "name" };
60
+ return gridFocusElement(root, name) ? name : null;
61
+ }
62
+ return null;
63
+ }
64
+ function targetKey(target) {
65
+ if (!target)
66
+ return "";
67
+ return target.kind === "cell" ? `cell:${target.pos.rowId}:${target.pos.columnId}` : JSON.stringify(target);
68
+ }
69
+ export function useGridFocus({ rootRef, focusedCell, editingCell, }) {
70
+ const [chrome, setChromeState] = useState(null);
71
+ const target = chrome ?? (focusedCell ? { kind: "cell", pos: focusedCell } : null);
72
+ const key = targetKey(target);
73
+ const lastCellRef = useRef(null);
74
+ useEffect(() => {
75
+ if (!focusedCell)
76
+ return;
77
+ lastCellRef.current = focusedCell;
78
+ setChromeState(null);
79
+ }, [focusedCell]);
80
+ const heldRef = useRef(false);
81
+ const setChrome = useCallback((next) => setChromeState(next), []);
82
+ const releaseToFrame = useCallback(() => {
83
+ rootRef.current?.focus({ preventScroll: true });
84
+ }, [rootRef]);
85
+ useEffect(() => {
86
+ const root = rootRef.current;
87
+ if (!root || !chrome || gridFocusElement(root, chrome))
88
+ return;
89
+ const fallback = gridChromeFallback(root, chrome);
90
+ setChromeState(fallback);
91
+ const active = document.activeElement;
92
+ if (!fallback && (active == null || active === document.body))
93
+ root.focus({ preventScroll: true });
94
+ });
95
+ useEffect(() => {
96
+ const root = rootRef.current;
97
+ const answered = editingCell != null &&
98
+ target?.kind === "cell" &&
99
+ (target.pos.rowId !== editingCell.rowId || target.pos.columnId !== editingCell.columnId);
100
+ if (!root || (editingCell && !answered))
101
+ return;
102
+ const active = document.activeElement;
103
+ const onBody = active == null || active === document.body;
104
+ const free = answered || onBody || (root.contains(active) && !active.closest(GRID_KEY_OWNING_SURFACES));
105
+ if (!target) {
106
+ if (heldRef.current && onBody)
107
+ root.focus({ preventScroll: true });
108
+ else if (free && !onBody && active !== root && active instanceof HTMLElement && !active.closest("[data-grid-guard]"))
109
+ active.blur();
110
+ heldRef.current = false;
111
+ return;
112
+ }
113
+ const element = gridFocusElement(root, target);
114
+ if (element && free && active !== element) {
115
+ element.focus({ preventScroll: true });
116
+ if (target.kind !== "cell")
117
+ element.scrollIntoView?.({ block: "nearest", inline: "nearest" });
118
+ }
119
+ heldRef.current = element != null && document.activeElement === element;
120
+ }, [key, editingCell, rootRef]);
121
+ return { chrome, setChrome, target, releaseToFrame, lastCellRef };
122
+ }
@@ -0,0 +1,20 @@
1
+ import type { MutableRefObject } from "react";
2
+ import type { ListColumn } from "../../model/column-schema.js";
3
+ import type { ListColumnState } from "../../model/column-state.js";
4
+ /** Bind visible header drag order back onto the complete stored column order. */
5
+ export declare function useGridHeaderDrag<Row>({ columns, columnState, onColumnStateChange, visibleColumnIds, scrollXRef, getScroller, viewBacked, }: {
6
+ columns: ListColumn<Row>[];
7
+ columnState?: ListColumnState;
8
+ onColumnStateChange?: (next: ListColumnState) => void;
9
+ visibleColumnIds: string[];
10
+ scrollXRef: MutableRefObject<number>;
11
+ getScroller: () => HTMLElement | undefined;
12
+ viewBacked?: boolean;
13
+ }): {
14
+ cellStyle: (id: string, index: number) => React.CSSProperties | undefined;
15
+ onCellPointerDown: (id: string, index: number) => (e: React.PointerEvent<HTMLElement>) => void;
16
+ onCellPointerMove: (e: React.PointerEvent<HTMLElement>) => void;
17
+ onCellPointerUp: (e: React.PointerEvent<HTMLElement>) => void;
18
+ onCellPointerCancel: () => void;
19
+ onCellClickCapture: (e: React.MouseEvent<HTMLElement>) => void;
20
+ };
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { baseColumnOrder, columnPlacedByView, resolveViewColumnOrder, } from "../../model/column-capabilities.js";
3
+ import { useHeaderDragReorder } from "./useHeaderDragReorder.js";
4
+ export function useGridHeaderDrag({ columns, columnState, onColumnStateChange, visibleColumnIds, scrollXRef, getScroller, viewBacked = false, }) {
5
+ return useHeaderDragReorder({
6
+ enabled: !!onColumnStateChange,
7
+ ids: visibleColumnIds,
8
+ scrollXRef,
9
+ getScroller,
10
+ canDrag: (id) => {
11
+ const column = columns.find((candidate) => candidate.id === id);
12
+ return !viewBacked || !column || columnPlacedByView(column);
13
+ },
14
+ onReorder: (movedId, nextVisible) => {
15
+ if (!onColumnStateChange)
16
+ return;
17
+ const moved = columns.find((column) => column.id === movedId);
18
+ if (viewBacked && moved && !columnPlacedByView(moved))
19
+ return;
20
+ const completeOrder = baseColumnOrder(columns, columnState?.order, viewBacked);
21
+ const remaining = completeOrder.filter((id) => id !== movedId);
22
+ const position = nextVisible.indexOf(movedId);
23
+ const follower = nextVisible[position + 1];
24
+ const previous = nextVisible[position - 1];
25
+ const insertAt = follower != null
26
+ ? remaining.indexOf(follower)
27
+ : previous != null
28
+ ? remaining.indexOf(previous) + 1
29
+ : remaining.length;
30
+ remaining.splice(insertAt, 0, movedId);
31
+ onColumnStateChange({
32
+ ...columnState,
33
+ order: viewBacked ? resolveViewColumnOrder(columns, remaining) : remaining,
34
+ });
35
+ },
36
+ });
37
+ }
@@ -0,0 +1,64 @@
1
+ import { type RefObject } from "react";
2
+ import { type GridCellPos } from "../core/coordinates.js";
3
+ import type { GridCellRange } from "../core/useGridRange.js";
4
+ import type { ListSettingsConfig } from "../../model/column-capabilities.js";
5
+ import type { ListColumn } from "../../model/column-schema.js";
6
+ import type { GridRangeVerbs } from "./useGridRangeActions.js";
7
+ import { type GridChromeTarget, type GridFocusShape } from "../core/grid-focus.js";
8
+ export declare function useGridKeyboard<Row>({ rootRef, focusedCell, editingCell, editingEnabled, listConfig, visibleRowIds, rowByKey, visibleColIds, visibleColumns, rows, getRowId, pendingByRow, rangeVerbsRef, focusCell, clearFocus, startEdit, cancelEdit, commitEdit, refuseEdit, undo, redo, rangeSetRect, rangeExtendTo, ranges, revealCell, releaseToFrame, lastCellRef, chrome, setChrome, shape, toggleGroup, }: {
9
+ rootRef: RefObject<HTMLDivElement | null>;
10
+ /** A column name, a footer cell, a bar or a checkbox holding the focus (`useGridFocus`); null: a data cell, or
11
+ * nothing. */
12
+ chrome?: GridChromeTarget | null;
13
+ setChrome?: (target: GridChromeTarget | null) => void;
14
+ /** What the keyboard walks beyond the data cells: the sections, their footers and menus, the checkbox lane. None:
15
+ * a grid whose keys stay on its data cells. */
16
+ shape?: GridFocusShape;
17
+ /** Collapse or open a group: a bar's Enter, Space, ← and →. */
18
+ toggleGroup?: (groupKey: string) => void;
19
+ /** Puts real focus on the grid's frame: Escape's let-go (`useGridFocus`). */
20
+ releaseToFrame: () => void;
21
+ /** The last data cell that held the focus: an arrow on the let-go frame comes back in there. */
22
+ lastCellRef: RefObject<GridCellPos | null>;
23
+ /** The grid's one reveal (`grid-scroll-owner.ts`'s `revealGridCell`, with the table's `revealRow`): brings a
24
+ * cell into view whether or not the page holds its row. */
25
+ revealCell: (pos: GridCellPos, behavior: ScrollBehavior) => void;
26
+ focusedCell: GridCellPos | null;
27
+ editingCell: GridCellPos | null;
28
+ editingEnabled: boolean;
29
+ /** Workspace-settings capability config — the keyboard routes ask the same effective
30
+ * write gate the cells do, so a lock holds here too. */
31
+ listConfig?: ListSettingsConfig;
32
+ visibleRowIds: string[];
33
+ /** Row key → the rendered row and its DATA id. Focus is a KEY; a commit needs
34
+ * the record and the id behind it. */
35
+ rowByKey: ReadonlyMap<string, {
36
+ row: Row;
37
+ rowId: string;
38
+ }>;
39
+ visibleColIds: string[];
40
+ visibleColumns: ListColumn<Row>[];
41
+ rows: Row[];
42
+ getRowId: (row: Row) => string;
43
+ pendingByRow: ReadonlyMap<string, Record<string, unknown>>;
44
+ rangeVerbsRef: RefObject<GridRangeVerbs | null>;
45
+ focusCell: (rowId: string, columnId: string) => void;
46
+ clearFocus: () => void;
47
+ /** Seed a fresh rectangle (⌘A, or extending with no range yet). */
48
+ rangeSetRect: (anchor: GridCellPos, head: GridCellPos) => void;
49
+ /** Grow the ACTIVE range to a new head, anchor untouched. */
50
+ rangeExtendTo: (pos: GridCellPos) => void;
51
+ /** Live ranges — the last one is active; read for its head. */
52
+ ranges: GridCellRange[];
53
+ startEdit: (rowId: string, columnId: string, seed?: string | null, whole?: boolean) => void;
54
+ cancelEdit: () => void;
55
+ commitEdit: (row: Row, rowId: string, columnId: string, previous: unknown, next: unknown) => void;
56
+ /** Say why a cell can't be written; answers whether it said anything. */
57
+ refuseEdit: (columnId: string) => boolean;
58
+ undo: (resolveRow: (rowId: string) => Row | undefined, onApply?: (pos: GridCellPos) => void) => boolean;
59
+ redo: (resolveRow: (rowId: string) => Row | undefined, onApply?: (pos: GridCellPos) => void) => boolean;
60
+ }): {
61
+ onEditorTab: (rowId: string, columnId: string, backwards: boolean) => void;
62
+ onEditorEnter: (rowId: string, columnId: string) => void;
63
+ enterGrid: (_which: "start" | "end", from: Element | null) => void;
64
+ };