@cosmicdrift/kumiko-renderer 0.388.0 → 0.390.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 (379) hide show
  1. package/dist/app/base-path-context.d.ts +9 -0
  2. package/dist/app/base-path-context.js +13 -0
  3. package/dist/app/base-path.d.ts +3 -0
  4. package/dist/app/base-path.js +27 -0
  5. package/dist/app/config-edit-body.d.ts +1 -1
  6. package/dist/app/config-edit-body.js +15 -6
  7. package/dist/app/config-edit-without-secret-fields.d.ts +2 -0
  8. package/dist/app/config-edit-without-secret-fields.js +28 -0
  9. package/dist/app/entity-list-facet-specs.d.ts +3 -0
  10. package/dist/app/entity-list-facet-specs.js +65 -0
  11. package/dist/app/entity-list-screen.js +74 -206
  12. package/dist/app/kumiko-screen.js +6 -14
  13. package/dist/app/list-bulk-actions.d.ts +18 -0
  14. package/dist/app/list-bulk-actions.js +54 -0
  15. package/dist/app/locked-screen-header.d.ts +9 -0
  16. package/dist/app/locked-screen-header.js +33 -0
  17. package/dist/app/projection-detail-body.js +59 -394
  18. package/dist/app/projection-detail-header-model.d.ts +11 -0
  19. package/dist/app/projection-detail-header-model.js +33 -0
  20. package/dist/app/projection-detail-header-region.d.ts +28 -0
  21. package/dist/app/projection-detail-header-region.js +81 -0
  22. package/dist/app/projection-detail-header.d.ts +29 -0
  23. package/dist/app/projection-detail-header.js +84 -0
  24. package/dist/app/projection-detail-navigation.d.ts +13 -0
  25. package/dist/app/projection-detail-navigation.js +91 -0
  26. package/dist/app/projection-detail-states.d.ts +22 -0
  27. package/dist/app/projection-detail-states.js +26 -0
  28. package/dist/app/projection-drawer-host.d.ts +12 -0
  29. package/dist/app/projection-drawer-host.js +10 -0
  30. package/dist/app/projection-list-body.d.ts +1 -1
  31. package/dist/app/projection-list-body.js +82 -197
  32. package/dist/app/projection-list-render-props.d.ts +56 -0
  33. package/dist/app/projection-list-render-props.js +47 -0
  34. package/dist/app/projection-list-render.d.ts +26 -0
  35. package/dist/app/projection-list-render.js +20 -0
  36. package/dist/app/projection-list-row-click.d.ts +12 -0
  37. package/dist/app/projection-list-row-click.js +14 -0
  38. package/dist/app/row-actions.d.ts +3 -0
  39. package/dist/app/row-actions.js +10 -5
  40. package/dist/app/screen-shared.js +9 -2
  41. package/dist/app/use-entity-range-facets.d.ts +24 -0
  42. package/dist/app/use-entity-range-facets.js +64 -0
  43. package/dist/app/use-projection-date-range.d.ts +12 -0
  44. package/dist/app/use-projection-date-range.js +21 -0
  45. package/dist/app/use-projection-detail-actions.d.ts +35 -0
  46. package/dist/app/use-projection-detail-actions.js +156 -0
  47. package/dist/app/use-projection-detail-data.d.ts +19 -0
  48. package/dist/app/use-projection-detail-data.js +47 -0
  49. package/dist/app/use-projection-detail-layout.d.ts +17 -0
  50. package/dist/app/use-projection-detail-layout.js +23 -0
  51. package/dist/app/use-projection-list-actions.d.ts +31 -0
  52. package/dist/app/use-projection-list-actions.js +73 -0
  53. package/dist/app/use-projection-list-data.d.ts +20 -0
  54. package/dist/app/use-projection-list-data.js +26 -0
  55. package/dist/app/use-projection-list-definitions.d.ts +11 -0
  56. package/dist/app/use-projection-list-definitions.js +20 -0
  57. package/dist/app/use-projection-list-query.d.ts +28 -0
  58. package/dist/app/use-projection-list-query.js +83 -0
  59. package/dist/app/use-screen-list-rows.d.ts +37 -0
  60. package/dist/app/use-screen-list-rows.js +104 -0
  61. package/dist/app/use-screen-list-table.d.ts +24 -0
  62. package/dist/app/use-screen-list-table.js +46 -0
  63. package/dist/components/list-group-page-bridges.d.ts +3 -0
  64. package/dist/components/list-group-page-bridges.js +31 -0
  65. package/dist/components/list-state-store.d.ts +16 -0
  66. package/dist/components/list-state-store.js +31 -0
  67. package/dist/components/related-list-section.js +37 -89
  68. package/dist/components/render-edit-banners.d.ts +12 -0
  69. package/dist/components/render-edit-banners.js +90 -0
  70. package/dist/components/render-edit-draft-save-helpers.d.ts +19 -0
  71. package/dist/components/render-edit-draft-save-helpers.js +42 -0
  72. package/dist/components/render-edit-field-grid.d.ts +4 -0
  73. package/dist/components/render-edit-field-grid.js +40 -0
  74. package/dist/components/render-edit-fields-section.d.ts +4 -0
  75. package/dist/components/render-edit-fields-section.js +76 -0
  76. package/dist/components/render-edit-form-actions.d.ts +4 -0
  77. package/dist/components/render-edit-form-actions.js +66 -0
  78. package/dist/components/render-edit-header-actions.d.ts +11 -0
  79. package/dist/components/render-edit-header-actions.js +120 -0
  80. package/dist/components/render-edit-layout-flags.d.ts +29 -0
  81. package/dist/components/render-edit-layout-flags.js +106 -0
  82. package/dist/components/render-edit-layout.d.ts +4 -0
  83. package/dist/components/render-edit-layout.js +79 -0
  84. package/dist/components/render-edit-render-model.d.ts +63 -0
  85. package/dist/components/render-edit-render-model.js +14 -0
  86. package/dist/components/render-edit-section-kinds.d.ts +4 -0
  87. package/dist/components/render-edit-section-kinds.js +115 -0
  88. package/dist/components/render-edit-submit-result.d.ts +8 -0
  89. package/dist/components/render-edit-submit-result.js +77 -0
  90. package/dist/components/render-edit-submit.d.ts +7 -0
  91. package/dist/components/render-edit-submit.js +113 -0
  92. package/dist/components/render-edit-titles.d.ts +17 -0
  93. package/dist/components/render-edit-titles.js +99 -0
  94. package/dist/components/render-edit-wizard-navigation.d.ts +11 -0
  95. package/dist/components/render-edit-wizard-navigation.js +115 -0
  96. package/dist/components/render-edit.d.ts +2 -2
  97. package/dist/components/render-edit.js +63 -1128
  98. package/dist/components/render-field-choice-inputs.d.ts +7 -0
  99. package/dist/components/render-field-choice-inputs.js +52 -0
  100. package/dist/components/render-field-control.d.ts +12 -0
  101. package/dist/components/render-field-control.js +93 -0
  102. package/dist/components/render-field-display-text.d.ts +4 -0
  103. package/dist/components/render-field-display-text.js +48 -0
  104. package/dist/components/render-field-fill-action.d.ts +13 -0
  105. package/dist/components/render-field-fill-action.js +63 -0
  106. package/dist/components/render-field-input-shared.d.ts +39 -0
  107. package/dist/components/render-field-input-shared.js +20 -0
  108. package/dist/components/render-field-input.d.ts +3 -0
  109. package/dist/components/render-field-input.js +34 -0
  110. package/dist/components/render-field-meta.d.ts +6 -0
  111. package/dist/components/render-field-meta.js +51 -0
  112. package/dist/components/render-field-read-only.d.ts +11 -0
  113. package/dist/components/render-field-read-only.js +75 -0
  114. package/dist/components/render-field-reference.d.ts +15 -0
  115. package/dist/components/render-field-reference.js +103 -0
  116. package/dist/components/render-field-scalar-inputs.d.ts +10 -0
  117. package/dist/components/render-field-scalar-inputs.js +35 -0
  118. package/dist/components/render-field-text-inputs.d.ts +3 -0
  119. package/dist/components/render-field-text-inputs.js +34 -0
  120. package/dist/components/render-field-values.d.ts +18 -0
  121. package/dist/components/render-field-values.js +111 -0
  122. package/dist/components/render-field-write-only.d.ts +9 -0
  123. package/dist/components/render-field-write-only.js +29 -0
  124. package/dist/components/render-field.d.ts +2 -2
  125. package/dist/components/render-field.js +39 -669
  126. package/dist/components/render-list-header-slot.d.ts +5 -0
  127. package/dist/components/render-list-header-slot.js +30 -0
  128. package/dist/components/render-list-reference-bridge.d.ts +3 -0
  129. package/dist/components/render-list-reference-bridge.js +25 -0
  130. package/dist/components/render-list-reference-columns.d.ts +25 -0
  131. package/dist/components/render-list-reference-columns.js +137 -0
  132. package/dist/components/render-list-table-props.d.ts +52 -0
  133. package/dist/components/render-list-table-props.js +53 -0
  134. package/dist/components/render-list-toolbar-action.d.ts +27 -0
  135. package/dist/components/render-list-toolbar-action.js +40 -0
  136. package/dist/components/render-list-toolbar-model.d.ts +42 -0
  137. package/dist/components/render-list-toolbar-model.js +82 -0
  138. package/dist/components/render-list-toolbar.d.ts +38 -0
  139. package/dist/components/render-list-toolbar.js +40 -0
  140. package/dist/components/render-list-types.d.ts +113 -0
  141. package/dist/components/render-list-types.js +1 -0
  142. package/dist/components/render-list.d.ts +5 -130
  143. package/dist/components/render-list.js +95 -319
  144. package/dist/components/use-reference-input-state.d.ts +20 -0
  145. package/dist/components/use-reference-input-state.js +85 -0
  146. package/dist/components/use-render-edit-controlled-sync.d.ts +3 -0
  147. package/dist/components/use-render-edit-controlled-sync.js +26 -0
  148. package/dist/components/use-render-edit-draft-save.d.ts +29 -0
  149. package/dist/components/use-render-edit-draft-save.js +141 -0
  150. package/dist/components/use-render-edit-form.d.ts +10 -0
  151. package/dist/components/use-render-edit-form.js +101 -0
  152. package/dist/components/use-render-edit-sections.d.ts +15 -0
  153. package/dist/components/use-render-edit-sections.js +100 -0
  154. package/dist/components/use-render-edit-state.d.ts +65 -0
  155. package/dist/components/use-render-edit-state.js +158 -0
  156. package/dist/components/use-render-edit-steps.d.ts +13 -0
  157. package/dist/components/use-render-edit-steps.js +52 -0
  158. package/dist/components/use-render-list-columns.d.ts +18 -0
  159. package/dist/components/use-render-list-columns.js +41 -0
  160. package/dist/components/use-render-list-search.d.ts +4 -0
  161. package/dist/components/use-render-list-search.js +50 -0
  162. package/dist/current-user.d.ts +2 -0
  163. package/dist/data-table-aggregate-types.d.ts +47 -0
  164. package/dist/data-table-aggregate-types.js +1 -0
  165. package/dist/data-table-bulk-types.d.ts +27 -0
  166. package/dist/data-table-bulk-types.js +1 -0
  167. package/dist/data-table-facet-types.d.ts +36 -0
  168. package/dist/data-table-facet-types.js +1 -0
  169. package/dist/data-table-view-types.d.ts +73 -0
  170. package/dist/data-table-view-types.js +1 -0
  171. package/dist/headless/view-model/edit.js +3 -1
  172. package/dist/headless/view-model/types.d.ts +4 -2
  173. package/dist/hooks/list-column-layout.d.ts +19 -0
  174. package/dist/hooks/list-column-layout.js +36 -0
  175. package/dist/hooks/list-group-pages.d.ts +26 -0
  176. package/dist/hooks/list-group-pages.js +37 -0
  177. package/dist/hooks/list-reset.d.ts +8 -0
  178. package/dist/hooks/list-reset.js +15 -0
  179. package/dist/hooks/list-server-groups.d.ts +39 -0
  180. package/dist/hooks/list-server-groups.js +84 -0
  181. package/dist/hooks/list-state-schema.d.ts +28 -0
  182. package/dist/hooks/list-state-schema.js +76 -0
  183. package/dist/hooks/use-bulk-run.d.ts +41 -0
  184. package/dist/hooks/use-bulk-run.js +65 -0
  185. package/dist/hooks/use-group-load-state.d.ts +11 -0
  186. package/dist/hooks/use-group-load-state.js +31 -0
  187. package/dist/hooks/use-list-aggregates.d.ts +38 -0
  188. package/dist/hooks/use-list-aggregates.js +107 -0
  189. package/dist/hooks/use-list-table.d.ts +38 -0
  190. package/dist/hooks/use-list-table.js +91 -0
  191. package/dist/hooks/use-list-view-state.d.ts +43 -0
  192. package/dist/hooks/use-list-view-state.js +161 -0
  193. package/dist/hooks/use-related-list-rows.d.ts +27 -0
  194. package/dist/hooks/use-related-list-rows.js +81 -0
  195. package/dist/hooks/use-related-list-state.d.ts +15 -0
  196. package/dist/hooks/use-related-list-state.js +31 -0
  197. package/dist/hooks/use-remembered-list-params.d.ts +13 -0
  198. package/dist/hooks/use-remembered-list-params.js +53 -0
  199. package/dist/hooks/use-remembered-local-list-state.d.ts +26 -0
  200. package/dist/hooks/use-remembered-local-list-state.js +63 -0
  201. package/dist/i18n-defaults.js +53 -0
  202. package/dist/index.d.ts +3 -1
  203. package/dist/index.js +2 -0
  204. package/dist/primitives.d.ts +11 -47
  205. package/dist/web/app/create-app.d.ts +5 -0
  206. package/dist/web/app/create-app.js +7 -4
  207. package/dist/web/app/dashboard-body.d.ts +1 -1
  208. package/dist/web/app/dashboard-body.js +42 -246
  209. package/dist/web/app/dashboard-header.d.ts +34 -0
  210. package/dist/web/app/dashboard-header.js +58 -0
  211. package/dist/web/app/dashboard-screen-controls.d.ts +11 -0
  212. package/dist/web/app/dashboard-screen-controls.js +42 -0
  213. package/dist/web/app/dashboard-screen-tiles.d.ts +8 -0
  214. package/dist/web/app/dashboard-screen-tiles.js +42 -0
  215. package/dist/web/app/dashboard-visibility.d.ts +42 -0
  216. package/dist/web/app/dashboard-visibility.js +102 -0
  217. package/dist/web/app/history-leave-guard.d.ts +6 -0
  218. package/dist/web/app/history-leave-guard.js +115 -0
  219. package/dist/web/app/list-state-store-boot.d.ts +6 -0
  220. package/dist/web/app/list-state-store-boot.js +15 -0
  221. package/dist/web/app/nav.js +7 -54
  222. package/dist/web/app/session-list-state-store.d.ts +15 -0
  223. package/dist/web/app/session-list-state-store.js +117 -0
  224. package/dist/web/app/use-dashboard-screen-state.d.ts +35 -0
  225. package/dist/web/app/use-dashboard-screen-state.js +69 -0
  226. package/dist/web/index.d.ts +1 -0
  227. package/dist/web/index.js +1 -0
  228. package/dist/web/lib/export-xlsx-request.d.ts +11 -0
  229. package/dist/web/lib/export-xlsx-request.js +46 -0
  230. package/dist/web/primitives/data-table/actions-column.d.ts +16 -0
  231. package/dist/web/primitives/data-table/actions-column.js +35 -0
  232. package/dist/web/primitives/data-table/bulk-selection-bar.d.ts +20 -0
  233. package/dist/web/primitives/data-table/bulk-selection-bar.js +37 -0
  234. package/dist/web/primitives/data-table/card-body.d.ts +6 -0
  235. package/dist/web/primitives/data-table/card-body.js +32 -0
  236. package/dist/web/primitives/data-table/card-row.d.ts +5 -0
  237. package/dist/web/primitives/data-table/card-row.js +31 -0
  238. package/dist/web/primitives/data-table/card-sort-select.d.ts +14 -0
  239. package/dist/web/primitives/data-table/card-sort-select.js +40 -0
  240. package/dist/web/primitives/data-table/card-view.d.ts +3 -0
  241. package/dist/web/primitives/data-table/card-view.js +13 -0
  242. package/dist/web/primitives/data-table/column-layout-mode.d.ts +5 -0
  243. package/dist/web/primitives/data-table/column-layout-mode.js +10 -0
  244. package/dist/web/primitives/data-table/column-picker-section.d.ts +7 -0
  245. package/dist/web/primitives/data-table/column-picker-section.js +35 -0
  246. package/dist/web/primitives/data-table/column-resize-handle.d.ts +14 -0
  247. package/dist/web/primitives/data-table/column-resize-handle.js +48 -0
  248. package/dist/web/primitives/data-table/data-cell-props.d.ts +7 -0
  249. package/dist/web/primitives/data-table/data-cell-props.js +8 -0
  250. package/dist/web/primitives/data-table/density.d.ts +14 -0
  251. package/dist/web/primitives/data-table/density.js +20 -0
  252. package/dist/web/primitives/data-table/export-button.d.ts +5 -0
  253. package/dist/web/primitives/data-table/export-button.js +37 -0
  254. package/dist/web/primitives/data-table/facet-cluster.d.ts +8 -0
  255. package/dist/web/primitives/data-table/facet-cluster.js +37 -0
  256. package/dist/web/primitives/data-table/group-band.d.ts +28 -0
  257. package/dist/web/primitives/data-table/group-band.js +53 -0
  258. package/dist/web/primitives/data-table/measure-value.d.ts +10 -0
  259. package/dist/web/primitives/data-table/measure-value.js +28 -0
  260. package/dist/web/primitives/data-table/pin-section.d.ts +8 -0
  261. package/dist/web/primitives/data-table/pin-section.js +20 -0
  262. package/dist/web/primitives/data-table/reset-all-button.d.ts +4 -0
  263. package/dist/web/primitives/data-table/reset-all-button.js +8 -0
  264. package/dist/web/primitives/data-table/row-render-parts.d.ts +8 -0
  265. package/dist/web/primitives/data-table/row-render-parts.js +35 -0
  266. package/dist/web/primitives/data-table/server-group-header.d.ts +11 -0
  267. package/dist/web/primitives/data-table/server-group-header.js +51 -0
  268. package/dist/web/primitives/data-table/sortable-header.d.ts +17 -0
  269. package/dist/web/primitives/data-table/sortable-header.js +41 -0
  270. package/dist/web/primitives/data-table/table-body.d.ts +3 -0
  271. package/dist/web/primitives/data-table/table-body.js +32 -0
  272. package/dist/web/primitives/data-table/table-chrome.d.ts +13 -0
  273. package/dist/web/primitives/data-table/table-chrome.js +30 -0
  274. package/dist/web/primitives/data-table/table-content.d.ts +3 -0
  275. package/dist/web/primitives/data-table/table-content.js +41 -0
  276. package/dist/web/primitives/data-table/table-data-cell.d.ts +4 -0
  277. package/dist/web/primitives/data-table/table-data-cell.js +25 -0
  278. package/dist/web/primitives/data-table/table-footer.d.ts +7 -0
  279. package/dist/web/primitives/data-table/table-footer.js +20 -0
  280. package/dist/web/primitives/data-table/table-header-row.d.ts +3 -0
  281. package/dist/web/primitives/data-table/table-header-row.js +21 -0
  282. package/dist/web/primitives/data-table/table-view.d.ts +3 -0
  283. package/dist/web/primitives/data-table/table-view.js +25 -0
  284. package/dist/web/primitives/data-table/toolbar-end-cluster.d.ts +10 -0
  285. package/dist/web/primitives/data-table/toolbar-end-cluster.js +13 -0
  286. package/dist/web/primitives/data-table/toolbar.d.ts +6 -0
  287. package/dist/web/primitives/data-table/toolbar.js +53 -0
  288. package/dist/web/primitives/data-table/totals-footer.d.ts +24 -0
  289. package/dist/web/primitives/data-table/totals-footer.js +48 -0
  290. package/dist/web/primitives/data-table/use-bulk-selection.d.ts +21 -0
  291. package/dist/web/primitives/data-table/use-bulk-selection.js +66 -0
  292. package/dist/web/primitives/data-table/use-column-pins.d.ts +32 -0
  293. package/dist/web/primitives/data-table/use-column-pins.js +117 -0
  294. package/dist/web/primitives/data-table/use-column-sizing.d.ts +22 -0
  295. package/dist/web/primitives/data-table/use-column-sizing.js +44 -0
  296. package/dist/web/primitives/data-table/use-data-table-state.d.ts +44 -0
  297. package/dist/web/primitives/data-table/use-data-table-state.js +123 -0
  298. package/dist/web/primitives/data-table/use-measured-column-widths.d.ts +15 -0
  299. package/dist/web/primitives/data-table/use-measured-column-widths.js +83 -0
  300. package/dist/web/primitives/data-table/use-row-keyboard-navigation.d.ts +22 -0
  301. package/dist/web/primitives/data-table/use-row-keyboard-navigation.js +65 -0
  302. package/dist/web/primitives/data-table/use-row-selection.d.ts +14 -0
  303. package/dist/web/primitives/data-table/use-row-selection.js +48 -0
  304. package/dist/web/primitives/data-table/use-view-columns.d.ts +6 -0
  305. package/dist/web/primitives/data-table/use-view-columns.js +17 -0
  306. package/dist/web/primitives/data-table/view-menu.d.ts +8 -0
  307. package/dist/web/primitives/data-table/view-menu.js +45 -0
  308. package/dist/web/primitives/data-table-cell.d.ts +0 -22
  309. package/dist/web/primitives/data-table-cell.js +1 -58
  310. package/dist/web/primitives/data-table.d.ts +3 -4
  311. package/dist/web/primitives/data-table.js +30 -272
  312. package/dist/web/primitives/file-value-list.d.ts +1 -1
  313. package/dist/web/primitives/file-value-list.js +5 -5
  314. package/dist/web/primitives/form-footer-parts.d.ts +25 -0
  315. package/dist/web/primitives/form-footer-parts.js +55 -0
  316. package/dist/web/primitives/form.js +33 -43
  317. package/dist/web/primitives/input-choice-kinds.d.ts +4 -0
  318. package/dist/web/primitives/input-choice-kinds.js +67 -0
  319. package/dist/web/primitives/input-file-kinds.d.ts +3 -0
  320. package/dist/web/primitives/input-file-kinds.js +6 -0
  321. package/dist/web/primitives/input-number-kinds.d.ts +4 -0
  322. package/dist/web/primitives/input-number-kinds.js +16 -0
  323. package/dist/web/primitives/input-optional-props.d.ts +20 -0
  324. package/dist/web/primitives/input-optional-props.js +24 -0
  325. package/dist/web/primitives/input-select-presentation.d.ts +13 -0
  326. package/dist/web/primitives/input-select-presentation.js +19 -0
  327. package/dist/web/primitives/input-shared.d.ts +22 -0
  328. package/dist/web/primitives/input-shared.js +10 -0
  329. package/dist/web/primitives/input-temporal-kinds.d.ts +5 -0
  330. package/dist/web/primitives/input-temporal-kinds.js +10 -0
  331. package/dist/web/primitives/input-text-kinds.d.ts +7 -0
  332. package/dist/web/primitives/input-text-kinds.js +33 -0
  333. package/dist/web/primitives/input.js +35 -161
  334. package/dist/web/primitives/number-range-facet.d.ts +7 -0
  335. package/dist/web/primitives/number-range-facet.js +33 -0
  336. package/dist/web/widgets/bounded-load-cache.d.ts +5 -1
  337. package/dist/web/widgets/bounded-load-cache.js +48 -26
  338. package/dist/web/widgets/chart-data.d.ts +35 -0
  339. package/dist/web/widgets/chart-data.js +37 -0
  340. package/dist/web/widgets/chart-markers.d.ts +26 -0
  341. package/dist/web/widgets/chart-markers.js +64 -0
  342. package/dist/web/widgets/chart-parts.d.ts +20 -0
  343. package/dist/web/widgets/chart-parts.js +15 -0
  344. package/dist/web/widgets/charts.d.ts +5 -78
  345. package/dist/web/widgets/charts.js +7 -485
  346. package/dist/web/widgets/drawer-panel-class.d.ts +3 -0
  347. package/dist/web/widgets/drawer-panel-class.js +40 -0
  348. package/dist/web/widgets/drawer-resize-controls.d.ts +11 -0
  349. package/dist/web/widgets/drawer-resize-controls.js +12 -0
  350. package/dist/web/widgets/drawer-sizing.d.ts +19 -0
  351. package/dist/web/widgets/drawer-sizing.js +60 -0
  352. package/dist/web/widgets/drawer.js +17 -116
  353. package/dist/web/widgets/pdf-preview.js +9 -4
  354. package/dist/web/widgets/stacked-area-brush.d.ts +13 -0
  355. package/dist/web/widgets/stacked-area-brush.js +91 -0
  356. package/dist/web/widgets/stacked-area-chart.d.ts +6 -0
  357. package/dist/web/widgets/stacked-area-chart.js +45 -0
  358. package/dist/web/widgets/stacked-area-chrome.d.ts +7 -0
  359. package/dist/web/widgets/stacked-area-chrome.js +77 -0
  360. package/dist/web/widgets/stacked-area-geometry.d.ts +54 -0
  361. package/dist/web/widgets/stacked-area-geometry.js +83 -0
  362. package/dist/web/widgets/stacked-area-model.d.ts +11 -0
  363. package/dist/web/widgets/stacked-area-model.js +1 -0
  364. package/dist/web/widgets/stacked-area-plot.d.ts +3 -0
  365. package/dist/web/widgets/stacked-area-plot.js +51 -0
  366. package/dist/web/widgets/stacked-area-props.d.ts +83 -0
  367. package/dist/web/widgets/stacked-area-props.js +16 -0
  368. package/dist/web/widgets/stacked-area-svg.d.ts +3 -0
  369. package/dist/web/widgets/stacked-area-svg.js +38 -0
  370. package/dist/web/widgets/stacked-area-tooltip.d.ts +3 -0
  371. package/dist/web/widgets/stacked-area-tooltip.js +86 -0
  372. package/dist/web/widgets/use-drawer-resize.d.ts +22 -0
  373. package/dist/web/widgets/use-drawer-resize.js +52 -0
  374. package/dist/web/widgets/use-stacked-area-tooltip.d.ts +9 -0
  375. package/dist/web/widgets/use-stacked-area-tooltip.js +34 -0
  376. package/dist/web/widgets/use-stacked-area-window.d.ts +20 -0
  377. package/dist/web/widgets/use-stacked-area-window.js +76 -0
  378. package/package.json +9 -9
  379. package/src/changes.json +163 -0
