@viewkitjs/views 0.5.0 → 0.6.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 (413) hide show
  1. package/CHANGELOG.md +620 -0
  2. package/README.md +4 -2
  3. package/dist/atoms/Avatar.d.ts +2 -0
  4. package/dist/atoms/Avatar.js +13 -0
  5. package/dist/atoms/CellMore.d.ts +2 -0
  6. package/dist/atoms/CellMore.js +4 -0
  7. package/dist/atoms/DisabledReason.d.ts +11 -0
  8. package/dist/atoms/DisabledReason.js +10 -0
  9. package/dist/atoms/DrillRows.d.ts +2 -2
  10. package/dist/atoms/DrillRows.js +7 -5
  11. package/dist/atoms/Loading.d.ts +6 -0
  12. package/dist/atoms/Loading.js +4 -1
  13. package/dist/atoms/PanelRows.js +3 -5
  14. package/dist/atoms/Pill.d.ts +2 -0
  15. package/dist/atoms/Pill.js +25 -0
  16. package/dist/atoms/RangeCalendar.d.ts +8 -0
  17. package/dist/atoms/RangeCalendar.js +30 -0
  18. package/dist/atoms/RelationRoles.js +2 -2
  19. package/dist/atoms/SelectionSheet.js +5 -4
  20. package/dist/atoms/ToolbarButton.d.ts +2 -0
  21. package/dist/atoms/ToolbarButton.js +18 -0
  22. package/dist/atoms/defaults.js +10 -0
  23. package/dist/atoms/types.d.ts +141 -1
  24. package/dist/cells/cell-format.d.ts +10 -1
  25. package/dist/cells/cell-title.d.ts +5 -1
  26. package/dist/cells/cell-title.js +2 -2
  27. package/dist/cells/cell-values.js +22 -7
  28. package/dist/cells/relation-wrap.js +1 -1
  29. package/dist/contract.d.ts +351 -15
  30. package/dist/contract.js +482 -4
  31. package/dist/display/actor.js +1 -1
  32. package/dist/display/boolean.js +5 -0
  33. package/dist/display/entity-chip.d.ts +12 -9
  34. package/dist/display/entity-chip.js +4 -5
  35. package/dist/display/fit-values.d.ts +34 -0
  36. package/dist/display/fit-values.js +45 -0
  37. package/dist/display/location.js +1 -1
  38. package/dist/display/multi-value.js +72 -8
  39. package/dist/display/options.d.ts +9 -1
  40. package/dist/display/relation.js +1 -1
  41. package/dist/display/rich-text.js +17 -6
  42. package/dist/display/select.js +6 -4
  43. package/dist/display/status-steps.d.ts +8 -0
  44. package/dist/display/status-steps.js +18 -0
  45. package/dist/display/viewer.js +1 -0
  46. package/dist/editors/BodyFrame.d.ts +29 -0
  47. package/dist/editors/BodyFrame.js +80 -0
  48. package/dist/editors/DateEditor.js +13 -17
  49. package/dist/editors/LocationEditor.d.ts +2 -0
  50. package/dist/editors/LocationEditor.js +29 -5
  51. package/dist/editors/NameEditor.d.ts +2 -0
  52. package/dist/editors/NameEditor.js +27 -7
  53. package/dist/editors/NumberEditor.d.ts +18 -0
  54. package/dist/editors/NumberEditor.js +29 -2
  55. package/dist/editors/RangeEditor.d.ts +2 -0
  56. package/dist/editors/RangeEditor.js +29 -4
  57. package/dist/editors/SelectEditor.d.ts +5 -0
  58. package/dist/editors/SelectEditor.js +3 -2
  59. package/dist/editors/TextEditor.d.ts +11 -1
  60. package/dist/editors/TextEditor.js +25 -8
  61. package/dist/editors/ValueListEditor.d.ts +7 -0
  62. package/dist/editors/ValueListEditor.js +60 -48
  63. package/dist/editors/body-panel.d.ts +7 -0
  64. package/dist/editors/body-panel.js +8 -0
  65. package/dist/editors/edit-session.d.ts +20 -3
  66. package/dist/editors/edit-session.js +43 -3
  67. package/dist/editors/leave-scope.d.ts +23 -0
  68. package/dist/editors/leave-scope.js +28 -0
  69. package/dist/editors/number-body.d.ts +29 -0
  70. package/dist/editors/number-body.js +37 -0
  71. package/dist/editors/parts-body.d.ts +66 -0
  72. package/dist/editors/parts-body.js +114 -0
  73. package/dist/editors/tab-ends.d.ts +5 -0
  74. package/dist/editors/tab-ends.js +7 -0
  75. package/dist/editors/text-body.d.ts +16 -0
  76. package/dist/editors/text-body.js +30 -0
  77. package/dist/editors/values-body.d.ts +47 -0
  78. package/dist/editors/values-body.js +140 -0
  79. package/dist/field-row/FieldRow.d.ts +7 -0
  80. package/dist/field-row/FieldRow.js +44 -24
  81. package/dist/field-row/FieldRowLane.js +12 -4
  82. package/dist/field-row/editors/RowChipsEditor.js +3 -1
  83. package/dist/field-row/editors/RowEditor.js +2 -1
  84. package/dist/field-row/editors/RowNameEditor.d.ts +5 -2
  85. package/dist/field-row/editors/RowNameEditor.js +12 -5
  86. package/dist/field-row/editors/RowNumberEditor.js +18 -2
  87. package/dist/field-row/editors/RowPlaceEditor.js +4 -2
  88. package/dist/field-row/editors/RowRangeEditor.d.ts +5 -2
  89. package/dist/field-row/editors/RowRangeEditor.js +13 -6
  90. package/dist/field-row/editors/RowRelationEditor.js +5 -2
  91. package/dist/field-row/editors/RowSelectEditor.js +4 -1
  92. package/dist/field-row/editors/RowTextEditor.d.ts +1 -1
  93. package/dist/field-row/editors/RowTextEditor.js +12 -3
  94. package/dist/field-row/editors/RowValueListEditor.d.ts +2 -1
  95. package/dist/field-row/editors/RowValueListEditor.js +17 -4
  96. package/dist/field-row/editors/host.d.ts +3 -0
  97. package/dist/field-row/editors/row-session.d.ts +12 -1
  98. package/dist/field-row/editors/row-session.js +52 -2
  99. package/dist/field-row/field-row-button.d.ts +40 -0
  100. package/dist/field-row/field-row-button.js +18 -0
  101. package/dist/field-row/field-row-checkbox.d.ts +9 -0
  102. package/dist/field-row/field-row-checkbox.js +7 -0
  103. package/dist/filters/filter-model.d.ts +2 -0
  104. package/dist/grid/chrome/GridAddColumn.js +17 -3
  105. package/dist/grid/chrome/GridAggregateMenu.d.ts +2 -0
  106. package/dist/grid/chrome/GridAggregateMenu.js +2 -0
  107. package/dist/grid/chrome/GridCellEditors.js +16 -6
  108. package/dist/grid/chrome/GridCellOutline.d.ts +7 -4
  109. package/dist/grid/chrome/GridCellOutline.js +4 -2
  110. package/dist/grid/chrome/GridChipsEditor.js +3 -1
  111. package/dist/grid/chrome/GridColumnMenu.d.ts +4 -1
  112. package/dist/grid/chrome/GridColumnMenu.js +5 -3
  113. package/dist/grid/chrome/GridColumnSortSection.d.ts +20 -0
  114. package/dist/grid/chrome/GridColumnSortSection.js +18 -1
  115. package/dist/grid/chrome/GridFooter.d.ts +4 -1
  116. package/dist/grid/chrome/GridFooter.js +6 -4
  117. package/dist/grid/chrome/GridGroupMenu.d.ts +5 -1
  118. package/dist/grid/chrome/GridGroupMenu.js +30 -8
  119. package/dist/grid/chrome/GridHeader.d.ts +5 -1
  120. package/dist/grid/chrome/GridHeader.js +9 -5
  121. package/dist/grid/chrome/GridLongTextEditor.js +15 -11
  122. package/dist/grid/chrome/GridNameEditor.js +4 -2
  123. package/dist/grid/chrome/GridNumberEditor.d.ts +8 -1
  124. package/dist/grid/chrome/GridNumberEditor.js +15 -3
  125. package/dist/grid/chrome/GridPager.d.ts +7 -0
  126. package/dist/grid/chrome/GridPager.js +34 -0
  127. package/dist/grid/chrome/GridPlaceEditor.js +4 -2
  128. package/dist/grid/chrome/GridRangeEditor.js +12 -4
  129. package/dist/grid/chrome/GridRelationEditor.js +5 -2
  130. package/dist/grid/chrome/GridRow.js +18 -6
  131. package/dist/grid/chrome/GridRowActions.d.ts +8 -3
  132. package/dist/grid/chrome/GridRowActions.js +16 -6
  133. package/dist/grid/chrome/GridRowCells.js +23 -7
  134. package/dist/grid/chrome/GridRowGlyph.d.ts +3 -1
  135. package/dist/grid/chrome/GridRowGlyph.js +7 -2
  136. package/dist/grid/chrome/GridSelectEditor.js +6 -3
  137. package/dist/grid/chrome/GridStructure.d.ts +6 -1
  138. package/dist/grid/chrome/GridStructure.js +32 -8
  139. package/dist/grid/chrome/GridTable.js +36 -24
  140. package/dist/grid/chrome/GridTableSurface.d.ts +5 -1
  141. package/dist/grid/chrome/GridTableSurface.js +5 -2
  142. package/dist/grid/chrome/GridTextEditor.d.ts +5 -1
  143. package/dist/grid/chrome/GridTextEditor.js +13 -3
  144. package/dist/grid/chrome/GridValueListEditor.d.ts +12 -4
  145. package/dist/grid/chrome/GridValueListEditor.js +11 -3
  146. package/dist/grid/chrome/StuckMarker.d.ts +3 -1
  147. package/dist/grid/chrome/StuckMarker.js +6 -2
  148. package/dist/grid/chrome/cells.d.ts +4 -2
  149. package/dist/grid/chrome/cells.js +2 -2
  150. package/dist/grid/chrome/grid-add-column-items.d.ts +1 -1
  151. package/dist/grid/chrome/grid-add-column-items.js +8 -1
  152. package/dist/grid/chrome/grid-button.d.ts +32 -0
  153. package/dist/grid/chrome/grid-button.js +12 -0
  154. package/dist/grid/chrome/grid-cell-classes.d.ts +38 -0
  155. package/dist/grid/chrome/grid-cell-classes.js +30 -0
  156. package/dist/grid/chrome/grid-column-menu-items.d.ts +3 -0
  157. package/dist/grid/chrome/grid-column-menu-items.js +32 -3
  158. package/dist/grid/chrome/grid-columns-template.d.ts +27 -0
  159. package/dist/grid/chrome/grid-columns-template.js +13 -0
  160. package/dist/grid/chrome/grid-edit-session.d.ts +4 -1
  161. package/dist/grid/chrome/grid-edit-session.js +11 -1
  162. package/dist/grid/chrome/grid-group-menu-items.d.ts +8 -1
  163. package/dist/grid/chrome/grid-group-menu-items.js +17 -0
  164. package/dist/grid/chrome/grid-group-menu-parts.d.ts +10 -6
  165. package/dist/grid/chrome/grid-group-menu-parts.js +4 -2
  166. package/dist/grid/chrome/grid-hover.d.ts +4 -1
  167. package/dist/grid/chrome/grid-hover.js +16 -6
  168. package/dist/grid/chrome/grid-pages.d.ts +15 -0
  169. package/dist/grid/chrome/grid-pages.js +9 -0
  170. package/dist/grid/chrome/grid-row-menu-items.js +18 -10
  171. package/dist/grid/chrome/grid-row-props.d.ts +6 -2
  172. package/dist/grid/chrome/grid-row-window.d.ts +7 -0
  173. package/dist/grid/chrome/grid-row-window.js +35 -1
  174. package/dist/grid/chrome/grid-table-props.d.ts +38 -4
  175. package/dist/grid/chrome/useGridColumnLayout.d.ts +3 -1
  176. package/dist/grid/chrome/useGridColumnLayout.js +29 -9
  177. package/dist/grid/chrome/useGridPartColumns.js +1 -1
  178. package/dist/grid/chrome/useGridScrollArea.js +2 -0
  179. package/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -0
  180. package/dist/grid/chrome/useGridTableInteractionModel.js +5 -3
  181. package/dist/grid/chrome/useGridTableSelection.d.ts +3 -1
  182. package/dist/grid/chrome/useGridTableSelection.js +2 -2
  183. package/dist/grid/chrome/useHeaderDragReorder.js +2 -0
  184. package/dist/grid/core/editing-controller.d.ts +36 -11
  185. package/dist/grid/core/editing-controller.js +92 -25
  186. package/dist/grid/core/grid-aria.d.ts +4 -0
  187. package/dist/grid/core/grid-aria.js +6 -4
  188. package/dist/grid/core/grid-focus.d.ts +6 -0
  189. package/dist/grid/core/grid-focus.js +28 -5
  190. package/dist/grid/core/useGridEditing.d.ts +11 -2
  191. package/dist/grid/core/useGridEditing.js +9 -5
  192. package/dist/grid/core/write-states.d.ts +20 -0
  193. package/dist/grid/core/write-states.js +21 -0
  194. package/dist/grid/grid-format-props.d.ts +26 -0
  195. package/dist/grid/grid-format-props.js +65 -0
  196. package/dist/grid/index.d.ts +3 -1
  197. package/dist/grid/index.js +1 -0
  198. package/dist/grid/useGridTablePrefs.d.ts +19 -20
  199. package/dist/grid/useGridTablePrefs.js +6 -58
  200. package/dist/grid/useGridTableSettings.d.ts +60 -0
  201. package/dist/grid/useGridTableSettings.js +61 -0
  202. package/dist/internal/count.d.ts +3 -0
  203. package/dist/internal/count.js +3 -0
  204. package/dist/model/body-frame.d.ts +16 -0
  205. package/dist/model/body-frame.js +5 -0
  206. package/dist/model/column-capabilities.d.ts +4 -1
  207. package/dist/model/column-capabilities.js +4 -1
  208. package/dist/model/column-filters.d.ts +7 -4
  209. package/dist/model/column-filters.js +26 -18
  210. package/dist/model/column-inspect.d.ts +3 -2
  211. package/dist/model/column-inspect.js +3 -1
  212. package/dist/model/column-sort.d.ts +11 -0
  213. package/dist/model/column-sort.js +14 -0
  214. package/dist/model/one-value.d.ts +6 -0
  215. package/dist/model/one-value.js +5 -0
  216. package/dist/model/part-write.js +1 -1
  217. package/dist/model/place-parts.d.ts +6 -0
  218. package/dist/model/place-parts.js +14 -0
  219. package/dist/model/relation-filters.d.ts +13 -2
  220. package/dist/model/relation-filters.js +9 -4
  221. package/dist/model/row-icon.d.ts +16 -6
  222. package/dist/model/settings-columns.d.ts +34 -0
  223. package/dist/model/settings-columns.js +146 -0
  224. package/dist/model/settings-look.d.ts +17 -0
  225. package/dist/model/settings-look.js +23 -0
  226. package/dist/model/view-rules.js +6 -2
  227. package/dist/panels/availability.d.ts +26 -0
  228. package/dist/panels/availability.js +28 -0
  229. package/dist/panels/filter/DateFilterBody.d.ts +42 -0
  230. package/dist/panels/filter/DateFilterBody.js +64 -0
  231. package/dist/panels/filter/DateFilterCalendar.d.ts +19 -0
  232. package/dist/panels/filter/DateFilterCalendar.js +37 -0
  233. package/dist/panels/filter/DateFilterInput.d.ts +16 -0
  234. package/dist/panels/filter/DateFilterInput.js +37 -0
  235. package/dist/panels/filter/FilterIcon.d.ts +7 -0
  236. package/dist/panels/filter/FilterIcon.js +15 -0
  237. package/dist/panels/filter/MenuSelect.d.ts +12 -0
  238. package/dist/panels/filter/MenuSelect.js +34 -0
  239. package/dist/panels/filter/NumberFilterBody.d.ts +21 -0
  240. package/dist/panels/filter/NumberFilterBody.js +76 -0
  241. package/dist/panels/filter/RangeFilterBody.d.ts +19 -0
  242. package/dist/panels/filter/RangeFilterBody.js +71 -0
  243. package/dist/panels/filter/RelationFilterBody.d.ts +17 -0
  244. package/dist/panels/filter/RelationFilterBody.js +20 -0
  245. package/dist/panels/filter/TextFilterBody.d.ts +31 -0
  246. package/dist/panels/filter/TextFilterBody.js +44 -0
  247. package/dist/panels/filter/TimeScopeDetail.d.ts +6 -0
  248. package/dist/panels/filter/TimeScopeDetail.js +47 -0
  249. package/dist/panels/filter/details.d.ts +17 -0
  250. package/dist/panels/filter/details.js +73 -0
  251. package/dist/panels/filter/filter-list.d.ts +23 -0
  252. package/dist/panels/filter/filter-list.js +38 -0
  253. package/dist/panels/group-sort.d.ts +24 -0
  254. package/dist/panels/group-sort.js +58 -0
  255. package/dist/panels/index.d.ts +24 -0
  256. package/dist/panels/index.js +17 -0
  257. package/dist/panels/labels.d.ts +37 -0
  258. package/dist/panels/labels.js +166 -0
  259. package/dist/panels/model.d.ts +343 -0
  260. package/dist/panels/model.js +77 -0
  261. package/dist/panels/react/GroupBucketsList.d.ts +16 -0
  262. package/dist/panels/react/GroupBucketsList.js +38 -0
  263. package/dist/panels/react/LayoutColumnsList.d.ts +24 -0
  264. package/dist/panels/react/LayoutColumnsList.js +71 -0
  265. package/dist/panels/react/PopoverColumnDetail.d.ts +11 -0
  266. package/dist/panels/react/PopoverColumnDetail.js +24 -0
  267. package/dist/panels/react/chrome.d.ts +17 -0
  268. package/dist/panels/react/chrome.js +8 -0
  269. package/dist/panels/react/column-refusals.d.ts +7 -0
  270. package/dist/panels/react/column-refusals.js +14 -0
  271. package/dist/panels/react/customize.d.ts +26 -0
  272. package/dist/panels/react/customize.js +98 -0
  273. package/dist/panels/react/drag.d.ts +2 -0
  274. package/dist/panels/react/drag.js +6 -0
  275. package/dist/panels/react/field-editor.d.ts +10 -0
  276. package/dist/panels/react/field-editor.js +1 -0
  277. package/dist/panels/react/filter-panel.d.ts +15 -0
  278. package/dist/panels/react/filter-panel.js +48 -0
  279. package/dist/panels/react/layout-detail.d.ts +4 -0
  280. package/dist/panels/react/layout-detail.js +21 -0
  281. package/dist/panels/react/order-details.d.ts +32 -0
  282. package/dist/panels/react/order-details.js +81 -0
  283. package/dist/panels/react/panel-header.d.ts +10 -0
  284. package/dist/panels/react/panel-header.js +12 -0
  285. package/dist/panels/react/panel-sheet.d.ts +19 -0
  286. package/dist/panels/react/panel-sheet.js +22 -0
  287. package/dist/panels/react/popover.d.ts +71 -0
  288. package/dist/panels/react/popover.js +47 -0
  289. package/dist/panels/react/root-list.d.ts +6 -0
  290. package/dist/panels/react/root-list.js +31 -0
  291. package/dist/panels/react/toolbar/ReadyToolbar.d.ts +42 -0
  292. package/dist/panels/react/toolbar/ReadyToolbar.js +92 -0
  293. package/dist/panels/react/toolbar/Toolbar.d.ts +16 -0
  294. package/dist/panels/react/toolbar/Toolbar.js +34 -0
  295. package/dist/panels/react/toolbar/ToolbarButton.d.ts +5 -0
  296. package/dist/panels/react/toolbar/ToolbarButton.js +9 -0
  297. package/dist/panels/react/toolbar/ToolbarFilter.d.ts +19 -0
  298. package/dist/panels/react/toolbar/ToolbarFilter.js +32 -0
  299. package/dist/panels/react/toolbar/ToolbarNew.d.ts +12 -0
  300. package/dist/panels/react/toolbar/ToolbarNew.js +21 -0
  301. package/dist/panels/react/toolbar/ToolbarOptions.d.ts +25 -0
  302. package/dist/panels/react/toolbar/ToolbarOptions.js +33 -0
  303. package/dist/panels/react/toolbar/ToolbarSearch.d.ts +9 -0
  304. package/dist/panels/react/toolbar/ToolbarSearch.js +41 -0
  305. package/dist/panels/react/toolbar/ToolbarSort.d.ts +12 -0
  306. package/dist/panels/react/toolbar/ToolbarSort.js +16 -0
  307. package/dist/panels/react/toolbar/ToolbarViews.d.ts +13 -0
  308. package/dist/panels/react/toolbar/ToolbarViews.js +24 -0
  309. package/dist/panels/react/toolbar/context.d.ts +29 -0
  310. package/dist/panels/react/toolbar/context.js +49 -0
  311. package/dist/panels/react/toolbar/panel-part.d.ts +37 -0
  312. package/dist/panels/react/toolbar/panel-part.js +37 -0
  313. package/dist/panels/react/toolbar/panel-state.d.ts +9 -0
  314. package/dist/panels/react/toolbar/panel-state.js +12 -0
  315. package/dist/panels/react/toolbar/use-box-narrow.d.ts +2 -0
  316. package/dist/panels/react/toolbar/use-box-narrow.js +18 -0
  317. package/dist/panels/react/toolbar/use-list-settings-state.d.ts +10 -0
  318. package/dist/panels/react/toolbar/use-list-settings-state.js +10 -0
  319. package/dist/panels/react/view-actions.d.ts +4 -0
  320. package/dist/panels/react/view-actions.js +37 -0
  321. package/dist/panels/react/view-footer.d.ts +16 -0
  322. package/dist/panels/react/view-footer.js +11 -0
  323. package/dist/panels/react/views-row/FoldingViewRow.d.ts +4 -0
  324. package/dist/panels/react/views-row/FoldingViewRow.js +105 -0
  325. package/dist/panels/react/views-row/HScrollRow.d.ts +7 -0
  326. package/dist/panels/react/views-row/HScrollRow.js +42 -0
  327. package/dist/panels/react/views-row/PillGroup.d.ts +30 -0
  328. package/dist/panels/react/views-row/PillGroup.js +86 -0
  329. package/dist/panels/react/views-row/ViewAxes.d.ts +6 -0
  330. package/dist/panels/react/views-row/ViewAxes.js +16 -0
  331. package/dist/panels/react/views-row/ViewCreatePill.d.ts +7 -0
  332. package/dist/panels/react/views-row/ViewCreatePill.js +11 -0
  333. package/dist/panels/react/views-row/ViewPicker.d.ts +5 -0
  334. package/dist/panels/react/views-row/ViewPicker.js +65 -0
  335. package/dist/panels/react/views-row/ViewPickerRow.d.ts +7 -0
  336. package/dist/panels/react/views-row/ViewPickerRow.js +18 -0
  337. package/dist/panels/react/views-row/ViewTabs.d.ts +31 -0
  338. package/dist/panels/react/views-row/ViewTabs.js +29 -0
  339. package/dist/panels/react/views-row/menu-classes.d.ts +6 -0
  340. package/dist/panels/react/views-row/menu-classes.js +3 -0
  341. package/dist/panels/react/views-row/use-anchored-toggle.d.ts +19 -0
  342. package/dist/panels/react/views-row/use-anchored-toggle.js +31 -0
  343. package/dist/panels/react.d.ts +51 -0
  344. package/dist/panels/react.js +43 -0
  345. package/dist/panels/settings/axes.d.ts +28 -0
  346. package/dist/panels/settings/axes.js +71 -0
  347. package/dist/panels/settings/filters.d.ts +5 -0
  348. package/dist/panels/settings/filters.js +62 -0
  349. package/dist/panels/settings/group-buckets.d.ts +23 -0
  350. package/dist/panels/settings/group-buckets.js +73 -0
  351. package/dist/panels/settings/input.d.ts +69 -0
  352. package/dist/panels/settings/input.js +1 -0
  353. package/dist/panels/settings/layout.d.ts +5 -0
  354. package/dist/panels/settings/layout.js +244 -0
  355. package/dist/panels/settings/order.d.ts +19 -0
  356. package/dist/panels/settings/order.js +271 -0
  357. package/dist/panels/settings/settings-panels.d.ts +17 -0
  358. package/dist/panels/settings/settings-panels.js +28 -0
  359. package/dist/panels/toolbar/clear.d.ts +9 -0
  360. package/dist/panels/toolbar/clear.js +26 -0
  361. package/dist/panels/toolbar/counts.d.ts +15 -0
  362. package/dist/panels/toolbar/counts.js +21 -0
  363. package/dist/panels/toolbar/edit-view.d.ts +5 -0
  364. package/dist/panels/toolbar/edit-view.js +18 -0
  365. package/dist/panels/toolbar/model.d.ts +34 -0
  366. package/dist/panels/toolbar/model.js +52 -0
  367. package/dist/panels/use-filter-opened.d.ts +8 -0
  368. package/dist/panels/use-filter-opened.js +11 -0
  369. package/dist/panels/view-state.d.ts +38 -0
  370. package/dist/panels/view-state.js +1 -0
  371. package/dist/panels/views-row/model.d.ts +131 -0
  372. package/dist/panels/views-row/model.js +14 -0
  373. package/dist/provider/ViewsProvider.d.ts +46 -6
  374. package/dist/provider/ViewsProvider.js +32 -2
  375. package/dist/provider/components.d.ts +258 -11
  376. package/dist/provider/context.d.ts +21 -2
  377. package/dist/react.d.ts +5 -2
  378. package/dist/selection/SelectionBar.js +13 -7
  379. package/dist/selection/bar-overflow.js +14 -1
  380. package/dist/selection/bar-parts.d.ts +4 -2
  381. package/dist/selection/bar-parts.js +5 -3
  382. package/dist/selection/useListSelectionShortcuts.d.ts +3 -2
  383. package/dist/selection/useListSelectionShortcuts.js +1 -1
  384. package/dist/selection/verbs.d.ts +7 -0
  385. package/docs/contract.md +307 -41
  386. package/docs/getting-started.md +1 -1
  387. package/docs/guides/atoms.md +37 -5
  388. package/docs/guides/columns.md +1 -1
  389. package/docs/guides/display.md +3 -2
  390. package/docs/guides/editors.md +4 -3
  391. package/docs/guides/selection.md +4 -2
  392. package/docs/guides/the-grid.md +21 -11
  393. package/docs/guides/the-provider.md +22 -6
  394. package/docs/index.md +2 -2
  395. package/docs/install.md +2 -3
  396. package/docs/reference/cells.md +1 -1
  397. package/docs/reference/display.md +5 -4
  398. package/docs/reference/editors-location.md +3 -1
  399. package/docs/reference/editors-name.md +3 -1
  400. package/docs/reference/editors-number.md +1 -0
  401. package/docs/reference/editors-range.md +3 -1
  402. package/docs/reference/editors-session.md +1 -0
  403. package/docs/reference/editors-text.md +2 -2
  404. package/docs/reference/editors-value-list.md +1 -1
  405. package/docs/reference/field-row.md +2 -2
  406. package/docs/reference/grid.md +8 -5
  407. package/docs/reference/panels-react.md +101 -0
  408. package/docs/reference/panels.md +123 -0
  409. package/docs/reference/react.md +39 -16
  410. package/docs/reference/selection.md +5 -5
  411. package/docs/reference/views.md +17 -12
  412. package/package.json +16 -6
  413. package/skills/views/SKILL.md +4 -3
