@viewkitjs/views 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/CHANGELOG.md +767 -1
  2. package/README.md +92 -41
  3. package/dist/atoms/LoadMore.js +11 -1
  4. package/dist/atoms/Row.js +1 -1
  5. package/dist/atoms/RowMenu.d.ts +1 -1
  6. package/dist/atoms/RowMenu.js +20 -6
  7. package/dist/atoms/types.d.ts +4 -4
  8. package/dist/cells/cell-format.d.ts +3 -3
  9. package/dist/cells/cell-title.d.ts +1 -2
  10. package/dist/cells/cell-title.js +2 -2
  11. package/dist/cells/cell-values.js +6 -3
  12. package/dist/contract.d.ts +79 -8
  13. package/dist/contract.js +55 -8
  14. package/dist/display/converted.d.ts +19 -0
  15. package/dist/display/converted.js +12 -0
  16. package/dist/display/format.d.ts +16 -1
  17. package/dist/display/format.js +10 -1
  18. package/dist/display/index.d.ts +2 -1
  19. package/dist/display/index.js +2 -1
  20. package/dist/display/link-click.d.ts +11 -0
  21. package/dist/display/link-click.js +3 -0
  22. package/dist/display/link.js +12 -6
  23. package/dist/display/location.d.ts +4 -3
  24. package/dist/display/location.js +12 -5
  25. package/dist/display/multi-value.d.ts +1 -1
  26. package/dist/display/multi-value.js +1 -1
  27. package/dist/display/options.d.ts +8 -2
  28. package/dist/display/percent.js +10 -3
  29. package/dist/display/phone.d.ts +2 -1
  30. package/dist/display/phone.js +11 -2
  31. package/dist/display/relation.js +1 -1
  32. package/dist/editors/ChipsEditor.d.ts +9 -4
  33. package/dist/editors/ChipsEditor.js +7 -3
  34. package/dist/editors/DateEditor.d.ts +21 -6
  35. package/dist/editors/DateEditor.js +118 -30
  36. package/dist/editors/EditorPanel.d.ts +61 -0
  37. package/dist/editors/EditorPanel.js +54 -0
  38. package/dist/editors/LocationEditor.d.ts +3 -0
  39. package/dist/editors/LocationEditor.js +28 -21
  40. package/dist/editors/NameEditor.d.ts +3 -0
  41. package/dist/editors/NameEditor.js +15 -10
  42. package/dist/editors/NumberEditor.d.ts +3 -0
  43. package/dist/editors/NumberEditor.js +7 -7
  44. package/dist/editors/RangeEditor.d.ts +16 -1
  45. package/dist/editors/RangeEditor.js +22 -6
  46. package/dist/editors/RelationEditor.d.ts +13 -28
  47. package/dist/editors/RelationEditor.js +17 -40
  48. package/dist/editors/RelationSetEditor.d.ts +53 -0
  49. package/dist/editors/RelationSetEditor.js +112 -0
  50. package/dist/editors/SelectEditor.d.ts +21 -3
  51. package/dist/editors/SelectEditor.js +55 -9
  52. package/dist/editors/TextEditor.d.ts +51 -0
  53. package/dist/editors/TextEditor.js +81 -0
  54. package/dist/editors/ValueListEditor.d.ts +5 -2
  55. package/dist/editors/ValueListEditor.js +11 -9
  56. package/dist/editors/edit-cores.d.ts +13 -10
  57. package/dist/editors/edit-cores.js +7 -6
  58. package/dist/editors/edit-session.d.ts +21 -11
  59. package/dist/editors/edit-session.js +19 -5
  60. package/dist/editors/keep-inside.d.ts +12 -0
  61. package/dist/editors/keep-inside.js +20 -0
  62. package/dist/editors/open-value.d.ts +21 -0
  63. package/dist/editors/open-value.js +36 -0
  64. package/dist/editors/open-values.d.ts +4 -0
  65. package/dist/editors/open-values.js +7 -0
  66. package/dist/editors/relation-kinds.d.ts +7 -0
  67. package/dist/editors/relation-kinds.js +21 -0
  68. package/dist/editors/relation-panel.d.ts +69 -0
  69. package/dist/editors/relation-panel.js +40 -0
  70. package/dist/field-row/FieldNoteLine.d.ts +14 -0
  71. package/dist/field-row/FieldNoteLine.js +14 -0
  72. package/dist/field-row/FieldRow.d.ts +73 -0
  73. package/dist/field-row/FieldRow.js +157 -0
  74. package/dist/field-row/FieldRowLane.d.ts +19 -0
  75. package/dist/field-row/FieldRowLane.js +11 -0
  76. package/dist/field-row/editors/RowChipsEditor.d.ts +11 -0
  77. package/dist/field-row/editors/RowChipsEditor.js +25 -0
  78. package/dist/field-row/editors/RowDateEditor.d.ts +16 -0
  79. package/dist/field-row/editors/RowDateEditor.js +18 -0
  80. package/dist/field-row/editors/RowEditor.d.ts +39 -0
  81. package/dist/field-row/editors/RowEditor.js +64 -0
  82. package/dist/field-row/editors/RowNameEditor.d.ts +4 -0
  83. package/dist/field-row/editors/RowNameEditor.js +15 -0
  84. package/dist/field-row/editors/RowNumberEditor.d.ts +12 -0
  85. package/dist/field-row/editors/RowNumberEditor.js +18 -0
  86. package/dist/field-row/editors/RowPlaceEditor.d.ts +8 -0
  87. package/dist/field-row/editors/RowPlaceEditor.js +18 -0
  88. package/dist/field-row/editors/RowRangeEditor.d.ts +4 -0
  89. package/dist/field-row/editors/RowRangeEditor.js +15 -0
  90. package/dist/field-row/editors/RowRelationEditor.d.ts +20 -0
  91. package/dist/field-row/editors/RowRelationEditor.js +77 -0
  92. package/dist/field-row/editors/RowSelectEditor.d.ts +13 -0
  93. package/dist/field-row/editors/RowSelectEditor.js +23 -0
  94. package/dist/field-row/editors/RowTextEditor.d.ts +15 -0
  95. package/dist/field-row/editors/RowTextEditor.js +16 -0
  96. package/dist/field-row/editors/RowValueListEditor.d.ts +4 -0
  97. package/dist/field-row/editors/RowValueListEditor.js +21 -0
  98. package/dist/field-row/editors/host.d.ts +59 -0
  99. package/dist/field-row/editors/host.js +1 -0
  100. package/dist/field-row/editors/row-session.d.ts +49 -0
  101. package/dist/field-row/editors/row-session.js +49 -0
  102. package/dist/field-row/index.d.ts +5 -0
  103. package/dist/field-row/index.js +5 -0
  104. package/dist/field-row/row-target.d.ts +20 -0
  105. package/dist/field-row/row-target.js +3 -0
  106. package/dist/field-row/useFieldWrite.d.ts +45 -0
  107. package/dist/field-row/useFieldWrite.js +190 -0
  108. package/dist/field-row/useRowSettlement.d.ts +33 -0
  109. package/dist/field-row/useRowSettlement.js +23 -0
  110. package/dist/fields/binding.d.ts +7 -2
  111. package/dist/fields/binding.js +13 -6
  112. package/dist/fields/currency.d.ts +0 -10
  113. package/dist/fields/currency.js +0 -14
  114. package/dist/fields/edit-core-types.d.ts +9 -9
  115. package/dist/fields/edit-core-types.js +6 -6
  116. package/dist/fields/money.d.ts +6 -0
  117. package/dist/fields/money.js +11 -0
  118. package/dist/fields/number-edit.d.ts +6 -0
  119. package/dist/fields/number-edit.js +4 -0
  120. package/dist/fields/prepare-write.js +6 -1
  121. package/dist/fields/relation-source-types.d.ts +12 -0
  122. package/dist/fields/write-target.d.ts +50 -0
  123. package/dist/fields/write-target.js +10 -0
  124. package/dist/filters/filter-model.d.ts +0 -1
  125. package/dist/filters/registry.d.ts +3 -36
  126. package/dist/filters/registry.js +0 -38
  127. package/dist/grid/chrome/GridAddColumn.d.ts +11 -0
  128. package/dist/grid/chrome/GridAddColumn.js +29 -0
  129. package/dist/grid/chrome/GridAggregateMenu.d.ts +31 -0
  130. package/dist/grid/chrome/GridAggregateMenu.js +29 -0
  131. package/dist/grid/chrome/GridCellEditors.d.ts +71 -0
  132. package/dist/grid/chrome/GridCellEditors.js +126 -0
  133. package/dist/grid/chrome/GridCellOutline.d.ts +49 -0
  134. package/dist/grid/chrome/GridCellOutline.js +16 -0
  135. package/dist/grid/chrome/GridChipsEditor.d.ts +38 -0
  136. package/dist/grid/chrome/GridChipsEditor.js +35 -0
  137. package/dist/grid/chrome/GridColumnColorSection.d.ts +11 -0
  138. package/dist/grid/chrome/GridColumnColorSection.js +40 -0
  139. package/dist/grid/chrome/GridColumnDateSection.d.ts +23 -0
  140. package/dist/grid/chrome/GridColumnDateSection.js +23 -0
  141. package/dist/grid/chrome/GridColumnDurationSection.d.ts +19 -0
  142. package/dist/grid/chrome/GridColumnDurationSection.js +24 -0
  143. package/dist/grid/chrome/GridColumnMenu.d.ts +101 -0
  144. package/dist/grid/chrome/GridColumnMenu.js +103 -0
  145. package/dist/grid/chrome/GridColumnNumberSection.d.ts +25 -0
  146. package/dist/grid/chrome/GridColumnNumberSection.js +27 -0
  147. package/dist/grid/chrome/GridColumnPercentSection.d.ts +15 -0
  148. package/dist/grid/chrome/GridColumnPercentSection.js +16 -0
  149. package/dist/grid/chrome/GridColumnSortSection.d.ts +18 -0
  150. package/dist/grid/chrome/GridColumnSortSection.js +16 -0
  151. package/dist/grid/chrome/GridDateEditor.d.ts +34 -0
  152. package/dist/grid/chrome/GridDateEditor.js +19 -0
  153. package/dist/grid/chrome/GridFlyout.d.ts +44 -0
  154. package/dist/grid/chrome/GridFlyout.js +80 -0
  155. package/dist/grid/chrome/GridFooter.d.ts +33 -0
  156. package/dist/grid/chrome/GridFooter.js +85 -0
  157. package/dist/grid/chrome/GridGroupMenu.d.ts +37 -0
  158. package/dist/grid/chrome/GridGroupMenu.js +64 -0
  159. package/dist/grid/chrome/GridHeader.d.ts +66 -0
  160. package/dist/grid/chrome/GridHeader.js +42 -0
  161. package/dist/grid/chrome/GridLongTextEditor.d.ts +55 -0
  162. package/dist/grid/chrome/GridLongTextEditor.js +69 -0
  163. package/dist/grid/chrome/GridMenuRow.d.ts +15 -0
  164. package/dist/grid/chrome/GridMenuRow.js +15 -0
  165. package/dist/grid/chrome/GridNameEditor.d.ts +24 -0
  166. package/dist/grid/chrome/GridNameEditor.js +21 -0
  167. package/dist/grid/chrome/GridNumberEditor.d.ts +49 -0
  168. package/dist/grid/chrome/GridNumberEditor.js +51 -0
  169. package/dist/grid/chrome/GridPlaceEditor.d.ts +26 -0
  170. package/dist/grid/chrome/GridPlaceEditor.js +22 -0
  171. package/dist/grid/chrome/GridRangeEditor.d.ts +30 -0
  172. package/dist/grid/chrome/GridRangeEditor.js +21 -0
  173. package/dist/grid/chrome/GridRelationEditor.d.ts +45 -0
  174. package/dist/grid/chrome/GridRelationEditor.js +92 -0
  175. package/dist/grid/chrome/GridResizeHandle.d.ts +19 -0
  176. package/dist/grid/chrome/GridResizeHandle.js +19 -0
  177. package/dist/grid/chrome/GridRow.d.ts +31 -0
  178. package/dist/grid/chrome/GridRow.js +179 -0
  179. package/dist/grid/chrome/GridRowActions.d.ts +32 -0
  180. package/dist/grid/chrome/GridRowActions.js +25 -0
  181. package/dist/grid/chrome/GridRowCells.d.ts +4 -0
  182. package/dist/grid/chrome/GridRowCells.js +128 -0
  183. package/dist/grid/chrome/GridRowGlyph.d.ts +12 -0
  184. package/dist/grid/chrome/GridRowGlyph.js +13 -0
  185. package/dist/grid/chrome/GridSelectEditor.d.ts +33 -0
  186. package/dist/grid/chrome/GridSelectEditor.js +43 -0
  187. package/dist/grid/chrome/GridStructure.d.ts +47 -0
  188. package/dist/grid/chrome/GridStructure.js +41 -0
  189. package/dist/grid/chrome/GridTable.d.ts +4 -0
  190. package/dist/grid/chrome/GridTable.js +192 -0
  191. package/dist/grid/chrome/GridTableSurface.d.ts +52 -0
  192. package/dist/grid/chrome/GridTableSurface.js +15 -0
  193. package/dist/grid/chrome/GridTextEditor.d.ts +45 -0
  194. package/dist/grid/chrome/GridTextEditor.js +38 -0
  195. package/dist/grid/chrome/GridValueListEditor.d.ts +30 -0
  196. package/dist/grid/chrome/GridValueListEditor.js +19 -0
  197. package/dist/grid/chrome/StuckMarker.d.ts +16 -0
  198. package/dist/grid/chrome/StuckMarker.js +34 -0
  199. package/dist/grid/chrome/cell-clipboard.d.ts +9 -0
  200. package/dist/grid/chrome/cell-clipboard.js +28 -0
  201. package/dist/grid/chrome/cell-cut-off.d.ts +11 -0
  202. package/dist/grid/chrome/cell-cut-off.js +20 -0
  203. package/dist/grid/chrome/cells.d.ts +21 -0
  204. package/dist/grid/chrome/cells.js +19 -0
  205. package/dist/grid/chrome/checks.d.ts +32 -0
  206. package/dist/grid/chrome/checks.js +32 -0
  207. package/dist/grid/chrome/column-glyph.d.ts +14 -0
  208. package/dist/grid/chrome/column-glyph.js +44 -0
  209. package/dist/grid/chrome/editors.d.ts +9 -0
  210. package/dist/grid/chrome/editors.js +10 -0
  211. package/dist/grid/chrome/grid-cell-classes.d.ts +53 -0
  212. package/dist/grid/chrome/grid-cell-classes.js +32 -0
  213. package/dist/grid/chrome/grid-cell-link.d.ts +13 -0
  214. package/dist/grid/chrome/grid-cell-link.js +9 -0
  215. package/dist/grid/chrome/grid-edit-session.d.ts +63 -0
  216. package/dist/grid/chrome/grid-edit-session.js +118 -0
  217. package/dist/grid/chrome/grid-hover.d.ts +60 -0
  218. package/dist/grid/chrome/grid-hover.js +81 -0
  219. package/dist/grid/chrome/grid-menu-focus.d.ts +43 -0
  220. package/dist/grid/chrome/grid-menu-focus.js +93 -0
  221. package/dist/grid/chrome/grid-menu-search.d.ts +7 -0
  222. package/dist/grid/chrome/grid-menu-search.js +7 -0
  223. package/dist/grid/chrome/grid-row-menu-key.d.ts +15 -0
  224. package/dist/grid/chrome/grid-row-menu-key.js +36 -0
  225. package/dist/grid/chrome/grid-row-props.d.ts +143 -0
  226. package/dist/grid/chrome/grid-row-props.js +1 -0
  227. package/dist/grid/chrome/grid-row-window.d.ts +61 -0
  228. package/dist/grid/chrome/grid-row-window.js +212 -0
  229. package/dist/grid/chrome/grid-scroll-owner.d.ts +38 -0
  230. package/dist/grid/chrome/grid-scroll-owner.js +75 -0
  231. package/dist/grid/chrome/grid-styles.d.ts +40 -0
  232. package/dist/grid/chrome/grid-styles.js +9 -0
  233. package/dist/grid/chrome/grid-table-props.d.ts +172 -0
  234. package/dist/grid/chrome/grid-table-props.js +1 -0
  235. package/dist/grid/chrome/useGridBatchApi.d.ts +34 -0
  236. package/dist/grid/chrome/useGridBatchApi.js +35 -0
  237. package/dist/grid/chrome/useGridColumnLayout.d.ts +30 -0
  238. package/dist/grid/chrome/useGridColumnLayout.js +206 -0
  239. package/dist/grid/chrome/useGridFocus.d.ts +45 -0
  240. package/dist/grid/chrome/useGridFocus.js +122 -0
  241. package/dist/grid/chrome/useGridHeaderDrag.d.ts +20 -0
  242. package/dist/grid/chrome/useGridHeaderDrag.js +37 -0
  243. package/dist/grid/chrome/useGridKeyboard.d.ts +64 -0
  244. package/dist/grid/chrome/useGridKeyboard.js +450 -0
  245. package/dist/grid/chrome/useGridPendingReconciliation.d.ts +12 -0
  246. package/dist/grid/chrome/useGridPendingReconciliation.js +32 -0
  247. package/dist/grid/chrome/useGridRailReveal.d.ts +57 -0
  248. package/dist/grid/chrome/useGridRailReveal.js +67 -0
  249. package/dist/grid/chrome/useGridRangeActions.d.ts +51 -0
  250. package/dist/grid/chrome/useGridRangeActions.js +195 -0
  251. package/dist/grid/chrome/useGridRangeGestures.d.ts +32 -0
  252. package/dist/grid/chrome/useGridRangeGestures.js +237 -0
  253. package/dist/grid/chrome/useGridRowContextMenu.d.ts +37 -0
  254. package/dist/grid/chrome/useGridRowContextMenu.js +153 -0
  255. package/dist/grid/chrome/useGridScaleStyles.d.ts +3 -0
  256. package/dist/grid/chrome/useGridScaleStyles.js +28 -0
  257. package/dist/grid/chrome/useGridScrollArea.d.ts +21 -0
  258. package/dist/grid/chrome/useGridScrollArea.js +65 -0
  259. package/dist/grid/chrome/useGridTableInteractionModel.d.ts +78 -0
  260. package/dist/grid/chrome/useGridTableInteractionModel.js +249 -0
  261. package/dist/grid/chrome/useGridTableSelection.d.ts +29 -0
  262. package/dist/grid/chrome/useGridTableSelection.js +55 -0
  263. package/dist/grid/chrome/useHeaderDragReorder.d.ts +21 -0
  264. package/dist/grid/chrome/useHeaderDragReorder.js +216 -0
  265. package/dist/grid/core/clipboard-model.d.ts +83 -0
  266. package/dist/grid/core/clipboard-model.js +291 -0
  267. package/dist/grid/core/column-values.d.ts +27 -0
  268. package/dist/grid/core/column-values.js +76 -0
  269. package/dist/grid/core/commit-model.d.ts +41 -0
  270. package/dist/grid/core/commit-model.js +3 -0
  271. package/dist/grid/core/coordinates.d.ts +48 -0
  272. package/dist/grid/core/coordinates.js +27 -0
  273. package/dist/grid/core/edge-scroll.d.ts +21 -0
  274. package/dist/grid/core/edge-scroll.js +23 -0
  275. package/dist/grid/core/edit-values.d.ts +9 -0
  276. package/dist/grid/core/edit-values.js +1 -0
  277. package/dist/grid/core/editing-controller.d.ts +60 -0
  278. package/dist/grid/core/editing-controller.js +266 -0
  279. package/dist/grid/core/editing-model.d.ts +87 -0
  280. package/dist/grid/core/editing-model.js +148 -0
  281. package/dist/grid/core/flat-rows.d.ts +35 -0
  282. package/dist/grid/core/flat-rows.js +20 -0
  283. package/dist/grid/core/grid-aria.d.ts +27 -0
  284. package/dist/grid/core/grid-aria.js +39 -0
  285. package/dist/grid/core/grid-focus.d.ts +54 -0
  286. package/dist/grid/core/grid-focus.js +148 -0
  287. package/dist/grid/core/grid-scale.d.ts +14 -0
  288. package/dist/grid/core/grid-scale.js +8 -0
  289. package/dist/grid/core/nav.d.ts +94 -0
  290. package/dist/grid/core/nav.js +92 -0
  291. package/dist/grid/core/pending-reconciliation.d.ts +53 -0
  292. package/dist/grid/core/pending-reconciliation.js +51 -0
  293. package/dist/grid/core/range-model.d.ts +25 -0
  294. package/dist/grid/core/range-model.js +59 -0
  295. package/dist/grid/core/row-window.d.ts +40 -0
  296. package/dist/grid/core/row-window.js +43 -0
  297. package/dist/grid/core/spreadsheet-operations.d.ts +101 -0
  298. package/dist/grid/core/spreadsheet-operations.js +280 -0
  299. package/dist/grid/core/useGridEditing.d.ts +46 -0
  300. package/dist/grid/core/useGridEditing.js +93 -0
  301. package/dist/grid/core/useGridRange.d.ts +20 -0
  302. package/dist/grid/core/useGridRange.js +24 -0
  303. package/dist/grid/core/value-equality.d.ts +54 -0
  304. package/dist/grid/core/value-equality.js +80 -0
  305. package/dist/grid/index.d.ts +18 -0
  306. package/dist/grid/index.js +5 -0
  307. package/dist/grid/useGridTablePrefs.d.ts +49 -0
  308. package/dist/grid/useGridTablePrefs.js +99 -0
  309. package/dist/index.d.ts +1 -1
  310. package/dist/index.js +1 -1
  311. package/dist/internal/viewport.d.ts +3 -0
  312. package/dist/internal/viewport.js +15 -0
  313. package/dist/model/column-capabilities.d.ts +3 -2
  314. package/dist/model/column-capabilities.js +28 -8
  315. package/dist/model/column-from.js +3 -0
  316. package/dist/model/column-inspect.d.ts +10 -2
  317. package/dist/model/column-inspect.js +9 -0
  318. package/dist/model/column-schema.d.ts +6 -1
  319. package/dist/model/column-state.d.ts +1 -1
  320. package/dist/model/column-types.d.ts +3 -1
  321. package/dist/model/column-types.js +1 -1
  322. package/dist/model/density.js +3 -3
  323. package/dist/model/filter-capabilities.d.ts +1 -1
  324. package/dist/model/filter-capabilities.js +1 -1
  325. package/dist/model/index.d.ts +4 -6
  326. package/dist/model/index.js +0 -1
  327. package/dist/model/preferences.d.ts +7 -7
  328. package/dist/model/preferences.js +0 -1
  329. package/dist/model/prefs-buckets.d.ts +0 -1
  330. package/dist/model/prefs-buckets.js +0 -3
  331. package/dist/model/render-count.d.ts +6 -0
  332. package/dist/model/render-count.js +11 -0
  333. package/dist/provider/ViewsProvider.d.ts +6 -2
  334. package/dist/provider/ViewsProvider.js +12 -2
  335. package/dist/provider/components.d.ts +35 -9
  336. package/dist/provider/components.js +4 -2
  337. package/dist/provider/context.d.ts +8 -4
  338. package/dist/provider/desktop.d.ts +9 -0
  339. package/dist/provider/desktop.js +22 -0
  340. package/dist/provider/menu-groups.d.ts +8 -0
  341. package/dist/provider/menu-groups.js +38 -0
  342. package/dist/provider/plain-input.d.ts +8 -0
  343. package/dist/provider/plain-input.js +5 -0
  344. package/dist/provider/ports.d.ts +22 -0
  345. package/dist/provider/ports.js +1 -0
  346. package/dist/react.d.ts +3 -2
  347. package/dist/react.js +1 -0
  348. package/dist/selection/SelectCheckbox.d.ts +3 -1
  349. package/dist/selection/SelectCheckbox.js +2 -2
  350. package/dist/selection/useCheckDragSelect.js +6 -5
  351. package/docs/contract.md +202 -72
  352. package/docs/getting-started.md +250 -0
  353. package/docs/guides/atoms.md +245 -0
  354. package/docs/guides/cells.md +302 -0
  355. package/docs/guides/columns.md +413 -0
  356. package/docs/guides/display.md +204 -0
  357. package/docs/guides/editors.md +462 -0
  358. package/docs/guides/ports.md +246 -0
  359. package/docs/guides/selection.md +270 -0
  360. package/docs/guides/the-grid.md +696 -0
  361. package/docs/guides/the-provider.md +448 -0
  362. package/docs/index.md +52 -0
  363. package/docs/install.md +9 -47
  364. package/docs/reference/cells.md +28 -0
  365. package/docs/reference/display.md +44 -0
  366. package/docs/reference/editors-chips.md +6 -0
  367. package/docs/reference/editors-date.md +6 -0
  368. package/docs/reference/editors-location.md +10 -0
  369. package/docs/reference/editors-name.md +6 -0
  370. package/docs/reference/editors-number.md +11 -0
  371. package/docs/reference/editors-open-values.md +10 -0
  372. package/docs/reference/editors-panel.md +12 -0
  373. package/docs/reference/editors-range.md +6 -0
  374. package/docs/reference/editors-relation.md +12 -0
  375. package/docs/reference/editors-select.md +9 -0
  376. package/docs/reference/editors-session.md +11 -0
  377. package/docs/reference/editors-text.md +9 -0
  378. package/docs/reference/editors-value-list.md +6 -0
  379. package/docs/reference/editors.md +5 -0
  380. package/docs/reference/field-row.md +16 -0
  381. package/docs/reference/grid.md +39 -0
  382. package/docs/reference/react.md +89 -0
  383. package/docs/reference/selection.md +33 -0
  384. package/docs/reference/views.md +622 -0
  385. package/package.json +27 -4
  386. package/skills/views/SKILL.md +20 -5
  387. package/dist/filters/types.d.ts +0 -27
  388. package/dist/filters/types.js +0 -1
  389. package/dist/model/filter-pushdown.d.ts +0 -106
  390. package/dist/model/filter-pushdown.js +0 -147
