viewkitjs 0.27.0 → 0.29.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 (469) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/MIGRATION.md +123 -5
  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 +3 -1
  41. package/views/dist/cells/cell-format.js +3 -3
  42. package/views/dist/cells/cell-values.js +9 -10
  43. package/views/dist/cells/use-cell-format.d.ts +8 -1
  44. package/views/dist/cells/use-cell-format.js +13 -2
  45. package/views/dist/contract.d.ts +218 -5
  46. package/views/dist/contract.js +233 -1
  47. package/views/dist/controls/alert/alert.d.ts +46 -0
  48. package/views/dist/controls/alert/alert.js +11 -0
  49. package/views/dist/controls/alert/looks.d.ts +4 -0
  50. package/views/dist/controls/alert/looks.js +19 -0
  51. package/views/dist/controls/alert/tokens.d.ts +92 -0
  52. package/views/dist/controls/alert/tokens.js +25 -0
  53. package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
  54. package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
  55. package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
  56. package/views/dist/controls/alert-dialog/confirm.js +11 -0
  57. package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
  58. package/views/dist/controls/alert-dialog/looks.js +17 -0
  59. package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
  60. package/views/dist/controls/alert-dialog/tokens.js +32 -0
  61. package/views/dist/controls/alert-dialog.css +95 -0
  62. package/views/dist/controls/alert.css +51 -0
  63. package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
  64. package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
  65. package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
  66. package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
  67. package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
  68. package/views/dist/controls/bulk-bar/looks.js +14 -0
  69. package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
  70. package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
  71. package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
  72. package/views/dist/controls/bulk-bar/tokens.js +36 -0
  73. package/views/dist/controls/bulk-bar/words.d.ts +50 -0
  74. package/views/dist/controls/bulk-bar/words.js +19 -0
  75. package/views/dist/controls/bulk-bar.css +96 -0
  76. package/views/dist/controls/button/button.js +3 -1
  77. package/views/dist/controls/button.css +5 -4
  78. package/views/dist/controls/checkbox/checkbox.js +3 -1
  79. package/views/dist/controls/checkbox.css +1 -1
  80. package/views/dist/controls/choice/tokens.d.ts +79 -0
  81. package/views/dist/controls/choice/tokens.js +22 -0
  82. package/views/dist/controls/choice.css +31 -0
  83. package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
  84. package/views/dist/controls/collapsible/collapsible.js +18 -0
  85. package/views/dist/controls/collapsible/looks.d.ts +4 -0
  86. package/views/dist/controls/collapsible/looks.js +5 -0
  87. package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
  88. package/views/dist/controls/collapsible/map-collapse.js +6 -0
  89. package/views/dist/controls/collapsible/tokens.d.ts +68 -0
  90. package/views/dist/controls/collapsible/tokens.js +19 -0
  91. package/views/dist/controls/collapsible.css +83 -0
  92. package/views/dist/controls/compound-editor/looks.js +1 -1
  93. package/views/dist/controls/compound-editor/place-parts.js +5 -1
  94. package/views/dist/controls/controls.d.ts +19 -0
  95. package/views/dist/controls/controls.js +17 -0
  96. package/views/dist/controls/customize/customize.d.ts +125 -0
  97. package/views/dist/controls/customize/customize.js +243 -0
  98. package/views/dist/controls/customize/glide.d.ts +10 -0
  99. package/views/dist/controls/customize/glide.js +55 -0
  100. package/views/dist/controls/customize/looks.d.ts +13 -0
  101. package/views/dist/controls/customize/looks.js +11 -0
  102. package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
  103. package/views/dist/controls/customize/map-customize-body.js +160 -0
  104. package/views/dist/controls/customize/rules.d.ts +23 -0
  105. package/views/dist/controls/customize/rules.js +19 -0
  106. package/views/dist/controls/customize/tokens.d.ts +40 -0
  107. package/views/dist/controls/customize/tokens.js +12 -0
  108. package/views/dist/controls/customize/words.d.ts +58 -0
  109. package/views/dist/controls/customize/words.js +37 -0
  110. package/views/dist/controls/customize.css +54 -0
  111. package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
  112. package/views/dist/controls/date-editor/looks.js +1 -1
  113. package/views/dist/controls/date-editor/map-calendar.js +3 -1
  114. package/views/dist/controls/filter-editor/block.d.ts +31 -0
  115. package/views/dist/controls/filter-editor/block.js +27 -0
  116. package/views/dist/controls/filter-editor/filter-editor.d.ts +58 -0
  117. package/views/dist/controls/filter-editor/filter-editor.js +250 -0
  118. package/views/dist/controls/filter-editor/how.d.ts +23 -0
  119. package/views/dist/controls/filter-editor/how.js +14 -0
  120. package/views/dist/controls/filter-editor/map-filter-body.d.ts +33 -0
  121. package/views/dist/controls/filter-editor/map-filter-body.js +190 -0
  122. package/views/dist/controls/filter-editor/map-rules.d.ts +101 -0
  123. package/views/dist/controls/filter-editor/map-rules.js +304 -0
  124. package/views/dist/controls/filter-editor/parts.d.ts +46 -0
  125. package/views/dist/controls/filter-editor/parts.js +75 -0
  126. package/views/dist/controls/filter-editor/rules.d.ts +142 -0
  127. package/views/dist/controls/filter-editor/rules.js +201 -0
  128. package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
  129. package/views/dist/controls/filter-editor/tokens.js +23 -0
  130. package/views/dist/controls/filter-editor/words.d.ts +74 -0
  131. package/views/dist/controls/filter-editor/words.js +46 -0
  132. package/views/dist/controls/filter-editor.css +142 -0
  133. package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
  134. package/views/dist/controls/group-editor/group-editor.js +126 -0
  135. package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
  136. package/views/dist/controls/group-editor/map-group-body.js +106 -0
  137. package/views/dist/controls/group-editor/rules.d.ts +48 -0
  138. package/views/dist/controls/group-editor/rules.js +41 -0
  139. package/views/dist/controls/group-editor/tokens.d.ts +15 -0
  140. package/views/dist/controls/group-editor/tokens.js +6 -0
  141. package/views/dist/controls/group-editor/words.d.ts +39 -0
  142. package/views/dist/controls/group-editor/words.js +21 -0
  143. package/views/dist/controls/group-editor.css +20 -0
  144. package/views/dist/controls/index.d.ts +45 -3
  145. package/views/dist/controls/index.js +44 -3
  146. package/views/dist/controls/inline-input/looks.js +1 -1
  147. package/views/dist/controls/input/input.js +10 -4
  148. package/views/dist/controls/internal/editor-parts.d.ts +8 -1
  149. package/views/dist/controls/internal/editor-parts.js +5 -0
  150. package/views/dist/controls/internal/phone.d.ts +5 -4
  151. package/views/dist/controls/internal/phone.js +7 -7
  152. package/views/dist/controls/internal/scroll.js +5 -1
  153. package/views/dist/controls/internal/step-return.d.ts +9 -0
  154. package/views/dist/controls/internal/step-return.js +27 -0
  155. package/views/dist/controls/internal/typed-run.d.ts +2 -0
  156. package/views/dist/controls/internal/typed-run.js +5 -0
  157. package/views/dist/controls/links-editor/links-editor.d.ts +5 -3
  158. package/views/dist/controls/links-editor/links-editor.js +38 -17
  159. package/views/dist/controls/links-editor/map-links-body.js +4 -1
  160. package/views/dist/controls/links-editor.css +1 -1
  161. package/views/dist/controls/menu/map-menu.js +2 -2
  162. package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
  163. package/views/dist/controls/menu-list/menu-list.js +25 -16
  164. package/views/dist/controls/modal/looks.d.ts +4 -0
  165. package/views/dist/controls/modal/looks.js +25 -0
  166. package/views/dist/controls/modal/modal.d.ts +69 -0
  167. package/views/dist/controls/modal/modal.js +62 -0
  168. package/views/dist/controls/modal/tokens.d.ts +192 -0
  169. package/views/dist/controls/modal/tokens.js +50 -0
  170. package/views/dist/controls/modal.css +130 -0
  171. package/views/dist/controls/notice/notice.d.ts +49 -0
  172. package/views/dist/controls/notice/notice.js +35 -0
  173. package/views/dist/controls/notice/tokens.d.ts +99 -0
  174. package/views/dist/controls/notice/tokens.js +27 -0
  175. package/views/dist/controls/notice.css +100 -0
  176. package/views/dist/controls/number-editor/looks.js +1 -1
  177. package/views/dist/controls/number-editor/number-editor.js +1 -1
  178. package/views/dist/controls/option/option.js +3 -1
  179. package/views/dist/controls/option.css +1 -1
  180. package/views/dist/controls/pane/looks.d.ts +4 -0
  181. package/views/dist/controls/pane/looks.js +11 -0
  182. package/views/dist/controls/pane/pane.d.ts +67 -0
  183. package/views/dist/controls/pane/pane.js +99 -0
  184. package/views/dist/controls/pane/state.d.ts +14 -0
  185. package/views/dist/controls/pane/state.js +7 -0
  186. package/views/dist/controls/pane/tokens.d.ts +79 -0
  187. package/views/dist/controls/pane/tokens.js +22 -0
  188. package/views/dist/controls/pane.css +104 -0
  189. package/views/dist/controls/picker/looks.js +1 -1
  190. package/views/dist/controls/picker/map-picker.d.ts +6 -2
  191. package/views/dist/controls/picker/map-picker.js +4 -2
  192. package/views/dist/controls/picker/picker.d.ts +7 -0
  193. package/views/dist/controls/picker/picker.js +57 -8
  194. package/views/dist/controls/picker/rows.d.ts +4 -2
  195. package/views/dist/controls/picker/rows.js +4 -3
  196. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  197. package/views/dist/controls/popover/map-popover.js +2 -2
  198. package/views/dist/controls/popover/popover.js +2 -1
  199. package/views/dist/controls/popover.css +3 -0
  200. package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
  201. package/views/dist/controls/ports-host/map-ports-host.js +43 -0
  202. package/views/dist/controls/press/tokens.d.ts +8 -0
  203. package/views/dist/controls/press/tokens.js +4 -0
  204. package/views/dist/controls/press.css +44 -0
  205. package/views/dist/controls/quick-filters/looks.d.ts +11 -0
  206. package/views/dist/controls/quick-filters/looks.js +9 -0
  207. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
  208. package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
  209. package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
  210. package/views/dist/controls/quick-filters/quick-filters.js +89 -0
  211. package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
  212. package/views/dist/controls/quick-filters/reminder.js +41 -0
  213. package/views/dist/controls/quick-filters/rules.d.ts +89 -0
  214. package/views/dist/controls/quick-filters/rules.js +52 -0
  215. package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
  216. package/views/dist/controls/quick-filters/tokens.js +30 -0
  217. package/views/dist/controls/quick-filters/words.d.ts +25 -0
  218. package/views/dist/controls/quick-filters/words.js +13 -0
  219. package/views/dist/controls/quick-filters.css +118 -0
  220. package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
  221. package/views/dist/controls/sheet/bottom-sheet.js +4 -4
  222. package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
  223. package/views/dist/controls/sheet/map-sheet.js +19 -6
  224. package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
  225. package/views/dist/controls/sheet/sheet-parts.js +2 -0
  226. package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
  227. package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
  228. package/views/dist/controls/sort-editor/rules.d.ts +48 -0
  229. package/views/dist/controls/sort-editor/rules.js +24 -0
  230. package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
  231. package/views/dist/controls/sort-editor/sort-editor.js +180 -0
  232. package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
  233. package/views/dist/controls/sort-editor/tokens.js +22 -0
  234. package/views/dist/controls/sort-editor/words.d.ts +48 -0
  235. package/views/dist/controls/sort-editor/words.js +25 -0
  236. package/views/dist/controls/sort-editor.css +96 -0
  237. package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
  238. package/views/dist/controls/switch-row/switch-row.js +9 -0
  239. package/views/dist/controls/switch-row/tokens.d.ts +51 -0
  240. package/views/dist/controls/switch-row/tokens.js +15 -0
  241. package/views/dist/controls/switch-row.css +39 -0
  242. package/views/dist/controls/switch.css +1 -1
  243. package/views/dist/controls/tag/tag.js +3 -1
  244. package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
  245. package/views/dist/controls/tag-field/tag-field.js +19 -0
  246. package/views/dist/controls/tag-field/tokens.d.ts +7 -0
  247. package/views/dist/controls/tag-field/tokens.js +4 -0
  248. package/views/dist/controls/tag-field.css +13 -0
  249. package/views/dist/controls/text-editor/looks.js +1 -1
  250. package/views/dist/controls/text-editor/text-editor.js +1 -5
  251. package/views/dist/controls/toast/toast.d.ts +79 -0
  252. package/views/dist/controls/toast/toast.js +101 -0
  253. package/views/dist/controls/toast/tokens.d.ts +100 -0
  254. package/views/dist/controls/toast/tokens.js +27 -0
  255. package/views/dist/controls/toast.css +93 -0
  256. package/views/dist/controls/tokens.js +38 -0
  257. package/views/dist/controls/toolbar/keys.d.ts +3 -0
  258. package/views/dist/controls/toolbar/keys.js +11 -0
  259. package/views/dist/controls/toolbar/looks.d.ts +10 -0
  260. package/views/dist/controls/toolbar/looks.js +40 -0
  261. package/views/dist/controls/toolbar/tokens.d.ts +28 -0
  262. package/views/dist/controls/toolbar/tokens.js +9 -0
  263. package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
  264. package/views/dist/controls/toolbar/toolbar.js +370 -0
  265. package/views/dist/controls/toolbar/words.d.ts +28 -0
  266. package/views/dist/controls/toolbar/words.js +17 -0
  267. package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
  268. package/views/dist/controls/toolbar-button/looks.js +21 -0
  269. package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
  270. package/views/dist/controls/toolbar-button/tokens.js +28 -0
  271. package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
  272. package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
  273. package/views/dist/controls/toolbar-button.css +75 -0
  274. package/views/dist/controls/toolbar.css +65 -0
  275. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  276. package/views/dist/controls/tooltip/map-tooltip.js +2 -2
  277. package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
  278. package/views/dist/controls/tooltip/tooltip.js +2 -2
  279. package/views/dist/controls/values-editor/looks.js +1 -1
  280. package/views/dist/controls/values-editor/values-editor.js +7 -1
  281. package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
  282. package/views/dist/controls/views-list/map-views-list-body.js +128 -4
  283. package/views/dist/controls/views-list/rules.d.ts +26 -0
  284. package/views/dist/controls/views-list/rules.js +63 -0
  285. package/views/dist/controls/views-list/view-menu.d.ts +84 -0
  286. package/views/dist/controls/views-list/view-menu.js +201 -0
  287. package/views/dist/controls/views-list/views-list.d.ts +8 -1
  288. package/views/dist/controls/views-list/views-list.js +18 -3
  289. package/views/dist/controls/views-list/words.d.ts +54 -0
  290. package/views/dist/controls/views-list/words.js +10 -1
  291. package/views/dist/controls/views-list.css +5 -1
  292. package/views/dist/display/date.js +5 -5
  293. package/views/dist/display/format.d.ts +6 -0
  294. package/views/dist/display/format.js +13 -2
  295. package/views/dist/display/index.d.ts +1 -1
  296. package/views/dist/display/index.js +1 -1
  297. package/views/dist/display/options.d.ts +3 -1
  298. package/views/dist/display/range.d.ts +2 -1
  299. package/views/dist/display/range.js +4 -1
  300. package/views/dist/display/use-display-options.d.ts +3 -0
  301. package/views/dist/display/use-display-options.js +10 -2
  302. package/views/dist/display/viewer.d.ts +1 -1
  303. package/views/dist/display/viewer.js +1 -1
  304. package/views/dist/editors/DateEditor.js +11 -9
  305. package/views/dist/editors/relation-panel.js +7 -1
  306. package/views/dist/editors/relation-picker.d.ts +2 -1
  307. package/views/dist/editors/relation-picker.js +4 -3
  308. package/views/dist/editors/relation-source.d.ts +4 -1
  309. package/views/dist/editors/relation-source.js +5 -2
  310. package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
  311. package/views/dist/fields/number-edit.d.ts +6 -0
  312. package/views/dist/fields/number-edit.js +8 -1
  313. package/views/dist/grid/chrome/GridCellEditors.js +2 -2
  314. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
  315. package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
  316. package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
  317. package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
  318. package/views/dist/grid/chrome/GridFooter.js +2 -2
  319. package/views/dist/grid/chrome/GridHeader.js +2 -1
  320. package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
  321. package/views/dist/grid/chrome/GridRowCells.js +2 -1
  322. package/views/dist/grid/chrome/GridTextEditor.js +2 -2
  323. package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
  324. package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
  325. package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
  326. package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
  327. package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
  328. package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
  329. package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
  330. package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
  331. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
  332. package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
  333. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
  334. package/views/dist/grid/core/clipboard-model.js +9 -4
  335. package/views/dist/grid/core/commit-model.d.ts +7 -0
  336. package/views/dist/grid/core/commit-model.js +5 -1
  337. package/views/dist/grid/core/editing-controller.js +10 -2
  338. package/views/dist/grid/core/editing-model.js +3 -7
  339. package/views/dist/grid/core/undo-owner.d.ts +6 -0
  340. package/views/dist/grid/core/undo-owner.js +13 -0
  341. package/views/dist/grid/core/useGridEditing.d.ts +2 -0
  342. package/views/dist/grid/core/useGridEditing.js +4 -0
  343. package/views/dist/grid/grid.css +240 -0
  344. package/views/dist/grid/looks.d.ts +5 -1
  345. package/views/dist/grid/looks.js +20 -12
  346. package/views/dist/grid-tokens.d.ts +109 -0
  347. package/views/dist/grid-tokens.js +29 -0
  348. package/views/dist/looks/index.d.ts +10 -0
  349. package/views/dist/looks/index.js +10 -0
  350. package/views/dist/looks/pieces.js +20 -0
  351. package/views/dist/model/column-capabilities.d.ts +2 -0
  352. package/views/dist/model/column-filters.d.ts +2 -1
  353. package/views/dist/model/column-from.js +2 -2
  354. package/views/dist/model/relation-filters.d.ts +2 -0
  355. package/views/dist/panels/index.d.ts +2 -2
  356. package/views/dist/panels/index.js +2 -2
  357. package/views/dist/panels/labels.d.ts +4 -0
  358. package/views/dist/panels/labels.js +8 -0
  359. package/views/dist/panels/model.d.ts +14 -1
  360. package/views/dist/panels/quick/model.d.ts +4 -0
  361. package/views/dist/panels/react/customize-body.d.ts +12 -5
  362. package/views/dist/panels/react/customize-body.js +41 -13
  363. package/views/dist/panels/react/customize.d.ts +8 -1
  364. package/views/dist/panels/react/customize.js +11 -6
  365. package/views/dist/panels/react/filter/FilterEditor.js +6 -6
  366. package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
  367. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
  368. package/views/dist/panels/react/filter/PhoneFilterEditor.js +12 -9
  369. package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
  370. package/views/dist/panels/react/filter/filter-body.js +21 -7
  371. package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
  372. package/views/dist/panels/react/filter/filter-part-body.js +3 -1
  373. package/views/dist/panels/react/panel-sheet.d.ts +5 -1
  374. package/views/dist/panels/react/panel-sheet.js +6 -2
  375. package/views/dist/panels/react/panel-step.d.ts +15 -0
  376. package/views/dist/panels/react/panel-step.js +27 -0
  377. package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
  378. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
  379. package/views/dist/panels/react/sort/SortEditor.js +5 -2
  380. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +18 -0
  381. package/views/dist/panels/react/toolbar/ReadyToolbar.js +93 -4
  382. package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
  383. package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
  384. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +15 -5
  385. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
  386. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +50 -0
  387. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
  388. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
  389. package/views/dist/panels/react/toolbar/ToolbarFilters.js +38 -23
  390. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
  391. package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
  392. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
  393. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
  394. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  395. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
  396. package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
  397. package/views/dist/panels/react/toolbar/panel-part.js +2 -2
  398. package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
  399. package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
  400. package/views/dist/panels/react/view-footer.d.ts +1 -1
  401. package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
  402. package/views/dist/panels/react.d.ts +1 -0
  403. package/views/dist/panels/react.js +1 -0
  404. package/views/dist/panels/settings/filter-groups.d.ts +3 -0
  405. package/views/dist/panels/settings/filter-groups.js +72 -7
  406. package/views/dist/panels/settings/filters.d.ts +5 -0
  407. package/views/dist/panels/settings/filters.js +12 -6
  408. package/views/dist/panels/settings/group-buckets.js +1 -0
  409. package/views/dist/panels/views-row/model.d.ts +10 -1
  410. package/views/dist/provider/ViewsProvider.d.ts +7 -1
  411. package/views/dist/provider/ViewsProvider.js +50 -6
  412. package/views/dist/provider/components.d.ts +178 -11
  413. package/views/dist/provider/context.d.ts +6 -0
  414. package/views/dist/provider/moment.d.ts +6 -0
  415. package/views/dist/provider/moment.js +10 -0
  416. package/views/dist/provider/ports.d.ts +18 -6
  417. package/views/dist/provider/ports.js +2 -1
  418. package/views/dist/react.d.ts +2 -2
  419. package/views/dist/react.js +1 -1
  420. package/views/dist/selection/SelectionBar.d.ts +2 -16
  421. package/views/dist/selection/SelectionBar.js +4 -1
  422. package/views/dist/selection/bar-props.d.ts +26 -0
  423. package/views/dist/selection/bar-props.js +1 -0
  424. package/views/dist/selection/index.d.ts +1 -1
  425. package/views/dist/selection/verbs.d.ts +32 -5
  426. package/views/dist/styles.css +1499 -73
  427. package/views/dist/styles.unlayered.css +1497 -70
  428. package/views/docs/contract.md +56 -23
  429. package/views/docs/controls/alert-dialog.md +37 -0
  430. package/views/docs/controls/alert.md +30 -0
  431. package/views/docs/controls/bulk-bar.md +41 -0
  432. package/views/docs/controls/choice.md +25 -0
  433. package/views/docs/controls/collapsible.md +22 -0
  434. package/views/docs/controls/customize.md +17 -0
  435. package/views/docs/controls/filter-editor.md +28 -0
  436. package/views/docs/controls/group-editor.md +11 -0
  437. package/views/docs/controls/modal.md +55 -0
  438. package/views/docs/controls/notice.md +32 -0
  439. package/views/docs/controls/pane.md +25 -0
  440. package/views/docs/controls/popover.md +2 -0
  441. package/views/docs/controls/press.md +9 -0
  442. package/views/docs/controls/quick-filters.md +35 -0
  443. package/views/docs/controls/radio.md +1 -1
  444. package/views/docs/controls/sort-editor.md +27 -0
  445. package/views/docs/controls/switch-row.md +18 -0
  446. package/views/docs/controls/tag-field.md +7 -0
  447. package/views/docs/controls/toast.md +32 -0
  448. package/views/docs/controls/toolbar-button.md +31 -0
  449. package/views/docs/controls/toolbar.md +14 -0
  450. package/views/docs/guides/atoms.md +2 -2
  451. package/views/docs/guides/cells.md +3 -3
  452. package/views/docs/guides/display.md +3 -3
  453. package/views/docs/guides/looks.md +8 -2
  454. package/views/docs/guides/ports.md +6 -6
  455. package/views/docs/guides/selection.md +5 -1
  456. package/views/docs/guides/the-grid.md +2 -2
  457. package/views/docs/guides/the-provider.md +21 -2
  458. package/views/docs/install.md +4 -1
  459. package/views/docs/reference/cells.md +3 -3
  460. package/views/docs/reference/controls.md +403 -16
  461. package/views/docs/reference/display.md +3 -2
  462. package/views/docs/reference/editors-relation.md +1 -1
  463. package/views/docs/reference/looks.md +35 -11
  464. package/views/docs/reference/panels-react.md +11 -10
  465. package/views/docs/reference/panels.md +9 -7
  466. package/views/docs/reference/react.md +20 -13
  467. package/views/docs/reference/selection.md +4 -2
  468. package/views/docs/reference/views.md +8 -6
  469. package/views/skills/views/SKILL.md +2 -2
