viewkitjs 0.28.0 → 0.30.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 (530) hide show
  1. package/CHANGELOG.md +218 -0
  2. package/MIGRATION.md +181 -11
  3. package/fields/dist/derived.d.ts +2 -1
  4. package/fields/dist/derived.js +9 -3
  5. package/fields/dist/entities.js +41 -3
  6. package/fields/dist/index.d.ts +1 -1
  7. package/fields/dist/index.js +1 -1
  8. package/fields/dist/messages.d.ts +8 -2
  9. package/fields/dist/messages.js +3 -0
  10. package/fields/dist/range.d.ts +6 -0
  11. package/fields/dist/range.js +8 -0
  12. package/fields/dist/registry.js +11 -1
  13. package/fields/dist/spec-changes.js +1 -0
  14. package/fields/dist/types.d.ts +23 -1
  15. package/fields/docs/guides/derived-fields.md +7 -5
  16. package/fields/docs/guides/field-types.md +2 -2
  17. package/fields/docs/guides/the-index.md +1 -1
  18. package/fields/docs/reference/fields.md +3 -1
  19. package/fields/docs/reference/types.md +3 -1
  20. package/fields/skills/viewkit/SKILL.md +1 -1
  21. package/package.json +2 -1
  22. package/postgres/dist/definitions/build.js +29 -5
  23. package/postgres/dist/definitions/label.d.ts +7 -0
  24. package/postgres/dist/definitions/label.js +9 -1
  25. package/postgres/dist/definitions/lookup.js +6 -2
  26. package/postgres/dist/definitions/place.d.ts +6 -3
  27. package/postgres/dist/definitions/rollup.js +5 -1
  28. package/postgres/dist/definitions/storage.d.ts +15 -0
  29. package/postgres/dist/definitions/storage.js +52 -1
  30. package/postgres/dist/definitions/stored.js +21 -0
  31. package/postgres/dist/phone.d.ts +13 -1
  32. package/postgres/dist/phone.js +23 -3
  33. package/postgres/dist/search-indexes.d.ts +6 -1
  34. package/postgres/dist/search-indexes.js +71 -25
  35. package/postgres/dist/search.js +3 -3
  36. package/postgres/docs/guides/definitions.md +22 -5
  37. package/postgres/docs/guides/field-map.md +5 -4
  38. package/postgres/docs/reference/definitions.md +3 -3
  39. package/postgres/docs/reference/postgres.md +1 -1
  40. package/views/dist/cells/cell-format.d.ts +2 -2
  41. package/views/dist/cells/cell-format.js +2 -2
  42. package/views/dist/cells/cell-values.js +9 -12
  43. package/views/dist/contract.d.ts +161 -18
  44. package/views/dist/contract.js +170 -28
  45. package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
  46. package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
  47. package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
  48. package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
  49. package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
  50. package/views/dist/controls/bulk-bar/looks.js +14 -0
  51. package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
  52. package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
  53. package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
  54. package/views/dist/controls/bulk-bar/tokens.js +36 -0
  55. package/views/dist/controls/bulk-bar/words.d.ts +50 -0
  56. package/views/dist/controls/bulk-bar/words.js +19 -0
  57. package/views/dist/controls/bulk-bar.css +96 -0
  58. package/views/dist/controls/button/button.js +3 -1
  59. package/views/dist/controls/button.css +5 -4
  60. package/views/dist/controls/checkbox/checkbox.js +3 -1
  61. package/views/dist/controls/checkbox.css +1 -1
  62. package/views/dist/controls/choice/tokens.d.ts +79 -0
  63. package/views/dist/controls/choice/tokens.js +22 -0
  64. package/views/dist/controls/choice.css +31 -0
  65. package/views/dist/controls/compound-editor/looks.js +1 -1
  66. package/views/dist/controls/controls.d.ts +8 -0
  67. package/views/dist/controls/controls.js +8 -0
  68. package/views/dist/controls/customize/customize.d.ts +176 -0
  69. package/views/dist/controls/customize/customize.js +348 -0
  70. package/views/dist/controls/customize/glide.d.ts +10 -0
  71. package/views/dist/controls/customize/glide.js +55 -0
  72. package/views/dist/controls/customize/looks.d.ts +13 -0
  73. package/views/dist/controls/customize/looks.js +11 -0
  74. package/views/dist/controls/customize/map-customize-body.d.ts +15 -0
  75. package/views/dist/controls/customize/map-customize-body.js +195 -0
  76. package/views/dist/controls/customize/map-ranges.d.ts +23 -0
  77. package/views/dist/controls/customize/map-ranges.js +41 -0
  78. package/views/dist/controls/customize/rules.d.ts +39 -0
  79. package/views/dist/controls/customize/rules.js +21 -0
  80. package/views/dist/controls/customize/tokens.d.ts +40 -0
  81. package/views/dist/controls/customize/tokens.js +12 -0
  82. package/views/dist/controls/customize/words.d.ts +65 -0
  83. package/views/dist/controls/customize/words.js +42 -0
  84. package/views/dist/controls/customize.css +57 -0
  85. package/views/dist/controls/date-editor/looks.js +1 -1
  86. package/views/dist/controls/filter-editor/block.d.ts +31 -0
  87. package/views/dist/controls/filter-editor/block.js +27 -0
  88. package/views/dist/controls/filter-editor/filter-editor.d.ts +4 -0
  89. package/views/dist/controls/filter-editor/filter-editor.js +86 -43
  90. package/views/dist/controls/filter-editor/how.d.ts +1 -1
  91. package/views/dist/controls/filter-editor/how.js +1 -0
  92. package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
  93. package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
  94. package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
  95. package/views/dist/controls/filter-editor/map-rules.js +73 -42
  96. package/views/dist/controls/filter-editor/rules.d.ts +42 -5
  97. package/views/dist/controls/filter-editor/rules.js +55 -2
  98. package/views/dist/controls/filter-editor/words.d.ts +15 -0
  99. package/views/dist/controls/filter-editor/words.js +6 -0
  100. package/views/dist/controls/filter-editor.css +18 -0
  101. package/views/dist/controls/index.d.ts +33 -9
  102. package/views/dist/controls/index.js +32 -9
  103. package/views/dist/controls/inline-input/looks.js +1 -1
  104. package/views/dist/controls/input/input.js +10 -4
  105. package/views/dist/controls/internal/phone.d.ts +5 -4
  106. package/views/dist/controls/internal/phone.js +7 -7
  107. package/views/dist/controls/internal/scroll.js +5 -1
  108. package/views/dist/controls/internal/typed-run.d.ts +2 -0
  109. package/views/dist/controls/internal/typed-run.js +5 -0
  110. package/views/dist/controls/menu/map-menu.js +2 -2
  111. package/views/dist/controls/menu-list/menu-list.d.ts +16 -1
  112. package/views/dist/controls/menu-list/menu-list.js +26 -8
  113. package/views/dist/controls/menu-list.css +8 -0
  114. package/views/dist/controls/number-editor/looks.js +1 -1
  115. package/views/dist/controls/option/option.js +3 -1
  116. package/views/dist/controls/option.css +1 -1
  117. package/views/dist/controls/pane/pane.d.ts +4 -0
  118. package/views/dist/controls/pane/pane.js +2 -1
  119. package/views/dist/controls/picker/looks.js +1 -1
  120. package/views/dist/controls/picker/map-picker.d.ts +6 -2
  121. package/views/dist/controls/picker/map-picker.js +4 -2
  122. package/views/dist/controls/picker/picker.d.ts +7 -0
  123. package/views/dist/controls/picker/picker.js +57 -8
  124. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  125. package/views/dist/controls/popover/map-popover.js +2 -2
  126. package/views/dist/controls/popover/popover.js +2 -1
  127. package/views/dist/controls/popover.css +3 -0
  128. package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
  129. package/views/dist/controls/ports-host/map-ports-host.js +43 -0
  130. package/views/dist/controls/press/tokens.d.ts +8 -0
  131. package/views/dist/controls/press/tokens.js +4 -0
  132. package/views/dist/controls/press.css +44 -0
  133. package/views/dist/controls/quick-filters/looks.d.ts +11 -0
  134. package/views/dist/controls/quick-filters/looks.js +9 -0
  135. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
  136. package/views/dist/controls/quick-filters/map-quick-filters-body.js +59 -0
  137. package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
  138. package/views/dist/controls/quick-filters/quick-filters.js +89 -0
  139. package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
  140. package/views/dist/controls/quick-filters/reminder.js +41 -0
  141. package/views/dist/controls/quick-filters/rules.d.ts +89 -0
  142. package/views/dist/controls/quick-filters/rules.js +52 -0
  143. package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
  144. package/views/dist/controls/quick-filters/tokens.js +30 -0
  145. package/views/dist/controls/quick-filters/words.d.ts +25 -0
  146. package/views/dist/controls/quick-filters/words.js +13 -0
  147. package/views/dist/controls/quick-filters.css +118 -0
  148. package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
  149. package/views/dist/controls/sheet/bottom-sheet.js +4 -4
  150. package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
  151. package/views/dist/controls/sheet/map-sheet.js +19 -6
  152. package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
  153. package/views/dist/controls/sheet/sheet-parts.js +2 -0
  154. package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
  155. package/views/dist/controls/switch-row/switch-row.js +9 -0
  156. package/views/dist/controls/switch-row/tokens.d.ts +51 -0
  157. package/views/dist/controls/switch-row/tokens.js +15 -0
  158. package/views/dist/controls/switch-row.css +39 -0
  159. package/views/dist/controls/switch.css +1 -1
  160. package/views/dist/controls/tag/tag.js +3 -1
  161. package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
  162. package/views/dist/controls/tag-field/tag-field.js +19 -0
  163. package/views/dist/controls/tag-field/tokens.d.ts +7 -0
  164. package/views/dist/controls/tag-field/tokens.js +4 -0
  165. package/views/dist/controls/tag-field.css +13 -0
  166. package/views/dist/controls/text-editor/looks.js +1 -1
  167. package/views/dist/controls/text-editor/map-text-body.d.ts +1 -1
  168. package/views/dist/controls/text-editor/map-text-body.js +2 -2
  169. package/views/dist/controls/text-editor/text-editor.d.ts +3 -0
  170. package/views/dist/controls/text-editor/text-editor.js +17 -7
  171. package/views/dist/controls/text-editor.css +11 -0
  172. package/views/dist/controls/toast/toast.d.ts +5 -1
  173. package/views/dist/controls/toast/toast.js +5 -3
  174. package/views/dist/controls/tokens.js +18 -0
  175. package/views/dist/controls/toolbar/keys.d.ts +3 -0
  176. package/views/dist/controls/toolbar/keys.js +11 -0
  177. package/views/dist/controls/toolbar/looks.d.ts +10 -0
  178. package/views/dist/controls/toolbar/looks.js +40 -0
  179. package/views/dist/controls/toolbar/tokens.d.ts +28 -0
  180. package/views/dist/controls/toolbar/tokens.js +9 -0
  181. package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
  182. package/views/dist/controls/toolbar/toolbar.js +370 -0
  183. package/views/dist/controls/toolbar/words.d.ts +28 -0
  184. package/views/dist/controls/toolbar/words.js +17 -0
  185. package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
  186. package/views/dist/controls/toolbar-button/looks.js +21 -0
  187. package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
  188. package/views/dist/controls/toolbar-button/tokens.js +28 -0
  189. package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
  190. package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
  191. package/views/dist/controls/toolbar-button.css +75 -0
  192. package/views/dist/controls/toolbar.css +65 -0
  193. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  194. package/views/dist/controls/tooltip/map-tooltip.js +2 -2
  195. package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
  196. package/views/dist/controls/tooltip/tooltip.js +2 -2
  197. package/views/dist/controls/values-editor/looks.js +1 -1
  198. package/views/dist/controls/values-editor/values.js +6 -2
  199. package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
  200. package/views/dist/controls/views-list/map-views-list-body.js +128 -4
  201. package/views/dist/controls/views-list/rules.d.ts +26 -0
  202. package/views/dist/controls/views-list/rules.js +63 -0
  203. package/views/dist/controls/views-list/view-menu.d.ts +84 -0
  204. package/views/dist/controls/views-list/view-menu.js +201 -0
  205. package/views/dist/controls/views-list/views-list.d.ts +8 -1
  206. package/views/dist/controls/views-list/views-list.js +18 -3
  207. package/views/dist/controls/views-list/words.d.ts +54 -0
  208. package/views/dist/controls/views-list/words.js +10 -1
  209. package/views/dist/controls/views-list.css +5 -1
  210. package/views/dist/display/date.js +3 -3
  211. package/views/dist/display/format.d.ts +6 -0
  212. package/views/dist/display/format.js +3 -0
  213. package/views/dist/display/index.d.ts +1 -1
  214. package/views/dist/display/index.js +1 -1
  215. package/views/dist/display/options.d.ts +1 -1
  216. package/views/dist/display/range.d.ts +2 -1
  217. package/views/dist/display/range.js +4 -1
  218. package/views/dist/display/rich-text.js +0 -1
  219. package/views/dist/editors/ChipsEditor.d.ts +4 -5
  220. package/views/dist/editors/ChipsEditor.js +12 -78
  221. package/views/dist/editors/DateEditor.d.ts +12 -16
  222. package/views/dist/editors/DateEditor.js +40 -191
  223. package/views/dist/editors/EditorPanel.d.ts +2 -6
  224. package/views/dist/editors/EditorPanel.js +2 -2
  225. package/views/dist/editors/LocationEditor.d.ts +11 -19
  226. package/views/dist/editors/LocationEditor.js +19 -211
  227. package/views/dist/editors/NameEditor.d.ts +8 -16
  228. package/views/dist/editors/NameEditor.js +11 -100
  229. package/views/dist/editors/NumberEditor.d.ts +14 -21
  230. package/views/dist/editors/NumberEditor.js +22 -49
  231. package/views/dist/editors/RangeEditor.d.ts +9 -33
  232. package/views/dist/editors/RangeEditor.js +12 -97
  233. package/views/dist/editors/RelationEditor.d.ts +6 -9
  234. package/views/dist/editors/RelationEditor.js +11 -30
  235. package/views/dist/editors/RelationSetEditor.d.ts +13 -24
  236. package/views/dist/editors/RelationSetEditor.js +33 -101
  237. package/views/dist/editors/SelectEditor.d.ts +15 -17
  238. package/views/dist/editors/SelectEditor.js +15 -94
  239. package/views/dist/editors/TextEditor.d.ts +23 -26
  240. package/views/dist/editors/TextEditor.js +11 -48
  241. package/views/dist/editors/ValueListEditor.d.ts +14 -23
  242. package/views/dist/editors/ValueListEditor.js +16 -202
  243. package/views/dist/editors/body-panel.d.ts +13 -7
  244. package/views/dist/editors/body-panel.js +3 -7
  245. package/views/dist/editors/edit-cores.d.ts +15 -15
  246. package/views/dist/editors/edit-cores.js +14 -14
  247. package/views/dist/editors/number-body.d.ts +1 -1
  248. package/views/dist/editors/number-step.d.ts +0 -34
  249. package/views/dist/editors/number-step.js +0 -37
  250. package/views/dist/editors/option-add-flow.d.ts +1 -13
  251. package/views/dist/editors/option-add-flow.js +0 -22
  252. package/views/dist/editors/relation-links-body.d.ts +2 -3
  253. package/views/dist/editors/relation-picker.d.ts +13 -3
  254. package/views/dist/editors/relation-source.d.ts +0 -22
  255. package/views/dist/editors/relation-source.js +0 -21
  256. package/views/dist/field-row/FieldRow.js +5 -6
  257. package/views/dist/field-row/FieldRowLane.js +0 -1
  258. package/views/dist/field-row/editors/RowChipsEditor.js +2 -2
  259. package/views/dist/field-row/editors/RowDateEditor.d.ts +2 -2
  260. package/views/dist/field-row/editors/RowDateEditor.js +2 -2
  261. package/views/dist/field-row/editors/RowNameEditor.d.ts +2 -5
  262. package/views/dist/field-row/editors/RowNameEditor.js +7 -12
  263. package/views/dist/field-row/editors/RowNumberEditor.d.ts +1 -1
  264. package/views/dist/field-row/editors/RowNumberEditor.js +4 -4
  265. package/views/dist/field-row/editors/RowPlaceEditor.js +3 -3
  266. package/views/dist/field-row/editors/RowRangeEditor.d.ts +2 -5
  267. package/views/dist/field-row/editors/RowRangeEditor.js +7 -14
  268. package/views/dist/field-row/editors/RowRelationEditor.js +3 -3
  269. package/views/dist/field-row/editors/RowSelectEditor.js +2 -2
  270. package/views/dist/field-row/editors/RowTextEditor.d.ts +1 -1
  271. package/views/dist/field-row/editors/RowTextEditor.js +3 -4
  272. package/views/dist/field-row/editors/RowValueListEditor.js +5 -5
  273. package/views/dist/field-row/field-row-button.d.ts +6 -9
  274. package/views/dist/field-row/field-row-button.js +1 -6
  275. package/views/dist/field-row/field-row-checkbox.d.ts +1 -1
  276. package/views/dist/field-row/row-target.d.ts +0 -7
  277. package/views/dist/field-row/row-target.js +0 -2
  278. package/views/dist/grid/chrome/GridAddColumn.d.ts +2 -1
  279. package/views/dist/grid/chrome/GridAddColumn.js +8 -66
  280. package/views/dist/grid/chrome/GridAggregateMenu.d.ts +5 -7
  281. package/views/dist/grid/chrome/GridAggregateMenu.js +20 -39
  282. package/views/dist/grid/chrome/GridCellEditors.d.ts +2 -2
  283. package/views/dist/grid/chrome/GridCellEditors.js +12 -12
  284. package/views/dist/grid/chrome/GridChipsEditor.js +3 -3
  285. package/views/dist/grid/chrome/GridColumnMenu.d.ts +11 -12
  286. package/views/dist/grid/chrome/GridColumnMenu.js +32 -93
  287. package/views/dist/grid/chrome/GridDateEditor.d.ts +6 -6
  288. package/views/dist/grid/chrome/GridDateEditor.js +3 -3
  289. package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -6
  290. package/views/dist/grid/chrome/GridGroupMenu.js +21 -62
  291. package/views/dist/grid/chrome/GridHeader.d.ts +1 -2
  292. package/views/dist/grid/chrome/GridHeader.js +3 -2
  293. package/views/dist/grid/chrome/GridLongTextEditor.d.ts +17 -38
  294. package/views/dist/grid/chrome/GridLongTextEditor.js +6 -7
  295. package/views/dist/grid/chrome/GridNameEditor.js +4 -4
  296. package/views/dist/grid/chrome/GridNumberEditor.d.ts +4 -5
  297. package/views/dist/grid/chrome/GridNumberEditor.js +5 -6
  298. package/views/dist/grid/chrome/GridPlaceEditor.d.ts +2 -5
  299. package/views/dist/grid/chrome/GridPlaceEditor.js +5 -5
  300. package/views/dist/grid/chrome/GridRangeEditor.d.ts +6 -12
  301. package/views/dist/grid/chrome/GridRangeEditor.js +7 -15
  302. package/views/dist/grid/chrome/GridRelationEditor.js +5 -5
  303. package/views/dist/grid/chrome/GridRow.js +0 -3
  304. package/views/dist/grid/chrome/GridRowActions.d.ts +1 -1
  305. package/views/dist/grid/chrome/GridRowActions.js +0 -5
  306. package/views/dist/grid/chrome/GridRowCells.js +11 -7
  307. package/views/dist/grid/chrome/GridSelectEditor.js +3 -3
  308. package/views/dist/grid/chrome/GridStructure.js +0 -1
  309. package/views/dist/grid/chrome/GridTable.js +1 -1
  310. package/views/dist/grid/chrome/GridTextEditor.d.ts +5 -7
  311. package/views/dist/grid/chrome/GridTextEditor.js +5 -18
  312. package/views/dist/grid/chrome/GridValueListEditor.js +4 -4
  313. package/views/dist/grid/chrome/grid-body-place.d.ts +2 -3
  314. package/views/dist/grid/chrome/grid-body-place.js +4 -8
  315. package/views/dist/grid/chrome/grid-button.d.ts +7 -10
  316. package/views/dist/grid/chrome/grid-button.js +1 -6
  317. package/views/dist/grid/chrome/grid-cell-classes.js +1 -1
  318. package/views/dist/grid/chrome/grid-column-menu-items.d.ts +4 -4
  319. package/views/dist/grid/chrome/grid-column-menu-items.js +10 -6
  320. package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
  321. package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
  322. package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
  323. package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
  324. package/views/dist/grid/chrome/grid-group-menu-parts.d.ts +5 -9
  325. package/views/dist/grid/chrome/grid-group-menu-parts.js +1 -3
  326. package/views/dist/grid/chrome/grid-hover.js +0 -1
  327. package/views/dist/grid/chrome/grid-menu-focus.d.ts +7 -31
  328. package/views/dist/grid/chrome/grid-menu-focus.js +7 -47
  329. package/views/dist/grid/chrome/grid-styles.d.ts +0 -3
  330. package/views/dist/grid/chrome/grid-styles.js +0 -1
  331. package/views/dist/grid/chrome/grid-table-props.d.ts +6 -10
  332. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -4
  333. package/views/dist/grid/core/clipboard-model.js +9 -4
  334. package/views/dist/grid/core/editing-controller.d.ts +2 -1
  335. package/views/dist/grid/core/editing-controller.js +10 -2
  336. package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
  337. package/views/dist/grid/core/refusal-sentence.js +2 -2
  338. package/views/dist/grid/core/write-states.d.ts +3 -1
  339. package/views/dist/grid/core/write-states.js +6 -2
  340. package/views/dist/grid/grid.css +240 -0
  341. package/views/dist/grid/looks.d.ts +5 -1
  342. package/views/dist/grid/looks.js +20 -12
  343. package/views/dist/grid-tokens.d.ts +109 -0
  344. package/views/dist/grid-tokens.js +29 -0
  345. package/views/dist/looks/index.d.ts +5 -0
  346. package/views/dist/looks/index.js +5 -0
  347. package/views/dist/looks/pieces.js +10 -0
  348. package/views/dist/model/body-frame.d.ts +0 -32
  349. package/views/dist/model/body-frame.js +1 -15
  350. package/views/dist/model/column-capabilities.d.ts +2 -0
  351. package/views/dist/model/column-filters.d.ts +2 -1
  352. package/views/dist/model/column-from.js +2 -2
  353. package/views/dist/model/column-inspect.d.ts +5 -5
  354. package/views/dist/model/column-inspect.js +2 -2
  355. package/views/dist/model/relation-filters.d.ts +2 -0
  356. package/views/dist/panels/customize-body.d.ts +1 -10
  357. package/views/dist/panels/customize-body.js +0 -3
  358. package/views/dist/panels/filter/MenuSelect.js +0 -5
  359. package/views/dist/panels/filter/RangeFilterBody.js +0 -1
  360. package/views/dist/panels/filter/details.d.ts +1 -5
  361. package/views/dist/panels/filter/details.js +0 -13
  362. package/views/dist/panels/filter/filter-list.d.ts +0 -1
  363. package/views/dist/panels/filter/filter-list.js +1 -1
  364. package/views/dist/panels/index.d.ts +2 -2
  365. package/views/dist/panels/index.js +2 -2
  366. package/views/dist/panels/labels.d.ts +4 -0
  367. package/views/dist/panels/labels.js +8 -0
  368. package/views/dist/panels/model.d.ts +10 -2
  369. package/views/dist/panels/panel-button.d.ts +10 -12
  370. package/views/dist/panels/panel-button.js +1 -6
  371. package/views/dist/panels/quick/model.d.ts +4 -0
  372. package/views/dist/panels/react/chrome.d.ts +0 -17
  373. package/views/dist/panels/react/chrome.js +0 -8
  374. package/views/dist/panels/react/customize-body.d.ts +14 -12
  375. package/views/dist/panels/react/customize-body.js +93 -19
  376. package/views/dist/panels/react/customize.d.ts +16 -12
  377. package/views/dist/panels/react/customize.js +4 -110
  378. package/views/dist/panels/react/filter/FilterEditor.d.ts +4 -18
  379. package/views/dist/panels/react/filter/FilterEditor.js +6 -330
  380. package/views/dist/panels/react/filter/FilterFieldList.d.ts +1 -1
  381. package/views/dist/panels/react/filter/FilterFieldList.js +27 -51
  382. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +1 -11
  383. package/views/dist/panels/react/filter/PhoneFilterEditor.js +8 -144
  384. package/views/dist/panels/react/filter/editor-ctx.d.ts +1 -33
  385. package/views/dist/panels/react/filter/editor-ctx.js +5 -33
  386. package/views/dist/panels/react/filter/filter-body.js +5 -2
  387. package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -6
  388. package/views/dist/panels/react/filter/filter-part-body.js +0 -5
  389. package/views/dist/panels/react/filter/rule-writes.d.ts +1 -26
  390. package/views/dist/panels/react/filter/rule-writes.js +4 -95
  391. package/views/dist/panels/react/order-details.d.ts +1 -26
  392. package/views/dist/panels/react/order-details.js +3 -69
  393. package/views/dist/panels/react/panel-header.js +0 -1
  394. package/views/dist/panels/react/panel-step.d.ts +3 -0
  395. package/views/dist/panels/react/panel-step.js +2 -1
  396. package/views/dist/panels/react/popover.d.ts +4 -7
  397. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +2 -4
  398. package/views/dist/panels/react/quick/QuickFiltersPanel.js +16 -136
  399. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -4
  400. package/views/dist/panels/react/sort/SortEditor.js +8 -245
  401. package/views/dist/panels/react/sort/SortFieldList.d.ts +1 -1
  402. package/views/dist/panels/react/sort/SortFieldList.js +11 -25
  403. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
  404. package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
  405. package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
  406. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +2 -2
  407. package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
  408. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +16 -18
  409. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
  410. package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
  411. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
  412. package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
  413. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  414. package/views/dist/panels/react/toolbar/ToolbarSave.js +0 -4
  415. package/views/dist/panels/react/toolbar/ToolbarSearch.js +0 -1
  416. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -3
  417. package/views/dist/panels/react/view-actions.js +0 -1
  418. package/views/dist/panels/react/views-row/FoldingViewRow.js +2 -5
  419. package/views/dist/panels/react/views-row/ViewCreatePill.js +0 -1
  420. package/views/dist/panels/react/views-row/ViewPicker.js +30 -45
  421. package/views/dist/panels/react/views-row/ViewPickerRow.js +0 -2
  422. package/views/dist/panels/react/views-row/menu-classes.d.ts +0 -4
  423. package/views/dist/panels/react/views-row/menu-classes.js +0 -2
  424. package/views/dist/panels/react.d.ts +5 -12
  425. package/views/dist/panels/react.js +5 -12
  426. package/views/dist/panels/settings/filter-groups.d.ts +3 -0
  427. package/views/dist/panels/settings/filter-groups.js +40 -9
  428. package/views/dist/panels/settings/filters.d.ts +5 -0
  429. package/views/dist/panels/settings/filters.js +12 -6
  430. package/views/dist/panels/views-row/model.d.ts +10 -1
  431. package/views/dist/provider/ViewsProvider.d.ts +2 -46
  432. package/views/dist/provider/ViewsProvider.js +31 -27
  433. package/views/dist/provider/components.d.ts +295 -107
  434. package/views/dist/provider/context.d.ts +7 -21
  435. package/views/dist/provider/missing-slot.d.ts +3 -7
  436. package/views/dist/provider/missing-slot.js +2 -9
  437. package/views/dist/provider/ports.d.ts +18 -6
  438. package/views/dist/provider/ports.js +2 -1
  439. package/views/dist/react.d.ts +2 -3
  440. package/views/dist/react.js +1 -1
  441. package/views/dist/selection/SelectionBar.d.ts +2 -16
  442. package/views/dist/selection/SelectionBar.js +6 -4
  443. package/views/dist/selection/bar-props.d.ts +26 -0
  444. package/views/dist/selection/bar-props.js +1 -0
  445. package/views/dist/selection/index.d.ts +1 -1
  446. package/views/dist/selection/verbs.d.ts +32 -5
  447. package/views/dist/styles.css +694 -191
  448. package/views/dist/styles.unlayered.css +691 -188
  449. package/views/docs/contract.md +133 -130
  450. package/views/docs/controls/bulk-bar.md +41 -0
  451. package/views/docs/controls/choice.md +25 -0
  452. package/views/docs/controls/customize.md +17 -0
  453. package/views/docs/controls/popover.md +2 -0
  454. package/views/docs/controls/press.md +9 -0
  455. package/views/docs/controls/quick-filters.md +35 -0
  456. package/views/docs/controls/radio.md +1 -1
  457. package/views/docs/controls/switch-row.md +18 -0
  458. package/views/docs/controls/tag-field.md +7 -0
  459. package/views/docs/controls/toolbar-button.md +31 -0
  460. package/views/docs/controls/toolbar.md +14 -0
  461. package/views/docs/getting-started.md +222 -2
  462. package/views/docs/guides/atoms.md +2 -2
  463. package/views/docs/guides/cells.md +224 -4
  464. package/views/docs/guides/display.md +3 -3
  465. package/views/docs/guides/editors.md +235 -20
  466. package/views/docs/guides/looks.md +8 -2
  467. package/views/docs/guides/ports.md +7 -7
  468. package/views/docs/guides/selection.md +5 -1
  469. package/views/docs/guides/the-grid.md +15 -17
  470. package/views/docs/guides/the-provider.md +9 -15
  471. package/views/docs/install.md +4 -1
  472. package/views/docs/reference/cells.md +2 -2
  473. package/views/docs/reference/controls.md +215 -21
  474. package/views/docs/reference/display.md +1 -0
  475. package/views/docs/reference/editors-chips.md +2 -2
  476. package/views/docs/reference/editors-date.md +4 -4
  477. package/views/docs/reference/editors-location.md +4 -7
  478. package/views/docs/reference/editors-name.md +3 -5
  479. package/views/docs/reference/editors-number.md +10 -10
  480. package/views/docs/reference/editors-panel.md +3 -3
  481. package/views/docs/reference/editors-range.md +3 -5
  482. package/views/docs/reference/editors-relation.md +4 -4
  483. package/views/docs/reference/editors-select.md +3 -3
  484. package/views/docs/reference/editors-text.md +3 -4
  485. package/views/docs/reference/editors-value-list.md +3 -3
  486. package/views/docs/reference/field-row.md +1 -1
  487. package/views/docs/reference/grid.md +2 -2
  488. package/views/docs/reference/looks.md +25 -11
  489. package/views/docs/reference/panels-react.md +23 -37
  490. package/views/docs/reference/panels.md +8 -6
  491. package/views/docs/reference/react.md +24 -24
  492. package/views/docs/reference/selection.md +4 -2
  493. package/views/docs/reference/views.md +12 -11
  494. package/views/skills/views/SKILL.md +2 -2
  495. package/views/dist/editors/relation-panel.d.ts +0 -69
  496. package/views/dist/editors/relation-panel.js +0 -46
  497. package/views/dist/grid/chrome/GridColumnColorSection.d.ts +0 -13
  498. package/views/dist/grid/chrome/GridColumnColorSection.js +0 -40
  499. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +0 -28
  500. package/views/dist/grid/chrome/GridColumnDateSection.js +0 -23
  501. package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +0 -23
  502. package/views/dist/grid/chrome/GridColumnDurationSection.js +0 -24
  503. package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +0 -29
  504. package/views/dist/grid/chrome/GridColumnNumberSection.js +0 -27
  505. package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +0 -16
  506. package/views/dist/grid/chrome/GridColumnPercentSection.js +0 -16
  507. package/views/dist/grid/chrome/GridColumnSortSection.d.ts +0 -38
  508. package/views/dist/grid/chrome/GridColumnSortSection.js +0 -33
  509. package/views/dist/grid/chrome/GridFlyout.d.ts +0 -44
  510. package/views/dist/grid/chrome/GridFlyout.js +0 -80
  511. package/views/dist/grid/chrome/GridMenuRow.d.ts +0 -15
  512. package/views/dist/grid/chrome/GridMenuRow.js +0 -15
  513. package/views/dist/grid/chrome/grid-menu-search.d.ts +0 -7
  514. package/views/dist/grid/chrome/grid-menu-search.js +0 -7
  515. package/views/dist/panels/react/GroupBucketsList.d.ts +0 -16
  516. package/views/dist/panels/react/GroupBucketsList.js +0 -44
  517. package/views/dist/panels/react/LayoutColumnsList.d.ts +0 -24
  518. package/views/dist/panels/react/LayoutColumnsList.js +0 -101
  519. package/views/dist/panels/react/PopoverColumnDetail.d.ts +0 -11
  520. package/views/dist/panels/react/PopoverColumnDetail.js +0 -24
  521. package/views/dist/panels/react/drag.d.ts +0 -2
  522. package/views/dist/panels/react/drag.js +0 -5
  523. package/views/dist/panels/react/layout-detail.d.ts +0 -4
  524. package/views/dist/panels/react/layout-detail.js +0 -29
  525. package/views/dist/panels/react/root-list.d.ts +0 -6
  526. package/views/dist/panels/react/root-list.js +0 -31
  527. package/views/dist/panels/react/sort/use-sort-drag.d.ts +0 -17
  528. package/views/dist/panels/react/sort/use-sort-drag.js +0 -39
  529. package/views/dist/panels/react/view-footer.d.ts +0 -20
  530. package/views/dist/panels/react/view-footer.js +0 -41
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useRef } from "react";
4
- import { DateEditor } from "../../editors/DateEditor.js";
4
+ import { DateEditorHost } from "../../editors/DateEditor.js";
5
5
  import { EditorPanel } from "../../editors/EditorPanel.js";