@@ -2,10 +2,13 @@ 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 { ViewsMenuRoute, ViewsResolvedComponents, ViewsSelectionBarSettings, ViewsSheetActionsPlace } from "./components.js";
5
+ import type { ViewsDatePicks, ViewsFieldRowButtons, ViewsFieldRowCheckboxes, ViewsGridButtons, ViewsGridCheckboxes, ViewsMenuRoute, ViewsResolvedComponents, ViewsSelectionBarSettings, ViewsSheetActionsPlace } from "./components.js";
6
6
  import type { ViewsIcons } from "./icons.js";
7
7
  import type { ViewsResolvedPorts } from "./ports.js";
8
8
  import type { ViewsEscapeRules } from "../editors/escape-rule.js";
9
+ import type { ViewsBodyFrame } from "../model/body-frame.js";
10
+ import type { ViewsSeveralValues } from "../display/fit-values.js";
11
+ import type { ViewsOneValueEditors } from "../model/one-value.js";
9
12
  export type ViewsContextValue = {
10
13
  /** The app's components, with the optional ones filled: the app's own, or the package's plain default. */
11
14
  components: ViewsResolvedComponents;
@@ -19,16 +22,32 @@ export type ViewsContextValue = {
19
22
  presentation?: (defaults: FieldPresentation) => FieldPresentation;
20
23
  /** The media query that means a desktop: the app's own, or `DEFAULT_DESKTOP_QUERY`. */
21
24
  desktopQuery: string;
22
- /** Where the editor panel's ✕ and ✓ stand on a phone. Absent means `bar`. */
25
+ /** Where the editor panel's ✕ and ✓, and a toolbar panel's ✕, stand on a phone. Absent means `bar`. */
23
26
  sheetActions?: ViewsSheetActionsPlace;
24
27
  /** What Escape does per field type (`ViewsProvider`'s `escape`); absent, every type throws the edit away. */
25
28
  escape?: ViewsEscapeRules;
29
+ /** Which single types open as the value list holding one (`ViewsProvider`'s `oneValue`); absent, the text box. */
30
+ oneValue?: ViewsOneValueEditors;
26
31
  /** The grid says why the app refused an edit it sent (`ViewsProvider`'s `sayRefusals`); absent, it says nothing. */
27
32
  sayRefusals?: boolean;
28
33
  /** How the grid opens its own menus (`ViewsProvider`'s `menus`). Absent means `popover`. */
29
34
  menus?: ViewsMenuRoute;
35
+ /** Who draws the buttons the grid draws itself (`ViewsProvider`'s `gridButtons`). Absent means `own`. */
36
+ gridButtons?: ViewsGridButtons;
37
+ /** How a cell of several values draws on one line (`ViewsProvider`'s `severalValues`). Absent means `first`. */
38
+ severalValues?: ViewsSeveralValues;
39
+ /** Who draws a yes/no cell's box in the grid (`ViewsProvider`'s `gridCheckboxes`). Absent means `own`. */
40
+ gridCheckboxes?: ViewsGridCheckboxes;
41
+ /** Who draws a field row's own buttons (`ViewsProvider`'s `fieldRowButtons`). Absent means `own`. */
42
+ fieldRowButtons?: ViewsFieldRowButtons;
43
+ /** Who draws a field row's yes/no box (`ViewsProvider`'s `fieldRowCheckboxes`). Absent means `own`. */
44
+ fieldRowCheckboxes?: ViewsFieldRowCheckboxes;
45
+ /** Who frames a whole body the app hands (`ViewsProvider`'s `bodyFrame`). Absent means `views`. */
46
+ bodyFrame?: ViewsBodyFrame;
30
47
  /** Where the selection bar sits (`ViewsProvider`'s `selectionBar`); absent, the package's defaults. */
31
48
  selectionBar?: ViewsSelectionBarSettings;
49
+ /** The quick days the date editors offer (`ViewsProvider`'s `datePicks`); absent, today, tomorrow and next Monday. */
50
+ datePicks?: ViewsDatePicks;
32
51
  };
33
52
  export declare const ViewsContext: import("react").Context<ViewsContextValue | null>;
34
53
  export declare function useViews(): ViewsContextValue;
package/dist/react.d.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  export { ViewsProvider, useViews } from "./provider/ViewsProvider.js";
2
2
  export type { ViewsContextValue, ViewsProviderProps } from "./provider/ViewsProvider.js";
3
3
  export type { EditEscape, ViewsEscapeRules } from "./editors/escape-rule.js";
4
+ export type { ViewsOneValueEditors } from "./model/one-value.js";
5
+ export type { ViewsBodyFrame } from "./model/body-frame.js";
4
6
  export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
5
- export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsDateBodyProps, ViewsDatePick, ViewsInputProps, ViewsMenuItem, ViewsMenuProps, ViewsMenuRoute, ViewsOpenChange, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsPopoverProps, ViewsResolvedComponents, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsTooltipProps, } from "./provider/components.js";
7
+ export type { ViewsSeveralValues } from "./display/fit-values.js";
8
+ export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsGridButtons, ViewsSelectionChip, ViewsGridCheckboxes, ViewsFieldRowButtons, ViewsFieldRowCheckboxes, ViewsInputProps, ViewsMenuItem, ViewsMenuProps, ViewsMenuRoute, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsResolvedComponents, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, } from "./provider/components.js";
6
9
  export type { ViewsIconProps, ViewsIcons } from "./provider/icons.js";