@@ -0,0 +1,112 @@
1
+ export declare const QUICK_FILTERS_TOKENS: readonly [{
2
+ readonly name: "--vk-border";
3
+ readonly kind: "colour";
4
+ readonly outright: "--border";
5
+ }, {
6
+ readonly name: "--vk-border-brand";
7
+ readonly kind: "colour";
8
+ readonly outright: "--border-focused";
9
+ }, {
10
+ readonly name: "--vk-border-width";
11
+ readonly kind: "size";
12
+ readonly outright: "--border-width";
13
+ }, {
14
+ readonly name: "--vk-duration-base";
15
+ readonly kind: "motion";
16
+ readonly outright: "--duration-base";
17
+ }, {
18
+ readonly name: "--vk-ease-out";
19
+ readonly kind: "motion";
20
+ readonly outright: "--ease-out";
21
+ }, {
22
+ readonly name: "--vk-fg";
23
+ readonly kind: "colour";
24
+ readonly outright: "--text";
25
+ }, {
26
+ readonly name: "--vk-fg-disabled";
27
+ readonly kind: "colour";
28
+ readonly outright: "--text-disabled";
29
+ }, {
30
+ readonly name: "--vk-fg-subtle";
31
+ readonly kind: "colour";
32
+ readonly outright: "--text-subtle";
33
+ }, {
34
+ readonly name: "--vk-fg-subtlest";
35
+ readonly kind: "colour";
36
+ readonly outright: "--text-subtlest";
37
+ }, {
38
+ readonly name: "--vk-focus-offset";
39
+ readonly kind: "size";
40
+ readonly outright: "--focus-offset";
41
+ }, {
42
+ readonly name: "--vk-focus-width";
43
+ readonly kind: "size";
44
+ readonly outright: "--focus-width";
45
+ }, {
46
+ readonly name: "--vk-font-size-base";
47
+ readonly kind: "size";
48
+ readonly outright: "--text-base";
49
+ }, {
50
+ readonly name: "--vk-font-size-sm";
51
+ readonly kind: "size";
52
+ readonly outright: "--text-sm";
53
+ }, {
54
+ readonly name: "--vk-font-size-xs";
55
+ readonly kind: "size";
56
+ readonly outright: "--text-xs";
57
+ }, {
58
+ readonly name: "--vk-font-weight-medium";
59
+ readonly kind: "size";
60
+ readonly outright: "--font-weight-medium";
61
+ }, {
62
+ readonly name: "--vk-layer-sticky";
63
+ readonly kind: "size";
64
+ readonly outright: "--layer-sticky";
65
+ }, {
66
+ readonly name: "--vk-line-height-base";
67
+ readonly kind: "size";
68
+ readonly outright: "--text-base--line-height";
69
+ }, {
70
+ readonly name: "--vk-line-height-sm";
71
+ readonly kind: "size";
72
+ readonly outright: "--text-sm--line-height";
73
+ }, {
74
+ readonly name: "--vk-overlay";
75
+ readonly kind: "colour";
76
+ readonly outright: "--surface-overlay";
77
+ }, {
78
+ readonly name: "--vk-overlay-card";
79
+ readonly kind: "colour";
80
+ readonly outright: "--surface-overlay-card";
81
+ }, {
82
+ readonly name: "--vk-overlay-card-pressed";
83
+ readonly kind: "colour";
84
+ readonly outright: "--surface-overlay-card-pressed";
85
+ }, {
86
+ readonly name: "--vk-overlay-hovered";
87
+ readonly kind: "colour";
88
+ readonly outright: "--surface-overlay-hovered";
89
+ }, {
90
+ readonly name: "--vk-overlay-pressed";
91
+ readonly kind: "colour";
92
+ readonly outright: "--surface-overlay-pressed";
93
+ }, {
94
+ readonly name: "--vk-radius-full";
95
+ readonly kind: "size";
96
+ readonly outright: "--radius-full";
97
+ }, {
98
+ readonly name: "--vk-radius-lg";
99
+ readonly kind: "size";
100
+ readonly outright: "--radius-lg";
101
+ }, {
102
+ readonly name: "--vk-shadow-menu";
103
+ readonly kind: "shadow";
104
+ readonly outright: "--shadow-menu";
105
+ }, {
106
+ readonly name: "--vk-spacing";
107
+ readonly kind: "size";
108
+ readonly outright: "--spacing";
109
+ }];
110
+ /** The reminder's own machinery (`--quick-filters-reminder-*`, `--quick-filters-room`), and the phone's safe area it stands above,
111
+ * as the Sheet reads it. */
112
+ export declare const QUICK_FILTERS_PRIVATE: readonly ["--quick-filters-", "--safe-area-"];
@@ -0,0 +1,30 @@
1
+ export const QUICK_FILTERS_TOKENS = [
2
+ { name: "--vk-border", kind: "colour", outright: "--border" },
3
+ { name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
4
+ { name: "--vk-border-width", kind: "size", outright: "--border-width" },
5
+ { name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
6
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
7
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
8
+ { name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
9
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
10
+ { name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
11
+ { name: "--vk-focus-offset", kind: "size", outright: "--focus-offset" },
12
+ { name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
13
+ { name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
14
+ { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
15
+ { name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
16
+ { name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
17
+ { name: "--vk-layer-sticky", kind: "size", outright: "--layer-sticky" },
18
+ { name: "--vk-line-height-base", kind: "size", outright: "--text-base--line-height" },
19
+ { name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
20
+ { name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
21
+ { name: "--vk-overlay-card", kind: "colour", outright: "--surface-overlay-card" },
22
+ { name: "--vk-overlay-card-pressed", kind: "colour", outright: "--surface-overlay-card-pressed" },
23
+ { name: "--vk-overlay-hovered", kind: "colour", outright: "--surface-overlay-hovered" },
24
+ { name: "--vk-overlay-pressed", kind: "colour", outright: "--surface-overlay-pressed" },
25
+ { name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
26
+ { name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
27
+ { name: "--vk-shadow-menu", kind: "shadow", outright: "--shadow-menu" },
28
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
29
+ ];
30
+ export const QUICK_FILTERS_PRIVATE = ["--quick-filters-", "--safe-area-"];
@@ -0,0 +1,25 @@
1
+ export interface QuickFiltersWords {
2
+ /** The strip's name to a screen reader ("Fields"). */
3
+ fields: string;
4
+ /** A field's search, where the field hands no words of its own ("Search Stage"). */
5
+ search: (field: string) => string;
6
+ /** What a held value says before its count ("Clear filter"). */
7
+ clear: string;
8
+ /** What a search that finds nothing says ("Nothing matches."). */
9
+ none: string;
10
+ }
11
+ export declare const QUICK_FILTERS_WORDS: QuickFiltersWords;
12
+ /** The words handed, each left out the English. */
13
+ export declare const quickFiltersWords: (given?: Partial<QuickFiltersWords>) => QuickFiltersWords;
14
+ /** The reminder's words (QuickFiltersReminderControl): its name, its press's name over the held values' names, and its ✕. */
15
+ export interface QuickFiltersReminderWords {
16
+ /** Its name to a screen reader ("Quick filters held"). */
17
+ label: string;
18
+ /** Its press's name, over the held values' names joined ("Quick filters: Won, Lost"). */
19
+ names: (names: string) => string;
20
+ /** Its ✕, letting every hold go ("Clear quick filters"). */
21
+ clear: string;
22
+ }
23
+ export declare const QUICK_FILTERS_REMINDER_WORDS: QuickFiltersReminderWords;
24
+ /** The reminder's words handed, each left out the English. */
25
+ export declare const quickFiltersReminderWords: (given?: Partial<QuickFiltersReminderWords>) => QuickFiltersReminderWords;
@@ -0,0 +1,13 @@
1
+ export const QUICK_FILTERS_WORDS = {
2
+ fields: "Fields",
3
+ search: (field) => `Search ${field}`,
4
+ clear: "Clear filter",
5
+ none: "Nothing matches.",
6
+ };
7
+ export const quickFiltersWords = (given) => given ? { ...QUICK_FILTERS_WORDS, ...Object.fromEntries(Object.entries(given).filter(([, w]) => w !== undefined)) } : QUICK_FILTERS_WORDS;
8
+ export const QUICK_FILTERS_REMINDER_WORDS = {
9
+ label: "Quick filters held",
10
+ names: (names) => `Quick filters: ${names}`,
11
+ clear: "Clear quick filters",
12
+ };
13
+ export const quickFiltersReminderWords = (given) => given ? { ...QUICK_FILTERS_REMINDER_WORDS, ...Object.fromEntries(Object.entries(given).filter(([, w]) => w !== undefined)) } : QUICK_FILTERS_REMINDER_WORDS;
@@ -0,0 +1,118 @@
1
+ /* Quick filters: a body (the Outright kit's, KIT-684 and KIT-833; ViewKit's since VK-724). Every value it draws with is a name
2
+ ViewKit's controls read (docs/controls/quick-filters.md); this file lays out its own parts, as the toolbar's canvas draws them
3
+ (round 9's .facets, .srch and .qr): its top (the strip, then the search), the open field's values, and the phone's form of the
4
+ same. The strip is the Toggle group and the search the Input, each drawn by its own file. A held value is data-held on its row,
5
+ on a neutral ground; while its field holds one, the list is data-quiet and its other values go quiet. The rules sit in the
6
+ components layer. */
7
+ @layer components {
8
+
9
+ /* The strip: three across, each pill as wide as the others; over the Toggle group's own row (two classes, so it holds whichever
10
+ stylesheet comes last). */
11
+ .o-quick-filters-top > .o-quick-filters-strip { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
12
+
13
+ /* The body: its top (the strip, then the search), then the values, 8 apart. The values scroll while the top stays put: in a box of
14
+ their own where the Pane is as tall as the list, and under the top, pinned on the Pane's ground, where it fits what it holds (its
15
+ body then has no height of its own to fill, and scrolls). */
16
+ .o-quick-filters { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--vk-fg); }
17
+ .o-quick-filters-top {
18
+ position: sticky; top: 0; z-index: 1; flex: none; display: flex; flex-direction: column; gap: calc(var(--vk-spacing) * 2);
19
+ padding-bottom: calc(var(--vk-spacing) * 2); background-color: var(--vk-overlay);
20
+ }
21
+
22
+ /* The values: rows 40 high, 12 in, the list's corners, 1 apart; under the pointer the overlay's hover. */
23
+ .o-quick-filters-values { display: flex; flex-direction: column; gap: var(--vk-border-width); flex: 1 1 auto; min-height: 0; overflow-y: auto; outline: none; }
24
+ .o-quick-filters-value {
25
+ flex: none; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2.5); height: calc(var(--vk-spacing) * 10); padding: 0 calc(var(--vk-spacing) * 3);
26
+ border-radius: var(--vk-radius-lg); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg);
27
+ cursor: pointer; user-select: none; outline: none;
28
+ }
29
+ @media (hover: hover) { .o-quick-filters-value:hover { background-color: var(--vk-overlay-hovered); } }
30
+ .o-quick-filters-value:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: calc(-1 * var(--vk-focus-width)); }
31
+ .o-quick-filters-mark { flex: none; display: inline-flex; align-items: center; }
32
+ .o-quick-filters-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
33
+ .o-quick-filters-count { flex: none; font-size: var(--vk-font-size-xs); color: var(--vk-fg-subtlest); font-variant-numeric: tabular-nums; }
34
+ .o-quick-filters-clear { flex: none; font-size: var(--vk-font-size-xs); color: var(--vk-fg-subtle); }
35
+
36
+ /* A search that finds nothing: the Picker's words where the values stand, drawn as its message is (.o-picker-message), centred. */
37
+ .o-quick-filters-none {
38
+ flex: none; margin: 0; padding: calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 2); text-align: center;
39
+ font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg-subtle);
40
+ }
41
+
42
+ /* Held: the overlay's card ground, a very subtle grey, never the brand (Mihai, 19 Nov 2026; KIT-778); its name at medium weight,
43
+ Clear filter before its count. Under the pointer a touch stronger, the card's pressed step: the overlay's own hover, pressed and
44
+ selected are one grey in dark, so this pair is the one a touch apart in both themes. */
45
+ .o-quick-filters-value[data-held] { background-color: var(--vk-overlay-card); }
46
+ .o-quick-filters-value[data-held] .o-quick-filters-name { font-weight: var(--vk-font-weight-medium); }
47
+ @media (hover: hover) { .o-quick-filters-value[data-held]:hover { background-color: var(--vk-overlay-card-pressed); } }
48
+
49
+ /* While its field holds a value, the others go quiet: their names and their counts. */
50
+ .o-quick-filters-values[data-quiet] .o-quick-filters-value:not([data-held]) .o-quick-filters-name { color: var(--vk-fg-subtlest); }
51
+ .o-quick-filters-values[data-quiet] .o-quick-filters-value:not([data-held]) .o-quick-filters-count { color: var(--vk-fg-disabled); }
52
+
53
+ /* On a phone (KIT-833): the same body in the full Sheet, a step up. The top 12 apart and 12 over the values; a value's row 44 high
54
+ in the phone's words, its count and Clear filter a size under them. No pointer to hover with: a press grounds its row while the
55
+ finger is on it, the computer's hover pair (the overlay's hover; held, the card's pressed step). The strip's pills and the search
56
+ take their phone sizes in the body (quick-filters.tsx). */
57
+ .o-quick-filters[data-form="phone"] .o-quick-filters-top { gap: calc(var(--vk-spacing) * 3); padding-bottom: calc(var(--vk-spacing) * 3); }
58
+ .o-quick-filters[data-form="phone"] .o-quick-filters-value {
59
+ height: calc(var(--vk-spacing) * 11); font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base));
60
+ }
61
+ .o-quick-filters[data-form="phone"] :is(.o-quick-filters-count, .o-quick-filters-clear) { font-size: var(--vk-font-size-sm); }
62
+ .o-quick-filters[data-form="phone"] .o-quick-filters-value:active { background-color: var(--vk-overlay-hovered); }
63
+ .o-quick-filters[data-form="phone"] .o-quick-filters-value[data-held]:active { background-color: var(--vk-overlay-card-pressed); }
64
+
65
+ /* The reminder (the Outright kit's, KIT-833; ViewKit's since VK-858; reminder.tsx): on a phone, what says a hold stands while quick filters are closed, the bulk bar's pill's
66
+ surface in its place (bulk-bar.css), at the centre of its holder's foot, its holder being the list's placed box, its parent.
67
+ Every value a token:
68
+
69
+ .o-quick-filters-reminder the pill; data-shown while something held is named, else gone (display none, after its going)
70
+ .o-quick-filters-reminder-words its own press: the first held value's mark and the names, which end in "…"
71
+ .o-quick-filters-reminder-more "+N", the names not shown
72
+ --quick-filters-reminder-bottom how far above the holder's foot it stands (the phone's own foot, or 16)
73
+ --quick-filters-reminder-height how tall it is (52, the pill's)
74
+ --quick-filters-room the room it takes at its holder's foot, handed to the holder while it is shown (none when it
75
+ isn't, or while the bulk bar shows there): a list that scrolls in the holder pads its foot by
76
+ it, and New's + stands on it, rising above the reminder */
77
+ :is(.o-quick-filters-reminder), :has(> .o-quick-filters-reminder) {
78
+ --quick-filters-reminder-bottom: max(var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)), calc(var(--vk-spacing) * 4));
79
+ --quick-filters-reminder-height: calc(var(--vk-spacing) * 13);
80
+ }
81
+ :has(> .o-quick-filters-reminder) { --quick-filters-room: 0px; }
82
+ :has(> .o-quick-filters-reminder[data-shown]) { --quick-filters-room: calc(var(--quick-filters-reminder-bottom) + var(--quick-filters-reminder-height) + var(--vk-spacing) * 2); }
83
+ /* While the bulk bar shows in the same list, it steps aside and gives its room back (after the rule above, which it outweighs by
84
+ order): two pills at a list's foot is one too many, and the bar is what the picked rows need. */
85
+ :has(> .o-bulk-bar[data-shown]) { --quick-filters-room: 0px; }
86
+ :has(> .o-bulk-bar[data-shown]) > .o-quick-filters-reminder { display: none; opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); transition: none; }
87
+
88
+ .o-quick-filters-reminder {
89
+ position: absolute; z-index: var(--vk-layer-sticky); left: 50%; bottom: var(--quick-filters-reminder-bottom); translate: -50% 0;
90
+ display: flex; align-items: center; box-sizing: border-box; width: max-content; height: var(--quick-filters-reminder-height); max-width: calc(100% - var(--vk-spacing) * 8);
91
+ padding-inline: calc(var(--vk-spacing) * 1.5); border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-full);
92
+ background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-menu); color: var(--vk-fg); white-space: nowrap; opacity: 1;
93
+ }
94
+ .o-quick-filters-reminder > .o-toolbar { min-width: 0; }
95
+ .o-quick-filters-reminder:not([data-shown]) { display: none; opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); }
96
+ /* It comes up from just under its place and goes back down, as the bulk bar does. Still where a person asks for less motion. */
97
+ @media (prefers-reduced-motion: no-preference) {
98
+ .o-quick-filters-reminder {
99
+ transition: opacity var(--vk-duration-base) var(--vk-ease-out), translate var(--vk-duration-base) var(--vk-ease-out), display var(--vk-duration-base) allow-discrete;
100
+ @starting-style { opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); }
101
+ }
102
+ }
103
+
104
+ /* Its own press: round, 44 high, no ground at rest; under the pointer the overlay's hover, pressed its pressed step. */
105
+ .o-quick-filters-reminder-words {
106
+ display: inline-flex; flex: 0 1 auto; align-items: center; gap: calc(var(--vk-spacing) * 2); box-sizing: border-box; min-width: 0;
107
+ height: calc(var(--vk-spacing) * 11); margin: 0; padding-inline: calc(var(--vk-spacing) * 3); border: 0; border-radius: var(--vk-radius-full);
108
+ background-color: transparent; color: var(--vk-fg); font: inherit; font-size: var(--vk-font-size-base); line-height: var(--vk-line-height-base);
109
+ white-space: nowrap; cursor: pointer;
110
+ }
111
+ /* In the Toolbar, its names give way before its ✕ does, over the Toolbar's flex: none on what a line holds (VK-860). */
112
+ .o-toolbar-line > .o-quick-filters-reminder-words { flex: 0 1 auto; }
113
+ .o-quick-filters-reminder-words > span:not(.o-quick-filters-mark, .o-quick-filters-reminder-more) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
114
+ @media (hover: hover) { .o-quick-filters-reminder-words:hover { background-color: var(--vk-overlay-hovered); } }
115
+ .o-quick-filters-reminder-words:active { background-color: var(--vk-overlay-pressed); }
116
+ .o-quick-filters-reminder-words:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
117
+ .o-quick-filters-reminder-more { flex: none; color: var(--vk-fg-subtle); font-variant-numeric: tabular-nums; }
118
+ }
@@ -10,8 +10,11 @@ export declare const SheetClose: ({ children }: {
10
10
  children: React.ReactElement;
11
11
  }) => import("react/jsx-runtime").JSX.Element;