@@ -1,4 +1,4 @@
1
- import type { ComponentType, CSSProperties, KeyboardEvent as ReactKeyboardEvent, MouseEvent as ReactMouseEvent, ReactElement, ReactNode, Ref, RefObject } from "react";
1
+ import type { ComponentPropsWithRef, ComponentType, CSSProperties, KeyboardEvent as ReactKeyboardEvent, MouseEvent as ReactMouseEvent, ReactElement, ReactNode, Ref, RefObject } from "react";
2
2
  /** Where a floating part attaches: an element, a ref to one, or a point (a context menu). */
3
3
  export type ViewsAnchor = HTMLElement | RefObject<HTMLElement | null> | {
4
4
  x: number;
@@ -32,7 +32,8 @@ export type ViewsPopoverProps = {
32
32
  sideOffset?: number;
33
33
  alignOffset?: number;
34
34
  /** False keeps focus where it was when the popup opens (an editor that owns
35
- * its own input). Default true. */
35
+ * its own input); that editor focuses its input with `preventScroll`, so the
36
+ * page stays where it is however the popup places itself. Default true. */
36
37
  initialFocus?: boolean;
37
38
  /** Called on a press outside the popup before it closes; return false to keep it open.
38
39
  * `event` is the pointer press, with its `target` where the press landed, also when the
@@ -42,8 +43,9 @@ export type ViewsPopoverProps = {
42
43
  /** Called on Escape before the popup closes; return false to keep it open. */
43
44
  onEscape?: (event: KeyboardEvent) => void | false;
44
45
  /** The popup's look. `panel` is the app's card popover; `menu` is its menu
45
- * panel, for a popover that holds a list (no inset: the list carries its
46
- * own). Default `panel`. */
46
+ * panel's surface, for a popover that holds a list: no inset (the list
47
+ * carries its own) and no card width (it is as wide as its list). Default
48
+ * `panel`. */
47
49
  chrome?: "panel" | "menu";
