@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,127 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useLayoutEffect, useRef, useState } from "react";
4
+ import { useAnchoredEditSession } from "../../editors/edit-session.js";
5
+ import { useViews } from "../../provider/context.js";
6
+ import { cx } from "../../internal/cx.js";
7
+ import { normalizeMarkdown } from "@viewkitjs/fields";
8
+ const MIN_W = 320;
9
+ const MAX_W = 512;
10
+ const MAX_LINES = 12;
11
+ export function GridLongTextEditor({ initial, seed, readOnly = false, markdown = false, onCommit, onCancel, onTab, onEnter, }) {
12
+ const { components, messages } = useViews();
13
+ const { Popover } = components;
14
+ const anchorRef = useRef(null);
15
+ const areaRef = useRef(null);
16
+ const [cell, setCell] = useState(null);
17
+ useLayoutEffect(() => {
18
+ const anchor = anchorRef.current;
19
+ if (anchor)
20
+ setCell(measureCell(anchor));
21
+ }, []);
22
+ const handleRef = useRef({
23
+ resolveClose: (reason) => {
24
+ if (readOnly)
25
+ return { kind: "noop" };
26
+ if (reason === "escape")
27
+ return { kind: "cancel" };
28
+ const tidy = markdown ? normalizeMarkdown : (text) => text.trim();
29
+ const next = tidy(areaRef.current?.value ?? "");
30
+ return next === tidy(initial) ? { kind: "noop" } : { kind: "commit", payload: next };
31
+ },
32
+ });
33
+ const viaRef = useRef(null);
34
+ const { open, close } = useAnchoredEditSession({
35
+ editorRef: handleRef,
36
+ onDone: (resolution) => {
37
+ if (resolution.kind === "commit") {
38
+ onCommit(resolution.payload);
39
+ if (viaRef.current === "enter")
40
+ onEnter?.();
41
+ if (viaRef.current === "tab")
42
+ onTab?.(false);
43
+ if (viaRef.current === "shift-tab")
44
+ onTab?.(true);
45
+ }
46
+ else
47
+ onCancel();
48
+ },
49
+ });
50
+ const closeVia = (reason) => {
51
+ viaRef.current = reason;
52
+ close(reason);
53
+ };
54
+ const attach = useCallback((el) => {
55
+ areaRef.current = el;
56
+ if (!el)
57
+ return;
58
+ el.focus({ preventScroll: true });
59
+ el.setSelectionRange(el.value.length, el.value.length);
60
+ grow(el);
61
+ }, []);
62
+ const onKeyDown = (event) => {
63
+ event.stopPropagation();
64
+ if (event.key === "Escape") {
65
+ event.preventDefault();
66
+ closeVia("escape");
67
+ }
68
+ else if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
69
+ event.preventDefault();
70
+ closeVia("enter");
71
+ }
72
+ else if (event.key === "Tab") {
73
+ event.preventDefault();
74
+ closeVia(event.shiftKey ? "shift-tab" : "tab");
75
+ }
76
+ };
77
+ const width = cell ? Math.min(MAX_W, Math.max(MIN_W, cell.width)) : MIN_W;
78
+ const padY = cell ? Math.max(0, (cell.height - cell.lineHeight) / 2 - 1) : 8;
79
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(Popover, { open: open, onOpenChange: (next) => {
80
+ if (!next)
81
+ closeVia("outside");
82
+ }, anchor: anchorRef, align: "start", sideOffset: cell ? -cell.height : 0, onEscape: () => closeVia("escape"), onOutsidePress: () => closeVia("outside"), initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: cx("z-90 rounded-sm p-0", readOnly ? "border-(color:--vk-border)" : "border-(color:--vk-border-brand)"), style: { width }, children: _jsx("textarea", { ref: attach, "data-grid-editor": true, "aria-label": messages({ key: readOnly ? "views.grid.value" : "views.grid.edit-value" }), defaultValue: seed ?? initial, readOnly: readOnly, rows: 1, onKeyDown: onKeyDown, onInput: (e) => grow(e.currentTarget), style: cell
83
+ ? {
84
+ paddingLeft: cell.paddingX,
85
+ paddingRight: cell.paddingX,
86
+ paddingTop: padY,
87
+ paddingBottom: padY,
88
+ fontSize: cell.fontSize,
89
+ lineHeight: `${cell.lineHeight}px`,
90
+ }
91
+ : undefined, className: cx("block w-full resize-none select-text bg-transparent text-(color:--vk-fg) outline-hidden", "overflow-y-auto overscroll-contain") }) })] }));
92
+ }
93
+ function measureCell(anchor) {
94
+ const box = anchor.getBoundingClientRect();
95
+ const cell = anchor.parentElement ?? anchor;
96
+ const style = getComputedStyle(cell);
97
+ const lineVar = style.getPropertyValue("--vk-line-h").trim();
98
+ return {
99
+ width: box.width,
100
+ height: box.height,
101
+ paddingX: parseFloat(style.paddingLeft) || 12,
102
+ fontSize: style.fontSize || "14px",
103
+ lineHeight: resolveLength(cell, lineVar) || 22,
104
+ };
105
+ }
106
+ function resolveLength(host, value) {
107
+ if (!value)
108
+ return 0;
109
+ const direct = parseFloat(value);
110
+ if (!Number.isNaN(direct) && /^-?[\d.]+px$/.test(value))
111
+ return direct;
112
+ const probe = document.createElement("div");
113
+ probe.style.position = "absolute";
114
+ probe.style.visibility = "hidden";
115
+ probe.style.height = value;
116
+ host.appendChild(probe);
117
+ const px = probe.getBoundingClientRect().height;
118
+ host.removeChild(probe);
119
+ return px;
120
+ }
121
+ function grow(el) {
122
+ el.style.height = "auto";
123
+ const style = getComputedStyle(el);
124
+ const line = parseFloat(style.lineHeight) || 22;
125
+ const pad = (parseFloat(style.paddingTop) || 0) + (parseFloat(style.paddingBottom) || 0);
126
+ el.style.height = `${Math.min(el.scrollHeight, line * MAX_LINES + pad)}px`;
127
+ }
@@ -0,0 +1,15 @@
1
+ import type { ReactElement } from "react";
2
+ import type { ViewsIconName } from "../../contract.js";
3
+ /** A knob row's leading glyph, by meaning, in the subtle ink every verb row's glyph wears at rest. */
4
+ export declare function KnobGlyph({ name }: {
5
+ name: ViewsIconName;
6
+ }): ReactElement;
7
+ /** One verb row in a grid menu: a glyph, a label, the chosen mark while active (its glyph then in the brand ink). */
8
+ export declare function GridMenuRow({ label, icon, onClick, active, }: {
9
+ label: string;
10
+ icon: ViewsIconName;
11
+ onClick: () => void;
12
+ active?: boolean;
13
+ }): ReactElement;
14
+ /** The divider between a grid menu's blocks. */
15
+ export declare function GridMenuSeparator(): ReactElement;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useViews } from "../../provider/context.js";
4
+ export function KnobGlyph({ name }) {
5
+ const Glyph = useViews().icons[name];
6
+ return _jsx(Glyph, { className: "size-4 text-(color:--vk-fg-subtle)" });
7
+ }
8
+ export function GridMenuRow({ label, icon, onClick, active = false, }) {
9
+ const { atoms, icons } = useViews();
10
+ const Glyph = icons[icon];
11
+ return (_jsx(atoms.Row, { label: label, chosen: active, leading: _jsx(Glyph, { className: active ? "size-4 text-(color:--vk-fg-brand)" : "size-4 text-(color:--vk-fg-subtle)" }), onClick: onClick }));
12
+ }
13
+ export function GridMenuSeparator() {
14
+ return _jsx("div", { role: "separator", className: "-mx-1 my-1.5 h-px bg-(color:--vk-border)" });
15
+ }
@@ -0,0 +1,19 @@
1
+ import type { NameValue } from "@viewkitjs/fields";
2
+ /**
3
+ * The GRID's host around the shared `NameEditor`. Anchored, like the select and
4
+ * date editors: three boxes do not fit a cell, so they open in a panel under it
5
+ * while the cell's own name stays on screen. `useAnchoredEditSession` owns the
6
+ * one-answer guard and the exit gap; the core's own blur ends the session,
7
+ * since a blur onto another box is not a close.
8
+ */
9
+ export declare function GridNameEditor({ initial, seed, allowEmpty, onCommit, onCancel, onTab, onEnter, }: {
10
+ initial: NameValue | null;
11
+ /** Type-to-replace: the character that opened this editor replaces the given box. */
12
+ seed?: string;
13
+ allowEmpty?: boolean;
14
+ onCommit: (payload: NameValue | null) => void;
15
+ onCancel: () => void;
16
+ onTab?: (backwards: boolean) => void;
17
+ /** Commit happened via Enter — advance one row down. */
18
+ onEnter?: () => void;
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef } from "react";
4
+ import { useAnchoredEditSession } from "../../editors/edit-session.js";
5
+ import { NameEditor } from "../../editors/NameEditor.js";
6
+ import { useViews } from "../../provider/context.js";
7
+ export function GridNameEditor({ initial, seed, allowEmpty = false, onCommit, onCancel, onTab, onEnter, }) {
8
+ const { Popover } = useViews().components;
9
+ const anchorRef = useRef(null);
10
+ const editorRef = useRef(null);
11
+ const viaRef = useRef(null);
12
+ const { open, close } = useAnchoredEditSession({
13
+ editorRef,
14
+ onDone: (resolution) => {
15
+ if (resolution.kind === "commit") {
16
+ onCommit(resolution.payload);
17
+ if (viaRef.current === "enter")
18
+ onEnter?.();
19
+ if (viaRef.current === "tab")
20
+ onTab?.(false);
21
+ if (viaRef.current === "shift-tab")
22
+ onTab?.(true);
23
+ }
24
+ else
25
+ onCancel();
26
+ },
27
+ });
28
+ const closeVia = (reason) => {
29
+ viaRef.current = reason;
30
+ close(reason);
31
+ };
32
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(Popover, { open: open, onOpenChange: (next) => {
33
+ if (!next)
34
+ closeVia("outside");
35
+ }, anchor: anchorRef, align: "start", sideOffset: 4, onEscape: () => closeVia("escape"), onOutsidePress: () => closeVia("outside"), initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 w-80 p-2", children: _jsx(NameEditor, { ref: editorRef, initial: initial, seed: seed, allowEmpty: allowEmpty, onRequestClose: closeVia }) })] }));
36
+ }
@@ -0,0 +1,35 @@
1
+ import type { DurationUnit } from "@viewkitjs/fields/query";
2
+ import type { GridNumberEditValue } from "../core/edit-values.js";
3
+ /**
4
+ * The GRID's host around the shared `NumberEditor` (`@viewkitjs/views/editors/number`) —
5
+ * the typed field and its unit chip are one component across every surface;
6
+ * this host owns only the grid's mechanics: WHICH close happened, the write,
7
+ * and the focus move that follows it.
8
+ *
9
+ * No exit gap, unlike the anchored editors: this one is INLINE — it replaces
10
+ * the cell's content rather than opening a popover over it, so there is no
11
+ * animation to play out and the commit lands at once, before the focus moves.
12
+ */
13
+ export declare function GridNumberEditor({ initial, seed, unit, unitOptions, decimals, durationUnit, allowEmpty, unitLeft, onCommit, onCancel, onTab, onEnter, }: {
14
+ /** Signed raw value (e.g. -47.50 for an "out" transaction in its own currency). */
15
+ initial: number;
16
+ /** Type-to-replace: the character that opened this editor. */
17
+ seed?: string;
18
+ /** The row's current unit (currency). Undefined = plain number, no chip. */
19
+ unit?: string;
20
+ /** Selectable units — presence makes the chip a picker. */
21
+ unitOptions?: string[];
22
+ /** Rounding + initial formatting precision. */
23
+ decimals?: number;
24
+ /** A duration column's STORED unit — the core edits it as human text. */
25
+ durationUnit?: DurationUnit;
26
+ allowEmpty?: boolean;
27
+ /** Right-aligned columns put the chip on the LEFT so the number stays flush
28
+ * with the column's right edge. */
29
+ unitLeft?: boolean;
30
+ onCommit: (payload: GridNumberEditValue) => void;
31
+ onCancel: () => void;
32
+ onTab?: (backwards: boolean) => void;
33
+ /** Commit happened via Enter — advance one row down (Sheets). */
34
+ onEnter?: () => void;
35
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useRef } from "react";
4
+ import { NumberEditor } from "../../editors/NumberEditor.js";
5
+ export function GridNumberEditor({ initial, seed, unit, unitOptions, decimals = 2, durationUnit, allowEmpty = false, unitLeft = false, onCommit, onCancel, onTab, onEnter, }) {
6
+ const editorRef = useRef(null);
7
+ const closedRef = useRef(false);
8
+ const close = (reason) => {
9
+ if (closedRef.current)
10
+ return;
11
+ closedRef.current = true;
12
+ const resolution = editorRef.current?.resolveClose(reason) ?? { kind: "noop" };
13
+ if (resolution.kind === "commit")
14
+ onCommit(resolution.payload);
15
+ else
16
+ onCancel();
17
+ if (reason === "enter")
18
+ onEnter?.();
19
+ if (reason === "tab")
20
+ onTab?.(false);
21
+ if (reason === "shift-tab")
22
+ onTab?.(true);
23
+ };
24
+ return (_jsx("span", { "data-slot": "vk-grid-editor", className: "flex h-full w-full min-w-0", children: _jsx(NumberEditor, { ref: editorRef, initial: initial, seed: seed, unit: unit, unitOptions: unitOptions, decimals: decimals, durationUnit: durationUnit, allowEmpty: allowEmpty, unitLeft: unitLeft, onRequestClose: close }) }));
25
+ }
@@ -0,0 +1,20 @@
1
+ import type { RangeValue } from "@viewkitjs/fields";
2
+ /**
3
+ * The GRID's host around the shared `RangeEditor` — inline, like the number
4
+ * host: the two boxes replace the cell's content, the write lands at once, and
5
+ * only then does focus move.
6
+ */
7
+ export declare function GridRangeEditor({ initial, seed, decimals, allowEmpty, suffix, onCommit, onCancel, onTab, onEnter, }: {
8
+ initial: RangeValue | null;
9
+ /** Type-to-replace: the character that opened this editor replaces the low box. */
10
+ seed?: string;
11
+ decimals?: number;
12
+ allowEmpty?: boolean;
13
+ /** "%", a currency code — drawn after the high box. */
14
+ suffix?: string;
15
+ onCommit: (payload: RangeValue) => void;
16
+ onCancel: () => void;
17
+ onTab?: (backwards: boolean) => void;
18
+ /** Commit happened via Enter — advance one row down. */
19
+ onEnter?: () => void;
20
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useRef } from "react";
4
+ import { RangeEditor } from "../../editors/RangeEditor.js";
5
+ export function GridRangeEditor({ initial, seed, decimals = 0, allowEmpty = false, suffix, onCommit, onCancel, onTab, onEnter, }) {
6
+ const editorRef = useRef(null);
7
+ const closedRef = useRef(false);
8
+ const close = (reason) => {
9
+ if (closedRef.current)
10
+ return;
11
+ closedRef.current = true;
12
+ const resolution = editorRef.current?.resolveClose(reason) ?? { kind: "noop" };
13
+ if (resolution.kind === "commit")
14
+ onCommit(resolution.payload);
15
+ else
16
+ onCancel();
17
+ if (reason === "enter")
18
+ onEnter?.();
19
+ if (reason === "tab")
20
+ onTab?.(false);
21
+ if (reason === "shift-tab")
22
+ onTab?.(true);
23
+ };
24
+ return (_jsx("span", { "data-slot": "vk-grid-editor", className: "flex h-full w-full min-w-0", children: _jsx(RangeEditor, { ref: editorRef, initial: initial, seed: seed, decimals: decimals, allowEmpty: allowEmpty, suffix: suffix, onRequestClose: close }) }));
25
+ }
@@ -0,0 +1,21 @@
1
+ import type { RelationSource } from "../../fields/relation-source-types.js";
2
+ /**
3
+ * The GRID's host around the shared `RelationEditor` (`@viewkitjs/views/editors/relation`)
4
+ * — the search-and-pick panel is one component across every surface; this host
5
+ * owns only the grid's mechanics: anchor to the cell rect, open on mount, WHICH
6
+ * close happened, the exit animation gap, and the write.
7
+ *
8
+ * The candidate list is the column's, not the table's: every subscription you
9
+ * could link to, including ones no row currently points at — which is the whole
10
+ * difference from the Filter panel's list, and the reason a table of ten rows
11
+ * can still move a transaction onto any of seventy subscriptions.
12
+ */
13
+ export declare function GridRelationEditor({ candidates, current, clearable, onCommit, onCancel, }: {
14
+ candidates: RelationSource;
15
+ /** The linked id, or null when the cell is empty. */
16
+ current: string | null;
17
+ /** Offer "None" — only when the column says the link is optional. */
18
+ clearable: boolean;
19
+ onCommit: (id: string | null) => void;
20
+ onCancel: () => void;
21
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef, useState } from "react";
4
+ import { useViews } from "../../provider/context.js";
5
+ import { RelationEditor } from "../../editors/RelationEditor.js";
6
+ export function GridRelationEditor({ candidates, current, clearable, onCommit, onCancel, }) {
7
+ const { Popover } = useViews().components;
8
+ const [open, setOpen] = useState(true);
9
+ const editorRef = useRef(null);
10
+ const anchorRef = useRef(null);
11
+ const closedRef = useRef(false);
12
+ const EXIT_MS = 160;
13
+ const close = (reason) => {
14
+ if (closedRef.current)
15
+ return;
16
+ closedRef.current = true;
17
+ const resolution = editorRef.current?.resolveClose(reason) ?? { kind: "noop" };
18
+ setOpen(false);
19
+ window.setTimeout(() => {
20
+ if (resolution.kind === "commit")
21
+ onCommit(resolution.payload);
22
+ else
23
+ onCancel();
24
+ }, EXIT_MS);
25
+ };
26
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(Popover, { open: open, onOpenChange: (next) => {
27
+ if (!next)
28
+ close("outside");
29
+ }, anchor: anchorRef, align: "start", sideOffset: 4, onEscape: () => close("escape"), onOutsidePress: () => close("outside"), onPanelClick: (e) => e.stopPropagation(), panelData: { "data-slot": "vk-grid-editor" }, chrome: "menu", className: "w-64 z-90", children: _jsx(RelationEditor, { ref: editorRef, candidates: candidates, initial: current, clearable: clearable, onRequestClose: close }) })] }));
30
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The column-resize grab zone on a header cell's right edge. The header cell is
3
+ * (usually) a Radix PopoverTrigger — every pointer/click event here stops
4
+ * propagation so a resize drag (or its post-drag compatibility click) never
5
+ * opens the header menu, and a plain click on the edge does nothing.
6
+ *
7
+ * The drag itself lives in GridTable (pointer capture on this element retargets
8
+ * move/up here, so the passed handlers see the whole gesture without any
9
+ * document listeners). Double-click clears the column's width override — but
10
+ * only for true double-clicks; GridTable ignores it after a real drag.
11
+ */
12
+ export declare function GridResizeHandle({ active, onResizeStart, onResizeMove, onResizeEnd, onReset, }: {
13
+ /** True while THIS column is being dragged — pins the hairline visible. */
14
+ active: boolean;
15
+ onResizeStart: (e: React.PointerEvent<HTMLElement>) => void;
16
+ onResizeMove: (e: React.PointerEvent<HTMLElement>) => void;
17
+ onResizeEnd: (e: React.PointerEvent<HTMLElement>) => void;
18
+ onReset: () => void;
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cx } from "../../internal/cx.js";
4
+ export function GridResizeHandle({ active, onResizeStart, onResizeMove, onResizeEnd, onReset, }) {
5
+ return (_jsx("div", { "data-slot": "vk-grid-resize-handle", "data-no-nav": true, className: "group/gridresize absolute inset-y-0 right-0 z-10 w-[7px] cursor-col-resize touch-none", onPointerDown: (e) => {
6
+ if (e.button !== 0)
7
+ return;
8
+ e.stopPropagation();
9
+ e.preventDefault();
10
+ e.currentTarget.setPointerCapture(e.pointerId);
11
+ onResizeStart(e);
12
+ }, onPointerMove: onResizeMove, onPointerUp: (e) => {
13
+ e.stopPropagation();
14
+ onResizeEnd(e);
15
+ }, onPointerCancel: onResizeEnd, onClick: (e) => e.stopPropagation(), onDoubleClick: (e) => {
16
+ e.stopPropagation();
17
+ onReset();
18
+ }, children: _jsx("div", { className: cx("absolute inset-y-0 right-0 w-[3px] rounded-full bg-(color:--vk-brand)", active ? "opacity-100" : "opacity-0 group-hover/gridresize:opacity-100") }) }));
19
+ }
@@ -0,0 +1,25 @@
1
+ import type { GridRowProps } from "./grid-row-props.js";
2
+ /**
3
+ * Whether a pointerdown is about to open the row — the same test the click
4
+ * handler applies, one event earlier, so the drawer's data is on its way
5
+ * before the click lands. Only the `[data-cell-open]` hotspot (the title text)
6
+ * opens the row, so the columns play no part in the answer.
7
+ */
8
+ export declare function shouldPrefetchGridRow(target: HTMLElement): boolean;
9
+ /**
10
+ * One spreadsheet row: a strip of bordered cells on the shared template
11
+ * (gutter track first). No kebab — actions live on right-click
12
+ * (the row's menu, `RowMenu`) and in the entity drawer.
13
+ *
14
+ * Click contract (Sheets model, Tier 3):
15
+ * real controls win → cmd/shift row-select → selection-mode toggle →
16
+ * title-TEXT click opens the drawer (`[data-cell-open]` hotspot — the text
17
+ * only, never the cell's padding) →
18
+ * otherwise the click SELECTS the cell, the title cell included; a second
19
+ * click on the selected cell (or dblclick / Enter) starts editing when the
20
+ * column has an editor.
21
+ * Middle-click still opens `rowHref` in a new tab.
22
+ */
23
+ declare function GridRowInner<Row>(props: GridRowProps<Row>): import("react/jsx-runtime").JSX.Element;
24
+ export declare const GridRow: typeof GridRowInner;
25
+ export {};
@@ -0,0 +1,136 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { memo } from "react";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { GridRowCheck, GridRailSpacer } from "./checks.js";
6
+ import { GRID_TAIL_BUTTON_BASE } from "./grid-styles.js";
7
+ import { gridRowClassName } from "./grid-cell-classes.js";
8
+ import { preventShiftTextSelect, ROW_INTERACTIVE_SELECTOR } from "../../selection/row-click.js";
9
+ import { useRestIntent } from "../../selection/useRestIntent.js";
10
+ import { gridColumnHasEditor } from "./editors.js";
11
+ import { gridColumnInspectable } from "../../model/column-inspect.js";
12
+ import { countRowRender } from "../../model/render-count.js";
13
+ import { useGridRowContextMenu } from "./useGridRowContextMenu.js";
14
+ import { GridRowCells } from "./GridRowCells.js";
15
+ import { useViews } from "../../provider/context.js";
16
+ export function shouldPrefetchGridRow(target) {
17
+ if (target.closest(ROW_INTERACTIVE_SELECTOR))
18
+ return false;
19
+ return target.closest("[data-cell-open]") != null;
20
+ }
21
+ function GridRowInner(props) {
22
+ countRowRender();
23
+ const { icons, messages, atoms } = useViews();
24
+ const More = icons.more;
25
+ const RowMenu = atoms.RowMenu;
26
+ const { row, id, gridTemplate, columns, selectable, selected, selectedAbove, selecting, toggle, toggleRange, contextMenu, rowClassName, rowHref, onOpenRow, onPrefetchRow, onRowDelete, deleteLabel, editingEnabled, focusedColId, editingColId, pendingByCol, selectValues, rowRange, onFocusCell, rowKey, onStartEdit, onRefuseEdit, onExtendCell, onAddCell, onCommitCell, inActiveRange, rangeCanClear, onRangeCopy, onRangeCut, onRangePaste, onRangeClear, onPasteAtCell, } = props;
27
+ const href = rowHref?.(row);
28
+ const canEdit = (col) => editingEnabled && gridColumnHasEditor(col);
29
+ const opensPanel = (col) => canEdit(col) || gridColumnInspectable(col);
30
+ const { contextItems, handleContextMenu } = useGridRowContextMenu({
31
+ row,
32
+ id,
33
+ columns,
34
+ selecting,
35
+ selectable,
36
+ selected,
37
+ toggle,
38
+ editingEnabled,
39
+ pendingByCol,
40
+ selectValues,
41
+ rowRange,
42
+ contextMenu,
43
+ inActiveRange,
44
+ rangeCanClear,
45
+ onRangeCopy,
46
+ onRangeCut,
47
+ onRangePaste,
48
+ onRangeClear,
49
+ onPasteAtCell,
50
+ onCommitCell,
51
+ onFocusCell,
52
+ rowKey,
53
+ });
54
+ const findCol = (target) => {
55
+ const colId = target.closest("[data-col-id]")?.getAttribute("data-col-id");
56
+ return colId ? columns.find((c) => c.id === colId) : undefined;
57
+ };
58
+ const handleClick = (e) => {
59
+ const target = e.target;
60
+ if (target.closest(ROW_INTERACTIVE_SELECTOR))
61
+ return;
62
+ if (selecting) {
63
+ toggle(id);
64
+ return;
65
+ }
66
+ if (e.shiftKey || e.metaKey || e.ctrlKey) {
67
+ const col = findCol(target);
68
+ if (col)
69
+ (e.shiftKey ? onExtendCell : onAddCell)(rowKey, col.id);
70
+ return;
71
+ }
72
+ const col = findCol(target);
73
+ if (target.closest("[data-cell-open]")) {
74
+ onOpenRow(row);
75
+ return;
76
+ }
77
+ if (!col)
78
+ return;
79
+ if (focusedColId === col.id) {
80
+ if (!opensPanel(col))
81
+ onRefuseEdit?.(col.id);
82
+ else if (editingColId !== col.id)
83
+ onStartEdit(rowKey, col.id);
84
+ return;
85
+ }
86
+ onFocusCell(rowKey, col.id);
87
+ };
88
+ const handleDoubleClick = (e) => {
89
+ const target = e.target;
90
+ if (target.closest(ROW_INTERACTIVE_SELECTOR))
91
+ return;
92
+ if (selecting || target.closest("[data-cell-open]"))
93
+ return;
94
+ const col = findCol(target);
95
+ if (!col)
96
+ return;
97
+ if (!opensPanel(col))
98
+ onRefuseEdit?.(col.id);
99
+ else if (editingColId !== col.id)
100
+ onStartEdit(rowKey, col.id);
101
+ };
102
+ const handlePointerDown = (e) => {
103
+ if (e.button !== 0)
104
+ return;
105
+ const target = e.target;
106
+ if (shouldPrefetchGridRow(target))
107
+ onPrefetchRow?.(row);
108
+ };
109
+ const rest = useRestIntent(onPrefetchRow ? () => onPrefetchRow(row) : undefined, (target) => shouldPrefetchGridRow(target));
110
+ const handleMouseDown = (e) => {
111
+ if (e.button === 1) {
112
+ const target = e.target;
113
+ if (href && !target.closest(ROW_INTERACTIVE_SELECTOR)) {
114
+ e.preventDefault();
115
+ window.open(href, "_blank", "noopener,noreferrer");
116
+ return;
117
+ }
118
+ }
119
+ if (selectable)
120
+ preventShiftTextSelect(e);
121
+ };
122
+ const body = (_jsxs("div", { "data-slot": "vk-grid-row", "data-row-id": rowKey, onPointerDown: handlePointerDown, onPointerOver: rest.onPointerOver, onPointerLeave: rest.onPointerLeave, onMouseDown: handleMouseDown, onClick: handleClick, onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu, className: gridRowClassName({ selected, selectable, wrapCells: !!props.wrapCells, hostClass: rowClassName?.(row) }), style: { gridTemplateColumns: gridTemplate }, children: [selected && !selectedAbove && (_jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-x-0 top-0 z-11 h-px bg-(color:--vk-brand)" })), selected && (_jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-x-0 bottom-0 z-11 h-px bg-(color:--vk-brand)" })), selectable ? (_jsx(GridRowCheck, { selecting: selecting, checked: selected, revealed: selected, onChange: (next, shift) => (shift ? toggleRange(id) : toggle(id, next)), "aria-label": messages({ key: "views.grid.select-row" }) })) : (_jsx(GridRailSpacer, { selecting: false, bordered: true })), _jsx(GridRowCells, { props: props }), _jsx("div", { "data-slot": "vk-grid-tail", className: cx("flex border-b border-(color:--vk-border-subtle) pl-(--vk-tail-pl,var(--vk-px))", props.wrapCells
123
+ ? "min-h-(--vk-row-h) items-start py-(--vk-tail-py)"
124
+ : "h-(--vk-row-h) items-center"), children: _jsx("button", { type: "button", tabIndex: -1, "data-slot": "vk-grid-row-more", "aria-label": messages({ key: "views.grid.row-menu" }), title: messages({ key: "views.grid.row-menu" }), onClick: (e) => {
125
+ e.stopPropagation();
126
+ const rect = e.currentTarget.getBoundingClientRect();
127
+ e.currentTarget.dispatchEvent(new MouseEvent("contextmenu", {
128
+ bubbles: true,
129
+ cancelable: true,
130
+ clientX: rect.left,
131
+ clientY: rect.bottom + 6,
132
+ }));
133
+ }, className: cx(GRID_TAIL_BUTTON_BASE, "md:opacity-0 md:group-hover/gridrow:opacity-100", selected ? "hover:bg-(color:--vk-brand-subtlest)" : "hover:bg-(color:--vk-hovered)"), children: _jsx(More, { className: "h-4 w-4" }) }) })] }));
134
+ return (_jsx(RowMenu, { rowId: id, items: contextItems, openHref: href, onDelete: onRowDelete, deleteLabel: deleteLabel, onToggleSelect: selectable ? () => toggle(id, !selected) : undefined, children: body }));
135
+ }
136
+ export const GridRow = memo(GridRowInner);
@@ -0,0 +1,32 @@
1
+ import type { MouseEvent as ReactMouseEvent, ReactNode } from "react";
2
+ import type { ListCellAction } from "../../model/column-schema.js";
3
+ /**
4
+ * Small icon-button affordances inside a grid row, and the lane that hosts them.
5
+ *
6
+ * Two surfaces, one button primitive:
7
+ * - `bare` — an action COLUMN's cell. The icon owns its own cell, so it
8
+ * needs no box of its own.
9
+ * - `outlined` — the title cell's trailing lane. Several buttons sit
10
+ * shoulder-to-shoulder ON TOP of row content, so each needs a
11
+ * filled, bordered box to read as a discrete target.
12
+ *
13
+ * Adding an action is declaring one `ListCellAction` — the same shape action
14
+ * columns already use. No new component per action, no bespoke button markup.
15
+ */
16
+ type GridActionVariant = "bare" | "outlined";
17
+ export declare function GridActionButton({ variant, label, onClick, tabIndex, className, children, }: {
18
+ variant?: GridActionVariant;
19
+ label?: string;
20
+ onClick?: (e: ReactMouseEvent<HTMLButtonElement>) => void;
21
+ /** -1 for hover-revealed lanes — tabbing to an invisible button is a trap. */
22
+ tabIndex?: number;
23
+ className?: string;
24
+ children: ReactNode;
25
+ }): import("react/jsx-runtime").JSX.Element;
26
+ export declare function GridRowActions<Row>({ row, actions, selected, }: {
27
+ row: Row;
28
+ actions: ListCellAction<Row>[];
29
+ /** This row is selected — the backing carries its tint. */
30
+ selected?: boolean;
31
+ }): import("react/jsx-runtime").JSX.Element | null;
32
+ export {};
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cx } from "../../internal/cx.js";
4
+ import { gridFrozenBg } from "./GridCellOutline.js";
5
+ const VARIANT = {
6
+ bare: "h-6 w-6 rounded-md hover:bg-(color:--vk-hovered)",
7
+ outlined: "h-6 w-6 rounded-md [corner-shape:squircle] border border-(color:--vk-border) bg-(color:--vk-ground) shadow-xs hover:bg-(color:--vk-hovered)",
8
+ };
9
+ export function GridActionButton({ variant = "bare", label, onClick, tabIndex, className, children, }) {
10
+ return (_jsx("button", { type: "button", tabIndex: tabIndex, "aria-label": label, title: label, onClick: (e) => {
11
+ e.stopPropagation();
12
+ onClick?.(e);
13
+ }, className: cx("flex shrink-0 items-center justify-center text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)", VARIANT[variant], className), children: children }));
14
+ }
15
+ const LANE_RAMP = "linear-gradient(to right, transparent 0, rgb(0 0 0) 2rem)";
16
+ export function GridRowActions({ row, actions, selected = false, }) {
17
+ if (actions.length === 0)
18
+ return null;
19
+ return (_jsxs("span", { className: "pointer-events-none absolute right-0 top-0 hidden md:flex h-(--vk-chrome-h,100%) items-center gap-1 pl-8 pr-(--vk-px) opacity-0 group-hover/gridrow:opacity-100", children: [_jsx("span", { "aria-hidden": true, className: cx("absolute inset-0", gridFrozenBg(selected)), style: { maskImage: LANE_RAMP, WebkitMaskImage: LANE_RAMP } }), actions.map((a) => {
20
+ const glyph = a.icon(row);
21
+ if (!glyph)
22
+ return null;
23
+ return (_jsx(GridActionButton, { variant: "outlined", tabIndex: -1, className: "pointer-events-auto relative", label: a.label?.(row), onClick: a.onClick ? (e) => a.onClick?.(row, e) : undefined, children: glyph }, a.id));
24
+ })] }));
25
+ }
@@ -0,0 +1,4 @@
1
+ import type { GridRowProps } from "./grid-row-props.js";
2
+ export declare function GridRowCells<Row>({ props }: {
3
+ props: GridRowProps<Row>;
4
+ }): import("react/jsx-runtime").JSX.Element[];