7
10
  export { NOOP_PORTS } from "./provider/ports.js";
8
11
  export type { ViewsClipboardPort, ViewsConfirmPort, ViewsConfirmRequest, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsResolvedPorts, ViewsToastPort, } from "./provider/ports.js";
9
12
  export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
10
- export type { ViewsAtoms, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsRelationRolesProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsSelectionSheetProps, ViewsStatusBadgeProps, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, ViewsChoiceRowProps, ViewsCheckRowProps, ViewsRadioRowProps, ViewsDirectionButtonProps, ViewsMenuRowProps, ViewsToggleRowProps, ViewsPanelSearchProps, } from "./atoms/types.js";
13
+ export type { ViewsAtoms, ViewsAvatarProps, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsRelationRolesProps, ViewsCellMoreProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsSelectionSheetProps, ViewsStatusBadgeProps, ViewsStatusOption, ViewsStatusPlace, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, ViewsChoiceRowProps, ViewsCheckRowProps, ViewsRadioRowProps, ViewsDirectionButtonProps, ViewsMenuRowProps, ViewsToggleRowProps, ViewsPanelSearchProps, ViewsPillProps, ViewsRangeCalendarProps, ViewsToolbarButtonProps, } from "./atoms/types.js";
11
14
  export type { ComponentName, PortName, ViewsIconName, ViewsMessage, ViewsMessageResolver } from "./contract.js";