48
50
  /** A click inside the popup. A popup is a portal, so its clicks still bubble
49
51
  * through the React tree to the anchor's row; the rendering stops them here. */
@@ -93,7 +95,8 @@ export type ViewsMenuItem = {
93
95
  /** A checkable row: the app draws its tick. A checkable row closes the menu like any row. */
94
96
  checked?: boolean;
95
97
  /** A group: its rows drawn in place under this row's label, never a flyout. A group row is a
96
- * label, not a target: its own `onSelect`, `href` and `checked` are ignored. */
98
+ * label, not a target: its own `onSelect`, `href` and `checked` are ignored. A disabled group
99
+ * disables every row under it: the provider hands the app's `Menu` those rows already `disabled`. */
97
100
  children?: ViewsMenuItem[];
98
101
  separatorBefore?: boolean;
99
102
  /** A keyboard hint drawn at the row's end, never bound by the menu. */
@@ -101,6 +104,8 @@ export type ViewsMenuItem = {
101
104
  /** A link item: the row is an anchor and `onSelect` still fires. */
102
105
  href?: string;
103
106
  };
107
+ /** Opens at `anchor`, with no trigger child and no flyouts: on Base UI, the menu's root,
108
+ * positioner and popup, the anchor handed to the positioner. */
104
109
  export type ViewsMenuProps = {
105
110
  open: boolean;
106
111
  onOpenChange: ViewsOpenChange;
@@ -122,6 +127,10 @@ export type ViewsCommandParts = {
122
127
  filter?: (value: string, search: string) => number;
123
128
  /** The arrows wrap from the last item to the first and back. Default false. */
124
129
  loop?: boolean;
130
+ /** The item highlighted as the list opens, by its value. Without it, the first item; while no item has it (a
131
+ * remote page that doesn't hold it), none, until a key or typed text moves the highlight: never the first, which
132
+ * in a relation picker is None. A list that ignores it opens on its first item. */
133
+ defaultValue?: string;
125
134
  }>;
126
135
  Input: ComponentType<{
127
136
  value: string;
@@ -152,8 +161,9 @@ export type ViewsCommandParts = {
152
161
  value: string;
153
162
  onSelect: (value: string) => void;
154
163
  disabled?: boolean;
155
- /** The value this item stands for is the current one: the app draws its chosen mark on
156
- * the item (the row inside draws the check). */
164
+ /** The value this item stands for is the current one. The app colours the item as its
165
+ * chosen row; the check is the package's, drawn by the row inside, so the item draws no
166
+ * tick of its own. */
157
167
  chosen?: boolean;
158
168
  children: ReactNode;
159
169
  className?: string;
@@ -186,7 +196,7 @@ export type ViewsCollapseProps = {
186
196
  clipClassName?: string;
187
197
  durationMs?: number;
188
198
  };
189
- /** A phone sheet. An app whose sheet has no snap points ignores `snap`. */
199
+ /** A phone sheet. `snap` is a hint: an app whose sheet has no snap points ignores it. */
190
200
  export type ViewsSheetProps = {
191
201
  open: boolean;
192
202
  onOpenChange: ViewsOpenChange;
@@ -196,6 +206,13 @@ export type ViewsSheetProps = {
196
206
  className?: string;
197
207
  children: ReactNode;
198
208
  };
209
+ /** A single-line text box. Forward every prop to the element, `ref` included: the editors focus the
210
+ * box, place its caret and read its value through it. */
211
+ export type ViewsInputProps = Omit<ComponentPropsWithRef<"input">, "children"> & {
212
+ /** `bare`: the box draws no frame of its own (a grid cell, a panel that frames it). `field`: it
213
+ * wears the app's field frame, as a form's input does. Default `bare`. */
214
+ chrome?: "bare" | "field";
215
+ };
199
216
  export type ViewsComponents = {
200
217
  Button: ComponentType<ViewsButtonProps>;
201
218
  Popover: ComponentType<ViewsPopoverProps>;
@@ -207,7 +224,9 @@ export type ViewsComponents = {
207
224
  Collapse: ComponentType<ViewsCollapseProps>;
208
225
  Sheet: ComponentType<ViewsSheetProps>;
209
226
  /** The app's own icon component by the app's own names, for glyphs a host
210
- * declares (`rowIcon`, a binding's `icon`). Semantic glyphs use `icons`. */
227
+ * declares (`rowIcon`, a binding's `icon`). It draws on the first paint,
228
+ * because rows are measured as they mount: map the names from a static
229
+ * record, never icons loaded on demand. Semantic glyphs use `icons`. */
211
230
  AppIcon: ComponentType<{
212
231
  name: string;
213
232
  className?: string;
@@ -219,4 +238,11 @@ export type ViewsComponents = {
219
238
  source: string;
220
239
  className?: string;
221
240
  }>;
241
+ /** Optional: every editor's single-line box draws through it. Left out, the provider draws a
242
+ * plain `<input>`. */
243
+ Input?: ComponentType<ViewsInputProps>;
244
+ };
245
+ /** The map as the views read it: the optional slots filled, the app's or the package's default. */
246
+ export type ViewsResolvedComponents = ViewsComponents & {
247
+ Input: ComponentType<ViewsInputProps>;
222
248
  };
@@ -1,3 +1,5 @@
1
- const _mapMatchesContract = true;
2
- void _mapMatchesContract;
1
+ const _requiredMatchContract = true;
2
+ const _optionalMatchContract = true;
3
+ void _requiredMatchContract;
4
+ void _optionalMatchContract;
3
5
  export {};
@@ -2,18 +2,22 @@ import type { FieldConventions } from "@viewkitjs/fields";
2
2
  import type { ViewsMessageResolver } from "../contract.js";
3
3
  import type { ViewsAtoms } from "../atoms/types.js";
4
4
  import type { FieldPresentation } from "../display/options.js";
5
- import type { ViewsComponents } from "./components.js";
5
+ import type { ViewsResolvedComponents } from "./components.js";
6
6
  import type { ViewsIcons } from "./icons.js";
7
- import type { ViewsPorts } from "./ports.js";
7
+ import type { ViewsResolvedPorts } from "./ports.js";
8
8
  export type ViewsContextValue = {
9
- components: ViewsComponents;
9
+ /** The app's components, with the optional ones filled: the app's own, or the package's plain default. */
10
+ components: ViewsResolvedComponents;
10
11
  atoms: ViewsAtoms;
11
12
  icons: ViewsIcons;
12
- ports: ViewsPorts;
13
+ /** The app's ports, with `confirm` always a function (the browser's where the app handed none). */
14
+ ports: ViewsResolvedPorts;
13
15
  messages: ViewsMessageResolver;
14
16
  conventions: FieldConventions;
15
17
  /** The app's formatting: given the package's defaults, return the app's. */
16
18
  presentation?: (defaults: FieldPresentation) => FieldPresentation;
19
+ /** The media query that means a desktop: the app's own, or `DEFAULT_DESKTOP_QUERY`. */
20
+ desktopQuery: string;
17
21
  };
18
22
  export declare const ViewsContext: import("react").Context<ViewsContextValue | null>;
19
23
  export declare function useViews(): ViewsContextValue;
@@ -0,0 +1,9 @@
1
+ /** The width a desktop starts at, unless the app hands in its own query. */
2
+ export declare const DEFAULT_DESKTOP_QUERY = "(min-width: 1024px)";
3
+ /** Whether the screen is a desktop by `query`, asked now: true where there is no `matchMedia`. For
4
+ * an answer at the moment of a gesture, where a subscription would redraw its reader on a change.
5
+ * The package's own: no entry point exports it. */
6
+ export declare function isDesktopNow(query: string): boolean;
7
+ /** Whether the screen is a desktop, by the provider's `desktopQuery`: true where there is no
8
+ * `matchMedia`. It follows the query's changes. The package's own: no entry point exports it. */
9
+ export declare function useDesktop(): boolean;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { useCallback, useSyncExternalStore } from "react";
3
+ import { useViews } from "./context.js";
4
+ export const DEFAULT_DESKTOP_QUERY = "(min-width: 1024px)";
5
+ function canAsk() {
6
+ return typeof window !== "undefined" && typeof window.matchMedia === "function";
7
+ }
8
+ export function isDesktopNow(query) {
9
+ return canAsk() ? window.matchMedia(query).matches : true;
10
+ }
11
+ export function useDesktop() {
12
+ const { desktopQuery } = useViews();
13
+ const subscribe = useCallback((onChange) => {
14
+ if (!canAsk())
15
+ return () => { };
16
+ const list = window.matchMedia(desktopQuery);
17
+ list.addEventListener("change", onChange);
18
+ return () => list.removeEventListener("change", onChange);
19
+ }, [desktopQuery]);
20
+ const read = () => isDesktopNow(desktopQuery);
21
+ return useSyncExternalStore(subscribe, read, () => true);
22
+ }
@@ -0,0 +1,8 @@
1
+ import { type ComponentType } from "react";
2
+ import type { ViewsMenuItem, ViewsMenuProps } from "./components.js";
3
+ /** The items with every row under a disabled group marked `disabled`, at every depth. Only the
4
+ * path to a disabled group is copied; with none, the same array comes back. */
5
+ export declare function settleMenuGroups(items: ViewsMenuItem[]): ViewsMenuItem[];
6
+ /** The app's Menu, handed its items settled. One wrapper per app Menu, so an open menu never
7
+ * remounts; a wrapper handed in again (a nested provider) comes back as it is. */
8
+ export declare function withSettledGroups(Menu: ComponentType<ViewsMenuProps>): ComponentType<ViewsMenuProps>;
@@ -0,0 +1,38 @@
1
+ import { createElement, useMemo } from "react";
2
+ function disableAll(items) {
3
+ return items.map((item) => ({
4
+ ...item,
5
+ disabled: true,
6
+ ...(item.children && { children: disableAll(item.children) }),
7
+ }));
8
+ }
9
+ export function settleMenuGroups(items) {
10
+ let changed = false;
11
+ const settled = items.map((item) => {
12
+ if (!item.children || item.children.length === 0)
13
+ return item;
14
+ const children = item.disabled ? disableAll(item.children) : settleMenuGroups(item.children);
15
+ if (children === item.children)
16
+ return item;
17
+ changed = true;
18
+ return { ...item, children };
19
+ });
20
+ return changed ? settled : items;
21
+ }
22
+ const wrappers = new WeakMap();
23
+ const settledMenus = new WeakSet();
24
+ export function withSettledGroups(Menu) {
25
+ if (settledMenus.has(Menu))
26
+ return Menu;
27
+ const known = wrappers.get(Menu);
28
+ if (known)
29
+ return known;
30
+ function SettledMenu(props) {
31
+ const items = useMemo(() => settleMenuGroups(props.items), [props.items]);
32
+ return createElement(Menu, { ...props, items });
33
+ }
34
+ SettledMenu.displayName = `Settled(${Menu.displayName ?? (Menu.name || "Menu")})`;
35
+ wrappers.set(Menu, SettledMenu);
36
+ settledMenus.add(SettledMenu);
37
+ return SettledMenu;
38
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ import type { ViewsInputProps } from "./components.js";
3
+ /**
4
+ * The package's own `Input`, for an app that hands none: a bare `<input>` carrying exactly what the
5
+ * editor hands it, `ref` included, and no look of its own. `chrome` is a hint for an app's frame, so
6
+ * it never reaches the element.
7
+ */
8
+ export declare function PlainInput({ chrome: _chrome, ...props }: ViewsInputProps): ReactNode;
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export function PlainInput({ chrome: _chrome, ...props }) {
4
+ return _jsx("input", { ...props });
5
+ }
@@ -25,11 +25,33 @@ export type ViewsPrefsPort = {
25
25
  set: <T>(key: string, value: T) => void;
26
26
  subscribe: (key: string, listener: () => void) => () => void;
27
27
  };
28
+ /** A question asked before an act, for the person to answer: the app's own dialog, or the browser's. */
29
+ export type ViewsConfirmRequest = {
30
+ /** The question, worded by the package's message (a row's Delete: `views.menus.row-delete-confirm`). */
31
+ message: string;
32
+ /** The yes button's words (a row's Delete: `views.menus.row-delete`). */
33
+ confirmLabel: string;
34
+ /** What the act is done to, as the host names it (a row's `deleteLabel`). Absent when it names nothing. */
35
+ subject?: string;
36
+ /** The act removes something: the app draws its destructive look. */
37
+ destructive?: boolean;
38
+ };
39
+ /** Resolves to whether the person said yes. */
40
+ export type ViewsConfirmPort = (request: ViewsConfirmRequest) => Promise<boolean>;
28
41
  export type ViewsPorts = {
29
42
  toast: ViewsToastPort;
30
43
  haptics: ViewsHapticsPort;
31
44
  clipboard: ViewsClipboardPort;
32
45
  viewPrefs: ViewsPrefsPort;
46
+ /** Asks before a destructive act (a row's Delete). Absent: the browser's own confirm with `message`. */
47
+ confirm?: ViewsConfirmPort;
48
+ };
49
+ /** The ports as the provider hands them on: `confirm` always there, the browser's where the app
50
+ * handed none. */
51
+ export type ViewsResolvedPorts = ViewsPorts & {
52
+ confirm: ViewsConfirmPort;
33
53
  };
54
+ /** The browser's own dialog, read when it is asked, so a server render never reaches `window`. */
55
+ export declare const browserConfirm: ViewsConfirmPort;
34
56
  /** Ports that do nothing: a server render, a test, an app without a device. */
35
57
  export declare const NOOP_PORTS: ViewsPorts;
@@ -1,3 +1,4 @@
1
+ export const browserConfirm = async ({ message }) => window.confirm(message);
1
2
  const _portsMatchContract = true;
2
3
  void _portsMatchContract;
3
4
  export const NOOP_PORTS = {
package/dist/react.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { ViewsProvider, useViews } from "./provider/ViewsProvider.js";
2
2
  export type { ViewsContextValue, ViewsProviderProps } from "./provider/ViewsProvider.js";
3
- export type { ViewsAlign, ViewsAnchor, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsMenuItem, ViewsMenuProps, ViewsOpenChange, ViewsPopoverProps, ViewsSheetProps, ViewsSide, ViewsTooltipProps, } from "./provider/components.js";
3
+ export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
4
+ export type { ViewsAlign, ViewsAnchor, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsInputProps, ViewsMenuItem, ViewsMenuProps, ViewsOpenChange, ViewsPopoverProps, ViewsResolvedComponents, ViewsSheetProps, ViewsSide, ViewsTooltipProps, } from "./provider/components.js";
4
5
  export type { ViewsIconProps, ViewsIcons } from "./provider/icons.js";
5
6
  export { NOOP_PORTS } from "./provider/ports.js";
6
- export type { ViewsClipboardPort, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsToastPort, } from "./provider/ports.js";
7
+ export type { ViewsClipboardPort, ViewsConfirmPort, ViewsConfirmRequest, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsResolvedPorts, ViewsToastPort, } from "./provider/ports.js";
7
8
  export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
8
9
  export type { ViewsAtoms, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsStatusBadgeProps, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, } from "./atoms/types.js";
9
10
  export type { ComponentName, PortName, ViewsIconName, ViewsMessage, ViewsMessageResolver } from "./contract.js";
package/dist/react.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use client";
2
2
  export { ViewsProvider, useViews } from "./provider/ViewsProvider.js";
3
+ export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
3
4
  export { NOOP_PORTS } from "./provider/ports.js";
4
5
  export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
@@ -6,6 +6,8 @@ type SelectCheckboxProps = {
6
6
  onChange: (next: boolean, shift: boolean) => void;
7
7
  "aria-label"?: string;
8
8
  className?: string;
9
+ /** -1 takes it out of the Tab order, where a surface reaches it by its own keys (the grid's ←). */
10
+ tabIndex?: number;
9
11
  };
10
12
  /**
11
13
  * Row selection checkbox: the app's checkbox (in the portal, its neutral selection skin).
@@ -13,5 +15,5 @@ type SelectCheckboxProps = {
13
15
  * holds it) is hovered — not the whole row — and reads the shift key off the press that changed
14
16
  * it, for range selection.
15
17
  */
16
- export declare function SelectCheckbox({ checked, revealed, onChange, className, "aria-label": ariaLabel, }: SelectCheckboxProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function SelectCheckbox({ checked, revealed, onChange, className, tabIndex, "aria-label": ariaLabel, }: SelectCheckboxProps): import("react/jsx-runtime").JSX.Element;
17
19
  export {};
@@ -2,9 +2,9 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { cx } from "../internal/cx.js";
4
4
  import { useViews } from "../provider/context.js";
5
- export function SelectCheckbox({ checked, revealed, onChange, className, "aria-label": ariaLabel, }) {
5
+ export function SelectCheckbox({ checked, revealed, onChange, className, tabIndex, "aria-label": ariaLabel, }) {
6
6
  const { Checkbox } = useViews().components;
7
- return (_jsx(Checkbox, { checked: checked, "aria-label": ariaLabel, onCheckedChange: (next, details) => onChange(next, pressedWithShift(details?.event)), className: cx("opacity-0 group-hover/selzone:opacity-100", revealed && "opacity-100", checked && "opacity-100", className) }));
7
+ return (_jsx(Checkbox, { checked: checked, tabIndex: tabIndex, "aria-label": ariaLabel, onCheckedChange: (next, details) => onChange(next, pressedWithShift(details?.event)), className: cx("opacity-0 group-hover/selzone:opacity-100", revealed && "opacity-100", checked && "opacity-100", className) }));
8
8
  }
9
9
  function pressedWithShift(event) {
10
10
  return event !== undefined && "shiftKey" in event && event.shiftKey === true;
@@ -3,8 +3,8 @@ import { useCallback, useEffect, useRef, } from "react";
3
3
  export const ROW_CHECK_ATTR = "data-row-check";
4
4
  const EDGE_PX = 40;
5
5
  const MAX_STEP_PX = 24;
6
- function verticalScrollerOf(root) {
7
- let node = root;
6
+ function verticalScrollerOf(from) {
7
+ let node = from;
8
8
  while (node && node !== document.body) {
9
9
  const oy = getComputedStyle(node).overflowY;
10
10
  if ((oy === "auto" || oy === "scroll") && node.scrollHeight > node.clientHeight)
@@ -92,8 +92,8 @@ export function useCheckDragSelect({ enabled, rootRef, rowIds, rowIdOf = (attr)
92
92
  raf = requestAnimationFrame(tick);
93
93
  };
94
94
  const maybeScroll = (d) => {
95
- if (!scroller && rootRef.current)
96
- scroller = verticalScrollerOf(rootRef.current);
95
+ if (!scroller)
96
+ scroller = verticalScrollerOf(d.rowEl);
97
97
  if (!scroller || raf != null)
98
98
  return;
99
99
  if (edgeStep(d.lastY, scroller) !== 0)
@@ -139,7 +139,7 @@ export function useCheckDragSelect({ enabled, rootRef, rowIds, rowIdOf = (attr)
139
139
  return false;
140
140
  const rowEl = target.closest("[data-row-id]");
141
141
  const attr = rowEl?.getAttribute("data-row-id");
142
- if (!attr)
142
+ if (!rowEl || !attr)
143
143
  return false;
144
144
  const rowId = rowIdOfRef.current(attr);
145
145
  draggedRef.current = false;
@@ -149,6 +149,7 @@ export function useCheckDragSelect({ enabled, rootRef, rowIds, rowIdOf = (attr)
149
149
  lastX: e.clientX,
150
150
  lastY: e.clientY,
151
151
  rowId,
152
+ rowEl,
152
153
  value: !isSelectedRef.current(rowId),
153
154
  active: false,
154
155
  original: new Map(),