12
12
  export interface SheetHeadProps {
13
- /** What it is. */
14
- title: string;
13
+ /** What it is: words, or words with a mark beside them. */
14
+ title: React.ReactNode;
15
+ /** Its name to screen readers where the title says it otherwise (a mark beside the words, other words): the title is what
16
+ * names the sheet, so this names the title. */
17
+ titleLabel?: string;
15
18
  /** Where its title stands, which each sheet chooses: centred, or at the left. */
16
19
  titleAt?: "center" | "left";
17
20
  /** A second line under the title, quieter. */
@@ -46,7 +49,7 @@ export declare function SheetButton({ className, kind, children, ...props }: {
46
49
  /** Its head, one of its kinds: the one header (HeaderBar), under its handle. Glass has on its left the X, or Back in its place, and on its right one action, or two, as the phone header's Two buttons says.
47
50
  * Flat has Back on its left, if there is one, and its action and the X on its right. Or Decide, a button either side of its
48
51
  * title. A sheet with no head is its handle alone. */
49
- export declare function SheetHead({ title, titleAt, description, close, onBack, left, right, children, words }: SheetHeadProps): import("react/jsx-runtime").JSX.Element;
52
+ export declare function SheetHead({ title, titleLabel, titleAt, description, close, onBack, left, right, children, words }: SheetHeadProps): import("react/jsx-runtime").JSX.Element;
50
53
  /** Its foot: stays at the foot of the screen at every stop, and leaves with the sheet. */
51
54
  export declare const SheetFoot: ({ children }: {
52
55
  children: React.ReactNode;
@@ -96,8 +99,10 @@ export interface SheetProps {
96
99
  standing?: boolean;
97
100
  /** Where focus goes once it shuts. Nothing found, or left out, focus goes back to what opened it. */
98
101
  finalFocus?: () => HTMLElement | null;
102
+ /** A class on the sheet itself, after its own. */
103
+ className?: string;
99
104
  /** Its head and its body. */
100
105
  children: React.ReactNode;
101
106
  }
102
107
  /** What rises from the bottom of the phone, in a form, at stops. What it holds is poured in. */
103
- export declare function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form, stops, openAt, stop, onStopChange, mark: marked, container, standing: stands, finalFocus, children }: SheetProps): import("react/jsx-runtime").JSX.Element;
108
+ export declare function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form, stops, openAt, stop, onStopChange, mark: marked, container, standing: stands, finalFocus, className, children }: SheetProps): import("react/jsx-runtime").JSX.Element;
@@ -20,10 +20,10 @@ export const SheetClose = ({ children }) => _jsx(Base.Close, { render: children
20
20
  export function SheetButton({ className, kind, children, ...props }) {
21
21
  return _jsxs(_Fragment, { children: [_jsx(GlassButton, { ...props, kind: kind, className: cx("o-sheet-glass", className), children: children }), _jsx(Button, { ...props, kind: kind ?? "quiet", shape: children == null ? "icon" : undefined, className: cx("o-sheet-plain", className), children: children })] });
22
22
  }
23
- export function SheetHead({ title, titleAt, description, close = true, onBack, left, right, children, words }) {
23
+ export function SheetHead({ title, titleLabel, titleAt, description, close = true, onBack, left, right, children, words }) {
24
24
  const closeWord = words?.close ?? "Close", backWord = words?.back ?? "Back";
25
25
  const sides = left != null || right != null;
26
- return (_jsx("div", { className: "o-sheet-head", children: _jsx(HeaderBar, { className: "o-sheet-row", titleAt: titleAt, "data-sides": sides ? "" : undefined, left: sides ? left : onBack ? _jsx(SheetButton, { "aria-label": backWord, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack }) : close && _jsx(Base.Close, { render: _jsx(GlassButton, { "aria-label": closeWord, className: "o-sheet-glass", icon: glyph(X) }) }), title: _jsx(Base.Title, { className: "o-sheet-title", children: title }), description: description, descriptionRender: _jsx(Base.Description, {}), right: sides ? right : _jsxs(_Fragment, { children: [children, close && _jsx(Base.Close, { render: _jsx(Button, { kind: "quiet", shape: "icon", "aria-label": closeWord, className: "o-sheet-plain", icon: glyph(X) }) })] }) }) }));
26
+ return (_jsx("div", { className: "o-sheet-head", children: _jsx(HeaderBar, { className: "o-sheet-row", titleAt: titleAt, "data-sides": sides ? "" : undefined, left: sides ? left : onBack ? _jsx(SheetButton, { "aria-label": backWord, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack }) : close && _jsx(Base.Close, { render: _jsx(GlassButton, { "aria-label": closeWord, className: "o-sheet-glass", icon: glyph(X) }) }), title: _jsx(Base.Title, { className: "o-sheet-title", "aria-label": titleLabel, children: title }), description: description, descriptionRender: _jsx(Base.Description, {}), right: sides ? right : _jsxs(_Fragment, { children: [children, close && _jsx(Base.Close, { render: _jsx(Button, { kind: "quiet", shape: "icon", "aria-label": closeWord, className: "o-sheet-plain", icon: glyph(X) }) })] }) }) }));
27
27
  }
28
28
  export const SheetFoot = ({ children }) => _jsx("div", { className: "o-sheet-foot", children: children });
29
29
  export const SheetBody = React.forwardRef(function SheetBody({ onScroll, children }, ref) {
@@ -246,7 +246,7 @@ function useKeyboardFoot(popup, on) {
246
246
  return () => { vv.removeEventListener("resize", read); vv.removeEventListener("scroll", read); popup.style.removeProperty("--sheet-keyboard"); };
247
247
  }, [typing, popup]);
248
248
  }
249
- export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form = "full", stops, openAt, stop, onStopChange, mark: marked = "[data-sheet-mark]", container, standing: stands, finalFocus, children }) {
249
+ export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form = "full", stops, openAt, stop, onStopChange, mark: marked = "[data-sheet-mark]", container, standing: stands, finalFocus, className, children }) {
250
250
  const closeBelow = React.useContext(CloseAll), stacked = closeBelow !== null;
251
251
  const standsBelow = React.useContext(Standing), standing = stands || standsBelow;
252
252
  const [armed, setArmed] = React.useState(false);
@@ -372,5 +372,5 @@ export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form =
372
372
  }, children: _jsxs(Base.Portal, { container: container, children: [_jsx(Base.Backdrop, { ref: backdrop, forceRender: stacked, className: "o-sheet-backdrop", "data-stacked": stacked ? "" : undefined }), _jsxs(Base.Viewport, { ref: setViewport, className: "o-sheet-viewport", "data-sheet-form": form, onClick: standing ? (e) => { if (e.target === e.currentTarget) {
373
373
  release("closed");
374
374
  close("outside-press");
375
- } } : undefined, children: [_jsx(Base.Popup, { ref: bindPopup, initialFocus: popupRef, finalFocus: finalFocus ? () => finalFocus() ?? true : undefined, className: "o-sheet o-smooth", "data-sheet-form": form, "aria-label": label, "data-kit": "sheet", children: _jsxs("div", { className: "o-sheet-cut", children: [_jsx("div", { className: "o-sheet-handle", "aria-hidden": "true" }), _jsx(Standing.Provider, { value: standing, children: _jsx(Body.Provider, { value: body, children: _jsx(CloseAll.Provider, { value: closeAll, children: children }) }) })] }) }), coming && _jsx("div", { className: "o-sheet-shield", "aria-hidden": "true", "data-sheet-shield": "", onPointerDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onClick: (e) => e.stopPropagation() })] })] }) }));
375
+ } } : undefined, children: [_jsx(Base.Popup, { ref: bindPopup, initialFocus: popupRef, finalFocus: finalFocus ? () => finalFocus() ?? true : undefined, className: cx("o-sheet o-smooth", className), "data-sheet-form": form, "aria-label": label, "data-kit": "sheet", children: _jsxs("div", { className: "o-sheet-cut", children: [_jsx("div", { className: "o-sheet-handle", "aria-hidden": "true" }), _jsx(Standing.Provider, { value: standing, children: _jsx(Body.Provider, { value: body, children: _jsx(CloseAll.Provider, { value: closeAll, children: children }) }) })] }) }), coming && _jsx("div", { className: "o-sheet-shield", "aria-hidden": "true", "data-sheet-shield": "", onPointerDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onClick: (e) => e.stopPropagation() })] })] }) }));
376
376
  }