@@ -4,6 +4,7 @@ import { useRef, useState } from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import { cx } from "../internal/cx.js";
6
6
  import { ELEMENT_RESET } from "../internal/reset.js";
7
+ import { DisabledReason } from "../atoms/DisabledReason.js";
7
8
  import { useViews } from "../provider/context.js";
8
9
  import { useDesktop, useMediaQuery } from "../provider/desktop.js";
9
10
  import { overflowItems, splitVerbs } from "./bar-overflow.js";
@@ -23,14 +24,14 @@ export function SelectionBar(props) {
23
24
  return createPortal(_jsx("div", { "data-slot": "vk-selection-bar", className: cx("fixed left-1/2 -translate-x-1/2", placement?.className), style: { bottom: placement?.bottom ?? DEFAULT_BOTTOM, zIndex: placement?.zIndex ?? DEFAULT_LAYER }, children: phone ? _jsx(SelectionBarPhone, { ...props }) : _jsx(DesktopBar, { ...props }) }), document.body);
24
25
  }
25
26
  function DesktopBar({ count, onClear, verbs, busy = false, onDelete, deleteLabel }) {
26
- const { components, icons, messages } = useViews();
27
+ const { components, icons, messages, selectionBar } = useViews();
27
28
  const { Button, Tooltip } = components;
28
29
  const { inline, overflow } = splitVerbs(verbs);
29
30
  const Close = icons.close;
30
31
  const Trash = icons.delete;
31
32
  const trashLabel = deleteLabel ?? messages({ key: "views.selection.delete" });
32
33
  const deselect = messages({ key: "views.selection.deselect-all" });
33
- return (_jsxs("div", { "data-slot": "vk-selection-pill", className: cx(PILL_CLASS, "pl-1.5"), children: [_jsx(Tooltip, { side: "top", delayMs: 300, className: "flex items-center gap-2", content: _jsxs(_Fragment, { children: [deselect, _jsx("span", { className: "rounded-sm border border-solid border-(color:--vk-border) px-1 py-px text-[10px] font-medium text-(color:--vk-fg-subtle)", children: messages({ key: "views.selection.escape" }) })] }), children: _jsxs("button", { type: "button", "data-slot": "vk-selection-chip", onClick: onClear, disabled: busy, "aria-label": deselect, className: cx(ELEMENT_RESET, "group/selchip flex h-8 cursor-pointer items-center gap-1.5 rounded-full bg-(color:--vk-neutral) pl-3 pr-2.5 transition-colors hover:bg-(color:--vk-neutral-hovered) disabled:cursor-default disabled:opacity-50"), children: [_jsx(CountWords, { count: count }), _jsx(Close, { className: "h-3 w-3 text-(color:--vk-fg-subtle) transition-colors group-hover/selchip:text-(color:--vk-fg)" })] }) }), _jsxs("div", { className: "flex items-center gap-1 pl-4", children: [inline.map((verb, index) => (_jsx(InlineVerb, { verb: verb, busy: busy }, index))), onDelete ? (_jsx(Button, { size: "icon", variant: "ghost", className: "h-8 w-8 rounded-full text-(color:--vk-danger) hover:bg-(color:--vk-danger-subtlest) hover:text-(color:--vk-danger)", disabled: busy, onClick: onDelete, "aria-label": trashLabel, title: trashLabel, children: _jsx(Trash, { className: "h-4 w-4" }) })) : null] }), _jsx("span", { className: DIVIDER_CLASS }), _jsx(MoreVerbs, { overflow: overflow, busy: busy })] }));
34
+ return (_jsxs("div", { "data-slot": "vk-selection-pill", className: cx(PILL_CLASS, "pl-1.5"), children: [_jsx(Tooltip, { side: "top", delayMs: 300, className: "flex items-center gap-2", content: _jsxs(_Fragment, { children: [deselect, _jsx("span", { className: "rounded-sm border border-solid border-(color:--vk-border) px-1 py-px text-[10px] font-medium text-(color:--vk-fg-subtle)", children: messages({ key: "views.selection.escape" }) })] }), children: selectionBar?.chip === "button" ? (_jsxs(Button, { type: "button", variant: "outline", size: "sm", className: "group/selchip h-8 gap-1.5 rounded-full pl-3 pr-2.5", "data-slot": "vk-selection-chip", "aria-label": deselect, disabled: busy, onClick: onClear, children: [_jsx(CountWords, { count: count }), _jsx(Close, { className: "h-3 w-3 text-(color:--vk-fg-subtle) transition-colors group-hover/selchip:text-(color:--vk-fg)" })] })) : (_jsxs("button", { type: "button", "data-slot": "vk-selection-chip", onClick: onClear, disabled: busy, "aria-label": deselect, className: cx(ELEMENT_RESET, "group/selchip flex h-8 cursor-pointer items-center gap-1.5 rounded-full bg-(color:--vk-neutral) pl-3 pr-2.5 transition-colors hover:bg-(color:--vk-neutral-hovered) disabled:cursor-default disabled:opacity-50"), children: [_jsx(CountWords, { count: count }), _jsx(Close, { className: "h-3 w-3 text-(color:--vk-fg-subtle) transition-colors group-hover/selchip:text-(color:--vk-fg)" })] })) }), _jsxs("div", { className: "flex items-center gap-1 pl-4", children: [inline.map((verb, index) => (_jsx(InlineVerb, { verb: verb, busy: busy }, index))), onDelete ? (_jsx(Button, { size: "icon", variant: "ghost", className: "h-8 w-8 rounded-full text-(color:--vk-danger) hover:bg-(color:--vk-danger-subtlest) hover:text-(color:--vk-danger)", disabled: busy, onClick: onDelete, "aria-label": trashLabel, title: trashLabel, children: _jsx(Trash, { className: "h-4 w-4" }) })) : null] }), _jsx("span", { className: DIVIDER_CLASS }), _jsx(MoreVerbs, { overflow: overflow, busy: busy })] }));
34
35
  }