6
6
  import { EditorClockContext } from "../../internal/zone-clock.js";
7
7
  import { temporalKindOf } from "../../model/field-type-of.js";
@@ -13,7 +13,7 @@ export function dayColumnKeepsBrowserClock(col) {
13
13
  export function GridDateEditor({ title, initial, dayOnly = false, browserClock = false, clearable = false, seed, refuse, onCommit, onCancel, onTab, onEnter, }) {
14
14
  const editorRef = useRef(null);
15
15
  const anchorRef = useRef(null);
16
- const place = useGridBodyPlace("date", anchorRef);
16
+ const place = useGridBodyPlace(anchorRef);
17
17
  const { session, close, sheet } = useGridEditSession({
18
18
  editorRef,
19
19
  mapPayload: dayOnly ? (payload) => payload.slice(0, 10) : undefined,
@@ -23,5 +23,5 @@ export function GridDateEditor({ title, initial, dayOnly = false, browserClock =
23
23
  onTab,
24
24
  onEnter,
25
25
  });
26
- return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 w-auto", children: _jsx(EditorClockContext.Provider, { value: browserClock ? "browser" : "conventions", children: _jsx(DateEditor, { ref: editorRef, label: typeof title === "string" ? title : undefined, initial: initial, dayOnly: dayOnly, clearable: clearable, seed: seed, focusDate: !sheet, onRequestClose: close }) }) })] }));
26
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 w-auto", children: _jsx(EditorClockContext.Provider, { value: browserClock ? "browser" : "conventions", children: _jsx(DateEditorHost, { ref: editorRef, label: typeof title === "string" ? title : undefined, initial: initial, dayOnly: dayOnly, clearable: clearable, seed: seed, focusDate: !sheet, onRequestClose: close }) }) })] }));
27
27
  }
@@ -13,17 +13,15 @@ export type GridGroupSortOption = {
13
13
  /**
14
14
  * The group-header `…` menu — a second remote for the list's row sort (all
15
15
  * groups at once), surfaced on the group band. Reveals on hover of the group
16
- * label; opens the map's popover, in its slot, of the same sortable columns the
17
- * view-options Sort panel drives, or, on the `menu` route (the provider's
18
- * `menus`), the map's Menu with those choices beside it and no search. Clicks
19
- * stop propagation so the group's collapse toggle stays put.
16
+ * label; opens the map's Menu, handed its rows as data: the same sortable
17
+ * columns the view-options Sort panel drives, beside it. Clicks stop
18
+ * propagation so the group's collapse toggle stays put.
20
19
  */
21
20
  export declare function GridGroupMenu({ sort, sortOptions, summary, onSummaryChange, figures, onHide, groupMenu, select, }: {
22
21
  /** The group's Select all in group, where the grid selects rows: whether all its rows are picked, and the pick.
23
22
  * Drawn only when `groupMenu` names `"select"`. */
24
23
  select?: GridGroupMenuSelect;
25
- /** Which parts the menu holds (`groupMenuParts`). Absent: sort and Hide as given, the figure toggles with them,
26
- * and, on the `popover` route, a search past eight sort choices. */
24
+ /** Which parts the menu holds (`groupMenuParts`). Absent: sort and Hide as given, the figure toggles with them. */
27
25
  groupMenu?: readonly GridGroupMenuPart[];
28
26
  /** Absent when the list offers no row sort here — the menu then carries only
29
27
  * what else it has (Hide group). */
@@ -1,34 +1,23 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useRef, useState } from "react";
3
+ import { useState } from "react";
4
4
  import { useViews } from "../../provider/context.js";
5
5
  import { cx } from "../../internal/cx.js";
6
6
  import { drawGridButton } from "./grid-button.js";
7
- import { GridMenuRow, GridMenuSeparator } from "./GridMenuRow.js";
8
- import { matchMenuOptions } from "./grid-menu-search.js";
9
7
  import { groupMenuParts } from "./grid-group-menu-parts.js";
10
- import { GRID_CHROME_FOCUS } from "./grid-styles.js";
11
- import { gridMenuArrows, gridMenuSearchArrows, useGridMenuFocus, useGridMenuPress } from "./grid-menu-focus.js";
8
+ import { useGridMenuFocus, useGridMenuPress } from "./grid-menu-focus.js";
12
9
  import { gridGroupMenuItems } from "./grid-group-menu-items.js";
13
10
  const GROUP_MORE_REVEAL = "group-data-desktop/gridtable:opacity-0 group-data-desktop/gridtable:group-hover/gridlabel:opacity-100 aria-expanded:opacity-100 group-data-desktop/gridtable:focus-visible:opacity-100";
14
- const EYEBROW = "px-2 pb-1 pt-2 text-(length:--vk-caption-text,11px) font-medium uppercase tracking-wide text-(color:--vk-fg-subtle)";
15
11
  export function GridGroupMenu({ sort, sortOptions, summary, onSummaryChange, figures = [], onHide, groupMenu, select, }) {
16
12
  const [open, setOpen] = useState(false);
17
13
  const [anchor, setAnchor] = useState(null);
18
- const menuFocus = useGridMenuFocus(open, anchor);
14
+ useGridMenuFocus(open, anchor);
19
15
  const press = useGridMenuPress(open);
20
- const rowsBox = useRef(null);
21
- const searchField = useRef(null);
22
16
  const views = useViews();
23
- const { atoms, components, icons, messages, menus } = views;
24
- const { Popover, Command, Menu } = components;
25
- const { List, Row, RowContent } = atoms;
17
+ const { components, icons, messages } = views;
18
+ const { Menu } = components;
26
19
  const More = icons.more;
27
- const [query, setQuery] = useState("");
28
- const close = () => {
29
- setOpen(false);
30
- setQuery("");
31
- };
20
+ const close = () => setOpen(false);
32
21
  const parts = groupMenuParts({
33
22
  groupMenu,
34
23
  hasSort: !!sort,
@@ -39,63 +28,33 @@ export function GridGroupMenu({ sort, sortOptions, summary, onSummaryChange, fig
39
28
  canSelect: !!select,
40
29
  });
41
30
  const offered = parts.sort ? sortOptions : [];
42
- const searchable = parts.command;
43
- const sorts = matchMenuOptions(offered, query);
44
- const pick = (opt) => {
45
- if (!sort)
46
- return;
47
- const active = sort.value === opt.value;
48
- const dir = active
49
- ? sort.dir === "asc"
50
- ? "desc"
51
- : "asc"
52
- : (opt.defaultDir ?? "asc");
53
- sort.onChange({ value: opt.value, dir });
54
- close();
55
- };
56
- const sortGlyph = (opt) => {
57
- const active = sort.value === opt.value;
58
- const Glyph = active && sort.dir === "desc" ? icons.sortRowsDown : icons.sortRowsUp;
59
- return (_jsx(Glyph, { className: cx("size-3.5", active ? "text-(color:--vk-fg-brand)" : "text-(color:--vk-fg-subtlest)") }));
60
- };
61
- const menuRoute = (menus ?? "popover") === "menu";
62
31
  return (_jsxs(_Fragment, { children: [drawGridButton(views, {
63
32
  ref: setAnchor,
64
33
  tabIndex: -1,
65
34
  "aria-label": messages({ key: "views.menus.group-options" }),
66
- "aria-haspopup": menuRoute ? "menu" : "dialog",
35
+ "aria-haspopup": "menu",
67
36
  "aria-expanded": open,
68
- onPointerDownCapture: menuRoute ? press.notePress : undefined,
37
+ onPointerDownCapture: press.notePress,
69
38
  onClick: (e) => {
70
39
  e.stopPropagation();
71
- if ((menuRoute && press.pressedOpen(e)) || open)
40
+ if (press.pressedOpen(e) || open)
72
41
  close();
73
- else {
74
- menuFocus.noteOpen(e);
42
+ else
75
43
  setOpen(true);
76
- }
77
44
  },
78
- own: cx("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-(color:--vk-fg-subtle)", "transition-opacity hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)", GROUP_MORE_REVEAL, GRID_CHROME_FOCUS),
79
45
  frame: cx("h-6 w-6 shrink-0 transition-opacity", GROUP_MORE_REVEAL),
80
46
  variant: "ghost",
81
47
  size: "icon",
82
48
  children: _jsx(More, { className: "h-3.5 w-3.5" }),
83
- }), menuRoute ? (_jsx("span", { className: "contents", onClick: (e) => e.stopPropagation(), children: _jsx(Menu, { open: open, onOpenChange: (next) => (next ? setOpen(true) : close()), anchor: anchor, side: "bottom", align: "start", label: messages({ key: "views.menus.group-options" }), items: open
84
- ? gridGroupMenuItems(parts, { ...(sort && { sort }), sortOptions: offered, ...(summary && { summary }), ...(onSummaryChange && { onSummaryChange }), figures, ...(onHide && { onHide }), ...(select && { select }) }, { messages, icons, close })
85
- : [] }) })) : (_jsx(Popover, { open: open, onOpenChange: (next) => (next ? setOpen(true) : close()), anchor: anchor, side: "bottom", align: "start", sideOffset: 4, initialFocus: menuFocus.initialFocus, chrome: "menu", panelData: { "data-slot": "vk-grid-group-menu" }, onPanelClick: (e) => e.stopPropagation(), className: "w-52", onOutsidePress: (event) => (anchor?.contains(event.target) ? false : undefined), children: _jsx("div", { ref: rowsBox, onKeyDown: (e) => gridMenuArrows(e, searchField.current), children: _jsxs(List, { children: [parts.select && select && (_jsxs(_Fragment, { children: [_jsx(GridMenuRow, { label: messages({
86
- key: "views.menus.group-select",
87
- values: { selected: select.allSelected ? "true" : "false" },
88
- }), icon: "selectRow", onClick: () => {
89
- select.onToggle();
90
- close();
91
- } }), (parts.sort || parts.figures || parts.hide) && _jsx(GridMenuSeparator, {})] })), offered.length > 0 && _jsx("div", { className: EYEBROW, children: messages({ key: "views.menus.group-sort" }) }), searchable ? (_jsxs(Command.Root, { shouldFilter: false, loop: true, label: messages({ key: "views.menus.search" }), children: [_jsx(Command.Input, { ref: searchField, onKeyDown: (e) => gridMenuSearchArrows(e, rowsBox.current), value: query, onValueChange: setQuery, placeholder: messages({ key: "views.menus.search" }) }), _jsx(Command.List, { className: "max-h-64 overscroll-contain", children: _jsx(Command.Group, { className: "p-0", children: sorts.map((opt) => {
92
- const active = sort.value === opt.value;
93
- return (_jsx(Command.Item, { value: opt.value, onSelect: () => pick(opt), chosen: active, children: _jsx(RowContent, { label: opt.label, leading: sortGlyph(opt), chosen: active }) }, opt.value));
94
- }) }) })] })) : (sorts.map((opt) => (_jsx(Row, { chosen: sort.value === opt.value, label: opt.label, leading: sortGlyph(opt), onClick: () => pick(opt) }, opt.value)))), parts.figures && onSummaryChange && (_jsxs(_Fragment, { children: [offered.length > 0 && _jsx(GridMenuSeparator, {}), _jsx("div", { className: EYEBROW, children: messages({ key: "views.menus.group-show" }) }), [
95
- { part: "count", label: messages({ key: "views.menus.group-count" }) },
96
- ...figures,
97
- ].map((s) => (_jsx(Row, { chosen: (summary ?? []).includes(s.part), label: s.label, onClick: () => onSummaryChange(s.part, !(summary ?? []).includes(s.part)) }, s.part)))] })), parts.hide && onHide && (_jsxs(_Fragment, { children: [(parts.sort || parts.figures) && _jsx(GridMenuSeparator, {}), _jsx(GridMenuRow, { label: messages({ key: "views.menus.group-hide" }), icon: "hide", onClick: () => {
98
- onHide();
99
- close();
100
- } })] }))] }) }) }))] }));
49
+ }), _jsx("span", { className: "contents", onClick: (e) => e.stopPropagation(), children: _jsx(Menu, { open: open, onOpenChange: (next) => (next ? setOpen(true) : close()), anchor: anchor, side: "bottom", align: "start", label: messages({ key: "views.menus.group-options" }), items: open
50
+ ? gridGroupMenuItems(parts, {
51
+ ...(sort && { sort }),
52
+ sortOptions: offered,
53
+ ...(summary && { summary }),
54
+ ...(onSummaryChange && { onSummaryChange }),
55
+ figures,
56
+ ...(onHide && { onHide }),
57
+ ...(select && { select }),
58
+ }, { messages, icons, close })
59
+ : [] }) })] }));
101
60
  }
@@ -8,7 +8,7 @@ import { type GridGroupByState, type GridSortState } from "./GridColumnMenu.js";
8
8
  import type { ViewsMenuItem } from "../../provider/components.js";
9
9
  import type { useHeaderDragReorder } from "./useHeaderDragReorder.js";
10
10
  type HeaderDrag = ReturnType<typeof useHeaderDragReorder>;
11
- export declare function GridHeader<Row>({ showAddColumn, addColumnAt, checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount, frozenLeft, verticalBorders, headerVerticalBorders, viewBacked, formatsWritable, renderAddColumn, renderColumnMenuRows, columnMenuItems, openColumnMenu, onOpenColumnMenuChange, }: {
11
+ export declare function GridHeader<Row>({ showAddColumn, addColumnAt, checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount, frozenLeft, verticalBorders, headerVerticalBorders, viewBacked, formatsWritable, renderAddColumn, columnMenuItems, openColumnMenu, onOpenColumnMenuChange, }: {
12
12
  /** The table sized the tail for "+ Add column": the desktop strip of a grid with column state. */
13
13
  showAddColumn?: boolean;
14
14
  /** Where "+ Add column" stands, as the table resolved it: `"title"` only where a title column is shown. */
@@ -73,7 +73,6 @@ export declare function GridHeader<Row>({ showAddColumn, addColumnAt, checkbox,
73
73
  /** The host's rules and slots, passed on from the grid's props (grid-table-props). */
74
74
  formatsWritable?: boolean;
75
75
  renderAddColumn?: (columns: ListColumnsConfig) => ReactNode;
76
- renderColumnMenuRows?: (fieldKey: string, close: () => void) => ReactNode;
77
76
  columnMenuItems?: (fieldKey: string) => ViewsMenuItem[] | null;
78
77
  /** The column whose menu this row of names holds open (`openColumnMenu`); null: none; absent: each menu holds its
79
78
  * own. */
@@ -15,7 +15,8 @@ import { gridColumnGlyph } from "./column-glyph.js";
15
15
  import { gridFocusOnPress } from "./useGridFocus.js";
16
16
  import { columnSortParts, effectiveSortKey, sortPartOf } from "../../model/column-sort.js";
17
17
  import { columnPlacedByView } from "../../model/column-capabilities.js";
18
- export function GridHeader({ showAddColumn = false, addColumnAt = "end", checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset = 0, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark = false, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount = 0, frozenLeft, verticalBorders = true, headerVerticalBorders = false, viewBacked = false, formatsWritable, renderAddColumn, renderColumnMenuRows, columnMenuItems, openColumnMenu, onOpenColumnMenuChange, }) {
18
+ import { timeShown } from "../../display/format.js";
19
+ export function GridHeader({ showAddColumn = false, addColumnAt = "end", checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset = 0, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark = false, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount = 0, frozenLeft, verticalBorders = true, headerVerticalBorders = false, viewBacked = false, formatsWritable, renderAddColumn, columnMenuItems, openColumnMenu, onOpenColumnMenuChange, }) {
19
20
  const { icons, components, messages } = useViews();
20
21
  const headId = useId();
21
22
  const addColumnNode = columnManager && showAddColumn ? gridAddColumnNode(renderAddColumn, columnManager, addColumnAt) : null;
@@ -52,7 +53,7 @@ export function GridHeader({ showAddColumn = false, addColumnAt = "end", checkbo
52
53
  : "relative"), children: [withCheck && checkbox, gridColumnGlyph({ icons, AppIcon: components.AppIcon }, column, "h-(--vk-head-glyph) w-(--vk-head-glyph) shrink-0 text-(color:--vk-head-glyph-fg,currentColor) opacity-70"), column.header ? (_jsx("span", { id: nameId, className: "truncate", children: column.header })) : null, sortMark && sortedAs && (_jsx("span", { "aria-hidden": true, className: "inline-flex shrink-0", children: _jsx(Mark, { className: "h-(--vk-head-glyph) w-(--vk-head-glyph)" }) })), withAddColumn && titleAddColumn, columnStateEnabled && (_jsx(GridResizeHandle, { active: resizingId === column.id, onResizeStart: (event) => startResize(column, event), onResizeMove: moveResize, onResizeEnd: endResize, onReset: () => resetColumnWidth(column) }))] }, column.id));
53
54
  if (!menuEnabled)
54
55
  return cell;
55
- return (_jsx(GridColumnMenu, { column: column, values: selectValues[column.id] ?? [], viewBacked: viewBacked, sort: sort, groupBy: groupBy, optionColors: optionColors?.[fieldKeyOf(column)], onOptionColorChange: onOptionColorChange, dateStyle: dateStyles?.[fieldKeyOf(column)], onDateStyleChange: onDateStyleChange, durationStyle: durationStyles?.[fieldKeyOf(column)], onDurationStyleChange: onDurationStyleChange, numberFormat: numberFormats?.[fieldKeyOf(column)], onNumberFormatChange: onNumberFormatChange, showTime: showTimeOverrides?.[fieldKeyOf(column)] ?? column.format?.withTime ?? false, onShowTimeChange: column.type === "datetime" ? onShowTimeChange : undefined, percentDisplay: percentDisplays?.[fieldKeyOf(column)], onPercentDisplayChange: onPercentDisplayChange, onMoveLeft: canMove && index > 0 ? () => moveColumn(column, -1) : undefined, onMoveRight: canMove && index < columns.length - 1 ? () => moveColumn(column, 1) : undefined, onHide: canHide ? () => hideColumn(column) : undefined, formatsWritable: formatsWritable, renderColumnMenuRows: column.partOf ? undefined : renderColumnMenuRows, columnMenuItems: column.partOf ? undefined : columnMenuItems, open: openColumnMenu === undefined ? undefined : openColumnMenu === column.id, onOpenChange: onOpenColumnMenuChange ? (next) => onOpenColumnMenuChange(next ? column.id : null) : undefined, children: cell }, column.id));
56
+ return (_jsx(GridColumnMenu, { column: column, values: selectValues[column.id] ?? [], viewBacked: viewBacked, sort: sort, groupBy: groupBy, optionColors: optionColors?.[fieldKeyOf(column)], onOptionColorChange: onOptionColorChange, dateStyle: dateStyles?.[fieldKeyOf(column)], onDateStyleChange: onDateStyleChange, durationStyle: durationStyles?.[fieldKeyOf(column)], onDurationStyleChange: onDurationStyleChange, numberFormat: numberFormats?.[fieldKeyOf(column)], onNumberFormatChange: onNumberFormatChange, showTime: timeShown(column.format?.withTime, showTimeOverrides?.[fieldKeyOf(column)]), onShowTimeChange: column.type === "datetime" ? onShowTimeChange : undefined, percentDisplay: percentDisplays?.[fieldKeyOf(column)], onPercentDisplayChange: onPercentDisplayChange, onMoveLeft: canMove && index > 0 ? () => moveColumn(column, -1) : undefined, onMoveRight: canMove && index < columns.length - 1 ? () => moveColumn(column, 1) : undefined, onHide: canHide ? () => hideColumn(column) : undefined, formatsWritable: formatsWritable, columnMenuItems: column.partOf ? undefined : columnMenuItems, open: openColumnMenu === undefined ? undefined : openColumnMenu === column.id, onOpenChange: onOpenColumnMenuChange ? (next) => onOpenColumnMenuChange(next ? column.id : null) : undefined, children: cell }, column.id));
56
57
  }), _jsxs("div", { "data-slot": "vk-grid-tail", role: "columnheader", "aria-colindex": ariaTailIndex, style: GRID_TAIL_PLACE, className: cx("flex h-(--vk-head-h) min-w-0 items-center gap-2 border-b border-(color:--vk-border-subtle)", addColumn ? "pl-0" : "pl-(--vk-px)"), children: [listConfig?.readOnly && (_jsxs("span", { title: messages({ key: "views.grid.read-only-why" }), className: cx("inline-flex shrink-0 items-center gap-1 whitespace-nowrap text-(length:--vk-head-text) text-(color:--vk-fg-subtle)", !!addColumn && "pl-(--vk-px)"), children: [_jsx(icons.lock, { className: "h-3 w-3" }), messages({ key: "views.grid.read-only" })] })), addColumn && _jsx("div", { className: "flex h-full min-w-0 flex-1 items-stretch", children: addColumn })] })] }));
57
58
  return (_jsx("div", { "data-slot": "vk-grid-header", "data-group-key": groupKey, role: "row", "aria-rowindex": ariaRowIndex, "aria-level": ariaLevel, className: cx("group/gridhead grid grid-cols-(--vk-cols)", GRID_ONE_LINE, GRID_CONTENT_PAD), style: { minWidth }, children: cells }));
58
59
  }
