@alepha/ui 0.30.0 → 0.32.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 (585) hide show
  1. package/README.md +1 -1
  2. package/dist/account/$pageAccount.d.ts +15 -7
  3. package/dist/account/$pageAccount.d.ts.map +1 -1
  4. package/dist/account/$pageAccount.js +15 -7
  5. package/dist/account/$pageAccount.js.map +1 -1
  6. package/dist/account/AccountBackToSiteMenuItem.d.ts +21 -0
  7. package/dist/account/AccountBackToSiteMenuItem.d.ts.map +1 -0
  8. package/dist/account/AccountBackToSiteMenuItem.js +32 -0
  9. package/dist/account/AccountBackToSiteMenuItem.js.map +1 -0
  10. package/dist/account/AccountBrand.d.ts +23 -0
  11. package/dist/account/AccountBrand.d.ts.map +1 -0
  12. package/dist/account/AccountBrand.js +47 -0
  13. package/dist/account/AccountBrand.js.map +1 -0
  14. package/dist/account/AccountConnections.d.ts +11 -6
  15. package/dist/account/AccountConnections.d.ts.map +1 -1
  16. package/dist/account/AccountConnections.js +103 -63
  17. package/dist/account/AccountConnections.js.map +1 -1
  18. package/dist/account/AccountDeleteDialog.js +4 -4
  19. package/dist/account/AccountDeleteDialog.js.map +1 -1
  20. package/dist/account/AccountKeys.d.ts +12 -8
  21. package/dist/account/AccountKeys.d.ts.map +1 -1
  22. package/dist/account/AccountKeys.js +236 -123
  23. package/dist/account/AccountKeys.js.map +1 -1
  24. package/dist/account/AccountLayout.d.ts +23 -24
  25. package/dist/account/AccountLayout.d.ts.map +1 -1
  26. package/dist/account/AccountLayout.js +79 -46
  27. package/dist/account/AccountLayout.js.map +1 -1
  28. package/dist/account/AccountMfaDialog.d.ts.map +1 -1
  29. package/dist/account/AccountMfaDialog.js +64 -75
  30. package/dist/account/AccountMfaDialog.js.map +1 -1
  31. package/dist/account/AccountPage.d.ts +28 -0
  32. package/dist/account/AccountPage.d.ts.map +1 -0
  33. package/dist/account/AccountPage.js +33 -0
  34. package/dist/account/AccountPage.js.map +1 -0
  35. package/dist/account/AccountPasswordDialog.js +3 -3
  36. package/dist/account/AccountPasswordDialog.js.map +1 -1
  37. package/dist/account/AccountProfile.d.ts.map +1 -1
  38. package/dist/account/AccountProfile.js +119 -115
  39. package/dist/account/AccountProfile.js.map +1 -1
  40. package/dist/account/AccountRecoveryCodes.d.ts +16 -0
  41. package/dist/account/AccountRecoveryCodes.d.ts.map +1 -0
  42. package/dist/account/AccountRecoveryCodes.js +46 -0
  43. package/dist/account/AccountRecoveryCodes.js.map +1 -0
  44. package/dist/account/AccountRecoveryCodesDialog.d.ts +16 -0
  45. package/dist/account/AccountRecoveryCodesDialog.d.ts.map +1 -0
  46. package/dist/account/AccountRecoveryCodesDialog.js +30 -0
  47. package/dist/account/AccountRecoveryCodesDialog.js.map +1 -0
  48. package/dist/account/AccountRouter.d.ts +61 -40
  49. package/dist/account/AccountRouter.d.ts.map +1 -1
  50. package/dist/account/AccountRouter.js +74 -48
  51. package/dist/account/AccountRouter.js.map +1 -1
  52. package/dist/account/AccountRouterOptions.d.ts +55 -26
  53. package/dist/account/AccountRouterOptions.d.ts.map +1 -1
  54. package/dist/account/AccountRouterOptions.js +1 -1
  55. package/dist/account/AccountRouterOptions.js.map +1 -1
  56. package/dist/account/AccountSecurity.d.ts.map +1 -1
  57. package/dist/account/AccountSecurity.js +129 -89
  58. package/dist/account/AccountSecurity.js.map +1 -1
  59. package/dist/account/AccountSessions.d.ts +16 -7
  60. package/dist/account/AccountSessions.d.ts.map +1 -1
  61. package/dist/account/AccountSessions.js +144 -98
  62. package/dist/account/AccountSessions.js.map +1 -1
  63. package/dist/account/ApiKeyCreateDialog.js +3 -3
  64. package/dist/account/ApiKeyCreateDialog.js.map +1 -1
  65. package/dist/account/ApiKeyScopeMatrix.js +1 -1
  66. package/dist/account/index.d.ts +4 -1
  67. package/dist/account/index.d.ts.map +1 -1
  68. package/dist/account/index.js +4 -1
  69. package/dist/admin/AdminAnalytics.js +2 -2
  70. package/dist/admin/AdminAudits.js +3 -3
  71. package/dist/admin/AdminDashboardCountCard.js +1 -1
  72. package/dist/admin/AdminFiles.d.ts.map +1 -1
  73. package/dist/admin/AdminFiles.js +7 -4
  74. package/dist/admin/AdminFiles.js.map +1 -1
  75. package/dist/admin/AdminFilesUsage.d.ts +4 -0
  76. package/dist/admin/AdminFilesUsage.d.ts.map +1 -1
  77. package/dist/admin/AdminFilesUsage.js +5 -2
  78. package/dist/admin/AdminFilesUsage.js.map +1 -1
  79. package/dist/admin/AdminFilesUsageCard.d.ts +12 -0
  80. package/dist/admin/AdminFilesUsageCard.d.ts.map +1 -1
  81. package/dist/admin/AdminFilesUsageCard.js +31 -3
  82. package/dist/admin/AdminFilesUsageCard.js.map +1 -1
  83. package/dist/admin/AdminJobDetail.js +3 -3
  84. package/dist/admin/AdminJobDetail.js.map +1 -1
  85. package/dist/admin/AdminJobDetailAside.js +1 -1
  86. package/dist/admin/AdminJobDetailExecutions.js +4 -4
  87. package/dist/admin/AdminJobDetailExecutions.js.map +1 -1
  88. package/dist/admin/AdminJobExecutionLogs.js +1 -1
  89. package/dist/admin/AdminJobExecutionLogs.js.map +1 -1
  90. package/dist/admin/AdminJobExecutionSheet.js +4 -4
  91. package/dist/admin/AdminJobExecutionSheet.js.map +1 -1
  92. package/dist/admin/AdminJobs.js +4 -4
  93. package/dist/admin/AdminJobs.js.map +1 -1
  94. package/dist/admin/AdminJobsPayloadDialog.js +1 -1
  95. package/dist/admin/AdminJobsTypeIcon.js +1 -1
  96. package/dist/admin/AdminKeys.js +6 -6
  97. package/dist/admin/AdminKeysTokenDialog.js +2 -2
  98. package/dist/admin/AdminKeysTokenDialog.js.map +1 -1
  99. package/dist/admin/AdminLayout.js +3 -3
  100. package/dist/admin/AdminNotifications.js +3 -3
  101. package/dist/admin/AdminNotificationsDetail.js +1 -1
  102. package/dist/admin/AdminNotificationsDetailTabs.js +1 -1
  103. package/dist/admin/AdminNotificationsPreviewTab.js +1 -1
  104. package/dist/admin/AdminParameters.d.ts.map +1 -1
  105. package/dist/admin/AdminParameters.js +2 -2
  106. package/dist/admin/AdminParameters.js.map +1 -1
  107. package/dist/admin/AdminParametersEditorForm.js +3 -3
  108. package/dist/admin/AdminParametersEditorForm.js.map +1 -1
  109. package/dist/admin/AdminParametersEditorPane.js +2 -2
  110. package/dist/admin/AdminParametersHistoryPane.js +2 -2
  111. package/dist/admin/AdminParametersTreeFooterActions.js +3 -3
  112. package/dist/admin/AdminParametersTreeFooterActions.js.map +1 -1
  113. package/dist/admin/AdminParametersTreeNodeView.js +4 -4
  114. package/dist/admin/AdminParametersTreeNodeView.js.map +1 -1
  115. package/dist/admin/AdminParametersTreePane.js +2 -2
  116. package/dist/admin/AdminParametersTreePane.js.map +1 -1
  117. package/dist/admin/AdminPayments.js +2 -2
  118. package/dist/admin/AdminRouter.js +1 -1
  119. package/dist/admin/AdminSessions.js +3 -3
  120. package/dist/admin/AdminUserAvatarControl.js +4 -4
  121. package/dist/admin/AdminUserAvatarControl.js.map +1 -1
  122. package/dist/admin/AdminUserDetail.d.ts.map +1 -1
  123. package/dist/admin/AdminUserDetail.js +5 -4
  124. package/dist/admin/AdminUserDetail.js.map +1 -1
  125. package/dist/admin/AdminUserDetailAuditsTab.js +1 -1
  126. package/dist/admin/AdminUserDetailIdentityAside.js +1 -1
  127. package/dist/admin/AdminUserDetailOverviewTab.js +1 -1
  128. package/dist/admin/AdminUserDetailPasswordDialog.js +2 -2
  129. package/dist/admin/AdminUserDetailPasswordDialog.js.map +1 -1
  130. package/dist/admin/AdminUserDetailSecurityTab.d.ts.map +1 -1
  131. package/dist/admin/AdminUserDetailSecurityTab.js +6 -4
  132. package/dist/admin/AdminUserDetailSecurityTab.js.map +1 -1
  133. package/dist/admin/AdminUserDetailSessionsTab.js +1 -1
  134. package/dist/admin/AdminUsers.js +4 -4
  135. package/dist/admin/AdminUsersRolesPicker.js +1 -1
  136. package/dist/admin/AdminUsersStatusBadge.js +1 -1
  137. package/dist/admin/ParameterDiffDialog.js +3 -3
  138. package/dist/admin/ParameterDiffDialog.js.map +1 -1
  139. package/dist/admin/ParameterHistoryItem.js +3 -3
  140. package/dist/admin/ParameterHistoryItem.js.map +1 -1
  141. package/dist/admin/ParameterJsonDialog.js +2 -2
  142. package/dist/admin/ParameterJsonDialog.js.map +1 -1
  143. package/dist/admin/ParameterSaveDialog.js +3 -3
  144. package/dist/admin/ParameterSaveDialog.js.map +1 -1
  145. package/dist/admin/analytics/AdvancedSection.js +1 -1
  146. package/dist/admin/analytics/AnalyticsEmpty.js +1 -1
  147. package/dist/admin/analytics/DatasetSelect.js +1 -1
  148. package/dist/admin/analytics/FilterEditor.js +4 -4
  149. package/dist/admin/analytics/FilterEditor.js.map +1 -1
  150. package/dist/admin/analytics/FilterValuePicker.js +3 -3
  151. package/dist/admin/analytics/FilterValuePicker.js.map +1 -1
  152. package/dist/admin/analytics/RequestDialog.js +2 -2
  153. package/dist/admin/analytics/RequestDialog.js.map +1 -1
  154. package/dist/admin/analytics/ResultsPane.js +2 -2
  155. package/dist/admin/analytics/ResultsPane.js.map +1 -1
  156. package/dist/admin/analytics/ResultsTable.d.ts.map +1 -1
  157. package/dist/admin/analytics/ResultsTable.js +2 -2
  158. package/dist/admin/analytics/ResultsTable.js.map +1 -1
  159. package/dist/admin/analytics/RunFooter.js +1 -1
  160. package/dist/admin/analytics/SamplingBadge.js +1 -1
  161. package/dist/admin/analytics/ToggleChip.js +1 -1
  162. package/dist/admin/analytics/ToggleChip.js.map +1 -1
  163. package/dist/admin/analytics/TruncationBanner.js +2 -2
  164. package/dist/admin/analytics/TruncationBanner.js.map +1 -1
  165. package/dist/admin/analytics/useAnalyticsQuery.js +1 -1
  166. package/dist/admin/analytics/useShapeLabels.js +1 -1
  167. package/dist/auth/AuthLogin.js +5 -5
  168. package/dist/auth/AuthLogin.js.map +1 -1
  169. package/dist/auth/AuthMfaStep.js +3 -3
  170. package/dist/auth/AuthMfaStep.js.map +1 -1
  171. package/dist/auth/AuthRegister.js +5 -5
  172. package/dist/auth/AuthRegister.js.map +1 -1
  173. package/dist/auth/AuthRegisterFormPhase.js +3 -3
  174. package/dist/auth/AuthRegisterFormPhase.js.map +1 -1
  175. package/dist/auth/AuthRegisterPasswordRules.js +1 -1
  176. package/dist/auth/AuthResetPassword.js +5 -5
  177. package/dist/auth/AuthResetPassword.js.map +1 -1
  178. package/dist/auth/AuthRouter.d.ts +2 -2
  179. package/dist/auth/AuthRouter.js +2 -2
  180. package/dist/auth/AuthRouter.js.map +1 -1
  181. package/dist/auth/AuthVerifyEmailStateful.js +2 -2
  182. package/dist/auth/AuthVerifyEmailView.js +3 -3
  183. package/dist/auth/AuthVerifyEmailView.js.map +1 -1
  184. package/dist/auth/safeRedirect.d.ts +3 -0
  185. package/dist/auth/safeRedirect.d.ts.map +1 -1
  186. package/dist/auth/safeRedirect.js +11 -0
  187. package/dist/auth/safeRedirect.js.map +1 -1
  188. package/dist/calendar/Calendar.js +3 -3
  189. package/dist/calendar/Calendar.js.map +1 -1
  190. package/dist/core/Alert.js +2 -2
  191. package/dist/core/Alert.js.map +1 -1
  192. package/dist/core/AlertDialog.js +1 -1
  193. package/dist/core/AlertDialog.js.map +1 -1
  194. package/dist/core/Badge.js +3 -3
  195. package/dist/core/Badge.js.map +1 -1
  196. package/dist/core/Button.d.ts +45 -3
  197. package/dist/core/Button.d.ts.map +1 -1
  198. package/dist/core/Button.js +155 -11
  199. package/dist/core/Button.js.map +1 -1
  200. package/dist/core/ButtonGroup.js +1 -1
  201. package/dist/core/Checkbox.js +1 -1
  202. package/dist/core/Checkbox.js.map +1 -1
  203. package/dist/core/Combobox.js +4 -4
  204. package/dist/core/Combobox.js.map +1 -1
  205. package/dist/core/ContextMenu.js +1 -1
  206. package/dist/core/ContextMenu.js.map +1 -1
  207. package/dist/core/Dialog.js +2 -2
  208. package/dist/core/Dialog.js.map +1 -1
  209. package/dist/core/DropdownMenu.js +2 -2
  210. package/dist/core/DropdownMenu.js.map +1 -1
  211. package/dist/core/Empty.js +1 -1
  212. package/dist/core/Input.js +1 -1
  213. package/dist/core/Input.js.map +1 -1
  214. package/dist/core/InputGroup.js +3 -3
  215. package/dist/core/InputGroup.js.map +1 -1
  216. package/dist/core/Menubar.js +2 -2
  217. package/dist/core/Menubar.js.map +1 -1
  218. package/dist/core/Pagination.js +1 -1
  219. package/dist/core/Pagination.js.map +1 -1
  220. package/dist/core/Segmented.d.ts.map +1 -1
  221. package/dist/core/Segmented.js +1 -1
  222. package/dist/core/Segmented.js.map +1 -1
  223. package/dist/core/Sheet.js +1 -1
  224. package/dist/core/Sheet.js.map +1 -1
  225. package/dist/core/Sidebar.js +4 -4
  226. package/dist/core/Sidebar.js.map +1 -1
  227. package/dist/core/Switch.js +1 -1
  228. package/dist/core/Switch.js.map +1 -1
  229. package/dist/core/Tabs.js +1 -1
  230. package/dist/core/Textarea.js +1 -1
  231. package/dist/core/Textarea.js.map +1 -1
  232. package/dist/core/TimeAgo.js +1 -1
  233. package/dist/core/index.d.ts +1 -1
  234. package/dist/core/index.d.ts.map +1 -1
  235. package/dist/core/index.js +20 -20
  236. package/dist/core/useDialog.d.ts.map +1 -1
  237. package/dist/core/useDialog.js +3 -3
  238. package/dist/core/useDialog.js.map +1 -1
  239. package/dist/form/AutoForm.d.ts +3 -1
  240. package/dist/form/AutoForm.d.ts.map +1 -1
  241. package/dist/form/AutoForm.js +3 -3
  242. package/dist/form/AutoForm.js.map +1 -1
  243. package/dist/form/AutoFormBottomBar.d.ts.map +1 -1
  244. package/dist/form/AutoFormBottomBar.js +5 -4
  245. package/dist/form/AutoFormBottomBar.js.map +1 -1
  246. package/dist/form/AutoFormErrorPopover.js +4 -4
  247. package/dist/form/AutoFormErrorPopover.js.map +1 -1
  248. package/dist/form/AutoFormGroupBlock.js +2 -2
  249. package/dist/form/AutoFormGroupGridField.js +1 -1
  250. package/dist/form/Control.d.ts +16 -0
  251. package/dist/form/Control.d.ts.map +1 -1
  252. package/dist/form/Control.js +30 -10
  253. package/dist/form/Control.js.map +1 -1
  254. package/dist/form/ControlArray.d.ts.map +1 -1
  255. package/dist/form/ControlArray.js +15 -14
  256. package/dist/form/ControlArray.js.map +1 -1
  257. package/dist/form/ControlDate.d.ts.map +1 -1
  258. package/dist/form/ControlDate.js +5 -2
  259. package/dist/form/ControlDate.js.map +1 -1
  260. package/dist/form/ControlDatePopover.js +1 -1
  261. package/dist/form/ControlDateRange.js +2 -2
  262. package/dist/form/ControlObject.js +7 -7
  263. package/dist/form/ControlObject.js.map +1 -1
  264. package/dist/form/ControlPassword.js +1 -1
  265. package/dist/form/ControlPassword.js.map +1 -1
  266. package/dist/form/ControlSelect.d.ts +3 -2
  267. package/dist/form/ControlSelect.d.ts.map +1 -1
  268. package/dist/form/ControlSelect.js +2 -2
  269. package/dist/form/ControlSelect.js.map +1 -1
  270. package/dist/form/ControlSelectCombobox.js +1 -1
  271. package/dist/form/ControlUpload.js +3 -3
  272. package/dist/form/ControlUpload.js.map +1 -1
  273. package/dist/form/FormField.js +5 -5
  274. package/dist/form/FormField.js.map +1 -1
  275. package/dist/form/fieldTrigger.js +1 -1
  276. package/dist/form/grid.d.ts +11 -0
  277. package/dist/form/grid.d.ts.map +1 -1
  278. package/dist/form/grid.js +17 -6
  279. package/dist/form/grid.js.map +1 -1
  280. package/dist/form/index.js +2 -2
  281. package/dist/i18n/fr/uiFr.d.ts.map +1 -1
  282. package/dist/i18n/fr/uiFr.js +41 -30
  283. package/dist/i18n/fr/uiFr.js.map +1 -1
  284. package/dist/markdown/MarkdownView.d.ts.map +1 -1
  285. package/dist/markdown/MarkdownView.js +5 -4
  286. package/dist/markdown/MarkdownView.js.map +1 -1
  287. package/dist/markdown/rehypeHighlight.d.ts +1 -1
  288. package/dist/markdown/rehypeHighlight.js +1 -1
  289. package/dist/markdown/rehypeHighlight.js.map +1 -1
  290. package/dist/organizations/MyOrganizationInvitations.d.ts +36 -0
  291. package/dist/organizations/MyOrganizationInvitations.d.ts.map +1 -1
  292. package/dist/organizations/MyOrganizationInvitations.js +116 -58
  293. package/dist/organizations/MyOrganizationInvitations.js.map +1 -1
  294. package/dist/organizations/MyOrganizations.js +4 -4
  295. package/dist/organizations/MyOrganizations.js.map +1 -1
  296. package/dist/organizations/OrganizationInviteDialog.js +2 -2
  297. package/dist/organizations/OrganizationInviteDialog.js.map +1 -1
  298. package/dist/organizations/OrganizationMemberIdentity.d.ts.map +1 -1
  299. package/dist/organizations/OrganizationMemberIdentity.js +1 -1
  300. package/dist/organizations/OrganizationMemberIdentity.js.map +1 -1
  301. package/dist/organizations/OrganizationMemberRankPicker.js +3 -3
  302. package/dist/organizations/OrganizationMembers.js +7 -7
  303. package/dist/organizations/OrganizationMembers.js.map +1 -1
  304. package/dist/organizations/OrganizationPendingInvitations.js +5 -5
  305. package/dist/organizations/OrganizationPendingInvitations.js.map +1 -1
  306. package/dist/organizations/OrganizationRankColumnHeader.d.ts +0 -1
  307. package/dist/organizations/OrganizationRankColumnHeader.d.ts.map +1 -1
  308. package/dist/organizations/OrganizationRankColumnHeader.js +26 -35
  309. package/dist/organizations/OrganizationRankColumnHeader.js.map +1 -1
  310. package/dist/organizations/OrganizationRanks.d.ts.map +1 -1
  311. package/dist/organizations/OrganizationRanks.js +7 -8
  312. package/dist/organizations/OrganizationRanks.js.map +1 -1
  313. package/dist/organizations/OrganizationTransferOwnershipDialog.js +3 -3
  314. package/dist/organizations/OrganizationTransferOwnershipDialog.js.map +1 -1
  315. package/dist/organizations/useInviteOrganizationMember.js +1 -1
  316. package/dist/organizations/useRevokeOrganizationInvitation.js +1 -1
  317. package/dist/otp/InputOTP.js +2 -2
  318. package/dist/otp/InputOTP.js.map +1 -1
  319. package/dist/settings/SettingsDangerSection.js +2 -2
  320. package/dist/settings/SettingsDangerSection.js.map +1 -1
  321. package/dist/settings/SettingsHeading.d.ts +1 -1
  322. package/dist/settings/SettingsHeading.js +1 -1
  323. package/dist/settings/SettingsHeading.js.map +1 -1
  324. package/dist/settings/SettingsSection.d.ts +1 -1
  325. package/dist/settings/SettingsSection.js +2 -2
  326. package/dist/settings/SettingsSection.js.map +1 -1
  327. package/dist/settings/index.js +2 -2
  328. package/dist/shell/AppActions.d.ts +2 -2
  329. package/dist/shell/AppActions.js +6 -6
  330. package/dist/shell/AppActions.js.map +1 -1
  331. package/dist/shell/AppShellSidebarNavItem.d.ts.map +1 -1
  332. package/dist/shell/AppShellSidebarNavItem.js +8 -2
  333. package/dist/shell/AppShellSidebarNavItem.js.map +1 -1
  334. package/dist/shell/AppShellStatefulSidebarTrigger.js +1 -1
  335. package/dist/shell/AppShellStatefulSidebarTrigger.js.map +1 -1
  336. package/dist/shell/ButtonDark.d.ts +2 -2
  337. package/dist/shell/ButtonDark.d.ts.map +1 -1
  338. package/dist/shell/ButtonDark.js +1 -1
  339. package/dist/shell/ButtonDark.js.map +1 -1
  340. package/dist/shell/ButtonInbox.d.ts +1 -1
  341. package/dist/shell/ButtonInbox.d.ts.map +1 -1
  342. package/dist/shell/ButtonInbox.js +7 -7
  343. package/dist/shell/ButtonInbox.js.map +1 -1
  344. package/dist/shell/ButtonLanguage.d.ts +2 -2
  345. package/dist/shell/ButtonLanguage.d.ts.map +1 -1
  346. package/dist/shell/ButtonLanguage.js +3 -3
  347. package/dist/shell/ButtonLanguage.js.map +1 -1
  348. package/dist/shell/ButtonSettings.d.ts +2 -2
  349. package/dist/shell/ButtonSettings.d.ts.map +1 -1
  350. package/dist/shell/ButtonSettings.js +2 -2
  351. package/dist/shell/ButtonSettings.js.map +1 -1
  352. package/dist/shell/ButtonSettingsLanguageMenu.js +1 -1
  353. package/dist/shell/ButtonSettingsThemeMenu.js +1 -1
  354. package/dist/shell/ButtonTheme.d.ts +2 -2
  355. package/dist/shell/ButtonTheme.d.ts.map +1 -1
  356. package/dist/shell/ButtonTheme.js +3 -3
  357. package/dist/shell/ButtonTheme.js.map +1 -1
  358. package/dist/shell/ButtonUser.d.ts +2 -2
  359. package/dist/shell/ButtonUser.d.ts.map +1 -1
  360. package/dist/shell/ButtonUser.js +4 -4
  361. package/dist/shell/ButtonUser.js.map +1 -1
  362. package/dist/shell/DetailAside.js +3 -3
  363. package/dist/shell/DetailAside.js.map +1 -1
  364. package/dist/shell/DetailLayout.js +2 -2
  365. package/dist/shell/DetailLayout.js.map +1 -1
  366. package/dist/shell/NavShell.js +1 -1
  367. package/dist/shell/NavigationProgress.js +1 -1
  368. package/dist/shell/PlateTabBar.d.ts.map +1 -1
  369. package/dist/shell/PlateTabBar.js +2 -2
  370. package/dist/shell/PlateTabBar.js.map +1 -1
  371. package/dist/shell/Spotlight.js +1 -1
  372. package/dist/shell/index.js +3 -3
  373. package/dist/shell/useNavBreadcrumbs.js +1 -1
  374. package/dist/shell/useNavEntries.js +1 -1
  375. package/dist/styles.css +152 -12
  376. package/dist/table/DataTable.js +3 -3
  377. package/dist/table/DataTableBody.js +1 -1
  378. package/dist/table/DataTableBulkBar.d.ts.map +1 -1
  379. package/dist/table/DataTableBulkBar.js +6 -3
  380. package/dist/table/DataTableBulkBar.js.map +1 -1
  381. package/dist/table/DataTableBulkMenu.d.ts.map +1 -1
  382. package/dist/table/DataTableBulkMenu.js +4 -3
  383. package/dist/table/DataTableBulkMenu.js.map +1 -1
  384. package/dist/table/DataTableColumnPicker.js +3 -3
  385. package/dist/table/DataTableColumnPicker.js.map +1 -1
  386. package/dist/table/DataTableFilterAdd.d.ts +7 -0
  387. package/dist/table/DataTableFilterAdd.d.ts.map +1 -1
  388. package/dist/table/DataTableFilterAdd.js +15 -6
  389. package/dist/table/DataTableFilterAdd.js.map +1 -1
  390. package/dist/table/DataTableFilterBar.d.ts.map +1 -1
  391. package/dist/table/DataTableFilterBar.js +12 -3
  392. package/dist/table/DataTableFilterBar.js.map +1 -1
  393. package/dist/table/DataTableFilterControl.d.ts +1 -1
  394. package/dist/table/DataTableFilterControl.js +2 -2
  395. package/dist/table/DataTableFilterControl.js.map +1 -1
  396. package/dist/table/DataTableFilterDialog.js +5 -5
  397. package/dist/table/DataTableFilterDialog.js.map +1 -1
  398. package/dist/table/DataTableFilterMenu.js +3 -3
  399. package/dist/table/DataTableFilterMenu.js.map +1 -1
  400. package/dist/table/DataTableFooter.d.ts.map +1 -1
  401. package/dist/table/DataTableFooter.js +1 -1
  402. package/dist/table/DataTableFooter.js.map +1 -1
  403. package/dist/table/DataTableHeaderRow.js +1 -1
  404. package/dist/table/DataTableHelpButton.js +2 -2
  405. package/dist/table/DataTableHelpButton.js.map +1 -1
  406. package/dist/table/DataTableRowActionsMenu.js +3 -3
  407. package/dist/table/DataTableRowActionsMenu.js.map +1 -1
  408. package/dist/table/DataTableToolbar.d.ts.map +1 -1
  409. package/dist/table/DataTableToolbar.js +4 -4
  410. package/dist/table/DataTableToolbar.js.map +1 -1
  411. package/dist/table/PermissionMatrixRowLabel.d.ts +1 -1
  412. package/dist/table/PermissionMatrixRowLabel.js +1 -1
  413. package/dist/table/PermissionMatrixRowLabel.js.map +1 -1
  414. package/dist/table/dataTableTypes.d.ts +12 -1
  415. package/dist/table/dataTableTypes.d.ts.map +1 -1
  416. package/dist/table/index.js +1 -1
  417. package/dist/table/useDataTableData.d.ts.map +1 -1
  418. package/dist/table/useDataTableData.js +13 -2
  419. package/dist/table/useDataTableData.js.map +1 -1
  420. package/dist/tree/TreeViewRenameInput.js +1 -1
  421. package/dist/tree/TreeViewResizer.js +1 -1
  422. package/package.json +17 -14
  423. package/src/account/$pageAccount.tsx +15 -7
  424. package/src/account/AccountBackToSiteMenuItem.tsx +46 -0
  425. package/src/account/AccountBrand.tsx +51 -0
  426. package/src/account/AccountConnections.tsx +154 -126
  427. package/src/account/AccountDeleteDialog.tsx +2 -2
  428. package/src/account/AccountKeys.tsx +277 -162
  429. package/src/account/AccountLayout.tsx +75 -84
  430. package/src/account/AccountMfaDialog.tsx +19 -38
  431. package/src/account/AccountPage.tsx +63 -0
  432. package/src/account/AccountPasswordDialog.tsx +1 -1
  433. package/src/account/AccountProfile.tsx +6 -4
  434. package/src/account/AccountRecoveryCodes.tsx +69 -0
  435. package/src/account/AccountRecoveryCodesDialog.tsx +47 -0
  436. package/src/account/AccountRouter.tsx +82 -50
  437. package/src/account/AccountRouterOptions.tsx +59 -27
  438. package/src/account/AccountSecurity.tsx +84 -12
  439. package/src/account/AccountSessions.tsx +214 -159
  440. package/src/account/ApiKeyCreateDialog.tsx +1 -1
  441. package/src/account/__tests__/AccountConnections.browser.spec.tsx +130 -0
  442. package/src/account/__tests__/AccountKeys.browser.spec.tsx +156 -0
  443. package/src/account/__tests__/AccountLayout.browser.spec.tsx +120 -30
  444. package/src/account/__tests__/AccountRecoveryCodes.browser.spec.tsx +118 -0
  445. package/src/account/__tests__/AccountRouter.spec.ts +34 -0
  446. package/src/account/__tests__/AccountSessions.browser.spec.tsx +199 -0
  447. package/src/account/index.ts +7 -1
  448. package/src/admin/AdminFiles.tsx +4 -1
  449. package/src/admin/AdminFilesUsage.tsx +10 -1
  450. package/src/admin/AdminFilesUsageCard.tsx +69 -2
  451. package/src/admin/AdminJobDetail.tsx +1 -1
  452. package/src/admin/AdminJobDetailExecutions.tsx +1 -1
  453. package/src/admin/AdminJobExecutionLogs.tsx +1 -1
  454. package/src/admin/AdminJobExecutionSheet.tsx +1 -1
  455. package/src/admin/AdminJobs.tsx +1 -1
  456. package/src/admin/AdminKeysTokenDialog.tsx +1 -1
  457. package/src/admin/AdminParameters.tsx +13 -14
  458. package/src/admin/AdminParametersEditorForm.tsx +2 -2
  459. package/src/admin/AdminParametersTreeFooterActions.tsx +2 -2
  460. package/src/admin/AdminParametersTreeNodeView.tsx +2 -2
  461. package/src/admin/AdminParametersTreePane.tsx +1 -1
  462. package/src/admin/AdminUserAvatarControl.tsx +2 -2
  463. package/src/admin/AdminUserDetail.tsx +3 -2
  464. package/src/admin/AdminUserDetailPasswordDialog.tsx +1 -1
  465. package/src/admin/AdminUserDetailSecurityTab.tsx +5 -3
  466. package/src/admin/ParameterDiffDialog.tsx +2 -2
  467. package/src/admin/ParameterHistoryItem.tsx +1 -1
  468. package/src/admin/ParameterJsonDialog.tsx +1 -1
  469. package/src/admin/ParameterSaveDialog.tsx +1 -1
  470. package/src/admin/__tests__/AdminFilesUsageCard.browser.spec.tsx +52 -2
  471. package/src/admin/analytics/FilterEditor.tsx +3 -3
  472. package/src/admin/analytics/FilterValuePicker.tsx +2 -2
  473. package/src/admin/analytics/RequestDialog.tsx +1 -1
  474. package/src/admin/analytics/ResultsPane.tsx +1 -1
  475. package/src/admin/analytics/ResultsTable.tsx +6 -1
  476. package/src/admin/analytics/ToggleChip.tsx +1 -1
  477. package/src/admin/analytics/TruncationBanner.tsx +1 -1
  478. package/src/auth/AuthLogin.tsx +2 -2
  479. package/src/auth/AuthMfaStep.tsx +2 -2
  480. package/src/auth/AuthRegister.tsx +2 -2
  481. package/src/auth/AuthRegisterFormPhase.tsx +1 -1
  482. package/src/auth/AuthResetPassword.tsx +2 -2
  483. package/src/auth/AuthRouter.tsx +2 -2
  484. package/src/auth/AuthVerifyEmailView.tsx +1 -1
  485. package/src/auth/__tests__/AuthRouter.spec.ts +2 -1
  486. package/src/auth/__tests__/safeRedirect.spec.ts +38 -0
  487. package/src/auth/safeRedirect.ts +13 -0
  488. package/src/calendar/Calendar.tsx +2 -2
  489. package/src/core/Alert.tsx +1 -1
  490. package/src/core/AlertDialog.tsx +1 -1
  491. package/src/core/Badge.tsx +2 -2
  492. package/src/core/Button.tsx +232 -18
  493. package/src/core/Checkbox.tsx +1 -1
  494. package/src/core/Combobox.tsx +4 -4
  495. package/src/core/ContextMenu.tsx +1 -1
  496. package/src/core/Dialog.tsx +2 -2
  497. package/src/core/DropdownMenu.tsx +1 -1
  498. package/src/core/Input.tsx +1 -1
  499. package/src/core/InputGroup.tsx +2 -2
  500. package/src/core/Menubar.tsx +1 -1
  501. package/src/core/Pagination.tsx +1 -1
  502. package/src/core/Segmented.tsx +6 -4
  503. package/src/core/Sheet.tsx +1 -1
  504. package/src/core/Sidebar.tsx +1 -1
  505. package/src/core/Switch.tsx +1 -1
  506. package/src/core/Textarea.tsx +1 -1
  507. package/src/core/index.ts +7 -1
  508. package/src/core/useDialog.tsx +3 -5
  509. package/src/form/AutoForm.tsx +3 -1
  510. package/src/form/AutoFormBottomBar.tsx +4 -3
  511. package/src/form/AutoFormErrorPopover.tsx +3 -3
  512. package/src/form/Control.tsx +66 -9
  513. package/src/form/ControlArray.tsx +13 -12
  514. package/src/form/ControlDate.tsx +4 -1
  515. package/src/form/ControlObject.tsx +6 -6
  516. package/src/form/ControlPassword.tsx +1 -1
  517. package/src/form/ControlSelect.tsx +3 -2
  518. package/src/form/ControlUpload.tsx +1 -1
  519. package/src/form/FormField.tsx +5 -5
  520. package/src/form/__tests__/ControlVerbatim.browser.spec.tsx +71 -0
  521. package/src/form/grid.tsx +17 -6
  522. package/src/i18n/fr/uiFr.ts +46 -33
  523. package/src/markdown/MarkdownView.tsx +5 -4
  524. package/src/markdown/rehypeHighlight.ts +1 -1
  525. package/src/organizations/MyOrganizationInvitations.tsx +177 -71
  526. package/src/organizations/MyOrganizations.tsx +1 -1
  527. package/src/organizations/OrganizationInviteDialog.tsx +1 -1
  528. package/src/organizations/OrganizationMemberIdentity.tsx +4 -1
  529. package/src/organizations/OrganizationMembers.tsx +3 -3
  530. package/src/organizations/OrganizationPendingInvitations.tsx +1 -1
  531. package/src/organizations/OrganizationRankColumnHeader.tsx +1 -8
  532. package/src/organizations/OrganizationRanks.tsx +2 -3
  533. package/src/organizations/OrganizationTransferOwnershipDialog.tsx +2 -2
  534. package/src/organizations/__tests__/MyOrganizationInvitations.browser.spec.tsx +61 -7
  535. package/src/organizations/__tests__/OrganizationRanks.browser.spec.tsx +34 -0
  536. package/src/otp/InputOTP.tsx +2 -2
  537. package/src/settings/SettingsDangerSection.tsx +2 -2
  538. package/src/settings/SettingsHeading.tsx +1 -1
  539. package/src/settings/SettingsSection.tsx +1 -1
  540. package/src/settings/__tests__/SettingsSection.browser.spec.tsx +3 -3
  541. package/src/shell/AppActions.tsx +6 -6
  542. package/src/shell/AppShellSidebarNavItem.tsx +17 -2
  543. package/src/shell/AppShellStatefulSidebarTrigger.tsx +1 -1
  544. package/src/shell/ButtonDark.tsx +3 -3
  545. package/src/shell/ButtonInbox.tsx +15 -5
  546. package/src/shell/ButtonLanguage.tsx +3 -3
  547. package/src/shell/ButtonSettings.tsx +3 -3
  548. package/src/shell/ButtonTheme.tsx +3 -3
  549. package/src/shell/ButtonUser.tsx +4 -4
  550. package/src/shell/DetailAside.tsx +1 -1
  551. package/src/shell/DetailLayout.tsx +1 -1
  552. package/src/shell/PlateTabBar.tsx +4 -2
  553. package/src/shell/__tests__/ActionErrorToaster.browser.spec.tsx +2 -2
  554. package/src/shell/__tests__/AppActions.browser.spec.tsx +1 -1
  555. package/src/shell/__tests__/ButtonInbox.browser.spec.tsx +12 -0
  556. package/src/shell/__tests__/NavigationProgress.browser.spec.tsx +2 -2
  557. package/src/styles.css +152 -12
  558. package/src/table/DataTableBulkBar.tsx +10 -3
  559. package/src/table/DataTableBulkMenu.tsx +2 -1
  560. package/src/table/DataTableColumnPicker.tsx +1 -1
  561. package/src/table/DataTableFilterAdd.tsx +55 -25
  562. package/src/table/DataTableFilterBar.tsx +16 -3
  563. package/src/table/DataTableFilterControl.tsx +1 -1
  564. package/src/table/DataTableFilterDialog.tsx +3 -3
  565. package/src/table/DataTableFilterMenu.tsx +1 -1
  566. package/src/table/DataTableFooter.tsx +31 -32
  567. package/src/table/DataTableHelpButton.tsx +1 -1
  568. package/src/table/DataTableRowActionsMenu.tsx +1 -1
  569. package/src/table/DataTableToolbar.tsx +11 -3
  570. package/src/table/PermissionMatrixRowLabel.tsx +1 -1
  571. package/src/table/__tests__/DataTableBulkBarChrome.browser.spec.tsx +87 -0
  572. package/src/table/__tests__/DataTableFilterDefaultBar.browser.spec.tsx +24 -0
  573. package/src/table/__tests__/DataTableNewestRequest.browser.spec.tsx +91 -0
  574. package/src/table/dataTableTypes.ts +14 -1
  575. package/src/table/useDataTableData.ts +24 -1
  576. package/dist/account/AccountHeader.d.ts +0 -33
  577. package/dist/account/AccountHeader.d.ts.map +0 -1
  578. package/dist/account/AccountHeader.js +0 -45
  579. package/dist/account/AccountHeader.js.map +0 -1
  580. package/dist/account/AccountKeysRow.d.ts +0 -22
  581. package/dist/account/AccountKeysRow.d.ts.map +0 -1
  582. package/dist/account/AccountKeysRow.js +0 -68
  583. package/dist/account/AccountKeysRow.js.map +0 -1
  584. package/src/account/AccountHeader.tsx +0 -66
  585. package/src/account/AccountKeysRow.tsx +0 -100