@@ -1,3 +1,6 @@
1
1
  import type { ViewsSheetProps } from "../../provider/components.js";
2
+ import { type SheetProps } from "./bottom-sheet.js";
3
+ /** The Sheet's form and stops for each height ViewKit asks for. */
4
+ export declare const SNAP_FORM: Readonly<Record<NonNullable<ViewsSheetProps["snap"]>, Pick<SheetProps, "form" | "stops" | "openAt">>>;
2
5
  /** ViewKit's sheet, drawn as the kit's Sheet. */
3
- export declare function MapSheet({ open, onOpenChange, label, actions, children }: ViewsSheetProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function MapSheet({ open, onOpenChange, title, label, description, actions, snap, className, children }: ViewsSheetProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,26 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
2
3
  import { useViews } from "../../provider/context.js";
3
- import { Sheet, SheetBody, SheetButton, SheetHead } from "./bottom-sheet.js";
4
- export function MapSheet({ open, onOpenChange, label, actions, children }) {
4
+ import { Sheet, SheetBody, SheetButton, SheetFoot, SheetHead } from "./bottom-sheet.js";
5
+ import { STOPS } from "./forms.js";
6
+ import { SheetPartsFrom } from "./sheet-parts.js";
7
+ export const SNAP_FORM = {
8
+ full: { form: "full" },
9
+ auto: { form: "edge" },
10
+ half: { form: "blend" },
11
+ peek: { form: "full", stops: [STOPS.small, STOPS.full], openAt: STOPS.small },
12
+ };
13
+ export function MapSheet({ open, onOpenChange, title, label, description, actions, snap, className, children }) {
5
14
  const { icons, messages } = useViews();
15
+ const [parts, setParts] = React.useState(null);
6
16
  const words = { close: messages({ key: "views.panels.close" }), back: messages({ key: "views.panels.back" }) };
7
- const name = label ?? "";
17
+ const name = label ?? "", shown = title ?? name;
18
+ const titleLabel = title != null && title !== name && label ? label : undefined;
8
19
  const left = actions?.back ?? actions?.close;
9
20
  const Back = icons.back, Close = icons.close, Check = icons.check;
10
- return (_jsxs(Sheet, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), label: name, children: [actions && left
11
- ? _jsx(SheetHead, { title: name, left: _jsx(SheetButton, { "aria-label": left.label, className: actions.back ? "o-sheet-back" : undefined, icon: actions.back ? _jsx(Back, {}) : _jsx(Close, {}), onClick: left.onPress }), right: actions.done ? _jsx(SheetButton, { kind: "primary", "aria-label": actions.done.label, icon: _jsx(Check, {}), onClick: actions.done.onPress }) : _jsx("span", {}) })
12
- : _jsx(SheetHead, { title: name, words: words }), _jsx(SheetBody, { children: children })] }));
21
+ return (_jsxs(Sheet, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), label: name, ...SNAP_FORM[snap ?? "full"], className: className, children: [parts
22
+ ? _jsx(SheetHead, { title: parts.title, ...parts.head, words: words })
23
+ : actions && left
24
+ ? _jsx(SheetHead, { title: shown, titleLabel: titleLabel, description: description, left: _jsx(SheetButton, { "aria-label": left.label, className: actions.back ? "o-sheet-back" : undefined, icon: actions.back ? _jsx(Back, {}) : _jsx(Close, {}), onClick: left.onPress }), right: actions.done ? _jsx(SheetButton, { kind: "primary", "aria-label": actions.done.label, icon: _jsx(Check, {}), onClick: actions.done.onPress }) : _jsx("span", {}) })
25
+ : _jsx(SheetHead, { title: shown, titleLabel: titleLabel, description: description, words: words }), _jsx(SheetBody, { children: _jsx(SheetPartsFrom.Provider, { value: setParts, children: children }) }), parts?.foot && _jsx(SheetFoot, { children: parts.foot })] }));
13
26
  }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import type { SheetHeadProps } from "./bottom-sheet.js";