@@ -1,55 +1,34 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type TextEditorType } from "../../editors/TextEditor.js";
3
3
  /**
4
- * The GRID's long-text panel — reading and editing a paragraph in ONE surface.
4
+ * The GRID's read-only text panel — reading a paragraph, or a line its cell cut off, in ONE surface.
5
5
  *
6
- * A `format.long` text is a paragraph, and a paragraph in a 37px cell is one
7
- * clipped line with no way in. So editing it does not swap the cell for a
8
- * one-line input: it opens a panel ON the cell (top-left on the cell's
9
- * top-left, the column's width) holding the whole value in the shared
10
- * `TextEditor` as a paragraph, the caret at the end — Attio's model.
11
- * Inspection is the same panel read-only: the value is selectable, copyable,
12
- * and never written.
6
+ * A text the person may write edits in its cell, in the app's `TextBody`. A text opened only to be read (a read-only
7
+ * cell inspected) has no body form, so it opens this panel ON the cell (top-left on the cell's top-left, the column's
8
+ * width) holding the whole value in the editor's own textarea, selectable and copyable, never written — Attio's model.
13
9
  *
14
- * Anchored like the select and date editors: the cell's own content stays on
15
- * screen behind the popover, `useAnchoredEditSession` owns the one-answer
16
- * guard and the exit gap, and the app's popover owns the viewport — with no
17
- * room below the panel opens above the cell. On a phone it opens in the sheet
18
- * instead (`EditorPanel`), titled with the column's header; the answer waits
19
- * for the sheet to slide away, and ✓ never moves the selection.
10
+ * Anchored like the select and date editors: the cell's own content stays on screen behind the popover, and the app's
11
+ * popover owns the viewport — with no room below the panel opens above the cell. On a phone it opens in the sheet
12
+ * instead (`EditorPanel`), titled with the column's header.
20
13
  *
21
- * It also opens a LINE whole (`paragraph={false}`): a plain text or a text
22
- * name its cell cut off. The box wraps so all of it shows, but it is
23
- * still a line: Enter commits and advances, and a newline is written as a space.
24
- *
25
- * Keys are a paragraph's: Enter is a newline; ⌘ or Ctrl Enter commits and
26
- * advances; Tab commits and moves; Escape cancels; an outside click commits.
27
- * The host grid's click-away listener clears the cell's focus after that commit.
14
+ * It opens a LINE whole too (`paragraph={false}`): a plain text or a text name its cell cut off. The box wraps so all
15
+ * of it shows. Every close writes nothing: Escape, Enter (⌘ or Ctrl Enter in a paragraph), Tab and an outside click
16
+ * close it, and Tab and Enter still move the grid's focus as they would from an edit.
28
17
  */
