@entifix/react-controls 0.1.0-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 (471) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/i18n/catalog/en.d.ts +10 -0
  4. package/dist/i18n/catalog/en.d.ts.map +1 -0
  5. package/dist/i18n/catalog/en.js +211 -0
  6. package/dist/i18n/catalog/en.js.map +1 -0
  7. package/dist/i18n/catalog/es.d.ts +275 -0
  8. package/dist/i18n/catalog/es.d.ts.map +1 -0
  9. package/dist/i18n/catalog/es.js +261 -0
  10. package/dist/i18n/catalog/es.js.map +1 -0
  11. package/dist/i18n/catalog/index.d.ts +403 -0
  12. package/dist/i18n/catalog/index.d.ts.map +1 -0
  13. package/dist/i18n/catalog/index.js +23 -0
  14. package/dist/i18n/catalog/index.js.map +1 -0
  15. package/dist/i18n/entity-labels.d.ts +29 -0
  16. package/dist/i18n/entity-labels.d.ts.map +1 -0
  17. package/dist/i18n/entity-labels.js +49 -0
  18. package/dist/i18n/entity-labels.js.map +1 -0
  19. package/dist/i18n/fallback-catalogs.d.ts +5 -0
  20. package/dist/i18n/fallback-catalogs.d.ts.map +1 -0
  21. package/dist/i18n/fallback-catalogs.js +34 -0
  22. package/dist/i18n/fallback-catalogs.js.map +1 -0
  23. package/dist/i18n/i18n-context.d.ts +62 -0
  24. package/dist/i18n/i18n-context.d.ts.map +1 -0
  25. package/dist/i18n/i18n-context.js +128 -0
  26. package/dist/i18n/i18n-context.js.map +1 -0
  27. package/dist/i18n/index.d.ts +5 -0
  28. package/dist/i18n/index.d.ts.map +1 -0
  29. package/dist/i18n/index.js +6 -0
  30. package/dist/i18n/index.js.map +1 -0
  31. package/dist/i18n/spec-support/catalogs.d.ts +2 -0
  32. package/dist/i18n/spec-support/catalogs.d.ts.map +1 -0
  33. package/dist/i18n/spec-support/catalogs.js +142 -0
  34. package/dist/i18n/spec-support/catalogs.js.map +1 -0
  35. package/dist/i18next/index.d.ts +20 -0
  36. package/dist/i18next/index.d.ts.map +1 -0
  37. package/dist/i18next/index.js +60 -0
  38. package/dist/i18next/index.js.map +1 -0
  39. package/dist/index.d.ts +46 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +47 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/preferences/index.d.ts +7 -0
  44. package/dist/preferences/index.d.ts.map +1 -0
  45. package/dist/preferences/index.js +8 -0
  46. package/dist/preferences/index.js.map +1 -0
  47. package/dist/preferences/indexeddb-ui-preferences-state.d.ts +16 -0
  48. package/dist/preferences/indexeddb-ui-preferences-state.d.ts.map +1 -0
  49. package/dist/preferences/indexeddb-ui-preferences-state.js +50 -0
  50. package/dist/preferences/indexeddb-ui-preferences-state.js.map +1 -0
  51. package/dist/preferences/local-storage-ui-preferences-state.d.ts +16 -0
  52. package/dist/preferences/local-storage-ui-preferences-state.d.ts.map +1 -0
  53. package/dist/preferences/local-storage-ui-preferences-state.js +51 -0
  54. package/dist/preferences/local-storage-ui-preferences-state.js.map +1 -0
  55. package/dist/preferences/ui-preferences-context.d.ts +16 -0
  56. package/dist/preferences/ui-preferences-context.d.ts.map +1 -0
  57. package/dist/preferences/ui-preferences-context.js +31 -0
  58. package/dist/preferences/ui-preferences-context.js.map +1 -0
  59. package/dist/preferences/ui-preferences-state.d.ts +23 -0
  60. package/dist/preferences/ui-preferences-state.d.ts.map +1 -0
  61. package/dist/preferences/ui-preferences-state.js +5 -0
  62. package/dist/preferences/ui-preferences-state.js.map +1 -0
  63. package/dist/preferences/use-ui-preference.d.ts +20 -0
  64. package/dist/preferences/use-ui-preference.d.ts.map +1 -0
  65. package/dist/preferences/use-ui-preference.js +72 -0
  66. package/dist/preferences/use-ui-preference.js.map +1 -0
  67. package/dist/preferences/use-viewport-mode.d.ts +33 -0
  68. package/dist/preferences/use-viewport-mode.d.ts.map +1 -0
  69. package/dist/preferences/use-viewport-mode.js +53 -0
  70. package/dist/preferences/use-viewport-mode.js.map +1 -0
  71. package/dist/primitives.d.ts +25 -0
  72. package/dist/primitives.d.ts.map +1 -0
  73. package/dist/primitives.js +54 -0
  74. package/dist/primitives.js.map +1 -0
  75. package/dist/theme/index.d.ts +3 -0
  76. package/dist/theme/index.d.ts.map +1 -0
  77. package/dist/theme/index.js +4 -0
  78. package/dist/theme/index.js.map +1 -0
  79. package/dist/theme/theme-context.d.ts +26 -0
  80. package/dist/theme/theme-context.d.ts.map +1 -0
  81. package/dist/theme/theme-context.js +79 -0
  82. package/dist/theme/theme-context.js.map +1 -0
  83. package/dist/theme/types.d.ts +22 -0
  84. package/dist/theme/types.d.ts.map +1 -0
  85. package/dist/theme/types.js +6 -0
  86. package/dist/theme/types.js.map +1 -0
  87. package/dist/ui/actions/action-surfaces.d.ts +59 -0
  88. package/dist/ui/actions/action-surfaces.d.ts.map +1 -0
  89. package/dist/ui/actions/action-surfaces.js +109 -0
  90. package/dist/ui/actions/action-surfaces.js.map +1 -0
  91. package/dist/ui/actions/index.d.ts +2 -0
  92. package/dist/ui/actions/index.d.ts.map +1 -0
  93. package/dist/ui/actions/index.js +3 -0
  94. package/dist/ui/actions/index.js.map +1 -0
  95. package/dist/ui/atoms/button/button-link.d.ts +27 -0
  96. package/dist/ui/atoms/button/button-link.d.ts.map +1 -0
  97. package/dist/ui/atoms/button/button-link.js +23 -0
  98. package/dist/ui/atoms/button/button-link.js.map +1 -0
  99. package/dist/ui/atoms/button/button-recipe.d.ts +19 -0
  100. package/dist/ui/atoms/button/button-recipe.d.ts.map +1 -0
  101. package/dist/ui/atoms/button/button-recipe.js +42 -0
  102. package/dist/ui/atoms/button/button-recipe.js.map +1 -0
  103. package/dist/ui/atoms/button/button.d.ts +7 -0
  104. package/dist/ui/atoms/button/button.d.ts.map +1 -0
  105. package/dist/ui/atoms/button/button.js +22 -0
  106. package/dist/ui/atoms/button/button.js.map +1 -0
  107. package/dist/ui/atoms/button/index.d.ts +4 -0
  108. package/dist/ui/atoms/button/index.d.ts.map +1 -0
  109. package/dist/ui/atoms/button/index.js +5 -0
  110. package/dist/ui/atoms/button/index.js.map +1 -0
  111. package/dist/ui/atoms/cell-value/cell-value.d.ts +12 -0
  112. package/dist/ui/atoms/cell-value/cell-value.d.ts.map +1 -0
  113. package/dist/ui/atoms/cell-value/cell-value.js +101 -0
  114. package/dist/ui/atoms/cell-value/cell-value.js.map +1 -0
  115. package/dist/ui/atoms/cell-value/index.d.ts +2 -0
  116. package/dist/ui/atoms/cell-value/index.d.ts.map +1 -0
  117. package/dist/ui/atoms/cell-value/index.js +3 -0
  118. package/dist/ui/atoms/cell-value/index.js.map +1 -0
  119. package/dist/ui/atoms/field/checkbox.d.ts +35 -0
  120. package/dist/ui/atoms/field/checkbox.d.ts.map +1 -0
  121. package/dist/ui/atoms/field/checkbox.js +46 -0
  122. package/dist/ui/atoms/field/checkbox.js.map +1 -0
  123. package/dist/ui/atoms/field/field.d.ts +4 -0
  124. package/dist/ui/atoms/field/field.d.ts.map +1 -0
  125. package/dist/ui/atoms/field/field.js +29 -0
  126. package/dist/ui/atoms/field/field.js.map +1 -0
  127. package/dist/ui/atoms/field/index.d.ts +3 -0
  128. package/dist/ui/atoms/field/index.d.ts.map +1 -0
  129. package/dist/ui/atoms/field/index.js +4 -0
  130. package/dist/ui/atoms/field/index.js.map +1 -0
  131. package/dist/ui/atoms/field-control/field-control.d.ts +50 -0
  132. package/dist/ui/atoms/field-control/field-control.d.ts.map +1 -0
  133. package/dist/ui/atoms/field-control/field-control.js +82 -0
  134. package/dist/ui/atoms/field-control/field-control.js.map +1 -0
  135. package/dist/ui/atoms/field-control/index.d.ts +2 -0
  136. package/dist/ui/atoms/field-control/index.d.ts.map +1 -0
  137. package/dist/ui/atoms/field-control/index.js +3 -0
  138. package/dist/ui/atoms/field-control/index.js.map +1 -0
  139. package/dist/ui/atoms/skeleton/index.d.ts +2 -0
  140. package/dist/ui/atoms/skeleton/index.d.ts.map +1 -0
  141. package/dist/ui/atoms/skeleton/index.js +3 -0
  142. package/dist/ui/atoms/skeleton/index.js.map +1 -0
  143. package/dist/ui/atoms/skeleton/skeleton.d.ts +21 -0
  144. package/dist/ui/atoms/skeleton/skeleton.d.ts.map +1 -0
  145. package/dist/ui/atoms/skeleton/skeleton.js +33 -0
  146. package/dist/ui/atoms/skeleton/skeleton.js.map +1 -0
  147. package/dist/ui/atoms/table/index.d.ts +2 -0
  148. package/dist/ui/atoms/table/index.d.ts.map +1 -0
  149. package/dist/ui/atoms/table/index.js +3 -0
  150. package/dist/ui/atoms/table/index.js.map +1 -0
  151. package/dist/ui/atoms/table/table.d.ts +30 -0
  152. package/dist/ui/atoms/table/table.d.ts.map +1 -0
  153. package/dist/ui/atoms/table/table.js +84 -0
  154. package/dist/ui/atoms/table/table.js.map +1 -0
  155. package/dist/ui/atoms/text/index.d.ts +2 -0
  156. package/dist/ui/atoms/text/index.d.ts.map +1 -0
  157. package/dist/ui/atoms/text/index.js +3 -0
  158. package/dist/ui/atoms/text/index.js.map +1 -0
  159. package/dist/ui/atoms/text/text.d.ts +86 -0
  160. package/dist/ui/atoms/text/text.d.ts.map +1 -0
  161. package/dist/ui/atoms/text/text.js +221 -0
  162. package/dist/ui/atoms/text/text.js.map +1 -0
  163. package/dist/ui/layout/_demo.d.ts +6 -0
  164. package/dist/ui/layout/_demo.d.ts.map +1 -0
  165. package/dist/ui/layout/_demo.js +11 -0
  166. package/dist/ui/layout/_demo.js.map +1 -0
  167. package/dist/ui/layout/_shared.d.ts +9 -0
  168. package/dist/ui/layout/_shared.d.ts.map +1 -0
  169. package/dist/ui/layout/_shared.js +30 -0
  170. package/dist/ui/layout/_shared.js.map +1 -0
  171. package/dist/ui/layout/box/box.d.ts +10 -0
  172. package/dist/ui/layout/box/box.d.ts.map +1 -0
  173. package/dist/ui/layout/box/box.js +28 -0
  174. package/dist/ui/layout/box/box.js.map +1 -0
  175. package/dist/ui/layout/box/index.d.ts +2 -0
  176. package/dist/ui/layout/box/index.d.ts.map +1 -0
  177. package/dist/ui/layout/box/index.js +3 -0
  178. package/dist/ui/layout/box/index.js.map +1 -0
  179. package/dist/ui/layout/center/center.d.ts +13 -0
  180. package/dist/ui/layout/center/center.d.ts.map +1 -0
  181. package/dist/ui/layout/center/center.js +22 -0
  182. package/dist/ui/layout/center/center.js.map +1 -0
  183. package/dist/ui/layout/center/index.d.ts +2 -0
  184. package/dist/ui/layout/center/index.d.ts.map +1 -0
  185. package/dist/ui/layout/center/index.js +3 -0
  186. package/dist/ui/layout/center/index.js.map +1 -0
  187. package/dist/ui/layout/cluster/cluster.d.ts +11 -0
  188. package/dist/ui/layout/cluster/cluster.d.ts.map +1 -0
  189. package/dist/ui/layout/cluster/cluster.js +19 -0
  190. package/dist/ui/layout/cluster/cluster.js.map +1 -0
  191. package/dist/ui/layout/cluster/index.d.ts +2 -0
  192. package/dist/ui/layout/cluster/index.d.ts.map +1 -0
  193. package/dist/ui/layout/cluster/index.js +3 -0
  194. package/dist/ui/layout/cluster/index.js.map +1 -0
  195. package/dist/ui/layout/cover/cover.d.ts +26 -0
  196. package/dist/ui/layout/cover/cover.d.ts.map +1 -0
  197. package/dist/ui/layout/cover/cover.js +57 -0
  198. package/dist/ui/layout/cover/cover.js.map +1 -0
  199. package/dist/ui/layout/cover/index.d.ts +2 -0
  200. package/dist/ui/layout/cover/index.d.ts.map +1 -0
  201. package/dist/ui/layout/cover/index.js +3 -0
  202. package/dist/ui/layout/cover/index.js.map +1 -0
  203. package/dist/ui/layout/grid/grid.d.ts +14 -0
  204. package/dist/ui/layout/grid/grid.d.ts.map +1 -0
  205. package/dist/ui/layout/grid/grid.js +25 -0
  206. package/dist/ui/layout/grid/grid.js.map +1 -0
  207. package/dist/ui/layout/grid/index.d.ts +2 -0
  208. package/dist/ui/layout/grid/index.d.ts.map +1 -0
  209. package/dist/ui/layout/grid/index.js +3 -0
  210. package/dist/ui/layout/grid/index.js.map +1 -0
  211. package/dist/ui/layout/sidebar/index.d.ts +2 -0
  212. package/dist/ui/layout/sidebar/index.d.ts.map +1 -0
  213. package/dist/ui/layout/sidebar/index.js +3 -0
  214. package/dist/ui/layout/sidebar/index.js.map +1 -0
  215. package/dist/ui/layout/sidebar/sidebar.d.ts +33 -0
  216. package/dist/ui/layout/sidebar/sidebar.d.ts.map +1 -0
  217. package/dist/ui/layout/sidebar/sidebar.js +54 -0
  218. package/dist/ui/layout/sidebar/sidebar.js.map +1 -0
  219. package/dist/ui/layout/switcher/index.d.ts +2 -0
  220. package/dist/ui/layout/switcher/index.d.ts.map +1 -0
  221. package/dist/ui/layout/switcher/index.js +3 -0
  222. package/dist/ui/layout/switcher/index.js.map +1 -0
  223. package/dist/ui/layout/switcher/switcher.d.ts +15 -0
  224. package/dist/ui/layout/switcher/switcher.d.ts.map +1 -0
  225. package/dist/ui/layout/switcher/switcher.js +26 -0
  226. package/dist/ui/layout/switcher/switcher.js.map +1 -0
  227. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts +27 -0
  228. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  229. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js +50 -0
  230. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js.map +1 -0
  231. package/dist/ui/molecules/breadcrumbs/index.d.ts +2 -0
  232. package/dist/ui/molecules/breadcrumbs/index.d.ts.map +1 -0
  233. package/dist/ui/molecules/breadcrumbs/index.js +3 -0
  234. package/dist/ui/molecules/breadcrumbs/index.js.map +1 -0
  235. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts +47 -0
  236. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts.map +1 -0
  237. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js +63 -0
  238. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js.map +1 -0
  239. package/dist/ui/molecules/bulk-action-bar/index.d.ts +2 -0
  240. package/dist/ui/molecules/bulk-action-bar/index.d.ts.map +1 -0
  241. package/dist/ui/molecules/bulk-action-bar/index.js +3 -0
  242. package/dist/ui/molecules/bulk-action-bar/index.js.map +1 -0
  243. package/dist/ui/molecules/bulk-result/bulk-result.d.ts +31 -0
  244. package/dist/ui/molecules/bulk-result/bulk-result.d.ts.map +1 -0
  245. package/dist/ui/molecules/bulk-result/bulk-result.js +86 -0
  246. package/dist/ui/molecules/bulk-result/bulk-result.js.map +1 -0
  247. package/dist/ui/molecules/bulk-result/index.d.ts +2 -0
  248. package/dist/ui/molecules/bulk-result/index.d.ts.map +1 -0
  249. package/dist/ui/molecules/bulk-result/index.js +3 -0
  250. package/dist/ui/molecules/bulk-result/index.js.map +1 -0
  251. package/dist/ui/molecules/card/card.d.ts +5 -0
  252. package/dist/ui/molecules/card/card.d.ts.map +1 -0
  253. package/dist/ui/molecules/card/card.js +14 -0
  254. package/dist/ui/molecules/card/card.js.map +1 -0
  255. package/dist/ui/molecules/card/index.d.ts +2 -0
  256. package/dist/ui/molecules/card/index.d.ts.map +1 -0
  257. package/dist/ui/molecules/card/index.js +3 -0
  258. package/dist/ui/molecules/card/index.js.map +1 -0
  259. package/dist/ui/molecules/column-settings/column-settings.d.ts +29 -0
  260. package/dist/ui/molecules/column-settings/column-settings.d.ts.map +1 -0
  261. package/dist/ui/molecules/column-settings/column-settings.js +117 -0
  262. package/dist/ui/molecules/column-settings/column-settings.js.map +1 -0
  263. package/dist/ui/molecules/column-settings/index.d.ts +2 -0
  264. package/dist/ui/molecules/column-settings/index.d.ts.map +1 -0
  265. package/dist/ui/molecules/column-settings/index.js +3 -0
  266. package/dist/ui/molecules/column-settings/index.js.map +1 -0
  267. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts +31 -0
  268. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts.map +1 -0
  269. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js +68 -0
  270. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js.map +1 -0
  271. package/dist/ui/molecules/confirm-dialog/index.d.ts +2 -0
  272. package/dist/ui/molecules/confirm-dialog/index.d.ts.map +1 -0
  273. package/dist/ui/molecules/confirm-dialog/index.js +3 -0
  274. package/dist/ui/molecules/confirm-dialog/index.js.map +1 -0
  275. package/dist/ui/molecules/drawer/drawer.d.ts +25 -0
  276. package/dist/ui/molecules/drawer/drawer.d.ts.map +1 -0
  277. package/dist/ui/molecules/drawer/drawer.js +60 -0
  278. package/dist/ui/molecules/drawer/drawer.js.map +1 -0
  279. package/dist/ui/molecules/drawer/index.d.ts +2 -0
  280. package/dist/ui/molecules/drawer/index.d.ts.map +1 -0
  281. package/dist/ui/molecules/drawer/index.js +3 -0
  282. package/dist/ui/molecules/drawer/index.js.map +1 -0
  283. package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts +36 -0
  284. package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts.map +1 -0
  285. package/dist/ui/molecules/entity-link-input/entity-link-input.js +191 -0
  286. package/dist/ui/molecules/entity-link-input/entity-link-input.js.map +1 -0
  287. package/dist/ui/molecules/entity-link-input/index.d.ts +2 -0
  288. package/dist/ui/molecules/entity-link-input/index.d.ts.map +1 -0
  289. package/dist/ui/molecules/entity-link-input/index.js +3 -0
  290. package/dist/ui/molecules/entity-link-input/index.js.map +1 -0
  291. package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts +19 -0
  292. package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts.map +1 -0
  293. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js +78 -0
  294. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js.map +1 -0
  295. package/dist/ui/molecules/entity-link-picker/index.d.ts +2 -0
  296. package/dist/ui/molecules/entity-link-picker/index.d.ts.map +1 -0
  297. package/dist/ui/molecules/entity-link-picker/index.js +3 -0
  298. package/dist/ui/molecules/entity-link-picker/index.js.map +1 -0
  299. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts +30 -0
  300. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts.map +1 -0
  301. package/dist/ui/molecules/entity-record-card/entity-record-card.js +39 -0
  302. package/dist/ui/molecules/entity-record-card/entity-record-card.js.map +1 -0
  303. package/dist/ui/molecules/entity-record-card/index.d.ts +2 -0
  304. package/dist/ui/molecules/entity-record-card/index.d.ts.map +1 -0
  305. package/dist/ui/molecules/entity-record-card/index.js +3 -0
  306. package/dist/ui/molecules/entity-record-card/index.js.map +1 -0
  307. package/dist/ui/molecules/filter-builder/filter-builder.d.ts +19 -0
  308. package/dist/ui/molecules/filter-builder/filter-builder.d.ts.map +1 -0
  309. package/dist/ui/molecules/filter-builder/filter-builder.js +333 -0
  310. package/dist/ui/molecules/filter-builder/filter-builder.js.map +1 -0
  311. package/dist/ui/molecules/filter-builder/filter-operators.d.ts +20 -0
  312. package/dist/ui/molecules/filter-builder/filter-operators.d.ts.map +1 -0
  313. package/dist/ui/molecules/filter-builder/filter-operators.js +56 -0
  314. package/dist/ui/molecules/filter-builder/filter-operators.js.map +1 -0
  315. package/dist/ui/molecules/filter-builder/index.d.ts +3 -0
  316. package/dist/ui/molecules/filter-builder/index.d.ts.map +1 -0
  317. package/dist/ui/molecules/filter-builder/index.js +4 -0
  318. package/dist/ui/molecules/filter-builder/index.js.map +1 -0
  319. package/dist/ui/molecules/loading-boundary/index.d.ts +2 -0
  320. package/dist/ui/molecules/loading-boundary/index.d.ts.map +1 -0
  321. package/dist/ui/molecules/loading-boundary/index.js +3 -0
  322. package/dist/ui/molecules/loading-boundary/index.js.map +1 -0
  323. package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts +27 -0
  324. package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts.map +1 -0
  325. package/dist/ui/molecules/loading-boundary/loading-boundary.js +42 -0
  326. package/dist/ui/molecules/loading-boundary/loading-boundary.js.map +1 -0
  327. package/dist/ui/molecules/menu/index.d.ts +2 -0
  328. package/dist/ui/molecules/menu/index.d.ts.map +1 -0
  329. package/dist/ui/molecules/menu/index.js +3 -0
  330. package/dist/ui/molecules/menu/index.js.map +1 -0
  331. package/dist/ui/molecules/menu/menu.d.ts +37 -0
  332. package/dist/ui/molecules/menu/menu.d.ts.map +1 -0
  333. package/dist/ui/molecules/menu/menu.js +71 -0
  334. package/dist/ui/molecules/menu/menu.js.map +1 -0
  335. package/dist/ui/molecules/pagination/index.d.ts +2 -0
  336. package/dist/ui/molecules/pagination/index.d.ts.map +1 -0
  337. package/dist/ui/molecules/pagination/index.js +3 -0
  338. package/dist/ui/molecules/pagination/index.js.map +1 -0
  339. package/dist/ui/molecules/pagination/pagination.d.ts +13 -0
  340. package/dist/ui/molecules/pagination/pagination.d.ts.map +1 -0
  341. package/dist/ui/molecules/pagination/pagination.js +68 -0
  342. package/dist/ui/molecules/pagination/pagination.js.map +1 -0
  343. package/dist/ui/molecules/sort-builder/index.d.ts +2 -0
  344. package/dist/ui/molecules/sort-builder/index.d.ts.map +1 -0
  345. package/dist/ui/molecules/sort-builder/index.js +3 -0
  346. package/dist/ui/molecules/sort-builder/index.js.map +1 -0
  347. package/dist/ui/molecules/sort-builder/sort-builder.d.ts +18 -0
  348. package/dist/ui/molecules/sort-builder/sort-builder.d.ts.map +1 -0
  349. package/dist/ui/molecules/sort-builder/sort-builder.js +185 -0
  350. package/dist/ui/molecules/sort-builder/sort-builder.js.map +1 -0
  351. package/dist/ui/molecules/stack/index.d.ts +2 -0
  352. package/dist/ui/molecules/stack/index.d.ts.map +1 -0
  353. package/dist/ui/molecules/stack/index.js +3 -0
  354. package/dist/ui/molecules/stack/index.js.map +1 -0
  355. package/dist/ui/molecules/stack/stack.d.ts +12 -0
  356. package/dist/ui/molecules/stack/stack.d.ts.map +1 -0
  357. package/dist/ui/molecules/stack/stack.js +36 -0
  358. package/dist/ui/molecules/stack/stack.js.map +1 -0
  359. package/dist/ui/molecules/tab-strip/index.d.ts +2 -0
  360. package/dist/ui/molecules/tab-strip/index.d.ts.map +1 -0
  361. package/dist/ui/molecules/tab-strip/index.js +3 -0
  362. package/dist/ui/molecules/tab-strip/index.js.map +1 -0
  363. package/dist/ui/molecules/tab-strip/tab-strip.d.ts +29 -0
  364. package/dist/ui/molecules/tab-strip/tab-strip.d.ts.map +1 -0
  365. package/dist/ui/molecules/tab-strip/tab-strip.js +82 -0
  366. package/dist/ui/molecules/tab-strip/tab-strip.js.map +1 -0
  367. package/dist/ui/molecules/table-toolbar/index.d.ts +2 -0
  368. package/dist/ui/molecules/table-toolbar/index.d.ts.map +1 -0
  369. package/dist/ui/molecules/table-toolbar/index.js +3 -0
  370. package/dist/ui/molecules/table-toolbar/index.js.map +1 -0
  371. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts +13 -0
  372. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts.map +1 -0
  373. package/dist/ui/molecules/table-toolbar/table-toolbar.js +28 -0
  374. package/dist/ui/molecules/table-toolbar/table-toolbar.js.map +1 -0
  375. package/dist/ui/molecules/theme-switcher/index.d.ts +2 -0
  376. package/dist/ui/molecules/theme-switcher/index.d.ts.map +1 -0
  377. package/dist/ui/molecules/theme-switcher/index.js +3 -0
  378. package/dist/ui/molecules/theme-switcher/index.js.map +1 -0
  379. package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts +6 -0
  380. package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts.map +1 -0
  381. package/dist/ui/molecules/theme-switcher/theme-switcher.js +24 -0
  382. package/dist/ui/molecules/theme-switcher/theme-switcher.js.map +1 -0
  383. package/dist/ui/organisms/command-palette/command-palette.d.ts +67 -0
  384. package/dist/ui/organisms/command-palette/command-palette.d.ts.map +1 -0
  385. package/dist/ui/organisms/command-palette/command-palette.js +226 -0
  386. package/dist/ui/organisms/command-palette/command-palette.js.map +1 -0
  387. package/dist/ui/organisms/command-palette/index.d.ts +2 -0
  388. package/dist/ui/organisms/command-palette/index.d.ts.map +1 -0
  389. package/dist/ui/organisms/command-palette/index.js +3 -0
  390. package/dist/ui/organisms/command-palette/index.js.map +1 -0
  391. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts +43 -0
  392. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts.map +1 -0
  393. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js +281 -0
  394. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js.map +1 -0
  395. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts +49 -0
  396. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts.map +1 -0
  397. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js +3 -0
  398. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js.map +1 -0
  399. package/dist/ui/organisms/entity-detail-grid/index.d.ts +3 -0
  400. package/dist/ui/organisms/entity-detail-grid/index.d.ts.map +1 -0
  401. package/dist/ui/organisms/entity-detail-grid/index.js +4 -0
  402. package/dist/ui/organisms/entity-detail-grid/index.js.map +1 -0
  403. package/dist/ui/organisms/entity-form/entity-form-slots.d.ts +53 -0
  404. package/dist/ui/organisms/entity-form/entity-form-slots.d.ts.map +1 -0
  405. package/dist/ui/organisms/entity-form/entity-form-slots.js +44 -0
  406. package/dist/ui/organisms/entity-form/entity-form-slots.js.map +1 -0
  407. package/dist/ui/organisms/entity-form/entity-form.d.ts +4 -0
  408. package/dist/ui/organisms/entity-form/entity-form.d.ts.map +1 -0
  409. package/dist/ui/organisms/entity-form/entity-form.js +494 -0
  410. package/dist/ui/organisms/entity-form/entity-form.js.map +1 -0
  411. package/dist/ui/organisms/entity-form/entity-form.types.d.ts +151 -0
  412. package/dist/ui/organisms/entity-form/entity-form.types.d.ts.map +1 -0
  413. package/dist/ui/organisms/entity-form/entity-form.types.js +3 -0
  414. package/dist/ui/organisms/entity-form/entity-form.types.js.map +1 -0
  415. package/dist/ui/organisms/entity-form/index.d.ts +5 -0
  416. package/dist/ui/organisms/entity-form/index.d.ts.map +1 -0
  417. package/dist/ui/organisms/entity-form/index.js +6 -0
  418. package/dist/ui/organisms/entity-form/index.js.map +1 -0
  419. package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts +13 -0
  420. package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts.map +1 -0
  421. package/dist/ui/organisms/entity-form/use-entity-form-fields.js +50 -0
  422. package/dist/ui/organisms/entity-form/use-entity-form-fields.js.map +1 -0
  423. package/dist/ui/organisms/entity-table/entity-table-slots.d.ts +55 -0
  424. package/dist/ui/organisms/entity-table/entity-table-slots.d.ts.map +1 -0
  425. package/dist/ui/organisms/entity-table/entity-table-slots.js +50 -0
  426. package/dist/ui/organisms/entity-table/entity-table-slots.js.map +1 -0
  427. package/dist/ui/organisms/entity-table/entity-table.d.ts +4 -0
  428. package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -0
  429. package/dist/ui/organisms/entity-table/entity-table.js +529 -0
  430. package/dist/ui/organisms/entity-table/entity-table.js.map +1 -0
  431. package/dist/ui/organisms/entity-table/entity-table.types.d.ts +126 -0
  432. package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -0
  433. package/dist/ui/organisms/entity-table/entity-table.types.js +3 -0
  434. package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -0
  435. package/dist/ui/organisms/entity-table/index.d.ts +5 -0
  436. package/dist/ui/organisms/entity-table/index.d.ts.map +1 -0
  437. package/dist/ui/organisms/entity-table/index.js +6 -0
  438. package/dist/ui/organisms/entity-table/index.js.map +1 -0
  439. package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts +29 -0
  440. package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts.map +1 -0
  441. package/dist/ui/organisms/entity-table/use-entity-table-columns.js +103 -0
  442. package/dist/ui/organisms/entity-table/use-entity-table-columns.js.map +1 -0
  443. package/dist/ui/organisms/top-bar/index.d.ts +2 -0
  444. package/dist/ui/organisms/top-bar/index.d.ts.map +1 -0
  445. package/dist/ui/organisms/top-bar/index.js +3 -0
  446. package/dist/ui/organisms/top-bar/index.js.map +1 -0
  447. package/dist/ui/organisms/top-bar/top-bar.d.ts +20 -0
  448. package/dist/ui/organisms/top-bar/top-bar.d.ts.map +1 -0
  449. package/dist/ui/organisms/top-bar/top-bar.js +43 -0
  450. package/dist/ui/organisms/top-bar/top-bar.js.map +1 -0
  451. package/dist/ui/organisms/wizard/index.d.ts +3 -0
  452. package/dist/ui/organisms/wizard/index.d.ts.map +1 -0
  453. package/dist/ui/organisms/wizard/index.js +4 -0
  454. package/dist/ui/organisms/wizard/index.js.map +1 -0
  455. package/dist/ui/organisms/wizard/wizard.d.ts +21 -0
  456. package/dist/ui/organisms/wizard/wizard.d.ts.map +1 -0
  457. package/dist/ui/organisms/wizard/wizard.js +260 -0
  458. package/dist/ui/organisms/wizard/wizard.js.map +1 -0
  459. package/dist/ui/organisms/wizard/wizard.types.d.ts +83 -0
  460. package/dist/ui/organisms/wizard/wizard.types.d.ts.map +1 -0
  461. package/dist/ui/organisms/wizard/wizard.types.js +3 -0
  462. package/dist/ui/organisms/wizard/wizard.types.js.map +1 -0
  463. package/dist/ui/utils/cn.d.ts +4 -0
  464. package/dist/ui/utils/cn.d.ts.map +1 -0
  465. package/dist/ui/utils/cn.js +5 -0
  466. package/dist/ui/utils/cn.js.map +1 -0
  467. package/dist/ui/utils/use-hotkey.d.ts +31 -0
  468. package/dist/ui/utils/use-hotkey.d.ts.map +1 -0
  469. package/dist/ui/utils/use-hotkey.js +69 -0
  470. package/dist/ui/utils/use-hotkey.js.map +1 -0
  471. package/package.json +118 -0