35
36
  function InlineVerb({ verb, busy }) {
36
37
  const { Button } = useViews().components;
@@ -38,7 +39,10 @@ function InlineVerb({ verb, busy }) {
38
39
  return _jsx(OptionsVerb, { verb: verb, busy: busy });
39
40
  if (verb.kind === "group")
40
41
  return _jsx(GroupVerb, { verb: verb, busy: busy });
41
- return (_jsxs(Button, { size: "sm", variant: "ghost", className: cx("rounded-full", verb.destructive && "text-(color:--vk-danger) hover:text-(color:--vk-danger)"), disabled: busy || verb.disabled, onClick: verb.onClick, children: [verb.icon, verb.label] }));
42
+ return (_jsx(DisabledReason, { reason: offReason(verb, busy), side: "top", className: "inline-flex", children: _jsxs(Button, { size: "sm", variant: "ghost", className: cx("rounded-full", verb.destructive && "text-(color:--vk-danger) hover:text-(color:--vk-danger)"), disabled: busy || verb.disabled, onClick: verb.onClick, children: [verb.icon, verb.label] }) }));
43
+ }
44
+ function offReason(verb, busy) {
45
+ return !busy && verb.disabled ? verb.disabledReason : undefined;
42
46
  }
43
47
  function useAnchoredOpen(disabled) {
44
48
  const [open, setOpen] = useState(false);
@@ -63,12 +67,13 @@ function GroupVerb({ verb, busy }) {
63
67
  const { Button, Menu } = useViews().components;
64
68
  const disabled = Boolean(busy || verb.disabled);
65
69
  const { open, setOpen, anchor, trigger } = useAnchoredOpen(disabled);
66
- return (_jsxs(_Fragment, { children: [_jsx("span", { ...trigger, children: _jsxs(Button, { size: "sm", variant: "ghost", className: "rounded-full", disabled: disabled, "aria-label": verb.label, children: [verb.icon, verb.label] }) }), _jsx(Menu, { open: open, onOpenChange: (next) => setOpen(next), anchor: anchor, side: "top", align: "center", label: verb.label, items: verb.items.map((item, index) => ({
70
+ return (_jsxs(_Fragment, { children: [_jsx(DisabledReason, { reason: offReason(verb, busy), side: "top", className: "inline-flex", children: _jsx("span", { ...trigger, children: _jsxs(Button, { size: "sm", variant: "ghost", className: "rounded-full", disabled: disabled, "aria-label": verb.label, children: [verb.icon, verb.label] }) }) }), _jsx(Menu, { open: open, onOpenChange: (next) => setOpen(next), anchor: anchor, side: "top", align: "center", label: verb.label, items: verb.items.map((item, index) => ({
67
71
  key: String(index),
68
72
  label: item.label,
69
73
  icon: item.icon,
70
74
  onSelect: item.onClick,
71
75
  disabled: item.disabled,
76
+ ...(item.disabled && item.disabledReason ? { disabledReason: item.disabledReason } : {}),
72
77
  destructive: item.destructive,
73
78
  })) })] }));
74
79
  }
@@ -78,7 +83,7 @@ function OptionsVerb({ verb, busy }) {
78
83
  const { List, Row } = atoms;
79
84
  const disabled = Boolean(busy || verb.disabled);
80
85
  const { open, setOpen, anchor, trigger } = useAnchoredOpen(disabled);
81
- return (_jsxs(_Fragment, { children: [_jsx("span", { ...trigger, children: _jsxs(Button, { size: "sm", variant: "ghost", className: "rounded-full", disabled: disabled, "aria-label": verb.label, children: [verb.icon, verb.label] }) }), _jsx(Popover, { open: open, onOpenChange: (next) => setOpen(next), anchor: anchor, side: "top", align: "center", sideOffset: 8, onOutsidePress: (event) => (anchor.current?.contains(event.target) ? false : undefined), chrome: "menu", className: "w-48", children: _jsx(List, { className: "max-h-72 overflow-y-auto overscroll-contain scrollbar-overlay", children: verb.options.map((option) => (_jsx(Row, { size: "compact", label: _jsx(OptionLabel, { option: option }), onClick: () => {
86
+ return (_jsxs(_Fragment, { children: [_jsx(DisabledReason, { reason: offReason(verb, busy), side: "top", className: "inline-flex", children: _jsx("span", { ...trigger, children: _jsxs(Button, { size: "sm", variant: "ghost", className: "rounded-full", disabled: disabled, "aria-label": verb.label, children: [verb.icon, verb.label] }) }) }), _jsx(Popover, { open: open, onOpenChange: (next) => setOpen(next), anchor: anchor, side: "top", align: "center", sideOffset: 8, onOutsidePress: (event) => (anchor.current?.contains(event.target) ? false : undefined), chrome: "menu", className: "w-48", children: _jsx(List, { className: "max-h-72 overflow-y-auto overscroll-contain scrollbar-overlay", children: verb.options.map((option) => (_jsx(Row, { size: "compact", label: _jsx(OptionLabel, { option: option, steps: verb.options }), onClick: () => {
82
87
  setOpen(false);
83
88
  verb.onSelect(option.value);
84
89
  } }, option.value))) }) })] }));
@@ -86,7 +91,8 @@ function OptionsVerb({ verb, busy }) {
86
91
  function MoreVerbs({ overflow, busy }) {
87
92
  const { components, icons, messages } = useViews();
88
93
  const { Button, Menu } = components;
89
- const { open, setOpen, anchor, trigger } = useAnchoredOpen(busy);
94
+ const disabled = busy || overflow.length === 0;
95
+ const { open, setOpen, anchor, trigger } = useAnchoredOpen(disabled);
90
96
  const More = icons.more;
91
- return (_jsxs(_Fragment, { children: [_jsx("span", { ...trigger, children: _jsxs(Button, { size: "sm", variant: "ghost", className: "rounded-full text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)", disabled: busy, "aria-label": messages({ key: "views.selection.more-label" }), children: [_jsx(More, { className: "h-4 w-4" }), messages({ key: "views.selection.more" })] }) }), _jsx(Menu, { open: open, onOpenChange: (next) => setOpen(next), anchor: anchor, side: "top", label: messages({ key: "views.selection.more" }), items: overflowItems(overflow) })] }));
97
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ...trigger, children: _jsxs(Button, { size: "sm", variant: "ghost", className: "rounded-full text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)", disabled: disabled, "aria-label": messages({ key: "views.selection.more-label" }), children: [_jsx(More, { className: "h-4 w-4" }), messages({ key: "views.selection.more" })] }) }), _jsx(Menu, { open: open, onOpenChange: (next) => setOpen(next), anchor: anchor, side: "top", label: messages({ key: "views.selection.more" }), items: overflowItems(overflow) })] }));
92
98
  }
@@ -3,10 +3,19 @@ export function splitVerbs(verbs) {
3
3
  return { inline: verbs.slice(0, INLINE_VERBS), overflow: verbs.slice(INLINE_VERBS) };
4
4
  }
5
5
  export function overflowItems(overflow) {
6
+ const reason = (disabled, why) => disabled && why ? { disabledReason: why } : {};
6
7
  return overflow.map((verb, index) => {
7
8
  const key = `verb-${index}`;
8
9
  if (verb.kind === "action") {
9
- return { key, label: verb.label, icon: verb.icon, onSelect: verb.onClick, disabled: verb.disabled, destructive: verb.destructive };
10
+ return {
11
+ key,
12
+ label: verb.label,
13
+ icon: verb.icon,
14
+ onSelect: verb.onClick,
15
+ disabled: verb.disabled,
16
+ ...reason(verb.disabled, verb.disabledReason),
17
+ destructive: verb.destructive,
18
+ };
10
19
  }
11
20
  if (verb.kind === "group") {
12
21
  return {
@@ -14,6 +23,7 @@ export function overflowItems(overflow) {
14
23
  label: verb.label,
15
24
  icon: verb.icon,
16
25
  disabled: verb.disabled,
26
+ ...reason(verb.disabled, verb.disabledReason),
17
27
  beside: true,
18
28
  children: verb.items.map((item, at) => ({
19
29
  key: `${key}-${at}`,
@@ -21,6 +31,7 @@ export function overflowItems(overflow) {
21
31
  icon: item.icon,
22
32
  onSelect: item.onClick,
23
33
  disabled: verb.disabled || item.disabled,
34
+ ...reason(verb.disabled || item.disabled, item.disabledReason ?? (verb.disabled ? verb.disabledReason : undefined)),
24
35
  destructive: item.destructive,
25
36
  })),
26
37
  };
@@ -30,11 +41,13 @@ export function overflowItems(overflow) {
30
41
  label: verb.label,
31
42
  icon: verb.icon,
32
43
  disabled: verb.disabled,
44
+ ...reason(verb.disabled, verb.disabledReason),
33
45
  beside: true,
34
46
  children: verb.options.map((option) => ({
35
47
  key: `${key}-${option.value}`,
36
48
  label: option.label,
37
49
  disabled: verb.disabled,
50
+ ...reason(verb.disabled, verb.disabledReason),
38
51
  onSelect: () => verb.onSelect(option.value),
39
52
  })),
40
53
  };
@@ -9,7 +9,9 @@ export declare function CountWords({ count }: {
9
9
  count: number;
10
10
  }): ReactNode;
11
11
  /** A value of an options verb as its badge: a status by its slot, a category by its colour, else its words.
12
- * The same badges a cell shows, so setting status on the bar reads as setting it in a cell. */
13
- export declare function OptionLabel({ option }: {
12
+ * The same badges a cell shows, so setting status on the bar reads as setting it in a cell. `steps` is the verb's
13
+ * options, the values it sets, which a status badge is placed among (VK-482). */
14
+ export declare function OptionLabel({ option, steps }: {
14
15
  option: PickerOption;
16
+ steps: readonly PickerOption[];
15
17
  }): ReactNode;
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { placeAmong } from "../display/status-steps.js";
3
4
  import { useViews } from "../provider/context.js";
4
5
  export const PILL_CLASS = "flex items-center gap-2 rounded-full border border-solid border-(color:--vk-border) bg-(color:--vk-overlay) py-1.5 pr-1.5 text-(color:--vk-fg) shadow-[var(--vk-float-shadow,0_8px_24px_rgb(0_0_0/0.12))]";
5
6
  export const DIVIDER_CLASS = "h-5 w-px bg-(color:--vk-border)";
@@ -7,10 +8,11 @@ export function CountWords({ count }) {
7
8
  const { messages } = useViews();
8
9
  return (_jsxs("span", { className: "text-sm whitespace-nowrap", children: [_jsx("span", { className: "font-semibold tabular-nums", children: count }), _jsxs("span", { className: "text-(color:--vk-fg-subtle)", children: [" ", messages({ key: "views.selection.selected" })] })] }));
9
10
  }
10
- export function OptionLabel({ option }) {
11
+ export function OptionLabel({ option, steps }) {
11
12
  const { atoms } = useViews();
12
- if (option.slot)
13
- return _jsx(atoms.StatusBadge, { slot: option.slot, label: option.label });
13
+ if (option.slot) {
14
+ return _jsx(atoms.StatusBadge, { slot: option.slot, label: option.label, place: placeAmong(steps, option.value) });
15
+ }
14
16
  if (option.color)
15
17
  return _jsx(atoms.Tag, { label: option.label, color: option.color });
16
18
  return option.label;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Clears the current selection when Escape is pressed, but only while a
3
- * selection is active. Mirrors the keydown effect used by the Tasks page
4
- * (src/app/(app)/[workspace]/command/tasks/page.tsx).
3
+ * selection is active, and only an Escape nothing else took: a menu or popover
4
+ * that closes on the key marks it handled (`preventDefault`, as Radix and Base
5
+ * UI do), so one press closes the menu and the next clears the selection.
5
6
  */
6
7
  export declare function useEscapeToClear(active: boolean, clear: () => void): void;
@@ -5,7 +5,7 @@ export function useEscapeToClear(active, clear) {
5
5
  if (!active)
6
6
  return;
7
7
  function onKeyDown(e) {
8
- if (e.key === "Escape")
8
+ if (e.key === "Escape" && !e.defaultPrevented)
9
9
  clear();
10
10
  }
11
11
  window.addEventListener("keydown", onKeyDown);
@@ -10,6 +10,8 @@ export type SelectionVerbItem = {
10
10
  * itself is the bar's own `onDelete`, never a verb. */
11
11
  destructive?: boolean;
12
12
  disabled?: boolean;
13
+ /** Why it is disabled, in the person's words: More's rows, the bar's button and the phone sheet carry it. */
14
+ disabledReason?: string;
13
15
  };
14
16
  /** "Set this field on every selected row": the field's values as their badges, the same rows a cell's
15
17
  * editor picks from. No current value: the rows may already hold several. */
@@ -18,6 +20,8 @@ export type SelectionOptionsVerb = {
18
20
  label: string;
19
21
  icon?: ReactNode;
20
22
  disabled?: boolean;
23
+ /** Why it is disabled, in the person's words: More's rows, the bar's button and the phone sheet carry it. */
24
+ disabledReason?: string;
21
25
  options: PickerOption[];
22
26
  onSelect: (value: string) => void;
23
27
  };
@@ -30,5 +34,8 @@ export type SelectionVerb = ({
30
34
  label: string;
31
35
  icon?: ReactNode;
32
36
  disabled?: boolean;
37
+ /** Why the group is disabled: its own button and More's row carry it, and so does each of its rows that
38
+ * gives none. */
39
+ disabledReason?: string;
33
40
  items: SelectionVerbItem[];
34
41
  } | SelectionOptionsVerb;