29
- export declare function GridLongTextEditor({ initial, seed, readOnly, markdown, paragraph, type, title, refuse, onCommit, onCancel, onTab, onEnter, }: {
30
- /** The stored value the session opens on ("" when unset). */
18
+ export declare function GridLongTextEditor({ initial, markdown, paragraph, type, title, onCancel, onTab, onEnter, }: {
19
+ /** The stored value the panel shows ("" when unset). */
31
20
  initial: string;
32
- /** Type-to-replace: the character that opened this editor replaces the value. */
33
- seed?: string;
34
- /** Inspection: the panel shows the value, selectable, and never commits. */
35
- readOnly?: boolean;
36
- /** Markdown keeps its first line's indent: it is tidied only at its edges
37
- * (`normalizeMarkdown`), where plain long text is trimmed. */
21
+ /** Rich text: the value is markdown, shown as it is stored. */
38
22
  markdown?: boolean;
39
- /** A paragraph (default): Enter is a newline. False: a line shown whole, where Enter commits. */
23
+ /** A paragraph (default). False: a line shown whole, where Enter closes. */
40
24
  paragraph?: boolean;
41
- /** The text editor's type for a line (its keyboard on a phone). Default: rich text when
42
- * `markdown`, else text. */
25
+ /** The text's type for a line. Default: rich text when `markdown`, else text. */
43
26
  type?: TextEditorType;
44
27
  /** The sheet's title on a phone: the column's header. */
45
28
  title?: ReactNode;
46
- onCommit: (value: string) => void;
47
29
  onCancel: () => void;
48
- /** Commit happened via Tab — move to the next cell in reading order. */
30
+ /** Closed via Tab — move to the next cell in reading order. */
49
31
  onTab?: (backwards: boolean) => void;
50
- /** Commit happened via ⌘-Enter — advance one row down. */
32
+ /** Closed via Enter (⌘ or Ctrl Enter in a paragraph) — advance one row down. */
51
33
  onEnter?: () => void;
52
- /** The grid's judgement of a value before it is written: its reason when it would refuse it.
53
- * A refused value stays open in the panel with that reason. */
54
- refuse?: (value: string) => string | null;
55
34
  }): import("react/jsx-runtime").JSX.Element;
@@ -2,13 +2,13 @@
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useLayoutEffect, useRef, useState } from "react";
4
4
  import { EditorPanel } from "../../editors/EditorPanel.js";
5
- import { TextEditor, } from "../../editors/TextEditor.js";
5
+ import { TextEditorHost, } from "../../editors/TextEditor.js";
6
6
  import { useViews } from "../../provider/context.js";
7
7
  import { cx } from "../../internal/cx.js";
8
8
  import { useGridEditSession } from "./grid-edit-session.js";
9
9
  const MIN_W = 320;
10
10
  const MAX_W = 512;
11
- export function GridLongTextEditor({ initial, seed, readOnly = false, markdown = false, paragraph = true, type, title, refuse, onCommit, onCancel, onTab, onEnter, }) {
11
+ export function GridLongTextEditor({ initial, markdown = false, paragraph = true, type, title, onCancel, onTab, onEnter, }) {
12
12
  const { messages } = useViews();
13
13
  const anchorRef = useRef(null);
14
14
  const editorRef = useRef(null);
@@ -20,17 +20,16 @@ export function GridLongTextEditor({ initial, seed, readOnly = false, markdown =
20
20
  }, []);
21
21
  const { session, close } = useGridEditSession({
22
22
  editorRef,
23
- refuse: refuse && ((value) => refuse(value)),
24
- onCommit: (payload) => onCommit(payload),
23
+ onCommit: () => { },
25
24
  onCancel,
26
25
  onTab,
27
26
  onEnter,
28
27
  });
29
28
  const width = cell ? Math.min(MAX_W, Math.max(MIN_W, cell.width)) : MIN_W;
30
29
  const padY = cell ? Math.max(0, (cell.height - cell.lineHeight) / 2 - 1) : 8;
31
- return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title ?? "", anchor: anchorRef, align: "start", sideOffset: cell ? -cell.height : 0, 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: (surface) => {
30
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title ?? "", anchor: anchorRef, align: "start", sideOffset: cell ? -cell.height : 0, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 rounded-sm border-(color:--vk-border) p-0", style: { width }, children: (surface) => {
32
31
  const framed = surface === "sheet" && paragraph;
33
- const editor = (_jsx(TextEditor, { ref: editorRef, type: type ?? (markdown ? "rich_text" : "text"), multiline: paragraph, wraps: !paragraph, initial: initial, seed: seed, readOnly: readOnly, ...(framed ? { rows: 3 } : {}), closeOnBlur: false, label: messages({ key: readOnly ? "views.grid.value" : "views.grid.edit-value" }), boxData: { "data-grid-editor": "" }, onRequestClose: close, style: cell && surface === "popover"
32
+ const editor = (_jsx(TextEditorHost, { ref: editorRef, type: type ?? (markdown ? "rich_text" : "text"), multiline: paragraph, initial: initial, readOnly: true, ...(framed ? { rows: 3 } : {}), closeOnBlur: false, label: messages({ key: "views.grid.value" }), boxData: { "data-grid-editor": "" }, onRequestClose: close, style: cell && surface === "popover"
34
33
  ? {
35
34
  paddingLeft: cell.paddingX,
36
35
  paddingRight: cell.paddingX,
@@ -39,7 +38,7 @@ export function GridLongTextEditor({ initial, seed, readOnly = false, markdown =
39
38
  fontSize: cell.fontSize,
40
39
  lineHeight: `${cell.lineHeight}px`,
41
40
  }
42
- : undefined, className: cx("block w-full resize-none select-text bg-transparent text-(color:--vk-fg) outline-hidden", "overflow-y-auto overscroll-contain", surface === "sheet" && !framed && "px-4 py-2", framed && "rounded-md px-3 py-2 ring ring-(color:--vk-border)", framed && !readOnly && "focus:ring-(color:--vk-border-brand)") }));
41
+ : undefined, className: cx("block w-full resize-none select-text bg-transparent text-(color:--vk-fg) outline-hidden", "overflow-y-auto overscroll-contain", surface === "sheet" && !framed && "px-4 py-2", framed && "rounded-md px-3 py-2 ring ring-(color:--vk-border)") }));
43
42
  return framed ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
44
43
  } })] }));