@@ -4,9 +4,9 @@ import { DataTableFilterAdd } from "./DataTableFilterAdd.js";
4
4
  import { DataTableFilterControl } from "./DataTableFilterControl.js";
5
5
  import { DATA_TABLE_FILTER_OPERATORS, DataTableFilterOperator } from "./DataTableFilterOperator.js";
6
6
  import { z } from "alepha";
7
- import { Search } from "lucide-react";
8
- import { useEffect, useLayoutEffect, useRef } from "react";
9
7
  import { useI18n } from "alepha/react/i18n";
8
+ import { Calendar, List, Search, Type } from "lucide-react";
9
+ import { useEffect, useLayoutEffect, useRef } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { useFormValues } from "alepha/react/form";
12
12
  //#region src/table/DataTableFilterBar.tsx
@@ -108,6 +108,7 @@ const DataTableFilterBar = (props) => {
108
108
  return [];
109
109
  };
110
110
  const itemsOf = (field) => {
111
+ if (typeof field.items === "function") return field.items(values);
111
112
  if (field.items) return field.items;
112
113
  const options = enumValuesOf(field);
113
114
  if (options.length === 0) return void 0;
@@ -125,7 +126,14 @@ const DataTableFilterBar = (props) => {
125
126
  };
126
127
  const placeholderOf = (field) => field.placeholder ?? field.control?.placeholder ?? (field.preset === "search" ? tr("dataTable.search", { default: "Search" }) : void 0);
127
128
  const labelOf = (field) => field.label ?? placeholderOf(field) ?? field.key;
128
- const iconOf = (field) => field.icon ?? (field.preset === "search" ? Search : void 0);
129
+ const iconOf = (field) => {
130
+ if (field.icon) return field.icon;
131
+ if (field.preset === "search") return Search;
132
+ const kind = kindOf(field);
133
+ if (kind === "date") return Calendar;
134
+ if (kind === "list") return List;
135
+ return Type;
136
+ };
129
137
  const clearField = (field) => {
130
138
  inputs[field.key]?.set(void 0);
131
139
  if (field.operators) inputs[operatorKeyOf(field)]?.set(void 0);
@@ -209,6 +217,7 @@ const DataTableFilterBar = (props) => {
209
217
  })
210
218
  }) }, field.key);
