@alepha/ui 0.39.0 → 0.41.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 (761) hide show
  1. package/README.md +4 -2
  2. package/dist/account/AccountConnections.js +1 -1
  3. package/dist/account/AccountConnectionsView.js +4 -4
  4. package/dist/account/AccountDeleteDialog.d.ts.map +1 -1
  5. package/dist/account/AccountDeleteDialog.js +5 -4
  6. package/dist/account/AccountDeleteDialog.js.map +1 -1
  7. package/dist/account/AccountDialog.js +4 -4
  8. package/dist/account/AccountDisplay.js +4 -4
  9. package/dist/account/AccountKeys.js +1 -1
  10. package/dist/account/AccountKeysView.js +5 -5
  11. package/dist/account/AccountMfaDialog.js +4 -4
  12. package/dist/account/AccountPasskeyProofDialog.js +2 -2
  13. package/dist/account/AccountPasskeyRow.js +3 -3
  14. package/dist/account/AccountPasskeys.js +4 -4
  15. package/dist/account/AccountPasswordDialog.js +4 -4
  16. package/dist/account/AccountPasswordDialog.js.map +1 -1
  17. package/dist/account/AccountPasswordGuard.js +2 -2
  18. package/dist/account/AccountProfile.js +1 -1
  19. package/dist/account/AccountProfileView.d.ts.map +1 -1
  20. package/dist/account/AccountProfileView.js +8 -7
  21. package/dist/account/AccountProfileView.js.map +1 -1
  22. package/dist/account/AccountRecoveryCodes.js +2 -2
  23. package/dist/account/AccountRecoveryCodesDialog.js +1 -1
  24. package/dist/account/AccountSecurity.js +1 -1
  25. package/dist/account/AccountSecurityView.js +5 -5
  26. package/dist/account/AccountSessions.js +1 -1
  27. package/dist/account/AccountSessionsView.js +4 -4
  28. package/dist/account/ApiKeyCreateDialog.js +7 -6
  29. package/dist/account/ApiKeyCreateDialog.js.map +1 -1
  30. package/dist/account/ApiKeyScopeMatrix.js +2 -2
  31. package/dist/account/ApiKeyStatusBadge.js +1 -1
  32. package/dist/admin/$pageAdmin.js +1 -1
  33. package/dist/admin/AdminAi.d.ts +12 -0
  34. package/dist/admin/AdminAi.d.ts.map +1 -0
  35. package/dist/admin/AdminAi.js +173 -0
  36. package/dist/admin/AdminAi.js.map +1 -0
  37. package/dist/admin/AdminAiDailyChart.d.ts +16 -0
  38. package/dist/admin/AdminAiDailyChart.d.ts.map +1 -0
  39. package/dist/admin/AdminAiDailyChart.js +87 -0
  40. package/dist/admin/AdminAiDailyChart.js.map +1 -0
  41. package/dist/admin/AdminAiUsageTable.d.ts +33 -0
  42. package/dist/admin/AdminAiUsageTable.d.ts.map +1 -0
  43. package/dist/admin/AdminAiUsageTable.js +77 -0
  44. package/dist/admin/AdminAiUsageTable.js.map +1 -0
  45. package/dist/admin/AdminAnalytics.js +3 -3
  46. package/dist/admin/AdminAudits.js +7 -7
  47. package/dist/admin/AdminBrand.js +2 -2
  48. package/dist/admin/AdminConnectedTile.js +1 -1
  49. package/dist/admin/AdminDashboard.js +3 -3
  50. package/dist/admin/AdminFailedAuditsTile.js +3 -3
  51. package/dist/admin/AdminFiles.d.ts.map +1 -1
  52. package/dist/admin/AdminFiles.js +8 -8
  53. package/dist/admin/AdminFiles.js.map +1 -1
  54. package/dist/admin/AdminFilesUsage.js +2 -2
  55. package/dist/admin/AdminFilesUsageCard.js +2 -2
  56. package/dist/admin/AdminJobDetail.js +7 -7
  57. package/dist/admin/AdminJobDetailAside.js +3 -3
  58. package/dist/admin/AdminJobDetailExecutions.js +6 -6
  59. package/dist/admin/AdminJobExecutionLogs.js +1 -1
  60. package/dist/admin/AdminJobExecutionSheet.d.ts.map +1 -1
  61. package/dist/admin/AdminJobExecutionSheet.js +12 -5
  62. package/dist/admin/AdminJobExecutionSheet.js.map +1 -1
  63. package/dist/admin/AdminJobExecutionSteps.js +1 -1
  64. package/dist/admin/AdminJobs.js +7 -7
  65. package/dist/admin/AdminJobsTypeIcon.js +1 -1
  66. package/dist/admin/AdminKeys.js +6 -6
  67. package/dist/admin/AdminKeysTokenDialog.js +4 -4
  68. package/dist/admin/AdminLayout.js +5 -5
  69. package/dist/admin/AdminNotifications.js +6 -6
  70. package/dist/admin/AdminNotificationsDetail.js +2 -2
  71. package/dist/admin/AdminNotificationsDetailTabs.js +3 -3
  72. package/dist/admin/AdminNotificationsPreviewBody.js +1 -1
  73. package/dist/admin/AdminNotificationsPreviewTab.js +1 -1
  74. package/dist/admin/AdminParameters.d.ts.map +1 -1
  75. package/dist/admin/AdminParameters.js +10 -8
  76. package/dist/admin/AdminParameters.js.map +1 -1
  77. package/dist/admin/AdminParametersEditorForm.d.ts +5 -0
  78. package/dist/admin/AdminParametersEditorForm.d.ts.map +1 -1
  79. package/dist/admin/AdminParametersEditorForm.js +8 -6
  80. package/dist/admin/AdminParametersEditorForm.js.map +1 -1
  81. package/dist/admin/AdminParametersEditorPane.d.ts +5 -0
  82. package/dist/admin/AdminParametersEditorPane.d.ts.map +1 -1
  83. package/dist/admin/AdminParametersEditorPane.js +7 -6
  84. package/dist/admin/AdminParametersEditorPane.js.map +1 -1
  85. package/dist/admin/AdminParametersHistoryPane.js +5 -5
  86. package/dist/admin/AdminParametersTreeFooterActions.js +3 -3
  87. package/dist/admin/AdminParametersTreeNodeView.js +5 -5
  88. package/dist/admin/AdminParametersTreeNodeView.js.map +1 -1
  89. package/dist/admin/AdminParametersTreePane.js +4 -4
  90. package/dist/admin/AdminPayments.js +4 -4
  91. package/dist/admin/AdminRouter.d.ts +12 -5
  92. package/dist/admin/AdminRouter.d.ts.map +1 -1
  93. package/dist/admin/AdminRouter.js +39 -10
  94. package/dist/admin/AdminRouter.js.map +1 -1
  95. package/dist/admin/AdminRouterOptions.js +1 -1
  96. package/dist/admin/AdminSessions.js +6 -6
  97. package/dist/admin/AdminStatTile.js +6 -6
  98. package/dist/admin/AdminStatTile.js.map +1 -1
  99. package/dist/admin/AdminStatTileDeltaChip.js +1 -1
  100. package/dist/admin/AdminUserAvatarControl.js +5 -5
  101. package/dist/admin/AdminUserCell.js +3 -3
  102. package/dist/admin/AdminUserDetail.js +10 -10
  103. package/dist/admin/AdminUserDetailAuditsTab.js +3 -3
  104. package/dist/admin/AdminUserDetailIdentityAside.js +4 -4
  105. package/dist/admin/AdminUserDetailOverviewTab.js +3 -3
  106. package/dist/admin/AdminUserDetailPasskeys.js +3 -3
  107. package/dist/admin/AdminUserDetailPasswordDialog.js +4 -4
  108. package/dist/admin/AdminUserDetailSecurityTab.js +4 -4
  109. package/dist/admin/AdminUserDetailSessionsTab.js +3 -3
  110. package/dist/admin/AdminUsers.js +10 -10
  111. package/dist/admin/AdminUsers.js.map +1 -1
  112. package/dist/admin/AdminUsersCreateDialog.js +5 -5
  113. package/dist/admin/AdminUsersRolesPicker.js +2 -2
  114. package/dist/admin/AdminUsersStatusBadge.js +1 -1
  115. package/dist/admin/AdminUsersTile.js +2 -2
  116. package/dist/admin/AdminWebhookDeliveries.js +6 -6
  117. package/dist/admin/AdminWebhookDeliveryDialog.js +5 -5
  118. package/dist/admin/AdminWebhookDetail.js +6 -6
  119. package/dist/admin/AdminWebhookDetailAside.js +3 -3
  120. package/dist/admin/AdminWebhookDetailOverview.js +6 -6
  121. package/dist/admin/AdminWebhooks.js +7 -7
  122. package/dist/admin/AdminWebhooksCreateDialog.js +6 -6
  123. package/dist/admin/AdminWebhooksSecretDialog.js +4 -4
  124. package/dist/admin/AdminWebhooksStatusBadge.js +3 -3
  125. package/dist/admin/ParameterDiffDialog.js +3 -3
  126. package/dist/admin/ParameterHistoryItem.js +5 -5
  127. package/dist/admin/ParameterJsonDialog.js +4 -4
  128. package/dist/admin/ParameterSaveDialog.js +5 -5
  129. package/dist/admin/adminAiMoney.d.ts +10 -0
  130. package/dist/admin/adminAiMoney.d.ts.map +1 -0
  131. package/dist/admin/adminAiMoney.js +21 -0
  132. package/dist/admin/adminAiMoney.js.map +1 -0
  133. package/dist/admin/adminParametersTree.d.ts +23 -2
  134. package/dist/admin/adminParametersTree.d.ts.map +1 -1
  135. package/dist/admin/adminParametersTree.js +36 -3
  136. package/dist/admin/adminParametersTree.js.map +1 -1
  137. package/dist/admin/analytics/AdvancedSection.js +3 -3
  138. package/dist/admin/analytics/AnalyticsChartBars.js +1 -1
  139. package/dist/admin/analytics/AnalyticsChartDonut.js +1 -1
  140. package/dist/admin/analytics/AnalyticsChartHeader.js +1 -1
  141. package/dist/admin/analytics/CoarsenedBadge.js +1 -1
  142. package/dist/admin/analytics/CompareNote.js +1 -1
  143. package/dist/admin/analytics/DatasetSelect.js +4 -4
  144. package/dist/admin/analytics/FilterEditor.js +3 -3
  145. package/dist/admin/analytics/FilterValuePicker.js +3 -3
  146. package/dist/admin/analytics/GroupByChips.js +1 -1
  147. package/dist/admin/analytics/MeasureChips.js +1 -1
  148. package/dist/admin/analytics/QueryPanel.js +1 -1
  149. package/dist/admin/analytics/RangeControl.js +3 -3
  150. package/dist/admin/analytics/RequestDialog.js +3 -3
  151. package/dist/admin/analytics/RequestDialog.js.map +1 -1
  152. package/dist/admin/analytics/ResultsPane.js +3 -3
  153. package/dist/admin/analytics/ResultsTable.d.ts.map +1 -1
  154. package/dist/admin/analytics/ResultsTable.js +3 -3
  155. package/dist/admin/analytics/ResultsTable.js.map +1 -1
  156. package/dist/admin/analytics/RunFooter.js +2 -2
  157. package/dist/admin/analytics/SamplingBadge.js +1 -1
  158. package/dist/admin/analytics/ToggleChip.js +1 -1
  159. package/dist/admin/analytics/TotalsCards.js +1 -1
  160. package/dist/admin/analytics/TruncationBanner.js +2 -2
  161. package/dist/admin/analytics/analyticsModel.d.ts +3 -1
  162. package/dist/admin/analytics/analyticsModel.d.ts.map +1 -1
  163. package/dist/admin/analytics/analyticsModel.js +13 -5
  164. package/dist/admin/analytics/analyticsModel.js.map +1 -1
  165. package/dist/admin/analytics/analyticsTypes.d.ts +1 -1
  166. package/dist/admin/analytics/analyticsTypes.d.ts.map +1 -1
  167. package/dist/admin/analytics/chartModel.d.ts.map +1 -1
  168. package/dist/admin/analytics/chartModel.js +2 -2
  169. package/dist/admin/analytics/chartModel.js.map +1 -1
  170. package/dist/admin/analytics/useAnalyticsQuery.js +2 -2
  171. package/dist/admin/analytics/useFilterValues.js +1 -1
  172. package/dist/admin/useAdminDetailTrail.js +2 -2
  173. package/dist/admin/useConfirmedAction.js +2 -2
  174. package/dist/ai/AiChat.d.ts +37 -5
  175. package/dist/ai/AiChat.d.ts.map +1 -1
  176. package/dist/ai/AiChat.js +107 -18
  177. package/dist/ai/AiChat.js.map +1 -1
  178. package/dist/ai/AiChatComposer.d.ts +9 -0
  179. package/dist/ai/AiChatComposer.d.ts.map +1 -1
  180. package/dist/ai/AiChatComposer.js +9 -4
  181. package/dist/ai/AiChatComposer.js.map +1 -1
  182. package/dist/ai/AiChatConfirmCard.d.ts +2 -2
  183. package/dist/ai/AiChatConfirmCard.d.ts.map +1 -1
  184. package/dist/ai/AiChatConfirmCard.js +20 -6
  185. package/dist/ai/AiChatConfirmCard.js.map +1 -1
  186. package/dist/ai/AiChatDock.js +3 -3
  187. package/dist/ai/AiChatEmpty.d.ts +5 -0
  188. package/dist/ai/AiChatEmpty.d.ts.map +1 -1
  189. package/dist/ai/AiChatEmpty.js +26 -30
  190. package/dist/ai/AiChatEmpty.js.map +1 -1
  191. package/dist/ai/AiChatFloat.d.ts +43 -0
  192. package/dist/ai/AiChatFloat.d.ts.map +1 -0
  193. package/dist/ai/AiChatFloat.js +66 -0
  194. package/dist/ai/AiChatFloat.js.map +1 -0
  195. package/dist/ai/AiChatHeaderButton.d.ts +14 -0
  196. package/dist/ai/AiChatHeaderButton.d.ts.map +1 -0
  197. package/dist/ai/AiChatHeaderButton.js +21 -0
  198. package/dist/ai/AiChatHeaderButton.js.map +1 -0
  199. package/dist/ai/AiChatHistory.d.ts.map +1 -1
  200. package/dist/ai/AiChatHistory.js +8 -6
  201. package/dist/ai/AiChatHistory.js.map +1 -1
  202. package/dist/ai/AiChatLauncher.d.ts +5 -0
  203. package/dist/ai/AiChatLauncher.d.ts.map +1 -1
  204. package/dist/ai/AiChatLauncher.js +3 -3
  205. package/dist/ai/AiChatLauncher.js.map +1 -1
  206. package/dist/ai/AiChatMessage.d.ts +6 -0
  207. package/dist/ai/AiChatMessage.d.ts.map +1 -1
  208. package/dist/ai/AiChatMessage.js +5 -5
  209. package/dist/ai/AiChatMessage.js.map +1 -1
  210. package/dist/ai/AiChatPanel.d.ts +65 -5
  211. package/dist/ai/AiChatPanel.d.ts.map +1 -1
  212. package/dist/ai/AiChatPanel.js +87 -41
  213. package/dist/ai/AiChatPanel.js.map +1 -1
  214. package/dist/ai/AiChatToolStepDetails.d.ts +14 -0
  215. package/dist/ai/AiChatToolStepDetails.d.ts.map +1 -0
  216. package/dist/ai/AiChatToolStepDetails.js +34 -0
  217. package/dist/ai/AiChatToolStepDetails.js.map +1 -0
  218. package/dist/ai/AiChatToolTrace.d.ts +63 -0
  219. package/dist/ai/AiChatToolTrace.d.ts.map +1 -0
  220. package/dist/ai/AiChatToolTrace.js +118 -0
  221. package/dist/ai/AiChatToolTrace.js.map +1 -0
  222. package/dist/ai/aiChatMotion.d.ts +24 -0
  223. package/dist/ai/aiChatMotion.d.ts.map +1 -0
  224. package/dist/ai/aiChatMotion.js +67 -0
  225. package/dist/ai/aiChatMotion.js.map +1 -0
  226. package/dist/ai/index.d.ts +6 -2
  227. package/dist/ai/index.d.ts.map +1 -1
  228. package/dist/ai/index.js +5 -1
  229. package/dist/ai/useAiChat.d.ts +11 -0
  230. package/dist/ai/useAiChat.d.ts.map +1 -1
  231. package/dist/ai/useAiChat.js +6 -4
  232. package/dist/ai/useAiChat.js.map +1 -1
  233. package/dist/ai/useAiChatFloatDrag.d.ts +23 -0
  234. package/dist/ai/useAiChatFloatDrag.d.ts.map +1 -0
  235. package/dist/ai/useAiChatFloatDrag.js +87 -0
  236. package/dist/ai/useAiChatFloatDrag.js.map +1 -0
  237. package/dist/ai/useAiContext.js +2 -2
  238. package/dist/auth/AuthLogin.d.ts.map +1 -1
  239. package/dist/auth/AuthLogin.js +18 -10
  240. package/dist/auth/AuthLogin.js.map +1 -1
  241. package/dist/auth/AuthLoginSlots.d.ts +53 -0
  242. package/dist/auth/AuthLoginSlots.d.ts.map +1 -0
  243. package/dist/auth/AuthLoginSlots.js +39 -0
  244. package/dist/auth/AuthLoginSlots.js.map +1 -0
  245. package/dist/auth/AuthMfaStep.js +7 -7
  246. package/dist/auth/AuthPasskeyAutofill.js +1 -1
  247. package/dist/auth/AuthRegister.js +9 -9
  248. package/dist/auth/AuthRegisterFormPhase.js +4 -4
  249. package/dist/auth/AuthRegisterPasswordRules.js +2 -2
  250. package/dist/auth/AuthResetPassword.js +10 -10
  251. package/dist/auth/AuthRouter.js +2 -2
  252. package/dist/auth/AuthVerifyEmail.js +2 -2
  253. package/dist/auth/AuthVerifyEmailStateful.js +3 -3
  254. package/dist/auth/AuthVerifyEmailView.js +4 -4
  255. package/dist/auth/TurnstileWidget.js +1 -1
  256. package/dist/auth/index.d.ts +1 -0
  257. package/dist/auth/index.d.ts.map +1 -1
  258. package/dist/auth/index.js +2 -1
  259. package/dist/auth/usePasskey.js +1 -1
  260. package/dist/calendar/Calendar.js +4 -4
  261. package/dist/chart/Chart.js +2 -2
  262. package/dist/command/Command.js +4 -4
  263. package/dist/core/Alert.js +2 -2
  264. package/dist/core/AlertDialog.js +2 -2
  265. package/dist/core/Avatar.js +2 -2
  266. package/dist/core/Badge.js +2 -2
  267. package/dist/core/BrandIcon.js +1 -1
  268. package/dist/core/Breadcrumb.js +3 -3
  269. package/dist/core/Button.d.ts.map +1 -1
  270. package/dist/core/Button.js +22 -6
  271. package/dist/core/Button.js.map +1 -1
  272. package/dist/core/ButtonGroup.js +2 -2
  273. package/dist/core/Card.js +1 -1
  274. package/dist/core/Checkbox.js +2 -2
  275. package/dist/core/Collapsible.js +2 -2
  276. package/dist/core/Combobox.d.ts.map +1 -1
  277. package/dist/core/Combobox.js +4 -4
  278. package/dist/core/Combobox.js.map +1 -1
  279. package/dist/core/ContextMenu.js +2 -2
  280. package/dist/core/Dialog.d.ts.map +1 -1
  281. package/dist/core/Dialog.js +4 -4
  282. package/dist/core/Dialog.js.map +1 -1
  283. package/dist/core/DirectionProvider.js +1 -1
  284. package/dist/core/Drawer.js +3 -3
  285. package/dist/core/DropdownMenu.js +2 -2
  286. package/dist/core/Empty.js +1 -1
  287. package/dist/core/HoverCard.js +1 -1
  288. package/dist/core/Input.js +2 -2
  289. package/dist/core/InputGroup.js +2 -2
  290. package/dist/core/Label.js +1 -1
  291. package/dist/core/Menubar.js +4 -4
  292. package/dist/core/PageOutline.d.ts +9 -1
  293. package/dist/core/PageOutline.d.ts.map +1 -1
  294. package/dist/core/PageOutline.js +25 -6
  295. package/dist/core/PageOutline.js.map +1 -1
  296. package/dist/core/Pagination.js +2 -2
  297. package/dist/core/PaneRail.js +1 -1
  298. package/dist/core/Popover.js +2 -2
  299. package/dist/core/Progress.js +1 -1
  300. package/dist/core/Segmented.d.ts +11 -1
  301. package/dist/core/Segmented.d.ts.map +1 -1
  302. package/dist/core/Segmented.js +8 -5
  303. package/dist/core/Segmented.js.map +1 -1
  304. package/dist/core/Separator.js +1 -1
  305. package/dist/core/Sheet.js +3 -3
  306. package/dist/core/Sidebar.js +7 -7
  307. package/dist/core/Slider.js +3 -3
  308. package/dist/core/Spinner.js +1 -1
  309. package/dist/core/Stepper.js +1 -1
  310. package/dist/core/Switch.js +1 -1
  311. package/dist/core/Table.js +1 -1
  312. package/dist/core/Textarea.js +1 -1
  313. package/dist/core/TimeAgo.d.ts +12 -5
  314. package/dist/core/TimeAgo.d.ts.map +1 -1
  315. package/dist/core/TimeAgo.js +18 -7
  316. package/dist/core/TimeAgo.js.map +1 -1
  317. package/dist/core/Toaster.js +2 -2
  318. package/dist/core/Tooltip.js +1 -1
  319. package/dist/core/UserAvatar.js +3 -3
  320. package/dist/core/index.d.ts +0 -1
  321. package/dist/core/index.d.ts.map +1 -1
  322. package/dist/core/index.js +1 -2
  323. package/dist/core/useDialog.js +5 -5
  324. package/dist/core/useUndoable.js +1 -1
  325. package/dist/form/AutoForm.js +6 -6
  326. package/dist/form/AutoFormBottomBar.js +4 -4
  327. package/dist/form/AutoFormErrorPopover.js +4 -4
  328. package/dist/form/AutoFormGroupBlock.js +3 -3
  329. package/dist/form/AutoFormGroupGridField.js +2 -2
  330. package/dist/form/Control.d.ts +4 -0
  331. package/dist/form/Control.d.ts.map +1 -1
  332. package/dist/form/Control.js +9 -8
  333. package/dist/form/Control.js.map +1 -1
  334. package/dist/form/ControlArray.js +7 -7
  335. package/dist/form/ControlDate.js +6 -6
  336. package/dist/form/ControlDatePopover.js +4 -4
  337. package/dist/form/ControlDateRange.js +5 -5
  338. package/dist/form/ControlMonthPopover.js +4 -4
  339. package/dist/form/ControlNumber.js +3 -3
  340. package/dist/form/ControlObject.js +7 -7
  341. package/dist/form/ControlPassword.js +3 -3
  342. package/dist/form/ControlSelect.d.ts +12 -0
  343. package/dist/form/ControlSelect.d.ts.map +1 -1
  344. package/dist/form/ControlSelect.js +13 -7
  345. package/dist/form/ControlSelect.js.map +1 -1
  346. package/dist/form/ControlSelectCombobox.js +4 -4
  347. package/dist/form/ControlUpload.d.ts.map +1 -1
  348. package/dist/form/ControlUpload.js +11 -10
  349. package/dist/form/ControlUpload.js.map +1 -1
  350. package/dist/form/ControlUploadItemThumb.js +1 -1
  351. package/dist/form/FormField.js +2 -2
  352. package/dist/form/FormFieldDescriptionTip.js +1 -1
  353. package/dist/form/fieldTrigger.js +3 -3
  354. package/dist/form/iconHint.js +1 -1
  355. package/dist/form/useFieldErrorText.js +1 -1
  356. package/dist/i18n/en/index.d.ts +22 -0
  357. package/dist/i18n/en/index.d.ts.map +1 -0
  358. package/dist/i18n/en/index.js +1 -0
  359. package/dist/i18n/en/uiEn.d.ts +37 -0
  360. package/dist/i18n/en/uiEn.d.ts.map +1 -0
  361. package/dist/i18n/en/uiEn.js +1497 -0
  362. package/dist/i18n/en/uiEn.js.map +1 -0
  363. package/dist/i18n/fr/uiFr.d.ts +3 -2
  364. package/dist/i18n/fr/uiFr.d.ts.map +1 -1
  365. package/dist/i18n/fr/uiFr.js +38 -4
  366. package/dist/i18n/fr/uiFr.js.map +1 -1
  367. package/dist/markdown/MarkdownView.d.ts +23 -0
  368. package/dist/markdown/MarkdownView.d.ts.map +1 -1
  369. package/dist/markdown/MarkdownView.js +29 -10
  370. package/dist/markdown/MarkdownView.js.map +1 -1
  371. package/dist/markdown/diagram/DiagramLabel.js +1 -1
  372. package/dist/markdown/diagram/FlowchartDiagram.js +2 -2
  373. package/dist/markdown/diagram/FlowchartDiagramCluster.js +2 -2
  374. package/dist/markdown/diagram/FlowchartDiagramEdge.js +1 -1
  375. package/dist/markdown/diagram/FlowchartDiagramNode.js +1 -1
  376. package/dist/markdown/diagram/MermaidFence.js +2 -2
  377. package/dist/markdown/diagram/SequenceDiagram.js +2 -2
  378. package/dist/markdown/diagram/SequenceDiagramFragment.js +2 -2
  379. package/dist/markdown/diagram/SequenceDiagramMessage.js +1 -1
  380. package/dist/markdown/diagram/SequenceDiagramNote.js +1 -1
  381. package/dist/markdown/diagram/SequenceDiagramParticipant.js +2 -2
  382. package/dist/markdown/diagram/SequenceDiagramParticipantActor.js +2 -2
  383. package/dist/markdown/diagram/layoutFlowchart.js +1 -1
  384. package/dist/markdown/highlightLines.d.ts +27 -0
  385. package/dist/markdown/highlightLines.d.ts.map +1 -0
  386. package/dist/markdown/highlightLines.js +91 -0
  387. package/dist/markdown/highlightLines.js.map +1 -0
  388. package/dist/markdown/index.d.ts +5 -2
  389. package/dist/markdown/index.d.ts.map +1 -1
  390. package/dist/markdown/index.js +2 -1
  391. package/dist/organizations/MyOrganizationInvitations.d.ts.map +1 -1
  392. package/dist/organizations/MyOrganizationInvitations.js +13 -5
  393. package/dist/organizations/MyOrganizationInvitations.js.map +1 -1
  394. package/dist/organizations/MyOrganizations.d.ts.map +1 -1
  395. package/dist/organizations/MyOrganizations.js +15 -5
  396. package/dist/organizations/MyOrganizations.js.map +1 -1
  397. package/dist/organizations/OrganizationInviteDialog.js +6 -6
  398. package/dist/organizations/OrganizationInviteDialog.js.map +1 -1
  399. package/dist/organizations/OrganizationMemberRankPicker.js +5 -5
  400. package/dist/organizations/OrganizationMembers.d.ts.map +1 -1
  401. package/dist/organizations/OrganizationMembers.js +12 -6
  402. package/dist/organizations/OrganizationMembers.js.map +1 -1
  403. package/dist/organizations/OrganizationPendingInvitations.d.ts.map +1 -1
  404. package/dist/organizations/OrganizationPendingInvitations.js +9 -4
  405. package/dist/organizations/OrganizationPendingInvitations.js.map +1 -1
  406. package/dist/organizations/OrganizationRankColumnHeader.js +2 -2
  407. package/dist/organizations/OrganizationRanks.d.ts.map +1 -1
  408. package/dist/organizations/OrganizationRanks.js +7 -5
  409. package/dist/organizations/OrganizationRanks.js.map +1 -1
  410. package/dist/organizations/OrganizationTransferOwnershipDialog.js +5 -5
  411. package/dist/organizations/OrganizationTransferOwnershipDialog.js.map +1 -1
  412. package/dist/organizations/useInviteOrganizationMember.js +1 -1
  413. package/dist/organizations/useRevokeOrganizationInvitation.js +2 -2
  414. package/dist/otp/InputOTP.js +2 -2
  415. package/dist/resizable/Resizable.js +1 -1
  416. package/dist/settings/$settingsDialog.js +1 -1
  417. package/dist/settings/$settingsSection.js +1 -1
  418. package/dist/settings/SettingsDangerSection.js +1 -1
  419. package/dist/settings/SettingsDialog.js +6 -6
  420. package/dist/settings/SettingsDialogHost.js +3 -3
  421. package/dist/settings/SettingsDialogs.js +2 -2
  422. package/dist/settings/useSettingsDialog.js +2 -2
  423. package/dist/shell/ActionErrorToaster.js +2 -2
  424. package/dist/shell/AppActions.js +1 -1
  425. package/dist/shell/AppShell.js +4 -4
  426. package/dist/shell/AppShellNavCollapse.js +1 -1
  427. package/dist/shell/AppShellNavDropdownItems.js +5 -5
  428. package/dist/shell/AppShellNavDropdownItems.js.map +1 -1
  429. package/dist/shell/AppShellSidebarNavItem.js +7 -7
  430. package/dist/shell/AppShellSidebarNavItem.js.map +1 -1
  431. package/dist/shell/AppShellStatefulSidebarTrigger.js +4 -4
  432. package/dist/shell/ButtonDark.js +3 -3
  433. package/dist/shell/ButtonInbox.d.ts +8 -0
  434. package/dist/shell/ButtonInbox.d.ts.map +1 -1
  435. package/dist/shell/ButtonInbox.js +8 -6
  436. package/dist/shell/ButtonInbox.js.map +1 -1
  437. package/dist/shell/ButtonLanguage.js +4 -4
  438. package/dist/shell/ButtonSettings.js +5 -5
  439. package/dist/shell/ButtonSettingsColorModeMenu.js +2 -2
  440. package/dist/shell/ButtonSettingsLanguageMenu.js +3 -3
  441. package/dist/shell/ButtonSettingsThemeMenu.js +4 -4
  442. package/dist/shell/ButtonSettingsVisionMenuItem.js +2 -2
  443. package/dist/shell/ButtonTheme.js +5 -5
  444. package/dist/shell/ButtonUser.js +1 -1
  445. package/dist/shell/ButtonUserAccountMenuItem.js +3 -3
  446. package/dist/shell/ButtonUserAdminMenuItem.js +4 -4
  447. package/dist/shell/ButtonUserAdminMenuItem.js.map +1 -1
  448. package/dist/shell/ButtonUserContent.js +5 -5
  449. package/dist/shell/ButtonUserDefaultMenu.js +2 -2
  450. package/dist/shell/ButtonUserLogoutMenuItem.js +2 -2
  451. package/dist/shell/ButtonVision.js +3 -3
  452. package/dist/shell/DetailAside.js +4 -4
  453. package/dist/shell/DetailLayout.d.ts +3 -1
  454. package/dist/shell/DetailLayout.d.ts.map +1 -1
  455. package/dist/shell/DetailLayout.js +29 -17
  456. package/dist/shell/DetailLayout.js.map +1 -1
  457. package/dist/shell/DetailLayoutTabMenu.d.ts +19 -0
  458. package/dist/shell/DetailLayoutTabMenu.d.ts.map +1 -0
  459. package/dist/shell/DetailLayoutTabMenu.js +65 -0
  460. package/dist/shell/DetailLayoutTabMenu.js.map +1 -0
  461. package/dist/shell/NavShell.js +2 -2
  462. package/dist/shell/PlateFolderTabs.js +1 -1
  463. package/dist/shell/PlateLayout.d.ts.map +1 -1
  464. package/dist/shell/PlateLayout.js +2 -2
  465. package/dist/shell/PlateLayout.js.map +1 -1
  466. package/dist/shell/PlateTabBar.js +1 -1
  467. package/dist/shell/SidebarBackHeader.js +3 -3
  468. package/dist/shell/SidebarBackHeader.js.map +1 -1
  469. package/dist/shell/SidebarNavAutoClose.js +1 -1
  470. package/dist/shell/Spotlight.js +3 -3
  471. package/dist/shell/useDetailTab.js +1 -1
  472. package/dist/shell/useNavBreadcrumbs.js +3 -3
  473. package/dist/shell/useNavCrumbs.js +1 -1
  474. package/dist/shell/useNavEntries.js +3 -3
  475. package/dist/shell/useNavTree.js +1 -1
  476. package/dist/sortable/index.d.ts +17 -0
  477. package/dist/sortable/index.d.ts.map +1 -0
  478. package/dist/sortable/index.js +4 -0
  479. package/dist/sortable/useSortableItem.d.ts +32 -0
  480. package/dist/sortable/useSortableItem.d.ts.map +1 -0
  481. package/dist/sortable/useSortableItem.js +35 -0
  482. package/dist/sortable/useSortableItem.js.map +1 -0
  483. package/dist/sortable/useSortableList.d.ts +85 -0
  484. package/dist/sortable/useSortableList.d.ts.map +1 -0
  485. package/dist/sortable/useSortableList.js +125 -0
  486. package/dist/sortable/useSortableList.js.map +1 -0
  487. package/dist/styles.css +43 -0
  488. package/dist/swagger/SwaggerAccessBadge.js +1 -1
  489. package/dist/swagger/SwaggerAlephaMeta.js +1 -1
  490. package/dist/swagger/SwaggerCredentials.js +3 -3
  491. package/dist/swagger/SwaggerExplorer.js +5 -5
  492. package/dist/swagger/SwaggerNav.js +2 -2
  493. package/dist/swagger/SwaggerOperationView.js +2 -2
  494. package/dist/swagger/SwaggerResponseView.js +2 -2
  495. package/dist/swagger/SwaggerResponses.js +1 -1
  496. package/dist/swagger/SwaggerSchemaView.js +1 -1
  497. package/dist/swagger/SwaggerTryIt.js +2 -2
  498. package/dist/swagger/SwaggerTryItForm.js +3 -3
  499. package/dist/swagger/useSwaggerAccess.js +2 -2
  500. package/dist/table/DataTable.d.ts.map +1 -1
  501. package/dist/table/DataTable.js +53 -15
  502. package/dist/table/DataTable.js.map +1 -1
  503. package/dist/table/DataTableBody.d.ts +10 -0
  504. package/dist/table/DataTableBody.d.ts.map +1 -1
  505. package/dist/table/DataTableBody.js +32 -10
  506. package/dist/table/DataTableBody.js.map +1 -1
  507. package/dist/table/DataTableBulkBar.d.ts.map +1 -1
  508. package/dist/table/DataTableBulkBar.js +5 -4
  509. package/dist/table/DataTableBulkBar.js.map +1 -1
  510. package/dist/table/DataTableBulkMenu.js +2 -2
  511. package/dist/table/DataTableColumnPicker.js +3 -3
  512. package/dist/table/DataTableCompactPager.js +2 -2
  513. package/dist/table/DataTableFilterAdd.js +2 -2
  514. package/dist/table/DataTableFilterBar.js +2 -2
  515. package/dist/table/DataTableFilterControl.js +2 -2
  516. package/dist/table/DataTableFilterDialog.js +3 -3
  517. package/dist/table/DataTableFilterMenu.js +2 -2
  518. package/dist/table/DataTableFooter.d.ts +5 -1
  519. package/dist/table/DataTableFooter.d.ts.map +1 -1
  520. package/dist/table/DataTableFooter.js +27 -23
  521. package/dist/table/DataTableFooter.js.map +1 -1
  522. package/dist/table/DataTableGroupRow.js +1 -1
  523. package/dist/table/DataTableHeaderFilter.js +3 -3
  524. package/dist/table/DataTableHeaderPopup.js +3 -3
  525. package/dist/table/DataTableHeaderPopupChevron.js +1 -1
  526. package/dist/table/DataTableHeaderPopupFilter.js +1 -1
  527. package/dist/table/DataTableHeaderPopupList.js +1 -1
  528. package/dist/table/DataTableHeaderPopupRange.js +3 -3
  529. package/dist/table/DataTableHeaderRow.js +3 -3
  530. package/dist/table/DataTableHelpButton.js +2 -2
  531. package/dist/table/DataTableKeyHints.d.ts +11 -0
  532. package/dist/table/DataTableKeyHints.d.ts.map +1 -0
  533. package/dist/table/DataTableKeyHints.js +23 -0
  534. package/dist/table/DataTableKeyHints.js.map +1 -0
  535. package/dist/table/DataTablePresetRail.js +4 -4
  536. package/dist/table/DataTableRowActionGroupItem.d.ts +23 -0
  537. package/dist/table/DataTableRowActionGroupItem.d.ts.map +1 -0
  538. package/dist/table/DataTableRowActionGroupItem.js +38 -0
  539. package/dist/table/DataTableRowActionGroupItem.js.map +1 -0
  540. package/dist/table/DataTableRowActionItem.d.ts.map +1 -1
  541. package/dist/table/DataTableRowActionItem.js +15 -2
  542. package/dist/table/DataTableRowActionItem.js.map +1 -1
  543. package/dist/table/DataTableRowActionPrimary.d.ts +20 -0
  544. package/dist/table/DataTableRowActionPrimary.d.ts.map +1 -0
  545. package/dist/table/DataTableRowActionPrimary.js +42 -0
  546. package/dist/table/DataTableRowActionPrimary.js.map +1 -0
  547. package/dist/table/DataTableRowActionsInline.d.ts +3 -2
  548. package/dist/table/DataTableRowActionsInline.d.ts.map +1 -1
  549. package/dist/table/DataTableRowActionsInline.js +35 -23
  550. package/dist/table/DataTableRowActionsInline.js.map +1 -1
  551. package/dist/table/DataTableRowActionsMenu.d.ts +3 -2
  552. package/dist/table/DataTableRowActionsMenu.d.ts.map +1 -1
  553. package/dist/table/DataTableRowActionsMenu.js +14 -16
  554. package/dist/table/DataTableRowActionsMenu.js.map +1 -1
  555. package/dist/table/DataTableSortMenuButton.d.ts +15 -0
  556. package/dist/table/DataTableSortMenuButton.d.ts.map +1 -0
  557. package/dist/table/DataTableSortMenuButton.js +62 -0
  558. package/dist/table/DataTableSortMenuButton.js.map +1 -0
  559. package/dist/table/DataTableSummaryPanel.js +2 -2
  560. package/dist/table/DataTableToolbar.d.ts +4 -0
  561. package/dist/table/DataTableToolbar.d.ts.map +1 -1
  562. package/dist/table/DataTableToolbar.js +8 -2
  563. package/dist/table/DataTableToolbar.js.map +1 -1
  564. package/dist/table/PermissionMatrixGroupRows.js +1 -1
  565. package/dist/table/dataTableBaseProps.d.ts +93 -3
  566. package/dist/table/dataTableBaseProps.d.ts.map +1 -1
  567. package/dist/table/dataTableFilterFields.js +1 -1
  568. package/dist/table/dataTablePersistence.d.ts +53 -11
  569. package/dist/table/dataTablePersistence.d.ts.map +1 -1
  570. package/dist/table/dataTablePersistence.js +66 -29
  571. package/dist/table/dataTablePersistence.js.map +1 -1
  572. package/dist/table/dataTablePriority.d.ts +16 -0
  573. package/dist/table/dataTablePriority.d.ts.map +1 -0
  574. package/dist/table/dataTablePriority.js +31 -0
  575. package/dist/table/dataTablePriority.js.map +1 -0
  576. package/dist/table/dataTableTypes.d.ts +155 -3
  577. package/dist/table/dataTableTypes.d.ts.map +1 -1
  578. package/dist/table/index.d.ts +10 -2
  579. package/dist/table/index.d.ts.map +1 -1
  580. package/dist/table/index.js +3 -1
  581. package/dist/table/useDataTableColumns.d.ts.map +1 -1
  582. package/dist/table/useDataTableColumns.js +5 -5
  583. package/dist/table/useDataTableColumns.js.map +1 -1
  584. package/dist/table/useDataTableData.d.ts +1 -0
  585. package/dist/table/useDataTableData.d.ts.map +1 -1
  586. package/dist/table/useDataTableData.js +10 -9
  587. package/dist/table/useDataTableData.js.map +1 -1
  588. package/dist/table/useDataTableFilterForm.d.ts.map +1 -1
  589. package/dist/table/useDataTableFilterForm.js +9 -5
  590. package/dist/table/useDataTableFilterForm.js.map +1 -1
  591. package/dist/table/useDataTableFilterModel.d.ts +1 -0
  592. package/dist/table/useDataTableFilterModel.d.ts.map +1 -1
  593. package/dist/table/useDataTableFilterModel.js +4 -4
  594. package/dist/table/useDataTableFilterVisibility.d.ts +5 -0
  595. package/dist/table/useDataTableFilterVisibility.d.ts.map +1 -1
  596. package/dist/table/useDataTableFilterVisibility.js +17 -9
  597. package/dist/table/useDataTableFilterVisibility.js.map +1 -1
  598. package/dist/table/useDataTableKeyboard.d.ts +58 -0
  599. package/dist/table/useDataTableKeyboard.d.ts.map +1 -0
  600. package/dist/table/useDataTableKeyboard.js +157 -0
  601. package/dist/table/useDataTableKeyboard.js.map +1 -0
  602. package/dist/table/useDataTableRefresh.d.ts.map +1 -1
  603. package/dist/table/useDataTableRefresh.js +4 -3
  604. package/dist/table/useDataTableRefresh.js.map +1 -1
  605. package/dist/table/useDataTableSummary.d.ts +5 -0
  606. package/dist/table/useDataTableSummary.d.ts.map +1 -1
  607. package/dist/table/useDataTableSummary.js +7 -7
  608. package/dist/table/useDataTableSummary.js.map +1 -1
  609. package/dist/table/useDataTableWake.js +1 -1
  610. package/dist/table/useElementWidth.d.ts +10 -0
  611. package/dist/table/useElementWidth.d.ts.map +1 -0
  612. package/dist/table/useElementWidth.js +29 -0
  613. package/dist/table/useElementWidth.js.map +1 -0
  614. package/dist/tree/TreeView.js +1 -1
  615. package/dist/tree/TreeViewRow.d.ts.map +1 -1
  616. package/dist/tree/TreeViewRow.js +3 -3
  617. package/dist/tree/TreeViewRow.js.map +1 -1
  618. package/docs/packages-alepha-ui-ai.md +4 -3
  619. package/docs/packages-alepha-ui-i18n-en.md +35 -0
  620. package/docs/packages-alepha-ui-markdown.md +3 -1
  621. package/docs/packages-alepha-ui-overview.md +4 -2
  622. package/docs/packages-alepha-ui-sortable.md +34 -0
  623. package/docs/packages-alepha-ui-table.md +7 -1
  624. package/package.json +28 -10
  625. package/src/account/AccountDeleteDialog.tsx +2 -1
  626. package/src/account/AccountPasswordDialog.tsx +1 -1
  627. package/src/account/AccountProfileView.tsx +2 -1
  628. package/src/account/ApiKeyCreateDialog.tsx +1 -1
  629. package/src/account/__tests__/AccountProfile.browser.spec.tsx +21 -5
  630. package/src/admin/AdminAi.tsx +231 -0
  631. package/src/admin/AdminAiDailyChart.tsx +93 -0
  632. package/src/admin/AdminAiUsageTable.tsx +115 -0
  633. package/src/admin/AdminFiles.tsx +4 -6
  634. package/src/admin/AdminJobExecutionSheet.tsx +9 -0
  635. package/src/admin/AdminParameters.tsx +13 -2
  636. package/src/admin/AdminParametersEditorForm.tsx +9 -4
  637. package/src/admin/AdminParametersEditorPane.tsx +6 -0
  638. package/src/admin/AdminParametersTreeNodeView.tsx +1 -1
  639. package/src/admin/AdminRouter.tsx +31 -5
  640. package/src/admin/__tests__/AdminAiDailyChart.browser.spec.tsx +57 -0
  641. package/src/admin/__tests__/AdminRouter.spec.ts +5 -2
  642. package/src/admin/adminAiMoney.ts +20 -0
  643. package/src/admin/adminParametersTree.spec.ts +132 -0
  644. package/src/admin/adminParametersTree.ts +54 -2
  645. package/src/admin/analytics/RequestDialog.tsx +1 -1
  646. package/src/admin/analytics/ResultsTable.tsx +3 -1
  647. package/src/admin/analytics/analyticsModel.spec.ts +61 -2
  648. package/src/admin/analytics/analyticsModel.ts +29 -14
  649. package/src/admin/analytics/analyticsTypes.ts +1 -1
  650. package/src/admin/analytics/chartModel.ts +6 -2
  651. package/src/ai/AiChat.tsx +182 -20
  652. package/src/ai/AiChatComposer.tsx +26 -2
  653. package/src/ai/AiChatConfirmCard.tsx +22 -5
  654. package/src/ai/AiChatEmpty.tsx +24 -11
  655. package/src/ai/AiChatFloat.tsx +136 -0
  656. package/src/ai/AiChatHeaderButton.tsx +36 -0
  657. package/src/ai/AiChatHistory.tsx +22 -12
  658. package/src/ai/AiChatLauncher.tsx +6 -1
  659. package/src/ai/AiChatMessage.tsx +18 -3
  660. package/src/ai/AiChatPanel.tsx +236 -74
  661. package/src/ai/AiChatToolStepDetails.tsx +42 -0
  662. package/src/ai/AiChatToolTrace.tsx +213 -0
  663. package/src/ai/__tests__/AiChat.browser.spec.tsx +771 -4
  664. package/src/ai/aiChatMotion.ts +86 -0
  665. package/src/ai/index.ts +6 -2
  666. package/src/ai/useAiChat.ts +13 -0
  667. package/src/ai/useAiChatFloatDrag.ts +131 -0
  668. package/src/auth/AuthLogin.tsx +26 -1
  669. package/src/auth/AuthLoginSlots.ts +55 -0
  670. package/src/auth/__tests__/AuthLoginSlots.browser.spec.tsx +93 -0
  671. package/src/auth/index.ts +1 -0
  672. package/src/core/Button.tsx +26 -1
  673. package/src/core/Combobox.tsx +3 -1
  674. package/src/core/Dialog.tsx +13 -2
  675. package/src/core/PageOutline.tsx +28 -4
  676. package/src/core/Segmented.tsx +27 -5
  677. package/src/core/TimeAgo.browser.spec.tsx +49 -4
  678. package/src/core/TimeAgo.tsx +19 -8
  679. package/src/core/__tests__/Button.browser.spec.tsx +57 -0
  680. package/src/core/__tests__/CoreA11y.browser.spec.tsx +1 -10
  681. package/src/core/__tests__/PageOutline.browser.spec.tsx +20 -0
  682. package/src/core/__tests__/Segmented.browser.spec.tsx +59 -1
  683. package/src/core/__tests__/Textarea.browser.spec.tsx +1 -0
  684. package/src/core/__tests__/primitiveSlots.spec.ts +0 -1
  685. package/src/core/index.ts +0 -11
  686. package/src/form/Control.tsx +5 -0
  687. package/src/form/ControlSelect.tsx +31 -3
  688. package/src/form/ControlUpload.tsx +11 -16
  689. package/src/form/__tests__/ControlChoices.browser.spec.tsx +42 -0
  690. package/src/form/__tests__/ControlSelectLongLabelDialog.browser.spec.tsx +105 -0
  691. package/src/form/__tests__/ControlUpload.browser.spec.tsx +24 -0
  692. package/src/i18n/en/__tests__/uiEn.spec.ts +110 -0
  693. package/src/i18n/en/index.ts +22 -0
  694. package/src/i18n/en/uiEn.ts +1678 -0
  695. package/src/i18n/fr/uiFr.ts +40 -4
  696. package/src/markdown/MarkdownView.tsx +51 -6
  697. package/src/markdown/__tests__/MarkdownViewLink.browser.spec.tsx +33 -0
  698. package/src/markdown/__tests__/highlightLines.spec.ts +45 -0
  699. package/src/markdown/highlightLines.ts +120 -0
  700. package/src/markdown/index.ts +14 -2
  701. package/src/organizations/MyOrganizationInvitations.tsx +11 -2
  702. package/src/organizations/MyOrganizations.tsx +24 -3
  703. package/src/organizations/OrganizationInviteDialog.tsx +1 -1
  704. package/src/organizations/OrganizationMembers.tsx +10 -1
  705. package/src/organizations/OrganizationPendingInvitations.tsx +6 -0
  706. package/src/organizations/OrganizationRanks.tsx +2 -0
  707. package/src/organizations/OrganizationTransferOwnershipDialog.tsx +1 -1
  708. package/src/organizations/__tests__/MyOrganizations.browser.spec.tsx +2 -1
  709. package/src/shell/ButtonInbox.tsx +11 -1
  710. package/src/shell/DetailLayout.tsx +27 -5
  711. package/src/shell/DetailLayoutTabMenu.tsx +89 -0
  712. package/src/shell/PlateLayout.tsx +18 -9
  713. package/src/shell/__tests__/ButtonInbox.browser.spec.tsx +40 -0
  714. package/src/shell/__tests__/DetailLayout.browser.spec.tsx +36 -1
  715. package/src/shell/__tests__/PlateLayout.browser.spec.tsx +19 -2
  716. package/src/sortable/__tests__/useSortableList.browser.spec.tsx +157 -0
  717. package/src/sortable/index.ts +22 -0
  718. package/src/sortable/useSortableItem.ts +65 -0
  719. package/src/sortable/useSortableList.ts +231 -0
  720. package/src/styles.css +43 -0
  721. package/src/table/DataTable.tsx +73 -7
  722. package/src/table/DataTableBody.tsx +48 -6
  723. package/src/table/DataTableBulkBar.tsx +3 -6
  724. package/src/table/DataTableFooter.tsx +6 -1
  725. package/src/table/DataTableKeyHints.tsx +40 -0
  726. package/src/table/DataTableRowActionGroupItem.tsx +75 -0
  727. package/src/table/DataTableRowActionItem.tsx +6 -0
  728. package/src/table/DataTableRowActionPrimary.tsx +52 -0
  729. package/src/table/DataTableRowActionsInline.tsx +19 -3
  730. package/src/table/DataTableRowActionsMenu.tsx +33 -49
  731. package/src/table/DataTableSortMenuButton.tsx +105 -0
  732. package/src/table/DataTableToolbar.tsx +9 -0
  733. package/src/table/__tests__/DataTableColumnPriority.browser.spec.tsx +147 -0
  734. package/src/table/__tests__/DataTableDenseHeader.browser.spec.tsx +92 -0
  735. package/src/table/__tests__/DataTableKeyboard.browser.spec.tsx +216 -0
  736. package/src/table/__tests__/DataTablePersistenceStorage.browser.spec.tsx +204 -0
  737. package/src/table/__tests__/DataTableRowActionGroup.browser.spec.tsx +118 -1
  738. package/src/table/__tests__/DataTableRowActionPrimary.browser.spec.tsx +126 -0
  739. package/src/table/__tests__/DataTableSortMenu.browser.spec.tsx +126 -0
  740. package/src/table/__tests__/DataTableStaticLoading.browser.spec.tsx +80 -0
  741. package/src/table/dataTableBaseProps.ts +94 -2
  742. package/src/table/dataTablePersistence.ts +118 -32
  743. package/src/table/dataTablePriority.ts +34 -0
  744. package/src/table/dataTableTypes.ts +159 -3
  745. package/src/table/index.ts +19 -1
  746. package/src/table/useDataTableColumns.ts +9 -4
  747. package/src/table/useDataTableData.ts +13 -4
  748. package/src/table/useDataTableFilterForm.ts +6 -2
  749. package/src/table/useDataTableFilterVisibility.ts +20 -7
  750. package/src/table/useDataTableKeyboard.ts +231 -0
  751. package/src/table/useDataTableRefresh.ts +4 -2
  752. package/src/table/useDataTableSummary.ts +25 -8
  753. package/src/table/useElementWidth.ts +35 -0
  754. package/src/tree/TreeViewRow.tsx +4 -12
  755. package/src/tree/__tests__/TreeView.browser.spec.tsx +27 -12
  756. package/dist/core/Tabs.d.ts +0 -15
  757. package/dist/core/Tabs.d.ts.map +0 -1
  758. package/dist/core/Tabs.js +0 -50
  759. package/dist/core/Tabs.js.map +0 -1
  760. package/src/core/Tabs.tsx +0 -86
  761. package/src/core/__tests__/Tabs.browser.spec.tsx +0 -23