3
+ /** What a body hands its Sheet: its title, its Back and ✕, and its foot. */
4
+ export type SheetParts = {
5
+ title: string;
6
+ head: Pick<SheetHeadProps, "onBack" | "close">;
7
+ foot?: React.ReactNode;
8
+ };
9
+ /** The Sheet's setter for its head's parts, held by a Sheet round what stands in it; null outside one. */
10
+ export declare const SheetPartsFrom: React.Context<((parts: SheetParts | null) => void) | null>;
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ export const SheetPartsFrom = React.createContext(null);
@@ -0,0 +1,9 @@
1
+ import { type ViewsMessageResolver } from "../../contract.js";
2
+ import type { ViewsSortBodyProps } from "../../provider/components.js";
3
+ import { type SortEditorProps } from "./sort-editor.js";
4
+ import type { SortEditorWords } from "./words.js";
5
+ /** The sort editor's words in the app's messages. */
6
+ export declare function sortEditorWordsOf(say: ViewsMessageResolver): SortEditorWords;
7
+ /** ViewKit's sort body's props as the sort editor's. */
8
+ export declare function sortEditorPropsOf(p: ViewsSortBodyProps, words: SortEditorWords, say?: ViewsMessageResolver): SortEditorProps;
9
+ export declare function MapSortBody(props: ViewsSortBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { resolveViewsMessage } from "../../contract.js";
5
+ import { ViewsContext } from "../../provider/context.js";
6
+ import { glyph, TICK, X } from "../internal/editor-parts.js";
7
+ import { useToldStep } from "../internal/told-step.js";
8
+ import { pickerWordsOf } from "../picker/map-picker.js";
9
+ import { HeaderBar } from "../phone-header/header-bar.js";
10
+ import { SheetButton } from "../sheet/bottom-sheet.js";
11
+ import { useSortEditor } from "./sort-editor.js";
12
+ const KIT = { asc: "ascending", desc: "descending" };
13
+ const VIEWKIT = { ascending: "asc", descending: "desc" };
14
+ const BACK = ["M5 12l14 0", "M5 12l6 6", "M5 12l6 -6"];
15
+ function BodyHead({ title, left, right }) {
16
+ return (_jsx("div", { className: "o-sheet-head", "data-slot": "vk-sort-head", children: _jsx(HeaderBar, { className: "o-sheet-row", "data-sides": "", left: left, title: _jsx("h2", { className: "o-sheet-title", children: title }), right: right }) }));
17
+ }
18
+ const placeOf = (value) => (value.includes("::") ? value.slice(0, value.lastIndexOf("::")) : value);
19
+ export function sortEditorWordsOf(say) {
20
+ return {
21
+ field: say({ key: "views.panels.sort-field" }),
22
+ direction: say({ key: "views.panels.sort-direction" }),
23
+ ascending: say({ key: "views.panels.sort-ascending" }),
24
+ descending: say({ key: "views.panels.sort-descending" }),
25
+ sorted: say({ key: "views.panels.sort-sorted" }),
26
+ max: (max) => say({ key: "views.panels.sort-max", values: { max } }),
27
+ add: say({ key: "views.panels.sort-add" }),
28
+ clearAllSorts: say({ key: "views.panels.sort-clear-all-sorts" }),
29
+ clearAll: say({ key: "views.panels.sort-clear-all" }),
30
+ delete: say({ key: "views.panels.sort-delete" }),
31
+ move: (label) => say({ key: "views.panels.sort-move", values: { label } }),
32
+ remove: (label) => say({ key: "views.panels.sort-remove", values: { label } }),
33
+ sortBy: (label) => say({ key: "views.panels.sort-by-named", values: { label } }),
34
+ actionsFor: (label) => say({ key: "views.panels.sort-actions", values: { label } }),
35
+ none: say({ key: "views.panels.sort-empty" }),
36
+ noneLine: say({ key: "views.panels.sort-empty-line" }),
37
+ search: say({ key: "views.panels.sort-search" }),
38
+ back: say({ key: "views.panels.back" }),
39
+ close: say({ key: "views.panels.close" }),
40
+ save: say({ key: "views.panels.sort-done" }),
41
+ putBack: say({ key: "views.panels.put-back" }),
42
+ fieldNamed: (label) => say({ key: "views.panels.sort-field-named", values: { label } }),
43
+ picker: pickerWordsOf(say),
44
+ };
45
+ }
46
+ function asideOf(rule, say) {
47
+ const why = rule.reason === "missing-field" && rule.value !== null
48
+ ? say({ key: "views.panels.sort-set-aside-back" })
49
+ : say({ key: "views.panels.sort-set-aside-why", values: { reason: rule.reason } });
50
+ return { key: rule.fieldKey, label: rule.label, direction: KIT[rule.dir], why, back: rule.value };
51
+ }
52
+ export function sortEditorPropsOf(p, words, say = resolveViewsMessage) {
53
+ const held = p.setAside;
54
+ return {
55
+ label: p.label,
56
+ fields: p.options.map((o) => ({ value: o.value, label: o.label, ...(o.glyph ? { as: { mark: o.glyph } } : {}) })),
57
+ rules: p.rules.map((r) => ({ field: r.value, direction: KIT[r.dir] })),
58
+ aside: held.map((r) => asideOf(r, say)),
59
+ max: p.max,
60
+ form: p.form,
61
+ addSort: p.addSort,
62
+ fieldOf: placeOf,
63
+ onDone: p.onDone,
64
+ words,
65
+ onRulesChange: (rules, aside) => p.onRulesChange(rules.map((r) => ({ value: r.field, dir: VIEWKIT[r.direction] })), ...(aside ? [aside.map((a) => held.find((h) => h.fieldKey === a.key)).filter((h) => !!h)] : [])),
66
+ };
67
+ }
68
+ export function MapSortBody(props) {
69
+ const views = React.useContext(ViewsContext);
70
+ const messages = views?.messages ?? resolveViewsMessage;
71
+ const words = React.useMemo(() => sortEditorWordsOf(messages), [messages]);
72
+ const parts = useSortEditor(sortEditorPropsOf(props, words, messages));
73
+ useToldStep(parts, props.onStepChange);
74
+ const { actions } = props;
75
+ if (!actions)
76
+ return _jsx(_Fragment, { children: parts.body });
77
+ const done = actions.done && _jsx(SheetButton, { kind: "primary", "aria-label": actions.done.label, icon: glyph(TICK), onClick: actions.done.onPress });
78
+ return (_jsxs(_Fragment, { children: [parts.title !== undefined
79
+ ? _jsx(BodyHead, { title: parts.title, left: _jsx(SheetButton, { "aria-label": words.back, className: "o-sheet-back", icon: glyph(BACK), onClick: parts.head.onBack }), right: done || _jsx("span", {}) })
80
+ : _jsx(BodyHead, { title: props.label, left: _jsx(SheetButton, { "aria-label": actions.close.label, icon: glyph(X), onClick: actions.close.onPress }), right: done || _jsx("span", {}) }), parts.body] }));
81
+ }
@@ -0,0 +1,48 @@
1
+ import { type PickerItem } from "../picker/rows.js";
2
+ export type SortDirection = "ascending" | "descending";
3
+ /** One rule: the field it sorts by (one level in, its value: company.region) and its direction. */
4
+ export interface SortRule {
5
+ field: string;
6
+ direction: SortDirection;
7
+ }
8
+ /** The field a sort key sorts: a place's part key sorts its place. Each key its own field unless handed. */
9
+ export type FieldOf = (field: string) => string;
10
+ /** A sort set aside: its stored field key, its words, its direction, why it was set aside in words, and the sort key it sorts by
11
+ * once put back, null while it doesn't fit. */
12
+ export interface SortAside {
13
+ key: string;
14
+ label: string;
15
+ direction: SortDirection;
16
+ why: string;
17
+ back: string | null;
18
+ }
19
+ /** How many rules a view sorts by, at most. */
20
+ export declare const SORT_MAX = 3;
21
+ /** The rules with one more at their end, sorting by `field`, ascending. */
22
+ export declare const addSort: (rules: SortRule[], field: string) => SortRule[];
23
+ /** Whether another rule can be added: fewer than `max`. */
24
+ export declare const canAddSort: (rules: SortRule[], max?: number) => boolean;
25
+ /** The fields the rules sort by already, each as `fieldOf` names it. */
26
+ export declare const sortedFields: (rules: SortRule[], fieldOf?: FieldOf) => Set<string>;
27
+ /** Whether another rule than the one on `own` already sorts `value`'s field. */
28
+ export declare const takenBy: (rules: SortRule[], value: string, own?: string, fieldOf?: FieldOf) => boolean;
29
+ /** The sort as the filter bar names it: its first rule's field, by its path, and how many rules follow; none, nothing. */
30
+ export declare function sortLabel(rules: SortRule[], fields: PickerItem[]): {
31
+ first: string;
32
+ more: number;
33
+ } | null;
34
+ /** How many rules fit: `max` less the sorts set aside, each holding one of the places. */
35
+ export declare const openPlaces: (max: number, aside: readonly SortAside[]) => number;
36
+ /** The sorts set aside without the one on `key`. */
37
+ export declare const dropAside: (aside: SortAside[], key: string) => SortAside[];
38
+ /** A sort set aside pointed at `field`: a rule on it, in the set-aside sort's direction, at the rules' end, and the sort out of the
39
+ * set-aside ones; null where another rule sorts that field already. */
40
+ export declare function repoint(rules: SortRule[], aside: SortAside[], key: string, field: string, fieldOf?: FieldOf): {
41
+ rules: SortRule[];
42
+ aside: SortAside[];
43
+ } | null;
44
+ /** A sort set aside put back on its own field; null while it doesn't fit (`back` null) or another rule sorts it. */
45
+ export declare function putBack(rules: SortRule[], aside: SortAside[], key: string, fieldOf?: FieldOf): {
46
+ rules: SortRule[];
47
+ aside: SortAside[];
48
+ } | null;
@@ -0,0 +1,24 @@
1
+ import { itemLabel } from "../picker/rows.js";
2
+ const itself = (f) => f;
3
+ export const SORT_MAX = 3;
4
+ export const addSort = (rules, field) => [...rules, { field, direction: "ascending" }];
5
+ export const canAddSort = (rules, max = SORT_MAX) => rules.length < max;
6
+ export const sortedFields = (rules, fieldOf = itself) => new Set(rules.map((r) => fieldOf(r.field)));
7
+ export const takenBy = (rules, value, own, fieldOf = itself) => rules.some((r) => r.field !== own && fieldOf(r.field) === fieldOf(value));
8
+ export function sortLabel(rules, fields) {
9
+ if (!rules.length)
10
+ return null;
11
+ return { first: itemLabel(fields, rules[0].field), more: rules.length - 1 };
12
+ }
13
+ export const openPlaces = (max, aside) => Math.max(max - aside.length, 0);
14
+ export const dropAside = (aside, key) => aside.filter((a) => a.key !== key);
15
+ export function repoint(rules, aside, key, field, fieldOf = itself) {
16
+ const held = aside.find((a) => a.key === key);
17
+ if (!held || takenBy(rules, field, undefined, fieldOf))
18
+ return null;
19
+ return { rules: [...rules, { field, direction: held.direction }], aside: dropAside(aside, key) };
20
+ }
21
+ export function putBack(rules, aside, key, fieldOf = itself) {
22
+ const back = aside.find((a) => a.key === key)?.back;
23
+ return back == null ? null : repoint(rules, aside, key, back, fieldOf);
24
+ }