@kapiuara/ui 0.15.3 → 0.17.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 (288) hide show
  1. package/LICENSE +19 -15
  2. package/README.md +505 -13
  3. package/dist/components/chat/KapiChatThread.js +4 -4
  4. package/dist/components/chat/KapiComposer.js +8 -8
  5. package/dist/components/data/KapiDataTable.d.ts +1 -1
  6. package/dist/components/data/KapiDataTable.js +25 -25
  7. package/dist/components/data/KapiPaginationFooter.js +1 -1
  8. package/dist/components/data/KapiSheet.d.ts +105 -0
  9. package/dist/components/data/KapiSheet.js +75 -0
  10. package/dist/components/data/KapiSparkline.d.ts +2 -1
  11. package/dist/components/data/KapiSparkline.js +29 -26
  12. package/dist/components/data/KapiTable.d.ts +2 -2
  13. package/dist/components/data/KapiTable.js +347 -329
  14. package/dist/components/data/KapiTableFilter.js +6 -6
  15. package/dist/components/data/KapiTableFooter.d.ts +22 -0
  16. package/dist/components/data/KapiTableFooter.js +55 -0
  17. package/dist/components/data/KapiTableRow.js +53 -52
  18. package/dist/components/data/KapiTableToolbar.d.ts +4 -2
  19. package/dist/components/data/KapiTableToolbar.js +71 -69
  20. package/dist/components/data/index.d.ts +3 -1
  21. package/dist/components/data/tableCells.d.ts +17 -5
  22. package/dist/components/data/tableCells.js +52 -53
  23. package/dist/components/data/tableLogic.d.ts +2 -0
  24. package/dist/components/data/tableLogic.js +66 -66
  25. package/dist/components/data/tableSlots.d.ts +9 -0
  26. package/dist/components/data/tableSlots.js +12 -0
  27. package/dist/components/data/tableSpanLogic.d.ts +35 -0
  28. package/dist/components/data/tableSpanLogic.js +47 -0
  29. package/dist/components/data/tableTypes.d.ts +54 -1
  30. package/dist/components/data/useTableSelection.d.ts +4 -2
  31. package/dist/components/data/useTableSelection.js +29 -25
  32. package/dist/components/display/KapiAnchor.d.ts +36 -0
  33. package/dist/components/display/KapiAnchor.js +36 -0
  34. package/dist/components/display/KapiAnnotation.js +68 -63
  35. package/dist/components/display/KapiAvatar.d.ts +6 -4
  36. package/dist/components/display/KapiAvatar.js +33 -28
  37. package/dist/components/display/KapiBadge.d.ts +6 -5
  38. package/dist/components/display/KapiBadge.js +25 -19
  39. package/dist/components/display/KapiCodeBlock.d.ts +48 -0
  40. package/dist/components/display/KapiCodeBlock.js +44 -0
  41. package/dist/components/display/KapiCommentComposer.js +6 -6
  42. package/dist/components/display/KapiDiff.d.ts +62 -0
  43. package/dist/components/display/KapiDiff.js +118 -0
  44. package/dist/components/display/KapiHighlight.d.ts +27 -0
  45. package/dist/components/display/KapiHighlight.js +21 -0
  46. package/dist/components/display/KapiIconTile.d.ts +2 -1
  47. package/dist/components/display/KapiIconTile.js +23 -21
  48. package/dist/components/display/KapiStat.d.ts +3 -2
  49. package/dist/components/display/KapiStat.js +32 -26
  50. package/dist/components/display/KapiTag.d.ts +4 -3
  51. package/dist/components/display/KapiTag.js +29 -24
  52. package/dist/components/display/KapiText.d.ts +43 -0
  53. package/dist/components/display/KapiText.js +33 -0
  54. package/dist/components/display/KapiTimeline.d.ts +5 -2
  55. package/dist/components/display/KapiTimeline.js +31 -23
  56. package/dist/components/display/KapiTitle.d.ts +33 -0
  57. package/dist/components/display/KapiTitle.js +29 -0
  58. package/dist/components/display/annotationLogic.d.ts +2 -1
  59. package/dist/components/display/annotationLogic.js +7 -6
  60. package/dist/components/display/codeBlockSlots.d.ts +10 -0
  61. package/dist/components/display/codeBlockSlots.js +13 -0
  62. package/dist/components/display/diffLogic.d.ts +58 -0
  63. package/dist/components/display/diffLogic.js +96 -0
  64. package/dist/components/display/diffSlots.d.ts +14 -0
  65. package/dist/components/display/diffSlots.js +17 -0
  66. package/dist/components/display/highlightLogic.d.ts +18 -0
  67. package/dist/components/display/highlightLogic.js +26 -0
  68. package/dist/components/display/highlightSlots.d.ts +5 -0
  69. package/dist/components/display/highlightSlots.js +8 -0
  70. package/dist/components/display/iconTileLogic.d.ts +2 -2
  71. package/dist/components/display/iconTileLogic.js +7 -6
  72. package/dist/components/display/index.d.ts +15 -0
  73. package/dist/components/display/statLogic.d.ts +2 -1
  74. package/dist/components/display/statLogic.js +7 -6
  75. package/dist/components/display/tagLogic.d.ts +2 -1
  76. package/dist/components/display/tagLogic.js +7 -6
  77. package/dist/components/display/textLogic.d.ts +32 -0
  78. package/dist/components/display/textLogic.js +19 -0
  79. package/dist/components/display/timelineLogic.d.ts +20 -2
  80. package/dist/components/display/timelineLogic.js +10 -2
  81. package/dist/components/feedback/KapiAlert.d.ts +8 -4
  82. package/dist/components/feedback/KapiAlert.js +39 -34
  83. package/dist/components/feedback/KapiFab.js +108 -108
  84. package/dist/components/feedback/KapiProgress.js +63 -54
  85. package/dist/components/feedback/KapiToastContainer.js +9 -9
  86. package/dist/components/feedback/KapiTour.js +12 -12
  87. package/dist/components/feedback/progressLogic.d.ts +2 -1
  88. package/dist/components/feedback/progressLogic.js +9 -8
  89. package/dist/components/inputs/KapiAutocomplete.d.ts +6 -0
  90. package/dist/components/inputs/KapiAutocomplete.js +86 -85
  91. package/dist/components/inputs/KapiButton.d.ts +7 -4
  92. package/dist/components/inputs/KapiButton.js +47 -42
  93. package/dist/components/inputs/KapiChecklist.d.ts +7 -1
  94. package/dist/components/inputs/KapiChecklist.js +53 -52
  95. package/dist/components/inputs/KapiCopyButton.d.ts +40 -0
  96. package/dist/components/inputs/KapiCopyButton.js +35 -0
  97. package/dist/components/inputs/KapiDatePicker.d.ts +7 -1
  98. package/dist/components/inputs/KapiDatePicker.js +118 -116
  99. package/dist/components/inputs/KapiDateRangePicker.d.ts +7 -1
  100. package/dist/components/inputs/KapiDateRangePicker.js +136 -135
  101. package/dist/components/inputs/KapiFacetedSearch.js +5 -5
  102. package/dist/components/inputs/KapiField.d.ts +9 -1
  103. package/dist/components/inputs/KapiField.js +43 -42
  104. package/dist/components/inputs/KapiFileUpload.js +6 -6
  105. package/dist/components/inputs/KapiInput.d.ts +29 -1
  106. package/dist/components/inputs/KapiInput.js +74 -51
  107. package/dist/components/inputs/KapiMaskedInput.js +26 -26
  108. package/dist/components/inputs/KapiNumberStepper.d.ts +7 -1
  109. package/dist/components/inputs/KapiNumberStepper.js +24 -23
  110. package/dist/components/inputs/KapiPinInput.d.ts +72 -0
  111. package/dist/components/inputs/KapiPinInput.js +75 -0
  112. package/dist/components/inputs/KapiPropsForm.d.ts +34 -0
  113. package/dist/components/inputs/KapiPropsForm.js +78 -0
  114. package/dist/components/inputs/KapiRating.d.ts +7 -1
  115. package/dist/components/inputs/KapiRating.js +39 -38
  116. package/dist/components/inputs/KapiSearchChip.js +5 -5
  117. package/dist/components/inputs/KapiSegmented.d.ts +13 -5
  118. package/dist/components/inputs/KapiSegmented.js +81 -77
  119. package/dist/components/inputs/KapiSelect.d.ts +21 -1
  120. package/dist/components/inputs/KapiSelect.js +251 -245
  121. package/dist/components/inputs/KapiSelectMenu.d.ts +4 -2
  122. package/dist/components/inputs/KapiSelectMenu.js +131 -133
  123. package/dist/components/inputs/KapiSlider.d.ts +10 -3
  124. package/dist/components/inputs/KapiSlider.js +67 -63
  125. package/dist/components/inputs/KapiTagInput.d.ts +7 -1
  126. package/dist/components/inputs/KapiTagInput.js +70 -69
  127. package/dist/components/inputs/KapiTextarea.d.ts +7 -1
  128. package/dist/components/inputs/KapiTextarea.js +51 -50
  129. package/dist/components/inputs/copyLogic.d.ts +1 -0
  130. package/dist/components/inputs/copyLogic.js +12 -0
  131. package/dist/components/inputs/fieldLogic.d.ts +21 -1
  132. package/dist/components/inputs/fieldLogic.js +18 -11
  133. package/dist/components/inputs/index.d.ts +9 -1
  134. package/dist/components/inputs/inputLogic.d.ts +16 -1
  135. package/dist/components/inputs/inputLogic.js +3 -3
  136. package/dist/components/inputs/ownField.d.ts +3 -1
  137. package/dist/components/inputs/ownField.js +28 -27
  138. package/dist/components/inputs/pinInputLogic.d.ts +34 -0
  139. package/dist/components/inputs/pinInputLogic.js +37 -0
  140. package/dist/components/inputs/propsFormLogic.d.ts +53 -0
  141. package/dist/components/inputs/propsFormLogic.js +11 -0
  142. package/dist/components/inputs/segmentedLogic.d.ts +7 -0
  143. package/dist/components/inputs/segmentedLogic.js +2 -2
  144. package/dist/components/inputs/selectSlots.d.ts +24 -0
  145. package/dist/components/inputs/selectSlots.js +27 -0
  146. package/dist/components/layout/KapiAccessCard.d.ts +5 -1
  147. package/dist/components/layout/KapiAccessCard.js +43 -39
  148. package/dist/components/layout/KapiAccountMenu.js +7 -7
  149. package/dist/components/layout/KapiBox.d.ts +31 -0
  150. package/dist/components/layout/KapiBox.js +26 -0
  151. package/dist/components/layout/KapiCard.d.ts +16 -4
  152. package/dist/components/layout/KapiCard.js +46 -34
  153. package/dist/components/layout/KapiCenter.d.ts +13 -0
  154. package/dist/components/layout/KapiCenter.js +23 -0
  155. package/dist/components/layout/KapiCol.d.ts +22 -0
  156. package/dist/components/layout/KapiCol.js +23 -0
  157. package/dist/components/layout/KapiCollapse.d.ts +39 -0
  158. package/dist/components/layout/KapiCollapse.js +20 -0
  159. package/dist/components/layout/KapiContextSlot.js +4 -4
  160. package/dist/components/layout/KapiDivider.d.ts +11 -2
  161. package/dist/components/layout/KapiDivider.js +30 -24
  162. package/dist/components/layout/KapiGrid.d.ts +29 -3
  163. package/dist/components/layout/KapiGrid.js +39 -17
  164. package/dist/components/layout/KapiNotificationBell.js +10 -10
  165. package/dist/components/layout/KapiPageHeader.d.ts +10 -1
  166. package/dist/components/layout/KapiPageHeader.js +94 -92
  167. package/dist/components/layout/KapiPanelParts.d.ts +11 -2
  168. package/dist/components/layout/KapiPanelParts.js +73 -56
  169. package/dist/components/layout/KapiRail.d.ts +10 -1
  170. package/dist/components/layout/KapiRail.js +125 -122
  171. package/dist/components/layout/KapiRoot.d.ts +55 -5
  172. package/dist/components/layout/KapiRoot.js +57 -38
  173. package/dist/components/layout/KapiShell.d.ts +44 -3
  174. package/dist/components/layout/KapiShell.js +54 -50
  175. package/dist/components/layout/accessCardLogic.d.ts +8 -1
  176. package/dist/components/layout/accessCardLogic.js +11 -7
  177. package/dist/components/layout/cardSlots.d.ts +9 -0
  178. package/dist/components/layout/cardSlots.js +12 -0
  179. package/dist/components/layout/gridSpanLogic.d.ts +46 -0
  180. package/dist/components/layout/gridSpanLogic.js +39 -0
  181. package/dist/components/layout/index.d.ts +13 -4
  182. package/dist/components/layout/layoutPrimitives.d.ts +11 -0
  183. package/dist/components/layout/layoutPrimitives.js +12 -1
  184. package/dist/components/layout/pageHeaderSlots.d.ts +12 -0
  185. package/dist/components/layout/pageHeaderSlots.js +15 -0
  186. package/dist/components/layout/railLogic.d.ts +16 -3
  187. package/dist/components/layout/railSlots.d.ts +12 -0
  188. package/dist/components/layout/railSlots.js +15 -0
  189. package/dist/components/layout/shellSlots.d.ts +6 -0
  190. package/dist/components/layout/shellSlots.js +9 -0
  191. package/dist/components/layout/useGridBreakpoint.d.ts +12 -0
  192. package/dist/components/layout/useGridBreakpoint.js +35 -0
  193. package/dist/components/locale/labelRegistry.d.ts +10 -0
  194. package/dist/components/navigation/KapiAccordion.js +9 -9
  195. package/dist/components/navigation/KapiBreadcrumb.d.ts +18 -2
  196. package/dist/components/navigation/KapiBreadcrumb.js +23 -16
  197. package/dist/components/navigation/KapiContextPanel.d.ts +17 -4
  198. package/dist/components/navigation/KapiContextPanel.js +152 -136
  199. package/dist/components/navigation/KapiNavBadge.d.ts +6 -3
  200. package/dist/components/navigation/KapiNavBadge.js +26 -22
  201. package/dist/components/navigation/KapiPanelGroup.d.ts +16 -4
  202. package/dist/components/navigation/KapiPanelGroup.js +66 -65
  203. package/dist/components/navigation/KapiTabs.d.ts +12 -0
  204. package/dist/components/navigation/KapiTabs.js +87 -71
  205. package/dist/components/navigation/KapiToc.d.ts +48 -0
  206. package/dist/components/navigation/KapiToc.js +66 -0
  207. package/dist/components/navigation/KapiTree.js +10 -10
  208. package/dist/components/navigation/MiniNavItem.d.ts +7 -2
  209. package/dist/components/navigation/MiniNavItem.js +41 -36
  210. package/dist/components/navigation/breadcrumbLogic.d.ts +4 -2
  211. package/dist/components/navigation/breadcrumbLogic.js +1 -1
  212. package/dist/components/navigation/index.d.ts +3 -0
  213. package/dist/components/navigation/navLink.d.ts +21 -0
  214. package/dist/components/navigation/navLink.js +26 -0
  215. package/dist/components/navigation/navLinkLogic.d.ts +18 -0
  216. package/dist/components/navigation/navLinkLogic.js +22 -0
  217. package/dist/components/navigation/tocLogic.d.ts +35 -0
  218. package/dist/components/navigation/tocLogic.js +11 -0
  219. package/dist/components/navigation/tocSlots.d.ts +8 -0
  220. package/dist/components/navigation/tocSlots.js +11 -0
  221. package/dist/components/overlays/KapiCommandPalette.js +6 -6
  222. package/dist/components/overlays/KapiContextMenu.d.ts +8 -0
  223. package/dist/components/overlays/KapiContextMenu.js +5 -5
  224. package/dist/components/overlays/KapiMenuButton.js +7 -7
  225. package/dist/components/overlays/KapiModal.d.ts +9 -0
  226. package/dist/components/overlays/KapiModal.js +79 -77
  227. package/dist/components/overlays/KapiOffcanvas.js +24 -24
  228. package/dist/components/overlays/KapiPhotoView.js +10 -10
  229. package/dist/components/overlays/KapiPopover.js +6 -6
  230. package/dist/components/overlays/KapiShapeSheet.js +4 -4
  231. package/dist/components/overlays/KapiTooltip.js +18 -18
  232. package/dist/components/overlays/index.d.ts +1 -1
  233. package/dist/components/overlays/menuList.js +127 -117
  234. package/dist/components/overlays/modalSlots.d.ts +11 -0
  235. package/dist/components/overlays/modalSlots.js +14 -0
  236. package/dist/components/slotCatalog.d.ts +123 -0
  237. package/dist/components/slotCatalog.js +27 -0
  238. package/dist/components/slotsLogic.d.ts +34 -0
  239. package/dist/components/slotsLogic.js +18 -0
  240. package/dist/components/tone.d.ts +26 -0
  241. package/dist/components/tone.js +15 -14
  242. package/dist/css/base.css +1 -1
  243. package/dist/css/components/data/KapiEventCalendar.css +1 -1
  244. package/dist/css/components/data/KapiTable.css +1 -1
  245. package/dist/css/components/display/KapiAnnotation.css +1 -1
  246. package/dist/css/components/display/KapiCodeBlock.css +1 -0
  247. package/dist/css/components/display/KapiDiff.css +1 -0
  248. package/dist/css/components/display/display.css +1 -1
  249. package/dist/css/components/display/typography.css +1 -0
  250. package/dist/css/components/feedback/feedback.css +1 -1
  251. package/dist/css/components/inputs/KapiButton.css +1 -1
  252. package/dist/css/components/inputs/KapiDatePicker.css +1 -1
  253. package/dist/css/components/inputs/KapiPinInput.css +1 -0
  254. package/dist/css/components/inputs/KapiSelect.css +1 -1
  255. package/dist/css/components/inputs/inputsExtra.css +1 -1
  256. package/dist/css/components/layout/KapiAccessCard.css +1 -1
  257. package/dist/css/components/layout/KapiBox.css +1 -0
  258. package/dist/css/components/layout/KapiCollapse.css +1 -0
  259. package/dist/css/components/layout/KapiDivider.css +1 -1
  260. package/dist/css/components/layout/KapiRail.css +1 -1
  261. package/dist/css/components/layout/gridSpan.css +1 -0
  262. package/dist/css/components/navigation/KapiToc.css +1 -0
  263. package/dist/css/components/navigation/navigation.css +1 -1
  264. package/dist/hooks/asyncResourceLogic.d.ts +11 -0
  265. package/dist/hooks/asyncResourceLogic.js +4 -0
  266. package/dist/hooks/densityLogic.d.ts +15 -0
  267. package/dist/hooks/densityLogic.js +4 -0
  268. package/dist/hooks/index.d.ts +7 -0
  269. package/dist/hooks/themeColorsLogic.d.ts +19 -0
  270. package/dist/hooks/themeColorsLogic.js +4 -2
  271. package/dist/hooks/themeDeriveLogic.d.ts +16 -0
  272. package/dist/hooks/themeDeriveLogic.js +27 -17
  273. package/dist/hooks/toneFamilyLogic.d.ts +146 -0
  274. package/dist/hooks/toneFamilyLogic.js +164 -0
  275. package/dist/hooks/useAsyncResource.d.ts +45 -0
  276. package/dist/hooks/useAsyncResource.js +24 -0
  277. package/dist/hooks/useKapiTheme.d.ts +16 -3
  278. package/dist/hooks/useKapiTheme.js +130 -117
  279. package/dist/hooks/useToneFamilies.d.ts +40 -0
  280. package/dist/hooks/useToneFamilies.js +50 -0
  281. package/dist/index.d.ts +3 -1
  282. package/dist/index.js +227 -204
  283. package/dist/kapi.css +1 -1
  284. package/dist/kapi.layered.css +1 -1
  285. package/dist/logic.d.ts +41 -0
  286. package/dist/logic.js +42 -0
  287. package/dist/styles/rawHeights.d.ts +8 -0
  288. package/package.json +14 -3
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/data/KapiTableFilter.css";
3
3
  import { joinClasses as e } from "../rootProps.js";