@@ -1,6 +1,6 @@
1
- import { Badge } from "../core/Badge.js";
2
1
  import { useI18n } from "alepha/react/i18n";
3
2
  import { Lock, LockOpen, ShieldCheck, ShieldX } from "lucide-react";
3
+ import { Badge } from "../core/Badge.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/swagger/SwaggerAccessBadge.tsx
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { Badge } from "../core/Badge.js";
2
1
  import { useI18n } from "alepha/react/i18n";
3
2
  import { Clock, KeyRound, Layers, ShieldCheck, TriangleAlert } from "lucide-react";
3
+ import { Badge } from "../core/Badge.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/swagger/SwaggerAlephaMeta.tsx
6
6
  /**
@@ -1,8 +1,8 @@
1
- import { Control } from "../form/Control.js";
2
- import { useI18n } from "alepha/react/i18n";
3
- import { jsx } from "react/jsx-runtime";
4
1
  import { z } from "alepha";
5
2
  import { useForm } from "alepha/react/form";
3
+ import { useI18n } from "alepha/react/i18n";
4
+ import { Control } from "../form/Control.js";
5
+ import { jsx } from "react/jsx-runtime";
6
6
  // src/swagger/SwaggerCredentials.tsx
7
7
  const credentialFieldSchema = z.object({ token: z.string().optional() });
8
8
  /**
@@ -1,3 +1,8 @@
1
+ import { AlephaError } from "alepha";
2
+ import { useQuery } from "alepha/react";
3
+ import { useI18n } from "alepha/react/i18n";
4
+ import { ChevronRight, FileJson, KeyRound } from "lucide-react";
5
+ import { useCallback, useEffect, useMemo, useState } from "react";
1
6
  import { Alert, AlertDescription, AlertTitle } from "../core/Alert.js";
2
7
  import { Badge } from "../core/Badge.js";
3
8
  import { Skeleton } from "../core/Skeleton.js";
@@ -8,12 +13,7 @@ import { SwaggerNav } from "./SwaggerNav.js";
8
13
  import { SwaggerOperationView } from "./SwaggerOperationView.js";
9
14
  import { SwaggerTryIt } from "./SwaggerTryIt.js";
10
15
  import { useSwaggerAccess } from "./useSwaggerAccess.js";
11
- import { useQuery } from "alepha/react";
12
- import { useI18n } from "alepha/react/i18n";
13
- import { ChevronRight, FileJson, KeyRound } from "lucide-react";
14
- import { useCallback, useEffect, useMemo, useState } from "react";
15
16
  import { jsx, jsxs } from "react/jsx-runtime";
16
- import { AlephaError } from "alepha";
17
17
  // src/swagger/SwaggerExplorer.tsx
18
18
  /**
19
19
  * The API explorer: the operations of an OpenAPI document by tag on the
@@ -1,8 +1,8 @@
1
+ import { useI18n } from "alepha/react/i18n";
2
+ import { Lock, Search } from "lucide-react";
1
3
  import { InputGroup, InputGroupAddon, InputGroupInput } from "../core/InputGroup.js";
2
4
  import { cn } from "../core/utils.js";
3
5
  import { SwaggerMethodBadge } from "./SwaggerMethodBadge.js";
4
- import { useI18n } from "alepha/react/i18n";
5
- import { Lock, Search } from "lucide-react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  // src/swagger/SwaggerNav.tsx
8
8
  /**
@@ -1,3 +1,5 @@
1
+ import { useI18n } from "alepha/react/i18n";
2
+ import { Lock } from "lucide-react";
1
3
  import { Badge } from "../core/Badge.js";
2
4
  import { SwaggerAlephaMeta } from "./SwaggerAlephaMeta.js";
3
5
  import { SwaggerMethodBadge } from "./SwaggerMethodBadge.js";
@@ -5,8 +7,6 @@ import { SwaggerParameters } from "./SwaggerParameters.js";
5
7
  import { SwaggerResponses } from "./SwaggerResponses.js";
6
8
  import { SwaggerSchemaView } from "./SwaggerSchemaView.js";
7
9
  import { SwaggerSection } from "./SwaggerSection.js";
8
- import { useI18n } from "alepha/react/i18n";
9
- import { Lock } from "lucide-react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  // src/swagger/SwaggerOperationView.tsx
12
12
  /**
@@ -1,7 +1,7 @@
1
- import { Badge } from "../core/Badge.js";
2
- import { Spinner } from "../core/Spinner.js";
3
1
  import { useI18n } from "alepha/react/i18n";
4
2
  import { ChevronRight } from "lucide-react";
3
+ import { Badge } from "../core/Badge.js";
4
+ import { Spinner } from "../core/Spinner.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  // src/swagger/SwaggerResponseView.tsx
7
7
  /**
@@ -1,6 +1,6 @@
1
+ import { ChevronRight } from "lucide-react";
1
2
  import { Badge } from "../core/Badge.js";
2
3
  import { SwaggerSchemaView } from "./SwaggerSchemaView.js";
3
- import { ChevronRight } from "lucide-react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/swagger/SwaggerResponses.tsx
6
6
  /**
@@ -1,6 +1,6 @@
1
+ import { useI18n } from "alepha/react/i18n";
1
2
  import { cn } from "../core/utils.js";
2
3
  import { SwaggerSchemaViewField } from "./SwaggerSchemaViewField.js";
3
- import { useI18n } from "alepha/react/i18n";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/swagger/SwaggerSchemaView.tsx
6
6
  /**
@@ -1,9 +1,9 @@
1
+ import { useI18n } from "alepha/react/i18n";
2
+ import { useMemo, useState } from "react";
1
3
  import { Segmented } from "../core/Segmented.js";
2
4
  import { SwaggerRequestBuilder } from "./SwaggerRequestBuilder.js";
3
5
  import { SwaggerResponseView } from "./SwaggerResponseView.js";
4
6
  import { SwaggerTryItForm } from "./SwaggerTryItForm.js";
5
- import { useI18n } from "alepha/react/i18n";
6
- import { useMemo, useState } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  // src/swagger/SwaggerTryIt.tsx
9
9
  /**
@@ -1,10 +1,10 @@
1
- import { AutoForm } from "../form/AutoForm.js";
1
+ import { DateTimeProvider } from "alepha/datetime";
2
2
  import { useInject } from "alepha/react";
3
+ import { useForm } from "alepha/react/form";
3
4
  import { useI18n } from "alepha/react/i18n";
4
5
  import { useEffect, useRef } from "react";
6
+ import { AutoForm } from "../form/AutoForm.js";
5
7
  import { jsx } from "react/jsx-runtime";
6
- import { useForm } from "alepha/react/form";
7
- import { DateTimeProvider } from "alepha/datetime";
8
8
  // src/swagger/SwaggerTryItForm.tsx
9
9
  /**
10
10
  * The request form of one operation in one body mode, and the send.
@@ -1,7 +1,7 @@
1
1
  import { useAlepha, useStore } from "alepha/react";
2
- import { useCallback } from "react";
3
- import { LinkProvider } from "alepha/server/links";
4
2
  import { currentUserAtom } from "alepha/security";
3
+ import { LinkProvider } from "alepha/server/links";
4
+ import { useCallback } from "react";
5
5
  // src/swagger/useSwaggerAccess.ts
6
6
  /**
7
7
  * Answers {@link SwaggerAccess} for each operation, against the current user.
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/table/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAsBlE,OAAO,KAAK,EAEV,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EAKhB,MAAM,qBAAqB,CAAC;AAY7B,MAAM,MAAM,cAAc,CACxB,CAAC,EACD,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,IACvD,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,CAAC,EACD,KAAK,CAAC,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,SAExD,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,sBAg2B5B,CAAC"}
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/table/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAyBlE,OAAO,KAAK,EAEV,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EAKhB,MAAM,qBAAqB,CAAC;AAc7B,MAAM,MAAM,cAAc,CACxB,CAAC,EACD,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,IACvD,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,CAAC,EACD,KAAK,CAAC,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,SAExD,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,sBA65B5B,CAAC"}
@@ -1,3 +1,7 @@
1
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { ClientOnly, useAlepha } from "alepha/react";
4
+ import { useI18n } from "alepha/react/i18n";
1
5
  import { Table, TableHeader } from "../core/Table.js";
2
6
  import { useIsMobile } from "../core/useIsMobile.js";
3
7
  import { useToast } from "../core/useToast.js";
@@ -11,9 +15,12 @@ import { DataTableFooter, PAGE_SIZES } from "./DataTableFooter.js";
11
15
  import { DataTableHeaderFilter } from "./DataTableHeaderFilter.js";
12
16
  import { DataTableHeaderPopup } from "./DataTableHeaderPopup.js";
13
17
  import { DataTableHeaderRow } from "./DataTableHeaderRow.js";
18
+ import { DataTableKeyHints } from "./DataTableKeyHints.js";
14
19
  import { persistedColumns, persistedOrder, persistedSize, persistedSort } from "./dataTablePersistence.js";
15
20
  import { DataTablePresetRail } from "./DataTablePresetRail.js";
16
21
  import { isEmptyFilterValue } from "./dataTablePresets.js";
22
+ import { fitColumnsToWidth } from "./dataTablePriority.js";
23
+ import { DataTableSortMenuButton } from "./DataTableSortMenuButton.js";
17
24
  import { DATA_TABLE_SQUARE_RIGHT } from "./dataTableSquareRight.js";
18
25
  import { DataTableSummaryPanel } from "./DataTableSummaryPanel.js";
19
26
  import { DataTableToolbar } from "./DataTableToolbar.js";
@@ -22,15 +29,13 @@ import { useDataTableColumns } from "./useDataTableColumns.js";
22
29
  import { useDataTableData } from "./useDataTableData.js";
23
30
  import { useDataTableFilterForm } from "./useDataTableFilterForm.js";
24
31
  import { useDataTableFilterVisibility } from "./useDataTableFilterVisibility.js";
32
+ import { useDataTableKeyboard } from "./useDataTableKeyboard.js";
25
33
  import { useDataTableRefresh } from "./useDataTableRefresh.js";
26
34
  import { useDataTableSummary } from "./useDataTableSummary.js";
27
35
  import { useDataTableWake } from "./useDataTableWake.js";
36
+ import { useElementWidth } from "./useElementWidth.js";
28
37
  import { useOptimisticRows } from "./useOptimisticRows.js";
29
38
  import { useTableSelection } from "./useTableSelection.js";
30
- import { ClientOnly, useAlepha } from "alepha/react";
31
- import { useI18n } from "alepha/react/i18n";
32
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
33
- import { jsx, jsxs } from "react/jsx-runtime";
34
39
  // src/table/DataTable.tsx
35
40
  /**
36
41
  * A data table: server-side or static rows, sorting, filters, row and bulk
@@ -66,7 +71,7 @@ const DataTable = (props) => {
66
71
  const columnsKey = props.persist?.columns === false ? void 0 : props.persistenceKey;
67
72
  const sortKey = props.persist?.sort === false ? void 0 : props.persistenceKey;
68
73
  const sizeKey = props.pageSizes?.length === 0 ? void 0 : props.persistenceKey;
69
- const [size, setSize] = useState(() => persistedSize(sizeKey, props.defaultSize));
74
+ const [size, setSize] = useState(() => persistedSize(sizeKey, props.defaultSize, props.persistenceStorage));
70
75
  const alepha = useAlepha();
71
76
  const { tr } = useI18n();
72
77
  const toast = useToast();
@@ -100,7 +105,8 @@ const DataTable = (props) => {
100
105
  }, [alepha, form]);
101
106
  const filterVisibility = useDataTableFilterVisibility({
102
107
  definition: filterDefinition,
103
- filtersKey
108
+ filtersKey,
109
+ persistenceStorage: props.persistenceStorage
104
110
  });
105
111
  const headerFilters = {};
106
112
  const popupFilters = {};
@@ -135,7 +141,7 @@ const DataTable = (props) => {
135
141
  onShownChange: filterVisibility.setShown
136
142
  });
137
143
  };
138
- const { page, setPage, sizeForm, sort, setSort, data: serverData, meta, rowFilters, groupCounts, loading, loadedRequestId, lastRequestId, isStatic, refreshKey, setRefreshKey, isRefreshing, setIsRefreshing, toggleSort, setSortTo } = useDataTableData({
144
+ const { page, setPage, sizeForm, sort, setSort, data: serverData, meta, rowFilters, groupCounts, loading, loadedRequestId, lastRequestId, isStatic, refreshKey, setRefreshKey, isRefreshing, setIsRefreshing, toggleSort, setSortTo, applySort } = useDataTableData({
139
145
  props: untyped,
140
146
  size,
141
147
  setSize,
@@ -168,6 +174,7 @@ const DataTable = (props) => {
168
174
  const summary = useDataTableSummary({
169
175
  summary: untyped.summary,
170
176
  persistenceKey: props.persistenceKey,
177
+ persistenceStorage: props.persistenceStorage,
171
178
  refreshKey,
172
179
  form,
173
180
  alepha
@@ -223,6 +230,11 @@ const DataTable = (props) => {
223
230
  const rowKey = useCallback((item) => rowKeyByItem.get(item) ?? "", [rowKeyByItem]);
224
231
  const { selection, selectedItems, allSelected, someSelected, toggleRow, toggleAll, clearSelection } = useTableSelection(data, rowKey);
225
232
  const rootRef = useRef(null);
233
+ const [rootElement, setRootElement] = useState(null);
234
+ const setRoot = useCallback((element) => {
235
+ rootRef.current = element;
236
+ setRootElement(element);
237
+ }, []);
226
238
  useDataTableWake({
227
239
  enabled: props.refreshOnFocus === true && !isStatic,
228
240
  loadedRequestId,
@@ -275,18 +287,31 @@ const DataTable = (props) => {
275
287
  if (scopeRef.current !== props.persistenceKey) {
276
288
  scopeRef.current = props.persistenceKey;
277
289
  setPage(0);
278
- setSize(persistedSize(sizeKey, props.defaultSize));
279
- setSort(persistedSort(sortKey, props.defaultSort));
280
- setVisibleColumns(persistedColumns(columnsKey, props.columns));
281
- setColumnOrder(persistedOrder(columnsKey, props.columns));
290
+ const storage = props.persistenceStorage;
291
+ setSize(persistedSize(sizeKey, props.defaultSize, storage));
292
+ setSort(persistedSort(sortKey, props.defaultSort, storage));
293
+ setVisibleColumns(persistedColumns(columnsKey, props.columns, storage));
294
+ setColumnOrder(persistedOrder(columnsKey, props.columns, storage));
282
295
  filterVisibility.rereadShown(filtersKey);
283
296
  summary.resetScope(props.persistenceKey);
284
297
  clearSelection();
285
298
  setRefreshKey((k) => k + 1);
286
299
  }
287
- const visibleCols = orderedKeys.map((key) => [key, props.columns[key]]).filter(([key]) => visibleColumns.has(key));
300
+ const cols = orderedKeys.map((key) => [key, props.columns[key]]);
301
+ const hasPriorities = Object.values(props.columns).some((def) => def.priority !== void 0);
302
+ const tableWidth = useElementWidth(rootElement, hasPriorities);
303
+ const visibleCols = fitColumnsToWidth(cols.filter(([key]) => visibleColumns.has(key)), tableWidth, props.priorityWidths);
288
304
  const hasCheckbox = Boolean(props.bulkActions?.length);
289
305
  const hasRowActions = Boolean(props.rowActions);
306
+ const keyboard = useDataTableKeyboard({
307
+ keyboard: props.keyboard,
308
+ root: rootRef,
309
+ data,
310
+ rowKeys,
311
+ onRowClick: props.onRowClick,
312
+ canSelect: hasCheckbox,
313
+ toggleRow
314
+ });
290
315
  const rowCtx = useMemo(() => ({
291
316
  refresh,
292
317
  reload,
@@ -353,7 +378,7 @@ const DataTable = (props) => {
353
378
  const canResetFilters = hasActiveFilters || filterVisibility.differsFromDeclaration;
354
379
  const isEmptyState = !loading && data.length === 0;
355
380
  const hasHelp = props.help != null && props.help !== false && props.help !== "";
356
- const showToolbar = !props.hideToolbar && (Boolean(props.filters) || Boolean(props.leading) || Boolean(props.toolbar) || Boolean(props.actions?.length) || hasHelp || !props.hideColumnPicker || !props.hideActionsMenu);
381
+ const showToolbar = !props.hideToolbar && (Boolean(props.filters) || Boolean(props.leading) || Boolean(props.toolbar) || Boolean(props.sortMenu?.items.length) || Boolean(props.actions?.length) || hasHelp || !props.hideColumnPicker || !props.hideActionsMenu);
357
382
  const rawSummaryContent = props.summary?.content;
358
383
  const summaryContent = typeof rawSummaryContent === "function" ? rawSummaryContent({ refreshKey }) : rawSummaryContent;
359
384
  const hasSummaryContent = summaryContent != null && summaryContent !== false && summaryContent !== "";
@@ -402,7 +427,7 @@ const DataTable = (props) => {
402
427
  filterVisibility.setShown([.../* @__PURE__ */ new Set([...filterVisibility.shown, ...setting])].filter((key) => filterDefinition.modes[key] !== "locked"), true);