45
44
  }
@@ -4,12 +4,12 @@ import { useRef } from "react";
4
4
  import { EditorPanel } from "../../editors/EditorPanel.js";
5
5
  import { NameEditor } from "../../editors/NameEditor.js";
6
6
  import { useGridEditSession } from "./grid-edit-session.js";
7
- import { useBodyPanel } from "../../editors/body-panel.js";
7
+ import { bodyPanel } from "../../editors/body-panel.js";
8
8
  import { useGridBodyPlace } from "./grid-body-place.js";
9
9
  export function GridNameEditor({ title, initial, seed, allowEmpty = false, onCommit, onCancel, onTab, onEnter, }) {
10
- const panel = useBodyPanel("parts", "w-80 p-2", "z-90");
10
+ const panel = bodyPanel("parts", "z-90");
11
11
  const anchorRef = useRef(null);
12
- const place = useGridBodyPlace("parts", anchorRef);
12
+ const place = useGridBodyPlace(anchorRef);
13
13
  const editorRef = useRef(null);
14
14
  const { session, close } = useGridEditSession({
15
15
  editorRef,
@@ -19,7 +19,7 @@ export function GridNameEditor({ title, initial, seed, allowEmpty = false, onCom
19
19
  onEnter,
20
20
  });
21
21
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
22
- const editor = (_jsx(NameEditor, { ref: editorRef, initial: initial, seed: seed, allowEmpty: allowEmpty, chrome: surface === "sheet" ? "field" : "bare", label: typeof title === "string" ? title : undefined, onRequestClose: close }));
22
+ const editor = (_jsx(NameEditor, { ref: editorRef, initial: initial, seed: seed, allowEmpty: allowEmpty, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
23
23
  return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
24
24
  } })] }));