4
- import { KapiField as t } from "../inputs/KapiField.js";
5
- import { KapiInputGroup as n } from "../inputs/KapiInputGroup.js";
6
- import { useLabels as r } from "../locale/KapiLocaleProvider.js";
4
+ import { useLabels as t } from "../locale/KapiLocaleProvider.js";
5
+ import { KapiField as n } from "../inputs/KapiField.js";
6
+ import { KapiInputGroup as r } from "../inputs/KapiInputGroup.js";
7
7
  import { KapiInput as i } from "../inputs/KapiInput.js";
8
8
  import { KapiSelect as a } from "../inputs/KapiSelect.js";
9
9
  import { filterColumnOptions as o, isFilterActive as s } from "./tableLogic.js";
@@ -22,7 +22,7 @@ var _ = {
22
22
  region: c
23
23
  }, v = "\0all", y = (e, t) => e.text === t.text && e.column === t.column;
24
24
  function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce: w, label: T, size: E = "sm", labels: D, className: O, "aria-label": k, ...A }) {
25
- let j = r("tableFilter", _, D), M = C ?? w ?? 0, N = d(() => o(x), [x]), [P, F] = p(c), I = f(c), [L, R] = p(c);
25
+ let j = t("tableFilter", _, D), M = C ?? w ?? 0, N = d(() => o(x), [x]), [P, F] = p(c), I = f(c), [L, R] = p(c);
26
26
  y(L, c) || (R(c), y(I.current, c) || F(c));
27
27
  let z = f(void 0);
28
28
  l(() => () => clearTimeout(z.current), []);
@@ -30,7 +30,7 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
30
30
  clearTimeout(z.current), I.current = e, b(e);
31
31
  }, V = (e, t) => {
32
32
  F(e), clearTimeout(z.current), !t && M > 0 ? z.current = setTimeout(() => B(e), M) : B(e);
33
- }, H = u(), U = /* @__PURE__ */ h(n, {
33
+ }, H = u(), U = /* @__PURE__ */ h(r, {
34
34
  size: E,
35
35
  className: "kapi-tablefilter__group",
36
36
  children: [/* @__PURE__ */ m(a, {
@@ -69,7 +69,7 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
69
69
  className: e("kapi-tablefilter", O),
70
70
  role: "search",
71
71
  "aria-label": k ?? j.region,
72
- children: [T == null ? U : /* @__PURE__ */ m(t, {
72
+ children: [T == null ? U : /* @__PURE__ */ m(n, {
73
73
  label: T,
74
74
  htmlFor: H,
75
75
  className: "kapi-tablefilter__field",
@@ -0,0 +1,22 @@
1
+ import { type StickyLayout } from "./tableCells.js";
2
+ import type { KapiTableColumnWidths } from "./tableLogic.js";
3
+ import type { KapiTableColumn, KapiTableFooterRow } from "./tableTypes.js";
4
+ type TableFooterProps<T> = {
5
+ rows: ReadonlyArray<KapiTableFooterRow>;
6
+ columns: ReadonlyArray<KapiTableColumn<T>>;
7
+ layout: StickyLayout;
8
+ widths: KapiTableColumnWidths;
9
+ /** La tabla tiene columna de checkboxes: el pie le deja su hueco (fijo, como en el cuerpo). */
10
+ selectable: boolean;
11
+ /** La tabla tiene columna del expansor. */
12
+ expandable: boolean;
13
+ /** La tabla tiene columna de acciones. */
14
+ hasActions: boolean;
15
+ };
16
+ /**
17
+ * Las columnas de checkboxes, expansor y acciones no llevan celdas propias en el pie: se rellenan con
18
+ * una celda vacía para que las cifras queden bajo su columna. Las columnas visibles que ninguna celda
19
+ * cubre también se rellenan, de a una, para que una fijada conserve su celda (y su opacidad).
20
+ */
21
+ export declare function TableFooter<T>({ rows, columns, layout, widths, selectable, expandable, hasActions }: TableFooterProps<T>): import("react").JSX.Element;
22
+ export {};
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { joinClasses as e } from "../rootProps.js";
3
+ import { columnAlign as t } from "./tableLogic.js";
4
+ import { actColClass as n, cellClass as r, columnBoxStyle as i, stickyInset as a } from "./tableCells.js";
5
+ import { layoutFooterRow as o } from "./tableSpanLogic.js";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ //#region src/components/data/KapiTableFooter.tsx
8
+ function l({ rows: l, columns: u, layout: d, widths: f, selectable: p, expandable: m, hasActions: h }) {
9
+ let g = u.map((e) => e.key);
10
+ return /* @__PURE__ */ s("tfoot", { children: l.map((l, _) => /* @__PURE__ */ c("tr", { children: [
11
+ p && /* @__PURE__ */ s("td", {
12
+ className: "is-sticky kapi-cbcol",
13
+ style: { insetInlineStart: 0 }
14
+ }),
15
+ m && /* @__PURE__ */ s("td", { className: "kapi-expandcol" }),
16
+ o(l, g).flatMap((n) => {
17
+ let o = u[n.start];
18
+ if (!n.cell) return u.slice(n.start, n.start + n.span).map((e, t) => {
19
+ let o = n.start + t;
20
+ return /* @__PURE__ */ s("td", {
21
+ className: r(e, o, d),
22
+ style: {
23
+ ...a(o, d),
24
+ ...i(e, "td", f)
25
+ }
26
+ }, e.key);
27
+ });
28
+ let { cell: c, start: l, span: p } = n, m = t(c.align ?? o.align), h = p === 1, g = {
29
+ ...h ? {
30
+ ...a(l, d),
31
+ ...i(o, "td", f)
32
+ } : {},
33
+ textAlign: m
34
+ }, _ = h ? r({
35
+ ...o,
36
+ align: c.align ?? o.align
37
+ }, l, d) : e(m && `is-align-${m}`), v = `${l}:${p}`, y = h ? void 0 : p;
38
+ return [c.header ? /* @__PURE__ */ s("th", {
39
+ scope: "row",
40
+ colSpan: y,
41
+ className: _,
42
+ style: g,
43
+ children: c.content
44
+ }, v) : /* @__PURE__ */ s("td", {
45
+ colSpan: y,
46
+ className: _,
47
+ style: g,
48
+ children: c.content
49
+ }, v)];
50
+ }),
51
+ h && /* @__PURE__ */ s("td", { className: n(d) })
52
+ ] }, _)) });
53
+ }
54
+ //#endregion
55
+ export { l as TableFooter };
@@ -2,17 +2,18 @@
2
2
  import { winOf as e } from "../../hooks/ownerDocument.js";
3
3
  import { actColClass as t, bodyCell as n } from "./tableCells.js";
4
4
  import { isRowActivationKey as r, mergeRowProps as i, shouldFireRowClick as a } from "./rowClickLogic.js";
5
- import { memo as o } from "react";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import { ChevronDown as u, ChevronRight as d, MoreHorizontal as f } from "lucide-react";
5
+ import { rowColSpans as o } from "./tableSpanLogic.js";
6
+ import { memo as s } from "react";
7
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { ChevronDown as d, ChevronRight as f, MoreHorizontal as p } from "lucide-react";
8
9
  //#region src/components/data/KapiTableRow.tsx
9
- var p = "button, a, input, select, textarea, label, [role=button]";
10
- function m({ row: o, id: m, index: h, selected: g, selectLabel: _, open: v, canSelect: y, clickSelect: b, clickable: x, getRowProps: S, rangeSelect: C, selectable: w, expandable: T, rowHeight: E, virtualIndex: D, columns: O, layout: k, widths: A, text: j, hasActions: M, actions: N, hasRowMenu: P, renderSubComponent: F, colSpan: I, handlers: L }) {
11
- let R = b && !x, z = x ? (t) => {
12
- a(t.target, t.currentTarget, e(t.currentTarget)?.getSelection() ?? null) && L.rowClick(o, t);
13
- } : R ? (e) => {
14
- e.target.closest(p) || L.activate(m, e.shiftKey);
15
- } : void 0, B = x ? (e) => {
10
+ var m = "button, a, input, select, textarea, label, [role=button]";
11
+ function h({ row: s, id: h, index: g, selected: _, selectLabel: v, open: y, canSelect: b, clickSelect: x, clickable: S, getRowProps: C, rangeSelect: w, selectable: T, expandable: E, rowHeight: D, virtualIndex: O, columns: k, layout: A, widths: j, text: M, hasActions: N, actions: P, hasRowMenu: F, renderSubComponent: I, colSpan: L, handlers: R }) {
12
+ let z = x && !S, B = k.some((e) => e.colSpan) ? o(k, s) : void 0, V = S ? (t) => {
13
+ a(t.target, t.currentTarget, e(t.currentTarget)?.getSelection() ?? null) && R.rowClick(s, t);
14
+ } : z ? (e) => {
15
+ e.target.closest(m) || R.activate(h, e.shiftKey);
16
+ } : void 0, H = S ? (e) => {
16
17
  let t = {
17
18
  key: e.key,
18
19
  target: e.target,
@@ -21,67 +22,67 @@ function m({ row: o, id: m, index: h, selected: g, selectLabel: _, open: v, canS
21
22
  r({
22
23
  ...t,
23
24
  isComposing: e.nativeEvent.isComposing
24
- }) && (e.preventDefault(), L.rowClick(o, e));
25
- } : void 0, V = R ? (e) => {
26
- C && e.shiftKey && e.preventDefault();
27
- } : void 0, H = i(S?.(o, h), {
28
- className: `${g ? "is-selected" : ""}${R ? " is-rowsel" : ""}${x ? " is-clickable" : ""}`.trim(),
29
- style: E === void 0 ? void 0 : { height: E },
30
- tabIndex: x ? 0 : void 0,
31
- onClick: z,
32
- onMouseDown: V,
33
- onKeyDown: B
25
+ }) && (e.preventDefault(), R.rowClick(s, e));
26
+ } : void 0, U = z ? (e) => {
27
+ w && e.shiftKey && e.preventDefault();
28
+ } : void 0, W = i(C?.(s, g), {
29
+ className: `${_ ? "is-selected" : ""}${z ? " is-rowsel" : ""}${S ? " is-clickable" : ""}`.trim(),
30
+ style: D === void 0 ? void 0 : { height: D },
31
+ tabIndex: S ? 0 : void 0,
32
+ onClick: V,
33
+ onMouseDown: U,
34
+ onKeyDown: H
34
35
  });
35
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("tr", {
36
- ...H,
37
- "data-vindex": D,
36
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("tr", {
37
+ ...W,
38
+ "data-vindex": O,
38
39
  children: [
39
- w && /* @__PURE__ */ c("td", {
40
+ T && /* @__PURE__ */ l("td", {
40
41
  className: "is-sticky kapi-cbcol",
41
42
  style: { insetInlineStart: 0 },
42
- children: /* @__PURE__ */ c("label", {
43
+ children: /* @__PURE__ */ l("label", {
43
44
  className: "kapi-check kapi-check--block",
44
- children: /* @__PURE__ */ c("input", {
45
+ children: /* @__PURE__ */ l("input", {
45
46
  type: "checkbox",
46
- checked: g,
47
- disabled: !y,
47
+ checked: _,
48
+ disabled: !b,
48
49
  onClick: (e) => {
49
- y && L.activate(m, e.shiftKey);
50
+ b && R.activate(h, e.shiftKey);
50
51
  },
51
52
  onChange: () => void 0,
52
- "aria-label": _
53
+ "aria-label": v
53
54
  })
54
55
  })
55
56
  }),
56
- T && /* @__PURE__ */ c("td", {
57
+ E && /* @__PURE__ */ l("td", {
57
58
  className: "kapi-expandcol",
58
- children: /* @__PURE__ */ c("button", {
59
+ children: /* @__PURE__ */ l("button", {
59
60
  type: "button",
60
61
  className: "kapi-expandcol__btn",
61
- "aria-label": j.expandRow,
62
- "aria-expanded": v,
63
- onClick: () => L.toggleExpanded(m),
64
- children: v ? /* @__PURE__ */ c(u, {
62
+ "aria-label": M.expandRow,
63
+ "aria-expanded": y,
64
+ onClick: () => R.toggleExpanded(h),
65
+ children: y ? /* @__PURE__ */ l(d, {
65
66
  size: 16,
66
67
  strokeWidth: 2
67
- }) : /* @__PURE__ */ c(d, {
68
+ }) : /* @__PURE__ */ l(f, {
68
69
  className: "kapi-flip-rtl",
69
70
  size: 16,
70
71
  strokeWidth: 2
71
72
  })
72
73
  })
73
74
  }),
74
- O.map((e, t) => n(e, t, o, k, A, j, L.copy)),
75
- M && /* @__PURE__ */ c("td", {
76
- className: t(k),
77
- children: /* @__PURE__ */ l("div", {
75
+ k.map((e, t) => B?.[t] === 0 ? null : n(e, t, s, A, j, M, R.copy, B?.[t])),
76
+ N && /* @__PURE__ */ l("td", {
77
+ className: t(A),
78
+ children: /* @__PURE__ */ u("div", {
78
79
  className: "kapi-actcol__in",
79
- children: [N ? N(o) : null, P && /* @__PURE__ */ c("button", {
80
+ children: [P ? P(s) : null, F && /* @__PURE__ */ l("button", {
80
81
  type: "button",
81
82
  className: "kapi-actcol__dots",
82
- "aria-label": j.moreActions,
83
- onClick: (e) => L.openMenu(e, o),
84
- children: /* @__PURE__ */ c(f, {
83
+ "aria-label": M.moreActions,
84
+ onClick: (e) => R.openMenu(e, s),
85
+ children: /* @__PURE__ */ l(p, {
85
86
  size: 16,
86
87
  strokeWidth: 2
87
88
  })
@@ -89,15 +90,15 @@ function m({ row: o, id: m, index: h, selected: g, selectLabel: _, open: v, canS
89
90
  })
90
91
  })
91
92
  ]
92
- }), v && F && /* @__PURE__ */ c("tr", {
93
+ }), y && I && /* @__PURE__ */ l("tr", {
93
94
  className: "kapi-subrow",
94
- "data-vindex": D,
95
- children: /* @__PURE__ */ c("td", {
96
- colSpan: I,
97
- children: F(o)
95
+ "data-vindex": O,
96
+ children: /* @__PURE__ */ l("td", {
97
+ colSpan: L,
98
+ children: I(s)
98
99
  })
99
100
  })] });
100
101
  }
101
- var h = o(m);
102
+ var g = s(h);
102
103
  //#endregion
103
- export { h as TableRow };
104
+ export { g as TableRow };
@@ -1,8 +1,10 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { KapiTableLabels } from "./tableLabels.js";
3
3
  import { type KapiTableColumnPinning, type TableColumnPinningInput, type KapiTableColumnVisibility, type KapiTableFilterState } from "./tableLogic.js";
4
- import type { KapiTableAction, KapiTableActionHandler, KapiTableColumn, KapiTableContext, KapiTableKeyField } from "./tableTypes.js";
4
+ import type { KapiTableAction, KapiTableActionHandler, KapiTableColumn, KapiTableContext, KapiTableClassNames, KapiTableKeyField } from "./tableTypes.js";
5
5
  type KapiTableToolbarProps<T, K extends KapiTableKeyField<T>> = {
6
+ /** `classNames` de la tabla: acá cuenta `toolbar`. */
7
+ classNames?: KapiTableClassNames | undefined;
6
8
  text: KapiTableLabels;
7
9
  filterable: boolean;
8
10
  filter: KapiTableFilterState;
@@ -33,5 +35,5 @@ type KapiTableToolbarProps<T, K extends KapiTableKeyField<T>> = {
33
35
  pinned: TableColumnPinningInput;
34
36
  onPinnedChange: (next: KapiTableColumnPinning) => void;
35
37
  };
36
- export declare function KapiTableToolbar<T, K extends KapiTableKeyField<T>>({ text, filterable, filter, onFilterChange, visibleColumns, manualFilter, filterDebounce, shownCount, totalCount, content, toolbarActions, isPending, context, onRun, refresh, refreshing, onExportCsv, columns, columnToggle, columnPinning, visibility, onShownColumnsChange, pinned, onPinnedChange }: KapiTableToolbarProps<T, K>): import("react").JSX.Element | null;
38
+ export declare function KapiTableToolbar<T, K extends KapiTableKeyField<T>>({ text, filterable, filter, onFilterChange, visibleColumns, manualFilter, filterDebounce, shownCount, totalCount, content, toolbarActions, isPending, context, onRun, refresh, refreshing, onExportCsv, columns, columnToggle, columnPinning, visibility, onShownColumnsChange, pinned, onPinnedChange, classNames }: KapiTableToolbarProps<T, K>): import("react").JSX.Element | null;
37
39
  export {};
@@ -5,22 +5,24 @@ import { KapiChecklist as n } from "../inputs/KapiChecklist.js";
5
5
  import { placementViewport as r } from "../../hooks/viewportInsetLogic.js";
6
6
  import { usePlacement as i } from "../../hooks/usePlacement.js";
7
7
  import { useDismiss as a } from "../../hooks/useDismiss.js";
8
- import { COLUMNS_PANEL_ESTIMATE as o, COLUMNS_PANEL_PLACEMENT as s, columnsPanelMaxHeight as c, csvHeaderOf as l, setSidePins as u, visibleColumnsOf as d } from "./tableLogic.js";
8
+ import { slot as o } from "../slotsLogic.js";
9
+ import { COLUMNS_PANEL_ESTIMATE as s, COLUMNS_PANEL_PLACEMENT as c, columnsPanelMaxHeight as l, csvHeaderOf as u, setSidePins as d, visibleColumnsOf as f } from "./tableLogic.js";
9
10
  import { useFocusReturn as ee } from "../../hooks/useFocusReturn.js";
10
- import { KapiContextMenu as f } from "../overlays/KapiContextMenu.js";
11
- import { KapiTableFilter as p } from "./KapiTableFilter.js";
12
- import { useEffect as te, useLayoutEffect as ne, useRef as m, useState as h } from "react";
13
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
14
- import { ChevronDown as y, Columns3 as re, Download as ie, Loader2 as b, RefreshCw as ae, Search as oe } from "lucide-react";
11
+ import { KapiContextMenu as p } from "../overlays/KapiContextMenu.js";
12
+ import { TABLE_SLOTS as m } from "./tableSlots.js";
13
+ import { KapiTableFilter as h } from "./KapiTableFilter.js";
14
+ import { useEffect as te, useLayoutEffect as ne, useRef as g, useState as _ } from "react";
15
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
16
+ import { ChevronDown as x, Columns3 as re, Download as ie, Loader2 as S, RefreshCw as C, Search as w } from "lucide-react";
15
17
  //#region src/components/data/KapiTableToolbar.tsx
16
- var se = (e) => e != null && typeof e != "boolean";
17
- function x({ text: e, filterable: f, filter: x, onFilterChange: S, visibleColumns: C, manualFilter: w, filterDebounce: T, shownCount: E, totalCount: D, content: O, toolbarActions: k, isPending: A, context: le, onRun: ue, refresh: j, refreshing: M, onExportCsv: N, columns: P, columnToggle: F, columnPinning: I, visibility: L, onShownColumnsChange: R, pinned: z, onPinnedChange: B }) {
18
- let [V, H] = h(!1), [U, W] = h(""), G = m(null), K = m(null), q = m(null), { restore: de } = ee(V, {
18
+ var T = (e) => e != null && typeof e != "boolean";
19
+ function E({ text: e, filterable: p, filter: E, onFilterChange: ae, visibleColumns: oe, manualFilter: O, filterDebounce: se, shownCount: ce, totalCount: le, content: k, toolbarActions: A, isPending: ue, context: de, onRun: fe, refresh: j, refreshing: M, onExportCsv: N, columns: P, columnToggle: F, columnPinning: I, visibility: L, onShownColumnsChange: R, pinned: z, onPinnedChange: B, classNames: pe }) {
20
+ let [V, H] = _(!1), [U, W] = _(""), G = g(null), K = g(null), q = g(null), { restore: me } = ee(V, {
19
21
  container: K,
20
22
  target: G
21
23
  }), J = (e) => {
22
- H(!1), W(""), e && de();
23
- }, fe = a(V, {
24
+ H(!1), W(""), e && me();
25
+ }, he = a(V, {
24
26
  zones: [q],
25
27
  outside: !1,
26
28
  onDismiss: () => J(!0)
@@ -29,118 +31,118 @@ function x({ text: e, filterable: f, filter: x, onFilterChange: S, visibleColumn
29
31
  anchor: G,
30
32
  floatingRef: K,
31
33
  measure: !1,
32
- estimate: o,
33
- ...s,
34
+ estimate: s,
35
+ ...c,
34
36
  hideUntilPlaced: !1
35
- }), X = Y?.side === "top" ? "top" : "bottom", [pe, me] = h(560);
37
+ }), ge = Y?.side === "top" ? "top" : "bottom", [_e, ve] = _(560);
36
38
  ne(() => {
37
39
  let e = Y?.side, t = e ? G.current?.getBoundingClientRect() : void 0;
38
- e && t && me(c(e, t, r(G.current).height));
40
+ e && t && ve(l(e, t, r(G.current).height));
39
41
  }, [Y]);
40
- let he = () => H(!0);
42
+ let ye = () => H(!0);
41
43
  te(() => {
42
44
  V && K.current?.querySelector("input, [role=\"listbox\"]")?.focus();
43
45
  }, [V]);
44
- let Z = P.filter((e) => e.hideable !== !1), ge = P.length > 6, Q = (e) => ({
46
+ let X = P.filter((e) => e.hideable !== !1), Z = P.length > 6, Q = (e) => ({
45
47
  id: e.key,
46
48
  label: e.label,
47
- text: l(e)
48
- }), $ = F && Z.length > 0 || I, _e = (k?.length ?? 0) > 0;
49
- return !f && !se(O) && !_e && !j && !N && !$ ? null : /* @__PURE__ */ v("div", {
50
- className: "kapi-tabletools",
49
+ text: u(e)
50
+ }), $ = F && X.length > 0 || I, be = (A?.length ?? 0) > 0;
51
+ return !p && !T(k) && !be && !j && !N && !$ ? null : /* @__PURE__ */ b("div", {
52
+ ...o(m, "toolbar", pe),
51
53
  children: [
52
- f && /* @__PURE__ */ _(p, {
53
- value: x,
54
- onChange: S,
55
- columns: C,
56
- count: w ? void 0 : {
57
- shown: E,
58
- total: D
54
+ p && /* @__PURE__ */ y(h, {
55
+ value: E,
56
+ onChange: ae,
57
+ columns: oe,
58
+ count: O ? void 0 : {
59
+ shown: ce,
60
+ total: le
59
61
  },
60
- loadDelay: w ? T : 0,
62
+ loadDelay: O ? se : 0,
61
63
  labels: e
62
64
  }),
63
- O,
64
- k?.map((e) => /* @__PURE__ */ _(ce, {
65
+ k,
66
+ A?.map((e) => /* @__PURE__ */ y(D, {
65
67
  action: e,
66
- busy: A(e.id),
67
- disabled: typeof e.disabled == "function" ? e.disabled(le()) : e.disabled === !0,
68
- onRun: (t) => ue(e.id, t)
68
+ busy: ue(e.id),
69
+ disabled: typeof e.disabled == "function" ? e.disabled(de()) : e.disabled === !0,
70
+ onRun: (t) => fe(e.id, t)
69
71
  }, e.id)),
70
- j && /* @__PURE__ */ v("button", {
72
+ j && /* @__PURE__ */ b("button", {
71
73
  type: "button",
72
74
  className: "kapi-filterchip kapi-tabletools__chip--icon",
73
75
  "aria-busy": M || void 0,
74
76
  onClick: j,
75
- children: [M ? /* @__PURE__ */ _(b, {
77
+ children: [M ? /* @__PURE__ */ y(S, {
76
78
  size: 14,
77
79
  strokeWidth: 2.2,
78
80
  className: "kapi-table-spin",
79
81
  "aria-hidden": !0
80
- }) : /* @__PURE__ */ _(ae, {
82
+ }) : /* @__PURE__ */ y(C, {
81
83
  size: 14,
82
84
  strokeWidth: 2.2
83
- }), /* @__PURE__ */ _("span", {
85
+ }), /* @__PURE__ */ y("span", {
84
86
  className: "kapi-strong kapi-tabletools__label",
85
87
  children: e.refresh
86
88
  })]
87
89
  }),
88
- N && /* @__PURE__ */ v("button", {
90
+ N && /* @__PURE__ */ b("button", {
89
91
  type: "button",
90
92
  className: "kapi-filterchip kapi-tabletools__chip--icon",
91
93
  onClick: N,
92
- children: [/* @__PURE__ */ _(ie, {
94
+ children: [/* @__PURE__ */ y(ie, {
93
95
  size: 14,
94
96
  strokeWidth: 2.2
95
- }), /* @__PURE__ */ _("span", {
97
+ }), /* @__PURE__ */ y("span", {
96
98
  className: "kapi-strong kapi-tabletools__label",
97
99
  children: e.exportCsv
98
100
  })]
99
101
  }),
100
- $ && /* @__PURE__ */ v("div", {
102
+ $ && /* @__PURE__ */ b("div", {
101
103
  ref: q,
102
104
  className: "kapi-dropdown",
103
- onKeyDown: fe,
104
- children: [/* @__PURE__ */ v("button", {
105
+ onKeyDown: he,
106
+ children: [/* @__PURE__ */ b("button", {
105
107
  ref: G,
106
108
  type: "button",
107
109
  className: "kapi-filterchip kapi-tabletools__chip--icon",
108
- onClick: () => V ? J(!1) : he(),
110
+ onClick: () => V ? J(!1) : ye(),
109
111
  "aria-haspopup": "dialog",
110
112
  "aria-expanded": V,
111
113
  children: [
112
- /* @__PURE__ */ _(re, {
114
+ /* @__PURE__ */ y(re, {
113
115
  size: 14,
114
116
  strokeWidth: 2.2
115
117
  }),
116
- /* @__PURE__ */ _("span", {
118
+ /* @__PURE__ */ y("span", {
117
119
  className: "kapi-strong kapi-tabletools__label",
118
120
  children: e.columns
119
121
  }),
120
- /* @__PURE__ */ _(y, {
122
+ /* @__PURE__ */ y(x, {
121
123
  size: 14,
122
124
  strokeWidth: 2.2,
123
125
  color: "var(--kapi-muted-2)",
124
126
  className: "kapi-tabletools__chevron"
125
127
  })
126
128
  ]
127
- }), V && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
129
+ }), V && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
128
130
  className: "kapi-dropdown__backdrop",
129
131
  onClick: () => J(!1)
130
- }), /* @__PURE__ */ v("div", {
132
+ }), /* @__PURE__ */ b("div", {
131
133
  ref: K,
132
- className: `kapi-menu kapi-dropdown__menu kapi-dropdown__menu--${X === "top" ? "up" : "down"} kapi-tabletools__menu kapi-tabletools__columns`,
133
- style: { maxHeight: pe },
134
+ className: `kapi-menu kapi-dropdown__menu kapi-dropdown__menu--${ge === "top" ? "up" : "down"} kapi-tabletools__menu kapi-tabletools__columns`,
135
+ style: { maxHeight: _e },
134
136
  role: "dialog",
135
137
  "aria-label": e.columns,
136
138
  children: [
137
- ge && /* @__PURE__ */ _(t, {
139
+ Z && /* @__PURE__ */ y(t, {
138
140
  type: "search",
139
141
  className: "kapi-tabletools__colsearch",
140
142
  "aria-label": e.searchColumns,
141
143
  placeholder: e.searchColumns,
142
144
  spellCheck: !1,
143
- startIcon: /* @__PURE__ */ _(oe, {}),
145
+ startIcon: /* @__PURE__ */ y(w, {}),
144
146
  clearable: !0,
145
147
  value: U,
146
148
  onChange: (e) => W(e.target.value),
@@ -148,19 +150,19 @@ function x({ text: e, filterable: f, filter: x, onFilterChange: S, visibleColumn
148
150
  (e.key === "ArrowDown" || e.key === "Enter") && (e.preventDefault(), K.current?.querySelector("[role=\"listbox\"]")?.focus());
149
151
  }
150
152
  }),
151
- F && /* @__PURE__ */ _(n, {
152
- items: Z.map(Q),
153
- value: Z.filter((e) => L[e.key] !== !1).map((e) => e.key),
153
+ F && /* @__PURE__ */ y(n, {
154
+ items: X.map(Q),
155
+ value: X.filter((e) => L[e.key] !== !1).map((e) => e.key),
154
156
  onChange: R,
155
157
  query: U,
156
158
  searchable: !1,
157
159
  ...I ? { label: e.showColumns } : { "aria-label": e.columns }
158
160
  }),
159
- I && ["left", "right"].map((t) => /* @__PURE__ */ _(n, {
161
+ I && ["left", "right"].map((t) => /* @__PURE__ */ y(n, {
160
162
  label: t === "left" ? e.pinColumns : e.pinColumnsRight,
161
- items: d(P, L).map(Q),
163
+ items: f(P, L).map(Q),
162
164
  value: z[t],
163
- onChange: (e) => B(u(z, t, e)),
165
+ onChange: (e) => B(d(z, t, e)),
164
166
  query: U,
165
167
  searchable: !1
166
168
  }, t))
@@ -170,14 +172,14 @@ function x({ text: e, filterable: f, filter: x, onFilterChange: S, visibleColumn
170
172
  ]
171
173
  });
172
174
  }
173
- function ce({ action: t, busy: n, disabled: r, onRun: i }) {
174
- let [a, o] = h(null), s = n ? /* @__PURE__ */ _(b, {
175
+ function D({ action: t, busy: n, disabled: r, onRun: i }) {
176
+ let [a, o] = _(null), s = n ? /* @__PURE__ */ y(S, {
175
177
  size: 14,
176
178
  strokeWidth: 2.2,
177
179
  className: "kapi-table-spin",
178
180
  "aria-hidden": !0
179
181
  }) : t.icon, { items: c, onAction: l } = t, u = t.icon === void 0 ? "kapi-filterchip" : "kapi-filterchip kapi-tabletools__chip--icon";
180
- if (c === void 0) return /* @__PURE__ */ v("button", {
182
+ if (c === void 0) return /* @__PURE__ */ b("button", {
181
183
  type: "button",
182
184
  className: u,
183
185
  disabled: r,
@@ -185,7 +187,7 @@ function ce({ action: t, busy: n, disabled: r, onRun: i }) {
185
187
  onClick: () => {
186
188
  l && i(l);
187
189
  },
188
- children: [s, /* @__PURE__ */ _("span", {
190
+ children: [s, /* @__PURE__ */ y("span", {
189
191
  className: "kapi-strong kapi-tabletools__label",
190
192
  children: t.label
191
193
  })]
@@ -197,7 +199,7 @@ function ce({ action: t, busy: n, disabled: r, onRun: i }) {
197
199
  disabled: n || t.disabled === !0,
198
200
  onClick: () => i(t.onAction)
199
201
  });
200
- return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("button", {
202
+ return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("button", {
201
203
  type: "button",
202
204
  className: u,
203
205
  disabled: r,
@@ -213,18 +215,18 @@ function ce({ action: t, busy: n, disabled: r, onRun: i }) {
213
215
  },
214
216
  children: [
215
217
  s,
216
- /* @__PURE__ */ _("span", {
218
+ /* @__PURE__ */ y("span", {
217
219
  className: "kapi-strong kapi-tabletools__label",
218
220
  children: t.label
219
221
  }),
220
- /* @__PURE__ */ _(y, {
222
+ /* @__PURE__ */ y(x, {
221
223
  size: 14,
222
224
  strokeWidth: 2.2,
223
225
  color: "var(--kapi-muted-2)",
224
226
  className: "kapi-tabletools__chevron"
225
227
  })
226
228
  ]
227
- }), a && /* @__PURE__ */ _(f, {
229
+ }), a && /* @__PURE__ */ y(p, {
228
230
  open: !0,
229
231
  x: a.x,
230
232
  y: a.y,
@@ -234,4 +236,4 @@ function ce({ action: t, busy: n, disabled: r, onRun: i }) {
234
236
  })] });
235
237
  }
236
238
  //#endregion
237
- export { x as KapiTableToolbar };
239
+ export { E as KapiTableToolbar };
@@ -52,9 +52,11 @@ barCategoryOrder,
52
52
  barStackTotals, DIRECT_LABEL_MAX_BARS } from "./barChartLogic.js";
53
53
  export type { KapiBarScale, KapiBarSort, KapiBarValueLabels } from "./barChartLogic.js";
54
54
  export { KapiTable, DEFAULT_TABLE_LABELS } from "./KapiTable.js";
55
+ export { KapiSheet, KapiSheetHead, KapiSheetBody, KapiSheetFoot, KapiSheetRow, KapiSheetCell, KapiSheetHeaderCell } from "./KapiSheet.js";
56
+ export type { KapiSheetProps, KapiSheetHeadProps, KapiSheetBodyProps, KapiSheetFootProps, KapiSheetRowProps, KapiSheetCellProps, KapiSheetHeaderCellProps } from "./KapiSheet.js";
55
57
  export { KapiDataTable } from "./KapiDataTable.js";
56
58
  export type { KapiDataTableProps } from "./KapiDataTable.js";
57
- export type { KapiTableCellValue, KapiTableColumn, KapiTableAction, KapiTableActionHandler, KapiTableActionItem, KapiTableClientPagination, KapiTableContext, KapiTableCsvOptions, KapiTableDataset, KapiTableKey, KapiTableKeyField, KapiTableLabels, KapiTablePagination, KapiTableProps, KapiTableRowAttributes, KapiTableRowHooks, KapiTableSelectionPreset, KapiTableSortDirection, KapiTableSortState, KapiTableSortValue } from "./KapiTable.js";
59
+ export type { KapiTableCellValue, KapiTableColumn, KapiTableAction, KapiTableActionHandler, KapiTableActionItem, KapiTableClientPagination, KapiTableContext, KapiTableCsvOptions, KapiTableDataset, KapiTableFooterCell, KapiTableFooterRow, KapiTableKey, KapiTableKeyField, KapiTableLabels, KapiTablePagination, KapiTableClassNames, KapiTableProps, KapiTableRowAttributes, KapiTableRowHooks, KapiTableSelectionPreset, KapiTableSortDirection, KapiTableSortState, KapiTableSortValue } from "./KapiTable.js";
58
60
  export {
59
61
  /** @deprecated Interno; usa `KapiTable` en su lugar. Se quita en 1.0. */
60
62
  datasetNoticeState,
@@ -1,8 +1,19 @@
1
1
  import type { CSSProperties, ReactNode } from "react";
2
- import { type KapiTableColumnWidths, type KapiTableSortState } from "./tableLogic.js";
2
+ import { columnAlign, type KapiTableColumnWidths, type KapiTableSortState } from "./tableLogic.js";
3
3
  import type { KapiTableLabels } from "./tableLabels.js";
4
4
  import type { KapiTableColumn } from "./tableTypes.js";
5
- export declare const copyToClipboard: (value: unknown, onCopy?: (value: unknown) => void) => void;
5
+ /**
6
+ * Copia el valor de una celda y avisa SÓLO si el portapapeles lo aceptó.
7
+ *
8
+ * Antes avisaba siempre: la escritura salía sin esperar y el `onCopy` se disparaba fuera del `try`,
9
+ * así que una app que muestra «¡Copiado!» en ese callback mentía cada vez que el portapapeles no
10
+ * estaba o rechazaba —sin permiso, sin foco, dentro de un iframe—. Su JSDoc dice «se llama tras
11
+ * copiar una celda», y ahora eso es cierto.
12
+ *
13
+ * Usa `copyText`, el mismo motor de `KapiCopyButton`: una sola implementación, y es la que resuelve
14
+ * el portapapeles por el documento dueño (iframe o shadow DOM) a partir del botón.
15
+ */
16
+ export declare const copyToClipboard: (value: unknown, onCopy?: (value: unknown) => void, from?: Element | null) => Promise<void>;
6
17
  /** Caja de la columna: sin override reproduce el comportamiento original. */
7
18
  export declare const columnBoxStyle: <T>(c: KapiTableColumn<T>, kind: "th" | "td", widths: KapiTableColumnWidths) => CSSProperties;
8
19
  /** Geometría de las columnas fijas, compartida por encabezado, filas y esqueleto (memoizada). */
@@ -16,8 +27,7 @@ export type StickyLayout = {
16
27
  /** Primera fija a la derecha: dibuja la sombra de ese borde (y Acciones deja de dibujarla). */
17
28
  firstRight: number;
18
29
  };
19
- /** Alineación lógica de una columna: `left`/`right` son alias de `start`/`end`. */
20
- export declare const columnAlign: (align: KapiTableColumn<unknown>["align"]) => "start" | "center" | "end" | undefined;
30
+ export { columnAlign };
21
31
  export declare const cellClass: <T>(c: KapiTableColumn<T>, i: number, layout: StickyLayout) => string;
22
32
  export declare const stickyInset: (i: number, layout: StickyLayout) => CSSProperties;
23
33
  /** Clase de la celda de acciones: sin sombra propia cuando hay fijas a la derecha pegadas a ella. */
@@ -35,4 +45,6 @@ export declare const stateRow: (colSpan: number, content: ReactNode, loading?: b
35
45
  /** Barra de esqueleto de una celda: ancho variable por fila y columna, acotado al de la columna. */
36
46
  export declare const skeletonBar: <T>(c: KapiTableColumn<T>, i: number, row: number) => import("react").JSX.Element;
37
47
  /** Celda de datos de una fila: clases y caja de la columna, offset fijo, etiqueta para tarjetas y copiar. */
38
- export declare const bodyCell: <T>(c: KapiTableColumn<T>, i: number, row: T, layout: StickyLayout, widths: KapiTableColumnWidths, text: Pick<KapiTableLabels, "copy">, onCopy: ((value: unknown) => void) | undefined) => import("react").JSX.Element;
48
+ export declare const bodyCell: <T>(c: KapiTableColumn<T>, i: number, row: T, layout: StickyLayout, widths: KapiTableColumnWidths, text: Pick<KapiTableLabels, "copy">, onCopy: ((value: unknown) => void) | undefined,
49
+ /** Columnas que ocupa la celda (`rowColSpans`); sin él, una. */
50
+ colSpan?: number) => import("react").JSX.Element;