@kapiuara/ui 0.13.0 → 0.15.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 (132) hide show
  1. package/README.md +239 -1
  2. package/dist/components/chat/KapiChatDivider.d.ts +7 -3
  3. package/dist/components/chat/KapiChatDivider.js +6 -6
  4. package/dist/components/chat/KapiChatList.js +19 -19
  5. package/dist/components/chat/KapiChatThread.js +23 -23
  6. package/dist/components/chat/KapiComposer.js +19 -19
  7. package/dist/components/chat/KapiMessageBubble.js +4 -4
  8. package/dist/components/chat/KapiTypingIndicator.js +4 -4
  9. package/dist/components/chat/index.d.ts +1 -1
  10. package/dist/components/closeReason.d.ts +34 -0
  11. package/dist/components/data/KapiBarChart.js +1 -1
  12. package/dist/components/data/KapiDataTable.js +31 -31
  13. package/dist/components/data/KapiEventCalendar.js +78 -78
  14. package/dist/components/data/KapiHeatmap.js +23 -23
  15. package/dist/components/data/KapiLineChart.js +1 -1
  16. package/dist/components/data/KapiPagination.js +4 -4
  17. package/dist/components/data/KapiSparkline.js +1 -1
  18. package/dist/components/data/KapiTable.js +122 -122
  19. package/dist/components/data/KapiTableFilter.js +18 -18
  20. package/dist/components/data/KapiTableRow.js +24 -24
  21. package/dist/components/data/KapiTableToolbar.js +49 -49
  22. package/dist/components/data/chartFrame.js +21 -21
  23. package/dist/components/data/useColumnResize.js +8 -8
  24. package/dist/components/data/useTableSelection.js +8 -8
  25. package/dist/components/display/KapiAnnotation.js +55 -55
  26. package/dist/components/display/KapiComment.js +4 -4
  27. package/dist/components/display/KapiCommentComposer.js +16 -16
  28. package/dist/components/display/KapiFileItem.js +6 -6
  29. package/dist/components/display/KapiFileViewer.js +9 -9
  30. package/dist/components/display/KapiTruncate.js +7 -7
  31. package/dist/components/feedback/KapiAlert.d.ts +2 -1
  32. package/dist/components/feedback/KapiAlert.js +8 -8
  33. package/dist/components/feedback/KapiCountdown.js +8 -8
  34. package/dist/components/feedback/KapiFab.js +30 -30
  35. package/dist/components/feedback/KapiOfflineBanner.js +8 -8
  36. package/dist/components/feedback/KapiToastContainer.js +25 -25
  37. package/dist/components/feedback/KapiTour.d.ts +2 -1
  38. package/dist/components/feedback/KapiTour.js +35 -35
  39. package/dist/components/inputs/KapiAutocomplete.js +14 -14
  40. package/dist/components/inputs/KapiButton.d.ts +17 -1
  41. package/dist/components/inputs/KapiButton.js +41 -25
  42. package/dist/components/inputs/KapiCalendar.js +5 -5
  43. package/dist/components/inputs/KapiCalendarGrid.js +10 -10
  44. package/dist/components/inputs/KapiChecklist.js +71 -71
  45. package/dist/components/inputs/KapiDatePicker.js +124 -122
  46. package/dist/components/inputs/KapiDateRangePicker.js +138 -136
  47. package/dist/components/inputs/KapiFacetedSearch.js +29 -29
  48. package/dist/components/inputs/KapiField.js +14 -14
  49. package/dist/components/inputs/KapiFileUpload.js +27 -27
  50. package/dist/components/inputs/KapiIconButton.d.ts +9 -1
  51. package/dist/components/inputs/KapiIconButton.js +27 -10
  52. package/dist/components/inputs/KapiInput.js +21 -21
  53. package/dist/components/inputs/KapiInputGroup.js +8 -8
  54. package/dist/components/inputs/KapiMaskedInput.d.ts +8 -3
  55. package/dist/components/inputs/KapiMaskedInput.js +64 -51
  56. package/dist/components/inputs/KapiNumberStepper.js +29 -29
  57. package/dist/components/inputs/KapiRating.js +61 -59
  58. package/dist/components/inputs/KapiSearchChip.js +8 -8
  59. package/dist/components/inputs/KapiSegmented.js +74 -64
  60. package/dist/components/inputs/KapiSelect.js +232 -222
  61. package/dist/components/inputs/KapiSelectMenu.js +60 -60
  62. package/dist/components/inputs/KapiSlider.js +1 -1
  63. package/dist/components/inputs/KapiSwitch.js +6 -6
  64. package/dist/components/inputs/KapiTagInput.js +83 -81
  65. package/dist/components/inputs/KapiTextarea.js +8 -8
  66. package/dist/components/inputs/misuseWarnings.d.ts +37 -0
  67. package/dist/components/inputs/misuseWarnings.js +36 -0
  68. package/dist/components/inputs/numberStepLogic.d.ts +10 -0
  69. package/dist/components/inputs/numberStepLogic.js +16 -7
  70. package/dist/components/inputs/ownField.js +4 -4
  71. package/dist/components/layout/KapiAccountMenu.d.ts +2 -1
  72. package/dist/components/layout/KapiAccountMenu.js +53 -53
  73. package/dist/components/layout/KapiContextSlot.js +35 -35
  74. package/dist/components/layout/KapiMasonry.js +6 -6
  75. package/dist/components/layout/KapiNotificationBell.js +60 -60
  76. package/dist/components/layout/KapiPageHeader.js +19 -19
  77. package/dist/components/layout/KapiRail.js +60 -60
  78. package/dist/components/layout/KapiRailAccount.js +9 -9
  79. package/dist/components/layout/KapiRoot.js +21 -21
  80. package/dist/components/layout/KapiScrollArea.js +11 -11
  81. package/dist/components/layout/KapiShell.js +12 -12
  82. package/dist/components/locale/KapiLocaleProvider.js +13 -13
  83. package/dist/components/navigation/CtxSlidingList.js +4 -4
  84. package/dist/components/navigation/KapiAccordion.js +12 -12
  85. package/dist/components/navigation/KapiBreadcrumb.js +11 -11
  86. package/dist/components/navigation/KapiCollapsiblePanel.js +23 -23
  87. package/dist/components/navigation/KapiContextPanel.js +76 -76
  88. package/dist/components/navigation/KapiFilterChips.js +9 -9
  89. package/dist/components/navigation/KapiNavBadge.d.ts +4 -2
  90. package/dist/components/navigation/KapiNavBadge.js +11 -10
  91. package/dist/components/navigation/KapiPanelGroup.js +25 -25
  92. package/dist/components/navigation/KapiSteps.js +4 -4
  93. package/dist/components/navigation/KapiTabs.d.ts +4 -1
  94. package/dist/components/navigation/KapiTabs.js +63 -55
  95. package/dist/components/navigation/KapiTree.js +75 -75
  96. package/dist/components/navigation/KapiWizard.d.ts +2 -1
  97. package/dist/components/navigation/KapiWizard.js +30 -30
  98. package/dist/components/overlays/KapiCanvasForm.d.ts +6 -2
  99. package/dist/components/overlays/KapiCanvasForm.js +12 -12
  100. package/dist/components/overlays/KapiCommandPalette.d.ts +2 -1
  101. package/dist/components/overlays/KapiCommandPalette.js +23 -23
  102. package/dist/components/overlays/KapiConfirm.d.ts +2 -1
  103. package/dist/components/overlays/KapiConfirm.js +12 -12
  104. package/dist/components/overlays/KapiContextMenu.d.ts +2 -1
  105. package/dist/components/overlays/KapiContextMenu.js +18 -18
  106. package/dist/components/overlays/KapiDialogHost.js +22 -22
  107. package/dist/components/overlays/KapiLoading.js +16 -16
  108. package/dist/components/overlays/KapiMenuButton.js +15 -15
  109. package/dist/components/overlays/KapiModal.d.ts +2 -1
  110. package/dist/components/overlays/KapiModal.js +28 -28
  111. package/dist/components/overlays/KapiOffcanvas.d.ts +3 -2
  112. package/dist/components/overlays/KapiOffcanvas.js +63 -63
  113. package/dist/components/overlays/KapiOffcanvasStack.js +38 -38
  114. package/dist/components/overlays/KapiPhotoView.js +15 -15
  115. package/dist/components/overlays/KapiPopover.d.ts +2 -1
  116. package/dist/components/overlays/KapiPopover.js +10 -10
  117. package/dist/components/overlays/KapiShapeSheet.js +20 -20
  118. package/dist/components/overlays/KapiSplitModal.js +29 -29
  119. package/dist/components/overlays/KapiTooltip.js +21 -21
  120. package/dist/components/overlays/menuList.js +60 -60
  121. package/dist/components/renderSlot.d.ts +27 -0
  122. package/dist/components/renderSlot.js +23 -0
  123. package/dist/css/components/chat/chat.css +1 -1
  124. package/dist/hooks/portalRoot.js +6 -6
  125. package/dist/hooks/useControllableState.d.ts +6 -2
  126. package/dist/hooks/useControllableState.js +14 -11
  127. package/dist/hooks/useFormReset.d.ts +22 -0
  128. package/dist/hooks/useFormReset.js +17 -0
  129. package/dist/index.d.ts +2 -0
  130. package/dist/kapi.css +1 -1
  131. package/dist/kapi.layered.css +1 -1
  132. package/package.json +5 -2