25
25
  }
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
2
2
  import type { DurationUnit } from "viewkitjs/fields/query";
3
3
  import type { GridNumberEditValue } from "../core/edit-values.js";
4
4
  /**
5
- * The GRID's host around the shared `NumberEditor` (`viewkitjs/views/editors/number`) —
5
+ * The GRID's host around the shared `NumberEditorHost` (`viewkitjs/views/editors/number`) —
6
6
  * the typed field and its unit chip are one component across every surface;
7
7
  * the edit session owns the one-answer guard, and the editor panel decides where
8
8
  * it opens. This host owns the grid's part: the write, and the focus move that
@@ -32,8 +32,7 @@ export declare function GridNumberEditor({ title, initial, seed, unit, unitOptio
32
32
  /** A duration column's STORED unit — the core edits it as human text. */
33
33
  durationUnit?: DurationUnit;
34
34
  allowEmpty?: boolean;
35
- /** Right-aligned columns put the chip on the LEFT so the number stays flush
36
- * with the column's right edge. */
35
+ /** A right-aligned column: the body's box grows leftward, so the number stays flush with the column's right edge. */
37
36
  unitLeft?: boolean;
38
37
  /** The figure the cell showed, when it showed the row's amount converted into another currency: named under
39
38
  * the editor, which opens on the row's own amount. */