@@ -0,0 +1,529 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { emptySelection, EntifixLogicError, extractMetaEntity, isSelected, selectionSize, toggleSelected } from '@entifix/core';
4
+ import { Fragment, useRef, useState } from 'react';
5
+ import { useErrorMessage, useT, useTranslateKey } from '../../../i18n/index.js';
6
+ import { OVERFLOW_GLYPH, useCasesForSurface } from '../../actions/index.js';
7
+ import { Button } from '../../atoms/button/index.js';
8
+ import { CellValue } from '../../atoms/cell-value/index.js';
9
+ import { Checkbox } from '../../atoms/field/index.js';
10
+ import { Skeleton } from '../../atoms/skeleton/index.js';
11
+ import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableMessageRow, TableRow } from '../../atoms/table/index.js';
12
+ import { Link } from '../../atoms/text/index.js';
13
+ import { BulkActionBar } from '../../molecules/bulk-action-bar/index.js';
14
+ import { BulkResult } from '../../molecules/bulk-result/index.js';
15
+ import { ColumnSettings } from '../../molecules/column-settings/index.js';
16
+ import { ConfirmDialog } from '../../molecules/confirm-dialog/index.js';
17
+ import { EntityRecordCard } from '../../molecules/entity-record-card/index.js';
18
+ import { FilterBuilder } from '../../molecules/filter-builder/index.js';
19
+ import { LoadingBoundary } from '../../molecules/loading-boundary/index.js';
20
+ import { Menu } from '../../molecules/menu/index.js';
21
+ import { Pagination } from '../../molecules/pagination/index.js';
22
+ import { SortBuilder } from '../../molecules/sort-builder/index.js';
23
+ import { TableToolbar } from '../../molecules/table-toolbar/index.js';
24
+ import { readEntityTableSlots } from './entity-table-slots.js';
25
+ import { useEntityTableColumns } from './use-entity-table-columns.js';
26
+ /**
27
+ * The grid and the card list are both rendered, and CSS picks one. A JS
28
+ * breakpoint hook would have to guess during SSR and correct after mount —
29
+ * a hydration mismatch on every page load. Classes are written out in full
30
+ * because Tailwind cannot see a class name that is concatenated at runtime.
31
+ */ const PIVOT_CLASS = {
32
+ sm: {
33
+ grid: 'hidden sm:block',
34
+ cards: 'sm:hidden'
35
+ },
36
+ md: {
37
+ grid: 'hidden md:block',
38
+ cards: 'md:hidden'
39
+ },
40
+ lg: {
41
+ grid: 'hidden lg:block',
42
+ cards: 'lg:hidden'
43
+ }
44
+ };
45
+ /**
46
+ * How many placeholder rows the built-in skeleton draws.
47
+ *
48
+ * The column count is taken from the real geometry, because that is the axis a
49
+ * mismatch shifts; the row count is capped instead of tracking `pageSize`, since
50
+ * a fifty-row page would otherwise paint fifty shimmer rows to stand in for
51
+ * content that arrives below the fold anyway.
52
+ */ const SKELETON_ROW_CAP = 5;
53
+ export function EntityTable({ entityConstructor, isLoading, skeleton = true, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, onSelect, preferencesKey, showControls = true, pivotBreakpoint = 'md', filtering, sorting, onFilteringChange, onSortingChange, selection, onSelectionChange, metadata, isMetadataLoading = false, onBulkUseCase, onUseCase, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning = false, children }) {
54
+ var _ref;
55
+ const t = useT();
56
+ // A descriptor's label is a runtime catalog key — the typed gate cannot see
57
+ // it, which is why `@r10c/i18n-check` is what catches a typo.
58
+ const translateKey = useTranslateKey();
59
+ const errorMessage = useErrorMessage();
60
+ const metaEntity = extractMetaEntity(entityConstructor);
61
+ const slots = readEntityTableSlots(children);
62
+ const [panel, setPanel] = useState('none');
63
+ /**
64
+ * A verb waiting to be confirmed, and what it will act on.
65
+ *
66
+ * ⚠️ **The table had no confirmation flow at all** until #216 moved a
67
+ * destructive verb onto it. It read `confirm.tone` — only to pick a tone for
68
+ * a button or a menu item — and then fired on the first click. `unpublish` is
69
+ * declared `destructive`, so a verb reachable from a row menu without this
70
+ * would have been a one-click unpublish with a red label explaining what had
71
+ * already happened.
72
+ *
73
+ * The state holds the confirmation itself rather than the descriptor, so the
74
+ * dialog cannot open for a verb that never asked for one — the same shape
75
+ * `EntityForm` uses, and for the same reason.
76
+ *
77
+ * It carries the **target** too, which the form's does not need: a form has
78
+ * one record and a table has a row or a selection, and those run through two
79
+ * different handlers with two different payloads.
80
+ */ const [pending, setPending] = useState(undefined);
81
+ const { columns, visibleColumns, hidden, setPersonalization } = useEntityTableColumns(entityConstructor, slots.columns, items[0], `entity-table:${(_ref = preferencesKey != null ? preferencesKey : metaEntity.key) != null ? _ref : metaEntity.name}`);
82
+ const pivot = PIVOT_CLASS[pivotBreakpoint];
83
+ // A picker's table is choosing *one* value; a multi-selection there would
84
+ // offer a set to a form member that holds a single reference, and the two
85
+ // controls would fight over the same row. This is a wiring mistake rather
86
+ // than a state, so it costs the render — the same call `EntityForm` makes
87
+ // for a link source aimed at a member no picker can edit.
88
+ if (onSelect !== undefined && selection !== undefined) {
89
+ throw new EntifixLogicError('EntityTable was given both `onSelect` and `selection`. A picker picks one ' + 'row and a selection accumulates many, so the row control cannot be both. ' + 'Drop `selection` inside a picker, or drop `onSelect` outside one.');
90
+ }
91
+ /**
92
+ * The selection, or `undefined` when the table is not selectable at all.
93
+ *
94
+ * One value rather than a `selection` prop beside a `selectable` boolean:
95
+ * two of them means every render site has to re-test both, and the second
96
+ * test is unreachable — which reads as a defensive check and is really dead
97
+ * code the coverage gate then cannot close.
98
+ */ const selectionState = selection !== undefined && onSelectionChange !== undefined ? selection : undefined;
99
+ const selectable = selectionState !== undefined;
100
+ const rowUseCases = useCasesForSurface('row-menu', metadata == null ? void 0 : metadata.useCases);
101
+ const bulkUseCases = useCasesForSurface('bulk-bar', metadata == null ? void 0 : metadata.useCases);
102
+ const toolbarUseCases = useCasesForSurface('table-toolbar', metadata == null ? void 0 : metadata.useCases);
103
+ const hasRowMenu = rowUseCases.length > 0 && onUseCase !== undefined;
104
+ /**
105
+ * What a `context-independent` collection verb acts on: everything the
106
+ * current filter matches.
107
+ *
108
+ * Not an empty `ids` selection, which would say "no rows" — the verb is
109
+ * available *without* a selection precisely because its subject is the
110
+ * collection, so the honest payload is the same filter the listing is
111
+ * showing, and the same one a "select all matching" escalation would send.
112
+ */ const everythingMatching = {
113
+ mode: 'matching',
114
+ filtering,
115
+ total: totalItems,
116
+ excluded: new Set()
117
+ };
118
+ const hasRowAction = onSelect !== undefined || hrefFor !== undefined || hasRowMenu;
119
+ const columnCount = visibleColumns.length + (hasRowAction ? 1 : 0) + (selectable ? 1 : 0);
120
+ /**
121
+ * The first load has nothing to show and is held with a skeleton; a refetch
122
+ * already has rows, so it keeps them and only marks the region busy. Splitting
123
+ * the two is what stops every pagination click flashing grey.
124
+ */ const isFirstLoad = isLoading && items.length === 0;
125
+ const isRefetching = isLoading && items.length > 0;
126
+ /** `true`/omitted → the built-in default; a node → that node; `false` → none. */ const customSkeleton = typeof skeleton === 'boolean' ? undefined : skeleton;
127
+ const showSkeleton = isFirstLoad && skeleton !== false;
128
+ const skeletonRows = Array.from({
129
+ length: Math.min(pageSize, SKELETON_ROW_CAP)
130
+ }, (_, index)=>index);
131
+ /**
132
+ * The refetch hint, and it is deliberately the only one: rows stay readable
133
+ * and simply dim, because a second skeleton over live data would be two
134
+ * loading signals in one region.
135
+ */ const busyClass = isRefetching ? 'opacity-60 transition-opacity duration-200 ease-smooth' : '';
136
+ const renderCell = (column, item)=>column.render ? column.render(item) : /*#__PURE__*/ _jsx(CellValue, {
137
+ value: item[column.name],
138
+ descriptor: column
139
+ });
140
+ /**
141
+ * The row a shift-click ranges *from* — the last box the user actually
142
+ * toggled. Held in a ref rather than state because it changes nothing on
143
+ * screen, and re-rendering the whole table on every click to remember an
144
+ * anchor is a cost with no visible return.
145
+ */ const anchorIndex = useRef(undefined);
146
+ const setSelection = (next)=>onSelectionChange == null ? void 0 : onSelectionChange(next);
147
+ const toggleRow = (index, checked, shiftKey, current)=>{
148
+ var _anchorIndex_current;
149
+ // A shift-click extends the last toggle across the rows *on this page*, in
150
+ // the direction the user dragged, and applies the new state to all of them.
151
+ const from = shiftKey ? (_anchorIndex_current = anchorIndex.current) != null ? _anchorIndex_current : index : index;
152
+ const [start, end] = from <= index ? [
153
+ from,
154
+ index
155
+ ] : [
156
+ index,
157
+ from
158
+ ];
159
+ let next = current;
160
+ for (const row of items.slice(start, end + 1)){
161
+ next = toggleSelected(next, row.id, checked);
162
+ }
163
+ anchorIndex.current = index;
164
+ setSelection(next);
165
+ };
166
+ /**
167
+ * The header box, and it has three states rather than two: none of this
168
+ * page's rows selected, all of them, or some. Without the third the box
169
+ * reads as "nothing is selected" while a bulk bar sits below it saying
170
+ * otherwise.
171
+ */ const pageIds = items.map((item)=>item.id);
172
+ const selectedOnPage = selectionState ? pageIds.filter((id)=>isSelected(selectionState, id)).length : 0;
173
+ const allOnPageSelected = pageIds.length > 0 && selectedOnPage === pageIds.length;
174
+ const someOnPageSelected = selectedOnPage > 0 && !allOnPageSelected;
175
+ const toggleAllOnPage = (checked, current)=>{
176
+ let next = current;
177
+ for (const id of pageIds)next = toggleSelected(next, id, checked);
178
+ anchorIndex.current = undefined;
179
+ setSelection(next);
180
+ };
181
+ /**
182
+ * How a row names itself to a screen reader.
183
+ *
184
+ * The first visible column's value, because that is what the user reads the
185
+ * row *as* — "Seleccionar Acme" rather than "Seleccionar fila 3", which tells
186
+ * them the position they can already see and not the thing they cannot.
187
+ */ const rowLabel = (item)=>{
188
+ // The first non-identifier column **that this row actually filled in**.
189
+ //
190
+ // An id names a row the way "row 3" does: it repeats what the user can
191
+ // already see. But skipping only the id is not enough — measured against
192
+ // the seeded catalog, where `code` is the first non-id column and is empty
193
+ // on every brand, so the label fell straight through to the id and never
194
+ // reached `name`. A column that is blank on this row names it no better
195
+ // than its position does, so the search continues past it.
196
+ //
197
+ // The id remains the last resort, because a row with nothing rendered
198
+ // still has to announce itself.
199
+ const named = visibleColumns.find((column)=>{
200
+ if (column.type === 'id') return false;
201
+ const value = item[column.name];
202
+ return value != null && String(value) !== '';
203
+ });
204
+ return named ? String(item[named.name]) : String(item.id);
205
+ };
206
+ const selectionCell = (item, index, // Passed in rather than closed over: this is only ever called under
207
+ // `selectable`, which already proves the selection exists, and reading the
208
+ // optional prop here would add a fallback arm that nothing can reach.
209
+ current)=>/*#__PURE__*/ _jsx(Checkbox, {
210
+ // Deliberately no `id`: both pivots are always in the DOM, so an id here
211
+ // would be emitted twice per row. `aria-label` names the control instead,
212
+ // and it names the *record* rather than the position.
213
+ "aria-label": t('table.selectRow', {
214
+ record: rowLabel(item)
215
+ }),
216
+ checked: isSelected(current, item.id),
217
+ disabled: isBulkRunning,
218
+ onChange: (event)=>toggleRow(index, event.currentTarget.checked, event.nativeEvent.shiftKey === true, current)
219
+ });
220
+ const runTarget = (key, target)=>{
221
+ if (target.kind === 'row') onUseCase == null ? void 0 : onUseCase(key, target.item);
222
+ else onBulkUseCase == null ? void 0 : onBulkUseCase(key, target.selection);
223
+ };
224
+ const invoke = (useCase, target)=>{
225
+ const confirm = useCase.confirm;
226
+ if (confirm) {
227
+ setPending({
228
+ key: useCase.key,
229
+ labelKey: useCase.labelKey,
230
+ confirm,
231
+ target
232
+ });
233
+ return;
234
+ }
235
+ runTarget(useCase.key, target);
236
+ };
237
+ const rowMenu = (item)=>hasRowMenu ? /*#__PURE__*/ _jsxs(Menu, {
238
+ children: [
239
+ /*#__PURE__*/ _jsx(Menu.Trigger, {
240
+ "aria-label": t('table.actions'),
241
+ children: OVERFLOW_GLYPH
242
+ }),
243
+ /*#__PURE__*/ _jsx(Menu.Items, {
244
+ children: rowUseCases.map((useCase)=>{
245
+ var _useCase_confirm;
246
+ return /*#__PURE__*/ _jsx(Menu.Item, {
247
+ tone: ((_useCase_confirm = useCase.confirm) == null ? void 0 : _useCase_confirm.tone) === 'destructive' ? 'destructive' : 'neutral',
248
+ onClick: ()=>invoke(useCase, {
249
+ kind: 'row',
250
+ item
251
+ }),
252
+ children: translateKey(useCase.labelKey)
253
+ }, useCase.key);
254
+ })
255
+ })
256
+ ]
257
+ }) : undefined;
258
+ /**
259
+ * Selection wins over navigation: a picker's row must set the value, not send
260
+ * the user away from the form they came from.
261
+ *
262
+ * The row menu sits *beside* whichever of the two applies rather than
263
+ * replacing it — "open this record" and "run a verb on it" are both true at
264
+ * once, and folding the first into the menu would bury the action every row
265
+ * of a list exists for.
266
+ */ const recordAction = (item)=>{
267
+ const primary = onSelect ? /*#__PURE__*/ _jsx(Button, {
268
+ type: "button",
269
+ variant: "secondary",
270
+ size: "sm",
271
+ onClick: ()=>onSelect(item),
272
+ children: t('table.select')
273
+ }) : hrefFor ? /*#__PURE__*/ _jsx(Link, {
274
+ href: hrefFor(item.id),
275
+ children: t('table.open')
276
+ }) : undefined;
277
+ const menu = rowMenu(item);
278
+ if (!menu) return primary;
279
+ return /*#__PURE__*/ _jsxs("span", {
280
+ className: "flex items-center gap-2xs",
281
+ children: [
282
+ primary,
283
+ menu
284
+ ]
285
+ });
286
+ };
287
+ /**
288
+ * "No records" is a statement about the data; after a failed load it would be
289
+ * a lie about it. The distinction matters most to the user who is deciding
290
+ * whether their catalog is empty or their backend is down.
291
+ */ const emptyMessage = error ? t('table.error') : t('table.empty');
292
+ return /*#__PURE__*/ _jsxs("div", {
293
+ className: "flex flex-col gap-s",
294
+ children: [
295
+ /*#__PURE__*/ _jsx("span", {
296
+ role: "status",
297
+ "aria-live": "polite",
298
+ className: "sr-only",
299
+ children: isFirstLoad ? t('table.loading') : ''
300
+ }),
301
+ showControls && /*#__PURE__*/ _jsx(TableToolbar, {
302
+ start: /*#__PURE__*/ _jsxs(_Fragment, {
303
+ children: [
304
+ newHref && /*#__PURE__*/ _jsx(Link, {
305
+ href: newHref,
306
+ children: t('table.new')
307
+ }),
308
+ /*#__PURE__*/ _jsx(LoadingBoundary, {
309
+ isLoading: isMetadataLoading,
310
+ lines: 0,
311
+ children: /*#__PURE__*/ _jsx(_Fragment, {
312
+ children: toolbarUseCases.map((useCase)=>{
313
+ var _useCase_confirm;
314
+ return /*#__PURE__*/ _jsx(Button, {
315
+ type: "button",
316
+ variant: ((_useCase_confirm = useCase.confirm) == null ? void 0 : _useCase_confirm.tone) === 'destructive' ? 'destructive' : 'secondary',
317
+ size: "sm",
318
+ disabled: isBulkRunning,
319
+ onClick: ()=>onBulkUseCase == null ? void 0 : onBulkUseCase(useCase.key, everythingMatching),
320
+ children: translateKey(useCase.labelKey)
321
+ }, useCase.key);
322
+ })
323
+ })
324
+ }),
325
+ slots.toolbar
326
+ ]
327
+ }),
328
+ end: /*#__PURE__*/ _jsxs(_Fragment, {
329
+ children: [
330
+ /*#__PURE__*/ _jsx(Button, {
331
+ type: "button",
332
+ variant: panel === 'filters' ? 'primary' : 'secondary',
333
+ size: "sm",
334
+ onClick: ()=>setPanel((current)=>current === 'filters' ? 'none' : 'filters'),
335
+ children: t('table.filters')
336
+ }),
337
+ /*#__PURE__*/ _jsx(Button, {
338
+ type: "button",
339
+ variant: panel === 'sorting' ? 'primary' : 'secondary',
340
+ size: "sm",
341
+ onClick: ()=>setPanel((current)=>current === 'sorting' ? 'none' : 'sorting'),
342
+ children: t('table.sorting')
343
+ }),
344
+ /*#__PURE__*/ _jsx(ColumnSettings, {
345
+ columns: columns,
346
+ hidden: hidden,
347
+ onChange: setPersonalization
348
+ })
349
+ ]
350
+ }),
351
+ panel: panel === 'filters' ? /*#__PURE__*/ _jsx(FilterBuilder, {
352
+ descriptors: columns.filter((column)=>column.filterable),
353
+ value: filtering,
354
+ onChange: (applied)=>onFilteringChange == null ? void 0 : onFilteringChange(applied)
355
+ }) : panel === 'sorting' ? /*#__PURE__*/ _jsx(SortBuilder, {
356
+ descriptors: columns.filter((column)=>column.sortable),
357
+ value: sorting,
358
+ onChange: (applied)=>onSortingChange == null ? void 0 : onSortingChange(applied)
359
+ }) : undefined
360
+ }),
361
+ selectionState && selectionSize(selectionState) > 0 && /*#__PURE__*/ _jsx(BulkActionBar, {
362
+ count: selectionSize(selectionState),
363
+ useCases: bulkUseCases,
364
+ busy: isBulkRunning,
365
+ // Offered only when this page is fully ticked and the store holds
366
+ // more than the page — the escalation has somewhere to escalate to.
367
+ matchingTotal: selectionState.mode === 'ids' && allOnPageSelected && totalItems > items.length ? totalItems : undefined,
368
+ onSelectAllMatching: ()=>setSelection(everythingMatching),
369
+ onClear: ()=>setSelection(emptySelection()),
370
+ onUseCase: (useCase)=>invoke(useCase, {
371
+ kind: 'selection',
372
+ selection: selectionState
373
+ })
374
+ }),
375
+ pending && /*#__PURE__*/ _jsx(ConfirmDialog, {
376
+ open: true,
377
+ tone: pending.confirm.tone,
378
+ title: translateKey(pending.labelKey),
379
+ message: translateKey(pending.confirm.messageKey),
380
+ busy: isBulkRunning,
381
+ onCancel: ()=>setPending(undefined),
382
+ onConfirm: ()=>{
383
+ const { key, target } = pending;
384
+ setPending(undefined);
385
+ runTarget(key, target);
386
+ }
387
+ }),
388
+ bulkOutcomes && bulkOutcomes.length > 0 && onBulkDismiss && /*#__PURE__*/ _jsx(BulkResult, {
389
+ outcomes: bulkOutcomes,
390
+ busy: isBulkRunning,
391
+ labelFor: (id)=>{
392
+ const row = items.find((item)=>item.id === id);
393
+ return row ? rowLabel(row) : undefined;
394
+ },
395
+ onRetryFailed: onBulkRetry,
396
+ onDismiss: onBulkDismiss
397
+ }),
398
+ error && /*#__PURE__*/ _jsx("p", {
399
+ role: "alert",
400
+ "data-testid": "entity-table-error",
401
+ className: "rounded-sm border border-danger bg-danger-subtle px-s py-2xs text-step-sm text-danger",
402
+ children: errorMessage(error)
403
+ }),
404
+ /*#__PURE__*/ _jsx("div", {
405
+ className: `${pivot.grid} ${busyClass}`,
406
+ children: /*#__PURE__*/ _jsxs(Table, {
407
+ children: [
408
+ /*#__PURE__*/ _jsx(TableHead, {
409
+ children: slots.header ? slots.header.render(visibleColumns) : /*#__PURE__*/ _jsxs("tr", {
410
+ children: [
411
+ selectable && /*#__PURE__*/ _jsx(TableHeaderCell, {
412
+ children: /*#__PURE__*/ _jsx(Checkbox, {
413
+ "aria-label": t('table.selectAllOnPage'),
414
+ checked: allOnPageSelected,
415
+ indeterminate: someOnPageSelected,
416
+ disabled: isBulkRunning || items.length === 0,
417
+ onChange: (event)=>toggleAllOnPage(event.currentTarget.checked, selectionState)
418
+ })
419
+ }),
420
+ visibleColumns.map((column)=>{
421
+ var _column_header;
422
+ return /*#__PURE__*/ _jsx(TableHeaderCell, {
423
+ children: (_column_header = column.header) != null ? _column_header : column.label
424
+ }, column.name);
425
+ }),
426
+ hasRowAction && /*#__PURE__*/ _jsx(TableHeaderCell, {
427
+ children: t('table.actions')
428
+ })
429
+ ]
430
+ })
431
+ }),
432
+ /*#__PURE__*/ _jsxs(TableBody, {
433
+ "aria-busy": isLoading || undefined,
434
+ children: [
435
+ showSkeleton && (customSkeleton ? /*#__PURE__*/ _jsx(TableMessageRow, {
436
+ colSpan: columnCount,
437
+ children: customSkeleton
438
+ }) : skeletonRows.map((row)=>/*#__PURE__*/ _jsxs(TableRow, {
439
+ children: [
440
+ selectable && /*#__PURE__*/ _jsx(TableCell, {
441
+ children: /*#__PURE__*/ _jsx(Skeleton, {
442
+ shape: "line",
443
+ className: "w-4"
444
+ })
445
+ }),
446
+ visibleColumns.map((column)=>/*#__PURE__*/ _jsx(TableCell, {
447
+ children: /*#__PURE__*/ _jsx(Skeleton, {
448
+ shape: "line",
449
+ className: "w-full"
450
+ })
451
+ }, column.name)),
452
+ hasRowAction && /*#__PURE__*/ _jsx(TableCell, {
453
+ children: /*#__PURE__*/ _jsx(Skeleton, {
454
+ shape: "line",
455
+ className: "w-16"
456
+ })
457
+ })
458
+ ]
459
+ }, row))),
460
+ !isLoading && items.length === 0 && /*#__PURE__*/ _jsx(TableMessageRow, {
461
+ colSpan: columnCount,
462
+ children: emptyMessage
463
+ }),
464
+ items.map((item, index)=>{
465
+ var _item_id, _item_id1;
466
+ return slots.row ? // A Fragment carries the key without wrapping the custom row in
467
+ // an element `<tbody>` would reject.
468
+ /*#__PURE__*/ _jsx(Fragment, {
469
+ children: slots.row.render(item, visibleColumns)
470
+ }, String((_item_id = item.id) != null ? _item_id : index)) : /*#__PURE__*/ _jsxs(TableRow, {
471
+ children: [
472
+ selectionState && /*#__PURE__*/ _jsx(TableCell, {
473
+ children: selectionCell(item, index, selectionState)
474
+ }),
475
+ visibleColumns.map((column)=>/*#__PURE__*/ _jsx(TableCell, {
476
+ children: renderCell(column, item)
477
+ }, column.name)),
478
+ hasRowAction && /*#__PURE__*/ _jsx(TableCell, {
479
+ children: recordAction(item)
480
+ })
481
+ ]
482
+ }, String((_item_id1 = item.id) != null ? _item_id1 : index));
483
+ })
484
+ ]
485
+ })
486
+ ]
487
+ })
488
+ }),
489
+ /*#__PURE__*/ _jsxs("div", {
490
+ className: `${pivot.cards} flex flex-col gap-2xs ${busyClass}`,
491
+ "aria-busy": isLoading || undefined,
492
+ children: [
493
+ showSkeleton && (customSkeleton != null ? customSkeleton : skeletonRows.map((row)=>/*#__PURE__*/ _jsx(EntityRecordCard, {
494
+ columns: visibleColumns,
495
+ renderCell: ()=>/*#__PURE__*/ _jsx(Skeleton, {
496
+ shape: "line",
497
+ className: "w-24"
498
+ })
499
+ }, row))),
500
+ !isLoading && items.length === 0 && /*#__PURE__*/ _jsx("p", {
501
+ className: "text-step-sm text-content-muted",
502
+ children: emptyMessage
503
+ }),
504
+ items.map((item, index)=>{
505
+ var _item_id;
506
+ return /*#__PURE__*/ _jsx(EntityRecordCard, {
507
+ columns: visibleColumns,
508
+ // The card is handed the resolved columns themselves, so the
509
+ // narrow layout goes through the exact same renderers as the grid.
510
+ renderCell: (column)=>renderCell(column, item),
511
+ leading: selectionState ? selectionCell(item, index, selectionState) : undefined,
512
+ actions: recordAction(item)
513
+ }, String((_item_id = item.id) != null ? _item_id : index));
514
+ })
515
+ ]
516
+ }),
517
+ /*#__PURE__*/ _jsx(Pagination, {
518
+ currentPage: currentPage,
519
+ pageSize: pageSize,
520
+ totalItems: totalItems,
521
+ onPageChange: onPageChange,
522
+ onPageSizeChange: onPageSizeChange
523
+ }),
524
+ slots.rest
525
+ ]
526
+ });
527
+ }
528
+
529
+ //# sourceMappingURL=entity-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"sourcesContent":["'use client';\n\nimport {\n emptySelection,\n EntifixLogicError,\n type Entity,\n type EntityId,\n type EntitySelection,\n type EntitySorting,\n extractMetaEntity,\n type FilterGroup,\n isSelected,\n selectionSize,\n toggleSelected,\n type UseCaseDescriptor,\n} from '@entifix/core';\nimport { Fragment, type ReactNode, useRef, useState } from 'react';\n\nimport { useErrorMessage, useT, useTranslateKey } from '../../../i18n/index.js';\nimport { OVERFLOW_GLYPH, useCasesForSurface } from '../../actions/index.js';\nimport { Button } from '../../atoms/button/index.js';\nimport { CellValue } from '../../atoms/cell-value/index.js';\nimport { Checkbox } from '../../atoms/field/index.js';\nimport { Skeleton } from '../../atoms/skeleton/index.js';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableMessageRow,\n TableRow,\n} from '../../atoms/table/index.js';\nimport { Link } from '../../atoms/text/index.js';\nimport { BulkActionBar } from '../../molecules/bulk-action-bar/index.js';\nimport { BulkResult } from '../../molecules/bulk-result/index.js';\nimport { ColumnSettings } from '../../molecules/column-settings/index.js';\nimport { ConfirmDialog } from '../../molecules/confirm-dialog/index.js';\nimport { EntityRecordCard } from '../../molecules/entity-record-card/index.js';\nimport { FilterBuilder } from '../../molecules/filter-builder/index.js';\nimport { LoadingBoundary } from '../../molecules/loading-boundary/index.js';\nimport { Menu } from '../../molecules/menu/index.js';\nimport { Pagination } from '../../molecules/pagination/index.js';\nimport { SortBuilder } from '../../molecules/sort-builder/index.js';\nimport { TableToolbar } from '../../molecules/table-toolbar/index.js';\nimport type {\n EntityTableColumn,\n EntityTablePivotBreakpoint,\n EntityTableProps,\n} from './entity-table.types.js';\nimport { readEntityTableSlots } from './entity-table-slots.js';\nimport { useEntityTableColumns } from './use-entity-table-columns.js';\n\n/**\n * The grid and the card list are both rendered, and CSS picks one. A JS\n * breakpoint hook would have to guess during SSR and correct after mount —\n * a hydration mismatch on every page load. Classes are written out in full\n * because Tailwind cannot see a class name that is concatenated at runtime.\n */\nconst PIVOT_CLASS: Record<\n EntityTablePivotBreakpoint,\n { grid: string; cards: string }\n> = {\n sm: { grid: 'hidden sm:block', cards: 'sm:hidden' },\n md: { grid: 'hidden md:block', cards: 'md:hidden' },\n lg: { grid: 'hidden lg:block', cards: 'lg:hidden' },\n};\n\ntype Panel = 'none' | 'filters' | 'sorting';\n\n/**\n * How many placeholder rows the built-in skeleton draws.\n *\n * The column count is taken from the real geometry, because that is the axis a\n * mismatch shifts; the row count is capped instead of tracking `pageSize`, since\n * a fifty-row page would otherwise paint fifty shimmer rows to stand in for\n * content that arrives below the fold anyway.\n */\nconst SKELETON_ROW_CAP = 5;\n\n/**\n * A table that builds itself from an entity's metadata: columns, labels, value\n * formatting and the filter/sort controls all come from `@accessor()`\n * declarations, so listing a new entity needs no bespoke table.\n *\n * Three things layer on top of that default:\n * - **personalization** — column order and visibility, persisted through the\n * UI-preferences port (so it survives reloads and can later move server-side);\n * - **responsiveness** — below `pivotBreakpoint` rows pivot into label/value\n * cards instead of scrolling sideways;\n * - **slots** — `<EntityColumn>` / `<EntityTableHeader>` / `<EntityTableRow>` /\n * `<EntityTableToolbar>` children override any part of the default rendering.\n */\n/**\n * What a pending verb will act on once it is confirmed.\n *\n * A form has one record; a table has a row or a selection, and those reach two\n * different handlers with two different payloads. Carrying the selection itself\n * rather than reading it back at confirm time also removes a branch that could\n * not happen: the bulk bar only renders inside a truthy selection.\n */\ntype PendingTarget<TEntity extends Entity> =\n | { kind: 'row'; item: TEntity }\n | { kind: 'selection'; selection: EntitySelection<TEntity> };\n\nexport function EntityTable<TEntity extends Entity>({\n entityConstructor,\n isLoading,\n skeleton = true,\n error,\n items,\n totalItems,\n currentPage,\n pageSize,\n onPageChange,\n onPageSizeChange,\n hrefFor,\n newHref,\n onSelect,\n preferencesKey,\n showControls = true,\n pivotBreakpoint = 'md',\n filtering,\n sorting,\n onFilteringChange,\n onSortingChange,\n selection,\n onSelectionChange,\n metadata,\n isMetadataLoading = false,\n onBulkUseCase,\n onUseCase,\n bulkOutcomes,\n onBulkDismiss,\n onBulkRetry,\n isBulkRunning = false,\n children,\n}: EntityTableProps<TEntity>) {\n const t = useT();\n // A descriptor's label is a runtime catalog key — the typed gate cannot see\n // it, which is why `@r10c/i18n-check` is what catches a typo.\n const translateKey = useTranslateKey();\n const errorMessage = useErrorMessage();\n const metaEntity = extractMetaEntity(entityConstructor);\n const slots = readEntityTableSlots<TEntity>(children);\n const [panel, setPanel] = useState<Panel>('none');\n\n /**\n * A verb waiting to be confirmed, and what it will act on.\n *\n * ⚠️ **The table had no confirmation flow at all** until #216 moved a\n * destructive verb onto it. It read `confirm.tone` — only to pick a tone for\n * a button or a menu item — and then fired on the first click. `unpublish` is\n * declared `destructive`, so a verb reachable from a row menu without this\n * would have been a one-click unpublish with a red label explaining what had\n * already happened.\n *\n * The state holds the confirmation itself rather than the descriptor, so the\n * dialog cannot open for a verb that never asked for one — the same shape\n * `EntityForm` uses, and for the same reason.\n *\n * It carries the **target** too, which the form's does not need: a form has\n * one record and a table has a row or a selection, and those run through two\n * different handlers with two different payloads.\n */\n const [pending, setPending] = useState<\n | {\n key: string;\n labelKey: string;\n confirm: NonNullable<UseCaseDescriptor['confirm']>;\n target: PendingTarget<TEntity>;\n }\n | undefined\n >(undefined);\n\n const { columns, visibleColumns, hidden, setPersonalization } =\n useEntityTableColumns<TEntity>(\n entityConstructor,\n slots.columns,\n items[0],\n `entity-table:${preferencesKey ?? metaEntity.key ?? metaEntity.name}`,\n );\n\n const pivot = PIVOT_CLASS[pivotBreakpoint];\n\n // A picker's table is choosing *one* value; a multi-selection there would\n // offer a set to a form member that holds a single reference, and the two\n // controls would fight over the same row. This is a wiring mistake rather\n // than a state, so it costs the render — the same call `EntityForm` makes\n // for a link source aimed at a member no picker can edit.\n if (onSelect !== undefined && selection !== undefined) {\n throw new EntifixLogicError(\n 'EntityTable was given both `onSelect` and `selection`. A picker picks one ' +\n 'row and a selection accumulates many, so the row control cannot be both. ' +\n 'Drop `selection` inside a picker, or drop `onSelect` outside one.',\n );\n }\n\n /**\n * The selection, or `undefined` when the table is not selectable at all.\n *\n * One value rather than a `selection` prop beside a `selectable` boolean:\n * two of them means every render site has to re-test both, and the second\n * test is unreachable — which reads as a defensive check and is really dead\n * code the coverage gate then cannot close.\n */\n const selectionState =\n selection !== undefined && onSelectionChange !== undefined\n ? selection\n : undefined;\n const selectable = selectionState !== undefined;\n const rowUseCases = useCasesForSurface('row-menu', metadata?.useCases);\n const bulkUseCases = useCasesForSurface('bulk-bar', metadata?.useCases);\n const toolbarUseCases = useCasesForSurface(\n 'table-toolbar',\n metadata?.useCases,\n );\n const hasRowMenu = rowUseCases.length > 0 && onUseCase !== undefined;\n\n /**\n * What a `context-independent` collection verb acts on: everything the\n * current filter matches.\n *\n * Not an empty `ids` selection, which would say \"no rows\" — the verb is\n * available *without* a selection precisely because its subject is the\n * collection, so the honest payload is the same filter the listing is\n * showing, and the same one a \"select all matching\" escalation would send.\n */\n const everythingMatching: EntitySelection<TEntity> = {\n mode: 'matching',\n filtering,\n total: totalItems,\n excluded: new Set<EntityId>(),\n };\n\n const hasRowAction =\n onSelect !== undefined || hrefFor !== undefined || hasRowMenu;\n const columnCount =\n visibleColumns.length + (hasRowAction ? 1 : 0) + (selectable ? 1 : 0);\n\n /**\n * The first load has nothing to show and is held with a skeleton; a refetch\n * already has rows, so it keeps them and only marks the region busy. Splitting\n * the two is what stops every pagination click flashing grey.\n */\n const isFirstLoad = isLoading && items.length === 0;\n const isRefetching = isLoading && items.length > 0;\n\n /** `true`/omitted → the built-in default; a node → that node; `false` → none. */\n const customSkeleton = typeof skeleton === 'boolean' ? undefined : skeleton;\n const showSkeleton = isFirstLoad && skeleton !== false;\n const skeletonRows = Array.from(\n { length: Math.min(pageSize, SKELETON_ROW_CAP) },\n (_, index) => index,\n );\n\n /**\n * The refetch hint, and it is deliberately the only one: rows stay readable\n * and simply dim, because a second skeleton over live data would be two\n * loading signals in one region.\n */\n const busyClass = isRefetching\n ? 'opacity-60 transition-opacity duration-200 ease-smooth'\n : '';\n\n const renderCell = (\n column: EntityTableColumn<TEntity>,\n item: TEntity,\n ): ReactNode =>\n column.render ? (\n column.render(item)\n ) : (\n <CellValue\n value={(item as Record<string, unknown>)[column.name]}\n descriptor={column}\n />\n );\n\n /**\n * The row a shift-click ranges *from* — the last box the user actually\n * toggled. Held in a ref rather than state because it changes nothing on\n * screen, and re-rendering the whole table on every click to remember an\n * anchor is a cost with no visible return.\n */\n const anchorIndex = useRef<number | undefined>(undefined);\n\n const setSelection = (next: EntitySelection<TEntity>) =>\n onSelectionChange?.(next);\n\n const toggleRow = (\n index: number,\n checked: boolean,\n shiftKey: boolean,\n current: EntitySelection<TEntity>,\n ) => {\n // A shift-click extends the last toggle across the rows *on this page*, in\n // the direction the user dragged, and applies the new state to all of them.\n const from = shiftKey ? (anchorIndex.current ?? index) : index;\n const [start, end] = from <= index ? [from, index] : [index, from];\n\n let next = current;\n for (const row of items.slice(start, end + 1)) {\n next = toggleSelected(next, row.id, checked);\n }\n\n anchorIndex.current = index;\n setSelection(next);\n };\n\n /**\n * The header box, and it has three states rather than two: none of this\n * page's rows selected, all of them, or some. Without the third the box\n * reads as \"nothing is selected\" while a bulk bar sits below it saying\n * otherwise.\n */\n const pageIds = items.map(item => item.id);\n const selectedOnPage = selectionState\n ? pageIds.filter(id => isSelected(selectionState, id)).length\n : 0;\n const allOnPageSelected =\n pageIds.length > 0 && selectedOnPage === pageIds.length;\n const someOnPageSelected = selectedOnPage > 0 && !allOnPageSelected;\n\n const toggleAllOnPage = (\n checked: boolean,\n current: EntitySelection<TEntity>,\n ) => {\n let next = current;\n for (const id of pageIds) next = toggleSelected(next, id, checked);\n anchorIndex.current = undefined;\n setSelection(next);\n };\n\n /**\n * How a row names itself to a screen reader.\n *\n * The first visible column's value, because that is what the user reads the\n * row *as* — \"Seleccionar Acme\" rather than \"Seleccionar fila 3\", which tells\n * them the position they can already see and not the thing they cannot.\n */\n const rowLabel = (item: TEntity): string => {\n // The first non-identifier column **that this row actually filled in**.\n //\n // An id names a row the way \"row 3\" does: it repeats what the user can\n // already see. But skipping only the id is not enough — measured against\n // the seeded catalog, where `code` is the first non-id column and is empty\n // on every brand, so the label fell straight through to the id and never\n // reached `name`. A column that is blank on this row names it no better\n // than its position does, so the search continues past it.\n //\n // The id remains the last resort, because a row with nothing rendered\n // still has to announce itself.\n const named = visibleColumns.find(column => {\n if (column.type === 'id') return false;\n const value = (item as Record<string, unknown>)[column.name];\n return value != null && String(value) !== '';\n });\n\n return named\n ? String((item as Record<string, unknown>)[named.name])\n : String(item.id);\n };\n\n const selectionCell = (\n item: TEntity,\n index: number,\n // Passed in rather than closed over: this is only ever called under\n // `selectable`, which already proves the selection exists, and reading the\n // optional prop here would add a fallback arm that nothing can reach.\n current: EntitySelection<TEntity>,\n ) => (\n <Checkbox\n // Deliberately no `id`: both pivots are always in the DOM, so an id here\n // would be emitted twice per row. `aria-label` names the control instead,\n // and it names the *record* rather than the position.\n aria-label={t('table.selectRow', { record: rowLabel(item) })}\n checked={isSelected(current, item.id)}\n disabled={isBulkRunning}\n onChange={event =>\n toggleRow(\n index,\n event.currentTarget.checked,\n (event.nativeEvent as MouseEvent).shiftKey === true,\n current,\n )\n }\n />\n );\n\n const runTarget = (key: string, target: PendingTarget<TEntity>) => {\n if (target.kind === 'row') onUseCase?.(key, target.item);\n else onBulkUseCase?.(key, target.selection);\n };\n\n const invoke = (\n useCase: UseCaseDescriptor,\n target: PendingTarget<TEntity>,\n ) => {\n const confirm = useCase.confirm;\n if (confirm) {\n setPending({\n key: useCase.key,\n labelKey: useCase.labelKey,\n confirm,\n target,\n });\n return;\n }\n runTarget(useCase.key, target);\n };\n\n const rowMenu = (item: TEntity) =>\n hasRowMenu ? (\n <Menu>\n <Menu.Trigger aria-label={t('table.actions')}>\n {OVERFLOW_GLYPH}\n </Menu.Trigger>\n <Menu.Items>\n {rowUseCases.map(useCase => (\n <Menu.Item\n key={useCase.key}\n tone={\n useCase.confirm?.tone === 'destructive'\n ? 'destructive'\n : 'neutral'\n }\n onClick={() => invoke(useCase, { kind: 'row', item })}\n >\n {translateKey(useCase.labelKey)}\n </Menu.Item>\n ))}\n </Menu.Items>\n </Menu>\n ) : undefined;\n\n /**\n * Selection wins over navigation: a picker's row must set the value, not send\n * the user away from the form they came from.\n *\n * The row menu sits *beside* whichever of the two applies rather than\n * replacing it — \"open this record\" and \"run a verb on it\" are both true at\n * once, and folding the first into the menu would bury the action every row\n * of a list exists for.\n */\n const recordAction = (item: TEntity) => {\n const primary = onSelect ? (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => onSelect(item)}\n >\n {t('table.select')}\n </Button>\n ) : hrefFor ? (\n <Link href={hrefFor(item.id)}>{t('table.open')}</Link>\n ) : undefined;\n\n const menu = rowMenu(item);\n if (!menu) return primary;\n\n return (\n <span className=\"flex items-center gap-2xs\">\n {primary}\n {menu}\n </span>\n );\n };\n\n /**\n * \"No records\" is a statement about the data; after a failed load it would be\n * a lie about it. The distinction matters most to the user who is deciding\n * whether their catalog is empty or their backend is down.\n */\n const emptyMessage = error ? t('table.error') : t('table.empty');\n\n return (\n <div className=\"flex flex-col gap-s\">\n {/*\n One announcement for the whole table, not one per layout. Both the grid\n and the card list are always in the DOM — CSS picks which is visible —\n so a live region inside each meant assistive tech was told twice that\n the table was loading. The shimmer itself is aria-hidden, so this is the\n only thing that carries the news.\n */}\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {isFirstLoad ? t('table.loading') : ''}\n </span>\n\n {showControls && (\n <TableToolbar\n start={\n <>\n {newHref && <Link href={newHref}>{t('table.new')}</Link>}\n {/* Collection-bound verbs that need no selection. They sit with\n `New` rather than in the bulk bar, because the bulk bar only\n exists while rows are ticked and these are always available. */}\n <LoadingBoundary isLoading={isMetadataLoading} lines={0}>\n <>\n {toolbarUseCases.map(useCase => (\n <Button\n key={useCase.key}\n type=\"button\"\n variant={\n useCase.confirm?.tone === 'destructive'\n ? 'destructive'\n : 'secondary'\n }\n size=\"sm\"\n disabled={isBulkRunning}\n onClick={() =>\n onBulkUseCase?.(useCase.key, everythingMatching)\n }\n >\n {translateKey(useCase.labelKey)}\n </Button>\n ))}\n </>\n </LoadingBoundary>\n {slots.toolbar}\n </>\n }\n end={\n <>\n <Button\n type=\"button\"\n variant={panel === 'filters' ? 'primary' : 'secondary'}\n size=\"sm\"\n onClick={() =>\n setPanel(current =>\n current === 'filters' ? 'none' : 'filters',\n )\n }\n >\n {t('table.filters')}\n </Button>\n <Button\n type=\"button\"\n variant={panel === 'sorting' ? 'primary' : 'secondary'}\n size=\"sm\"\n onClick={() =>\n setPanel(current =>\n current === 'sorting' ? 'none' : 'sorting',\n )\n }\n >\n {t('table.sorting')}\n </Button>\n <ColumnSettings\n columns={columns}\n hidden={hidden}\n onChange={setPersonalization}\n />\n </>\n }\n panel={\n panel === 'filters' ? (\n <FilterBuilder<TEntity>\n descriptors={columns.filter(column => column.filterable)}\n value={filtering}\n onChange={(applied: FilterGroup<TEntity>) =>\n onFilteringChange?.(applied)\n }\n />\n ) : panel === 'sorting' ? (\n <SortBuilder<TEntity>\n descriptors={columns.filter(column => column.sortable)}\n value={sorting}\n onChange={(applied: EntitySorting<TEntity>) =>\n onSortingChange?.(applied)\n }\n />\n ) : undefined\n }\n />\n )}\n\n {/*\n The bar appears when there is something selected and something to do\n with it. It sits above the rows rather than floating over them: a fixed\n overlay covers the last row of a short page, which is the row the user\n most likely just ticked.\n */}\n {selectionState && selectionSize(selectionState) > 0 && (\n <BulkActionBar\n count={selectionSize(selectionState)}\n useCases={bulkUseCases}\n busy={isBulkRunning}\n // Offered only when this page is fully ticked and the store holds\n // more than the page — the escalation has somewhere to escalate to.\n matchingTotal={\n selectionState.mode === 'ids' &&\n allOnPageSelected &&\n totalItems > items.length\n ? totalItems\n : undefined\n }\n onSelectAllMatching={() => setSelection(everythingMatching)}\n onClear={() => setSelection(emptySelection<TEntity>())}\n onUseCase={useCase =>\n invoke(useCase, { kind: 'selection', selection: selectionState })\n }\n />\n )}\n\n {pending && (\n <ConfirmDialog\n open\n tone={pending.confirm.tone}\n title={translateKey(pending.labelKey)}\n message={translateKey(pending.confirm.messageKey)}\n busy={isBulkRunning}\n onCancel={() => setPending(undefined)}\n onConfirm={() => {\n const { key, target } = pending;\n setPending(undefined);\n runTarget(key, target);\n }}\n />\n )}\n\n {bulkOutcomes && bulkOutcomes.length > 0 && onBulkDismiss && (\n <BulkResult\n outcomes={bulkOutcomes}\n busy={isBulkRunning}\n labelFor={id => {\n const row = items.find(item => item.id === id);\n return row ? rowLabel(row) : undefined;\n }}\n onRetryFailed={onBulkRetry}\n onDismiss={onBulkDismiss}\n />\n )}\n\n {/*\n Rendered once, outside both layouts, and independently of whether there\n are rows: a refetch that fails leaves the previous page on screen, and\n without this the user would read stale data as current.\n */}\n {error && (\n <p\n role=\"alert\"\n data-testid=\"entity-table-error\"\n className=\"rounded-sm border border-danger bg-danger-subtle px-s py-2xs text-step-sm text-danger\"\n >\n {errorMessage(error)}\n </p>\n )}\n\n {/* Wide viewports: a grid. */}\n <div className={`${pivot.grid} ${busyClass}`}>\n <Table>\n <TableHead>\n {slots.header ? (\n slots.header.render(visibleColumns)\n ) : (\n <tr>\n {selectable && (\n <TableHeaderCell>\n <Checkbox\n aria-label={t('table.selectAllOnPage')}\n checked={allOnPageSelected}\n indeterminate={someOnPageSelected}\n disabled={isBulkRunning || items.length === 0}\n onChange={event =>\n toggleAllOnPage(\n event.currentTarget.checked,\n selectionState,\n )\n }\n />\n </TableHeaderCell>\n )}\n {visibleColumns.map(column => (\n <TableHeaderCell key={column.name}>\n {column.header ?? column.label}\n </TableHeaderCell>\n ))}\n {hasRowAction && (\n <TableHeaderCell>{t('table.actions')}</TableHeaderCell>\n )}\n </tr>\n )}\n </TableHead>\n <TableBody aria-busy={isLoading || undefined}>\n {/* Skeleton rows rather than the word \"Loading\", and one per column\n rather than a single full-width blob: the placeholder occupies\n the real grid, so the swap to rows shifts nothing sideways.\n `TableMessageRow` is deliberately bypassed — it is one centred\n full-span cell and cannot express the geometry. */}\n {showSkeleton &&\n (customSkeleton ? (\n <TableMessageRow colSpan={columnCount}>\n {customSkeleton}\n </TableMessageRow>\n ) : (\n skeletonRows.map(row => (\n <TableRow key={row}>\n {selectable && (\n <TableCell>\n <Skeleton shape=\"line\" className=\"w-4\" />\n </TableCell>\n )}\n {visibleColumns.map(column => (\n <TableCell key={column.name}>\n <Skeleton shape=\"line\" className=\"w-full\" />\n </TableCell>\n ))}\n {hasRowAction && (\n <TableCell>\n <Skeleton shape=\"line\" className=\"w-16\" />\n </TableCell>\n )}\n </TableRow>\n ))\n ))}\n {!isLoading && items.length === 0 && (\n <TableMessageRow colSpan={columnCount}>\n {emptyMessage}\n </TableMessageRow>\n )}\n {items.map((item, index) =>\n slots.row ? (\n // A Fragment carries the key without wrapping the custom row in\n // an element `<tbody>` would reject.\n <Fragment key={String(item.id ?? index)}>\n {slots.row.render(item, visibleColumns)}\n </Fragment>\n ) : (\n <TableRow key={String(item.id ?? index)}>\n {selectionState && (\n <TableCell>\n {selectionCell(item, index, selectionState)}\n </TableCell>\n )}\n {visibleColumns.map(column => (\n <TableCell key={column.name}>\n {renderCell(column, item)}\n </TableCell>\n ))}\n {hasRowAction && <TableCell>{recordAction(item)}</TableCell>}\n </TableRow>\n ),\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Narrow viewports: the same columns pivoted into cards. */}\n <div\n className={`${pivot.cards} flex flex-col gap-2xs ${busyClass}`}\n aria-busy={isLoading || undefined}\n >\n {/* The card pivot gets card-shaped placeholders, not a bare shimmer\n block: the border, radius and padding are the geometry here. */}\n {showSkeleton &&\n (customSkeleton ??\n skeletonRows.map(row => (\n <EntityRecordCard\n key={row}\n columns={visibleColumns}\n renderCell={() => <Skeleton shape=\"line\" className=\"w-24\" />}\n />\n )))}\n {!isLoading && items.length === 0 && (\n <p className=\"text-step-sm text-content-muted\">{emptyMessage}</p>\n )}\n {items.map((item, index) => (\n <EntityRecordCard\n key={String(item.id ?? index)}\n columns={visibleColumns}\n // The card is handed the resolved columns themselves, so the\n // narrow layout goes through the exact same renderers as the grid.\n renderCell={column =>\n renderCell(column as EntityTableColumn<TEntity>, item)\n }\n leading={\n selectionState\n ? selectionCell(item, index, selectionState)\n : undefined\n }\n actions={recordAction(item)}\n />\n ))}\n </div>\n\n <Pagination\n currentPage={currentPage}\n pageSize={pageSize}\n totalItems={totalItems}\n onPageChange={onPageChange}\n onPageSizeChange={onPageSizeChange}\n />\n\n {slots.rest}\n </div>\n );\n}\n"],"names":["emptySelection","EntifixLogicError","extractMetaEntity","isSelected","selectionSize","toggleSelected","Fragment","useRef","useState","useErrorMessage","useT","useTranslateKey","OVERFLOW_GLYPH","useCasesForSurface","Button","CellValue","Checkbox","Skeleton","Table","TableBody","TableCell","TableHead","TableHeaderCell","TableMessageRow","TableRow","Link","BulkActionBar","BulkResult","ColumnSettings","ConfirmDialog","EntityRecordCard","FilterBuilder","LoadingBoundary","Menu","Pagination","SortBuilder","TableToolbar","readEntityTableSlots","useEntityTableColumns","PIVOT_CLASS","sm","grid","cards","md","lg","SKELETON_ROW_CAP","EntityTable","entityConstructor","isLoading","skeleton","error","items","totalItems","currentPage","pageSize","onPageChange","onPageSizeChange","hrefFor","newHref","onSelect","preferencesKey","showControls","pivotBreakpoint","filtering","sorting","onFilteringChange","onSortingChange","selection","onSelectionChange","metadata","isMetadataLoading","onBulkUseCase","onUseCase","bulkOutcomes","onBulkDismiss","onBulkRetry","isBulkRunning","children","t","translateKey","errorMessage","metaEntity","slots","panel","setPanel","pending","setPending","undefined","columns","visibleColumns","hidden","setPersonalization","key","name","pivot","selectionState","selectable","rowUseCases","useCases","bulkUseCases","toolbarUseCases","hasRowMenu","length","everythingMatching","mode","total","excluded","Set","hasRowAction","columnCount","isFirstLoad","isRefetching","customSkeleton","showSkeleton","skeletonRows","Array","from","Math","min","_","index","busyClass","renderCell","column","item","render","value","descriptor","anchorIndex","setSelection","next","toggleRow","checked","shiftKey","current","start","end","row","slice","id","pageIds","map","selectedOnPage","filter","allOnPageSelected","someOnPageSelected","toggleAllOnPage","rowLabel","named","find","type","String","selectionCell","aria-label","record","disabled","onChange","event","currentTarget","nativeEvent","runTarget","target","kind","invoke","useCase","confirm","labelKey","rowMenu","Trigger","Items","Item","tone","onClick","recordAction","primary","variant","size","href","menu","span","className","emptyMessage","div","role","aria-live","lines","toolbar","descriptors","filterable","applied","sortable","count","busy","matchingTotal","onSelectAllMatching","onClear","open","title","message","messageKey","onCancel","onConfirm","outcomes","labelFor","onRetryFailed","onDismiss","p","data-testid","header","tr","indeterminate","label","aria-busy","col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