@@ -2,8 +2,8 @@
2
2
  import { useLabels as e } from "../locale/KapiLocaleProvider.js";
3
3
  import { computePagination as t } from "./tableLogic.js";
4
4
  import { KapiPaginationFooter as n } from "./KapiPaginationFooter.js";
5
- import { jsx as r } from "react/jsx-runtime";
6
- import { useEffect as i } from "react";
5
+ import { useEffect as r } from "react";
6
+ import { jsx as i } from "react/jsx-runtime";
7
7
  //#region src/components/data/KapiPagination.tsx
8
8
  var a = {
9
9
  rowsPerPage: "Filas por página",
@@ -20,14 +20,14 @@ function o({ page: o, pageSize: s, total: c, onPageChange: l, pageSizeOptions: u
20
20
  pageSize: s,
21
21
  total: c
22
22
  });
23
- return i(() => {
23
+ return r(() => {
24
24
  c > 0 && v.page !== o && l(v.page);
25
25
  }, [
26
26
  c,
27
27
  v.page,
28
28
  o,
29
29
  l
30
- ]), /* @__PURE__ */ r(n, {
30
+ ]), /* @__PURE__ */ i(n, {
31
31
  ...g,
32
32
  as: "nav",
33
33
  className: m,
@@ -6,8 +6,8 @@ import { chartVars as n } from "./chartFrame.js";
6
6
  import { areaPath as r, linePath as i, linePoints as a } from "./lineChartLogic.js";
7
7
  import { sparklineLabel as o, sparklineMax as s } from "./sparklineLogic.js";
8
8
  /* empty css */
9
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
9
  import "react";
10
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
11
11
  //#region src/components/data/KapiSparkline.tsx
12
12
  var u = {
13
13
  trend: "Tendencia",
@@ -2,9 +2,9 @@
2
2
  import "#kapi-css/components/inputs/checkControl.css";
3
3
  import "#kapi-css/components/overlays/overlays.css";
4
4
  import "#kapi-css/components/data/KapiTable.css";
5
- import { useKapiFormatLocale as e, useKapiLocale as t, useLabels as n } from "../locale/KapiLocaleProvider.js";
5
+ import { joinClasses as e } from "../rootProps.js";
6
+ import { useKapiFormatLocale as t, useKapiLocale as n, useLabels as r } from "../locale/KapiLocaleProvider.js";
6
7
  /* empty css */
7
- import { joinClasses as r } from "../rootProps.js";
8
8
  import { useControllableState as i } from "../../hooks/useControllableState.js";
9
9
  import { useVirtualList as ee } from "../../hooks/useVirtualList.js";
10
10
  /* empty css */
@@ -29,21 +29,21 @@ import { TableDatasetNotice as Ye, useTableSelection as Xe } from "./useTableSel
29
29
  import { headerMenuItems as Ze } from "./tableHeaderMenu.js";
30
30
  import { useShallowStable as a } from "../../hooks/shallowStable.js";
31
31
  import { TableRow as Qe } from "./KapiTableRow.js";
32
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
33
- import { useEffect as $e, useLayoutEffect as et, useMemo as c, useRef as l, useState as u } from "react";
32
+ import { useEffect as $e, useLayoutEffect as et, useMemo as o, useRef as s, useState as c } from "react";
33
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
34
34
  import { RefreshCw as tt } from "lucide-react";
35
35
  //#region src/components/data/KapiTable.tsx
36
36
  var nt = 600, d = 46, rt = 5, it = {
37
37
  text: "",
38
38
  column: null
39
39
  }, at = [];
40
- function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh", fill: lt = !1, bulkActionsPlacement: ut = "bottom", className: dt, style: ft, id: pt, ref: mt, labels: ht, actions: gt, rowMenu: m, contextMenu: h, onCopy: _t, selectable: g = !1, rowSelect: vt = !1, rowLabel: yt, selectedIds: bt, defaultSelectedIds: xt, onSelectedIdsChange: St, bulkActions: Ct, rangeSelect: wt = !0, selectionPresets: Tt, virtual: _ = !1, rowHeight: Et = d, estimatedRowHeight: Dt = d, sort: Ot, defaultSort: kt = null, onSortChange: At, manualSort: jt = !1, pagination: v, dataset: y, loading: b = !1, loadingRows: Mt = rt, card: Nt = !1, emptyMessage: Pt, loadingMessage: Ft, isRowSelectable: It, renderSubComponent: Lt, expandedIds: Rt, defaultExpandedIds: zt, onExpandedIdsChange: Bt, density: Vt = "default", rowHover: Ht = !1, columnToggle: Ut = !1, columnVisibility: Wt, defaultColumnVisibility: Gt, onColumnVisibilityChange: Kt, columnPinning: x = !1, pinnedColumns: qt, defaultPinnedColumns: Jt, onPinnedColumnsChange: Yt, headerMenu: Xt = !1, resizableColumns: Zt = !1, columnWidths: Qt, defaultColumnWidths: $t, onColumnWidthsChange: en, filterable: tn = !1, filter: nn, defaultFilter: rn = it, onFilterChange: an, manualFilter: on = !1, filterDebounce: sn = 300, exportCsv: cn, toolbar: S, toolbarActions: ln, onRefresh: C, mobileCards: un = !1, onRowClick: dn, getRowProps: fn }) {
41
- let w = a(ot), T = n("table", Ne, a(ht)), pn = Pt === void 0 ? T.empty : Pt, mn = Ft === void 0 ? T.loading : Ft, hn = t(), gn = e(), [_n, vn] = u(null), [E, yn] = u(null), [D, bn] = u(null), O = Oe({
42
- onMenu: h || C ? (e, t) => vn({
40
+ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh", fill: lt = !1, bulkActionsPlacement: ut = "bottom", className: dt, style: ft, id: pt, ref: mt, labels: ht, actions: gt, rowMenu: m, contextMenu: h, onCopy: _t, selectable: g = !1, rowSelect: vt = !1, rowLabel: yt, selectedIds: bt, defaultSelectedIds: xt, onSelectedIdsChange: St, bulkActions: Ct, rangeSelect: wt = !0, selectionPresets: Tt, virtual: _ = !1, rowHeight: Et = d, estimatedRowHeight: Dt = d, sort: Ot, defaultSort: kt = null, onSortChange: At, manualSort: jt = !1, pagination: v, dataset: Mt, loading: y = !1, loadingRows: Nt = rt, card: Pt = !1, emptyMessage: Ft, loadingMessage: It, isRowSelectable: Lt, renderSubComponent: Rt, expandedIds: zt, defaultExpandedIds: Bt, onExpandedIdsChange: Vt, density: Ht = "default", rowHover: Ut = !1, columnToggle: Wt = !1, columnVisibility: Gt, defaultColumnVisibility: Kt, onColumnVisibilityChange: qt, columnPinning: Jt = !1, pinnedColumns: Yt, defaultPinnedColumns: Xt, onPinnedColumnsChange: Zt, headerMenu: Qt = !1, resizableColumns: $t = !1, columnWidths: en, defaultColumnWidths: tn, onColumnWidthsChange: nn, filterable: rn = !1, filter: an, defaultFilter: on = it, onFilterChange: sn, manualFilter: b = !1, filterDebounce: cn = 300, exportCsv: ln, toolbar: x, toolbarActions: un, onRefresh: S, mobileCards: dn = !1, onRowClick: fn, getRowProps: pn }) {
41
+ let C = a(ot), w = r("table", Ne, a(ht)), mn = Ft === void 0 ? w.empty : Ft, hn = It === void 0 ? w.loading : It, gn = n(), _n = t(), [T, vn] = c(null), [E, yn] = c(null), [D, bn] = c(null), O = Oe({
42
+ onMenu: h || S ? (e, t) => vn({
43
43
  x: e,
44
44
  y: t
45
45
  }) : void 0,
46
- zoneMenu: Xt ? {
46
+ zoneMenu: Qt ? {
47
47
  selector: "thead th[data-col]",
48
48
  onMenu: (e, t, n) => {
49
49
  let r = e.getAttribute("data-col");
@@ -63,31 +63,31 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
63
63
  }
64
64
  }
65
65
  } : void 0
66
- }), xn = ke(), [k, Sn] = i(Ot, kt, At), Cn = (e) => Sn(fe(k, e)), A = _ && Et === "auto", wn = Et === "auto" ? void 0 : Et, j = !!Lt && (!_ || A), [Tn, En] = i(Rt, zt ?? at, Bt && ((e) => Bt([...e]))), Dn = c(() => new Set(Tn), [Tn]), On = (e) => En([...Ce(Dn, e)]), [M, kn] = i(Wt, Gt ?? {}, Kt), An = (e) => kn(Se(M, e)), jn = (e) => {
66
+ }), xn = ke(), [k, Sn] = i(Ot, kt, At), Cn = (e) => Sn(fe(k, e)), A = _ && Et === "auto", wn = Et === "auto" ? void 0 : Et, j = !!Rt && (!_ || A), [Tn, En] = i(zt, Bt ?? at, Vt && ((e) => Vt([...e]))), Dn = o(() => new Set(Tn), [Tn]), On = (e) => En([...Ce(Dn, e)]), [M, kn] = i(Gt, Kt ?? {}, qt), An = (e) => kn(Se(M, e)), jn = (e) => {
67
67
  let t = new Set(e), n = { ...M };
68
- w.forEach((e) => {
68
+ C.forEach((e) => {
69
69
  e.hideable !== !1 && (n[e.key] = t.has(e.key));
70
70
  }), kn(n);
71
- }, [Mn, Nn] = i(Qt, $t ?? {}, en), N = a(Mn), Pn = l(null), Fn = x || qt !== void 0 || Jt !== void 0, [P, In] = i(qt, () => Jt ?? ve(w), Yt), Ln = (e, t) => In(ge(P, e, t)), Rn = c(() => Fn ? pe(w, P) : w, [
71
+ }, [Mn, Nn] = i(en, tn ?? {}, nn), N = a(Mn), Pn = s(null), Fn = Jt || Yt !== void 0 || Xt !== void 0, [P, In] = i(Yt, () => Xt ?? ve(C), Zt), Ln = (e, t) => In(ge(P, e, t)), Rn = o(() => Fn ? pe(C, P) : C, [
72
72
  Fn,
73
- w,
73
+ C,
74
74
  P
75
- ]), F = a(c(() => we(Rn, M), [Rn, M])), [I, zn] = i(nn, rn, an), Bn = c(() => {
76
- if (on) return f;
75
+ ]), F = a(o(() => we(Rn, M), [Rn, M])), [I, zn] = i(an, on, sn), Bn = o(() => {
76
+ if (b) return f;
77
77
  let e = le(F, I.column);
78
78
  return ce(f, (t) => e.map((e) => e.filterValue ? e.filterValue(t) : me(t, e.key)), I.text);
79
79
  }, [
80
80
  f,
81
81
  F,
82
82
  I,
83
- on
84
- ]), L = c(() => jt ? Bn : _e(Bn, w, k, hn), [
83
+ b
84
+ ]), L = o(() => jt ? Bn : _e(Bn, C, k, gn), [
85
85
  Bn,
86
- w,
86
+ C,
87
87
  k,
88
88
  jt,
89
- hn
90
- ]), R = Ke(v) ? v : void 0, z = Ke(v) ? void 0 : v, [B, V] = i(R?.page, R?.defaultPage ?? 1, R?.onPageChange), [Vn, Hn] = i(R?.pageSize, R?.defaultPageSize ?? 10, R?.onPageSizeChange), H = `${I.column ?? ""}\u0000${I.text}`, Un = l(H), Wn = R !== void 0 && Un.current !== H, U = c(() => R ? Ge(L, Wn ? 1 : B, Vn) : null, [
89
+ gn
90
+ ]), R = Ke(v) ? v : void 0, z = Ke(v) ? void 0 : v, [B, V] = i(R?.page, R?.defaultPage ?? 1, R?.onPageChange), [Vn, Hn] = i(R?.pageSize, R?.defaultPageSize ?? 10, R?.onPageSizeChange), H = `${I.column ?? ""}\u0000${I.text}`, Un = s(H), Wn = R !== void 0 && Un.current !== H, U = o(() => R ? Ge(L, Wn ? 1 : B, Vn) : null, [
91
91
  R !== void 0,
92
92
  L,
93
93
  Wn,
@@ -105,7 +105,7 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
105
105
  }
106
106
  },
107
107
  showEdges: R.showEdges
108
- } : z ?? null, Gn = U && U.info.page !== B && (!b || Wn) ? U.info.page : null, Kn = l(V);
108
+ } : z ?? null, Gn = U && U.info.page !== B && (!y || Wn) ? U.info.page : null, Kn = s(V);
109
109
  Kn.current = V, $e(() => {
110
110
  Un.current = H, Gn !== null && Kn.current(Gn);
111
111
  }, [H, Gn]);
@@ -116,13 +116,13 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
116
116
  selectedIds: bt,
117
117
  defaultSelectedIds: xt,
118
118
  onSelectedIdsChange: St,
119
- isRowSelectable: It,
119
+ isRowSelectable: Lt,
120
120
  selectionPresets: Tt,
121
121
  rangeSelect: wt,
122
- dataset: y,
123
- loadingLabel: T.loading,
124
- locale: hn
125
- }), nr = Zn ? 80 : 46, rr = c(() => re(F.map((e) => ({
122
+ dataset: Mt,
123
+ loadingLabel: w.loading,
124
+ locale: gn
125
+ }), nr = Zn ? 80 : 46, rr = o(() => re(F.map((e) => ({
126
126
  sticky: e.sticky,
127
127
  width: se(e, N)
128
128
  })), (g ? nr : 0) + (j ? 44 : 0)), [
@@ -131,7 +131,7 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
131
131
  g,
132
132
  nr,
133
133
  j
134
- ]), q = !!(gt || m), ir = c(() => F.some((e) => ye(e.sticky) === "right"), [F]), ar = l(null), [or, sr] = u(0);
134
+ ]), q = !!(gt || m), ir = o(() => F.some((e) => ye(e.sticky) === "right"), [F]), ar = s(null), [or, sr] = c(0);
135
135
  et(() => {
136
136
  let e = ar.current;
137
137
  if (!e || !ir) return;
@@ -143,14 +143,14 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
143
143
  let n = new ResizeObserver(t);
144
144
  return n.observe(e), () => n.disconnect();
145
145
  }, [ir, q]);
146
- let cr = q ? or : 0, lr = c(() => ie(F.map((e) => ({
146
+ let cr = q ? or : 0, lr = o(() => ie(F.map((e) => ({
147
147
  sticky: e.sticky,
148
148
  width: se(e, N)
149
149
  })), cr), [
150
150
  F,
151
151
  N,
152
152
  cr
153
- ]), J = c(() => ({
153
+ ]), J = o(() => ({
154
154
  lefts: rr,
155
155
  rights: lr,
156
156
  lastLeft: de(F),
@@ -162,14 +162,14 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
162
162
  ]), Y = D ? F.find((e) => e.key === D.key) : void 0, ur = Y ? Ze(Y, {
163
163
  sort: k,
164
164
  pinned: P,
165
- canPin: x,
166
- canHide: Ut,
165
+ canPin: Jt,
166
+ canHide: Wt,
167
167
  visibleCount: F.length,
168
- text: T,
168
+ text: w,
169
169
  onSort: Sn,
170
170
  onPin: Ln,
171
171
  onHide: An
172
- }) : [], X = F.length + +!!g + +!!q + +!!j, dr = c(() => A ? W.map((e) => e[p]) : void 0, [
172
+ }) : [], X = F.length + +!!g + +!!q + +!!j, dr = o(() => A ? W.map((e) => e[p]) : void 0, [
173
173
  A,
174
174
  W,
175
175
  p
@@ -192,7 +192,7 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
192
192
  ]);
193
193
  let Sr = (e) => {
194
194
  _ && xr(), br(e.currentTarget);
195
- }, Cr = l(!0);
195
+ }, Cr = s(!0);
196
196
  $e(() => {
197
197
  if (Cr.current) {
198
198
  Cr.current = !1;
@@ -205,10 +205,10 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
205
205
  I.column,
206
206
  O
207
207
  ]);
208
- let wr = typeof cn == "object" ? cn : {}, Tr = () => {
208
+ let wr = typeof ln == "object" ? ln : {}, Tr = () => {
209
209
  let e = F.map(oe), t = wr.rows, n = (t === void 0 ? L : typeof t == "function" ? t() : t).map((e) => F.map((t) => t.csvValue ? t.csvValue(e) : t.copyValue ? t.copyValue(e) : me(e, t.key)));
210
210
  De(new Blob([`\uFEFF${te(e, n, wr.separator)}`], { type: "text/csv;charset=utf-8" }), ae(wr.fileName));
211
- }, Er = un && !_, Dr = (e, t) => {
211
+ }, Er = dn && !_, Dr = (e, t) => {
212
212
  if (!m) return;
213
213
  let n = e.currentTarget.getBoundingClientRect();
214
214
  yn({
@@ -216,21 +216,21 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
216
216
  y: n.bottom + 4,
217
217
  items: m(t)
218
218
  });
219
- }, Q = l({
219
+ }, Q = s({
220
220
  activateRow: tr,
221
221
  toggleExpanded: On,
222
222
  openRowMenu: Dr,
223
- onRowClick: dn,
223
+ onRowClick: fn,
224
224
  onCopy: _t
225
225
  });
226
226
  Q.current = {
227
227
  activateRow: tr,
228
228
  toggleExpanded: On,
229
229
  openRowMenu: Dr,
230
- onRowClick: dn,
230
+ onRowClick: fn,
231
231
  onCopy: _t
232
232
  };
233
- let Or = c(() => ({
233
+ let Or = o(() => ({
234
234
  activate: (e, t) => Q.current.activateRow(e, t),
235
235
  toggleExpanded: (e) => Q.current.toggleExpanded(e),
236
236
  openMenu: (e, t) => Q.current.openRowMenu(e, t),
@@ -247,27 +247,27 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
247
247
  rights: lr,
248
248
  offset: (g ? nr : 0) + (j ? 44 : 0),
249
249
  rightEnd: cr,
250
- resizableColumns: Zt,
251
- resizeLabel: T.resizeColumn
252
- }), $ = U ? U.info : z ? ne(z) : null, Ar = z && $ && !b && z.total > 0 && $.page !== z.page ? $.page : null, jr = l(z?.onPageChange);
250
+ resizableColumns: $t,
251
+ resizeLabel: w.resizeColumn
252
+ }), $ = U ? U.info : z ? ne(z) : null, Ar = z && $ && !y && z.total > 0 && $.page !== z.page ? $.page : null, jr = s(z?.onPageChange);
253
253
  jr.current = z?.onPageChange, $e(() => {
254
254
  Ar !== null && jr.current?.(Ar);
255
255
  }, [Ar]);
256
- let Mr = Array.from({ length: Mt }, (e, t) => /* @__PURE__ */ s("tr", {
256
+ let Mr = Array.from({ length: Nt }, (e, t) => /* @__PURE__ */ u("tr", {
257
257
  className: "kapi-table-skrow",
258
258
  "aria-hidden": !0,
259
259
  children: [
260
- g && /* @__PURE__ */ o("td", {
260
+ g && /* @__PURE__ */ l("td", {
261
261
  className: "is-sticky kapi-cbcol",
262
262
  style: { insetInlineStart: 0 },
263
- children: /* @__PURE__ */ o(Ae, {
263
+ children: /* @__PURE__ */ l(Ae, {
264
264
  width: 16,
265
265
  height: 16,
266
266
  radius: 5
267
267
  })
268
268
  }),
269
- j && /* @__PURE__ */ o("td", { className: "kapi-expandcol" }),
270
- F.map((e, n) => /* @__PURE__ */ o("td", {
269
+ j && /* @__PURE__ */ l("td", { className: "kapi-expandcol" }),
270
+ F.map((e, n) => /* @__PURE__ */ l("td", {
271
271
  "data-col": e.key,
272
272
  className: Ie(e, n, J),
273
273
  style: {
@@ -276,9 +276,9 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
276
276
  },
277
277
  children: Be(e, n, t)
278
278
  }, e.key)),
279
- q && /* @__PURE__ */ o("td", {
279
+ q && /* @__PURE__ */ l("td", {
280
280
  className: Pe(J),
281
- children: /* @__PURE__ */ o(Ae, {
281
+ children: /* @__PURE__ */ l(Ae, {
282
282
  width: 28,
283
283
  height: 14,
284
284
  radius: 6,
@@ -286,7 +286,7 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
286
286
  })
287
287
  })
288
288
  ]
289
- }, `sk-${t}`)), Nr = g && Ct && K.length > 0 ? /* @__PURE__ */ o(je, {
289
+ }, `sk-${t}`)), Nr = g && Ct && K.length > 0 ? /* @__PURE__ */ l(je, {
290
290
  count: K.length,
291
291
  onClear: Yn,
292
292
  placement: ut,
@@ -296,7 +296,7 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
296
296
  })
297
297
  }) : null, Pr = () => ({
298
298
  columns: [...F],
299
- hiddenColumns: w.filter((e) => M[e.key] === !1).map((e) => e.key),
299
+ hiddenColumns: C.filter((e) => M[e.key] === !1).map((e) => e.key),
300
300
  columnWidths: { ...N },
301
301
  pinnedColumns: {
302
302
  left: [...P.left],
@@ -312,56 +312,56 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
312
312
  total: G.total
313
313
  } : null
314
314
  }), Fr = (e, t) => xn.run(e, (e) => t(Pr(), { signal: e })), Ir = xn.isPending(st), Lr = () => {
315
- C && Fr(st, C);
316
- }, Rr = [...h ?? [], ...C ? [...h && h.length > 0 ? [{ sep: !0 }] : [], {
317
- label: T.refresh,
318
- icon: /* @__PURE__ */ o(tt, { size: 16 }),
315
+ S && Fr(st, S);
316
+ }, Rr = [...h ?? [], ...S ? [...h && h.length > 0 ? [{ sep: !0 }] : [], {
317
+ label: w.refresh,
318
+ icon: /* @__PURE__ */ l(tt, { size: 16 }),
319
319
  disabled: Ir,
320
320
  onClick: Lr
321
- }] : []], zr = typeof S == "function" ? S(Pr()) : S;
322
- return /* @__PURE__ */ s("div", {
321
+ }] : []], zr = typeof x == "function" ? x(Pr()) : x;
322
+ return /* @__PURE__ */ u("div", {
323
323
  ref: mt,
324
324
  id: pt,
325
325
  style: ft,
326
- className: r("kapi-table-shell", Nt && "kapi-table-shell--card", lt && "kapi-table-shell--fill", Er && "kapi-table-shell--cards", dt),
326
+ className: e("kapi-table-shell", Pt && "kapi-table-shell--card", lt && "kapi-table-shell--fill", Er && "kapi-table-shell--cards", dt),
327
327
  children: [
328
328
  ut === "top" && Nr,
329
- /* @__PURE__ */ o(Je, {
330
- text: T,
331
- filterable: tn,
329
+ /* @__PURE__ */ l(Je, {
330
+ text: w,
331
+ filterable: rn,
332
332
  filter: I,
333
333
  onFilterChange: zn,
334
334
  visibleColumns: F,
335
- manualFilter: on,
336
- filterDebounce: sn,
335
+ manualFilter: b,
336
+ filterDebounce: cn,
337
337
  shownCount: L.length,
338
338
  totalCount: f.length,
339
339
  content: zr,
340
- toolbarActions: ln,
340
+ toolbarActions: un,
341
341
  isPending: xn.isPending,
342
342
  context: Pr,
343
343
  onRun: Fr,
344
- refresh: C ? Lr : void 0,
344
+ refresh: S ? Lr : void 0,
345
345
  refreshing: Ir,
346
- onExportCsv: cn ? Tr : void 0,
347
- columns: w,
348
- columnToggle: Ut,
349
- columnPinning: x,
346
+ onExportCsv: ln ? Tr : void 0,
347
+ columns: C,
348
+ columnToggle: Wt,
349
+ columnPinning: Jt,
350
350
  visibility: M,
351
351
  onShownColumnsChange: jn,
352
352
  pinned: P,
353
353
  onPinnedChange: In
354
354
  }),
355
- y !== void 0 && g && /* @__PURE__ */ o(Ye, {
356
- dataset: y,
355
+ Mt !== void 0 && g && /* @__PURE__ */ l(Ye, {
356
+ dataset: Mt,
357
357
  notice: er,
358
358
  shown: Xn.length,
359
- clearLabel: T.datasetClear,
360
- labels: T,
361
- locale: gn
359
+ clearLabel: w.datasetClear,
360
+ labels: w,
361
+ locale: _n
362
362
  }),
363
- /* @__PURE__ */ s("div", {
364
- className: r(be({
363
+ /* @__PURE__ */ u("div", {
364
+ className: e(be({
365
365
  cortaDerecha: vr,
366
366
  cortaIzquierda: yr,
367
367
  rightEdge: q || ir
@@ -371,78 +371,78 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
371
371
  style: lt ? void 0 : { maxHeight: ct },
372
372
  onScroll: Sr,
373
373
  children: [
374
- /* @__PURE__ */ s("table", {
374
+ /* @__PURE__ */ u("table", {
375
375
  ref: Pn,
376
- className: `kapi-table2${_ ? A ? " is-virtual-auto" : " is-virtual" : ""}${Vt === "card" ? " kapi-table2--card" : ""}${Ht ? " kapi-table2--hover" : ""}`,
377
- children: [/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ s("tr", { children: [
378
- g && /* @__PURE__ */ s("th", {
376
+ className: `kapi-table2${_ ? A ? " is-virtual-auto" : " is-virtual" : ""}${Ht === "card" ? " kapi-table2--card" : ""}${Ut ? " kapi-table2--hover" : ""}`,
377
+ children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", { children: [
378
+ g && /* @__PURE__ */ u("th", {
379
379
  className: `is-sticky kapi-cbcol${Zn ? " kapi-cbcol--presets" : ""}`,
380
380
  style: { insetInlineStart: 0 },
381
- children: [/* @__PURE__ */ o("label", {
381
+ children: [/* @__PURE__ */ l("label", {
382
382
  className: "kapi-check kapi-check--block",
383
- children: /* @__PURE__ */ o("input", {
383
+ children: /* @__PURE__ */ l("input", {
384
384
  type: "checkbox",
385
385
  checked: $n === "all",
386
386
  ref: (e) => {
387
387
  e && (e.indeterminate = $n === "some");
388
388
  },
389
389
  onChange: () => Jn(xe(qn, Xn)),
390
- "aria-label": T.selectAll
390
+ "aria-label": w.selectAll
391
391
  })
392
- }), Zn && /* @__PURE__ */ o(Ee, {
392
+ }), Zn && /* @__PURE__ */ l(Ee, {
393
393
  label: null,
394
- "aria-label": T.selectMatching,
394
+ "aria-label": w.selectMatching,
395
395
  variant: "ghost",
396
396
  items: Qn
397
397
  })]
398
398
  }),
399
- j && /* @__PURE__ */ o("th", {
399
+ j && /* @__PURE__ */ l("th", {
400
400
  className: "kapi-expandcol",
401
- children: /* @__PURE__ */ o("span", {
401
+ children: /* @__PURE__ */ l("span", {
402
402
  className: "kapi-sr-only",
403
- children: T.expandColumn
403
+ children: w.expandColumn
404
404
  })
405
405
  }),
406
- F.map((e, t) => /* @__PURE__ */ s("th", {
407
- "data-col": e.key,
408
- className: r(Ie(e, t, J), e.sortable && "is-sortable"),
409
- "aria-sort": Fe(e, k),
406
+ F.map((t, n) => /* @__PURE__ */ u("th", {
407
+ "data-col": t.key,
408
+ className: e(Ie(t, n, J), t.sortable && "is-sortable"),
409
+ "aria-sort": Fe(t, k),
410
410
  style: {
411
- ...He(t, J),
412
- ...Re(e, "th", N),
413
- textAlign: Le(e.align)
411
+ ...He(n, J),
412
+ ...Re(t, "th", N),
413
+ textAlign: Le(t.align)
414
414
  },
415
- children: [ze(e, k, Cn, T), kr(e)]
416
- }, e.key)),
417
- q && /* @__PURE__ */ o("th", {
415
+ children: [ze(t, k, Cn, w), kr(t)]
416
+ }, t.key)),
417
+ q && /* @__PURE__ */ l("th", {
418
418
  ref: ar,
419
419
  className: Pe(J),
420
- children: T.actions
420
+ children: w.actions
421
421
  })
422
- ] }) }), /* @__PURE__ */ s("tbody", { children: [
423
- b && (Mt > 0 ? Mr : Ve(X, mn, !0)),
424
- !b && W.length === 0 && Ve(X, pn),
425
- !b && W.length > 0 && mr > 0 && /* @__PURE__ */ o("tr", {
422
+ ] }) }), /* @__PURE__ */ u("tbody", { children: [
423
+ y && (Nt > 0 ? Mr : Ve(X, hn, !0)),
424
+ !y && W.length === 0 && Ve(X, mn),
425
+ !y && W.length > 0 && mr > 0 && /* @__PURE__ */ l("tr", {
426
426
  "aria-hidden": !0,
427
427
  style: { height: mr },
428
- children: /* @__PURE__ */ o("td", {
428
+ children: /* @__PURE__ */ l("td", {
429
429
  colSpan: X,
430
430
  className: "kapi-table-pad"
431
431
  })
432
432
  }),
433
- !b && gr.map((e, t) => {
434
- let n = e[p], r = !It || It(e), i = _r + Z + t + 1;
435
- return /* @__PURE__ */ o(Qe, {
433
+ !y && gr.map((e, t) => {
434
+ let n = e[p], r = !Lt || Lt(e), i = _r + Z + t + 1;
435
+ return /* @__PURE__ */ l(Qe, {
436
436
  row: e,
437
437
  id: n,
438
438
  index: Z + t,
439
439
  selected: qn.has(n),
440
- selectLabel: g ? he(e, F, i, T, yt) : "",
440
+ selectLabel: g ? he(e, F, i, w, yt) : "",
441
441
  open: j && Dn.has(n),
442
442
  canSelect: r,
443
443
  clickSelect: g && vt && r,
444
- clickable: dn !== void 0,
445
- getRowProps: fn,
444
+ clickable: fn !== void 0,
445
+ getRowProps: pn,
446
446
  rangeSelect: wt,
447
447
  selectable: g,
448
448
  expandable: j,
@@ -451,41 +451,41 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
451
451
  columns: F,
452
452
  layout: J,
453
453
  widths: N,
454
- text: T,
454
+ text: w,
455
455
  hasActions: q,
456
456
  actions: gt,
457
457
  hasRowMenu: m !== void 0,
458
- renderSubComponent: Lt,
458
+ renderSubComponent: Rt,
459
459
  colSpan: X,
460
460
  handlers: Or
461
461
  }, n);
462
462
  }),
463
- !b && W.length > 0 && hr > 0 && /* @__PURE__ */ o("tr", {
463
+ !y && W.length > 0 && hr > 0 && /* @__PURE__ */ l("tr", {
464
464
  "aria-hidden": !0,
465
465
  style: { height: hr },
466
- children: /* @__PURE__ */ o("td", {
466
+ children: /* @__PURE__ */ l("td", {
467
467
  colSpan: X,
468
468
  className: "kapi-table-pad"
469
469
  })
470
470
  })
471
471
  ] })]
472
472
  }),
473
- _n && Rr.length > 0 && /* @__PURE__ */ o(Te, {
473
+ T && Rr.length > 0 && /* @__PURE__ */ l(Te, {
474
474
  open: !0,
475
- x: _n.x,
476
- y: _n.y,
475
+ x: T.x,
476
+ y: T.y,
477
477
  items: Rr,
478
478
  onClose: () => vn(null)
479
479
  }),
480
- D && Y && ur.length > 0 && /* @__PURE__ */ o(Te, {
480
+ D && Y && ur.length > 0 && /* @__PURE__ */ l(Te, {
481
481
  open: !0,
482
482
  x: D.x,
483
483
  y: D.y,
484
484
  items: ur,
485
- "aria-label": `${T.columnActions} ${typeof Y.label == "string" ? Y.label : Y.key}`,
485
+ "aria-label": `${w.columnActions} ${typeof Y.label == "string" ? Y.label : Y.key}`,
486
486
  onClose: () => bn(null)
487
487
  }),
488
- E && /* @__PURE__ */ o(Te, {
488
+ E && /* @__PURE__ */ l(Te, {
489
489
  open: !0,
490
490
  x: E.x,
491
491
  y: E.y,
@@ -495,7 +495,7 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
495
495
  ]
496
496
  }),
497
497
  ut === "bottom" && Nr,
498
- G && $ && /* @__PURE__ */ o(Me, {
498
+ G && $ && /* @__PURE__ */ l(Me, {
499
499
  as: "div",
500
500
  info: $,
501
501
  pageSize: G.pageSize,
@@ -504,7 +504,7 @@ function ot({ columns: ot, rows: f, keyField: p = "id", maxHeight: ct = "58vh",
504
504
  pageSizeOptions: G.pageSizeOptions,
505
505
  onPageSizeChange: G.onPageSizeChange,
506
506
  showEdges: G.showEdges ?? !0,
507
- labels: T
507
+ labels: w
508
508
  })
509
509
  ]
510
510
  });