211
219
  }), !dialog && /* @__PURE__ */ jsx(DataTableFilterAdd, {
220
+ labeled: !ordered.some((field) => drawn(field)),
212
221
  items: props.fields.filter((field) => !isLocked(field) && !field.hidden && !shown.includes(field.key)).map((field) => ({
213
222
  key: field.key,
214
223
  label: labelOf(field),
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFilterBar.js","names":[],"sources":["../../src/table/DataTableFilterBar.tsx"],"sourcesContent":["import { type ZObject, type ZType, z } from \"alepha\";\nimport type { FormModel } from \"alepha/react/form\";\nimport { useFormValues } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { Search } from \"lucide-react\";\nimport { useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport { FilterSlot } from \"../core/FilterSlot.tsx\";\nimport { Control } from \"../form/Control.tsx\";\nimport type { SelectOption } from \"../form/ControlSelect.tsx\";\nimport type { DataTableFilterAddType } from \"./DataTableFilterAdd.tsx\";\nimport { DataTableFilterAdd } from \"./DataTableFilterAdd.tsx\";\nimport { DataTableFilterControl } from \"./DataTableFilterControl.tsx\";\nimport type { DataTableFilterOperatorOption } from \"./DataTableFilterOperator.tsx\";\nimport {\n DATA_TABLE_FILTER_OPERATORS,\n DataTableFilterOperator,\n} from \"./DataTableFilterOperator.tsx\";\nimport type {\n DataTableFilterFieldOptions,\n DataTableFilterMode,\n DataTableFilterPreset,\n} from \"./dataTableTypes.ts\";\n\nexport interface DataTableFilterBarProps {\n /**\n * The table's filter form. Every `key` below names one of its fields, and\n * so does every operator key.\n */\n form: FormModel<ZObject>;\n\n /**\n * Every filter, in declaration order: the order the bar draws them in and\n * the add menu lists them in.\n */\n fields: DataTableFilterBarField[];\n\n /**\n * Which filters are on the bar. The table's state, not the bar's, because\n * three things write it: this bar, Reset filters and persistence.\n *\n * A locked field is drawn whether or not it is in here.\n */\n shown: readonly string[];\n\n /**\n * The shown filters changed. `act` is true for the reader's own add or\n * remove, and false when a filter joined the bar because it holds a value:\n * that is not the reader choosing anything, and must not be stored.\n */\n onShownChange: (shown: string[], act: boolean) => void;\n\n /**\n * `\"dialog\"` draws every filter, each like a locked field, and no add menu:\n * the phone dialog is already the on-demand step, and a menu per filter\n * behind that button would be a second one.\n */\n variant?: \"bar\" | \"dialog\";\n}\n\n/**\n * The filter bar `DataTable` draws from `filters.fields`: the locked filters\n * (the search box), then the filters the reader put on the bar, then the menu\n * that adds one.\n *\n * **Which filters start on the bar is the field's `mode`.** An `optional`\n * field, the default, is off it until the reader adds it; a `default` field\n * is on it from the start and removable; a `locked` field is always there and\n * never removable. Showing every filter a table supports spends the width of\n * the bar on questions nobody has asked; four boxes reading \"Any status\",\n * \"Any team\", \"Any role\" say only that those columns exist.\n *\n * ⚠️ **A filter holding a value, or a non-default operator, is always on the\n * bar**, whatever its mode and however it got the value: restored from\n * persistence, read from a shared link, carried across a remount. Keyed on\n * the shown state alone, the bar came back empty while the table stayed\n * filtered, and \"Add filters\" handed back a filter that was already set. The\n * same holds for `hidden`: an empty hidden field is off the bar and out of the\n * menu, and a hidden field narrowing the list is still drawn, or the list\n * would be narrowed with nothing on screen saying why.\n *\n * **Operators** are optional per field, and each is a field of its own in the\n * filters schema, `<key>Op` unless `operatorKey` says otherwise. The backend\n * must declare the same key and values; a default operator sends no key at\n * all. See `DataTableFilterOperator` for why it is one switch rather than an\n * EQUAL toggle beside an OR/AND one.\n *\n * Internal to the table: a table given `fields` and no `filters.render`\n * mounts it, in the toolbar and in the phone dialog.\n *\n * Built and settled on the `apps/ui` showcase (`/blocks/data-table/basic`) in #Q2308.\n */\nexport const DataTableFilterBar = (props: DataTableFilterBarProps) => {\n const { tr } = useI18n();\n const values = useFormValues(props.form) as Record<string, unknown>;\n const dialog = props.variant === \"dialog\";\n const modeOf = (field: DataTableFilterBarField): DataTableFilterMode =>\n field.mode ?? (field.preset === \"search\" ? \"locked\" : \"optional\");\n const shown = props.shown;\n const root = useRef<HTMLDivElement>(null);\n // The filter to open once React has put it on screen. A REF, not state: the\n // effect below both reads and clears it, and clearing it with `setState`\n // inside an effect is a cascading render. Nothing renders from it.\n const pendingOpen = useRef<string | undefined>(undefined);\n // Which filters held a value at the last commit - see the operator effect.\n const heldValue = useRef<Record<string, boolean>>({});\n\n const inputs = props.form.input as unknown as Record<\n string,\n { set: (value: unknown) => void } | undefined\n >;\n\n const isSet = (key: string): boolean => {\n const value = values[key];\n return Array.isArray(value) ? value.length > 0 : Boolean(value);\n };\n\n const operatorKeyOf = (field: DataTableFilterBarField) =>\n field.operatorKey ?? `${field.key}Op`;\n\n // Narrowing the list, by a value or by an operator standing on its own.\n const holds = (field: DataTableFilterBarField): boolean =>\n isSet(field.key) || values[operatorKeyOf(field)] !== undefined;\n\n const isLocked = (field: DataTableFilterBarField) =>\n modeOf(field) === \"locked\";\n\n const operatorsOf = (\n field: DataTableFilterBarField,\n ): DataTableFilterOperatorOption[] | undefined => {\n if (!field.operators || typeof field.operators !== \"string\") {\n return field.operators as DataTableFilterOperatorOption[] | undefined;\n }\n // The values come from the one table the filter schema is built from; only\n // the words are this bar's. A value is labelled the same in every preset\n // it appears in, so one entry per value covers all three.\n const not = tr(\"dataTable.operator.prefixNot\", { default: \"not\" });\n const labels: Record<\n string,\n Omit<DataTableFilterOperatorOption, \"value\">\n > = {\n is: { label: tr(\"dataTable.operator.is\", { default: \"is\" }) },\n not: {\n label: tr(\"dataTable.operator.isNot\", { default: \"is not\" }),\n prefix: not,\n },\n any: { label: tr(\"dataTable.operator.anyOf\", { default: \"any of\" }) },\n all: {\n label: tr(\"dataTable.operator.allOf\", { default: \"all of\" }),\n prefix: tr(\"dataTable.operator.prefixAll\", { default: \"all\" }),\n },\n none: {\n label: tr(\"dataTable.operator.noneOf\", { default: \"none of\" }),\n prefix: not,\n },\n };\n return DATA_TABLE_FILTER_OPERATORS[field.operators].map((value) => ({\n value,\n label: labels[value]?.label ?? value,\n prefix: labels[value]?.prefix,\n }));\n };\n\n const operatorOf = (field: DataTableFilterBarField) => {\n const operators = operatorsOf(field);\n return (\n operators?.find(\n (operator) => operator.value === values[operatorKeyOf(field)],\n ) ?? operators?.[0]\n );\n };\n\n /**\n * The schema a field is read with, stripped of `.optional()`: its own, or\n * `z.string()` for the search preset.\n */\n const schemaOf = (field: DataTableFilterBarField): ZType | undefined =>\n field.schema\n ? z.schema.unwrap(field.schema)\n : field.preset === \"search\"\n ? z.string()\n : undefined;\n\n /**\n * The values an enum schema, or an array of one, allows. Empty for any\n * other schema.\n */\n const enumValuesOf = (field: DataTableFilterBarField): string[] => {\n const schema = schemaOf(field);\n if (!schema) return [];\n if (z.schema.isEnum(schema)) return z.schema.enumValues(schema);\n if (z.schema.isArray(schema)) {\n const element = z.schema.unwrap(z.schema.element(schema));\n if (z.schema.isEnum(element)) return z.schema.enumValues(element);\n }\n return [];\n };\n\n // Live data first, then the enum the schema declares. A bare string falls\n // back to the select's own label for it.\n const itemsOf = (\n field: DataTableFilterBarField,\n ): SelectOption[] | undefined => {\n if (field.items) return field.items;\n const options = enumValuesOf(field);\n if (options.length === 0) return undefined;\n const optionLabel = field.optionLabel;\n return optionLabel\n ? options.map((value) => ({ value, label: optionLabel(value) }))\n : options;\n };\n\n // Classified in `Control`'s own order, so the menu names the control the\n // filter will actually draw.\n const kindOf = (field: DataTableFilterBarField): DataTableFilterAddType => {\n const schema = schemaOf(field);\n // Before the list test, as `Control` orders it: a range IS an array, and\n // tested as one it would be offered as a list and drawn as a calendar.\n if (schema && z.schema.isDateRange(schema)) return \"date\";\n if (\n field.items ||\n (schema && (z.schema.isEnum(schema) || z.schema.isArray(schema)))\n ) {\n return \"list\";\n }\n return \"text\";\n };\n\n const placeholderOf = (field: DataTableFilterBarField) =>\n field.placeholder ??\n field.control?.placeholder ??\n (field.preset === \"search\"\n ? tr(\"dataTable.search\", { default: \"Search\" })\n : undefined);\n\n const labelOf = (field: DataTableFilterBarField) =>\n field.label ?? placeholderOf(field) ?? field.key;\n\n const iconOf = (field: DataTableFilterBarField) =>\n field.icon ?? (field.preset === \"search\" ? Search : undefined);\n\n // A filter goes back to its default operator as its value goes: an\n // operator standing with nothing to qualify still counts as a filter in the\n // table's reset button and badge, while narrowing nothing.\n const clearField = (field: DataTableFilterBarField) => {\n inputs[field.key]?.set(undefined);\n if (field.operators) inputs[operatorKeyOf(field)]?.set(undefined);\n };\n\n useEffect(() => {\n const key = pendingOpen.current;\n if (!key) return;\n pendingOpen.current = undefined;\n // ⚠️ Opening the new filter has to happen from OUT HERE, after the render\n // that mounts it: inside the menu's click handler the control does not\n // exist yet. Driven through the DOM because `Control` exposes no\n // imperative \"open\" - a combobox owns that state, and a date range's\n // popover owns its own. A text filter has no list, so it is focused\n // instead. Scoped to this bar, so two tables on one page cannot open each\n // other's filters.\n const slot = root.current?.querySelector(`[data-filter=\"${key}\"]`);\n const trigger = slot?.querySelector<HTMLElement>(\n '[data-slot=\"combobox-trigger\"], [data-slot=\"date-trigger\"]',\n );\n if (trigger) {\n trigger.click();\n return;\n }\n slot?.querySelector<HTMLInputElement>('[data-slot=\"input\"]')?.focus();\n }, [shown]);\n\n useEffect(() => {\n // The other way a value empties: unticked inside the list, or cleared by\n // a locked field's own cross, rather than cleared by the button. Only on\n // the transition from set to empty, so a reader who picks \"is not\" BEFORE\n // picking a value keeps it, and a persisted operator survives the mount\n // it is restored on.\n for (const field of props.fields) {\n const set = isSet(field.key);\n const operatorKey = operatorKeyOf(field);\n if (\n field.operators &&\n heldValue.current[field.key] &&\n !set &&\n values[operatorKey] !== undefined\n ) {\n inputs[operatorKey]?.set(undefined);\n }\n heldValue.current[field.key] = set;\n }\n }, [values]);\n\n // A field holding a value or an operator joins `shown` the moment it is\n // seen - see the docblock. Folded INTO `shown` rather than drawn as\n // `shown ∪ set`, because a filter visible only for holding a value would\n // unmount the instant the reader emptied it, list open and cursor on it.\n // Locked fields are drawn regardless and never join it, and the dialog\n // draws every field.\n const unshown = dialog\n ? []\n : props.fields\n .filter(\n (field) =>\n !isLocked(field) && holds(field) && !shown.includes(field.key),\n )\n .map((field) => field.key);\n\n // The table's state cannot be set from this component's render, so it is\n // set in a LAYOUT effect: React flushes that update synchronously, before\n // the browser paints, so no frame shows the bar without the filter. The\n // guard stops it looping - it only fires while something is missing, and\n // the update adds exactly that.\n useLayoutEffect(() => {\n if (unshown.length > 0) {\n props.onShownChange([...shown, ...unshown], false);\n }\n });\n\n const drawn = (field: DataTableFilterBarField): boolean => {\n if (field.hidden && !holds(field)) return false;\n if (dialog || isLocked(field)) return true;\n return shown.includes(field.key);\n };\n\n // Locked first, in declaration order, then the shown ones in the order they\n // joined the bar: an added filter goes to the END, beside the \"+\" that\n // brought it, not back to its declared slot. Added D, C, B, A reads\n // D C B A. The dialog keeps the declaration as it is: nothing there is\n // added or removed.\n const rank = (field: DataTableFilterBarField) => {\n const index = shown.indexOf(field.key);\n return index === -1 ? Number.MAX_SAFE_INTEGER : index;\n };\n const ordered = dialog\n ? props.fields\n : [\n ...props.fields.filter((field) => isLocked(field)),\n ...props.fields\n .filter((field) => !isLocked(field))\n .sort((a, b) => rank(a) - rank(b)),\n ];\n\n return (\n // `contents`, so the slots are items of the table's own wrapping row (and\n // of the phone dialog's grid) exactly as a caller's bare fragment is.\n <div ref={root} className=\"contents\">\n {ordered\n .filter((field) => drawn(field))\n .map((field) => {\n // In the dialog every filter is drawn like a locked one: no\n // clear-and-remove button, the control's own cross resets it.\n const removable = !dialog && !isLocked(field);\n const operators = operatorsOf(field);\n const operator = operatorOf(field);\n const label = labelOf(field);\n return (\n <FilterSlot key={field.key}>\n <div data-filter={field.key}>\n <DataTableFilterControl\n label={label}\n active={isSet(field.key)}\n // A cross empties a filter holding a value; a funnel-x\n // removes an empty one. `active` picks between the two.\n // A locked filter is given neither, so it keeps the cross\n // inside its own field.\n onClear={removable ? () => clearField(field) : undefined}\n onRemove={\n removable\n ? () => {\n clearField(field);\n props.onShownChange(\n shown.filter((key) => key !== field.key),\n true,\n );\n }\n : undefined\n }\n >\n <Control\n {...field.control}\n input={inputs[field.key] as never}\n label=\"\"\n icon={iconOf(field)}\n clearable\n placeholder={placeholderOf(field)}\n items={itemsOf(field) as never}\n // The filter's name, as the control's accessible name:\n // an empty select says only its placeholder, and a set\n // one only its value. A name the caller gave wins.\n inputProps={{\n \"aria-label\": label,\n // A text filter is as wide as its placeholder. The slot\n // grows from its content, and an input's content width\n // is its `size` in characters (20 by default), so a\n // long placeholder was cut at the slot's minimum.\n ...(kindOf(field) === \"text\"\n ? {\n size: Math.max(\n 20,\n placeholderOf(field)?.length ?? 0,\n ),\n }\n : {}),\n ...field.control?.inputProps,\n }}\n // The filter's name, and a non-default operator, muted in\n // front of the value: \"Status: not Active\". An empty\n // select draws no prefix; its placeholder names it. The\n // colon is a catalog entry because French spaces it.\n triggerPrefix={[\n tr(\"dataTable.filterName\", {\n default: `${label}:`,\n args: [label],\n }),\n operator?.prefix,\n ]\n .filter(Boolean)\n .join(\" \")}\n // Sized from its content, not the trigger: the trigger\n // grows as the reader picks, and a popup tied to it would\n // widen under the cursor.\n popupClassName=\"w-max min-w-48\"\n popupHeader={\n operators && (\n <DataTableFilterOperator\n options={operators}\n value={operator?.value}\n onChange={(value) =>\n inputs[operatorKeyOf(field)]?.set(value)\n }\n />\n )\n }\n />\n </DataTableFilterControl>\n </div>\n </FilterSlot>\n );\n })}\n\n {!dialog && (\n <DataTableFilterAdd\n items={props.fields\n .filter(\n (field) =>\n !isLocked(field) && !field.hidden && !shown.includes(field.key),\n )\n .map((field) => ({\n key: field.key,\n label: labelOf(field),\n icon: iconOf(field),\n type: kindOf(field),\n }))}\n onAdd={(key) => {\n pendingOpen.current = key;\n props.onShownChange([...shown, key], true);\n }}\n />\n )}\n </div>\n );\n};\n\n/**\n * One filter of the bar: a field of `filters.fields` with its key, as the\n * table hands it over. `schema` is the one the table read at mount, and gives\n * the options of an enum and the kind the add menu names.\n */\nexport interface DataTableFilterBarField extends DataTableFilterFieldOptions {\n /**\n * The form field this filter writes.\n */\n key: string;\n schema?: ZType;\n preset?: DataTableFilterPreset;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,MAAa,sBAAsB,UAAmC;CACpE,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,SAAS,cAAc,MAAM,IAAI;CACvC,MAAM,SAAS,MAAM,YAAY;CACjC,MAAM,UAAU,UACd,MAAM,SAAS,MAAM,WAAW,WAAW,WAAW;CACxD,MAAM,QAAQ,MAAM;CACpB,MAAM,OAAO,OAAuB,IAAI;CAIxC,MAAM,cAAc,OAA2B,KAAA,CAAS;CAExD,MAAM,YAAY,OAAgC,CAAC,CAAC;CAEpD,MAAM,SAAS,MAAM,KAAK;CAK1B,MAAM,SAAS,QAAyB;EACtC,MAAM,QAAQ,OAAO;EACrB,OAAO,MAAM,QAAQ,KAAK,IAAI,MAAM,SAAS,IAAI,QAAQ,KAAK;CAChE;CAEA,MAAM,iBAAiB,UACrB,MAAM,eAAe,GAAG,MAAM,IAAI;CAGpC,MAAM,SAAS,UACb,MAAM,MAAM,GAAG,KAAK,OAAO,cAAc,KAAK,OAAO,KAAA;CAEvD,MAAM,YAAY,UAChB,OAAO,KAAK,MAAM;CAEpB,MAAM,eACJ,UACgD;EAChD,IAAI,CAAC,MAAM,aAAa,OAAO,MAAM,cAAc,UACjD,OAAO,MAAM;EAKf,MAAM,MAAM,GAAG,gCAAgC,EAAE,SAAS,MAAM,CAAC;EACjE,MAAM,SAGF;GACF,IAAI,EAAE,OAAO,GAAG,yBAAyB,EAAE,SAAS,KAAK,CAAC,EAAE;GAC5D,KAAK;IACH,OAAO,GAAG,4BAA4B,EAAE,SAAS,SAAS,CAAC;IAC3D,QAAQ;GACV;GACA,KAAK,EAAE,OAAO,GAAG,4BAA4B,EAAE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
1
+ {"version":3,"file":"DataTableFilterBar.js","names":[],"sources":["../../src/table/DataTableFilterBar.tsx"],"sourcesContent":["import { type ZObject, type ZType, z } from \"alepha\";\nimport type { FormModel } from \"alepha/react/form\";\nimport { useFormValues } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { Calendar, List, Search, Type } from \"lucide-react\";\nimport { useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport { FilterSlot } from \"../core/FilterSlot.tsx\";\nimport { Control } from \"../form/Control.tsx\";\nimport type { SelectOption } from \"../form/ControlSelect.tsx\";\nimport type { DataTableFilterAddType } from \"./DataTableFilterAdd.tsx\";\nimport { DataTableFilterAdd } from \"./DataTableFilterAdd.tsx\";\nimport { DataTableFilterControl } from \"./DataTableFilterControl.tsx\";\nimport type { DataTableFilterOperatorOption } from \"./DataTableFilterOperator.tsx\";\nimport {\n DATA_TABLE_FILTER_OPERATORS,\n DataTableFilterOperator,\n} from \"./DataTableFilterOperator.tsx\";\nimport type {\n DataTableFilterFieldOptions,\n DataTableFilterMode,\n DataTableFilterPreset,\n} from \"./dataTableTypes.ts\";\n\nexport interface DataTableFilterBarProps {\n /**\n * The table's filter form. Every `key` below names one of its fields, and\n * so does every operator key.\n */\n form: FormModel<ZObject>;\n\n /**\n * Every filter, in declaration order: the order the bar draws them in and\n * the add menu lists them in.\n */\n fields: DataTableFilterBarField[];\n\n /**\n * Which filters are on the bar. The table's state, not the bar's, because\n * three things write it: this bar, Reset filters and persistence.\n *\n * A locked field is drawn whether or not it is in here.\n */\n shown: readonly string[];\n\n /**\n * The shown filters changed. `act` is true for the reader's own add or\n * remove, and false when a filter joined the bar because it holds a value:\n * that is not the reader choosing anything, and must not be stored.\n */\n onShownChange: (shown: string[], act: boolean) => void;\n\n /**\n * `\"dialog\"` draws every filter, each like a locked field, and no add menu:\n * the phone dialog is already the on-demand step, and a menu per filter\n * behind that button would be a second one.\n */\n variant?: \"bar\" | \"dialog\";\n}\n\n/**\n * The filter bar `DataTable` draws from `filters.fields`: the locked filters\n * (the search box), then the filters the reader put on the bar, then the menu\n * that adds one.\n *\n * **Which filters start on the bar is the field's `mode`.** An `optional`\n * field, the default, is off it until the reader adds it; a `default` field\n * is on it from the start and removable; a `locked` field is always there and\n * never removable. Showing every filter a table supports spends the width of\n * the bar on questions nobody has asked; four boxes reading \"Any status\",\n * \"Any team\", \"Any role\" say only that those columns exist.\n *\n * ⚠️ **A filter holding a value, or a non-default operator, is always on the\n * bar**, whatever its mode and however it got the value: restored from\n * persistence, read from a shared link, carried across a remount. Keyed on\n * the shown state alone, the bar came back empty while the table stayed\n * filtered, and \"Add filters\" handed back a filter that was already set. The\n * same holds for `hidden`: an empty hidden field is off the bar and out of the\n * menu, and a hidden field narrowing the list is still drawn, or the list\n * would be narrowed with nothing on screen saying why.\n *\n * **Operators** are optional per field, and each is a field of its own in the\n * filters schema, `<key>Op` unless `operatorKey` says otherwise. The backend\n * must declare the same key and values; a default operator sends no key at\n * all. See `DataTableFilterOperator` for why it is one switch rather than an\n * EQUAL toggle beside an OR/AND one.\n *\n * Internal to the table: a table given `fields` and no `filters.render`\n * mounts it, in the toolbar and in the phone dialog.\n *\n * Built and settled on the `apps/ui` showcase (`/blocks/data-table/basic`) in #Q2308.\n */\nexport const DataTableFilterBar = (props: DataTableFilterBarProps) => {\n const { tr } = useI18n();\n const values = useFormValues(props.form) as Record<string, unknown>;\n const dialog = props.variant === \"dialog\";\n const modeOf = (field: DataTableFilterBarField): DataTableFilterMode =>\n field.mode ?? (field.preset === \"search\" ? \"locked\" : \"optional\");\n const shown = props.shown;\n const root = useRef<HTMLDivElement>(null);\n // The filter to open once React has put it on screen. A REF, not state: the\n // effect below both reads and clears it, and clearing it with `setState`\n // inside an effect is a cascading render. Nothing renders from it.\n const pendingOpen = useRef<string | undefined>(undefined);\n // Which filters held a value at the last commit - see the operator effect.\n const heldValue = useRef<Record<string, boolean>>({});\n\n const inputs = props.form.input as unknown as Record<\n string,\n { set: (value: unknown) => void } | undefined\n >;\n\n const isSet = (key: string): boolean => {\n const value = values[key];\n return Array.isArray(value) ? value.length > 0 : Boolean(value);\n };\n\n const operatorKeyOf = (field: DataTableFilterBarField) =>\n field.operatorKey ?? `${field.key}Op`;\n\n // Narrowing the list, by a value or by an operator standing on its own.\n const holds = (field: DataTableFilterBarField): boolean =>\n isSet(field.key) || values[operatorKeyOf(field)] !== undefined;\n\n const isLocked = (field: DataTableFilterBarField) =>\n modeOf(field) === \"locked\";\n\n const operatorsOf = (\n field: DataTableFilterBarField,\n ): DataTableFilterOperatorOption[] | undefined => {\n if (!field.operators || typeof field.operators !== \"string\") {\n return field.operators as DataTableFilterOperatorOption[] | undefined;\n }\n // The values come from the one table the filter schema is built from; only\n // the words are this bar's. A value is labelled the same in every preset\n // it appears in, so one entry per value covers all three.\n const not = tr(\"dataTable.operator.prefixNot\", { default: \"not\" });\n const labels: Record<\n string,\n Omit<DataTableFilterOperatorOption, \"value\">\n > = {\n is: { label: tr(\"dataTable.operator.is\", { default: \"is\" }) },\n not: {\n label: tr(\"dataTable.operator.isNot\", { default: \"is not\" }),\n prefix: not,\n },\n any: { label: tr(\"dataTable.operator.anyOf\", { default: \"any of\" }) },\n all: {\n label: tr(\"dataTable.operator.allOf\", { default: \"all of\" }),\n prefix: tr(\"dataTable.operator.prefixAll\", { default: \"all\" }),\n },\n none: {\n label: tr(\"dataTable.operator.noneOf\", { default: \"none of\" }),\n prefix: not,\n },\n };\n return DATA_TABLE_FILTER_OPERATORS[field.operators].map((value) => ({\n value,\n label: labels[value]?.label ?? value,\n prefix: labels[value]?.prefix,\n }));\n };\n\n const operatorOf = (field: DataTableFilterBarField) => {\n const operators = operatorsOf(field);\n return (\n operators?.find(\n (operator) => operator.value === values[operatorKeyOf(field)],\n ) ?? operators?.[0]\n );\n };\n\n /**\n * The schema a field is read with, stripped of `.optional()`: its own, or\n * `z.string()` for the search preset.\n */\n const schemaOf = (field: DataTableFilterBarField): ZType | undefined =>\n field.schema\n ? z.schema.unwrap(field.schema)\n : field.preset === \"search\"\n ? z.string()\n : undefined;\n\n /**\n * The values an enum schema, or an array of one, allows. Empty for any\n * other schema.\n */\n const enumValuesOf = (field: DataTableFilterBarField): string[] => {\n const schema = schemaOf(field);\n if (!schema) return [];\n if (z.schema.isEnum(schema)) return z.schema.enumValues(schema);\n if (z.schema.isArray(schema)) {\n const element = z.schema.unwrap(z.schema.element(schema));\n if (z.schema.isEnum(element)) return z.schema.enumValues(element);\n }\n return [];\n };\n\n // Live data first, then the enum the schema declares. A bare string falls\n // back to the select's own label for it.\n const itemsOf = (\n field: DataTableFilterBarField,\n ): SelectOption[] | undefined => {\n if (typeof field.items === \"function\") return field.items(values);\n if (field.items) return field.items;\n const options = enumValuesOf(field);\n if (options.length === 0) return undefined;\n const optionLabel = field.optionLabel;\n return optionLabel\n ? options.map((value) => ({ value, label: optionLabel(value) }))\n : options;\n };\n\n // Classified in `Control`'s own order, so the menu names the control the\n // filter will actually draw.\n const kindOf = (field: DataTableFilterBarField): DataTableFilterAddType => {\n const schema = schemaOf(field);\n // Before the list test, as `Control` orders it: a range IS an array, and\n // tested as one it would be offered as a list and drawn as a calendar.\n if (schema && z.schema.isDateRange(schema)) return \"date\";\n if (\n field.items ||\n (schema && (z.schema.isEnum(schema) || z.schema.isArray(schema)))\n ) {\n return \"list\";\n }\n return \"text\";\n };\n\n const placeholderOf = (field: DataTableFilterBarField) =>\n field.placeholder ??\n field.control?.placeholder ??\n (field.preset === \"search\"\n ? tr(\"dataTable.search\", { default: \"Search\" })\n : undefined);\n\n const labelOf = (field: DataTableFilterBarField) =>\n field.label ?? placeholderOf(field) ?? field.key;\n\n // Every filter has an icon, as every `Control` does: the caller's, the\n // search glyph for the search preset, else its kind's (the same glyphs the\n // controls fall back to). Without the last step a filter the caller gave no\n // icon was the one bare row of the add menu (\"When\", beside \"Resource\" and\n // \"What\").\n const iconOf = (field: DataTableFilterBarField) => {\n if (field.icon) return field.icon;\n if (field.preset === \"search\") return Search;\n const kind = kindOf(field);\n if (kind === \"date\") return Calendar;\n if (kind === \"list\") return List;\n return Type;\n };\n\n // A filter goes back to its default operator as its value goes: an\n // operator standing with nothing to qualify still counts as a filter in the\n // table's reset button and badge, while narrowing nothing.\n const clearField = (field: DataTableFilterBarField) => {\n inputs[field.key]?.set(undefined);\n if (field.operators) inputs[operatorKeyOf(field)]?.set(undefined);\n };\n\n useEffect(() => {\n const key = pendingOpen.current;\n if (!key) return;\n pendingOpen.current = undefined;\n // ⚠️ Opening the new filter has to happen from OUT HERE, after the render\n // that mounts it: inside the menu's click handler the control does not\n // exist yet. Driven through the DOM because `Control` exposes no\n // imperative \"open\" - a combobox owns that state, and a date range's\n // popover owns its own. A text filter has no list, so it is focused\n // instead. Scoped to this bar, so two tables on one page cannot open each\n // other's filters.\n const slot = root.current?.querySelector(`[data-filter=\"${key}\"]`);\n const trigger = slot?.querySelector<HTMLElement>(\n '[data-slot=\"combobox-trigger\"], [data-slot=\"date-trigger\"]',\n );\n if (trigger) {\n trigger.click();\n return;\n }\n slot?.querySelector<HTMLInputElement>('[data-slot=\"input\"]')?.focus();\n }, [shown]);\n\n useEffect(() => {\n // The other way a value empties: unticked inside the list, or cleared by\n // a locked field's own cross, rather than cleared by the button. Only on\n // the transition from set to empty, so a reader who picks \"is not\" BEFORE\n // picking a value keeps it, and a persisted operator survives the mount\n // it is restored on.\n for (const field of props.fields) {\n const set = isSet(field.key);\n const operatorKey = operatorKeyOf(field);\n if (\n field.operators &&\n heldValue.current[field.key] &&\n !set &&\n values[operatorKey] !== undefined\n ) {\n inputs[operatorKey]?.set(undefined);\n }\n heldValue.current[field.key] = set;\n }\n }, [values]);\n\n // A field holding a value or an operator joins `shown` the moment it is\n // seen - see the docblock. Folded INTO `shown` rather than drawn as\n // `shown ∪ set`, because a filter visible only for holding a value would\n // unmount the instant the reader emptied it, list open and cursor on it.\n // Locked fields are drawn regardless and never join it, and the dialog\n // draws every field.\n const unshown = dialog\n ? []\n : props.fields\n .filter(\n (field) =>\n !isLocked(field) && holds(field) && !shown.includes(field.key),\n )\n .map((field) => field.key);\n\n // The table's state cannot be set from this component's render, so it is\n // set in a LAYOUT effect: React flushes that update synchronously, before\n // the browser paints, so no frame shows the bar without the filter. The\n // guard stops it looping - it only fires while something is missing, and\n // the update adds exactly that.\n useLayoutEffect(() => {\n if (unshown.length > 0) {\n props.onShownChange([...shown, ...unshown], false);\n }\n });\n\n const drawn = (field: DataTableFilterBarField): boolean => {\n if (field.hidden && !holds(field)) return false;\n if (dialog || isLocked(field)) return true;\n return shown.includes(field.key);\n };\n\n // Locked first, in declaration order, then the shown ones in the order they\n // joined the bar: an added filter goes to the END, beside the \"+\" that\n // brought it, not back to its declared slot. Added D, C, B, A reads\n // D C B A. The dialog keeps the declaration as it is: nothing there is\n // added or removed.\n const rank = (field: DataTableFilterBarField) => {\n const index = shown.indexOf(field.key);\n return index === -1 ? Number.MAX_SAFE_INTEGER : index;\n };\n const ordered = dialog\n ? props.fields\n : [\n ...props.fields.filter((field) => isLocked(field)),\n ...props.fields\n .filter((field) => !isLocked(field))\n .sort((a, b) => rank(a) - rank(b)),\n ];\n\n return (\n // `contents`, so the slots are items of the table's own wrapping row (and\n // of the phone dialog's grid) exactly as a caller's bare fragment is.\n <div ref={root} className=\"contents\">\n {ordered\n .filter((field) => drawn(field))\n .map((field) => {\n // In the dialog every filter is drawn like a locked one: no\n // clear-and-remove button, the control's own cross resets it.\n const removable = !dialog && !isLocked(field);\n const operators = operatorsOf(field);\n const operator = operatorOf(field);\n const label = labelOf(field);\n return (\n <FilterSlot key={field.key}>\n <div data-filter={field.key}>\n <DataTableFilterControl\n label={label}\n active={isSet(field.key)}\n // A cross empties a filter holding a value; a funnel-x\n // removes an empty one. `active` picks between the two.\n // A locked filter is given neither, so it keeps the cross\n // inside its own field.\n onClear={removable ? () => clearField(field) : undefined}\n onRemove={\n removable\n ? () => {\n clearField(field);\n props.onShownChange(\n shown.filter((key) => key !== field.key),\n true,\n );\n }\n : undefined\n }\n >\n <Control\n {...field.control}\n input={inputs[field.key] as never}\n label=\"\"\n icon={iconOf(field)}\n clearable\n placeholder={placeholderOf(field)}\n items={itemsOf(field) as never}\n // The filter's name, as the control's accessible name:\n // an empty select says only its placeholder, and a set\n // one only its value. A name the caller gave wins.\n inputProps={{\n \"aria-label\": label,\n // A text filter is as wide as its placeholder. The slot\n // grows from its content, and an input's content width\n // is its `size` in characters (20 by default), so a\n // long placeholder was cut at the slot's minimum.\n ...(kindOf(field) === \"text\"\n ? {\n size: Math.max(\n 20,\n placeholderOf(field)?.length ?? 0,\n ),\n }\n : {}),\n ...field.control?.inputProps,\n }}\n // The filter's name, and a non-default operator, muted in\n // front of the value: \"Status: not Active\". An empty\n // select draws no prefix; its placeholder names it. The\n // colon is a catalog entry because French spaces it.\n triggerPrefix={[\n tr(\"dataTable.filterName\", {\n default: `${label}:`,\n args: [label],\n }),\n operator?.prefix,\n ]\n .filter(Boolean)\n .join(\" \")}\n // Sized from its content, not the trigger: the trigger\n // grows as the reader picks, and a popup tied to it would\n // widen under the cursor.\n popupClassName=\"w-max min-w-48\"\n popupHeader={\n operators && (\n <DataTableFilterOperator\n options={operators}\n value={operator?.value}\n onChange={(value) =>\n inputs[operatorKeyOf(field)]?.set(value)\n }\n />\n )\n }\n />\n </DataTableFilterControl>\n </div>\n </FilterSlot>\n );\n })}\n\n {!dialog && (\n <DataTableFilterAdd\n labeled={!ordered.some((field) => drawn(field))}\n items={props.fields\n .filter(\n (field) =>\n !isLocked(field) && !field.hidden && !shown.includes(field.key),\n )\n .map((field) => ({\n key: field.key,\n label: labelOf(field),\n icon: iconOf(field),\n type: kindOf(field),\n }))}\n onAdd={(key) => {\n pendingOpen.current = key;\n props.onShownChange([...shown, key], true);\n }}\n />\n )}\n </div>\n );\n};\n\n/**\n * One filter of the bar: a field of `filters.fields` with its key, as the\n * table hands it over. `schema` is the one the table read at mount, and gives\n * the options of an enum and the kind the add menu names.\n */\nexport interface DataTableFilterBarField extends DataTableFilterFieldOptions {\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AO,KAAK;IAClB,MAAM,OAAO,KAAK;GACpB,EAAE;GACJ,QAAQ,QAAQ;IACd,YAAY,UAAU;IACtB,MAAM,cAAc,CAAC,GAAG,OAAO,GAAG,GAAG,IAAI;GAC3C;EACD,CAAA,CAEA;;AAET"}
@@ -96,7 +96,7 @@ export interface DataTableFilterControlProps {
96
96
  * from the icon changing.
97
97
  *
98
98
  * ⚠️ The tooltip needs a `TooltipProvider` above it, like every other tooltip
99
- * in this package; `apps/ui` and `apps/lore` both mount one in their layout.
99
+ * in this package; `apps/ui` and Lore both mount one in their layout.
100
100
  *
101
101
  * The value has to clear through `onClear` rather than through the control,
102
102
  * because the container is given `active` and cannot reach into the field it
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../core/utils.js";
2
2
  import { Tooltip, TooltipContent, TooltipTrigger } from "../core/Tooltip.js";
3
- import { FunnelX, X } from "lucide-react";
4
3
  import { useI18n } from "alepha/react/i18n";
4
+ import { FunnelX, X } from "lucide-react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/table/DataTableFilterControl.tsx
7
7
  /**
@@ -51,7 +51,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
51
51
  * from the icon changing.
52
52
  *
53
53
  * ⚠️ The tooltip needs a `TooltipProvider` above it, like every other tooltip
54
- * in this package; `apps/ui` and `apps/lore` both mount one in their layout.
54
+ * in this package; `apps/ui` and Lore both mount one in their layout.
55
55
  *
56
56
  * The value has to clear through `onClear` rather than through the control,
57
57
  * because the container is given `active` and cannot reach into the field it
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFilterControl.js","names":[],"sources":["../../src/table/DataTableFilterControl.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { FunnelX, X } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../core/Tooltip.tsx\";\nimport { cn } from \"../core/utils.ts\";\n\nexport interface DataTableFilterControlProps {\n /**\n * What this filter is called. Not drawn here - a set select names itself on\n * its trigger through `triggerPrefix` (\"Status not Active\"), and an empty\n * one through its placeholder - but it names the button (\"Remove filter:\n * Status\"), which is the only accessible name that button will ever have.\n *\n * ⚠️ It was also a hover tooltip on the control, and that was removed on\n * 2026-09-13: once the trigger carries the name, the tooltip repeated what\n * was already on screen.\n */\n label: string;\n\n /**\n * The filter itself, unchanged: a `Control` with `label=\"\"`, exactly as it\n * is written today. This component adds chrome AROUND a control and never\n * alters one.\n */\n children: ReactNode;\n\n /**\n * Take this filter out of the bar.\n *\n * ⚠️ NOT \"clear its value\" - that is `onClear`, and the cross runs them in\n * that order (see the docblock below). A filter with neither draws no cross\n * at all, which is how the bar keeps a filter that may not leave.\n *\n * The caller is expected to clear the filter's value as it removes it.\n * Removing a filter that is still narrowing the list leaves the reader with\n * a shorter list and nothing on screen explaining why.\n */\n onRemove?: () => void;\n\n /**\n * Empty this filter without taking it out of the bar.\n *\n * Given alongside `onRemove`, it becomes the cross's FIRST act: a filter\n * holding a value is cleared, and only a filter already empty is removed.\n * Given alone - the search box, which may not leave - the cross appears\n * only while there is something to clear and does nothing else.\n */\n onClear?: () => void;\n\n /**\n * Whether this filter currently holds a value. Draws nothing: the value on\n * the trigger already says it, and a darker border on top of that was\n * tried and dropped on 2026-09-13.\n *\n * ⚠️ It decides which act the cross performs, so a caller that passes\n * `onClear` and forgets this gets a cross that removes a filter the reader\n * expected it to empty.\n */\n active?: boolean;\n}\n\n/**\n * One filter's slot in a `DataTable` filter bar: the control, and the\n * cross that removes it.\n *\n * **One box, not a control with a button beside it.** The container draws the\n * border and the control inside is stripped of its own, so the remove action\n * reads as part of the field rather than as a separate thing that happens to\n * be adjacent - which is what a detached button looked like, and why it was\n * never obvious which filter a cross belonged to in a row of four.\n *\n * ```text\n * ( icon Any status ▾ │ × )\n * ```\n *\n * ⚠️ Three other designs were built and thrown away on 2026-09-12, and the\n * reasons are worth keeping so they are not re-proposed: a detached trailing\n * button (ambiguous ownership, and it truncated the control it sat beside); a\n * strip of actions sliding out from behind the control on hover (nothing\n * discoverable, and it overlapped whatever the page put above the bar); and\n * an always-present label row carrying the actions (cost a row of labels that\n * `label=\"\"` exists to remove). This is what survived.\n *\n * ⚠️ The control's own `clearable` cross is HIDDEN here whenever this draws a\n * button. Two crosses a few pixels apart - one clearing the VALUE, one\n * removing the FILTER - is the ambiguity this design exists to remove, and at\n * this size they are the same glyph. It hides the affordance, not the\n * capability: the one button does both jobs in turn.\n *\n * Given neither `onClear` nor `onRemove`, it draws no button and hides\n * nothing, so the control keeps the cross inside its own field. That is the\n * search box: a filter that never leaves the bar has only one job for a cross,\n * and the field's own is the one every search box has.\n *\n * **The button is staged: clear, then remove.** A filter holding a value is\n * emptied by the first click and removed by the second, and the two acts do\n * not share a glyph: a cross empties the field, a struck-through funnel takes\n * the filter out of the bar. The destructive half is therefore never the one\n * a reader reaches first, and never wears the icon of the other - which\n * matters because emptying a filter is what they usually mean, and a filter\n * they configured and then lost to a stray click has to be added and\n * configured again.\n *\n * The stage is legible before the click from the icon, the tooltip (\"Clear\n * value\" against \"Remove filter\") and the accessible name, and afterwards\n * from the icon changing.\n *\n * ⚠️ The tooltip needs a `TooltipProvider` above it, like every other tooltip\n * in this package; `apps/ui` and `apps/lore` both mount one in their layout.\n *\n * The value has to clear through `onClear` rather than through the control,\n * because the container is given `active` and cannot reach into the field it\n * wraps - the caller owns the form.\n */\nexport const DataTableFilterControl = (props: DataTableFilterControlProps) => {\n const { tr } = useI18n();\n // The first act while the filter holds a value, the second once it is\n // empty. `onClear` alone never escalates: the search box may not leave.\n const clears = Boolean(props.onClear && props.active);\n const action = clears ? props.onClear : props.onRemove;\n const ActionIcon = clears ? X : FunnelX;\n // ⚠️ Two labels, and they are not the same string. The TOOLTIP names the\n // act and nothing else - it is read beside the filter it belongs to, so\n // repeating that filter's name in it is noise on every hover. The\n // ACCESSIBLE name has to carry the filter, because a screen reader meets\n // these buttons as a list and \"Remove filter\" four times over says which\n // one it is about exactly never.\n const label = String(\n clears\n ? tr(\"dataTable.clearValue\", { default: \"Clear value\" })\n : tr(\"dataTable.removeFilter\", { default: \"Remove filter\" }),\n );\n const actionLabel = `${label}: ${props.label}`;\n\n return (\n <div\n className={cn(\n \"bg-background border-border flex items-stretch overflow-hidden rounded-md border\",\n // The field's own two states, moved out to the container: it is the\n // thing with a border now, so it has to answer for them.\n \"hover:border-border-hover\",\n \"has-[:focus-visible]:border-ring has-[:focus-visible]:ring-ring/50 has-[:focus-visible]:ring-[3px]\",\n // The control keeps its layout and loses only its frame. Every slot\n // is covered because a text filter draws `input`, a select draws\n // `combobox-trigger` and a date range draws `date-trigger`, and a bar\n // mixes the three.\n //\n // ⚠️ The ring has to go as well as the border. Leaving it turns focus\n // into a rounded rectangle floating INSIDE the container, which looks\n // like a rendering bug rather than a focused field.\n \"[&_[data-slot=input]]:rounded-none [&_[data-slot=input]]:border-0 [&_[data-slot=input]]:bg-transparent [&_[data-slot=input]]:shadow-none [&_[data-slot=input]]:focus-visible:ring-0\",\n \"[&_[data-slot=combobox-trigger]]:rounded-none [&_[data-slot=combobox-trigger]]:border-0 [&_[data-slot=combobox-trigger]]:bg-transparent [&_[data-slot=combobox-trigger]]:shadow-none [&_[data-slot=combobox-trigger]]:focus-visible:ring-0\",\n \"[&_[data-slot=date-trigger]]:rounded-none [&_[data-slot=date-trigger]]:border-0 [&_[data-slot=date-trigger]]:bg-transparent [&_[data-slot=date-trigger]]:shadow-none [&_[data-slot=date-trigger]]:focus-visible:ring-0\",\n // A segmented filter (`control: { segmented: true }`) loses its frame\n // the same way, and keeps its muted track, which now fills the box.\n //\n // ⚠️ Its segments size from their labels here. `ControlSelect` always\n // draws it `fullWidth`, whose segments start from a zero basis, and a\n // slot sized to its content then splits the width evenly below what\n // the longest label needs: \"Disabled\" was drawn against the edge.\n // `basis-auto` keeps the stretch and starts each one from its label.\n \"[&_[data-slot=segmented]]:rounded-none [&_[data-slot=segmented]]:border-0\",\n \"[&_[data-slot=segmented-item]]:basis-auto\",\n // See the docblock: the control's own clear cross would be a second,\n // identical glyph beside the remove one. Only then, though: a filter\n // given neither `onClear` nor `onRemove` draws no button of its own,\n // so its control keeps its classic in-field cross - the search box.\n //\n // ⚠️ The margin the trigger keeps for that cross goes with it. Hiding\n // only the button left 24px of blank between the value and the\n // chevron, widening every filter that holds a value.\n (props.onClear || props.onRemove) &&\n '[&_[data-slot=\"combobox-clear\"]]:hidden [&_[data-slot=\"control-clear\"]]:hidden [&_[data-slot=\"trigger-label\"]]:mr-0',\n )}\n >\n {/*\n `min-w-0` so the control absorbs the button's width by shrinking\n instead of pushing it out of the slot - a flex child's default\n `min-width: auto` refuses to go below its content.\n */}\n <div className=\"min-w-0 flex-1\">{props.children}</div>\n {action && (\n <>\n {/*\n The divider, and it is doing real work: without it the cross\n floats in the same field as the value and reads as part of it - a\n second caret rather than a separate act. `bg-input` is the\n container's own resting border colour, so the line is that border\n continued inward.\n */}\n <span aria-hidden className=\"bg-input w-px self-stretch\" />\n <Tooltip>\n <TooltipTrigger\n render={\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:bg-hover hover:text-foreground flex shrink-0 items-center justify-center px-2 focus-visible:outline-none\"\n aria-label={actionLabel}\n onClick={action}\n />\n }\n >\n {/*\n The funnel is the denser glyph of the two and reads smaller at\n the same box, so it is drawn a step larger to sit at the same\n visual weight as the cross it replaces.\n */}\n <ActionIcon className={clears ? \"size-3\" : \"size-3.5\"} />\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n </>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAa,0BAA0B,UAAuC;CAC5E,MAAM,EAAE,OAAO,QAAQ;CAGvB,MAAM,SAAS,QAAQ,MAAM,WAAW,MAAM,MAAM;CACpD,MAAM,SAAS,SAAS,MAAM,UAAU,MAAM;CAC9C,MAAM,aAAa,SAAS,IAAI;CAOhC,MAAM,QAAQ,OACZ,SACI,GAAG,wBAAwB,EAAE,SAAS,cAAc,CAAC,IACrD,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CAC/D;CACA,MAAM,cAAc,GAAG,MAAM,IAAI,MAAM;CAEvC,OACE,qBAAC,OAAD;EACE,WAAW,GACT,oFAGA,6BACA,sGASA,uLACA,8OACA,0NASA,6EACA,8CASC,MAAM,WAAW,MAAM,aACtB,2HACJ;EAtCF,UAAA,CA6CE,oBAAC,OAAD;GAAK,WAAU;GAAkB,UAAA,MAAM;EAAc,CAAA,GACpD,UACC,qBAAA,UAAA,EAAA,UAAA,CAQE,oBAAC,QAAD;GAAM,eAAA;GAAY,WAAU;EAA8B,CAAA,GAC1D,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;GACE,QACE,oBAAC,UAAD;IACE,MAAK;IACL,WAAU;IACV,cAAY;IACZ,SAAS;GACV,CAAA;GAQH,UAAA,oBAAC,YAAD,EAAY,WAAW,SAAS,WAAW,WAAa,CAAA;EAC1C,CAAA,GAChB,oBAAC,gBAAD,EAAA,UAAiB,MAAsB,CAAA,CAChC,EAAA,CAAA,CACT,EAAA,CAAA,CAED;;AAET"}
1
+ {"version":3,"file":"DataTableFilterControl.js","names":[],"sources":["../../src/table/DataTableFilterControl.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { FunnelX, X } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../core/Tooltip.tsx\";\nimport { cn } from \"../core/utils.ts\";\n\nexport interface DataTableFilterControlProps {\n /**\n * What this filter is called. Not drawn here - a set select names itself on\n * its trigger through `triggerPrefix` (\"Status not Active\"), and an empty\n * one through its placeholder - but it names the button (\"Remove filter:\n * Status\"), which is the only accessible name that button will ever have.\n *\n * ⚠️ It was also a hover tooltip on the control, and that was removed on\n * 2026-09-13: once the trigger carries the name, the tooltip repeated what\n * was already on screen.\n */\n label: string;\n\n /**\n * The filter itself, unchanged: a `Control` with `label=\"\"`, exactly as it\n * is written today. This component adds chrome AROUND a control and never\n * alters one.\n */\n children: ReactNode;\n\n /**\n * Take this filter out of the bar.\n *\n * ⚠️ NOT \"clear its value\" - that is `onClear`, and the cross runs them in\n * that order (see the docblock below). A filter with neither draws no cross\n * at all, which is how the bar keeps a filter that may not leave.\n *\n * The caller is expected to clear the filter's value as it removes it.\n * Removing a filter that is still narrowing the list leaves the reader with\n * a shorter list and nothing on screen explaining why.\n */\n onRemove?: () => void;\n\n /**\n * Empty this filter without taking it out of the bar.\n *\n * Given alongside `onRemove`, it becomes the cross's FIRST act: a filter\n * holding a value is cleared, and only a filter already empty is removed.\n * Given alone - the search box, which may not leave - the cross appears\n * only while there is something to clear and does nothing else.\n */\n onClear?: () => void;\n\n /**\n * Whether this filter currently holds a value. Draws nothing: the value on\n * the trigger already says it, and a darker border on top of that was\n * tried and dropped on 2026-09-13.\n *\n * ⚠️ It decides which act the cross performs, so a caller that passes\n * `onClear` and forgets this gets a cross that removes a filter the reader\n * expected it to empty.\n */\n active?: boolean;\n}\n\n/**\n * One filter's slot in a `DataTable` filter bar: the control, and the\n * cross that removes it.\n *\n * **One box, not a control with a button beside it.** The container draws the\n * border and the control inside is stripped of its own, so the remove action\n * reads as part of the field rather than as a separate thing that happens to\n * be adjacent - which is what a detached button looked like, and why it was\n * never obvious which filter a cross belonged to in a row of four.\n *\n * ```text\n * ( icon Any status ▾ │ × )\n * ```\n *\n * ⚠️ Three other designs were built and thrown away on 2026-09-12, and the\n * reasons are worth keeping so they are not re-proposed: a detached trailing\n * button (ambiguous ownership, and it truncated the control it sat beside); a\n * strip of actions sliding out from behind the control on hover (nothing\n * discoverable, and it overlapped whatever the page put above the bar); and\n * an always-present label row carrying the actions (cost a row of labels that\n * `label=\"\"` exists to remove). This is what survived.\n *\n * ⚠️ The control's own `clearable` cross is HIDDEN here whenever this draws a\n * button. Two crosses a few pixels apart - one clearing the VALUE, one\n * removing the FILTER - is the ambiguity this design exists to remove, and at\n * this size they are the same glyph. It hides the affordance, not the\n * capability: the one button does both jobs in turn.\n *\n * Given neither `onClear` nor `onRemove`, it draws no button and hides\n * nothing, so the control keeps the cross inside its own field. That is the\n * search box: a filter that never leaves the bar has only one job for a cross,\n * and the field's own is the one every search box has.\n *\n * **The button is staged: clear, then remove.** A filter holding a value is\n * emptied by the first click and removed by the second, and the two acts do\n * not share a glyph: a cross empties the field, a struck-through funnel takes\n * the filter out of the bar. The destructive half is therefore never the one\n * a reader reaches first, and never wears the icon of the other - which\n * matters because emptying a filter is what they usually mean, and a filter\n * they configured and then lost to a stray click has to be added and\n * configured again.\n *\n * The stage is legible before the click from the icon, the tooltip (\"Clear\n * value\" against \"Remove filter\") and the accessible name, and afterwards\n * from the icon changing.\n *\n * ⚠️ The tooltip needs a `TooltipProvider` above it, like every other tooltip\n * in this package; `apps/ui` and Lore both mount one in their layout.\n *\n * The value has to clear through `onClear` rather than through the control,\n * because the container is given `active` and cannot reach into the field it\n * wraps - the caller owns the form.\n */\nexport const DataTableFilterControl = (props: DataTableFilterControlProps) => {\n const { tr } = useI18n();\n // The first act while the filter holds a value, the second once it is\n // empty. `onClear` alone never escalates: the search box may not leave.\n const clears = Boolean(props.onClear && props.active);\n const action = clears ? props.onClear : props.onRemove;\n const ActionIcon = clears ? X : FunnelX;\n // ⚠️ Two labels, and they are not the same string. The TOOLTIP names the\n // act and nothing else - it is read beside the filter it belongs to, so\n // repeating that filter's name in it is noise on every hover. The\n // ACCESSIBLE name has to carry the filter, because a screen reader meets\n // these buttons as a list and \"Remove filter\" four times over says which\n // one it is about exactly never.\n const label = String(\n clears\n ? tr(\"dataTable.clearValue\", { default: \"Clear value\" })\n : tr(\"dataTable.removeFilter\", { default: \"Remove filter\" }),\n );\n const actionLabel = `${label}: ${props.label}`;\n\n return (\n <div\n className={cn(\n \"bg-background border-border flex items-stretch overflow-hidden rounded-md border\",\n // The field's own two states, moved out to the container: it is the\n // thing with a border now, so it has to answer for them.\n \"hover:border-border-hover\",\n \"has-[:focus-visible]:border-ring has-[:focus-visible]:ring-ring/50 has-[:focus-visible]:ring-[3px]\",\n // The control keeps its layout and loses only its frame. Every slot\n // is covered because a text filter draws `input`, a select draws\n // `combobox-trigger` and a date range draws `date-trigger`, and a bar\n // mixes the three.\n //\n // ⚠️ The ring has to go as well as the border. Leaving it turns focus\n // into a rounded rectangle floating INSIDE the container, which looks\n // like a rendering bug rather than a focused field.\n \"[&_[data-slot=input]]:rounded-none [&_[data-slot=input]]:border-0 [&_[data-slot=input]]:bg-transparent [&_[data-slot=input]]:shadow-none [&_[data-slot=input]]:focus-visible:ring-0\",\n \"[&_[data-slot=combobox-trigger]]:rounded-none [&_[data-slot=combobox-trigger]]:border-0 [&_[data-slot=combobox-trigger]]:bg-transparent [&_[data-slot=combobox-trigger]]:shadow-none [&_[data-slot=combobox-trigger]]:focus-visible:ring-0\",\n \"[&_[data-slot=date-trigger]]:rounded-none [&_[data-slot=date-trigger]]:border-0 [&_[data-slot=date-trigger]]:bg-transparent [&_[data-slot=date-trigger]]:shadow-none [&_[data-slot=date-trigger]]:focus-visible:ring-0\",\n // A segmented filter (`control: { segmented: true }`) loses its frame\n // the same way, and keeps its muted track, which now fills the box.\n //\n // ⚠️ Its segments size from their labels here. `ControlSelect` always\n // draws it `fullWidth`, whose segments start from a zero basis, and a\n // slot sized to its content then splits the width evenly below what\n // the longest label needs: \"Disabled\" was drawn against the edge.\n // `basis-auto` keeps the stretch and starts each one from its label.\n \"[&_[data-slot=segmented]]:rounded-none [&_[data-slot=segmented]]:border-0\",\n \"[&_[data-slot=segmented-item]]:basis-auto\",\n // See the docblock: the control's own clear cross would be a second,\n // identical glyph beside the remove one. Only then, though: a filter\n // given neither `onClear` nor `onRemove` draws no button of its own,\n // so its control keeps its classic in-field cross - the search box.\n //\n // ⚠️ The margin the trigger keeps for that cross goes with it. Hiding\n // only the button left 24px of blank between the value and the\n // chevron, widening every filter that holds a value.\n (props.onClear || props.onRemove) &&\n '[&_[data-slot=\"combobox-clear\"]]:hidden [&_[data-slot=\"control-clear\"]]:hidden [&_[data-slot=\"trigger-label\"]]:mr-0',\n )}\n >\n {/*\n `min-w-0` so the control absorbs the button's width by shrinking\n instead of pushing it out of the slot - a flex child's default\n `min-width: auto` refuses to go below its content.\n */}\n <div className=\"min-w-0 flex-1\">{props.children}</div>\n {action && (\n <>\n {/*\n The divider, and it is doing real work: without it the cross\n floats in the same field as the value and reads as part of it - a\n second caret rather than a separate act. `bg-input` is the\n container's own resting border colour, so the line is that border\n continued inward.\n */}\n <span aria-hidden className=\"bg-input w-px self-stretch\" />\n <Tooltip>\n <TooltipTrigger\n render={\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:bg-hover hover:text-foreground flex shrink-0 items-center justify-center px-2 focus-visible:outline-none\"\n aria-label={actionLabel}\n onClick={action}\n />\n }\n >\n {/*\n The funnel is the denser glyph of the two and reads smaller at\n the same box, so it is drawn a step larger to sit at the same\n visual weight as the cross it replaces.\n */}\n <ActionIcon className={clears ? \"size-3\" : \"size-3.5\"} />\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n </>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAa,0BAA0B,UAAuC;CAC5E,MAAM,EAAE,OAAO,QAAQ;CAGvB,MAAM,SAAS,QAAQ,MAAM,WAAW,MAAM,MAAM;CACpD,MAAM,SAAS,SAAS,MAAM,UAAU,MAAM;CAC9C,MAAM,aAAa,SAAS,IAAI;CAOhC,MAAM,QAAQ,OACZ,SACI,GAAG,wBAAwB,EAAE,SAAS,cAAc,CAAC,IACrD,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CAC/D;CACA,MAAM,cAAc,GAAG,MAAM,IAAI,MAAM;CAEvC,OACE,qBAAC,OAAD;EACE,WAAW,GACT,oFAGA,6BACA,sGASA,uLACA,8OACA,0NASA,6EACA,8CASC,MAAM,WAAW,MAAM,aACtB,2HACJ;EAtCF,UAAA,CA6CE,oBAAC,OAAD;GAAK,WAAU;GAAkB,UAAA,MAAM;EAAc,CAAA,GACpD,UACC,qBAAA,UAAA,EAAA,UAAA,CAQE,oBAAC,QAAD;GAAM,eAAA;GAAY,WAAU;EAA8B,CAAA,GAC1D,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;GACE,QACE,oBAAC,UAAD;IACE,MAAK;IACL,WAAU;IACV,cAAY;IACZ,SAAS;GACV,CAAA;GAQH,UAAA,oBAAC,YAAD,EAAY,WAAW,SAAS,WAAW,WAAa,CAAA;EAC1C,CAAA,GAChB,oBAAC,gBAAD,EAAA,UAAiB,MAAsB,CAAA,CAChC,EAAA,CAAA,CACT,EAAA,CAAA,CAED;;AAET"}
@@ -1,9 +1,9 @@
1
+ import { Badge } from "../core/Badge.js";
1
2
  import { Button } from "../core/Button.js";
2
3
  import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "../core/Dialog.js";
3
- import { Badge } from "../core/Badge.js";
4
+ import { useI18n } from "alepha/react/i18n";
4
5
  import { Funnel, Share2 } from "lucide-react";
5
6
  import { useState } from "react";
6
- import { useI18n } from "alepha/react/i18n";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/table/DataTableFilterDialog.tsx
9
9
  /**
@@ -43,7 +43,7 @@ const DataTableFilterDialog = (props) => {
43
43
  render: /* @__PURE__ */ jsx(Button, {
44
44
  type: "button",
45
45
  size: "sm",
46
- variant: "ghost",
46
+ variant: "minimal",
47
47
  className: "h-9 gap-1.5 px-2",
48
48
  "aria-label": label
49
49
  }),
@@ -62,14 +62,14 @@ const DataTableFilterDialog = (props) => {
62
62
  /* @__PURE__ */ jsxs(DialogFooter, { children: [
63
63
  props.onShare && /* @__PURE__ */ jsxs(Button, {
64
64
  type: "button",
65
- variant: "outline",
65
+ variant: "outlined",
66
66
  disabled: props.activeCount === 0,
67
67
  onClick: props.onShare,
68
68
  children: [/* @__PURE__ */ jsx(Share2, { className: "size-4" }), tr("dataTable.shareFilters", { default: "Share filters" })]
69
69
  }),
70
70
  /* @__PURE__ */ jsx(Button, {
71
71
  type: "button",
72
- variant: "outline",
72
+ variant: "outlined",
73
73
  disabled: !props.canReset,
74
74
  onClick: props.onReset,
75
75
  children: tr("dataTable.resetFilters", { default: "Reset filters" })
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFilterDialog.js","names":[],"sources":["../../src/table/DataTableFilterDialog.tsx"],"sourcesContent":["import type { FormModel } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { Funnel, Share2 } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\n\nimport { Badge } from \"../core/Badge.tsx\";\nimport { Button } from \"../core/Button.tsx\";\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"../core/Dialog.tsx\";\n\nexport interface DataTableFilterDialogProps {\n /**\n * The table's own filter form. The SAME instance the toolbar bar would\n * render — this component never builds one of its own, or a filter set in\n * here would live in a model `fetch` does not read.\n */\n form: FormModel<any>;\n /**\n * The filter controls, already rendered: the bar in its `dialog` variant,\n * or the caller's `filters.render(form)` output. Passing nodes rather than a\n * callback keeps this component unaware of the `DataTableFilters` shape.\n */\n children: ReactNode;\n /**\n * How many filters currently narrow the list. Renders as a badge on the\n * trigger, and gates Share: sharing means nothing with nothing set.\n */\n activeCount: number;\n /**\n * Whether Reset would change anything: a value set, or a bar that differs\n * from its declaration. Share stays about values.\n */\n canReset: boolean;\n onReset: () => void;\n /**\n * Copy a link that reopens the list with these filters. Same action as the\n * desktop toolbar's menu item: a phone is where a reader is most likely to\n * want to send the view to someone rather than keep it.\n *\n * Absent when the table does not read its filters back from the query, in\n * which case the link would be inert and the button is not rendered at all.\n */\n onShare?: () => void;\n}\n\n/**\n * The filter bar, on a phone.\n *\n * Below `useIsMobile`'s breakpoint the bar's controls cost several rows of\n * height above a table the reader came for — three selects and a search box\n * stack at 412px — so they move behind this trigger and the bar itself is not\n * rendered (feedback #2106).\n *\n * Three decisions worth stating, because each had a plausible opposite:\n *\n * - **Not rendered, not `hidden`.** The controls are form-bound `Control`s, so\n * a CSS-hidden bar plus a dialog copy would put two inputs on every field —\n * duplicate ids, two labels pointing at one name. `DataTable` renders the\n * filters in exactly one place at a time, which is why the switch is\n * `useIsMobile()` and not a `max-md:hidden` class.\n * - **Applies on change, not on close.** The desktop bar refetches as you type\n * (debounced, on the alepha event bus rather than on any DOM event — which\n * is what lets these controls work identically inside a portal). Apply /\n * Cancel semantics here would be a second behaviour for the same controls,\n * and would mean the reader's filters behave differently depending on the\n * width of their screen. Done just closes.\n * - **The trigger carries a count.** A button that looks the same whether or\n * not three filters are narrowing the list turns a filtered table into one\n * that looks broken, and on a phone the bar is no longer there to say\n * otherwise.\n */\nexport const DataTableFilterDialog = (props: DataTableFilterDialogProps) => {\n const { tr } = useI18n();\n const [open, setOpen] = useState(false);\n const label = tr(\"dataTable.filters\", { default: \"Filters\" });\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger\n render={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-9 gap-1.5 px-2\"\n aria-label={label}\n />\n }\n >\n <Funnel className=\"size-4\" />\n {props.activeCount > 0 && (\n <Badge\n variant=\"secondary\"\n className=\"h-5 min-w-5 justify-center px-1 text-[10px] tabular-nums\"\n >\n {props.activeCount}\n </Badge>\n )}\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{label}</DialogTitle>\n <DialogDescription>\n {tr(\"dataTable.filtersHint\", {\n default: \"Changes apply as you make them.\",\n })}\n </DialogDescription>\n </DialogHeader>\n {/*\n A filter bar sizes its slots for a ROW (Lore's `FilterSlot` is\n `w-44`), and those widths are wrong stacked in a dialog: three\n 176px controls left-aligned in a 348px box read as a broken layout\n rather than a form. A descendant selector outranks the plain class\n on the element, so stretching them here costs no caller a change\n and leaves the desktop bar untouched.\n\n Two levels, because both shapes occur: slots directly under the\n form, and slots inside one wrapper the caller uses for its own\n `flex flex-wrap`. Deeper than that keeps its own width - a limit,\n not an oversight, since the alternative is a selector broad enough\n to resize things that are not controls.\n */}\n <form\n {...props.form.props}\n className=\"grid grid-cols-1 gap-3 [&>*]:w-full [&>*>*]:w-full\"\n >\n {props.children}\n </form>\n <DialogFooter>\n {props.onShare && (\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={props.activeCount === 0}\n onClick={props.onShare}\n >\n <Share2 className=\"size-4\" />\n {tr(\"dataTable.shareFilters\", { default: \"Share filters\" })}\n </Button>\n )}\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={!props.canReset}\n onClick={props.onReset}\n >\n {tr(\"dataTable.resetFilters\", { default: \"Reset filters\" })}\n </Button>\n <DialogClose render={<Button type=\"button\" />}>\n {tr(\"dataTable.filtersDone\", { default: \"Done\" })}\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAa,yBAAyB,UAAsC;CAC1E,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,QAAQ,GAAG,qBAAqB,EAAE,SAAS,UAAU,CAAC;CAE5D,OACE,qBAAC,QAAD;EAAc;EAAM,cAAc;EAAlC,UAAA,CACE,qBAAC,eAAD;GACE,QACE,oBAAC,QAAD;IACE,MAAK;IACL,MAAK;IACL,SAAQ;IACR,WAAU;IACV,cAAY;GACb,CAAA;GARL,UAAA,CAWE,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA,GAC3B,MAAM,cAAc,KACnB,oBAAC,OAAD;IACE,SAAQ;IACR,WAAU;IAET,UAAA,MAAM;GACF,CAAA,CAEI;EACf,CAAA,GAAA,qBAAC,eAAD,EAAA,UAAA;GACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,aAAD,EAAA,UAAc,MAAmB,CAAA,GACjC,oBAAC,mBAAD,EAAA,UACG,GAAG,yBAAyB,EAC3B,SAAS,kCACX,CAAC,EACgB,CAAA,CACP,EAAA,CAAA;GAed,oBAAC,QAAD;IACE,GAAI,MAAM,KAAK;IACf,WAAU;IAET,UAAA,MAAM;GACH,CAAA;GACN,qBAAC,cAAD,EAAA,UAAA;IACG,MAAM,WACL,qBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,UAAU,MAAM,gBAAgB;KAChC,SAAS,MAAM;KAJjB,UAAA,CAME,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA,GAC3B,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CACpD;;IAEV,oBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,UAAU,CAAC,MAAM;KACjB,SAAS,MAAM;KAEd,UAAA,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC;IACpD,CAAA;IACR,oBAAC,aAAD;KAAa,QAAQ,oBAAC,QAAD,EAAQ,MAAK,SAAU,CAAA;KACzC,UAAA,GAAG,yBAAyB,EAAE,SAAS,OAAO,CAAC;IACrC,CAAA;GACD,EAAA,CAAA;EACD,EAAA,CAAA,CACT;;AAEZ"}
1
+ {"version":3,"file":"DataTableFilterDialog.js","names":[],"sources":["../../src/table/DataTableFilterDialog.tsx"],"sourcesContent":["import type { FormModel } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { Funnel, Share2 } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\n\nimport { Badge } from \"../core/Badge.tsx\";\nimport { Button } from \"../core/Button.tsx\";\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"../core/Dialog.tsx\";\n\nexport interface DataTableFilterDialogProps {\n /**\n * The table's own filter form. The SAME instance the toolbar bar would\n * render — this component never builds one of its own, or a filter set in\n * here would live in a model `fetch` does not read.\n */\n form: FormModel<any>;\n /**\n * The filter controls, already rendered: the bar in its `dialog` variant,\n * or the caller's `filters.render(form)` output. Passing nodes rather than a\n * callback keeps this component unaware of the `DataTableFilters` shape.\n */\n children: ReactNode;\n /**\n * How many filters currently narrow the list. Renders as a badge on the\n * trigger, and gates Share: sharing means nothing with nothing set.\n */\n activeCount: number;\n /**\n * Whether Reset would change anything: a value set, or a bar that differs\n * from its declaration. Share stays about values.\n */\n canReset: boolean;\n onReset: () => void;\n /**\n * Copy a link that reopens the list with these filters. Same action as the\n * desktop toolbar's menu item: a phone is where a reader is most likely to\n * want to send the view to someone rather than keep it.\n *\n * Absent when the table does not read its filters back from the query, in\n * which case the link would be inert and the button is not rendered at all.\n */\n onShare?: () => void;\n}\n\n/**\n * The filter bar, on a phone.\n *\n * Below `useIsMobile`'s breakpoint the bar's controls cost several rows of\n * height above a table the reader came for — three selects and a search box\n * stack at 412px — so they move behind this trigger and the bar itself is not\n * rendered (feedback #2106).\n *\n * Three decisions worth stating, because each had a plausible opposite:\n *\n * - **Not rendered, not `hidden`.** The controls are form-bound `Control`s, so\n * a CSS-hidden bar plus a dialog copy would put two inputs on every field —\n * duplicate ids, two labels pointing at one name. `DataTable` renders the\n * filters in exactly one place at a time, which is why the switch is\n * `useIsMobile()` and not a `max-md:hidden` class.\n * - **Applies on change, not on close.** The desktop bar refetches as you type\n * (debounced, on the alepha event bus rather than on any DOM event — which\n * is what lets these controls work identically inside a portal). Apply /\n * Cancel semantics here would be a second behaviour for the same controls,\n * and would mean the reader's filters behave differently depending on the\n * width of their screen. Done just closes.\n * - **The trigger carries a count.** A button that looks the same whether or\n * not three filters are narrowing the list turns a filtered table into one\n * that looks broken, and on a phone the bar is no longer there to say\n * otherwise.\n */\nexport const DataTableFilterDialog = (props: DataTableFilterDialogProps) => {\n const { tr } = useI18n();\n const [open, setOpen] = useState(false);\n const label = tr(\"dataTable.filters\", { default: \"Filters\" });\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger\n render={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"minimal\"\n className=\"h-9 gap-1.5 px-2\"\n aria-label={label}\n />\n }\n >\n <Funnel className=\"size-4\" />\n {props.activeCount > 0 && (\n <Badge\n variant=\"secondary\"\n className=\"h-5 min-w-5 justify-center px-1 text-[10px] tabular-nums\"\n >\n {props.activeCount}\n </Badge>\n )}\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{label}</DialogTitle>\n <DialogDescription>\n {tr(\"dataTable.filtersHint\", {\n default: \"Changes apply as you make them.\",\n })}\n </DialogDescription>\n </DialogHeader>\n {/*\n A filter bar sizes its slots for a ROW (Lore's `FilterSlot` is\n `w-44`), and those widths are wrong stacked in a dialog: three\n 176px controls left-aligned in a 348px box read as a broken layout\n rather than a form. A descendant selector outranks the plain class\n on the element, so stretching them here costs no caller a change\n and leaves the desktop bar untouched.\n\n Two levels, because both shapes occur: slots directly under the\n form, and slots inside one wrapper the caller uses for its own\n `flex flex-wrap`. Deeper than that keeps its own width - a limit,\n not an oversight, since the alternative is a selector broad enough\n to resize things that are not controls.\n */}\n <form\n {...props.form.props}\n className=\"grid grid-cols-1 gap-3 [&>*]:w-full [&>*>*]:w-full\"\n >\n {props.children}\n </form>\n <DialogFooter>\n {props.onShare && (\n <Button\n type=\"button\"\n variant=\"outlined\"\n disabled={props.activeCount === 0}\n onClick={props.onShare}\n >\n <Share2 className=\"size-4\" />\n {tr(\"dataTable.shareFilters\", { default: \"Share filters\" })}\n </Button>\n )}\n <Button\n type=\"button\"\n variant=\"outlined\"\n disabled={!props.canReset}\n onClick={props.onReset}\n >\n {tr(\"dataTable.resetFilters\", { default: \"Reset filters\" })}\n </Button>\n <DialogClose render={<Button type=\"button\" />}>\n {tr(\"dataTable.filtersDone\", { default: \"Done\" })}\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAa,yBAAyB,UAAsC;CAC1E,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,QAAQ,GAAG,qBAAqB,EAAE,SAAS,UAAU,CAAC;CAE5D,OACE,qBAAC,QAAD;EAAc;EAAM,cAAc;EAAlC,UAAA,CACE,qBAAC,eAAD;GACE,QACE,oBAAC,QAAD;IACE,MAAK;IACL,MAAK;IACL,SAAQ;IACR,WAAU;IACV,cAAY;GACb,CAAA;GARL,UAAA,CAWE,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA,GAC3B,MAAM,cAAc,KACnB,oBAAC,OAAD;IACE,SAAQ;IACR,WAAU;IAET,UAAA,MAAM;GACF,CAAA,CAEI;EACf,CAAA,GAAA,qBAAC,eAAD,EAAA,UAAA;GACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,aAAD,EAAA,UAAc,MAAmB,CAAA,GACjC,oBAAC,mBAAD,EAAA,UACG,GAAG,yBAAyB,EAC3B,SAAS,kCACX,CAAC,EACgB,CAAA,CACP,EAAA,CAAA;GAed,oBAAC,QAAD;IACE,GAAI,MAAM,KAAK;IACf,WAAU;IAET,UAAA,MAAM;GACH,CAAA;GACN,qBAAC,cAAD,EAAA,UAAA;IACG,MAAM,WACL,qBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,UAAU,MAAM,gBAAgB;KAChC,SAAS,MAAM;KAJjB,UAAA,CAME,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA,GAC3B,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CACpD;;IAEV,oBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,UAAU,CAAC,MAAM;KACjB,SAAS,MAAM;KAEd,UAAA,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC;IACpD,CAAA;IACR,oBAAC,aAAD;KAAa,QAAQ,oBAAC,QAAD,EAAQ,MAAK,SAAU,CAAA;KACzC,UAAA,GAAG,yBAAyB,EAAE,SAAS,OAAO,CAAC;IACrC,CAAA;GACD,EAAA,CAAA;EACD,EAAA,CAAA,CACT;;AAEZ"}
@@ -1,7 +1,7 @@
1
- import { Button } from "../core/Button.js";
2
1
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../core/DropdownMenu.js";
3
- import { Funnel, FunnelX, Share2 } from "lucide-react";
2
+ import { Button } from "../core/Button.js";
4
3
  import { useI18n } from "alepha/react/i18n";
4
+ import { Funnel, FunnelX, Share2 } from "lucide-react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/table/DataTableFilterMenu.tsx
7
7
  /**
@@ -41,7 +41,7 @@ const DataTableFilterMenu = (props) => {
41
41
  render: /* @__PURE__ */ jsx(Button, {
42
42
  type: "button",
43
43
  size: "sm",
44
- variant: "ghost",
44
+ variant: "minimal",
45
45
  className: "h-9 w-9 p-0",
46
46
  "aria-label": label
47
47
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFilterMenu.js","names":[],"sources":["../../src/table/DataTableFilterMenu.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { Funnel, FunnelX, Share2 } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\n\nexport interface DataTableFilterMenuProps {\n /**\n * How many filters currently narrow the list. Gates Share: sharing means\n * nothing with nothing set.\n *\n * It is deliberately NOT drawn on the trigger, unlike\n * {@link DataTableFilterDialog}'s. That dialog badges its trigger because\n * the filter bar is not on screen behind it; out here the bar IS the\n * indicator, holding the values themselves a few pixels to the left, so a\n * count beside it says the same thing twice and reads as a notification.\n */\n activeCount: number;\n /**\n * Whether Reset would change anything. Not `activeCount` alone: a bar the\n * reader rearranged (a default filter removed, an optional one added) is\n * something to reset while no value is set.\n */\n canReset: boolean;\n /**\n * Share the current filters as a link, when the table is linkable at all.\n * `undefined` drops the item, leaving the menu with Reset alone.\n */\n onShare?: () => void;\n onReset: () => void;\n}\n\n/**\n * The filter menu in the toolbar, on anything wider than a phone.\n *\n * It replaces the bare \"Reset filters\" icon button, for two reasons that\n * arrived together:\n *\n * - **Share needed somewhere to live.** A filtered table is a view worth\n * sending to someone, and the address bar cannot carry it: the filters are\n * never written back to the URL (see `fromQuery`, and Lore incident #156).\n * So the link has to be something the reader asks for, which means an item\n * in a menu rather than a bar that writes as you type.\n * - **Clear belongs beside it.** The two are one decision - this view, kept\n * or dropped - and a menu is where a reader looks for both.\n *\n * The same `Funnel` icon as {@link DataTableFilterDialog}, on purpose: one\n * affordance for filters, whatever the width. Not its badge, though - see\n * `activeCount` for why the count stops at the phone.\n *\n * ## A table that cannot be linked gets the menu anyway\n *\n * Without `onShare` this is a menu of one item, which the toolbar used to\n * refuse: it drew a bare `FunnelX` button instead, on the grounds that a\n * menu costs a click to reach a button already on the bar. What that traded\n * away is the reason for the click. The bare button spends most of its life\n * disabled - Reset does nothing until a value is set or the bar is moved -\n * and a greyed icon with no words on it does not say whether it resets\n * filters, clears a search or empties the table. Behind the `Funnel` the\n * same state reads as \"Reset filters\", greyed, which explains itself.\n */\nexport const DataTableFilterMenu = (props: DataTableFilterMenuProps) => {\n const { tr } = useI18n();\n const label = tr(\"dataTable.filters\", { default: \"Filters\" });\n const idle = props.activeCount === 0;\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-9 w-9 p-0\"\n aria-label={label}\n />\n }\n >\n <Funnel className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {props.onShare && (\n <DropdownMenuItem disabled={idle} onClick={props.onShare}>\n <Share2 className=\"size-4\" />\n {tr(\"dataTable.shareFilters\", { default: \"Share filters\" })}\n </DropdownMenuItem>\n )}\n <DropdownMenuItem disabled={!props.canReset} onClick={props.onReset}>\n <FunnelX className=\"size-4\" />\n {tr(\"dataTable.resetFilters\", { default: \"Reset filters\" })}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAa,uBAAuB,UAAoC;CACtE,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,QAAQ,GAAG,qBAAqB,EAAE,SAAS,UAAU,CAAC;CAC5D,MAAM,OAAO,MAAM,gBAAgB;CAEnC,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,qBAAD;EACE,QACE,oBAAC,QAAD;GACE,MAAK;GACL,MAAK;GACL,SAAQ;GACR,WAAU;GACV,cAAY;EACb,CAAA;EAGH,UAAA,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA;CACT,CAAA,GACrB,qBAAC,qBAAD;EAAqB,OAAM;EAA3B,UAAA,CACG,MAAM,WACL,qBAAC,kBAAD;GAAkB,UAAU;GAAM,SAAS,MAAM;GAAjD,UAAA,CACE,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA,GAC3B,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CAC1C;EAEpB,CAAA,GAAA,qBAAC,kBAAD;GAAkB,UAAU,CAAC,MAAM;GAAU,SAAS,MAAM;GAA5D,UAAA,CACE,oBAAC,SAAD,EAAS,WAAU,SAAU,CAAA,GAC5B,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CAC1C;EACC,CAAA,CAAA;CACT,CAAA,CAAA,EAAA,CAAA;AAElB"}
1
+ {"version":3,"file":"DataTableFilterMenu.js","names":[],"sources":["../../src/table/DataTableFilterMenu.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { Funnel, FunnelX, Share2 } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\n\nexport interface DataTableFilterMenuProps {\n /**\n * How many filters currently narrow the list. Gates Share: sharing means\n * nothing with nothing set.\n *\n * It is deliberately NOT drawn on the trigger, unlike\n * {@link DataTableFilterDialog}'s. That dialog badges its trigger because\n * the filter bar is not on screen behind it; out here the bar IS the\n * indicator, holding the values themselves a few pixels to the left, so a\n * count beside it says the same thing twice and reads as a notification.\n */\n activeCount: number;\n /**\n * Whether Reset would change anything. Not `activeCount` alone: a bar the\n * reader rearranged (a default filter removed, an optional one added) is\n * something to reset while no value is set.\n */\n canReset: boolean;\n /**\n * Share the current filters as a link, when the table is linkable at all.\n * `undefined` drops the item, leaving the menu with Reset alone.\n */\n onShare?: () => void;\n onReset: () => void;\n}\n\n/**\n * The filter menu in the toolbar, on anything wider than a phone.\n *\n * It replaces the bare \"Reset filters\" icon button, for two reasons that\n * arrived together:\n *\n * - **Share needed somewhere to live.** A filtered table is a view worth\n * sending to someone, and the address bar cannot carry it: the filters are\n * never written back to the URL (see `fromQuery`, and Lore incident #156).\n * So the link has to be something the reader asks for, which means an item\n * in a menu rather than a bar that writes as you type.\n * - **Clear belongs beside it.** The two are one decision - this view, kept\n * or dropped - and a menu is where a reader looks for both.\n *\n * The same `Funnel` icon as {@link DataTableFilterDialog}, on purpose: one\n * affordance for filters, whatever the width. Not its badge, though - see\n * `activeCount` for why the count stops at the phone.\n *\n * ## A table that cannot be linked gets the menu anyway\n *\n * Without `onShare` this is a menu of one item, which the toolbar used to\n * refuse: it drew a bare `FunnelX` button instead, on the grounds that a\n * menu costs a click to reach a button already on the bar. What that traded\n * away is the reason for the click. The bare button spends most of its life\n * disabled - Reset does nothing until a value is set or the bar is moved -\n * and a greyed icon with no words on it does not say whether it resets\n * filters, clears a search or empties the table. Behind the `Funnel` the\n * same state reads as \"Reset filters\", greyed, which explains itself.\n */\nexport const DataTableFilterMenu = (props: DataTableFilterMenuProps) => {\n const { tr } = useI18n();\n const label = tr(\"dataTable.filters\", { default: \"Filters\" });\n const idle = props.activeCount === 0;\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"minimal\"\n className=\"h-9 w-9 p-0\"\n aria-label={label}\n />\n }\n >\n <Funnel className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {props.onShare && (\n <DropdownMenuItem disabled={idle} onClick={props.onShare}>\n <Share2 className=\"size-4\" />\n {tr(\"dataTable.shareFilters\", { default: \"Share filters\" })}\n </DropdownMenuItem>\n )}\n <DropdownMenuItem disabled={!props.canReset} onClick={props.onReset}>\n <FunnelX className=\"size-4\" />\n {tr(\"dataTable.resetFilters\", { default: \"Reset filters\" })}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAa,uBAAuB,UAAoC;CACtE,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,QAAQ,GAAG,qBAAqB,EAAE,SAAS,UAAU,CAAC;CAC5D,MAAM,OAAO,MAAM,gBAAgB;CAEnC,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,qBAAD;EACE,QACE,oBAAC,QAAD;GACE,MAAK;GACL,MAAK;GACL,SAAQ;GACR,WAAU;GACV,cAAY;EACb,CAAA;EAGH,UAAA,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA;CACT,CAAA,GACrB,qBAAC,qBAAD;EAAqB,OAAM;EAA3B,UAAA,CACG,MAAM,WACL,qBAAC,kBAAD;GAAkB,UAAU;GAAM,SAAS,MAAM;GAAjD,UAAA,CACE,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA,GAC3B,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CAC1C;EAEpB,CAAA,GAAA,qBAAC,kBAAD;GAAkB,UAAU,CAAC,MAAM;GAAU,SAAS,MAAM;GAA5D,UAAA,CACE,oBAAC,SAAD,EAAS,WAAU,SAAU,CAAA,GAC5B,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,CAC1C;EACC,CAAA,CAAA;CACT,CAAA,CAAA,EAAA,CAAA;AAElB"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFooter.d.ts","sourceRoot":"","sources":["../../src/table/DataTableFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AActD,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC,CAAC;IAClD;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,UAAW,oBAAoB,gCA4K1D,CAAC;AAsBF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,UAAoB,CAAC"}
1
+ {"version":3,"file":"DataTableFooter.d.ts","sourceRoot":"","sources":["../../src/table/DataTableFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AActD,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC,CAAC;IAClD;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,UAAW,oBAAoB,gCA2K1D,CAAC;AAsBF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,UAAoB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../core/utils.js";
2
- import { Control } from "../form/Control.js";
3
2
  import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "../core/Pagination.js";
3
+ import { Control } from "../form/Control.js";
4
4
  import { useI18n } from "alepha/react/i18n";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/table/DataTableFooter.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFooter.js","names":[],"sources":["../../src/table/DataTableFooter.tsx"],"sourcesContent":["import type { Page, ZObject, ZodNumber } from \"alepha\";\nimport type { FormModel } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport type { Dispatch, SetStateAction } from \"react\";\n\nimport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../core/Pagination.tsx\";\nimport { cn } from \"../core/utils.ts\";\nimport { Control } from \"../form/Control.tsx\";\n\nexport interface DataTableFooterProps {\n /**\n * Sizes offered in the picker, as passed to the table. Defaults to\n * {@link PAGE_SIZES}.\n */\n pageSizes?: number[];\n /**\n * The picker's one-field form, owned by the table.\n */\n sizeForm: FormModel<ZObject<{ size: ZodNumber }>>;\n /**\n * The current page's metadata, `null` until a page has arrived.\n */\n meta: Page<unknown>[\"page\"] | null;\n isMobile: boolean;\n setPage: Dispatch<SetStateAction<number>>;\n /**\n * The table's `chromeClassName`, merged after the bar's own classes.\n */\n className?: string;\n}\n\n/**\n * The footer under the rows: the page-size picker, where the reader is, and\n * the page links.\n */\nexport const DataTableFooter = (props: DataTableFooterProps) => {\n const { sizeForm, meta, isMobile, setPage } = props;\n const pageSizes = props.pageSizes ?? PAGE_SIZES;\n const { tr, l } = useI18n();\n\n return (\n /* `bg-muted`, paired with the filter bar above, see the note on it in\n `DataTableToolbar.tsx`.\n Carries the same `--bevel` fold under its top border: the three\n chrome bands (filter bar, header, footer) are lit from one side, so\n they read as the same material at three different heights. */\n <div\n className={cn(\n \"bg-muted -mt-2 flex flex-wrap items-center justify-between gap-2 rounded-md rounded-t-none border p-2 shadow-[inset_0_1px_0_0_var(--bevel)]\",\n props.className,\n )}\n >\n {/* The size picker sits with the count, not in the toolbar above:\n this line already answers \"how many, where am I\", while the\n toolbar answers \"which rows\". Mixing the two turns the toolbar\n into a junk drawer. */}\n <div className=\"flex items-center gap-2\">\n {/*\n Hidden on a phone, and the size itself is untouched: `size` is\n persisted per table, so a reader who chose 50 on a desktop keeps\n 50 here — this drops the CONTROL, not the setting. Nobody picks\n 100 rows on a 412px screen, and the picker plus the range text\n plus the numbered pages is exactly what made this bar wrap onto\n three lines (feedback #2106).\n */}\n {pageSizes.length > 0 &&\n !isMobile && (\n // The same `Control` the filter bar is built on, so the picker\n // is one component with every other select in this table. It\n // used to be the raw `Select` underneath it, because `Control`\n // is form-bound and this is not a form — `sizeForm` (built in\n // `useDataTableData`) is\n // what closes that gap.\n <Control\n input={sizeForm.input.size}\n // The count line beside it is not a label, so the trigger has\n // to name itself.\n label=\"\"\n inputProps={{\n \"aria-label\": tr(\"table.pageSize\", {\n default: \"Rows per page\",\n }),\n }}\n // `bg-background`, because this bar is `bg-muted` and the\n // trigger is `bg-transparent` by default: on a plain form\n // surface that blending is right, on a tinted bar it made the\n // picker read as part of the bar while the pagination buttons\n // beside it sat on their own plane. Set here rather than on\n // the trigger itself, which every form still wants\n // transparent.\n triggerClassName=\"bg-background h-7 w-auto gap-1 text-xs\"\n items={pageSizes.map((n) => ({\n value: String(n),\n label: String(n),\n }))}\n />\n )}\n <p className=\"text-muted-foreground text-xs\">\n {meta\n ? // The row range is the half that goes on a phone: \"where am\n // I\" survives, \"how many of how many\" does not, and the two\n // together are what pushed this past one line.\n //\n // Every part is the reader's language: the words through the\n // catalogue, the numbers through `l()`, so a French table\n // reads \"Page 1 sur 113 · 20 sur 2 250\" rather than an English\n // line with a French table above it (#Q2392).\n `${\n meta.totalPages\n ? tr(\"dataTable.pageOf\", {\n default: \"Page $1 of $2\",\n args: [l(meta.number + 1), l(meta.totalPages)],\n })\n : tr(\"dataTable.page\", {\n default: \"Page $1\",\n args: [l(meta.number + 1)],\n })\n }${\n isMobile\n ? \"\"\n : ` · ${tr(\"dataTable.rowsOf\", {\n default: \"$1 of $2\",\n args: [\n l(meta.numberOfElements),\n meta.totalElements === undefined\n ? \"?\"\n : l(meta.totalElements),\n ],\n })}`\n }`\n : \"—\"}\n </p>\n </div>\n {meta && meta.totalPages && meta.totalPages > 1 ? (\n <Pagination\n className=\"mx-0 w-auto justify-end\"\n aria-label={tr(\"dataTable.pagination\", { default: \"Pagination\" })}\n >\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n href=\"#\"\n text={tr(\"dataTable.previous\", { default: \"Previous\" })}\n aria-label={tr(\"dataTable.previousPage\", {\n default: \"Go to previous page\",\n })}\n onClick={(e) => {\n e.preventDefault();\n if (!meta.isFirst) setPage((p) => Math.max(0, p - 1));\n }}\n aria-disabled={meta.isFirst}\n className={cn(meta.isFirst && \"pointer-events-none opacity-50\")}\n />\n </PaginationItem>\n {/*\n Previous/next only on a phone. The numbered sequence is up\n to seven tap targets plus two ellipses, which is the widest\n thing in this bar, and \"Page 1 of 3\" beside it already says\n where the reader is. Their labels are `hidden sm:block` in\n the primitive, so the two that remain are bare chevrons.\n */}\n {!isMobile &&\n computePageItems(meta.number + 1, meta.totalPages).map(\n (item, idx) =>\n item === \"ellipsis\" ? (\n <PaginationItem key={`e-${idx}`}>\n <PaginationEllipsis\n label={tr(\"dataTable.morePages\", {\n default: \"More pages\",\n })}\n />\n </PaginationItem>\n ) : (\n <PaginationItem key={item}>\n <PaginationLink\n href=\"#\"\n isActive={item === meta.number + 1}\n onClick={(e) => {\n e.preventDefault();\n setPage(item - 1);\n }}\n >\n {item}\n </PaginationLink>\n </PaginationItem>\n ),\n )}\n <PaginationItem>\n <PaginationNext\n href=\"#\"\n text={tr(\"dataTable.next\", { default: \"Next\" })}\n aria-label={tr(\"dataTable.nextPage\", {\n default: \"Go to next page\",\n })}\n onClick={(e) => {\n e.preventDefault();\n if (!meta.isLast) setPage((p) => p + 1);\n }}\n aria-disabled={meta.isLast}\n className={cn(meta.isLast && \"pointer-events-none opacity-50\")}\n />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n ) : null}\n </div>\n );\n};\n\n/**\n * Build the visible page-number sequence with ellipses. Always shows\n * first + last, ±1 around current. Gaps collapse into a single ellipsis.\n * `current` and `total` are 1-indexed.\n */\nfunction computePageItems(\n current: number,\n total: number,\n): Array<number | \"ellipsis\"> {\n if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);\n const items: Array<number | \"ellipsis\"> = [1];\n if (current > 3) items.push(\"ellipsis\");\n const start = Math.max(2, current - 1);\n const end = Math.min(total - 1, current + 1);\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 2) items.push(\"ellipsis\");\n items.push(total);\n return items;\n}\n\n/**\n * Page sizes the footer offers.\n *\n * No \"all\". Pagination here is server-side, so an unbounded fetch is a query\n * whose cost grows with the biggest table in the product and is paid by the\n * reader who can least afford it. 100 covers \"let me scan the lot\" without\n * that.\n */\nexport const PAGE_SIZES = [10, 20, 50, 100];\n"],"mappings":";;;;;;;;;;AA2CA,MAAa,mBAAmB,UAAgC;CAC9D,MAAM,EAAE,UAAU,MAAM,UAAU,YAAY;CAC9C,MAAM,YAAY,MAAM,aAAa;CACrC,MAAM,EAAE,IAAI,MAAM,QAAQ;CAE1B,OAME,qBAAC,OAAD;EACE,WAAW,GACT,+IACA,MAAM,SACR;EAJF,UAAA,CAUE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CASG,UAAU,SAAS,KAClB,CAAC,YAOC,oBAAC,SAAD;IACE,OAAO,SAAS,MAAM;IAGtB,OAAM;IACN,YAAY,EACV,cAAc,GAAG,kBAAkB,EACjC,SAAS,gBACX,CAAC,EACH;IAQA,kBAAiB;IACjB,OAAO,UAAU,KAAK,OAAO;KAC3B,OAAO,OAAO,CAAC;KACf,OAAO,OAAO,CAAC;IACjB,EAAE;GACH,CAAA,GAEL,oBAAC,KAAD;IAAG,WAAU;IACV,UAAA,OASG,GACE,KAAK,aACD,GAAG,oBAAoB;KACrB,SAAS;KACT,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC,GAAG,EAAE,KAAK,UAAU,CAAC;IAC/C,CAAC,IACD,GAAG,kBAAkB;KACnB,SAAS;KACT,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;IAC3B,CAAC,IAEL,WACI,KACA,MAAM,GAAG,oBAAoB;KAC3B,SAAS;KACT,MAAM,CACJ,EAAE,KAAK,gBAAgB,GACvB,KAAK,kBAAkB,KAAA,IACn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MAAM,IAAI,CAAC;KACxC;KACA,iBAAe,KAAK;KACpB,WAAW,GAAG,KAAK,UAAU,gCAAgC;IAC9D,CAAA,EACa,CAAA;GACC,EAAA,CAAA;EACT,CAAA,IACV,IACD;;AAET;;;;;;AAOA,SAAS,iBACP,SACA,OAC4B;CAC5B,IAAI,SAAS,GAAG,OAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CACpE,MAAM,QAAoC,CAAC,CAAC;CAC5C,IAAI,UAAU,GAAG,MAAM,KAAK,UAAU;CACtC,MAAM,QAAQ,KAAK,IAAI,GAAG,UAAU,CAAC;CACrC,MAAM,MAAM,KAAK,IAAI,QAAQ,GAAG,UAAU,CAAC;CAC3C,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC;CAC/C,IAAI,UAAU,QAAQ,GAAG,MAAM,KAAK,UAAU;CAC9C,MAAM,KAAK,KAAK;CAChB,OAAO;AACT;;;;;;;;;AAUA,MAAa,aAAa;CAAC;CAAI;CAAI;CAAI;AAAG"}
1
+ {"version":3,"file":"DataTableFooter.js","names":[],"sources":["../../src/table/DataTableFooter.tsx"],"sourcesContent":["import type { Page, ZObject, ZodNumber } from \"alepha\";\nimport type { FormModel } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport type { Dispatch, SetStateAction } from \"react\";\n\nimport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../core/Pagination.tsx\";\nimport { cn } from \"../core/utils.ts\";\nimport { Control } from \"../form/Control.tsx\";\n\nexport interface DataTableFooterProps {\n /**\n * Sizes offered in the picker, as passed to the table. Defaults to\n * {@link PAGE_SIZES}.\n */\n pageSizes?: number[];\n /**\n * The picker's one-field form, owned by the table.\n */\n sizeForm: FormModel<ZObject<{ size: ZodNumber }>>;\n /**\n * The current page's metadata, `null` until a page has arrived.\n */\n meta: Page<unknown>[\"page\"] | null;\n isMobile: boolean;\n setPage: Dispatch<SetStateAction<number>>;\n /**\n * The table's `chromeClassName`, merged after the bar's own classes.\n */\n className?: string;\n}\n\n/**\n * The footer under the rows: the page-size picker, where the reader is, and\n * the page links.\n */\nexport const DataTableFooter = (props: DataTableFooterProps) => {\n const { sizeForm, meta, isMobile, setPage } = props;\n const pageSizes = props.pageSizes ?? PAGE_SIZES;\n const { tr, l } = useI18n();\n\n return (\n /* `bg-muted`, paired with the filter bar above, see the note on it in\n `DataTableToolbar.tsx`.\n Carries the same `--bevel` fold under its top border: the three\n chrome bands (filter bar, header, footer) are lit from one side, so\n they read as the same material at three different heights. */\n <div\n className={cn(\n \"bg-muted -mt-2 flex flex-wrap items-center justify-between gap-2 rounded-md rounded-t-none border p-2 shadow-[inset_0_1px_0_0_var(--bevel)]\",\n props.className,\n )}\n >\n {/* The size picker sits with the count, not in the toolbar above:\n this line already answers \"how many, where am I\", while the\n toolbar answers \"which rows\". Mixing the two turns the toolbar\n into a junk drawer. */}\n <div className=\"flex items-center gap-2\">\n {/*\n Hidden on a phone, and the size itself is untouched: `size` is\n persisted per table, so a reader who chose 50 on a desktop keeps\n 50 here — this drops the CONTROL, not the setting. Nobody picks\n 100 rows on a 412px screen, and the picker plus the range text\n plus the numbered pages is exactly what made this bar wrap onto\n three lines (feedback #2106).\n */}\n {pageSizes.length > 0 && !isMobile && (\n // The same `Control` the filter bar is built on, so the picker\n // is one component with every other select in this table. It\n // used to be the raw `Select` underneath it, because `Control`\n // is form-bound and this is not a form — `sizeForm` (built in\n // `useDataTableData`) is\n // what closes that gap.\n <Control\n input={sizeForm.input.size}\n // The count line beside it is not a label, so the trigger has\n // to name itself.\n label=\"\"\n inputProps={{\n \"aria-label\": tr(\"table.pageSize\", {\n default: \"Rows per page\",\n }),\n }}\n // `bg-background`, because this bar is `bg-muted` and the\n // trigger is `bg-transparent` by default: on a plain form\n // surface that blending is right, on a tinted bar it made the\n // picker read as part of the bar while the pagination buttons\n // beside it sat on their own plane. Set here rather than on\n // the trigger itself, which every form still wants\n // transparent.\n triggerClassName=\"bg-background h-7 w-auto gap-1 text-xs\"\n items={pageSizes.map((n) => ({\n value: String(n),\n label: String(n),\n }))}\n />\n )}\n <p className=\"text-muted-foreground text-xs\">\n {meta\n ? // The row range is the half that goes on a phone: \"where am\n // I\" survives, \"how many of how many\" does not, and the two\n // together are what pushed this past one line.\n //\n // Every part is the reader's language: the words through the\n // catalogue, the numbers through `l()`, so a French table\n // reads \"Page 1 sur 113 · 20 sur 2 250\" rather than an English\n // line with a French table above it (#Q2392).\n `${\n meta.totalPages\n ? tr(\"dataTable.pageOf\", {\n default: \"Page $1 of $2\",\n args: [l(meta.number + 1), l(meta.totalPages)],\n })\n : tr(\"dataTable.page\", {\n default: \"Page $1\",\n args: [l(meta.number + 1)],\n })\n }${\n isMobile\n ? \"\"\n : ` · ${tr(\"dataTable.rowsOf\", {\n default: \"$1 of $2\",\n args: [\n l(meta.numberOfElements),\n meta.totalElements === undefined\n ? \"?\"\n : l(meta.totalElements),\n ],\n })}`\n }`\n : \"—\"}\n </p>\n </div>\n {meta && meta.totalPages && meta.totalPages > 1 ? (\n <Pagination\n className=\"mx-0 w-auto justify-end\"\n aria-label={tr(\"dataTable.pagination\", { default: \"Pagination\" })}\n >\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n href=\"#\"\n text={tr(\"dataTable.previous\", { default: \"Previous\" })}\n aria-label={tr(\"dataTable.previousPage\", {\n default: \"Go to previous page\",\n })}\n onClick={(e) => {\n e.preventDefault();\n if (!meta.isFirst) setPage((p) => Math.max(0, p - 1));\n }}\n aria-disabled={meta.isFirst}\n className={cn(meta.isFirst && \"pointer-events-none opacity-50\")}\n />\n </PaginationItem>\n {/*\n Previous/next only on a phone. The numbered sequence is up\n to seven tap targets plus two ellipses, which is the widest\n thing in this bar, and \"Page 1 of 3\" beside it already says\n where the reader is. Their labels are `hidden sm:block` in\n the primitive, so the two that remain are bare chevrons.\n */}\n {!isMobile &&\n computePageItems(meta.number + 1, meta.totalPages).map(\n (item, idx) =>\n item === \"ellipsis\" ? (\n <PaginationItem key={`e-${idx}`}>\n <PaginationEllipsis\n label={tr(\"dataTable.morePages\", {\n default: \"More pages\",\n })}\n />\n </PaginationItem>\n ) : (\n <PaginationItem key={item}>\n <PaginationLink\n href=\"#\"\n isActive={item === meta.number + 1}\n onClick={(e) => {\n e.preventDefault();\n setPage(item - 1);\n }}\n >\n {item}\n </PaginationLink>\n </PaginationItem>\n ),\n )}\n <PaginationItem>\n <PaginationNext\n href=\"#\"\n text={tr(\"dataTable.next\", { default: \"Next\" })}\n aria-label={tr(\"dataTable.nextPage\", {\n default: \"Go to next page\",\n })}\n onClick={(e) => {\n e.preventDefault();\n if (!meta.isLast) setPage((p) => p + 1);\n }}\n aria-disabled={meta.isLast}\n className={cn(meta.isLast && \"pointer-events-none opacity-50\")}\n />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n ) : null}\n </div>\n );\n};\n\n/**\n * Build the visible page-number sequence with ellipses. Always shows\n * first + last, ±1 around current. Gaps collapse into a single ellipsis.\n * `current` and `total` are 1-indexed.\n */\nfunction computePageItems(\n current: number,\n total: number,\n): Array<number | \"ellipsis\"> {\n if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);\n const items: Array<number | \"ellipsis\"> = [1];\n if (current > 3) items.push(\"ellipsis\");\n const start = Math.max(2, current - 1);\n const end = Math.min(total - 1, current + 1);\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 2) items.push(\"ellipsis\");\n items.push(total);\n return items;\n}\n\n/**\n * Page sizes the footer offers.\n *\n * No \"all\". Pagination here is server-side, so an unbounded fetch is a query\n * whose cost grows with the biggest table in the product and is paid by the\n * reader who can least afford it. 100 covers \"let me scan the lot\" without\n * that.\n */\nexport const PAGE_SIZES = [10, 20, 50, 100];\n"],"mappings":";;;;;;;;;;AA2CA,MAAa,mBAAmB,UAAgC;CAC9D,MAAM,EAAE,UAAU,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AG,UAAU,CAAC;CACrC,MAAM,MAAM,KAAK,IAAI,QAAQ,GAAG,UAAU,CAAC;CAC3C,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC;CAC/C,IAAI,UAAU,QAAQ,GAAG,MAAM,KAAK,UAAU;CAC9C,MAAM,KAAK,KAAK;CAChB,OAAO;AACT;;;;;;;;;AAUA,MAAa,aAAa;CAAC;CAAI;CAAI;CAAI;AAAG"}
@@ -2,8 +2,8 @@ import { cn } from "../core/utils.js";
2
2
  import { TableHead, TableRow } from "../core/Table.js";
3
3
  import { Checkbox } from "../core/Checkbox.js";
4
4
  import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "../core/ContextMenu.js";
5
- import { ArrowDown, ArrowDownAZ, ArrowUp, ArrowUpAZ, ChevronLeft, ChevronRight, ChevronsUpDown, EyeOff } from "lucide-react";
6
5
  import { useI18n } from "alepha/react/i18n";
6
+ import { ArrowDown, ArrowDownAZ, ArrowUp, ArrowUpAZ, ChevronLeft, ChevronRight, ChevronsUpDown, EyeOff } from "lucide-react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/table/DataTableHeaderRow.tsx
9
9
  /**
@@ -1,8 +1,8 @@
1
1
  import { Button } from "../core/Button.js";
2
2
  import { HoverCard, HoverCardContent, HoverCardTrigger } from "../core/HoverCard.js";
3
+ import { useI18n } from "alepha/react/i18n";
3
4
  import { CircleHelp } from "lucide-react";
4
5
  import { useState } from "react";
5
- import { useI18n } from "alepha/react/i18n";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/table/DataTableHelpButton.tsx
8
8
  /**
@@ -27,7 +27,7 @@ const DataTableHelpButton = (props) => {
27
27
  render: /* @__PURE__ */ jsx(Button, {
28
28
  type: "button",
29
29
  size: "sm",
30
- variant: "ghost",
30
+ variant: "minimal",
31
31
  className: "h-9 w-9 p-0",
32
32
  "aria-label": label,
33
33
  onClick: () => setOpen(true)
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableHelpButton.js","names":[],"sources":["../../src/table/DataTableHelpButton.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { CircleHelp } from \"lucide-react\";\nimport { type ReactNode, useState } from \"react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"../core/HoverCard.tsx\";\n\nexport interface DataTableHelpButtonProps {\n /**\n * What the hover card holds: the table's `help`.\n */\n children: ReactNode;\n}\n\n/**\n * The `?` at the end of the toolbar's icon group, opening a hover card with\n * the page's explanation.\n *\n * A hover card opens on hover and on keyboard focus, and stays open while the\n * pointer crosses into it, so a link inside can be reached. Neither of those\n * happens on a touch screen: the hover is mouse-only, and a tap does not count\n * as a visible focus. So the state is held here and a click opens it too, and\n * the card closes as any hover card does, on Escape or a press outside.\n */\nexport const DataTableHelpButton = (props: DataTableHelpButtonProps) => {\n const { tr } = useI18n();\n const [open, setOpen] = useState(false);\n const label = tr(\"dataTable.help\", { default: \"Help\" });\n\n return (\n <HoverCard open={open} onOpenChange={(next) => setOpen(next)}>\n <HoverCardTrigger\n // Shorter than the hover card's own 600ms: the reader pointing at a\n // `?` is asking for it, not skimming past a link.\n delay={200}\n render={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-9 w-9 p-0\"\n aria-label={label}\n onClick={() => setOpen(true)}\n />\n }\n >\n <CircleHelp className=\"size-4\" />\n </HoverCardTrigger>\n <HoverCardContent\n side=\"bottom\"\n align=\"end\"\n className=\"w-80 max-w-[calc(100vw-2rem)] p-3 leading-relaxed\"\n >\n {props.children}\n </HoverCardContent>\n </HoverCard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAa,uBAAuB,UAAoC;CACtE,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,QAAQ,GAAG,kBAAkB,EAAE,SAAS,OAAO,CAAC;CAEtD,OACE,qBAAC,WAAD;EAAiB;EAAM,eAAe,SAAS,QAAQ,IAAI;EAA3D,UAAA,CACE,oBAAC,kBAAD;GAGE,OAAO;GACP,QACE,oBAAC,QAAD;IACE,MAAK;IACL,MAAK;IACL,SAAQ;IACR,WAAU;IACV,cAAY;IACZ,eAAe,QAAQ,IAAI;GAC5B,CAAA;GAGH,UAAA,oBAAC,YAAD,EAAY,WAAU,SAAU,CAAA;EAChB,CAAA,GAClB,oBAAC,kBAAD;GACE,MAAK;GACL,OAAM;GACN,WAAU;GAET,UAAA,MAAM;EACS,CAAA,CACT;;AAEf"}
1
+ {"version":3,"file":"DataTableHelpButton.js","names":[],"sources":["../../src/table/DataTableHelpButton.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { CircleHelp } from \"lucide-react\";\nimport { type ReactNode, useState } from \"react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"../core/HoverCard.tsx\";\n\nexport interface DataTableHelpButtonProps {\n /**\n * What the hover card holds: the table's `help`.\n */\n children: ReactNode;\n}\n\n/**\n * The `?` at the end of the toolbar's icon group, opening a hover card with\n * the page's explanation.\n *\n * A hover card opens on hover and on keyboard focus, and stays open while the\n * pointer crosses into it, so a link inside can be reached. Neither of those\n * happens on a touch screen: the hover is mouse-only, and a tap does not count\n * as a visible focus. So the state is held here and a click opens it too, and\n * the card closes as any hover card does, on Escape or a press outside.\n */\nexport const DataTableHelpButton = (props: DataTableHelpButtonProps) => {\n const { tr } = useI18n();\n const [open, setOpen] = useState(false);\n const label = tr(\"dataTable.help\", { default: \"Help\" });\n\n return (\n <HoverCard open={open} onOpenChange={(next) => setOpen(next)}>\n <HoverCardTrigger\n // Shorter than the hover card's own 600ms: the reader pointing at a\n // `?` is asking for it, not skimming past a link.\n delay={200}\n render={\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"minimal\"\n className=\"h-9 w-9 p-0\"\n aria-label={label}\n onClick={() => setOpen(true)}\n />\n }\n >\n <CircleHelp className=\"size-4\" />\n </HoverCardTrigger>\n <HoverCardContent\n side=\"bottom\"\n align=\"end\"\n className=\"w-80 max-w-[calc(100vw-2rem)] p-3 leading-relaxed\"\n >\n {props.children}\n </HoverCardContent>\n </HoverCard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAa,uBAAuB,UAAoC;CACtE,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,QAAQ,GAAG,kBAAkB,EAAE,SAAS,OAAO,CAAC;CAEtD,OACE,qBAAC,WAAD;EAAiB;EAAM,eAAe,SAAS,QAAQ,IAAI;EAA3D,UAAA,CACE,oBAAC,kBAAD;GAGE,OAAO;GACP,QACE,oBAAC,QAAD;IACE,MAAK;IACL,MAAK;IACL,SAAQ;IACR,WAAU;IACV,cAAY;IACZ,eAAe,QAAQ,IAAI;GAC5B,CAAA;GAGH,UAAA,oBAAC,YAAD,EAAY,WAAU,SAAU,CAAA;EAChB,CAAA,GAClB,oBAAC,kBAAD;GACE,MAAK;GACL,OAAM;GACN,WAAU;GAET,UAAA,MAAM;EACS,CAAA,CACT;;AAEf"}
@@ -1,8 +1,8 @@
1
- import { Button } from "../core/Button.js";
2
1
  import { DropdownMenu, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "../core/DropdownMenu.js";
2
+ import { Button } from "../core/Button.js";
3
3
  import { DataTableRowActionItem } from "./DataTableRowActionItem.js";
4
- import { MoreVertical } from "lucide-react";
5
4
  import { useI18n } from "alepha/react/i18n";
5
+ import { MoreVertical } from "lucide-react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/table/DataTableRowActionsMenu.tsx
8
8
  /**
@@ -15,7 +15,7 @@ const DataTableRowActionsMenu = (props) => {
15
15
  if (effective.length === 0) return null;
16
16
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
17
17
  render: /* @__PURE__ */ jsx(Button, {
18
- variant: "ghost",
18
+ variant: "minimal",
19
19
  size: "icon",
20
20
  "aria-label": tr("dataTable.openRowActions", { default: "Open row actions" })
21
21
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableRowActionsMenu.js","names":[],"sources":["../../src/table/DataTableRowActionsMenu.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { MoreVertical } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\nimport { DataTableRowActionItem } from \"./DataTableRowActionItem.tsx\";\nimport type {\n RowActionContext,\n RowActionEntry,\n RowActionGroup,\n} from \"./dataTableTypes.ts\";\n\nexport interface DataTableRowActionsMenuProps<T> {\n actions: RowActionEntry<T>[];\n item: T;\n ctx: RowActionContext;\n}\n\n/**\n * The three-dots menu at the end of a row, with one level of submenus for\n * groups. Renders nothing when no entry survives.\n */\nexport const DataTableRowActionsMenu = <T,>(\n props: DataTableRowActionsMenuProps<T>,\n) => {\n const { tr } = useI18n();\n // ⚠️ Effective entries, not entries: a group is one entry however many\n // children it has, so a lone empty group would otherwise render the\n // three-dots trigger over an empty menu.\n const effective = props.actions.filter((action) =>\n isRowActionGroup(action) ? action.children.length > 0 : true,\n );\n if (effective.length === 0) return null;\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={tr(\"dataTable.openRowActions\", {\n default: \"Open row actions\",\n })}\n />\n }\n >\n <MoreVertical className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {effective.map((action, idx) => {\n const Icon = action.icon;\n if (isRowActionGroup(action)) {\n return (\n <DropdownMenuSub key={action.label}>\n <DropdownMenuSubTrigger>\n {Icon && <Icon className=\"mr-2 size-4\" />}\n {action.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n {action.children.map((child) => (\n <DataTableRowActionItem\n key={child.label}\n action={child}\n item={props.item}\n ctx={props.ctx}\n />\n ))}\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n }\n // A group is never destructive, so the previous entry being one\n // reads as falsy here and the separator rule needs no case for it.\n const previous = effective[idx - 1];\n const sep =\n idx > 0 &&\n action.destructive &&\n !(previous && !isRowActionGroup(previous) && previous.destructive);\n return (\n <span key={action.label}>\n {sep && <DropdownMenuSeparator />}\n <DataTableRowActionItem\n action={action}\n item={props.item}\n ctx={props.ctx}\n />\n </span>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n\nfunction isRowActionGroup<T>(\n entry: RowActionEntry<T>,\n): entry is RowActionGroup<T> {\n return \"children\" in entry;\n}\n"],"mappings":";;;;;;;;;;;AA8BA,MAAa,2BACX,UACG;CACH,MAAM,EAAE,OAAO,QAAQ;CAIvB,MAAM,YAAY,MAAM,QAAQ,QAAQ,WACtC,iBAAiB,MAAM,IAAI,OAAO,SAAS,SAAS,IAAI,IAC1D;CACA,IAAI,UAAU,WAAW,GAAG,OAAO;CACnC,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,qBAAD;EACE,QACE,oBAAC,QAAD;GACE,SAAQ;GACR,MAAK;GACL,cAAY,GAAG,4BAA4B,EACzC,SAAS,mBACX,CAAC;EACF,CAAA;EAGH,UAAA,oBAAC,cAAD,EAAc,WAAU,SAAU,CAAA;CACf,CAAA,GACrB,oBAAC,qBAAD;EAAqB,OAAM;EACxB,UAAA,UAAU,KAAK,QAAQ,QAAQ;GAC9B,MAAM,OAAO,OAAO;GACpB,IAAI,iBAAiB,MAAM,GACzB,OACE,qBAAC,iBAAD,EAAA,UAAA,CACE,qBAAC,wBAAD,EAAA,UAAA,CACG,QAAQ,oBAAC,MAAD,EAAM,WAAU,cAAe,CAAA,GACvC,OAAO,KACc,EAAA,CAAA,GACxB,oBAAC,wBAAD,EAAA,UACG,OAAO,SAAS,KAAK,UACpB,oBAAC,wBAAD;IAEE,QAAQ;IACR,MAAM,MAAM;IACZ,KAAK,MAAM;GACZ,GAJM,MAAM,KAIZ,CACF,EACqB,CAAA,CACT,EAAA,GAfK,OAAO,KAeZ;GAKrB,MAAM,WAAW,UAAU,MAAM;GACjC,MAAM,MACJ,MAAM,KACN,OAAO,eACP,EAAE,YAAY,CAAC,iBAAiB,QAAQ,KAAK,SAAS;GACxD,OACE,qBAAC,QAAD,EAAA,UAAA,CACG,OAAO,oBAAC,uBAAD,CAAwB,CAAA,GAChC,oBAAC,wBAAD;IACU;IACR,MAAM,MAAM;IACZ,KAAK,MAAM;GACZ,CAAA,CACG,EAAA,GAPK,OAAO,KAOZ;EAEV,CAAC;CACkB,CAAA,CACT,EAAA,CAAA;AAElB;AAEA,SAAS,iBACP,OAC4B;CAC5B,OAAO,cAAc;AACvB"}
1
+ {"version":3,"file":"DataTableRowActionsMenu.js","names":[],"sources":["../../src/table/DataTableRowActionsMenu.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { MoreVertical } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\nimport { DataTableRowActionItem } from \"./DataTableRowActionItem.tsx\";\nimport type {\n RowActionContext,\n RowActionEntry,\n RowActionGroup,\n} from \"./dataTableTypes.ts\";\n\nexport interface DataTableRowActionsMenuProps<T> {\n actions: RowActionEntry<T>[];\n item: T;\n ctx: RowActionContext;\n}\n\n/**\n * The three-dots menu at the end of a row, with one level of submenus for\n * groups. Renders nothing when no entry survives.\n */\nexport const DataTableRowActionsMenu = <T,>(\n props: DataTableRowActionsMenuProps<T>,\n) => {\n const { tr } = useI18n();\n // ⚠️ Effective entries, not entries: a group is one entry however many\n // children it has, so a lone empty group would otherwise render the\n // three-dots trigger over an empty menu.\n const effective = props.actions.filter((action) =>\n isRowActionGroup(action) ? action.children.length > 0 : true,\n );\n if (effective.length === 0) return null;\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n variant=\"minimal\"\n size=\"icon\"\n aria-label={tr(\"dataTable.openRowActions\", {\n default: \"Open row actions\",\n })}\n />\n }\n >\n <MoreVertical className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {effective.map((action, idx) => {\n const Icon = action.icon;\n if (isRowActionGroup(action)) {\n return (\n <DropdownMenuSub key={action.label}>\n <DropdownMenuSubTrigger>\n {Icon && <Icon className=\"mr-2 size-4\" />}\n {action.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n {action.children.map((child) => (\n <DataTableRowActionItem\n key={child.label}\n action={child}\n item={props.item}\n ctx={props.ctx}\n />\n ))}\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n }\n // A group is never destructive, so the previous entry being one\n // reads as falsy here and the separator rule needs no case for it.\n const previous = effective[idx - 1];\n const sep =\n idx > 0 &&\n action.destructive &&\n !(previous && !isRowActionGroup(previous) && previous.destructive);\n return (\n <span key={action.label}>\n {sep && <DropdownMenuSeparator />}\n <DataTableRowActionItem\n action={action}\n item={props.item}\n ctx={props.ctx}\n />\n </span>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n\nfunction isRowActionGroup<T>(\n entry: RowActionEntry<T>,\n): entry is RowActionGroup<T> {\n return \"children\" in entry;\n}\n"],"mappings":";;;;;;;;;;;AA8BA,MAAa,2BACX,UACG;CACH,MAAM,EAAE,OAAO,QAAQ;CAI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