@@ -46,9 +45,9 @@ export declare function GridNumberEditor({ title, initial, seed, unit, unitOptio
46
45
  /** The grid's judgement of a value before it is written: its reason when it would refuse it.
47
46
  * A refused value keeps the editor open with that reason. */
48
47
  refuse?: (value: GridNumberEditValue) => string | null;
49
- /** The field's type: an app's `NumberBody` is handed it as its kind. Default `number`. */
48
+ /** The field's type: the `NumberBody` is handed it as its kind. Default `number`. */
50
49
  type?: "number" | "percent" | "currency";
51
- /** The field's limits (`numberBounds`): the editor's own box steps within them, and an app's `NumberBody` is handed them. */
50
+ /** The field's limits (`numberBounds`): the `NumberBody` is handed them. */
52
51
  bounds?: {
53
52
  min?: number;
54
53
  max?: number;
@@ -1,13 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useRef } from "react";
4
- import { NumberEditor } from "../../editors/NumberEditor.js";
4
+ import { NumberEditorHost } from "../../editors/NumberEditor.js";
5
5
  import { EditorPanel } from "../../editors/EditorPanel.js";
6
6
  import { ConversionLine } from "../../display/converted.js";
7
7
  import { useKeepInside } from "../../editors/keep-inside.js";
8
8
  import { cx } from "../../internal/cx.js";
9
- import { useViews } from "../../provider/context.js";
10
- import { GRID_EDITOR_LAYER } from "./grid-editor-layer.js";
9
+ import { BODY_FIGURE_ROOM_PX, GRID_EDITOR_LAYER } from "./grid-editor-layer.js";
11
10
  import { GridFittedBox } from "./grid-fitted-box.js";
12
11
  import { GridRefusal, UNDER_CELL_CLASS, useGridEditSession } from "./grid-edit-session.js";
13
12
  export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code, decimals = 2, durationUnit, allowEmpty = false, unitLeft = false, conversion, onCommit, onCancel, onTab, onEnter, refuse, type, bounds, }) {
@@ -22,8 +21,8 @@ export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code
22
21
  onTab,
23
22
  onEnter,
24
23
  });