@@ -0,0 +1,18 @@
1
+ import type { EntityDefinition, EntityListScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
2
+ import type { ListColumnViewModel, ListViewModel, Translate } from "../headless/index.ts";
3
+ import { type PublishedReferenceLookup } from "./render-list-reference-columns.ts";
4
+ type RenderListColumnsInput = {
5
+ readonly screen: EntityListScreenDefinition;
6
+ readonly entity: Pick<EntityDefinition, "fields" | "derivedFields">;
7
+ readonly rows: readonly Readonly<Record<string, unknown>>[];
8
+ readonly featureName: string;
9
+ readonly translate: Translate;
10
+ };
11
+ export declare function useRenderListColumns(input: RenderListColumnsInput): {
12
+ referenceColumns: import("./render-list-reference-columns.ts").ReferenceColumnSpec[];
13
+ handleLookupMap: (field: string, lookup: PublishedReferenceLookup) => void;
14
+ enrichedVm: Omit<ListViewModel, "columns"> & {
15
+ columns: readonly ListColumnViewModel[];
16
+ };
17
+ };
18
+ export {};
@@ -0,0 +1,41 @@
1
+ import { useCallback, useMemo, useState } from "react";
2
+ import { useReferenceLinkResolver } from "../app/reference-link.js";
3
+ import { computeListViewModel } from "../headless/index.js";
4
+ import { enrichReferenceColumns, selectReferenceColumns, } from "./render-list-reference-columns.js";
5
+ export function useRenderListColumns(input) {
6
+ const { screen, entity, rows, featureName, translate } = input;
7
+ const vm = useMemo(() => computeListViewModel({ screen, entity, rows, translate, featureName }), [screen, entity, rows, translate, featureName]);
8
+ // Reference-field eager loading through bridge components.
9
+ // The Hooks rule requires useReferenceLookup for each reference column,
10
+ // but the number of columns varies with the schema. Each column therefore
11
+ // mounts a ReferenceLookupBridge that publishes its map to local state
12
+ // through onMap. Each bridge makes a constant number of hook calls (one),
13
+ // and React manages its lifecycle when the schema changes via key.
14
+ const referenceColumns = useMemo(() => selectReferenceColumns(vm.columns, featureName), [vm.columns, featureName]);
15
+ const [referenceLookups, setReferenceLookups] = useState({});
16
+ const handleLookupMap = useCallback((field, lookup) => {
17
+ setReferenceLookups((prev) => {
18
+ // Skip the update when the lookup is identical. Otherwise the bridge
19
+ // would re-render and send the same map back until React entered
20
+ // an infinite loop.
21
+ const current = prev[field];
22
+ if (current?.map === lookup.map && current.complete === lookup.complete)
23
+ return prev;
24
+ return { ...prev, [field]: lookup };
25
+ });
26
+ }, []);
27
+ const resolveReferenceLink = useReferenceLinkResolver();
28
+ const enrichedColumns = useMemo(() => enrichReferenceColumns({
29
+ columns: vm.columns,
30
+ referenceColumns,
31
+ referenceLookups,
32
+ resolveReferenceLink,
33
+ featureName,
34
+ translate,
35
+ }), [vm.columns, referenceColumns, referenceLookups, resolveReferenceLink, featureName, translate]);
36
+ const enrichedVm = useMemo(() => ({
37
+ ...vm,
38
+ columns: enrichedColumns,
39
+ }), [vm, enrichedColumns]);
40
+ return { referenceColumns, handleLookupMap, enrichedVm };
41
+ }
@@ -0,0 +1,4 @@
1
+ export declare function useRenderListSearch(searchValue: string | undefined, onSearchChange: ((next: string) => void) | undefined): {
2
+ readonly localQ: string;
3
+ readonly setLocalQ: (next: string) => void;
4
+ };
@@ -0,0 +1,50 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ const SEARCH_DEBOUNCE_MS = 300;
3
+ // Local search buffer + debounce. External changes (browser back,
4
+ // cross-component reset) are mirrored back; typing only fires
5
+ // onSearchChange after 300ms without further keystrokes.
6
+ export function useRenderListSearch(searchValue, onSearchChange) {
7
+ const [localQ, setLocalQ] = useState(searchValue ?? "");
8
+ // Sync during render, not in a useEffect: the passive effect also fires on
9
+ // mount and can flush after a keystroke landing in the same commit,
10
+ // resetting localQ and swallowing the input.
11
+ const [syncedSearchValue, setSyncedSearchValue] = useState(searchValue);
12
+ // The parent may echo our own debounced emits back late (router/URL round
13
+ // trip), possibly after a newer emit already went out; adopting such a stale
14
+ // echo would erase keys typed in between. All unechoed emits are kept, and a
15
+ // matching echo drops itself and every older one. The render phase only reads
16
+ // the list (a discarded or repeated render must find the echo again); the
17
+ // matched entries are dropped in an effect.
18
+ const pendingEmitsRef = useRef([]);
19
+ if (searchValue !== syncedSearchValue) {
20
+ setSyncedSearchValue(searchValue);
21
+ if (!pendingEmitsRef.current.includes(searchValue ?? "")) {
22
+ setLocalQ(searchValue ?? "");
23
+ pendingEmitsRef.current = [];
24
+ }
25
+ }
26
+ useEffect(() => {
27
+ const echoIndex = pendingEmitsRef.current.indexOf(syncedSearchValue ?? "");
28
+ if (echoIndex >= 0)
29
+ pendingEmitsRef.current.splice(0, echoIndex + 1);
30
+ }, [syncedSearchValue]);
31
+ useEffect(() => {
32
+ // skip: no search handler wired, so typing never emits
33
+ if (onSearchChange === undefined)
34
+ return;
35
+ // skip: buffer already matches the parent value
36
+ if (localQ === (searchValue ?? ""))
37
+ return;
38
+ // A late echo of an older emit changes searchValue but must not re-send
39
+ // the value that is already in flight.
40
+ // skip: that value is already in flight
41
+ if (pendingEmitsRef.current.at(-1) === localQ)
42
+ return;
43
+ const timer = setTimeout(() => {
44
+ pendingEmitsRef.current.push(localQ);
45
+ onSearchChange(localQ);
46
+ }, SEARCH_DEBOUNCE_MS);
47
+ return () => clearTimeout(timer);
48
+ }, [localQ, searchValue, onSearchChange]);
49
+ return { localQ, setLocalQ };
50
+ }
@@ -7,6 +7,8 @@ export type CurrentUser = {
7
7
  readonly displayName: string;
8
8
  /** Effective IANA zone of the user (override, else tenant). */
9
9
  readonly timeZone?: string;
10
+ /** Active tenant; scopes per-user browser state such as remembered list views. */
11
+ readonly tenantId?: string;
10
12
  };
11
13
  export declare function CurrentUserProvider({ user, children, }: {
12
14
  readonly user: CurrentUser | undefined;
@@ -0,0 +1,47 @@
1
+ import type { AggregateKey } from "@cosmicdrift/kumiko-types/aggregate-types";
2
+ import type { ListAggregateMeasureKind, ListAggregateValue } from "@cosmicdrift/kumiko-types/list-aggregate-types";
3
+ /** One server-computed measure; a money measure holds one minor-unit value per currency. */
4
+ export type DataTableMeasure = {
5
+ readonly field: string;
6
+ readonly kind: ListAggregateMeasureKind;
7
+ readonly value: ListAggregateValue;
8
+ };
9
+ export type DataTableServerGroup = {
10
+ /** `relatedListGroupKey` of the group value; stable across reloads. */
11
+ readonly key: string;
12
+ /** Raw group value, rendered through the group column when `label` is absent. */
13
+ readonly value: AggregateKey;
14
+ readonly label?: string;
15
+ /** Rows of the whole group on the server, not the loaded ones. */
16
+ readonly count: number;
17
+ readonly measures: readonly DataTableMeasure[];
18
+ readonly collapsed: boolean;
19
+ /** How many of the table's `rows` belong to this group; rows arrive in group order. */
20
+ readonly rowCount: number;
21
+ readonly hasMore: boolean;
22
+ readonly loading: boolean;
23
+ };
24
+ /** Server-side grouping: groups are the load unit, each loads its own rows. */
25
+ export type DataTableServerGroups = {
26
+ readonly field: string;
27
+ readonly groups: readonly DataTableServerGroup[];
28
+ readonly totalCount: number;
29
+ readonly onToggle: (key: string) => void;
30
+ readonly onLoadMore: (key: string) => void;
31
+ readonly onHeaderVisible: (key: string) => void;
32
+ };
33
+ export type DataTableTotals = {
34
+ readonly measures: readonly DataTableMeasure[];
35
+ };
36
+ /** `truncated`: more groups than the server answers. `searchTruncated`: the search hit its cap. */
37
+ export type DataTableListNotice = "truncated" | "searchTruncated";
38
+ export type DataTableRangeBound = "min" | "max";
39
+ /** "From/to" inputs on a number field. Values are the typed strings, "" = open bound. */
40
+ export type DataTableRangeFacet = {
41
+ readonly field: string;
42
+ readonly label: string;
43
+ readonly min: string;
44
+ readonly max: string;
45
+ /** Shown after the inputs, e.g. the money field's currency. */
46
+ readonly unit?: string;
47
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { IconKey } from "@cosmicdrift/kumiko-types/nav-icon";
2
+ import type { ListRowViewModel } from "./headless/index.ts";
3
+ export type BulkRowOutcome = {
4
+ readonly kind: "succeeded";
5
+ } | {
6
+ readonly kind: "failed";
7
+ readonly message: string;
8
+ };
9
+ export type DataTableBulkAction = {
10
+ readonly id: string;
11
+ /** Translated label of the underlying row action. */
12
+ readonly label: string;
13
+ readonly style?: "primary" | "secondary" | "danger";
14
+ readonly icon?: IconKey;
15
+ /** Present: one confirm dialog for the whole selection, with this text for `count` rows. */
16
+ readonly confirmText?: (count: number) => string;
17
+ readonly confirmLabel?: string;
18
+ /** False: the row action's `visible` hides it for this row; the run skips the row. */
19
+ readonly appliesTo: (row: ListRowViewModel) => boolean;
20
+ /** Exactly one server write for one row. Never throws for a rejected write. */
21
+ readonly writeRow: (row: ListRowViewModel) => Promise<BulkRowOutcome>;
22
+ };
23
+ export type DataTableBulk = {
24
+ readonly actions: readonly DataTableBulkAction[];
25
+ /** Reloads the list once after a run. */
26
+ readonly reload: () => Promise<void>;
27
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ export type DataTableFacet = {
2
+ /** Entity-Feldname (= URL-State-Key + payload.filters[].field). */
3
+ readonly field: string;
4
+ /** Translated Button-Label ("Status", "Active"). */
5
+ readonly label: string;
6
+ /** Selectable values with display labels. `value` is the raw filter value
7
+ * (a select option or `"true"`/`"false"`), transported as a string. */
8
+ readonly options: readonly {
9
+ readonly value: string;
10
+ readonly label: string;
11
+ }[];
12
+ /** Present: render the facet as a row of single-choice toggle chips instead
13
+ * of a dropdown. A chip is pressed while the selection equals its values. */
14
+ readonly chips?: readonly DataTableFacetChip[];
15
+ /** Chips only: show each chip's `count` next to its label. */
16
+ readonly showCounts?: boolean;
17
+ /** Chips only: hide chips whose `count` is 0 (unless pressed). */
18
+ readonly hideEmpty?: boolean;
19
+ };
20
+ export type DataTableFacetChip = {
21
+ readonly id: string;
22
+ /** Translated chip label. */
23
+ readonly label: string;
24
+ /** Selection a click sets; `[]` clears the facet. */
25
+ readonly values: readonly string[];
26
+ /** Matching row count, undefined while unknown. */
27
+ readonly count?: number;
28
+ };
29
+ export type DataTableDateRangeFacet = {
30
+ /** The facet's namespace (its date field) — a key, not a filter value. */
31
+ readonly field: string;
32
+ /** Translated label ("When"). */
33
+ readonly label: string;
34
+ readonly from: string;
35
+ readonly to: string;
36
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,73 @@
1
+ import type { ListColumnPin, ListTableDensity } from "@cosmicdrift/kumiko-types/screen";
2
+ import type { DataTableListNotice, DataTableRangeBound, DataTableRangeFacet, DataTableServerGroups, DataTableTotals } from "./data-table-aggregate-types.ts";
3
+ export type DataTableDensity = ListTableDensity;
4
+ export type DataTableColumnPin = ListColumnPin;
5
+ export type DataTableColumnPins = Readonly<Record<string, DataTableColumnPin>>;
6
+ export type DataTableColumnWidths = Readonly<Record<string, number>>;
7
+ /** One column in the view menu. The label comes from the DataTable's own
8
+ * column of the same `field`. */
9
+ export type DataTableViewColumn = {
10
+ readonly field: string;
11
+ readonly visible: boolean;
12
+ };
13
+ export type DataTableViewOptions = {
14
+ /** Present: the view menu has a column section (visibility + order). The
15
+ * order lists every column; hidden ones stay in the list. */
16
+ readonly columns?: readonly DataTableViewColumn[];
17
+ readonly onColumnsChange?: (next: readonly DataTableViewColumn[]) => void;
18
+ readonly density: DataTableDensity;
19
+ /** Present: the view menu has a density section. */
20
+ readonly onDensityChange?: (next: DataTableDensity) => void;
21
+ /** Present: pinning is on and the view menu has a pin section. Unpinned columns have no entry. */
22
+ readonly pins?: DataTableColumnPins;
23
+ readonly onPinsChange?: (next: DataTableColumnPins) => void;
24
+ /** Present: resizing is on; the table switches to table-layout fixed. Every column has an entry (px). */
25
+ readonly widths?: DataTableColumnWidths;
26
+ /** Present together with `widths`; every column has an entry (px). */
27
+ readonly minWidths?: DataTableColumnWidths;
28
+ readonly onWidthChange?: (field: string, width: number) => void;
29
+ readonly keyboardNavigation?: boolean;
30
+ /** Present: the view menu has a "group by" section. */
31
+ readonly groupBy?: DataTableGroupByChoice;
32
+ /** False once columns, order or density differ from the screen default. */
33
+ readonly viewIsDefault: boolean;
34
+ readonly onViewReset: () => void;
35
+ };
36
+ export type DataTableGroupByChoice = {
37
+ /** Active group field, "" = not grouped. */
38
+ readonly value: string;
39
+ readonly fields: readonly string[];
40
+ readonly onChange: (next: string) => void;
41
+ };
42
+ export type DataTableResetAll = {
43
+ /** True while something deviates from the screen default. */
44
+ readonly active: boolean;
45
+ readonly onReset: () => void;
46
+ };
47
+ /** What the export button sends to POST /api/export/xlsx (xlsx is the only format). */
48
+ export type DataTableExport = {
49
+ /** Screen QN `<feature>:screen:<id>`. */
50
+ readonly screen: string;
51
+ readonly screenShortId: string;
52
+ /** The list payload without paging keys; the server reads the whole filtered list. */
53
+ readonly payload: Readonly<Record<string, unknown>>;
54
+ /** Visible column ids in display order. */
55
+ readonly columns: readonly string[];
56
+ };
57
+ /** The DataTable props a screen's `table` block feeds. */
58
+ export type DataTableTableBlock = {
59
+ /** View menu (column picker, density); absent = no menu. */
60
+ readonly view?: DataTableViewOptions;
61
+ /** Replaces the facet reset with one that also covers sort, search and page size. */
62
+ readonly resetAll?: DataTableResetAll;
63
+ /** Present: the toolbar has an export button (web only). */
64
+ readonly exportList?: DataTableExport;
65
+ /** Present: the rows are grouped on the server; replaces pager and infinite scroll. */
66
+ readonly serverGroups?: DataTableServerGroups;
67
+ /** Present: a footer row with the server-computed totals of the filtered list. */
68
+ readonly totals?: DataTableTotals;
69
+ /** Present: the toolbar says the answer is incomplete and asks to narrow the list. */
70
+ readonly notice?: DataTableListNotice;
71
+ readonly rangeFacets?: readonly DataTableRangeFacet[];
72
+ readonly onRangeChange?: (field: string, bound: DataTableRangeBound, value: string) => void;
73
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -56,6 +56,7 @@ function wasEmptiedByWriteExclusion(declaredFieldSpecs, remainingFields) {
56
56
  export function computeRelatedListSectionViewModel(sectionSpec, translate) {
57
57
  return {
58
58
  kind: "relatedList",
59
+ ...(sectionSpec.id !== undefined && { id: sectionSpec.id }),
59
60
  title: translate(sectionSpec.title),
60
61
  query: sectionSpec.query,
61
62
  ...(sectionSpec.parentParam !== undefined && { parentParam: sectionSpec.parentParam }),
@@ -67,13 +68,14 @@ export function computeRelatedListSectionViewModel(sectionSpec, translate) {
67
68
  }),
68
69
  ...(sectionSpec.itemNoun !== undefined && { itemNoun: sectionSpec.itemNoun }),
69
70
  ...(sectionSpec.pageSize !== undefined && { pageSize: sectionSpec.pageSize }),
71
+ ...(sectionSpec.table !== undefined && { table: sectionSpec.table }),
70
72
  ...(sectionSpec.defaultSort !== undefined && { defaultSort: sectionSpec.defaultSort }),
71
73
  ...(sectionSpec.searchable !== undefined && { searchable: sectionSpec.searchable }),
72
74
  ...(sectionSpec.facets !== undefined && { facets: sectionSpec.facets }),
73
75
  ...(sectionSpec.rowClick !== undefined && { rowClick: sectionSpec.rowClick }),
74
76
  ...(sectionSpec.rowActions !== undefined && { rowActions: sectionSpec.rowActions }),
75
77
  ...(sectionSpec.rowActionMode !== undefined && { rowActionMode: sectionSpec.rowActionMode }),
76
- ...(sectionSpec.groupBy !== undefined && { groupBy: sectionSpec.groupBy }),
78
+ ...(sectionSpec.bulkActions !== undefined && { bulkActions: sectionSpec.bulkActions }),
77
79
  ...(sectionSpec.rowTone !== undefined && { rowTone: sectionSpec.rowTone }),
78
80
  ...(sectionSpec.toolbarActions !== undefined && { toolbarActions: sectionSpec.toolbarActions }),
79
81
  ...(sectionSpec.actions !== undefined && { actions: sectionSpec.actions }),
@@ -1,4 +1,4 @@
1
- import type { EditFieldSpec, EditSectionSpec, FieldAffix, FieldFillAction, FieldIconKey, FieldRenderer, IconKey, ListColumnSpec, ListFacetSpec, ListSortSpec, OptionsQueryPayload, PlatformComponent, RelatedListGroupBy, RelatedListRowTone, RelatedListToolbarAction, RowAction, RowActionMode, ScreenSlots, SelectOptionTone } from "@cosmicdrift/kumiko-framework/ui-types";
1
+ import type { EditFieldSpec, EditSectionSpec, FieldAffix, FieldFillAction, FieldIconKey, FieldRenderer, IconKey, ListBulkAction, ListColumnSpec, ListFacetSpec, ListSortSpec, ListTableOptions, OptionsQueryPayload, PlatformComponent, RelatedListRowTone, RelatedListToolbarAction, RowAction, RowActionMode, ScreenSlots, SelectOptionTone } from "@cosmicdrift/kumiko-framework/ui-types";
2
2
  export type RuntimeRenderer = (value: unknown, row?: Readonly<Record<string, unknown>>) => string;
3
3
  /** Where a cell's text links to. `href` comes from NavApi.hrefFor (new-tab and
4
4
  * copy-link work); `onPress` is the in-app navigation for a plain click. */
@@ -333,6 +333,7 @@ export type EditExtensionSectionViewModel = {
333
333
  };
334
334
  export type EditRelatedListSectionViewModel = {
335
335
  readonly kind: "relatedList";
336
+ readonly id?: string;
336
337
  readonly title: string;
337
338
  readonly query: string;
338
339
  readonly parentParam?: string;
@@ -345,6 +346,7 @@ export type EditRelatedListSectionViewModel = {
345
346
  /** Untranslated plural-forms key, resolved with the row count by the list footer. */
346
347
  readonly itemNoun?: string;
347
348
  readonly pageSize?: number;
349
+ readonly table?: ListTableOptions;
348
350
  readonly defaultSort?: ListSortSpec;
349
351
  readonly searchable?: boolean;
350
352
  readonly facets?: readonly ListFacetSpec[];
@@ -354,7 +356,7 @@ export type EditRelatedListSectionViewModel = {
354
356
  };
355
357
  readonly rowActions?: readonly RowAction[];
356
358
  readonly rowActionMode?: RowActionMode;
357
- readonly groupBy?: RelatedListGroupBy;
359
+ readonly bulkActions?: readonly ListBulkAction[];
358
360
  readonly rowTone?: RelatedListRowTone;
359
361
  readonly toolbarActions?: readonly RelatedListToolbarAction[];
360
362
  /** From `EditRelatedListSection.actions` — rendered in the
@@ -0,0 +1,19 @@
1
+ import type { DataTableColumnPin, DataTableColumnPins, DataTableColumnWidths } from "../data-table-view-types.ts";
2
+ export declare const DEFAULT_COLUMN_WIDTH_PX = 160;
3
+ export declare const DEFAULT_MIN_COLUMN_WIDTH_PX = 64;
4
+ /** Upper bound so a tampered stored width cannot blow the table up. */
5
+ export declare const MAX_COLUMN_WIDTH_PX = 2000;
6
+ type LayoutSchemaColumn = {
7
+ readonly field: string;
8
+ readonly pinned?: DataTableColumnPin;
9
+ readonly width?: number;
10
+ readonly minWidth?: number;
11
+ };
12
+ export declare function defaultPins(schema: readonly LayoutSchemaColumn[]): DataTableColumnPins;
13
+ export declare function minWidthsOf(schema: readonly LayoutSchemaColumn[]): DataTableColumnWidths;
14
+ export declare function clampWidth(width: number, min: number): number;
15
+ export declare function defaultWidths(schema: readonly LayoutSchemaColumn[], minWidths: DataTableColumnWidths): DataTableColumnWidths;
16
+ /** A saved width wins per field; a column the saved view has never seen keeps its default. */
17
+ export declare function mergeSavedWidths(defaults: DataTableColumnWidths, saved: Readonly<Record<string, number>>, minWidths: DataTableColumnWidths): DataTableColumnWidths;
18
+ export declare function sameRecord<T>(a: Readonly<Record<string, T>>, b: Readonly<Record<string, T>>): boolean;
19
+ export {};
@@ -0,0 +1,36 @@
1
+ export const DEFAULT_COLUMN_WIDTH_PX = 160;
2
+ export const DEFAULT_MIN_COLUMN_WIDTH_PX = 64;
3
+ /** Upper bound so a tampered stored width cannot blow the table up. */
4
+ export const MAX_COLUMN_WIDTH_PX = 2000;
5
+ export function defaultPins(schema) {
6
+ const pins = {};
7
+ for (const column of schema) {
8
+ if (column.pinned !== undefined)
9
+ pins[column.field] = column.pinned;
10
+ }
11
+ return pins;
12
+ }
13
+ export function minWidthsOf(schema) {
14
+ return Object.fromEntries(schema.map((column) => [column.field, column.minWidth ?? DEFAULT_MIN_COLUMN_WIDTH_PX]));
15
+ }
16
+ export function clampWidth(width, min) {
17
+ return Math.min(MAX_COLUMN_WIDTH_PX, Math.max(min, Math.round(width)));
18
+ }
19
+ export function defaultWidths(schema, minWidths) {
20
+ return Object.fromEntries(schema.map((column) => [
21
+ column.field,
22
+ clampWidth(column.width ?? DEFAULT_COLUMN_WIDTH_PX, minWidths[column.field] ?? DEFAULT_MIN_COLUMN_WIDTH_PX),
23
+ ]));
24
+ }
25
+ /** A saved width wins per field; a column the saved view has never seen keeps its default. */
26
+ export function mergeSavedWidths(defaults, saved, minWidths) {
27
+ return Object.fromEntries(Object.entries(defaults).map(([field, fallback]) => {
28
+ const savedWidth = saved[field];
29
+ const min = minWidths[field] ?? DEFAULT_MIN_COLUMN_WIDTH_PX;
30
+ return [field, savedWidth === undefined ? fallback : clampWidth(savedWidth, min)];
31
+ }));
32
+ }
33
+ export function sameRecord(a, b) {
34
+ const keys = Object.keys(a);
35
+ return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);
36
+ }
@@ -0,0 +1,26 @@
1
+ import type { AggregateKey } from "@cosmicdrift/kumiko-types/aggregate-types";
2
+ /** How a group pages through its rows: offset for `pagination: "pages"`, cursor for `"infinite"`. */
3
+ export type ListGroupPaging = "offset" | "cursor";
4
+ export type ListGroupPageResult = {
5
+ readonly rows: readonly Readonly<Record<string, unknown>>[];
6
+ readonly nextCursor: string | null;
7
+ readonly loading: boolean;
8
+ };
9
+ export type ListGroupPageRequest = {
10
+ readonly pageKey: string;
11
+ readonly payload: Readonly<Record<string, unknown>>;
12
+ };
13
+ /** The list payload as the aggregate sees it: filters, search and screen filter, no paging. */
14
+ export declare function withoutListPaging(payload: Readonly<Record<string, unknown>>): Record<string, unknown>;
15
+ export declare function groupPageKey(groupKey: string, pageIndex: number): string;
16
+ export declare function groupPagePayload(args: {
17
+ readonly base: Readonly<Record<string, unknown>>;
18
+ readonly groupField: string;
19
+ readonly groupValue: AggregateKey;
20
+ readonly pageSize: number;
21
+ readonly pageIndex: number;
22
+ readonly paging: ListGroupPaging;
23
+ readonly cursor: string | undefined;
24
+ }): Record<string, unknown>;
25
+ /** Loaded pages of one group in order, up to the first page that has not answered yet. */
26
+ export declare function loadedGroupPages(results: ReadonlyMap<string, ListGroupPageResult>, groupKey: string, requestedPages: number): ListGroupPageResult[];
@@ -0,0 +1,37 @@
1
+ const PAGING_KEYS = ["limit", "offset", "cursor", "totalCount"];
2
+ /** The list payload as the aggregate sees it: filters, search and screen filter, no paging. */
3
+ export function withoutListPaging(payload) {
4
+ const kept = { ...payload };
5
+ for (const key of PAGING_KEYS)
6
+ delete kept[key];
7
+ return kept;
8
+ }
9
+ export function groupPageKey(groupKey, pageIndex) {
10
+ return `${groupKey}#${pageIndex}`;
11
+ }
12
+ function existingFilters(base) {
13
+ const filters = base["filters"];
14
+ return Array.isArray(filters) ? filters : [];
15
+ }
16
+ export function groupPagePayload(args) {
17
+ const { base, groupField, groupValue, pageSize, pageIndex, paging, cursor } = args;
18
+ const offset = pageIndex * pageSize;
19
+ return {
20
+ ...base,
21
+ filters: [...existingFilters(base), { field: groupField, op: "eq", value: groupValue }],
22
+ limit: pageSize,
23
+ ...(paging === "offset" && offset > 0 && { offset }),
24
+ ...(paging === "cursor" && cursor !== undefined && { cursor }),
25
+ };
26
+ }
27
+ /** Loaded pages of one group in order, up to the first page that has not answered yet. */
28
+ export function loadedGroupPages(results, groupKey, requestedPages) {
29
+ const pages = [];
30
+ for (let pageIndex = 0; pageIndex < requestedPages; pageIndex++) {
31
+ const page = results.get(groupPageKey(groupKey, pageIndex));
32
+ if (page === undefined)
33
+ break;
34
+ pages.push(page);
35
+ }
36
+ return pages;
37
+ }
@@ -0,0 +1,8 @@
1
+ type UrlParams = Readonly<Record<string, string | undefined>>;
2
+ /** Exact `${screenId}.` prefix: `orders` must not match `orders-archive.q`. */
3
+ export declare function listParamKeys(params: UrlParams, screenId: string): string[];
4
+ /** The page alone is navigation, not a deviation from the default view. */
5
+ export declare function isListStateAtDefault(params: UrlParams, screenId: string): boolean;
6
+ /** Nulling every list key lets defaultSort/defaultFilters apply again, and drops the `~` "no filter" markers. */
7
+ export declare function listResetUpdates(params: UrlParams, screenId: string): Record<string, null>;
8
+ export {};
@@ -0,0 +1,15 @@
1
+ const PAGE_SUFFIX = "page";
2
+ /** Exact `${screenId}.` prefix: `orders` must not match `orders-archive.q`. */
3
+ export function listParamKeys(params, screenId) {
4
+ const prefix = `${screenId}.`;
5
+ return Object.keys(params).filter((key) => key.startsWith(prefix));
6
+ }
7
+ /** The page alone is navigation, not a deviation from the default view. */
8
+ export function isListStateAtDefault(params, screenId) {
9
+ const pageKey = `${screenId}.${PAGE_SUFFIX}`;
10
+ return listParamKeys(params, screenId).every((key) => key === pageKey);
11
+ }
12
+ /** Nulling every list key lets defaultSort/defaultFilters apply again, and drops the `~` "no filter" markers. */
13
+ export function listResetUpdates(params, screenId) {
14
+ return Object.fromEntries(listParamKeys(params, screenId).map((key) => [key, null]));
15
+ }
@@ -0,0 +1,39 @@
1
+ import type { ListAggregateGroup } from "@cosmicdrift/kumiko-types/list-aggregate-types";
2
+ import { type ListTableGrouping } from "@cosmicdrift/kumiko-types/screen";
3
+ import type { DataTableMeasure, DataTableServerGroup } from "../data-table-aggregate-types.ts";
4
+ import type { Translate } from "../headless/index.ts";
5
+ import { type ListGroupPageRequest, type ListGroupPageResult, type ListGroupPaging } from "./list-group-pages.ts";
6
+ export type GroupLoadState = {
7
+ readonly resetKey: string;
8
+ readonly toggled: ReadonlySet<string>;
9
+ readonly visible: ReadonlySet<string>;
10
+ readonly requestedPages: ReadonlyMap<string, number>;
11
+ readonly results: ReadonlyMap<string, ListGroupPageResult>;
12
+ };
13
+ export type MeasureSpec = {
14
+ readonly field: string;
15
+ readonly kind: DataTableMeasure["kind"];
16
+ };
17
+ type Row = Readonly<Record<string, unknown>>;
18
+ export declare function freshLoadState(resetKey: string): GroupLoadState;
19
+ export declare function measuresOf(totals: readonly MeasureSpec[], group: ListAggregateGroup | undefined): DataTableMeasure[];
20
+ type ServerGroupsInput = {
21
+ readonly answer: readonly ListAggregateGroup[];
22
+ readonly groupField: string;
23
+ /** The declared grouping, only when the active field is the declared one. */
24
+ readonly declared: ListTableGrouping | undefined;
25
+ readonly state: GroupLoadState;
26
+ readonly base: Readonly<Record<string, unknown>>;
27
+ readonly pageSize: number;
28
+ readonly paging: ListGroupPaging;
29
+ readonly measures: readonly MeasureSpec[];
30
+ readonly translate: Translate;
31
+ };
32
+ export type ServerGroupsBuild = {
33
+ readonly groups: DataTableServerGroup[];
34
+ readonly rows: Row[];
35
+ readonly requests: ListGroupPageRequest[];
36
+ };
37
+ /** Header entries, loaded rows and the page requests of the open, visible groups. */
38
+ export declare function buildServerGroups(input: ServerGroupsInput): ServerGroupsBuild;
39
+ export {};