403
428
  };
404
429
  const table = /* @__PURE__ */ jsxs("div", {
405
- ref: rootRef,
430
+ ref: setRoot,
406
431
  className: cn("flex flex-col gap-2", rail ? "min-h-0 min-w-0 flex-1 [&>*]:rounded-s-none" : props.className),
407
432
  children: [
408
433
  props.header && /* @__PURE__ */ jsx("div", {
@@ -434,6 +459,11 @@ const DataTable = (props) => {
434
459
  canResetFilters,
435
460
  leading: props.leading,
436
461
  toolbar: props.toolbar,
462
+ sortControl: props.sortMenu?.items.length ? /* @__PURE__ */ jsx(DataTableSortMenuButton, {
463
+ menu: props.sortMenu,
464
+ sort,
465
+ onSort: applySort
466
+ }) : void 0,
437
467
  actions: props.actions,
438
468
  help: hasHelp ? props.help : void 0,
439
469
  isMobile,
@@ -461,7 +491,8 @@ const DataTable = (props) => {
461
491
  /* @__PURE__ */ jsx("div", {
462
492
  className: cn("bg-card flex min-h-0 flex-1 flex-col overflow-auto rounded-md border", (showToolbar || showSummary) && "-mt-2 rounded-t-none border-t-0", showFooter ? "rounded-b-none border-b-0" : squareRight?.bottom, flatRows, !showToolbar && !showSummary && squareRight?.top, "[&>[data-slot=table-container]]:grow"),
463
493
  children: /* @__PURE__ */ jsxs(Table, {
464
- className: cn(isEmptyState && "h-full", compact && "text-xs [&_th]:text-xs"),
494
+ className: cn(isEmptyState && "h-full", compact && "text-xs [&_th]:text-xs", props.denseHeader && "[&_tbody_tr]:border-b [&_th]:h-10 [&_th]:text-[11.5px] [&_th]:font-semibold [&_th]:tracking-wide [&_th]:uppercase [&_th_button]:tracking-wide [&_th_button]:uppercase"),
495
+ "data-dense-header": props.denseHeader || void 0,
465
496
  children: [/* @__PURE__ */ jsx(TableHeader, {
466
497
  className: cn("bg-muted sticky top-0 z-10 [&_th]:shadow-[inset_0_1px_0_0_var(--bevel),inset_0_-1px_0_0_var(--border)] [&_tr]:border-b-0", props.chromeClassName),
467
498
  children: /* @__PURE__ */ jsx(DataTableHeaderRow, {
@@ -500,6 +531,8 @@ const DataTable = (props) => {
500
531
  rowActionsDisplay: props.rowActionsDisplay,
501
532
  striped: props.striped,
502
533
  onRowClick: props.onRowClick,
534
+ focusedKey: keyboard.focusedKey,
535
+ onRowFocus: keyboard.enabled ? keyboard.focusRow : void 0,
503
536
  isRowActive: props.isRowActive,
504
537
  onRowHover: props.onRowHover,
505
538
  empty: props.empty,
@@ -520,12 +553,17 @@ const DataTable = (props) => {
520
553
  meta,
521
554
  setPage
522
555
  }),
556
+ keyboard.hints && !showFooter && !isMobile && /* @__PURE__ */ jsx(DataTableKeyHints, {
557
+ hints: keyboard.hints,
558
+ className: "px-1"
559
+ }),
523
560
  showFooter && /* @__PURE__ */ jsx(DataTableFooter, {
524
561
  pageSizes: props.pageSizes,
525
562
  sizeForm,
526
563
  meta,
527
564
  isMobile,
528
565
  setPage,
566
+ hints: keyboard.hints && !isMobile ? /* @__PURE__ */ jsx(DataTableKeyHints, { hints: keyboard.hints }) : void 0,
529
567
  className: cn(squareRight?.bottom, flatBottom, props.chromeClassName)
530
568
  })
531
569
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.js","names":[],"sources":["../../src/table/DataTable.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { ClientOnly, useAlepha } from \"alepha/react\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { Table, TableHeader } from \"../core/Table.tsx\";\nimport { useIsMobile } from \"../core/useIsMobile.ts\";\nimport { useToast } from \"../core/useToast.tsx\";\nimport { cn } from \"../core/utils.ts\";\nimport type { DataTableBaseProps } from \"./dataTableBaseProps.ts\";\nimport { DataTableBody } from \"./DataTableBody.tsx\";\nimport { DataTableBulkBar } from \"./DataTableBulkBar.tsx\";\nimport { DATA_TABLE_CELL_PADDING } from \"./dataTableCellPadding.ts\";\nimport { DataTableCompactPager } from \"./DataTableCompactPager.tsx\";\nimport type { DataTableFilterBarField } from \"./DataTableFilterBar.tsx\";\nimport { dataTableFilterBarFields } from \"./dataTableFilterFields.ts\";\nimport { DataTableFooter, PAGE_SIZES } from \"./DataTableFooter.tsx\";\nimport { DataTableHeaderFilter } from \"./DataTableHeaderFilter.tsx\";\nimport { DataTableHeaderPopup } from \"./DataTableHeaderPopup.tsx\";\nimport { DataTableHeaderRow } from \"./DataTableHeaderRow.tsx\";\nimport {\n persistedColumns,\n persistedOrder,\n persistedSize,\n persistedSort,\n} from \"./dataTablePersistence.ts\";\nimport { DataTablePresetRail } from \"./DataTablePresetRail.tsx\";\nimport { isEmptyFilterValue } from \"./dataTablePresets.ts\";\nimport { DATA_TABLE_SQUARE_RIGHT } from \"./dataTableSquareRight.ts\";\nimport { DataTableSummaryPanel } from \"./DataTableSummaryPanel.tsx\";\nimport { DataTableToolbar } from \"./DataTableToolbar.tsx\";\nimport type {\n DataTableCellContext,\n DataTableFilterFields,\n DataTableNoFilterFields,\n DataTableSource,\n DataTableStatCard,\n BulkActionContext,\n ColumnDef,\n RowActionContext,\n} from \"./dataTableTypes.ts\";\nimport { cleanFilterValues } from \"./queryFilters.ts\";\nimport { useDataTableColumns } from \"./useDataTableColumns.ts\";\nimport { useDataTableData } from \"./useDataTableData.ts\";\nimport { useDataTableFilterForm } from \"./useDataTableFilterForm.ts\";\nimport { useDataTableFilterVisibility } from \"./useDataTableFilterVisibility.ts\";\nimport { useDataTableRefresh } from \"./useDataTableRefresh.ts\";\nimport { useDataTableSummary } from \"./useDataTableSummary.ts\";\nimport { useDataTableWake } from \"./useDataTableWake.ts\";\nimport { useOptimisticRows } from \"./useOptimisticRows.ts\";\nimport { useTableSelection } from \"./useTableSelection.ts\";\n\nexport type DataTableProps<\n T,\n F extends DataTableFilterFields = DataTableNoFilterFields,\n> = DataTableBaseProps<T, F> & DataTableSource<T, F>;\n\n/**\n * A data table: server-side or static rows, sorting, filters, row and bulk\n * actions, persisted preferences.\n *\n * `T` is the row. `F` is the type of `filters.fields`, written as\n * `typeof filterFields` beside the row type, which is what types `fetch`'s\n * filters, the `data` predicate, `initialValues`, `seedValues` and\n * `fromQuery`. It defaults to no filters at all, so a table given `fields`\n * without it does not compile.\n */\nexport const DataTable = <\n T,\n const F extends DataTableFilterFields = DataTableNoFilterFields,\n>(\n props: DataTableProps<T, F>,\n) => {\n /**\n * The props, with their filters read untyped. The parts below enumerate\n * filter keys at runtime and never read one by name, so the type of `F` is\n * the call site's business and one cast here keeps it out of every hook.\n */\n const untyped = props as unknown as DataTableProps<T, DataTableFilterFields>;\n\n /**\n * `persistenceKey`, once per facet.\n *\n * A facet that is off gets `undefined`, which is the same value every\n * persistence helper here already treats as \"do not store\" - so turning one\n * off takes the branch a table with no key has always taken, rather than a\n * new one. That is what keeps the default behaviour of `persistenceKey`\n * exactly as it was: with `persist` absent, all three of these ARE\n * `props.persistenceKey`.\n *\n * Primitives, so they go straight into the dependency arrays and `useState`\n * initializers below without giving any of them a new identity per render.\n */\n const filtersKey =\n props.persist?.filters === false ? undefined : props.persistenceKey;\n const columnsKey =\n props.persist?.columns === false ? undefined : props.persistenceKey;\n const sortKey =\n props.persist?.sort === false ? undefined : props.persistenceKey;\n // `pageSizes={[]}` hides the picker, and with it the reader's say in the\n // size: a size stored while the picker was still there must not outlive\n // it, or a reader who once chose 50 is stuck at 50 with no control left to\n // change it. The call site's `defaultSize` is the size, full stop.\n const sizeKey =\n props.pageSizes?.length === 0 ? undefined : props.persistenceKey;\n\n // State, not a constant. It was `props.defaultSize ?? 20` read once, so a\n // reader had no way to see more rows than the call site had decided for\n // them. Already in `load`'s dependency array, so changing it refetches.\n const [size, setSize] = useState<number>(() =>\n persistedSize(sizeKey, props.defaultSize),\n );\n const alepha = useAlepha();\n const { tr } = useI18n();\n const toast = useToast();\n /**\n * The whole of the phone layout, and deliberately one switch rather than a\n * scattering of `max-md:` classes: the filter controls have to be rendered\n * in exactly ONE of the two places (see `DataTableFilterDialog`), which\n * CSS cannot express. Everything else below the breakpoint follows the same\n * flag so the two halves of the layout cannot disagree.\n *\n * Safe against hydration because the whole table sits inside `ClientOnly`,\n * and `useIsMobile` reads the same `MediaQueryList` it subscribes to.\n */\n const isMobile = useIsMobile();\n\n const { form, definition: filterDefinition } = useDataTableFilterForm({\n props: untyped,\n filtersKey,\n alepha,\n });\n\n // `filters.onChange` (#Q3779): every value on mount, then after each\n // change. Read through a ref so a new callback each render neither\n // resubscribes nor fires.\n const onFiltersChange = useRef(untyped.filters?.onChange);\n onFiltersChange.current = untyped.filters?.onChange;\n // The current filter values as state too, so a summary tile standing for\n // some of them (`DataTableStatCard.filter`) redraws pressed or not.\n const [filterValues, setFilterValues] = useState<Record<string, unknown>>(\n () => ({ ...form?.currentValues }),\n );\n useEffect(() => {\n if (!form) return;\n onFiltersChange.current?.({ ...form.currentValues });\n // No `setFilterValues` here: the state starts from the form's values,\n // and every change after that comes through the event below.\n return alepha.events.on(\"form:changed\", (event) => {\n if (event.id !== form.id) return;\n onFiltersChange.current?.({ ...form.currentValues });\n setFilterValues({ ...form.currentValues });\n });\n }, [alepha, form]);\n\n const filterVisibility = useDataTableFilterVisibility({\n definition: filterDefinition,\n filtersKey,\n });\n\n // The filters that sit in a column's header, by column: the first field\n // naming a column wins it. Only for the bar the table draws itself - a\n // caller's `filters.render` owns where its filters go, and the bar's rule\n // that a set filter shows on it is what makes a header filter safe.\n const headerFilters: Record<string, DataTableFilterBarField> = {};\n // Under `headerPopup`, every field naming a column, so a `min` / `max`\n // pair lands in one popup.\n const popupFilters: Record<string, DataTableFilterBarField[]> = {};\n if (untyped.filters && !untyped.filters.render && filterDefinition) {\n for (const field of dataTableFilterBarFields(\n untyped.filters.fields,\n filterDefinition,\n )) {\n if (!field.column || field.hidden) continue;\n if (!(field.column in headerFilters)) headerFilters[field.column] = field;\n const fields = (popupFilters[field.column] ??= []);\n const ranged = field.range !== undefined;\n if (fields.length === 0 || (ranged && fields.every((f) => f.range))) {\n fields.push(field);\n }\n }\n }\n const headerPopup = props.headerPopup\n ? (columnKey: string, def: ColumnDef<T>) => {\n const fields = form ? (popupFilters[columnKey] ?? []) : [];\n if (fields.length === 0 && !def.sortable) return undefined;\n const field = def.sortKey ?? columnKey;\n return (\n <DataTableHeaderPopup\n form={form ?? undefined}\n label={def.label}\n hinted={Boolean(def.hint)}\n fields={fields}\n sortable={Boolean(def.sortable)}\n sorted={sort?.field === field ? sort.direction : null}\n onSort={(direction) => setSortTo(columnKey, def, direction)}\n />\n );\n }\n : undefined;\n const headerFilter = (columnKey: string) => {\n const field = headerFilters[columnKey];\n if (!field || !form) return undefined;\n return (\n <DataTableHeaderFilter\n form={form}\n field={field}\n shown={filterVisibility.shown}\n onShownChange={filterVisibility.setShown}\n />\n );\n };\n\n const {\n page,\n setPage,\n sizeForm,\n sort,\n setSort,\n data: serverData,\n meta,\n rowFilters,\n groupCounts,\n loading,\n loadedRequestId,\n lastRequestId,\n isStatic,\n refreshKey,\n setRefreshKey,\n isRefreshing,\n setIsRefreshing,\n toggleSort,\n setSortTo,\n } = useDataTableData({\n props: untyped,\n size,\n setSize,\n sortKey,\n form,\n alepha,\n });\n\n // `onPage`: the page on screen and how many there are, whenever either\n // moves. Through a ref so an inline callback does not re-fire it.\n const onPageRef = useRef(props.onPage);\n onPageRef.current = props.onPage;\n const totalPages = meta?.totalPages ?? 0;\n useEffect(() => {\n onPageRef.current?.({ page, totalPages });\n }, [page, totalPages]);\n\n const {\n refresh,\n reload,\n handleRefreshClick,\n resetFilters,\n canShare,\n shareFilters,\n } = useDataTableRefresh({\n props: untyped,\n form,\n filterKeys: filterDefinition?.keys ?? [],\n resetShownFilters: filterVisibility.resetShown,\n filtersKey,\n alepha,\n toast,\n tr,\n setPage,\n setRefreshKey,\n setIsRefreshing,\n });\n\n const summary = useDataTableSummary({\n summary: untyped.summary,\n persistenceKey: props.persistenceKey,\n refreshKey,\n form,\n alepha,\n });\n\n // -- Row identity ----------------------------------------------------------\n\n /**\n * A row's key, in order of preference: the caller's `rowKey`, the row's own\n * `id`, then where the row sits.\n *\n * The last one used to be `Math.random()`, which is not an identity at all.\n * Every render produced a new key, so React saw every id-less row as a new\n * row and remounted it: focus in an inline input was lost the moment\n * anything else re-rendered, and the list re-animated on every keystroke.\n * Selection was broken by the same thing - `selection.has(rowKey(item))`\n * compared against a key generated one render earlier, so it never matched.\n */\n /**\n * A row's key from the row alone, so a row redrawn by an optimistic patch\n * (a new object) keeps the key of the one it replaces.\n */\n const keyOf = useCallback(\n (item: T, index: number): string => {\n if (props.rowKey) return props.rowKey(item);\n const id = (item as { id?: unknown })?.id;\n // Coercion at a boundary: the value is a form/route/chart primitive\n // whose declared type is wider than what can reach here.\n // oxlint-disable-next-line typescript/no-base-to-string -- a coercion at a boundary, see the comment above\n return id != null ? String(id) : `page-${page}-row-${index}`;\n },\n [page, props.rowKey],\n );\n\n const serverRowKeys = useMemo(\n () => serverData.map((item, index) => keyOf(item, index)),\n [serverData, keyOf],\n );\n\n // -- Optimistic overlay ----------------------------------------------------\n\n const serverKeyByItem = useMemo(() => {\n const map = new Map<T, string>();\n serverData.forEach((item, index) => map.set(item, serverRowKeys[index]));\n return map;\n }, [serverData, serverRowKeys]);\n\n const overlayKey = useCallback(\n (item: T) => serverKeyByItem.get(item) ?? keyOf(item, -1),\n [serverKeyByItem, keyOf],\n );\n\n const overlay = useOptimisticRows<T>({\n data: serverData,\n rowKeys: serverRowKeys,\n rowKey: overlayKey,\n loadedRequestId,\n lastRequestId,\n reload,\n isStatic,\n });\n const data = overlay.data;\n const rowKeys = overlay.rowKeys;\n\n /**\n * Selection asks for a key by item, not by index. Every item it can ask\n * about is one of `data`'s, so a lookup keyed on identity covers it without\n * an O(n) scan per call.\n */\n const rowKeyByItem = useMemo(() => {\n const map = new Map<T, string>();\n data.forEach((item, index) => map.set(item, rowKeys[index]));\n return map;\n }, [data, rowKeys]);\n\n const rowKey = useCallback(\n (item: T): string => rowKeyByItem.get(item) ?? \"\",\n [rowKeyByItem],\n );\n\n // -- Selection -------------------------------------------------------------\n\n const {\n selection,\n selectedItems,\n allSelected,\n someSelected,\n toggleRow,\n toggleAll,\n clearSelection,\n } = useTableSelection(data, rowKey);\n\n // Back on the tab: a background reload, unless the rows are fresh or the\n // reader is mid-selection or mid-edit (#Q4069).\n const rootRef = useRef<HTMLDivElement | null>(null);\n useDataTableWake({\n enabled: props.refreshOnFocus === true && !isStatic,\n loadedRequestId,\n freshMs: 10_000,\n selecting: selection.size > 0,\n root: rootRef,\n reload,\n });\n\n // The bulk actions offered for THIS selection: an action's `visible`\n // predicate reads the selected rows. Computed once, here, so the pill's\n // contents and the pill's own presence come from the same list.\n const visibleBulkActions = useMemo(\n () =>\n (props.bulkActions ?? []).filter(\n (action) => action.visible?.(selectedItems) ?? true,\n ),\n [props.bulkActions, selectedItems],\n );\n\n const {\n allColumnKeys,\n visibleColumns,\n setVisibleColumns,\n orderedKeys,\n setColumnOrder,\n moveColumn,\n reorderColumn,\n toggleColumn,\n orderAnnouncement,\n } = useDataTableColumns({ props: untyped, columnsKey, tr });\n\n /**\n * ⚠️ A changed `persistenceKey` is a changed SCOPE, and this is where that\n * is handled.\n *\n * Every caller encodes its scope in that key - `lor.activity.${project.id}`,\n * `lor.epics.${project.id}` - so switching project changes it. Nothing acted\n * on that before, and `load` re-runs only on `[page, size, sortParam,\n * refreshKey, form, alepha]`, none of which a project switch touches. The\n * router does not remount on a param-only navigation either, so the table\n * kept serving the PREVIOUS project's rows under the new project's name\n * (feedback #2096).\n *\n * `refreshKey` is bumped rather than relying on the re-read: two projects\n * can share a stored sort and size, and then no dependency of `load` would\n * change and nothing would refetch. That equality is the bug's whole\n * mechanism, so the refetch cannot be a side effect of the values moving.\n *\n * ⚠️ Adjusted during RENDER, not in an effect, and that is load-bearing.\n * React re-renders before committing this, so no frame, no fetch and no\n * effect ever sees the OUTGOING scope's state under the INCOMING key. The\n * sort used to be written by an effect keyed on `persistenceKey`, which\n * would have stored the project you just left over the one you just\n * opened; every write is now the reader's own act.\n *\n * ⚠️ `props.fetch` is still NOT a dependency of `load`. That is the loop\n * `fetchRef` exists to prevent, and several callers write a store atom from\n * inside their fetcher.\n *\n * Filter VALUES are deliberately not reset here: `useForm` captures its\n * `initialValues` once, so resetting them is form surgery rather than a\n * state assignment. They are also not clobbered - the filter-persist effect\n * writes only on `form:changed` / `form:submit:success`, never on mount - so\n * the stored filters of the project you left stay its own.\n */\n const scopeRef = useRef(props.persistenceKey);\n if (scopeRef.current !== props.persistenceKey) {\n scopeRef.current = props.persistenceKey;\n setPage(0);\n setSize(persistedSize(sizeKey, props.defaultSize));\n setSort(persistedSort(sortKey, props.defaultSort));\n setVisibleColumns(persistedColumns(columnsKey, props.columns));\n // Same render pass as the rest, and for the identical reason: the effects\n // keyed on `persistenceKey` fire in one flush, so an order left behind\n // here would be written back under the INCOMING key.\n setColumnOrder(persistedOrder(columnsKey, props.columns));\n // Which filters are on the bar is the scope's too, and read here for the\n // same reason: the project just opened must not show the bar of the one\n // just left.\n filterVisibility.rereadShown(filtersKey);\n // The panel's open state is the scope's like the size is, and its cards\n // are the scope's figures: they go now, and the bump below refetches.\n summary.resetScope(props.persistenceKey);\n // The selection is the scope's rows: a bulk action after the switch must\n // not receive rows of the project just left, off screen by now.\n clearSelection();\n setRefreshKey((k) => k + 1);\n }\n\n // -- Render ---------------------------------------------------------------\n\n // The reader's order, not the declaration's.\n const cols = orderedKeys.map((key) => [key, props.columns[key]!]) as Array<\n [string, ColumnDef<T>]\n >;\n const visibleCols = cols.filter(([key]) => visibleColumns.has(key));\n const hasCheckbox = Boolean(props.bulkActions?.length);\n const hasRowActions = Boolean(props.rowActions);\n\n const rowCtx: RowActionContext<T> = useMemo(\n () => ({ refresh, reload, clearSelection, optimistic: overlay.optimistic }),\n [refresh, reload, clearSelection, overlay.optimistic],\n );\n const bulkCtx: BulkActionContext<T> = useMemo(\n () => ({ refresh, reload, clearSelection, optimistic: overlay.optimistic }),\n [refresh, reload, clearSelection, overlay.optimistic],\n );\n\n /**\n * How many filters currently narrow the list: a count rather than the\n * boolean this used to be, because on a phone the bar is behind a button\n * and the trigger's badge is the only thing that says the table is\n * filtered at all.\n */\n const activeFilterCount = useMemo(() => {\n if (!props.filters || !form) return 0;\n return Object.keys(cleanFilterValues(form.currentValues ?? {})).length;\n }, [props.filters, form, refreshKey]);\n const hasActiveFilters = activeFilterCount > 0;\n /**\n * Whether the filters are the table's declared default view\n * (`initialValues`), such as an inbox that opens on `status: open`. An\n * empty page there means the list has nothing, so its `emptyMessage`\n * still applies (#Q3820): only a filter the reader set is a \"no match\".\n */\n const filtersAtDefault = useMemo(() => {\n if (!props.filters || !form) return true;\n const canonical = (values: Record<string, unknown>) => {\n const clean = cleanFilterValues(values);\n return JSON.stringify(\n Object.keys(clean)\n .sort()\n .map((key) => [key, clean[key]]),\n );\n };\n return (\n canonical(form.currentValues ?? {}) ===\n canonical((props.filters.initialValues ?? {}) as Record<string, unknown>)\n );\n }, [props.filters, form, refreshKey]);\n\n // What every cell is told beside its row: the search the rows on screen\n // answer, from the first `preset: \"search\"` field holding one.\n const searchKey = Object.entries(props.filters?.fields ?? {}).find(\n ([, field]) => field.preset === \"search\",\n )?.[0];\n const rowSearch = searchKey ? rowFilters?.[searchKey] : undefined;\n const cellContext: DataTableCellContext = {\n search:\n typeof rowSearch === \"string\" && rowSearch.trim() !== \"\"\n ? rowSearch.trim()\n : undefined,\n };\n /**\n * Whether Reset filters would change anything: a value set, or a bar that\n * is not the one the table declares. Not the count alone, or a reader who\n * removed a default filter would have no way to bring it back.\n */\n const canResetFilters =\n hasActiveFilters || filterVisibility.differsFromDeclaration;\n\n // The empty state is showing, as opposed to the skeleton that also renders\n // on `data.length === 0`. Read by the `<Table>` height as well as the body,\n // so the two cannot disagree.\n const isEmptyState = !loading && data.length === 0;\n\n // A node that draws nothing is no help and no content: the `?` and the\n // band would open on an empty card. Decided here, once, and handed down\n // as `undefined` when it is empty.\n const hasHelp =\n props.help != null && props.help !== false && props.help !== \"\";\n const showToolbar =\n !props.hideToolbar &&\n (Boolean(props.filters) ||\n Boolean(props.leading) ||\n Boolean(props.toolbar) ||\n Boolean(props.actions?.length) ||\n hasHelp ||\n !props.hideColumnPicker ||\n !props.hideActionsMenu);\n // Drawn while a first fetch is out (its placeholders), and after that only\n // with something in it: a summary with no card and no content is no band.\n // A function is called on every render, which only builds its element: the\n // panel mounts it while open, and the counter is what tells it to reload.\n const rawSummaryContent = props.summary?.content;\n const summaryContent =\n typeof rawSummaryContent === \"function\"\n ? rawSummaryContent({ refreshKey })\n : rawSummaryContent;\n const hasSummaryContent =\n summaryContent != null && summaryContent !== false && summaryContent !== \"\";\n const showSummary =\n Boolean(props.summary) &&\n (summary.cards === undefined ||\n summary.cards.length > 0 ||\n hasSummaryContent);\n // `density=\"compact\"` defaults the padding to `small` and the type to\n // `text-xs`; an explicit `cellPadding` keeps the padding half its own.\n const compact = props.density === \"compact\";\n const cellPadding =\n DATA_TABLE_CELL_PADDING[\n props.cellPadding ?? (compact ? \"small\" : \"normal\")\n ];\n const squareRight = props.squareRight\n ? DATA_TABLE_SQUARE_RIGHT[`${props.squareRight}`]\n : undefined;\n // `flat` drops the outer frame and keeps the lines between the bands: the\n // toolbar keeps its bottom border, the footer its top one, and the rows\n // lose the sides. Applied after `squareRight`, which has nothing left to\n // square once the corners are gone.\n const flatTop = props.flat && \"rounded-none border-x-0 border-t-0\";\n const flatRows =\n props.flat && \"rounded-none border-x-0 border-t-0 border-b-0\";\n const flatBottom = props.flat && \"rounded-none border-x-0 border-b-0\";\n // The footer holds two controls, the size picker and the page links, and\n // the count beside them. A table that hid the picker (`pageSizes={[]}`)\n // and fits on one page has neither, and \"Page 1 of 1\" alone is a bar\n // saying nothing, so it goes. The links' condition is the footer's own.\n // `pagination={false}` holds for static rows only: a fetched table is\n // paged by the server, and hiding its pager would hide rows.\n const unpaged = props.pagination === false && Boolean(props.data);\n // `\"compact\"` swaps the footer for the small pager under the rows, for a\n // static and a fetched table alike: rows stay reachable, the band goes.\n const compactPager = props.pagination === \"compact\";\n const showFooter =\n !unpaged &&\n !compactPager &&\n ((props.pageSizes ?? PAGE_SIZES).length > 0 ||\n Boolean(meta?.totalPages && meta.totalPages > 1));\n const showColumnPicker = !props.hideColumnPicker && allColumnKeys.length > 0;\n const showActionsMenu = !props.hideActionsMenu;\n\n // The presets rail (`filters.presets`), from `md` up: on a phone the\n // filter dialog is the table's whole filter surface.\n const presets = untyped.filters?.presets;\n const rail =\n presets &&\n presets.items.length > 0 &&\n form &&\n filterDefinition &&\n !isMobile ? (\n <DataTablePresetRail\n form={form}\n keys={filterDefinition.keys}\n kept={filterDefinition.kept}\n presets={presets}\n onApply={(preset) => {\n const values = preset.values as Record<string, unknown>;\n const inputs = form.input as unknown as Record<\n string,\n { set?: (value: unknown) => void } | undefined\n >;\n const kept = filterDefinition.kept;\n const current = (form.currentValues ?? {}) as Record<string, unknown>;\n // Every key but the kept ones (`keepOnPreset`), so a preset is\n // the whole filter: what it does not name is cleared, the way\n // Reset filters clears it.\n for (const key of filterDefinition.keys) {\n if (kept.includes(key)) continue;\n inputs[key]?.set?.(values[key]);\n }\n // The bar then shows the preset's filters, and a kept one still\n // holding a value, and nothing else.\n filterVisibility.setShown(\n [\n ...Object.keys(values).filter(\n (key) =>\n !kept.includes(key) && !isEmptyFilterValue(values[key]),\n ),\n ...kept.filter((key) => !isEmptyFilterValue(current[key])),\n ].filter((key) => filterDefinition.modes[key] !== \"locked\"),\n true,\n );\n }}\n onAll={resetFilters}\n className={cn(\n // `flat`: no frame of its own either, only the line between the\n // rail and the rows, which the table's flattened start edge no\n // longer draws.\n props.flat && \"rounded-none border-y-0 border-s-0 border-e\",\n props.chromeClassName,\n )}\n />\n ) : undefined;\n\n // A summary tile standing for filter values (`DataTableStatCard.filter`):\n // a click sets them and shows them on the bar, or clears them when they\n // all hold already.\n const selectCard = (card: DataTableStatCard) => {\n if (!form || !filterDefinition || !card.filter) return;\n const inputs = form.input as unknown as Record<\n string,\n { set?: (value: unknown) => void } | undefined\n >;\n const keys = Object.keys(card.filter).filter((key) =>\n filterDefinition.keys.includes(key),\n );\n if (isCardActive(card, filterValues)) {\n for (const key of keys) inputs[key]?.set?.(undefined);\n return;\n }\n for (const key of keys) inputs[key]?.set?.(card.filter[key]);\n // A key the tile clears (`undefined`) adds no chip to the bar.\n const setting = keys.filter((key) => card.filter?.[key] !== undefined);\n filterVisibility.setShown(\n [...new Set([...filterVisibility.shown, ...setting])].filter(\n (key) => filterDefinition.modes[key] !== \"locked\",\n ),\n true,\n );\n };\n\n const table = (\n <div\n ref={rootRef}\n className={cn(\n \"flex flex-col gap-2\",\n // Beside the rail the table and the rail are one panel: every band\n // squares its start corners against the rail's squared end ones.\n rail ? \"min-h-0 min-w-0 flex-1 [&>*]:rounded-s-none\" : props.className,\n )}\n >\n {props.header && (\n <div className=\"flex items-center gap-2\">\n <div className=\"min-w-0 flex-1\">{props.header}</div>\n </div>\n )}\n\n {/*\n The summary opens the frame when it is there, so it takes the top\n corners `squareRight` squares, and whatever follows it (the filter\n bar, or the rows when there is none) joins under it the way the rows\n join the filter bar: flattened top, no top border, `-mt-2` against\n the wrapper's gap. The panel's own bottom border is the line\n between them.\n */}\n\n {showSummary && (\n <DataTableSummaryPanel\n title={\n props.summary?.title ??\n tr(\"dataTable.summary\", { default: \"Summary\" })\n }\n open={summary.open}\n onOpenChange={summary.setOpen}\n cards={summary.cards}\n isActive={(card) => isCardActive(card, filterValues)}\n onSelect={form && filterDefinition ? selectCard : undefined}\n loading={summary.loading}\n content={hasSummaryContent ? summaryContent : undefined}\n className={cn(squareRight?.top, flatTop, props.chromeClassName)}\n />\n )}\n\n {showToolbar && (\n <DataTableToolbar<T>\n columns={props.columns}\n filters={untyped.filters}\n form={form}\n filterDefinition={filterDefinition}\n shownFilters={filterVisibility.shown}\n headerPopup={props.headerPopup}\n onShownFiltersChange={filterVisibility.setShown}\n canResetFilters={canResetFilters}\n leading={props.leading}\n toolbar={props.toolbar}\n actions={props.actions}\n help={hasHelp ? props.help : undefined}\n isMobile={isMobile}\n showColumnPicker={showColumnPicker}\n showActionsMenu={showActionsMenu}\n activeFilterCount={activeFilterCount}\n canShare={canShare}\n resetFilters={resetFilters}\n shareFilters={shareFilters}\n orderedKeys={orderedKeys}\n visibleColumns={visibleColumns}\n toggleColumn={toggleColumn}\n reorderColumn={reorderColumn}\n isRefreshing={isRefreshing}\n handleRefreshClick={handleRefreshClick}\n className={cn(\n showSummary ? \"-mt-2 rounded-t-none border-t-0\" : squareRight?.top,\n flatTop,\n props.chromeClassName,\n )}\n />\n )}\n\n {hasCheckbox && selection.size > 0 && visibleBulkActions.length > 0 && (\n <DataTableBulkBar<T>\n selection={selection}\n selectedItems={selectedItems}\n visibleBulkActions={visibleBulkActions}\n bulkCtx={bulkCtx}\n clearSelection={clearSelection}\n />\n )}\n\n {/*\n The toolbar, the rows and the footer are one panel: each facing edge\n is flattened and its border dropped so no double line appears, and\n `-mt-2` cancels the wrapper's `gap-2`. The footer half follows\n `showFooter`, which is true for every table that keeps its size\n picker: gating the footer on `meta` alone would pop the bar in and\n flip this bottom border on every load, since `meta` starts null and\n only fills after the fetch. Only a table that hid the picker can\n lose it, and then the rows close the panel themselves.\n */}\n <div\n className={cn(\n // `bg-card`: the rows are content between the chrome bands, and\n // keep their own surface on a muted page (a Plate's body) instead\n // of taking the chrome's colour through a transparent panel.\n \"bg-card flex min-h-0 flex-1 flex-col overflow-auto rounded-md border\",\n (showToolbar || showSummary) && \"-mt-2 rounded-t-none border-t-0\",\n showFooter ? \"rounded-b-none border-b-0\" : squareRight?.bottom,\n flatRows,\n // With no toolbar and no summary the rows open the table, so\n // their top-right corner is the one `squareRight` squares.\n !showToolbar && !showSummary && squareRight?.top,\n // `<Table>` wraps the table in a container div whose classes it\n // hardcodes, and only this table needs that container to grow,\n // so the one class it needs is set from out here instead.\n //\n // `grow`, NOT `flex-1`: `flex-1` sets the basis to 0, and in the\n // ordinary case this wrapper has no height of its own, so a 0\n // basis with nothing to grow into collapses the table to nothing.\n // `grow` keeps the content basis and only spends space that is\n // actually free, which is the full-height case.\n \"[&>[data-slot=table-container]]:grow\",\n )}\n >\n {/* `h-full` ONLY while the empty state is what is in the body.\n It is what lets that one row take the height the scroller grew\n into, so `align-middle` can centre the state in it.\n\n ⚠️ Never unconditionally. A CSS table given a height larger\n than its content does not leave the surplus at the bottom, it\n DISTRIBUTES IT ACROSS THE ROWS - so an unconditional `h-full`\n silently turns a short table into a tall one: Lore's Apps page,\n two rows in a full-height pane, rendered them 239px each. No\n unit test sees it (jsdom computes no layout) and it is invisible\n on a table long enough to fill its own container, which is why\n it reached e2e rather than review. */}\n <Table\n className={cn(\n isEmptyState && \"h-full\",\n compact && \"text-xs [&_th]:text-xs\",\n )}\n >\n {/* `bg-muted`, fully opaque, NOT the base header's `bg-muted/50`:\n this header is sticky, so anything translucent lets the rows\n scroll visibly through the column labels. Same tint, no\n transparency.\n\n Two inset lines, not one. The bottom is the divider against the\n first row; the top is the `--bevel` highlight, which is what\n gives the band its thickness. Inset shadows rather than borders\n because a border on a sticky `<thead>` is dropped by the\n collapsed table border model, and because the two lines have to\n sit INSIDE the header's own height: it is pinned at `top-0`\n against a scrolling body, so anything painted outside it is\n painted over.\n\n The lines sit on the cells, not on the `<thead>`: WebKit paints\n no `box-shadow` on a table section, so on Safari the header had\n no bottom line at all. Not `chrome` either, for the same reason,\n and because `cn` does not know `chrome` is a background: it kept\n `TableHeader`'s `bg-muted/50` beside it, which won. */}\n <TableHeader\n className={cn(\n // ⚠️ `[&_tr]:border-b-0` or the bottom rule is drawn TWICE: `TableHeader`\n // gives its rows a `border-b`, and the inset shadow draws the\n // same line, so the band closed with 2px where it opens with\n // 1px. The inset one wins because it is what survives the sticky\n // header being painted over.\n \"bg-muted sticky top-0 z-10 [&_th]:shadow-[inset_0_1px_0_0_var(--bevel),inset_0_-1px_0_0_var(--border)] [&_tr]:border-b-0\",\n props.chromeClassName,\n )}\n >\n <DataTableHeaderRow<T>\n headClassName={cellPadding.head}\n visibleCols={visibleCols}\n hasCheckbox={hasCheckbox}\n hasRowActions={hasRowActions}\n allSelected={allSelected}\n someSelected={someSelected}\n toggleAll={toggleAll}\n sort={sort}\n toggleSort={toggleSort}\n setSortTo={setSortTo}\n moveColumn={moveColumn}\n toggleColumn={toggleColumn}\n headerFilter={headerFilter}\n headerPopup={headerPopup}\n />\n </TableHeader>\n <DataTableBody<T>\n cellClassName={cellPadding.cell}\n data={data}\n cellContext={cellContext}\n rowKeys={rowKeys}\n leaving={overlay.leaving}\n flash={overlay.flash}\n loading={loading}\n visibleCols={visibleCols}\n hasCheckbox={hasCheckbox}\n hasRowActions={hasRowActions}\n hasActiveFilters={hasActiveFilters}\n filtersAtDefault={filtersAtDefault}\n selection={selection}\n toggleRow={toggleRow}\n rowCtx={rowCtx}\n rowActions={props.rowActions}\n rowActionsDisplay={props.rowActionsDisplay}\n striped={props.striped}\n onRowClick={props.onRowClick}\n isRowActive={props.isRowActive}\n onRowHover={props.onRowHover}\n empty={props.empty}\n emptyMessage={props.emptyMessage}\n emptyState={props.emptyState}\n noMatchState={props.noMatchState}\n groupBy={props.groupBy}\n groupCounts={groupCounts}\n />\n </Table>\n </div>\n\n {/* A move is otherwise silent: nothing about a reordered table is\n spoken, and the visual change is the only feedback. Outside the\n table so it is not read as a cell. */}\n <span aria-live=\"polite\" className=\"sr-only\">\n {orderAnnouncement}\n </span>\n\n {compactPager && <DataTableCompactPager meta={meta} setPage={setPage} />}\n\n {showFooter && (\n <DataTableFooter\n pageSizes={props.pageSizes}\n sizeForm={sizeForm}\n meta={meta}\n isMobile={isMobile}\n setPage={setPage}\n className={cn(squareRight?.bottom, flatBottom, props.chromeClassName)}\n />\n )}\n </div>\n );\n\n return (\n <ClientOnly>\n {rail ? (\n <div className={cn(\"flex min-h-0\", props.className)}>\n {rail}\n {table}\n </div>\n ) : (\n table\n )}\n </ClientOnly>\n );\n};\n\n/**\n * Whether every filter value a summary tile stands for holds now. Compared\n * as JSON, so an array value matches the same members in the same order; an\n * `undefined` value (the tile clears that filter) holds while the field is\n * empty: unset, `\"\"` or an emptied multi-select.\n */\nconst isCardActive = (\n card: DataTableStatCard,\n values: Record<string, unknown>,\n): boolean => {\n if (!card.filter) return false;\n const entries = Object.entries(card.filter);\n const empty = (value: unknown) =>\n value === undefined ||\n value === null ||\n value === \"\" ||\n (Array.isArray(value) && value.length === 0);\n return (\n entries.length > 0 &&\n entries.every(([key, value]) =>\n value === undefined\n ? empty(values[key])\n : JSON.stringify(values[key]) === JSON.stringify(value),\n )\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,MAAa,aAIX,UACG;;;;;;CAMH,MAAM,UAAU;;;;;;;;;;;;;;CAehB,MAAM,aACJ,MAAM,SAAS,YAAY,QAAQ,KAAA,IAAY,MAAM;CACvD,MAAM,aACJ,MAAM,SAAS,YAAY,QAAQ,KAAA,IAAY,MAAM;CACvD,MAAM,UACJ,MAAM,SAAS,SAAS,QAAQ,KAAA,IAAY,MAAM;CAKpD,MAAM,UACJ,MAAM,WAAW,WAAW,IAAI,KAAA,IAAY,MAAM;CAKpD,MAAM,CAAC,MAAM,WAAW,eACtB,cAAc,SAAS,MAAM,WAAW,CAC1C;CACA,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,QAAQ,SAAS;;;;;;;;;;;CAWvB,MAAM,WAAW,YAAY;CAE7B,MAAM,EAAE,MAAM,YAAY,qBAAqB,uBAAuB;EACpE,OAAO;EACP;EACA;CACF,CAAC;CAKD,MAAM,kB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KL,oBAAC,QAAD;IAAM,aAAU;IAAS,WAAU;IAChC,UAAA;GACG,CAAA;GAEL,gBAAgB,oBAAC,uBAAD;IAA6B;IAAe;GAAU,CAAA;GAEtE,cACC,oBAAC,iBAAD;IACE,WAAW,MAAM;IACP;IACJ;IACI;IACD;IACT,WAAW,GAAG,aAAa,QAAQ,YAAY,MAAM,eAAe;GACrE,CAAA;EAEA;;CAGP,OACE,oBAAC,YAAD,EAAA,UACG,OACC,qBAAC,OAAD;EAAK,WAAW,GAAG,gBAAgB,MAAM,SAAS;EAAlD,UAAA,CACG,MACA,KACE;CAEL,CAAA,IAAA,MAEQ,CAAA;AAEhB;;;;;;;AAQA,MAAM,gBACJ,MACA,WACY;CACZ,IAAI,CAAC,KAAK,QAAQ,OAAO;CACzB,MAAM,UAAU,OAAO,QAAQ,KAAK,MAAM;CAC1C,MAAM,SAAS,UACb,UAAU,KAAA,KACV,UAAU,QACV,UAAU,MACT,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW;CAC5C,OACE,QAAQ,SAAS,KACjB,QAAQ,OAAO,CAAC,KAAK,WACnB,UAAU,KAAA,IACN,MAAM,OAAO,IAAI,IACjB,KAAK,UAAU,OAAO,IAAI,MAAM,KAAK,UAAU,KAAK,CAC1D;AAEJ"}
1
+ {"version":3,"file":"DataTable.js","names":[],"sources":["../../src/table/DataTable.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { ClientOnly, useAlepha } from \"alepha/react\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { Table, TableHeader } from \"../core/Table.tsx\";\nimport { useIsMobile } from \"../core/useIsMobile.ts\";\nimport { useToast } from \"../core/useToast.tsx\";\nimport { cn } from \"../core/utils.ts\";\nimport type { DataTableBaseProps } from \"./dataTableBaseProps.ts\";\nimport { DataTableBody } from \"./DataTableBody.tsx\";\nimport { DataTableBulkBar } from \"./DataTableBulkBar.tsx\";\nimport { DATA_TABLE_CELL_PADDING } from \"./dataTableCellPadding.ts\";\nimport { DataTableCompactPager } from \"./DataTableCompactPager.tsx\";\nimport type { DataTableFilterBarField } from \"./DataTableFilterBar.tsx\";\nimport { dataTableFilterBarFields } from \"./dataTableFilterFields.ts\";\nimport { DataTableFooter, PAGE_SIZES } from \"./DataTableFooter.tsx\";\nimport { DataTableHeaderFilter } from \"./DataTableHeaderFilter.tsx\";\nimport { DataTableHeaderPopup } from \"./DataTableHeaderPopup.tsx\";\nimport { DataTableHeaderRow } from \"./DataTableHeaderRow.tsx\";\nimport { DataTableKeyHints } from \"./DataTableKeyHints.tsx\";\nimport {\n persistedColumns,\n persistedOrder,\n persistedSize,\n persistedSort,\n} from \"./dataTablePersistence.ts\";\nimport { DataTablePresetRail } from \"./DataTablePresetRail.tsx\";\nimport { isEmptyFilterValue } from \"./dataTablePresets.ts\";\nimport { fitColumnsToWidth } from \"./dataTablePriority.ts\";\nimport { DataTableSortMenuButton } from \"./DataTableSortMenuButton.tsx\";\nimport { DATA_TABLE_SQUARE_RIGHT } from \"./dataTableSquareRight.ts\";\nimport { DataTableSummaryPanel } from \"./DataTableSummaryPanel.tsx\";\nimport { DataTableToolbar } from \"./DataTableToolbar.tsx\";\nimport type {\n DataTableCellContext,\n DataTableFilterFields,\n DataTableNoFilterFields,\n DataTableSource,\n DataTableStatCard,\n BulkActionContext,\n ColumnDef,\n RowActionContext,\n} from \"./dataTableTypes.ts\";\nimport { cleanFilterValues } from \"./queryFilters.ts\";\nimport { useDataTableColumns } from \"./useDataTableColumns.ts\";\nimport { useDataTableData } from \"./useDataTableData.ts\";\nimport { useDataTableFilterForm } from \"./useDataTableFilterForm.ts\";\nimport { useDataTableFilterVisibility } from \"./useDataTableFilterVisibility.ts\";\nimport { useDataTableKeyboard } from \"./useDataTableKeyboard.ts\";\nimport { useDataTableRefresh } from \"./useDataTableRefresh.ts\";\nimport { useDataTableSummary } from \"./useDataTableSummary.ts\";\nimport { useDataTableWake } from \"./useDataTableWake.ts\";\nimport { useElementWidth } from \"./useElementWidth.ts\";\nimport { useOptimisticRows } from \"./useOptimisticRows.ts\";\nimport { useTableSelection } from \"./useTableSelection.ts\";\n\nexport type DataTableProps<\n T,\n F extends DataTableFilterFields = DataTableNoFilterFields,\n> = DataTableBaseProps<T, F> & DataTableSource<T, F>;\n\n/**\n * A data table: server-side or static rows, sorting, filters, row and bulk\n * actions, persisted preferences.\n *\n * `T` is the row. `F` is the type of `filters.fields`, written as\n * `typeof filterFields` beside the row type, which is what types `fetch`'s\n * filters, the `data` predicate, `initialValues`, `seedValues` and\n * `fromQuery`. It defaults to no filters at all, so a table given `fields`\n * without it does not compile.\n */\nexport const DataTable = <\n T,\n const F extends DataTableFilterFields = DataTableNoFilterFields,\n>(\n props: DataTableProps<T, F>,\n) => {\n /**\n * The props, with their filters read untyped. The parts below enumerate\n * filter keys at runtime and never read one by name, so the type of `F` is\n * the call site's business and one cast here keeps it out of every hook.\n */\n const untyped = props as unknown as DataTableProps<T, DataTableFilterFields>;\n\n /**\n * `persistenceKey`, once per facet.\n *\n * A facet that is off gets `undefined`, which is the same value every\n * persistence helper here already treats as \"do not store\" - so turning one\n * off takes the branch a table with no key has always taken, rather than a\n * new one. That is what keeps the default behaviour of `persistenceKey`\n * exactly as it was: with `persist` absent, all three of these ARE\n * `props.persistenceKey`.\n *\n * Primitives, so they go straight into the dependency arrays and `useState`\n * initializers below without giving any of them a new identity per render.\n */\n const filtersKey =\n props.persist?.filters === false ? undefined : props.persistenceKey;\n const columnsKey =\n props.persist?.columns === false ? undefined : props.persistenceKey;\n const sortKey =\n props.persist?.sort === false ? undefined : props.persistenceKey;\n // `pageSizes={[]}` hides the picker, and with it the reader's say in the\n // size: a size stored while the picker was still there must not outlive\n // it, or a reader who once chose 50 is stuck at 50 with no control left to\n // change it. The call site's `defaultSize` is the size, full stop.\n const sizeKey =\n props.pageSizes?.length === 0 ? undefined : props.persistenceKey;\n\n // State, not a constant. It was `props.defaultSize ?? 20` read once, so a\n // reader had no way to see more rows than the call site had decided for\n // them. Already in `load`'s dependency array, so changing it refetches.\n const [size, setSize] = useState<number>(() =>\n persistedSize(sizeKey, props.defaultSize, props.persistenceStorage),\n );\n const alepha = useAlepha();\n const { tr } = useI18n();\n const toast = useToast();\n /**\n * The whole of the phone layout, and deliberately one switch rather than a\n * scattering of `max-md:` classes: the filter controls have to be rendered\n * in exactly ONE of the two places (see `DataTableFilterDialog`), which\n * CSS cannot express. Everything else below the breakpoint follows the same\n * flag so the two halves of the layout cannot disagree.\n *\n * Safe against hydration because the whole table sits inside `ClientOnly`,\n * and `useIsMobile` reads the same `MediaQueryList` it subscribes to.\n */\n const isMobile = useIsMobile();\n\n const { form, definition: filterDefinition } = useDataTableFilterForm({\n props: untyped,\n filtersKey,\n alepha,\n });\n\n // `filters.onChange` (#Q3779): every value on mount, then after each\n // change. Read through a ref so a new callback each render neither\n // resubscribes nor fires.\n const onFiltersChange = useRef(untyped.filters?.onChange);\n onFiltersChange.current = untyped.filters?.onChange;\n // The current filter values as state too, so a summary tile standing for\n // some of them (`DataTableStatCard.filter`) redraws pressed or not.\n const [filterValues, setFilterValues] = useState<Record<string, unknown>>(\n () => ({ ...form?.currentValues }),\n );\n useEffect(() => {\n if (!form) return;\n onFiltersChange.current?.({ ...form.currentValues });\n // No `setFilterValues` here: the state starts from the form's values,\n // and every change after that comes through the event below.\n return alepha.events.on(\"form:changed\", (event) => {\n if (event.id !== form.id) return;\n onFiltersChange.current?.({ ...form.currentValues });\n setFilterValues({ ...form.currentValues });\n });\n }, [alepha, form]);\n\n const filterVisibility = useDataTableFilterVisibility({\n definition: filterDefinition,\n filtersKey,\n persistenceStorage: props.persistenceStorage,\n });\n\n // The filters that sit in a column's header, by column: the first field\n // naming a column wins it. Only for the bar the table draws itself - a\n // caller's `filters.render` owns where its filters go, and the bar's rule\n // that a set filter shows on it is what makes a header filter safe.\n const headerFilters: Record<string, DataTableFilterBarField> = {};\n // Under `headerPopup`, every field naming a column, so a `min` / `max`\n // pair lands in one popup.\n const popupFilters: Record<string, DataTableFilterBarField[]> = {};\n if (untyped.filters && !untyped.filters.render && filterDefinition) {\n for (const field of dataTableFilterBarFields(\n untyped.filters.fields,\n filterDefinition,\n )) {\n if (!field.column || field.hidden) continue;\n if (!(field.column in headerFilters)) headerFilters[field.column] = field;\n const fields = (popupFilters[field.column] ??= []);\n const ranged = field.range !== undefined;\n if (fields.length === 0 || (ranged && fields.every((f) => f.range))) {\n fields.push(field);\n }\n }\n }\n const headerPopup = props.headerPopup\n ? (columnKey: string, def: ColumnDef<T>) => {\n const fields = form ? (popupFilters[columnKey] ?? []) : [];\n if (fields.length === 0 && !def.sortable) return undefined;\n const field = def.sortKey ?? columnKey;\n return (\n <DataTableHeaderPopup\n form={form ?? undefined}\n label={def.label}\n hinted={Boolean(def.hint)}\n fields={fields}\n sortable={Boolean(def.sortable)}\n sorted={sort?.field === field ? sort.direction : null}\n onSort={(direction) => setSortTo(columnKey, def, direction)}\n />\n );\n }\n : undefined;\n const headerFilter = (columnKey: string) => {\n const field = headerFilters[columnKey];\n if (!field || !form) return undefined;\n return (\n <DataTableHeaderFilter\n form={form}\n field={field}\n shown={filterVisibility.shown}\n onShownChange={filterVisibility.setShown}\n />\n );\n };\n\n const {\n page,\n setPage,\n sizeForm,\n sort,\n setSort,\n data: serverData,\n meta,\n rowFilters,\n groupCounts,\n loading,\n loadedRequestId,\n lastRequestId,\n isStatic,\n refreshKey,\n setRefreshKey,\n isRefreshing,\n setIsRefreshing,\n toggleSort,\n setSortTo,\n applySort,\n } = useDataTableData({\n props: untyped,\n size,\n setSize,\n sortKey,\n form,\n alepha,\n });\n\n // `onPage`: the page on screen and how many there are, whenever either\n // moves. Through a ref so an inline callback does not re-fire it.\n const onPageRef = useRef(props.onPage);\n onPageRef.current = props.onPage;\n const totalPages = meta?.totalPages ?? 0;\n useEffect(() => {\n onPageRef.current?.({ page, totalPages });\n }, [page, totalPages]);\n\n const {\n refresh,\n reload,\n handleRefreshClick,\n resetFilters,\n canShare,\n shareFilters,\n } = useDataTableRefresh({\n props: untyped,\n form,\n filterKeys: filterDefinition?.keys ?? [],\n resetShownFilters: filterVisibility.resetShown,\n filtersKey,\n alepha,\n toast,\n tr,\n setPage,\n setRefreshKey,\n setIsRefreshing,\n });\n\n const summary = useDataTableSummary({\n summary: untyped.summary,\n persistenceKey: props.persistenceKey,\n persistenceStorage: props.persistenceStorage,\n refreshKey,\n form,\n alepha,\n });\n\n // -- Row identity ----------------------------------------------------------\n\n /**\n * A row's key, in order of preference: the caller's `rowKey`, the row's own\n * `id`, then where the row sits.\n *\n * The last one used to be `Math.random()`, which is not an identity at all.\n * Every render produced a new key, so React saw every id-less row as a new\n * row and remounted it: focus in an inline input was lost the moment\n * anything else re-rendered, and the list re-animated on every keystroke.\n * Selection was broken by the same thing - `selection.has(rowKey(item))`\n * compared against a key generated one render earlier, so it never matched.\n */\n /**\n * A row's key from the row alone, so a row redrawn by an optimistic patch\n * (a new object) keeps the key of the one it replaces.\n */\n const keyOf = useCallback(\n (item: T, index: number): string => {\n if (props.rowKey) return props.rowKey(item);\n const id = (item as { id?: unknown })?.id;\n // Coercion at a boundary: the value is a form/route/chart primitive\n // whose declared type is wider than what can reach here.\n // oxlint-disable-next-line typescript/no-base-to-string -- a coercion at a boundary, see the comment above\n return id != null ? String(id) : `page-${page}-row-${index}`;\n },\n [page, props.rowKey],\n );\n\n const serverRowKeys = useMemo(\n () => serverData.map((item, index) => keyOf(item, index)),\n [serverData, keyOf],\n );\n\n // -- Optimistic overlay ----------------------------------------------------\n\n const serverKeyByItem = useMemo(() => {\n const map = new Map<T, string>();\n serverData.forEach((item, index) => map.set(item, serverRowKeys[index]));\n return map;\n }, [serverData, serverRowKeys]);\n\n const overlayKey = useCallback(\n (item: T) => serverKeyByItem.get(item) ?? keyOf(item, -1),\n [serverKeyByItem, keyOf],\n );\n\n const overlay = useOptimisticRows<T>({\n data: serverData,\n rowKeys: serverRowKeys,\n rowKey: overlayKey,\n loadedRequestId,\n lastRequestId,\n reload,\n isStatic,\n });\n const data = overlay.data;\n const rowKeys = overlay.rowKeys;\n\n /**\n * Selection asks for a key by item, not by index. Every item it can ask\n * about is one of `data`'s, so a lookup keyed on identity covers it without\n * an O(n) scan per call.\n */\n const rowKeyByItem = useMemo(() => {\n const map = new Map<T, string>();\n data.forEach((item, index) => map.set(item, rowKeys[index]));\n return map;\n }, [data, rowKeys]);\n\n const rowKey = useCallback(\n (item: T): string => rowKeyByItem.get(item) ?? \"\",\n [rowKeyByItem],\n );\n\n // -- Selection -------------------------------------------------------------\n\n const {\n selection,\n selectedItems,\n allSelected,\n someSelected,\n toggleRow,\n toggleAll,\n clearSelection,\n } = useTableSelection(data, rowKey);\n\n // Back on the tab: a background reload, unless the rows are fresh or the\n // reader is mid-selection or mid-edit (#Q4069).\n const rootRef = useRef<HTMLDivElement | null>(null);\n // The root as state too, for the width `ColumnDef.priority` reads: the\n // table mounts under `ClientOnly`, after this hook's first effect.\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null);\n const setRoot = useCallback((element: HTMLDivElement | null) => {\n rootRef.current = element;\n setRootElement(element);\n }, []);\n useDataTableWake({\n enabled: props.refreshOnFocus === true && !isStatic,\n loadedRequestId,\n freshMs: 10_000,\n selecting: selection.size > 0,\n root: rootRef,\n reload,\n });\n\n // The bulk actions offered for THIS selection: an action's `visible`\n // predicate reads the selected rows. Computed once, here, so the pill's\n // contents and the pill's own presence come from the same list.\n const visibleBulkActions = useMemo(\n () =>\n (props.bulkActions ?? []).filter(\n (action) => action.visible?.(selectedItems) ?? true,\n ),\n [props.bulkActions, selectedItems],\n );\n\n const {\n allColumnKeys,\n visibleColumns,\n setVisibleColumns,\n orderedKeys,\n setColumnOrder,\n moveColumn,\n reorderColumn,\n toggleColumn,\n orderAnnouncement,\n } = useDataTableColumns({ props: untyped, columnsKey, tr });\n\n /**\n * ⚠️ A changed `persistenceKey` is a changed SCOPE, and this is where that\n * is handled.\n *\n * Every caller encodes its scope in that key - `lor.activity.${project.id}`,\n * `lor.epics.${project.id}` - so switching project changes it. Nothing acted\n * on that before, and `load` re-runs only on `[page, size, sortParam,\n * refreshKey, form, alepha]`, none of which a project switch touches. The\n * router does not remount on a param-only navigation either, so the table\n * kept serving the PREVIOUS project's rows under the new project's name\n * (feedback #2096).\n *\n * `refreshKey` is bumped rather than relying on the re-read: two projects\n * can share a stored sort and size, and then no dependency of `load` would\n * change and nothing would refetch. That equality is the bug's whole\n * mechanism, so the refetch cannot be a side effect of the values moving.\n *\n * ⚠️ Adjusted during RENDER, not in an effect, and that is load-bearing.\n * React re-renders before committing this, so no frame, no fetch and no\n * effect ever sees the OUTGOING scope's state under the INCOMING key. The\n * sort used to be written by an effect keyed on `persistenceKey`, which\n * would have stored the project you just left over the one you just\n * opened; every write is now the reader's own act.\n *\n * ⚠️ `props.fetch` is still NOT a dependency of `load`. That is the loop\n * `fetchRef` exists to prevent, and several callers write a store atom from\n * inside their fetcher.\n *\n * Filter VALUES are deliberately not reset here: `useForm` captures its\n * `initialValues` once, so resetting them is form surgery rather than a\n * state assignment. They are also not clobbered - the filter-persist effect\n * writes only on `form:changed` / `form:submit:success`, never on mount - so\n * the stored filters of the project you left stay its own.\n */\n const scopeRef = useRef(props.persistenceKey);\n if (scopeRef.current !== props.persistenceKey) {\n scopeRef.current = props.persistenceKey;\n setPage(0);\n const storage = props.persistenceStorage;\n setSize(persistedSize(sizeKey, props.defaultSize, storage));\n setSort(persistedSort(sortKey, props.defaultSort, storage));\n setVisibleColumns(persistedColumns(columnsKey, props.columns, storage));\n // Same render pass as the rest, and for the identical reason: the effects\n // keyed on `persistenceKey` fire in one flush, so an order left behind\n // here would be written back under the INCOMING key.\n setColumnOrder(persistedOrder(columnsKey, props.columns, storage));\n // Which filters are on the bar is the scope's too, and read here for the\n // same reason: the project just opened must not show the bar of the one\n // just left.\n filterVisibility.rereadShown(filtersKey);\n // The panel's open state is the scope's like the size is, and its cards\n // are the scope's figures: they go now, and the bump below refetches.\n summary.resetScope(props.persistenceKey);\n // The selection is the scope's rows: a bulk action after the switch must\n // not receive rows of the project just left, off screen by now.\n clearSelection();\n setRefreshKey((k) => k + 1);\n }\n\n // -- Render ---------------------------------------------------------------\n\n // The reader's order, not the declaration's.\n const cols = orderedKeys.map((key) => [key, props.columns[key]!]) as Array<\n [string, ColumnDef<T>]\n >;\n // The reader's columns, less those whose `priority` the table's width\n // sheds: the picker's state is left as it is.\n const hasPriorities = Object.values(props.columns).some(\n (def) => def.priority !== undefined,\n );\n const tableWidth = useElementWidth(rootElement, hasPriorities);\n const visibleCols = fitColumnsToWidth(\n cols.filter(([key]) => visibleColumns.has(key)),\n tableWidth,\n props.priorityWidths,\n );\n const hasCheckbox = Boolean(props.bulkActions?.length);\n const hasRowActions = Boolean(props.rowActions);\n\n const keyboard = useDataTableKeyboard<T>({\n keyboard: props.keyboard,\n root: rootRef,\n data,\n rowKeys,\n onRowClick: props.onRowClick,\n canSelect: hasCheckbox,\n toggleRow,\n });\n\n const rowCtx: RowActionContext<T> = useMemo(\n () => ({ refresh, reload, clearSelection, optimistic: overlay.optimistic }),\n [refresh, reload, clearSelection, overlay.optimistic],\n );\n const bulkCtx: BulkActionContext<T> = useMemo(\n () => ({ refresh, reload, clearSelection, optimistic: overlay.optimistic }),\n [refresh, reload, clearSelection, overlay.optimistic],\n );\n\n /**\n * How many filters currently narrow the list: a count rather than the\n * boolean this used to be, because on a phone the bar is behind a button\n * and the trigger's badge is the only thing that says the table is\n * filtered at all.\n */\n const activeFilterCount = useMemo(() => {\n if (!props.filters || !form) return 0;\n return Object.keys(cleanFilterValues(form.currentValues ?? {})).length;\n }, [props.filters, form, refreshKey]);\n const hasActiveFilters = activeFilterCount > 0;\n /**\n * Whether the filters are the table's declared default view\n * (`initialValues`), such as an inbox that opens on `status: open`. An\n * empty page there means the list has nothing, so its `emptyMessage`\n * still applies (#Q3820): only a filter the reader set is a \"no match\".\n */\n const filtersAtDefault = useMemo(() => {\n if (!props.filters || !form) return true;\n const canonical = (values: Record<string, unknown>) => {\n const clean = cleanFilterValues(values);\n return JSON.stringify(\n Object.keys(clean)\n .sort()\n .map((key) => [key, clean[key]]),\n );\n };\n return (\n canonical(form.currentValues ?? {}) ===\n canonical((props.filters.initialValues ?? {}) as Record<string, unknown>)\n );\n }, [props.filters, form, refreshKey]);\n\n // What every cell is told beside its row: the search the rows on screen\n // answer, from the first `preset: \"search\"` field holding one.\n const searchKey = Object.entries(props.filters?.fields ?? {}).find(\n ([, field]) => field.preset === \"search\",\n )?.[0];\n const rowSearch = searchKey ? rowFilters?.[searchKey] : undefined;\n const cellContext: DataTableCellContext = {\n search:\n typeof rowSearch === \"string\" && rowSearch.trim() !== \"\"\n ? rowSearch.trim()\n : undefined,\n };\n /**\n * Whether Reset filters would change anything: a value set, or a bar that\n * is not the one the table declares. Not the count alone, or a reader who\n * removed a default filter would have no way to bring it back.\n */\n const canResetFilters =\n hasActiveFilters || filterVisibility.differsFromDeclaration;\n\n // The empty state is showing, as opposed to the skeleton that also renders\n // on `data.length === 0`. Read by the `<Table>` height as well as the body,\n // so the two cannot disagree.\n const isEmptyState = !loading && data.length === 0;\n\n // A node that draws nothing is no help and no content: the `?` and the\n // band would open on an empty card. Decided here, once, and handed down\n // as `undefined` when it is empty.\n const hasHelp =\n props.help != null && props.help !== false && props.help !== \"\";\n const showToolbar =\n !props.hideToolbar &&\n (Boolean(props.filters) ||\n Boolean(props.leading) ||\n Boolean(props.toolbar) ||\n Boolean(props.sortMenu?.items.length) ||\n Boolean(props.actions?.length) ||\n hasHelp ||\n !props.hideColumnPicker ||\n !props.hideActionsMenu);\n // Drawn while a first fetch is out (its placeholders), and after that only\n // with something in it: a summary with no card and no content is no band.\n // A function is called on every render, which only builds its element: the\n // panel mounts it while open, and the counter is what tells it to reload.\n const rawSummaryContent = props.summary?.content;\n const summaryContent =\n typeof rawSummaryContent === \"function\"\n ? rawSummaryContent({ refreshKey })\n : rawSummaryContent;\n const hasSummaryContent =\n summaryContent != null && summaryContent !== false && summaryContent !== \"\";\n const showSummary =\n Boolean(props.summary) &&\n (summary.cards === undefined ||\n summary.cards.length > 0 ||\n hasSummaryContent);\n // `density=\"compact\"` defaults the padding to `small` and the type to\n // `text-xs`; an explicit `cellPadding` keeps the padding half its own.\n const compact = props.density === \"compact\";\n const cellPadding =\n DATA_TABLE_CELL_PADDING[\n props.cellPadding ?? (compact ? \"small\" : \"normal\")\n ];\n const squareRight = props.squareRight\n ? DATA_TABLE_SQUARE_RIGHT[`${props.squareRight}`]\n : undefined;\n // `flat` drops the outer frame and keeps the lines between the bands: the\n // toolbar keeps its bottom border, the footer its top one, and the rows\n // lose the sides. Applied after `squareRight`, which has nothing left to\n // square once the corners are gone.\n const flatTop = props.flat && \"rounded-none border-x-0 border-t-0\";\n const flatRows =\n props.flat && \"rounded-none border-x-0 border-t-0 border-b-0\";\n const flatBottom = props.flat && \"rounded-none border-x-0 border-b-0\";\n // The footer holds two controls, the size picker and the page links, and\n // the count beside them. A table that hid the picker (`pageSizes={[]}`)\n // and fits on one page has neither, and \"Page 1 of 1\" alone is a bar\n // saying nothing, so it goes. The links' condition is the footer's own.\n // `pagination={false}` holds for static rows only: a fetched table is\n // paged by the server, and hiding its pager would hide rows.\n const unpaged = props.pagination === false && Boolean(props.data);\n // `\"compact\"` swaps the footer for the small pager under the rows, for a\n // static and a fetched table alike: rows stay reachable, the band goes.\n const compactPager = props.pagination === \"compact\";\n const showFooter =\n !unpaged &&\n !compactPager &&\n ((props.pageSizes ?? PAGE_SIZES).length > 0 ||\n Boolean(meta?.totalPages && meta.totalPages > 1));\n const showColumnPicker = !props.hideColumnPicker && allColumnKeys.length > 0;\n const showActionsMenu = !props.hideActionsMenu;\n\n // The presets rail (`filters.presets`), from `md` up: on a phone the\n // filter dialog is the table's whole filter surface.\n const presets = untyped.filters?.presets;\n const rail =\n presets &&\n presets.items.length > 0 &&\n form &&\n filterDefinition &&\n !isMobile ? (\n <DataTablePresetRail\n form={form}\n keys={filterDefinition.keys}\n kept={filterDefinition.kept}\n presets={presets}\n onApply={(preset) => {\n const values = preset.values as Record<string, unknown>;\n const inputs = form.input as unknown as Record<\n string,\n { set?: (value: unknown) => void } | undefined\n >;\n const kept = filterDefinition.kept;\n const current = (form.currentValues ?? {}) as Record<string, unknown>;\n // Every key but the kept ones (`keepOnPreset`), so a preset is\n // the whole filter: what it does not name is cleared, the way\n // Reset filters clears it.\n for (const key of filterDefinition.keys) {\n if (kept.includes(key)) continue;\n inputs[key]?.set?.(values[key]);\n }\n // The bar then shows the preset's filters, and a kept one still\n // holding a value, and nothing else.\n filterVisibility.setShown(\n [\n ...Object.keys(values).filter(\n (key) =>\n !kept.includes(key) && !isEmptyFilterValue(values[key]),\n ),\n ...kept.filter((key) => !isEmptyFilterValue(current[key])),\n ].filter((key) => filterDefinition.modes[key] !== \"locked\"),\n true,\n );\n }}\n onAll={resetFilters}\n className={cn(\n // `flat`: no frame of its own either, only the line between the\n // rail and the rows, which the table's flattened start edge no\n // longer draws.\n props.flat && \"rounded-none border-y-0 border-s-0 border-e\",\n props.chromeClassName,\n )}\n />\n ) : undefined;\n\n // A summary tile standing for filter values (`DataTableStatCard.filter`):\n // a click sets them and shows them on the bar, or clears them when they\n // all hold already.\n const selectCard = (card: DataTableStatCard) => {\n if (!form || !filterDefinition || !card.filter) return;\n const inputs = form.input as unknown as Record<\n string,\n { set?: (value: unknown) => void } | undefined\n >;\n const keys = Object.keys(card.filter).filter((key) =>\n filterDefinition.keys.includes(key),\n );\n if (isCardActive(card, filterValues)) {\n for (const key of keys) inputs[key]?.set?.(undefined);\n return;\n }\n for (const key of keys) inputs[key]?.set?.(card.filter[key]);\n // A key the tile clears (`undefined`) adds no chip to the bar.\n const setting = keys.filter((key) => card.filter?.[key] !== undefined);\n filterVisibility.setShown(\n [...new Set([...filterVisibility.shown, ...setting])].filter(\n (key) => filterDefinition.modes[key] !== \"locked\",\n ),\n true,\n );\n };\n\n const table = (\n <div\n ref={setRoot}\n className={cn(\n \"flex flex-col gap-2\",\n // Beside the rail the table and the rail are one panel: every band\n // squares its start corners against the rail's squared end ones.\n rail ? \"min-h-0 min-w-0 flex-1 [&>*]:rounded-s-none\" : props.className,\n )}\n >\n {props.header && (\n <div className=\"flex items-center gap-2\">\n <div className=\"min-w-0 flex-1\">{props.header}</div>\n </div>\n )}\n\n {/*\n The summary opens the frame when it is there, so it takes the top\n corners `squareRight` squares, and whatever follows it (the filter\n bar, or the rows when there is none) joins under it the way the rows\n join the filter bar: flattened top, no top border, `-mt-2` against\n the wrapper's gap. The panel's own bottom border is the line\n between them.\n */}\n\n {showSummary && (\n <DataTableSummaryPanel\n title={\n props.summary?.title ??\n tr(\"dataTable.summary\", { default: \"Summary\" })\n }\n open={summary.open}\n onOpenChange={summary.setOpen}\n cards={summary.cards}\n isActive={(card) => isCardActive(card, filterValues)}\n onSelect={form && filterDefinition ? selectCard : undefined}\n loading={summary.loading}\n content={hasSummaryContent ? summaryContent : undefined}\n className={cn(squareRight?.top, flatTop, props.chromeClassName)}\n />\n )}\n\n {showToolbar && (\n <DataTableToolbar<T>\n columns={props.columns}\n filters={untyped.filters}\n form={form}\n filterDefinition={filterDefinition}\n shownFilters={filterVisibility.shown}\n headerPopup={props.headerPopup}\n onShownFiltersChange={filterVisibility.setShown}\n canResetFilters={canResetFilters}\n leading={props.leading}\n toolbar={props.toolbar}\n sortControl={\n props.sortMenu?.items.length ? (\n <DataTableSortMenuButton\n menu={props.sortMenu}\n sort={sort}\n onSort={applySort}\n />\n ) : undefined\n }\n actions={props.actions}\n help={hasHelp ? props.help : undefined}\n isMobile={isMobile}\n showColumnPicker={showColumnPicker}\n showActionsMenu={showActionsMenu}\n activeFilterCount={activeFilterCount}\n canShare={canShare}\n resetFilters={resetFilters}\n shareFilters={shareFilters}\n orderedKeys={orderedKeys}\n visibleColumns={visibleColumns}\n toggleColumn={toggleColumn}\n reorderColumn={reorderColumn}\n isRefreshing={isRefreshing}\n handleRefreshClick={handleRefreshClick}\n className={cn(\n showSummary ? \"-mt-2 rounded-t-none border-t-0\" : squareRight?.top,\n flatTop,\n props.chromeClassName,\n )}\n />\n )}\n\n {hasCheckbox && selection.size > 0 && visibleBulkActions.length > 0 && (\n <DataTableBulkBar<T>\n selection={selection}\n selectedItems={selectedItems}\n visibleBulkActions={visibleBulkActions}\n bulkCtx={bulkCtx}\n clearSelection={clearSelection}\n />\n )}\n\n {/*\n The toolbar, the rows and the footer are one panel: each facing edge\n is flattened and its border dropped so no double line appears, and\n `-mt-2` cancels the wrapper's `gap-2`. The footer half follows\n `showFooter`, which is true for every table that keeps its size\n picker: gating the footer on `meta` alone would pop the bar in and\n flip this bottom border on every load, since `meta` starts null and\n only fills after the fetch. Only a table that hid the picker can\n lose it, and then the rows close the panel themselves.\n */}\n <div\n className={cn(\n // `bg-card`: the rows are content between the chrome bands, and\n // keep their own surface on a muted page (a Plate's body) instead\n // of taking the chrome's colour through a transparent panel.\n \"bg-card flex min-h-0 flex-1 flex-col overflow-auto rounded-md border\",\n (showToolbar || showSummary) && \"-mt-2 rounded-t-none border-t-0\",\n showFooter ? \"rounded-b-none border-b-0\" : squareRight?.bottom,\n flatRows,\n // With no toolbar and no summary the rows open the table, so\n // their top-right corner is the one `squareRight` squares.\n !showToolbar && !showSummary && squareRight?.top,\n // `<Table>` wraps the table in a container div whose classes it\n // hardcodes, and only this table needs that container to grow,\n // so the one class it needs is set from out here instead.\n //\n // `grow`, NOT `flex-1`: `flex-1` sets the basis to 0, and in the\n // ordinary case this wrapper has no height of its own, so a 0\n // basis with nothing to grow into collapses the table to nothing.\n // `grow` keeps the content basis and only spends space that is\n // actually free, which is the full-height case.\n \"[&>[data-slot=table-container]]:grow\",\n )}\n >\n {/* `h-full` ONLY while the empty state is what is in the body.\n It is what lets that one row take the height the scroller grew\n into, so `align-middle` can centre the state in it.\n\n ⚠️ Never unconditionally. A CSS table given a height larger\n than its content does not leave the surplus at the bottom, it\n DISTRIBUTES IT ACROSS THE ROWS - so an unconditional `h-full`\n silently turns a short table into a tall one: Lore's Apps page,\n two rows in a full-height pane, rendered them 239px each. No\n unit test sees it (jsdom computes no layout) and it is invisible\n on a table long enough to fill its own container, which is why\n it reached e2e rather than review. */}\n <Table\n className={cn(\n isEmptyState && \"h-full\",\n compact && \"text-xs [&_th]:text-xs\",\n // `denseHeader`: a 40 px band of uppercase labels, and a line\n // under every row. A sortable column's label is a button, which\n // the base styles reset to no text transform: it takes the\n // band's case and tracking too.\n props.denseHeader &&\n \"[&_tbody_tr]:border-b [&_th]:h-10 [&_th]:text-[11.5px] [&_th]:font-semibold [&_th]:tracking-wide [&_th]:uppercase [&_th_button]:tracking-wide [&_th_button]:uppercase\",\n )}\n data-dense-header={props.denseHeader || undefined}\n >\n {/* `bg-muted`, fully opaque, NOT the base header's `bg-muted/50`:\n this header is sticky, so anything translucent lets the rows\n scroll visibly through the column labels. Same tint, no\n transparency.\n\n Two inset lines, not one. The bottom is the divider against the\n first row; the top is the `--bevel` highlight, which is what\n gives the band its thickness. Inset shadows rather than borders\n because a border on a sticky `<thead>` is dropped by the\n collapsed table border model, and because the two lines have to\n sit INSIDE the header's own height: it is pinned at `top-0`\n against a scrolling body, so anything painted outside it is\n painted over.\n\n The lines sit on the cells, not on the `<thead>`: WebKit paints\n no `box-shadow` on a table section, so on Safari the header had\n no bottom line at all. Not `chrome` either, for the same reason,\n and because `cn` does not know `chrome` is a background: it kept\n `TableHeader`'s `bg-muted/50` beside it, which won. */}\n <TableHeader\n className={cn(\n // ⚠️ `[&_tr]:border-b-0` or the bottom rule is drawn TWICE: `TableHeader`\n // gives its rows a `border-b`, and the inset shadow draws the\n // same line, so the band closed with 2px where it opens with\n // 1px. The inset one wins because it is what survives the sticky\n // header being painted over.\n \"bg-muted sticky top-0 z-10 [&_th]:shadow-[inset_0_1px_0_0_var(--bevel),inset_0_-1px_0_0_var(--border)] [&_tr]:border-b-0\",\n props.chromeClassName,\n )}\n >\n <DataTableHeaderRow<T>\n headClassName={cellPadding.head}\n visibleCols={visibleCols}\n hasCheckbox={hasCheckbox}\n hasRowActions={hasRowActions}\n allSelected={allSelected}\n someSelected={someSelected}\n toggleAll={toggleAll}\n sort={sort}\n toggleSort={toggleSort}\n setSortTo={setSortTo}\n moveColumn={moveColumn}\n toggleColumn={toggleColumn}\n headerFilter={headerFilter}\n headerPopup={headerPopup}\n />\n </TableHeader>\n <DataTableBody<T>\n cellClassName={cellPadding.cell}\n data={data}\n cellContext={cellContext}\n rowKeys={rowKeys}\n leaving={overlay.leaving}\n flash={overlay.flash}\n loading={loading}\n visibleCols={visibleCols}\n hasCheckbox={hasCheckbox}\n hasRowActions={hasRowActions}\n hasActiveFilters={hasActiveFilters}\n filtersAtDefault={filtersAtDefault}\n selection={selection}\n toggleRow={toggleRow}\n rowCtx={rowCtx}\n rowActions={props.rowActions}\n rowActionsDisplay={props.rowActionsDisplay}\n striped={props.striped}\n onRowClick={props.onRowClick}\n focusedKey={keyboard.focusedKey}\n onRowFocus={keyboard.enabled ? keyboard.focusRow : undefined}\n isRowActive={props.isRowActive}\n onRowHover={props.onRowHover}\n empty={props.empty}\n emptyMessage={props.emptyMessage}\n emptyState={props.emptyState}\n noMatchState={props.noMatchState}\n groupBy={props.groupBy}\n groupCounts={groupCounts}\n />\n </Table>\n </div>\n\n {/* A move is otherwise silent: nothing about a reordered table is\n spoken, and the visual change is the only feedback. Outside the\n table so it is not read as a cell. */}\n <span aria-live=\"polite\" className=\"sr-only\">\n {orderAnnouncement}\n </span>\n\n {compactPager && <DataTableCompactPager meta={meta} setPage={setPage} />}\n\n {/* The key hints sit in the footer; a table without one lists them\n under the rows. Not on a phone, which has no keys. */}\n {keyboard.hints && !showFooter && !isMobile && (\n <DataTableKeyHints hints={keyboard.hints} className=\"px-1\" />\n )}\n\n {showFooter && (\n <DataTableFooter\n pageSizes={props.pageSizes}\n sizeForm={sizeForm}\n meta={meta}\n isMobile={isMobile}\n setPage={setPage}\n hints={\n keyboard.hints && !isMobile ? (\n <DataTableKeyHints hints={keyboard.hints} />\n ) : undefined\n }\n className={cn(squareRight?.bottom, flatBottom, props.chromeClassName)}\n />\n )}\n </div>\n );\n\n return (\n <ClientOnly>\n {rail ? (\n <div className={cn(\"flex min-h-0\", props.className)}>\n {rail}\n {table}\n </div>\n ) : (\n table\n )}\n </ClientOnly>\n );\n};\n\n/**\n * Whether every filter value a summary tile stands for holds now. Compared\n * as JSON, so an array value matches the same members in the same order; an\n * `undefined` value (the tile clears that filter) holds while the field is\n * empty: unset, `\"\"` or an emptied multi-select.\n */\nconst isCardActive = (\n card: DataTableStatCard,\n values: Record<string, unknown>,\n): boolean => {\n if (!card.filter) return false;\n const entries = Object.entries(card.filter);\n const empty = (value: unknown) =>\n value === undefined ||\n value === null ||\n value === \"\" ||\n (Array.isArray(value) && value.length === 0);\n return (\n entries.length > 0 &&\n entries.every(([key, value]) =>\n value === undefined\n ? empty(values[key])\n : JSON.stringify(values[key]) === JSON.stringify(value),\n )\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,MAAa,aAIX,UACG;;;;;;CAMH,MAAM,UAAU;;;;;;;;;;;;;;CAehB,MAAM,aACJ,MAAM,SAAS,YAAY,QAAQ,KAAA,IAAY,MAAM;CACvD,MAAM,aACJ,MAAM,SAAS,YAAY,QAAQ,KAAA,IAAY,MAAM;CACvD,MAAM,UACJ,MAAM,SAAS,SAAS,QAAQ,KAAA,IAAY,MAAM;CAKpD,MAAM,UACJ,MAAM,WAAW,WAAW,IAAI,KAAA,IAAY,MAAM;CAKpD,MAAM,CAAC,MAAM,WAAW,eACtB,cAAc,SAAS,MAAM,aAAa,MAAM,kBAAkB,CACpE;CACA,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,QAAQ,SAAS;;;;;;;;;;;CAWvB,MAAM,WAAW,YAAY;CAE7B,MAAM,EAAE,MAAM,YAAY,qBAAqB,uBAAuB;EACpE,OAAO;EACP;EACA;CACF,CAAC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EA;;CAGP,OACE,oBAAC,YAAD,EAAA,UACG,OACC,qBAAC,OAAD;EAAK,WAAW,GAAG,gBAAgB,MAAM,SAAS;EAAlD,UAAA,CACG,MACA,KACE;CAEL,CAAA,IAAA,MAEQ,CAAA;AAEhB;;;;;;;AAQA,MAAM,gBACJ,MACA,WACY;CACZ,IAAI,CAAC,KAAK,QAAQ,OAAO;CACzB,MAAM,UAAU,OAAO,QAAQ,KAAK,MAAM;CAC1C,MAAM,SAAS,UACb,UAAU,KAAA,KACV,UAAU,QACV,UAAU,MACT,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW;CAC5C,OACE,QAAQ,SAAS,KACjB,QAAQ,OAAO,CAAC,KAAK,WACnB,UAAU,KAAA,IACN,MAAM,OAAO,IAAI,IACjB,KAAK,UAAU,OAAO,IAAI,MAAM,KAAK,UAAU,KAAK,CAC1D;AAEJ"}
@@ -54,6 +54,16 @@ export interface DataTableBodyProps<T> {
54
54
  */
55
55
  striped?: boolean;
56
56
  onRowClick?: (item: T) => void;
57
+ /**
58
+ * The key of the row the keyboard focus is on (the table's `keyboard`),
59
+ * drawn marked.
60
+ */
61
+ focusedKey?: string;
62
+ /**
63
+ * Called with a row's key when it is clicked, so a click moves the
64
+ * keyboard focus there. Absent while `keyboard` is off.
65
+ */
66
+ onRowFocus?: (key: string) => void;
57
67
  /**
58
68
  * The table's `isRowActive`.
59
69
  */