@viewkitjs/views 0.0.0-stage → 0.2.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 (451) hide show
  1. package/CHANGELOG.md +615 -0
  2. package/LICENSE.md +7 -0
  3. package/README.md +99 -2
  4. package/dist/atoms/CommandMenu.d.ts +2 -0
  5. package/dist/atoms/CommandMenu.js +20 -0
  6. package/dist/atoms/List.d.ts +2 -0
  7. package/dist/atoms/List.js +6 -0
  8. package/dist/atoms/LoadMore.d.ts +2 -0
  9. package/dist/atoms/LoadMore.js +25 -0
  10. package/dist/atoms/Loading.d.ts +2 -0
  11. package/dist/atoms/Loading.js +7 -0
  12. package/dist/atoms/PlatformMark.d.ts +2 -0
  13. package/dist/atoms/PlatformMark.js +4 -0
  14. package/dist/atoms/RelationLink.d.ts +2 -0
  15. package/dist/atoms/RelationLink.js +6 -0
  16. package/dist/atoms/Row.d.ts +3 -0
  17. package/dist/atoms/Row.js +30 -0
  18. package/dist/atoms/RowMenu.d.ts +2 -0
  19. package/dist/atoms/RowMenu.js +112 -0
  20. package/dist/atoms/StatusBadge.d.ts +2 -0
  21. package/dist/atoms/StatusBadge.js +7 -0
  22. package/dist/atoms/StatusMarker.d.ts +2 -0
  23. package/dist/atoms/StatusMarker.js +19 -0
  24. package/dist/atoms/Tag.d.ts +2 -0
  25. package/dist/atoms/Tag.js +13 -0
  26. package/dist/atoms/TickBox.d.ts +2 -0
  27. package/dist/atoms/TickBox.js +8 -0
  28. package/dist/atoms/defaults.d.ts +2 -0
  29. package/dist/atoms/defaults.js +27 -0
  30. package/dist/atoms/tones.d.ts +5 -0
  31. package/dist/atoms/tones.js +28 -0
  32. package/dist/atoms/types.d.ts +178 -0
  33. package/dist/atoms/types.js +3 -0
  34. package/dist/cells/cell-format.d.ts +138 -0
  35. package/dist/cells/cell-format.js +16 -0
  36. package/dist/cells/cell-title.d.ts +17 -0
  37. package/dist/cells/cell-title.js +8 -0
  38. package/dist/cells/cell-values.d.ts +28 -0
  39. package/dist/cells/cell-values.js +87 -0
  40. package/dist/cells/index.d.ts +4 -0
  41. package/dist/cells/index.js +4 -0
  42. package/dist/cells/legacy-field.d.ts +52 -0
  43. package/dist/cells/legacy-field.js +164 -0
  44. package/dist/cells/relation-wrap.d.ts +3 -0
  45. package/dist/cells/relation-wrap.js +24 -0
  46. package/dist/cells/use-cell-format.d.ts +5 -0
  47. package/dist/cells/use-cell-format.js +10 -0
  48. package/dist/contract.d.ts +461 -0
  49. package/dist/contract.js +682 -0
  50. package/dist/display/actor.d.ts +4 -0
  51. package/dist/display/actor.js +26 -0
  52. package/dist/display/boolean.d.ts +18 -0
  53. package/dist/display/boolean.js +43 -0
  54. package/dist/display/breakdown.d.ts +15 -0
  55. package/dist/display/breakdown.js +32 -0
  56. package/dist/display/currency.d.ts +9 -0
  57. package/dist/display/currency.js +29 -0
  58. package/dist/display/date.d.ts +12 -0
  59. package/dist/display/date.js +26 -0
  60. package/dist/display/display-cores.d.ts +31 -0
  61. package/dist/display/display-cores.js +57 -0
  62. package/dist/display/entity-chip.d.ts +26 -0
  63. package/dist/display/entity-chip.js +9 -0
  64. package/dist/display/format.d.ts +66 -0
  65. package/dist/display/format.js +190 -0
  66. package/dist/display/index.d.ts +8 -0
  67. package/dist/display/index.js +7 -0
  68. package/dist/display/link.d.ts +29 -0
  69. package/dist/display/link.js +50 -0
  70. package/dist/display/location.d.ts +8 -0
  71. package/dist/display/location.js +22 -0
  72. package/dist/display/multi-value.d.ts +18 -0
  73. package/dist/display/multi-value.js +28 -0
  74. package/dist/display/name.d.ts +6 -0
  75. package/dist/display/name.js +14 -0
  76. package/dist/display/number.d.ts +11 -0
  77. package/dist/display/number.js +27 -0
  78. package/dist/display/options.d.ts +153 -0
  79. package/dist/display/options.js +1 -0
  80. package/dist/display/percent.d.ts +4 -0
  81. package/dist/display/percent.js +40 -0
  82. package/dist/display/phone.d.ts +11 -0
  83. package/dist/display/phone.js +45 -0
  84. package/dist/display/range.d.ts +6 -0
  85. package/dist/display/range.js +29 -0
  86. package/dist/display/relation.d.ts +4 -0
  87. package/dist/display/relation.js +29 -0
  88. package/dist/display/rich-text.d.ts +10 -0
  89. package/dist/display/rich-text.js +34 -0
  90. package/dist/display/select.d.ts +6 -0
  91. package/dist/display/select.js +38 -0
  92. package/dist/display/text-class.d.ts +23 -0
  93. package/dist/display/text-class.js +5 -0
  94. package/dist/display/text.d.ts +19 -0
  95. package/dist/display/text.js +8 -0
  96. package/dist/display/use-display-options.d.ts +2 -0
  97. package/dist/display/use-display-options.js +14 -0
  98. package/dist/display/user.d.ts +11 -0
  99. package/dist/display/user.js +10 -0
  100. package/dist/display/value-list.d.ts +10 -0
  101. package/dist/display/value-list.js +12 -0
  102. package/dist/display/viewer.d.ts +4 -0
  103. package/dist/display/viewer.js +11 -0
  104. package/dist/display/web-href.d.ts +8 -0
  105. package/dist/display/web-href.js +12 -0
  106. package/dist/editors/ChipsEditor.d.ts +59 -0
  107. package/dist/editors/ChipsEditor.js +73 -0
  108. package/dist/editors/DateEditor.d.ts +25 -0
  109. package/dist/editors/DateEditor.js +122 -0
  110. package/dist/editors/LocationEditor.d.ts +22 -0
  111. package/dist/editors/LocationEditor.js +228 -0
  112. package/dist/editors/NameEditor.d.ts +22 -0
  113. package/dist/editors/NameEditor.js +92 -0
  114. package/dist/editors/NumberEditor.d.ts +67 -0
  115. package/dist/editors/NumberEditor.js +86 -0
  116. package/dist/editors/RangeEditor.d.ts +22 -0
  117. package/dist/editors/RangeEditor.js +70 -0
  118. package/dist/editors/RelationEditor.d.ts +65 -0
  119. package/dist/editors/RelationEditor.js +64 -0
  120. package/dist/editors/SelectEditor.d.ts +72 -0
  121. package/dist/editors/SelectEditor.js +59 -0
  122. package/dist/editors/ValueListEditor.d.ts +38 -0
  123. package/dist/editors/ValueListEditor.js +217 -0
  124. package/dist/editors/edit-cores.d.ts +83 -0
  125. package/dist/editors/edit-cores.js +38 -0
  126. package/dist/editors/edit-session.d.ts +74 -0
  127. package/dist/editors/edit-session.js +35 -0
  128. package/dist/editors/open-values.d.ts +28 -0
  129. package/dist/editors/open-values.js +26 -0
  130. package/dist/editors/relation-source.d.ts +66 -0
  131. package/dist/editors/relation-source.js +102 -0
  132. package/dist/fields/binding.d.ts +87 -0
  133. package/dist/fields/binding.js +117 -0
  134. package/dist/fields/currency.d.ts +82 -0
  135. package/dist/fields/currency.js +41 -0
  136. package/dist/fields/denomination.d.ts +42 -0
  137. package/dist/fields/denomination.js +11 -0
  138. package/dist/fields/edit-core-types.d.ts +40 -0
  139. package/dist/fields/edit-core-types.js +29 -0
  140. package/dist/fields/format-knobs.d.ts +34 -0
  141. package/dist/fields/format-knobs.js +36 -0
  142. package/dist/fields/menus.d.ts +28 -0
  143. package/dist/fields/menus.js +1 -0
  144. package/dist/fields/money.d.ts +60 -0
  145. package/dist/fields/money.js +78 -0
  146. package/dist/fields/number-edit.d.ts +11 -0
  147. package/dist/fields/number-edit.js +17 -0
  148. package/dist/fields/prepare-write.d.ts +55 -0
  149. package/dist/fields/prepare-write.js +67 -0
  150. package/dist/fields/relation-source-types.d.ts +54 -0
  151. package/dist/fields/relation-source-types.js +1 -0
  152. package/dist/figures.d.ts +52 -0
  153. package/dist/figures.js +63 -0
  154. package/dist/filters/date-filter.d.ts +2 -0
  155. package/dist/filters/date-filter.js +1 -0
  156. package/dist/filters/filter-model.d.ts +176 -0
  157. package/dist/filters/filter-model.js +41 -0
  158. package/dist/filters/number-filter.d.ts +2 -0
  159. package/dist/filters/number-filter.js +1 -0
  160. package/dist/filters/range-filter.d.ts +2 -0
  161. package/dist/filters/range-filter.js +1 -0
  162. package/dist/filters/registry.d.ts +103 -0
  163. package/dist/filters/registry.js +8 -0
  164. package/dist/filters/relation-filter.d.ts +16 -0
  165. package/dist/filters/relation-filter.js +53 -0
  166. package/dist/filters/text-filter.d.ts +2 -0
  167. package/dist/filters/text-filter.js +1 -0
  168. package/dist/grid/chrome/GridAddColumn.d.ts +11 -0
  169. package/dist/grid/chrome/GridAddColumn.js +29 -0
  170. package/dist/grid/chrome/GridAggregateMenu.d.ts +31 -0
  171. package/dist/grid/chrome/GridAggregateMenu.js +27 -0
  172. package/dist/grid/chrome/GridCellEditors.d.ts +64 -0
  173. package/dist/grid/chrome/GridCellEditors.js +55 -0
  174. package/dist/grid/chrome/GridCellOutline.d.ts +70 -0
  175. package/dist/grid/chrome/GridCellOutline.js +21 -0
  176. package/dist/grid/chrome/GridChipsEditor.d.ts +28 -0
  177. package/dist/grid/chrome/GridChipsEditor.js +40 -0
  178. package/dist/grid/chrome/GridColumnColorSection.d.ts +11 -0
  179. package/dist/grid/chrome/GridColumnColorSection.js +40 -0
  180. package/dist/grid/chrome/GridColumnDateSection.d.ts +23 -0
  181. package/dist/grid/chrome/GridColumnDateSection.js +23 -0
  182. package/dist/grid/chrome/GridColumnDurationSection.d.ts +19 -0
  183. package/dist/grid/chrome/GridColumnDurationSection.js +24 -0
  184. package/dist/grid/chrome/GridColumnMenu.d.ts +101 -0
  185. package/dist/grid/chrome/GridColumnMenu.js +99 -0
  186. package/dist/grid/chrome/GridColumnNumberSection.d.ts +25 -0
  187. package/dist/grid/chrome/GridColumnNumberSection.js +27 -0
  188. package/dist/grid/chrome/GridColumnPercentSection.d.ts +15 -0
  189. package/dist/grid/chrome/GridColumnPercentSection.js +16 -0
  190. package/dist/grid/chrome/GridColumnSortSection.d.ts +18 -0
  191. package/dist/grid/chrome/GridColumnSortSection.js +16 -0
  192. package/dist/grid/chrome/GridDateEditor.d.ts +22 -0
  193. package/dist/grid/chrome/GridDateEditor.js +31 -0
  194. package/dist/grid/chrome/GridFlyout.d.ts +44 -0
  195. package/dist/grid/chrome/GridFlyout.js +80 -0
  196. package/dist/grid/chrome/GridFooter.d.ts +23 -0
  197. package/dist/grid/chrome/GridFooter.js +81 -0
  198. package/dist/grid/chrome/GridGroupMenu.d.ts +37 -0
  199. package/dist/grid/chrome/GridGroupMenu.js +57 -0
  200. package/dist/grid/chrome/GridHeader.d.ts +61 -0
  201. package/dist/grid/chrome/GridHeader.js +37 -0
  202. package/dist/grid/chrome/GridLongTextEditor.d.ts +36 -0
  203. package/dist/grid/chrome/GridLongTextEditor.js +127 -0
  204. package/dist/grid/chrome/GridMenuRow.d.ts +15 -0
  205. package/dist/grid/chrome/GridMenuRow.js +15 -0
  206. package/dist/grid/chrome/GridNameEditor.d.ts +19 -0
  207. package/dist/grid/chrome/GridNameEditor.js +36 -0
  208. package/dist/grid/chrome/GridNumberEditor.d.ts +35 -0
  209. package/dist/grid/chrome/GridNumberEditor.js +25 -0
  210. package/dist/grid/chrome/GridRangeEditor.d.ts +20 -0
  211. package/dist/grid/chrome/GridRangeEditor.js +25 -0
  212. package/dist/grid/chrome/GridRelationEditor.d.ts +21 -0
  213. package/dist/grid/chrome/GridRelationEditor.js +30 -0
  214. package/dist/grid/chrome/GridResizeHandle.d.ts +19 -0
  215. package/dist/grid/chrome/GridResizeHandle.js +19 -0
  216. package/dist/grid/chrome/GridRow.d.ts +25 -0
  217. package/dist/grid/chrome/GridRow.js +136 -0
  218. package/dist/grid/chrome/GridRowActions.d.ts +32 -0
  219. package/dist/grid/chrome/GridRowActions.js +25 -0
  220. package/dist/grid/chrome/GridRowCells.d.ts +4 -0
  221. package/dist/grid/chrome/GridRowCells.js +133 -0
  222. package/dist/grid/chrome/GridRowGlyph.d.ts +12 -0
  223. package/dist/grid/chrome/GridRowGlyph.js +13 -0
  224. package/dist/grid/chrome/GridSelectEditor.d.ts +18 -0
  225. package/dist/grid/chrome/GridSelectEditor.js +49 -0
  226. package/dist/grid/chrome/GridStructure.d.ts +48 -0
  227. package/dist/grid/chrome/GridStructure.js +45 -0
  228. package/dist/grid/chrome/GridTable.d.ts +4 -0
  229. package/dist/grid/chrome/GridTable.js +125 -0
  230. package/dist/grid/chrome/GridTableSurface.d.ts +15 -0
  231. package/dist/grid/chrome/GridTableSurface.js +6 -0
  232. package/dist/grid/chrome/GridTextEditor.d.ts +11 -0
  233. package/dist/grid/chrome/GridTextEditor.js +40 -0
  234. package/dist/grid/chrome/GridValueListEditor.d.ts +18 -0
  235. package/dist/grid/chrome/GridValueListEditor.js +36 -0
  236. package/dist/grid/chrome/StuckMarker.d.ts +16 -0
  237. package/dist/grid/chrome/StuckMarker.js +34 -0
  238. package/dist/grid/chrome/cell-clipboard.d.ts +9 -0
  239. package/dist/grid/chrome/cell-clipboard.js +28 -0
  240. package/dist/grid/chrome/cells.d.ts +21 -0
  241. package/dist/grid/chrome/cells.js +20 -0
  242. package/dist/grid/chrome/checks.d.ts +35 -0
  243. package/dist/grid/chrome/checks.js +22 -0
  244. package/dist/grid/chrome/column-glyph.d.ts +14 -0
  245. package/dist/grid/chrome/column-glyph.js +44 -0
  246. package/dist/grid/chrome/editors.d.ts +9 -0
  247. package/dist/grid/chrome/editors.js +10 -0
  248. package/dist/grid/chrome/grid-cell-classes.d.ts +59 -0
  249. package/dist/grid/chrome/grid-cell-classes.js +30 -0
  250. package/dist/grid/chrome/grid-menu-search.d.ts +7 -0
  251. package/dist/grid/chrome/grid-menu-search.js +7 -0
  252. package/dist/grid/chrome/grid-row-props.d.ts +131 -0
  253. package/dist/grid/chrome/grid-row-props.js +1 -0
  254. package/dist/grid/chrome/grid-styles.d.ts +37 -0
  255. package/dist/grid/chrome/grid-styles.js +8 -0
  256. package/dist/grid/chrome/grid-table-props.d.ts +173 -0
  257. package/dist/grid/chrome/grid-table-props.js +1 -0
  258. package/dist/grid/chrome/useGridBatchApi.d.ts +34 -0
  259. package/dist/grid/chrome/useGridBatchApi.js +35 -0
  260. package/dist/grid/chrome/useGridColumnLayout.d.ts +30 -0
  261. package/dist/grid/chrome/useGridColumnLayout.js +206 -0
  262. package/dist/grid/chrome/useGridHeaderDrag.d.ts +20 -0
  263. package/dist/grid/chrome/useGridHeaderDrag.js +37 -0
  264. package/dist/grid/chrome/useGridKeyboard.d.ts +47 -0
  265. package/dist/grid/chrome/useGridKeyboard.js +274 -0
  266. package/dist/grid/chrome/useGridPendingReconciliation.d.ts +12 -0
  267. package/dist/grid/chrome/useGridPendingReconciliation.js +32 -0
  268. package/dist/grid/chrome/useGridRailReveal.d.ts +57 -0
  269. package/dist/grid/chrome/useGridRailReveal.js +67 -0
  270. package/dist/grid/chrome/useGridRangeActions.d.ts +49 -0
  271. package/dist/grid/chrome/useGridRangeActions.js +188 -0
  272. package/dist/grid/chrome/useGridRangeGestures.d.ts +32 -0
  273. package/dist/grid/chrome/useGridRangeGestures.js +190 -0
  274. package/dist/grid/chrome/useGridRowContextMenu.d.ts +35 -0
  275. package/dist/grid/chrome/useGridRowContextMenu.js +127 -0
  276. package/dist/grid/chrome/useGridScaleStyles.d.ts +1 -0
  277. package/dist/grid/chrome/useGridScaleStyles.js +29 -0
  278. package/dist/grid/chrome/useGridScrollSync.d.ts +38 -0
  279. package/dist/grid/chrome/useGridScrollSync.js +176 -0
  280. package/dist/grid/chrome/useGridTableInteractionModel.d.ts +55 -0
  281. package/dist/grid/chrome/useGridTableInteractionModel.js +197 -0
  282. package/dist/grid/chrome/useGridTableSelection.d.ts +29 -0
  283. package/dist/grid/chrome/useGridTableSelection.js +55 -0
  284. package/dist/grid/chrome/useHeaderDragReorder.d.ts +21 -0
  285. package/dist/grid/chrome/useHeaderDragReorder.js +216 -0
  286. package/dist/grid/core/clipboard-model.d.ts +81 -0
  287. package/dist/grid/core/clipboard-model.js +291 -0
  288. package/dist/grid/core/column-values.d.ts +27 -0
  289. package/dist/grid/core/column-values.js +76 -0
  290. package/dist/grid/core/commit-model.d.ts +34 -0
  291. package/dist/grid/core/commit-model.js +3 -0
  292. package/dist/grid/core/coordinates.d.ts +48 -0
  293. package/dist/grid/core/coordinates.js +27 -0
  294. package/dist/grid/core/edit-values.d.ts +9 -0
  295. package/dist/grid/core/edit-values.js +1 -0
  296. package/dist/grid/core/editing-controller.d.ts +59 -0
  297. package/dist/grid/core/editing-controller.js +240 -0
  298. package/dist/grid/core/editing-model.d.ts +78 -0
  299. package/dist/grid/core/editing-model.js +136 -0
  300. package/dist/grid/core/grid-scale.d.ts +14 -0
  301. package/dist/grid/core/grid-scale.js +8 -0
  302. package/dist/grid/core/nav.d.ts +94 -0
  303. package/dist/grid/core/nav.js +92 -0
  304. package/dist/grid/core/pending-reconciliation.d.ts +50 -0
  305. package/dist/grid/core/pending-reconciliation.js +49 -0
  306. package/dist/grid/core/range-model.d.ts +25 -0
  307. package/dist/grid/core/range-model.js +59 -0
  308. package/dist/grid/core/spreadsheet-operations.d.ts +85 -0
  309. package/dist/grid/core/spreadsheet-operations.js +253 -0
  310. package/dist/grid/core/useGridEditing.d.ts +43 -0
  311. package/dist/grid/core/useGridEditing.js +90 -0
  312. package/dist/grid/core/useGridRange.d.ts +20 -0
  313. package/dist/grid/core/useGridRange.js +24 -0
  314. package/dist/grid/core/value-equality.d.ts +32 -0
  315. package/dist/grid/core/value-equality.js +34 -0
  316. package/dist/grid/index.d.ts +18 -0
  317. package/dist/grid/index.js +5 -0
  318. package/dist/grid/useGridTablePrefs.d.ts +50 -0
  319. package/dist/grid/useGridTablePrefs.js +101 -0
  320. package/dist/grouping/sort-groups.d.ts +18 -0
  321. package/dist/grouping/sort-groups.js +33 -0
  322. package/dist/grouping/types.d.ts +10 -0
  323. package/dist/grouping/types.js +1 -0
  324. package/dist/index.d.ts +28 -0
  325. package/dist/index.js +28 -0
  326. package/dist/internal/chip.d.ts +4 -0
  327. package/dist/internal/chip.js +3 -0
  328. package/dist/internal/cx.d.ts +3 -0
  329. package/dist/internal/cx.js +3 -0
  330. package/dist/internal/viewport.d.ts +5 -0
  331. package/dist/internal/viewport.js +29 -0
  332. package/dist/model/aggregates.d.ts +59 -0
  333. package/dist/model/aggregates.js +186 -0
  334. package/dist/model/card-density.d.ts +8 -0
  335. package/dist/model/card-density.js +10 -0
  336. package/dist/model/card-layout.d.ts +85 -0
  337. package/dist/model/card-layout.js +90 -0
  338. package/dist/model/column-capabilities.d.ts +162 -0
  339. package/dist/model/column-capabilities.js +233 -0
  340. package/dist/model/column-filters.d.ts +106 -0
  341. package/dist/model/column-filters.js +321 -0
  342. package/dist/model/column-format.d.ts +103 -0
  343. package/dist/model/column-format.js +1 -0
  344. package/dist/model/column-from.d.ts +28 -0
  345. package/dist/model/column-from.js +160 -0
  346. package/dist/model/column-inspect.d.ts +18 -0
  347. package/dist/model/column-inspect.js +6 -0
  348. package/dist/model/column-knobs.d.ts +20 -0
  349. package/dist/model/column-knobs.js +16 -0
  350. package/dist/model/column-money.d.ts +13 -0
  351. package/dist/model/column-money.js +27 -0
  352. package/dist/model/column-order.d.ts +36 -0
  353. package/dist/model/column-order.js +68 -0
  354. package/dist/model/column-schema.d.ts +335 -0
  355. package/dist/model/column-schema.js +1 -0
  356. package/dist/model/column-sort.d.ts +17 -0
  357. package/dist/model/column-sort.js +11 -0
  358. package/dist/model/column-state.d.ts +77 -0
  359. package/dist/model/column-state.js +95 -0
  360. package/dist/model/column-types.d.ts +109 -0
  361. package/dist/model/column-types.js +50 -0
  362. package/dist/model/column-warnings.d.ts +44 -0
  363. package/dist/model/column-warnings.js +24 -0
  364. package/dist/model/density.d.ts +3 -0
  365. package/dist/model/density.js +13 -0
  366. package/dist/model/field-type-of.d.ts +21 -0
  367. package/dist/model/field-type-of.js +11 -0
  368. package/dist/model/filter-capabilities.d.ts +1 -0
  369. package/dist/model/filter-capabilities.js +1 -0
  370. package/dist/model/index.d.ts +38 -0
  371. package/dist/model/index.js +20 -0
  372. package/dist/model/part-rows.d.ts +28 -0
  373. package/dist/model/part-rows.js +40 -0
  374. package/dist/model/preferences.d.ts +155 -0
  375. package/dist/model/preferences.js +84 -0
  376. package/dist/model/prefs-buckets.d.ts +173 -0
  377. package/dist/model/prefs-buckets.js +71 -0
  378. package/dist/model/relation-filters.d.ts +45 -0
  379. package/dist/model/relation-filters.js +78 -0
  380. package/dist/model/render-count.d.ts +2 -0
  381. package/dist/model/render-count.js +24 -0
  382. package/dist/model/row-icon.d.ts +23 -0
  383. package/dist/model/row-icon.js +5 -0
  384. package/dist/model/view-rules.d.ts +73 -0
  385. package/dist/model/view-rules.js +216 -0
  386. package/dist/provider/ViewsProvider.d.ts +26 -0
  387. package/dist/provider/ViewsProvider.js +16 -0
  388. package/dist/provider/components.d.ts +230 -0
  389. package/dist/provider/components.js +3 -0
  390. package/dist/provider/context.d.ts +20 -0
  391. package/dist/provider/context.js +10 -0
  392. package/dist/provider/icons.d.ts +6 -0
  393. package/dist/provider/icons.js +1 -0
  394. package/dist/provider/menu-groups.d.ts +8 -0
  395. package/dist/provider/menu-groups.js +38 -0
  396. package/dist/provider/ports.d.ts +57 -0
  397. package/dist/provider/ports.js +9 -0
  398. package/dist/react.d.ts +9 -0
  399. package/dist/react.js +4 -0
  400. package/dist/selection/SelectCheckbox.d.ts +17 -0
  401. package/dist/selection/SelectCheckbox.js +11 -0
  402. package/dist/selection/index.d.ts +7 -0
  403. package/dist/selection/index.js +6 -0
  404. package/dist/selection/model.d.ts +55 -0
  405. package/dist/selection/model.js +86 -0
  406. package/dist/selection/row-click.d.ts +35 -0
  407. package/dist/selection/row-click.js +20 -0
  408. package/dist/selection/types.d.ts +17 -0
  409. package/dist/selection/types.js +1 -0
  410. package/dist/selection/useCheckDragSelect.d.ts +61 -0
  411. package/dist/selection/useCheckDragSelect.js +165 -0
  412. package/dist/selection/useListSelection.d.ts +39 -0
  413. package/dist/selection/useListSelection.js +48 -0
  414. package/dist/selection/useListSelectionShortcuts.d.ts +6 -0
  415. package/dist/selection/useListSelectionShortcuts.js +14 -0
  416. package/dist/selection/useRestIntent.d.ts +18 -0
  417. package/dist/selection/useRestIntent.js +35 -0
  418. package/docs/contract.md +525 -0
  419. package/docs/getting-started.md +250 -0
  420. package/docs/guides/atoms.md +245 -0
  421. package/docs/guides/cells.md +302 -0
  422. package/docs/guides/columns.md +412 -0
  423. package/docs/guides/display.md +203 -0
  424. package/docs/guides/editors.md +404 -0
  425. package/docs/guides/ports.md +246 -0
  426. package/docs/guides/selection.md +270 -0
  427. package/docs/guides/the-grid.md +677 -0
  428. package/docs/guides/the-provider.md +446 -0
  429. package/docs/index.md +50 -0
  430. package/docs/install.md +67 -0
  431. package/docs/reference/cells.md +28 -0
  432. package/docs/reference/display.md +42 -0
  433. package/docs/reference/editors-chips.md +6 -0
  434. package/docs/reference/editors-date.md +6 -0
  435. package/docs/reference/editors-location.md +10 -0
  436. package/docs/reference/editors-name.md +6 -0
  437. package/docs/reference/editors-number.md +11 -0
  438. package/docs/reference/editors-open-values.md +9 -0
  439. package/docs/reference/editors-range.md +6 -0
  440. package/docs/reference/editors-relation.md +9 -0
  441. package/docs/reference/editors-select.md +8 -0
  442. package/docs/reference/editors-session.md +9 -0
  443. package/docs/reference/editors-value-list.md +6 -0
  444. package/docs/reference/editors.md +5 -0
  445. package/docs/reference/grid.md +39 -0
  446. package/docs/reference/react.md +86 -0
  447. package/docs/reference/selection.md +33 -0
  448. package/docs/reference/views.md +601 -0
  449. package/docs/reshaping.md +19 -0
  450. package/package.json +118 -3
  451. package/skills/views/SKILL.md +102 -0
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEffect, useRef } from "react";
4
+ export function StuckMarker() {
5
+ const ref = useRef(null);
6
+ useEffect(() => {
7
+ const marker = ref.current;
8
+ const header = marker?.nextElementSibling;
9
+ if (!marker || !header)
10
+ return;
11
+ let raf = 0;
12
+ const apply = () => {
13
+ raf = 0;
14
+ const stuck = header.getBoundingClientRect().top - marker.getBoundingClientRect().top > 0.5;
15
+ if ((header.dataset.stuck === "true") !== stuck)
16
+ header.dataset.stuck = String(stuck);
17
+ };
18
+ const schedule = () => {
19
+ if (!raf)
20
+ raf = requestAnimationFrame(apply);
21
+ };
22
+ apply();
23
+ window.addEventListener("scroll", schedule, true);
24
+ window.addEventListener("resize", schedule);
25
+ return () => {
26
+ window.removeEventListener("scroll", schedule, true);
27
+ window.removeEventListener("resize", schedule);
28
+ if (raf)
29
+ cancelAnimationFrame(raf);
30
+ delete header.dataset.stuck;
31
+ };
32
+ }, []);
33
+ return _jsx("div", { ref: ref, "aria-hidden": true, className: "h-0" });
34
+ }
@@ -0,0 +1,9 @@
1
+ import type { ViewsClipboardPort } from "../../provider/ports.js";
2
+ import { type GridCellClipboard, type GridClipboardCell } from "../core/clipboard-model.js";
3
+ import type { ListColumn } from "../../model/column-schema.js";
4
+ export { cellClearPrev, cellEditBaseline, cellPrevPayload, rowHoldsCurrency, coercePaste, parseTsvText, type GridPasteSource, } from "../core/clipboard-model.js";
5
+ export declare function getGridClipboard(): GridCellClipboard | null;
6
+ /** Puts one cell's text on the system clipboard through the app's port, and keeps the typed entry
7
+ * the grid pastes from — which survives a refused system write. */
8
+ export declare function copyCell<Row>(write: ViewsClipboardPort["writeText"], col: ListColumn<Row>, baseline: unknown, unit?: string): Promise<string>;
9
+ export declare function copyCells(write: ViewsClipboardPort["writeText"], matrix: GridClipboardCell[][]): Promise<string>;
@@ -0,0 +1,28 @@
1
+ import { cellCopyText, serializeClipboardMatrix, } from "../core/clipboard-model.js";
2
+ export { cellClearPrev, cellEditBaseline, cellPrevPayload, rowHoldsCurrency, coercePaste, parseTsvText, } from "../core/clipboard-model.js";
3
+ let clipboard = null;
4
+ export function getGridClipboard() {
5
+ return clipboard;
6
+ }
7
+ export async function copyCell(write, col, baseline, unit) {
8
+ const text = cellCopyText(col, baseline);
9
+ clipboard = { text, value: baseline, type: col.type, unit };
10
+ try {
11
+ await write(text);
12
+ }
13
+ catch {
14
+ }
15
+ return text;
16
+ }
17
+ export async function copyCells(write, matrix) {
18
+ if (matrix.length === 0 || matrix[0].length === 0)
19
+ return "";
20
+ const text = serializeClipboardMatrix(matrix);
21
+ clipboard = { ...matrix[0][0], text, matrix };
22
+ try {
23
+ await write(text);
24
+ }
25
+ catch {
26
+ }
27
+ return text;
28
+ }
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from "react";
2
+ import type { GridCellOptions } from "../../cells/cell-format.js";
3
+ import type { ListColumn } from "../../model/column-schema.js";
4
+ export { formatDate, formatNumber } from "../../cells/cell-format.js";
5
+ /**
6
+ * Renders a typed cell, then appends the column's `indicator` if it has one.
7
+ *
8
+ * `indicator` is declared on EVERY column in the schema but used to be read only
9
+ * inside the `title` branch — so it looked generic and was honoured by exactly
10
+ * one type. That gap is why a column needing a per-row adornment (Subscriptions'
11
+ * next-charge urgency) reached for a full custom `render` instead, throwing away
12
+ * the typed renderer's date formatting and hover tooltip to get it.
13
+ *
14
+ * `title` still places its own indicator: its cell has layout rules about where
15
+ * the click target ends, and the adornment has to sit inside them.
16
+ */
17
+ export declare function renderTypedCell<Row>(col: ListColumn<Row>, row: Row, opts?: GridCellOptions): ReactNode;
18
+ /** Renders an `action` column's cell — a centered row of icon buttons. Real
19
+ * `<button>`s so GridRow's click contract treats them as interactive (the row
20
+ * does not open / select on an action click). */
21
+ export declare function renderActionCell<Row>(col: ListColumn<Row>, row: Row): ReactNode;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cx } from "../../internal/cx.js";
4
+ import { GridActionButton } from "./GridRowActions.js";
5
+ import { renderTypedCellValue } from "../../cells/cell-values.js";
6
+ export { formatDate, formatNumber } from "../../cells/cell-format.js";
7
+ export function renderTypedCell(col, row, opts) {
8
+ const cell = renderTypedCellValue(col, row, opts);
9
+ if (col.type === "title")
10
+ return cell;
11
+ const indicator = col.indicator?.(row);
12
+ if (!indicator)
13
+ return cell;
14
+ return (_jsxs("span", { className: cx("flex min-w-0 flex-1 flex-wrap content-start items-center gap-x-1.5 overflow-hidden", !opts?.wrap && "h-(--vk-line-h) leading-(--vk-line-h)"), children: [_jsx("span", { className: cx("max-w-full", opts?.wrap ? "min-w-0" : "flex-none truncate"), children: cell }), indicator] }));
15
+ }
16
+ export function renderActionCell(col, row) {
17
+ if (!col.actions?.length)
18
+ return null;
19
+ return (_jsx("span", { className: "flex items-center justify-center gap-1", children: col.actions.map((a) => (_jsx(GridActionButton, { variant: "bare", label: a.label?.(row), onClick: a.onClick ? () => a.onClick?.(row) : undefined, children: a.icon(row) }, a.id))) }));
20
+ }
@@ -0,0 +1,35 @@
1
+ /** Empty rail segment — keeps the opaque lane continuous across the header and
2
+ * footer rows, which have no checkbox of their own. `bordered` follows whether
3
+ * that surface's own cells draw a bottom rule: the header's do, the footer's
4
+ * don't. */
5
+ export declare function GridRailSpacer({ selecting, bordered, }: {
6
+ selecting: boolean;
7
+ bordered?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ /** Row checkbox — reveals while the row (`group/gridrow`) is hovered. */
10
+ export declare function GridRowCheck({ selecting, checked, revealed, onChange, "aria-label": ariaLabel, }: {
11
+ selecting: boolean;
12
+ checked: boolean;
13
+ revealed: boolean;
14
+ onChange: (next: boolean, shift: boolean) => void;
15
+ "aria-label"?: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ /**
18
+ * Select-all / group checkbox — the SAME rail slot the rows use, mounted as the
19
+ * header's leading track rather than as an overlay beside it.
20
+ *
21
+ * It used to be a page-anchored overlay, on the reasoning that the header strip
22
+ * sits outside the scrollers and its cells were slid by JS, so a checkbox in the
23
+ * flow would have had to be counter-translated. Both halves of that stopped
24
+ * being true: the strip is a real scroll container now, and the rail travels
25
+ * with its row instead of standing still. An overlay would be the one piece of
26
+ * leading chrome that didn't move — parked at a fixed x while every row's
27
+ * checkbox slid away from it and stopped somewhere else.
28
+ */
29
+ export declare function GridHeadCheck({ selecting, allSelected, someSelected, onToggle, "aria-label": ariaLabel, }: {
30
+ selecting: boolean;
31
+ allSelected: boolean;
32
+ someSelected: boolean;
33
+ onToggle: (next: boolean) => void;
34
+ "aria-label"?: string;
35
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useViews } from "../../provider/context.js";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { gridFrozenBg } from "./GridCellOutline.js";
6
+ import { GRID_GROUND } from "./grid-styles.js";
7
+ import { SelectCheckbox } from "../../selection/SelectCheckbox.js";
8
+ function RailSlot({ selecting, selected = false, bordered = false, children, }) {
9
+ return (_jsx("div", { "data-slot": "vk-grid-rail", className: "sticky left-(--vk-rail-w) z-10 h-full", "data-action-menu": true, onClick: (e) => e.stopPropagation(), children: _jsxs("div", { "data-row-check": selecting ? "" : undefined, className: cx("relative flex h-full w-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] -translate-x-full items-start justify-end", "pr-[calc(var(--vk-rail-gap)+((var(--vk-rail-w)-16px)/2-var(--vk-rail-gap))*var(--vk-parked,0)*(1-var(--vk-frozen-on,0)))]", "transition-[padding-right] duration-150"), children: [_jsx("span", { "aria-hidden": true, className: cx("absolute inset-0", gridFrozenBg(selected), "opacity-(--vk-frozen-on,0) transition-opacity duration-150", "group-data-[rail=on]/gridtable:opacity-100") }), bordered && (_jsx("span", { "aria-hidden": true, className: cx("pointer-events-none absolute inset-x-0 bottom-0 h-px bg-(color:--vk-border-subtle) transition-opacity duration-150", "opacity-[calc(var(--vk-parked,0)*var(--vk-frozen-on,0))]", "group-data-[rail=on]/gridtable:opacity-(--vk-parked,0)") })), children ? (_jsx("span", { "data-row-check": true, className: "relative flex h-(--vk-chrome-h,100%) items-center", children: children })) : null] }) }));
10
+ }
11
+ export function GridRailSpacer({ selecting, bordered = false, }) {
12
+ return _jsx(RailSlot, { selecting: selecting, bordered: bordered });
13
+ }
14
+ export function GridRowCheck({ selecting, checked, revealed, onChange, "aria-label": ariaLabel, }) {
15
+ return (_jsx(RailSlot, { selecting: selecting, selected: checked, bordered: true, children: _jsx(SelectCheckbox, { checked: checked, revealed: revealed, onChange: onChange, "aria-label": ariaLabel, className: cx(GRID_GROUND, "transition-opacity duration-150 group-hover/gridrow:opacity-100 group-data-[rail=on]/gridtable:opacity-100") }) }));
16
+ }
17
+ export function GridHeadCheck({ selecting, allSelected, someSelected, onToggle, "aria-label": ariaLabel, }) {
18
+ const { Checkbox } = useViews().components;
19
+ return (_jsx(RailSlot, { selecting: selecting, bordered: true, children: _jsx(Checkbox, { checked: allSelected, indeterminate: !allSelected && someSelected, onCheckedChange: (next) => onToggle(next), "aria-label": ariaLabel, partialTone: "brand", className: cx(cx(GRID_GROUND, "transition-opacity duration-150"), selecting || allSelected || someSelected
20
+ ? "opacity-100"
21
+ : "opacity-0 group-hover/gridhead:opacity-100 group-data-[rail=on]/gridtable:opacity-100") }) }));
22
+ }
@@ -0,0 +1,14 @@
1
+ import type { ComponentType, ReactNode } from "react";
2
+ import type { ListColumn } from "../../model/column-schema.js";
3
+ import type { ViewsIcons } from "../../provider/icons.js";
4
+ type GridGlyphs = {
5
+ icons: ViewsIcons;
6
+ AppIcon: ComponentType<{
7
+ name: string;
8
+ className?: string;
9
+ }>;
10
+ };
11
+ /** The column's glyph: its explicit `icon` → its binding's glyph → its field's type → a computed
12
+ * column's mark → its list type's → nothing. */
13
+ export declare function gridColumnGlyph<Row>({ icons, AppIcon }: GridGlyphs, col: ListColumn<Row>, className?: string): ReactNode;
14
+ export {};
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ const LIST_TYPE_GLYPHS = {
4
+ title: "text",
5
+ status: "status",
6
+ text: "text",
7
+ number: "number",
8
+ percent: "percent",
9
+ currency: "currency",
10
+ date: "date",
11
+ datetime: "datetime",
12
+ select: "select",
13
+ multiselect: "multiselect",
14
+ boolean: "boolean",
15
+ relation: "relation",
16
+ user: "user",
17
+ url: "url",
18
+ domain: "domain",
19
+ email: "email",
20
+ phone: "phone",
21
+ location: "location",
22
+ name: "name",
23
+ actor: "actor",
24
+ rich_text: "rich_text",
25
+ range: "range",
26
+ };
27
+ export function gridColumnGlyph({ icons, AppIcon }, col, className = "h-3.5 w-3.5 shrink-0 opacity-70") {
28
+ if (col.icon)
29
+ return col.icon;
30
+ if (col.binding?.icon)
31
+ return _jsx(AppIcon, { name: col.binding.icon, className: className });
32
+ if (col.field) {
33
+ const Glyph = icons[col.field.type];
34
+ return _jsx(Glyph, { className: className });
35
+ }
36
+ if (col.custom) {
37
+ const Glyph = icons.computed;
38
+ return _jsx(Glyph, { className: className });
39
+ }
40
+ if (!col.type)
41
+ return null;
42
+ const Glyph = icons[LIST_TYPE_GLYPHS[col.type]];
43
+ return _jsx(Glyph, { className: className });
44
+ }
@@ -0,0 +1,9 @@
1
+ export { gridColumnHasEditor, gridEditorKind } from "../../model/column-capabilities.js";
2
+ export { GridTextEditor } from "./GridTextEditor.js";
3
+ export { GridLongTextEditor } from "./GridLongTextEditor.js";
4
+ export { GridSelectEditor } from "./GridSelectEditor.js";
5
+ export { GridChipsEditor } from "./GridChipsEditor.js";
6
+ export { GridNumberEditor } from "./GridNumberEditor.js";
7
+ export { GridRangeEditor } from "./GridRangeEditor.js";
8
+ export { GridDateEditor } from "./GridDateEditor.js";
9
+ export { GridRelationEditor } from "./GridRelationEditor.js";
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ export { gridColumnHasEditor, gridEditorKind } from "../../model/column-capabilities.js";
3
+ export { GridTextEditor } from "./GridTextEditor.js";
4
+ export { GridLongTextEditor } from "./GridLongTextEditor.js";
5
+ export { GridSelectEditor } from "./GridSelectEditor.js";
6
+ export { GridChipsEditor } from "./GridChipsEditor.js";
7
+ export { GridNumberEditor } from "./GridNumberEditor.js";
8
+ export { GridRangeEditor } from "./GridRangeEditor.js";
9
+ export { GridDateEditor } from "./GridDateEditor.js";
10
+ export { GridRelationEditor } from "./GridRelationEditor.js";
@@ -0,0 +1,59 @@
1
+ import type { FieldSettlement } from "@viewkitjs/fields";
2
+ /**
3
+ * One body cell's class string.
4
+ *
5
+ * Extracted from `GridRowCells` because that file is held under the line ceiling
6
+ * and the policy there is split, not raise — and because this is the one part
7
+ * of the cell that is pure: a dozen booleans in, a string out. That makes the
8
+ * geometry testable without rendering a grid, which matters most for the wrap
9
+ * mode, whose whole contract is "the unwrapped string is unchanged".
10
+ */
11
+ export type GridCellClassState = {
12
+ align?: "left" | "center" | "right";
13
+ /** The title column: an ordinary cell that holds the row-open hotspot (its
14
+ * rendered text), which the cell dresses as a link. */
15
+ isTitle: boolean;
16
+ /** Pinned to the left edge (inside the frozen block). */
17
+ frozen: boolean;
18
+ focused: boolean;
19
+ editing: boolean;
20
+ /** Inside the active multi-cell range. */
21
+ inRange: boolean;
22
+ /** The row is selected (frozen cells repaint the selection tint). */
23
+ selected: boolean;
24
+ /** Last visible column — its right border is always transparent. */
25
+ lastColumn: boolean;
26
+ verticalBorders: boolean;
27
+ /** Wrap mode: the cell grows with its content instead of clipping to one
28
+ * line, and its text top-aligns so line one still reads across the row. */
29
+ wrap: boolean;
30
+ /** The value is saved here but its provider has not accepted it yet (spec
31
+ * §11.2) — the one pending state the grid draws, beside `data-settlement`. */
32
+ settlement?: Extract<FieldSettlement, "requested">;
33
+ };
34
+ /** The row-open hotspot inside a title cell, dressed as a link on its own hover. */
35
+ export declare const GRID_TITLE_LINK_CLASS = "**:data-cell-open:underline-offset-2 [&_[data-cell-open]:hover]:text-(color:--vk-fg-brand) [&_[data-cell-open]:hover]:underline";
36
+ /** A ranged cell's tint: it covers the cell and reaches 1px past its trailing edges, bridging the
37
+ * hairlines between cells into one surface. `-z-1` lays it under the cell's value and over the
38
+ * cell's own ground, inside the stacking context every ranged cell is (its z, or sticky). */
39
+ export declare const GRID_RANGE_TINT_CLASS = "pointer-events-none absolute left-0 top-0 -bottom-px -right-px -z-1 bg-(color:--vk-brand-subtlest)";
40
+ export declare function gridCellClassName(state: GridCellClassState): string;
41
+ /** The row's own classes. A SELECTED row hovers brand, not neutral: hover and selected both write
42
+ * background-image, so the neutral tint would replace the selection, and the row would grey out
43
+ * under the pointer exactly where it should feel most active. A doubled brand mix keeps the hover
44
+ * a clear step up in the same colour. The host's class is the row's last word, as it was under the
45
+ * merge: where it paints the row's own ground (Domains' unregistered rows), the selected tint
46
+ * stands aside for it — only that one property conflicts; the hover is an image.
47
+ *
48
+ * The row owns the page gutter (px) — the checkbox reveals inside it at left-0 — so the table's
49
+ * left edge stays aligned with the page content; pl includes --vk-indent (grouped tables shift
50
+ * right as one unit). The hover tint is FLAT and full-bleed, a one-stop background-IMAGE rather
51
+ * than a colour so it layers OVER the selected ground; the same string as GRID_FROZEN_HOVER, so
52
+ * pinned and scrolling cells tint the same. In wrap mode `--vk-chrome-h` becomes the first-line
53
+ * strip, so the checkbox lane and the title's hover actions sit beside line one. */
54
+ export declare function gridRowClassName(state: {
55
+ selected: boolean;
56
+ selectable: boolean;
57
+ wrapCells: boolean;
58
+ hostClass?: string;
59
+ }): string;
@@ -0,0 +1,30 @@
1
+ import { ROW_NO_TEXT_SELECT } from "../../selection/row-click.js";
2
+ import { cx } from "../../internal/cx.js";
3
+ import { GRID_CELL_HOVER_SHADOW, gridFrozenBg } from "./GridCellOutline.js";
4
+ import { GRID_GROUND } from "./grid-styles.js";
5
+ const GRID_CELL_REQUESTED = "italic opacity-80";
6
+ export const GRID_TITLE_LINK_CLASS = "**:data-cell-open:underline-offset-2 [&_[data-cell-open]:hover]:text-(color:--vk-fg-brand) [&_[data-cell-open]:hover]:underline";
7
+ export const GRID_RANGE_TINT_CLASS = "pointer-events-none absolute left-0 top-0 -bottom-px -right-px -z-1 bg-(color:--vk-brand-subtlest)";
8
+ export function gridCellClassName(state) {
9
+ const { focused, editing, inRange, frozen, selected, wrap } = state;
10
+ return cx(state.settlement === "requested" && GRID_CELL_REQUESTED, "group/gridcell", "flex min-w-0 border-b border-r border-(color:--vk-border-subtle) px-(--vk-px) text-(length:--vk-text)", wrap
11
+ ? "min-h-(--vk-row-h) items-start py-(--vk-cell-py) leading-(--vk-line-h) [&>*:not(.absolute)]:min-h-(--vk-line-h)"
12
+ : "h-(--vk-row-h) items-center whitespace-nowrap", "scroll-mt-(--vk-scroll-mt)", "scroll-ml-[calc(var(--vk-rail-w)+var(--vk-frozen-w,0px))]", (!state.verticalBorders || state.lastColumn) && "border-r-transparent", state.align === "right" && "justify-end text-right tabular-nums", state.align === "center" && "justify-center text-center", frozen ? "sticky" : "relative", focused || editing || inRange ? "overflow-visible" : "overflow-hidden", frozen
13
+ ? focused || editing
14
+ ? "z-9"
15
+ : inRange
16
+ ? "z-[calc(8*var(--vk-scrolled,0))]"
17
+ : "z-[calc(7*var(--vk-scrolled,0))]"
18
+ : focused || editing
19
+ ? "z-5"
20
+ : inRange
21
+ ? "z-4"
22
+ : undefined, frozen && gridFrozenBg(selected), editing && GRID_GROUND, !focused && !editing && !inRange && !state.isTitle && GRID_CELL_HOVER_SHADOW, state.isTitle && GRID_TITLE_LINK_CLASS);
23
+ }
24
+ export function gridRowClassName(state) {
25
+ const { selected, selectable, wrapCells, hostClass } = state;
26
+ const hostPaintsGround = hostClass != null && /(?:^|\s)bg-/.test(hostClass);
27
+ return cx("group/gridrow relative grid cursor-pointer pl-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] pr-(--vk-gutter,0px)", selectable && ROW_NO_TEXT_SELECT, wrapCells && "[--vk-chrome-h:var(--vk-row-h)]", selected
28
+ ? "hover:bg-[linear-gradient(color-mix(in_oklab,_var(--vk-brand)_10%,_transparent),color-mix(in_oklab,_var(--vk-brand)_10%,_transparent))]"
29
+ : "hover:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered))]", selected && !hostPaintsGround && "bg-(color:--vk-brand-subtlest)", hostClass);
30
+ }
@@ -0,0 +1,7 @@
1
+ /** How many options a grid menu lists before it offers a search: a group band's Sort rows. */
2
+ export declare const GRID_MENU_SEARCH_AFTER = 8;
3
+ /** The options a grid menu lists for a search: every one while the search is empty, else those whose label
4
+ * holds it. */
5
+ export declare function matchMenuOptions<O extends {
6
+ label: string;
7
+ }>(options: readonly O[], query: string): O[];
@@ -0,0 +1,7 @@
1
+ export const GRID_MENU_SEARCH_AFTER = 8;
2
+ export function matchMenuOptions(options, query) {
3
+ const needle = query.trim().toLowerCase();
4
+ if (!needle)
5
+ return [...options];
6
+ return options.filter((option) => option.label.toLowerCase().includes(needle));
7
+ }
@@ -0,0 +1,131 @@
1
+ import type { ReactNode } from "react";
2
+ import type { ViewsRowMenuItem } from "../../atoms/types.js";
3
+ import type { FieldMenus } from "../../fields/menus.js";
4
+ import type { ListSettingsConfig } from "../../model/column-capabilities.js";
5
+ import type { ListCellAction, ListColumn, ListOptionColorOverrides, ListRelationValue } from "../../model/column-schema.js";
6
+ import type { ListDateStyleOverrides, ListDurationStyleOverrides, ListNumberFormatOverrides, ListPercentDisplayOverrides, ListShowTimeOverrides } from "../../model/column-format.js";
7
+ import type { ListRowIconAccessor } from "../../model/row-icon.js";
8
+ import type { GridRowRangeSpan } from "../core/useGridRange.js";
9
+ export type GridRowProps<Row> = {
10
+ row: Row;
11
+ /** The DATA id — what a write, the optimistic overlay and selection address.
12
+ * Shared by every copy of a row that is drawn more than once. */
13
+ id: string;
14
+ /** This RENDERED row's identity, unique even when the same record is drawn
15
+ * under several groups. Focus, the editor, arrows and ranges are in terms of
16
+ * it; see `GridCellPos`. */
17
+ rowKey: string;
18
+ gridTemplate: string;
19
+ columns: ListColumn<Row>[];
20
+ selectable: boolean;
21
+ selected: boolean;
22
+ /** The row directly above in the SAME rendered list is selected. Every
23
+ * selected row draws its own BOTTOM rule; the top one is drawn only to CAP a
24
+ * run, which is what leaves exactly one line at each boundary — with both
25
+ * ends unconditional, two adjacent rows would land a rule each on
26
+ * neighbouring pixels and read as a 2px line. Plain boolean on purpose: this
27
+ * row is `memo()`d with no comparator. */
28
+ selectedAbove: boolean;
29
+ selecting: boolean;
30
+ toggle: (id: string, next?: boolean) => void;
31
+ toggleRange: (id: string) => void;
32
+ contextMenu?: (row: Row) => ViewsRowMenuItem[];
33
+ rowClassName?: (row: Row) => string | undefined;
34
+ rowHref?: (row: Row) => string | undefined;
35
+ onOpenRow: (row: Row) => void;
36
+ onPrefetchRow?: (row: Row) => void;
37
+ onRowDelete?: (id: string) => Promise<void>;
38
+ deleteLabel?: string;
39
+ /** Per-row actions in the title cell's hover lane, before the built-in Edit. */
40
+ rowActions?: ListCellAction<Row>[];
41
+ /** Leading ICON at the START of the title cell — a bare glyph, never an
42
+ * avatar component (see GridTableProps.rowIcon). Undefined = the user
43
+ * turned the "Row icon" toggle off, or the list has no icon to draw. */
44
+ rowIcon?: ListRowIconAccessor<Row>;
45
+ verticalBorders?: boolean;
46
+ /** Cells wrap to at most 3 lines and the row grows to its tallest cell. */
47
+ wrapCells?: boolean;
48
+ optionColors?: ListOptionColorOverrides;
49
+ dateStyles?: ListDateStyleOverrides;
50
+ /** Per-field duration rendering (override → `format.durationStyle` → adaptive). */
51
+ durationStyles?: ListDurationStyleOverrides;
52
+ /** Per-field decimals / display-currency (host-owned, from the header menu). */
53
+ numberFormats?: ListNumberFormatOverrides;
54
+ /** Per-field show-time overrides for date columns. */
55
+ showTimeOverrides?: ListShowTimeOverrides;
56
+ /** Per-field percent drawing (text, bar, ring). */
57
+ percentDisplays?: ListPercentDisplayOverrides;
58
+ /** The grid has a commit handler — cells with editors may enter edit mode. */
59
+ editingEnabled: boolean;
60
+ /** Focused/editing column id — null unless it's THIS row's cell. */
61
+ focusedColId: string | null;
62
+ editingColId: string | null;
63
+ /** columnId → optimistic pending value (undefined when this row has none). */
64
+ pendingByCol?: Record<string, unknown>;
65
+ /** columnId → `requested` for a pending value saved here but not yet accepted
66
+ * by the provider that owns it (spec §11.2) — drawn as the cell's pending state. */
67
+ settlementByCol?: Record<string, "requested">;
68
+ /** columnId → option values for status/select editors (declared + discovered).
69
+ * One memo-stable object shared by every row. */
70
+ selectValues?: Record<string, string[]>;
71
+ /** THIS row's slices of the 2D range selection (visible-column indices),
72
+ * memo-stable (GridTable caches identity per row). Undefined when no
73
+ * multi-cell range touches the row — the common case renders as before. */
74
+ rowRange?: GridRowRangeSpan[];
75
+ /** How many LEADING columns are pinned to the left edge. A plain number, so a
76
+ * memoized row doesn't re-render on every scroll; the row computes its own
77
+ * sticky offsets from it. 0 = nothing frozen. */
78
+ frozenCount?: number;
79
+ /** Sticky `left` for the frozen column at visible index i — a calc() over the
80
+ * width vars, so live resize re-lays the frozen stack without React. */
81
+ frozenLeft?: (i: number) => string;
82
+ /** Workspace-settings capability locks (table read-only / per-column) — subtracts from
83
+ * what the columns declare. Memo-stable: threaded straight from the host. */
84
+ listConfig?: ListSettingsConfig;
85
+ onFocusCell: (rowId: string, columnId: string) => void;
86
+ onStartEdit: (rowId: string, columnId: string) => void;
87
+ /** A second click or a double-click on a cell that opens nothing: the grid
88
+ * says why it can't be edited (or nothing, when it can be written). */
89
+ onRefuseEdit?: (columnId: string) => void;
90
+ /** Tab out of an editor → next/prev cell in reading order (grid-owned so it
91
+ * matches Tab-while-focused; wraps rows). */
92
+ onEditorTab: (rowId: string, columnId: string, backwards: boolean) => void;
93
+ /** Enter out of an editor → advance one row down. */
94
+ onEditorEnter: (rowId: string, columnId: string) => void;
95
+ /** Type-to-replace seed: the character that opened THIS row's editor, or null.
96
+ * Used as the editor's initial value in place of the cell's own. */
97
+ editSeed?: string | null;
98
+ /** Shift-click: extend the active range to this cell (anchor stays). */
99
+ onExtendCell: (rowId: string, columnId: string) => void;
100
+ /** ⌘-click: add this cell as its own range. */
101
+ onAddCell: (rowId: string, columnId: string) => void;
102
+ onCommitCell: (row: Row, rowId: string, columnId: string, prev: unknown, next: unknown, opts?: {
103
+ overlay?: boolean;
104
+ }) => void;
105
+ /** Cell-scoped args make late (animation-deferred) cancels safe. */
106
+ onCancelEdit: (rowId?: string, columnId?: string) => void;
107
+ /** Open the entity a `relation` cell POINTS AT — a different entity from the
108
+ * one `onOpenRow` opens, which is why it can't reuse that handler. Omitted
109
+ * by a host with nowhere to send the click; the chip then renders inert
110
+ * rather than advertising a navigation it can't perform. */
111
+ onOpenRelation?: (value: ListRelationValue, columnId: string, row: Row) => void;
112
+ /** This app's glyph for an entity kind — see `GridCellOptions.entityIcon`. */
113
+ entityIcon?: (kind: string | undefined) => ReactNode;
114
+ /** The verbs a `command` column's cell opens, by field key — the host's, the
115
+ * same map the drawer's `FieldPanel` takes. Memo-stable: threaded straight
116
+ * from the host. See `GridCellOptions.commandItems`. */
117
+ commands?: FieldMenus<Row>;
118
+ /** Whether a cell sits inside the active MULTI-cell range — the context
119
+ * menu's verbs then act on the whole range instead of the one cell. */
120
+ inActiveRange: (rowId: string, columnId: string) => boolean;
121
+ /** Whether the active range holds any clearable column (greys Cut/Clear —
122
+ * required fields can't be emptied). */
123
+ rangeCanClear: () => boolean;
124
+ onRangeCopy: () => void;
125
+ onRangeCut: () => void;
126
+ onRangePaste: () => void;
127
+ onRangeClear: () => void;
128
+ /** Paste the clipboard MATRIX anchored at this cell (single-cell menu path
129
+ * when the clipboard holds a range copy). */
130
+ onPasteAtCell: (rowId: string, columnId: string) => void;
131
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ export declare const GRID_BLEED = "-mx-(--vk-gutter,0px)";
2
+ export declare const GRID_ROW_PAD = "px-(--vk-gutter,0px)";
3
+ export declare const GRID_CONTENT_PAD = "pl-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] pr-(--vk-gutter,0px)";
4
+ /** A part that paints the ground it sits on — the editing cell, a frozen footer cell, the rail's
5
+ * checkboxes, an outlined row action, the header's drag ghost. The page's ground, without
6
+ * re-declaring its states: every host the grid mounts in carries the page's own. */
7
+ export declare const GRID_GROUND = "bg-(color:--vk-ground)";
8
+ /** THE endFill-tail ⋯ button look: each row's menu button. Its hover is the caller's: neutral, or
9
+ * brand on a selected row. */
10
+ export declare const GRID_TAIL_BUTTON_BASE = "inline-flex h-8 w-9 items-center justify-center rounded-sm text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)";
11
+ export declare const GRID_HEADER_BG = "bg-[linear-gradient(to_bottom,var(--vk-ground)_calc(100%-2px),transparent_calc(100%-2px))]";
12
+ /**
13
+ * A FROZEN header cell's OWN paint — the same band, alpha-gated on
14
+ * `--vk-scrolled` (0/1, from the scroll sync), like the frozen z-tier and the
15
+ * head fade. It needs to be opaque only while cells pass underneath it; at rest
16
+ * the strip's own GRID_HEADER_BG already covers the band.
17
+ *
18
+ * Load-bearing, not tidiness: painting it unconditionally fills GRID_HEADER_BG's
19
+ * deliberate 2px transparent sliver — the ONLY place the FIRST row's selection
20
+ * ring can draw its top edge (no row above it, and the band outranks every
21
+ * cell). Symptom: pin the identity columns, edit the first row's title, and the
22
+ * ring's top edge is missing.
23
+ */
24
+ export declare const GRID_HEADER_BG_FROZEN = "bg-[linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";
25
+ /**
26
+ * The frozen cell's hover tint. GRID_HEADER_BG is a background-IMAGE and images
27
+ * paint over the background-COLOR — so the plain `hover:bg-(color:--vk-hovered)` the other
28
+ * header cells use is completely hidden underneath it, except in the 2px
29
+ * transparent sliver.
30
+ *
31
+ * So the hover tint has to be an image too, stacked ABOVE the same base — first
32
+ * layer wins in a background-image list. Non-frozen cells keep the simple
33
+ * colour version; only frozen cells need this. The base layer carries the same
34
+ * `--vk-scrolled` gate as GRID_HEADER_BG_FROZEN, so hovering a header at rest
35
+ * can't reintroduce the opacity the sliver depends on.
36
+ */
37
+ export declare const GRID_HEADER_BG_FROZEN_HOVER = "hover:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered)),linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";
@@ -0,0 +1,8 @@
1
+ export const GRID_BLEED = "-mx-(--vk-gutter,0px)";
2
+ export const GRID_ROW_PAD = "px-(--vk-gutter,0px)";
3
+ export const GRID_CONTENT_PAD = "pl-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] pr-(--vk-gutter,0px)";
4
+ export const GRID_GROUND = "bg-(color:--vk-ground)";
5
+ export const GRID_TAIL_BUTTON_BASE = "inline-flex h-8 w-9 items-center justify-center rounded-sm text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)";
6
+ export const GRID_HEADER_BG = "bg-[linear-gradient(to_bottom,var(--vk-ground)_calc(100%-2px),transparent_calc(100%-2px))]";
7
+ export const GRID_HEADER_BG_FROZEN = "bg-[linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";
8
+ export const GRID_HEADER_BG_FROZEN_HOVER = "hover:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered)),linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";