25
- const body = !!useViews().components.NumberBody && !durationUnit;
26
- const editor = (surface) => (_jsx(NumberEditor, { ref: editorRef, initial: initial, seed: seed, unit: unit, unitOptions: unitOptions, code: code, decimals: decimals, durationUnit: durationUnit, allowEmpty: allowEmpty, unitLeft: unitLeft, ...bounds, ...(body
24
+ const body = !durationUnit;
25
+ const editor = (surface) => (_jsx(NumberEditorHost, { ref: editorRef, initial: initial, seed: seed, unit: unit, unitOptions: unitOptions, code: code, decimals: decimals, durationUnit: durationUnit, allowEmpty: allowEmpty, ...bounds, ...(body
27
26
  ? {
28
27
  type,
29
28
  label: typeof title === "string" ? title : undefined,
@@ -33,7 +32,7 @@ export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code
33
32
  form: surface === "sheet" ? "phone" : "computer",
34
33
  }
35
34
  : {}), onRequestClose: close }));
36
- return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, children: (surface) => body ? (surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [editor(surface), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { ref: anchorRef, "data-slot": "vk-grid-editor", "data-grown": "", className: cx(GRID_EDITOR_LAYER, unitLeft && "justify-end"), children: [editor(surface), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] }))) : surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [_jsx("div", { className: "flex h-10 min-w-0 items-center rounded-md border border-(color:--vk-border) px-2", children: editor(surface) }), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", className: cx("relative flex h-full w-full min-w-0", unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] })) }));
35
+ return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, children: (surface) => body ? (surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [editor(surface), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", "data-grown": "", className: cx(GRID_EDITOR_LAYER, unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, edge: false, room: BODY_FIGURE_ROOM_PX, children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] }))) : surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [_jsx("div", { className: "flex h-10 min-w-0 items-center rounded-md border border-(color:--vk-border) px-2", children: editor(surface) }), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", className: cx("relative flex h-full w-full min-w-0", unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] })) }));
37
36
  }
38
37
  function UnderCellConversion({ figure }) {
39
38
  const ref = useRef(null);
@@ -7,11 +7,10 @@ import type { FieldDefOf, LocationValue } from "viewkitjs/fields";
7
7
  * session owns the one-answer guard and the exit gap; the editor panel opens the
8
8
  * popover on a desktop and the sheet on a phone, titled with the column's
9
9
  * header. An emptied place always reaches `refuse`, so a field that can't be
10
- * emptied says so in the editor rather than closing on nothing; a column that
11
- * may be emptied (`clearable`) ends the editor with a Clear row. No seed: a key
10
+ * emptied says so in the editor rather than closing on nothing. No seed: a key
12
11
  * typed on a place cell opens the place as it is.
13
12
  */
14
- export declare function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter, clearable, }: {
13
+ export declare function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter, }: {
15
14
  field: FieldDefOf<"location">;
16
15
  /** The field's name: the sheet's title on a phone. */
17
16
  title: ReactNode;
@@ -24,6 +23,4 @@ export declare function GridPlaceEditor({ field, title, initial, refuse, onCommi
24
23
  onTab?: (backwards: boolean) => void;
25
24
  /** Commit happened via Enter — advance one row down. */
26
25
  onEnter?: () => void;
27
- /** The column may be emptied: the editor ends with a Clear row, which commits null. Default false. */
28
- clearable?: boolean;
29
26
  }): import("react/jsx-runtime").JSX.Element;
@@ -4,12 +4,12 @@ import { useRef } from "react";
4
4
  import { EditorPanel } from "../../editors/EditorPanel.js";
5
5
  import { LocationEditor } from "../../editors/LocationEditor.js";
6
6
  import { useGridEditSession } from "./grid-edit-session.js";
7
- import { useBodyPanel } from "../../editors/body-panel.js";
7
+ import { bodyPanel } from "../../editors/body-panel.js";
8
8
  import { useGridBodyPlace } from "./grid-body-place.js";
9
- export function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter, clearable = false, }) {
10
- const panel = useBodyPanel("parts", "w-96 p-2", "z-90");
9
+ export function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter, }) {
10
+ const panel = bodyPanel("parts", "z-90");
11
11
  const anchorRef = useRef(null);
12
- const place = useGridBodyPlace("parts", anchorRef);
12
+ const place = useGridBodyPlace(anchorRef);
13
13
  const editorRef = useRef(null);
14
14
  const { session, close } = useGridEditSession({
15
15
  editorRef,
@@ -20,7 +20,7 @@ export function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCan
20
20
  onEnter,
21
21
  });
22
22
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
23
- const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: initial, allowEmpty: true, clearable: clearable, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
23
+ const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: initial, allowEmpty: true, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
24
24
  return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
25
25
  } })] }));
26
26
  }
@@ -1,13 +1,12 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { RangePreset, RangeValue } from "viewkitjs/fields";
3
3
  /**
4
- * The GRID's host around the shared `RangeEditor` — like the number host: the
5
- * edit session owns the one-answer guard and the editor panel decides where it
6
- * opens. On a desktop the two boxes replace the cell's content, the write lands
7
- * at once, and only then does focus move; on a phone they open in the sheet and
8
- * the answer waits for the sheet to slide away.
4
+ * The GRID's host around the shared `RangeEditor`: the edit session owns the
5
+ * one-answer guard and the editor panel decides where it opens. On a desktop the
6
+ * app's parts body opens in a popover over the cell, its top on the cell's top;
7
+ * on a phone it opens in the sheet and the answer waits for the sheet to slide away.
9
8
  */
10
- export declare function GridRangeEditor({ title, initial, seed, decimals, allowEmpty, suffix, bands, bounds, onCommit, onCancel, onTab, onEnter, refuse, }: {
9
+ export declare function GridRangeEditor({ title, initial, seed, decimals, allowEmpty, suffix, bands, onCommit, onCancel, onTab, onEnter, refuse, }: {
11
10
  /** The field's name: the sheet's title on a phone. */
12
11
  title: ReactNode;
13
12
  initial: RangeValue | null;
@@ -17,13 +16,8 @@ export declare function GridRangeEditor({ title, initial, seed, decimals, allowE
17
16
  allowEmpty?: boolean;
18
17
  /** "%", a currency code — drawn after the high box. */
19
18
  suffix?: string;
20
- /** The field's bands: a menu under the cell on the desktop, listed under the boxes in the sheet. */
19
+ /** The field's bands: the body lists them. */
21
20
  bands?: readonly RangePreset[];
22
- /** The field's limits for each end (`numberBounds`): the editor's own boxes step within them. */
23
- bounds?: {
24
- min?: number;
25
- max?: number;
26
- };
27
21
  onCommit: (payload: RangeValue) => void;
28
22
  onCancel: () => void;
29
23
  onTab?: (backwards: boolean) => void;
@@ -3,30 +3,22 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { useRef } from "react";
4
4
  import { RangeEditor } from "../../editors/RangeEditor.js";
5
5
  import { EditorPanel } from "../../editors/EditorPanel.js";
6
- import { useViews } from "../../provider/context.js";
7
- import { GridRefusal, useGridEditSession } from "./grid-edit-session.js";
8
- import { useBodyPanel } from "../../editors/body-panel.js";
6
+ import { useGridEditSession } from "./grid-edit-session.js";
7
+ import { bodyPanel } from "../../editors/body-panel.js";
9
8
  import { useGridBodyPlace } from "./grid-body-place.js";
10
- export function GridRangeEditor({ title, initial, seed, decimals = 0, allowEmpty = false, suffix, bands, bounds, onCommit, onCancel, onTab, onEnter, refuse, }) {
11
- const panel = useBodyPanel("parts", "w-80 p-2", "z-90");
9
+ export function GridRangeEditor({ title, initial, seed, decimals = 0, allowEmpty = false, suffix, bands, onCommit, onCancel, onTab, onEnter, refuse, }) {
10
+ const panel = bodyPanel("parts", "z-90");
12
11
  const editorRef = useRef(null);
13
12
  const anchorRef = useRef(null);
14
- const place = useGridBodyPlace("parts", anchorRef);
15
- const { PartsBody } = useViews().components;
16
- const inPlace = !PartsBody;
13
+ const place = useGridBodyPlace(anchorRef);
17
14
  const { session, close } = useGridEditSession({
18
15
  editorRef,
19
- inPlace,
20
16
  refuse: refuse && ((value) => refuse(value)),
21
17
  onCommit: (payload) => onCommit(payload),
22
18
  onCancel,
23
19
  onTab,
24
20
  onEnter,
25
21
  });
26
- const banded = (bands?.length ?? 0) > 0 && inPlace;
27
- const editor = (sheet) => (_jsx(RangeEditor, { ref: editorRef, initial: initial, seed: seed, decimals: decimals, allowEmpty: allowEmpty, suffix: suffix, bands: bands, ...bounds, bandsAt: sheet ? "below" : "popover", refusal: session.refusal, label: typeof title === "string" ? title : undefined, boxClassName: sheet ? "h-10 rounded-md border border-(color:--vk-border) px-2" : undefined, onRequestClose: close }));
28
- if (!inPlace) {
29
- return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor(true) }) : editor(false)) })] }));
30
- }
31
- return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, editorDrawsRefusal: banded, children: (surface) => surface === "sheet" ? (_jsx("div", { className: "px-2 pb-3", children: editor(true) })) : (_jsxs("span", { ref: anchorRef, "data-slot": "vk-grid-editor", className: "relative flex h-full w-full min-w-0", children: [editor(false), !banded && _jsx(GridRefusal, { reason: session.refusal })] })) }));
22
+ const editor = (_jsx(RangeEditor, { ref: editorRef, initial: initial, seed: seed, decimals: decimals, allowEmpty: allowEmpty, suffix: suffix, bands: bands, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
23
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
32
24
  }