@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
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/data/KapiTableFilter.css";
3
- import { KapiField as e } from "../inputs/KapiField.js";
4
- import { KapiInputGroup as t } from "../inputs/KapiInputGroup.js";
5
- import { useLabels as n } from "../locale/KapiLocaleProvider.js";
6
- import { KapiInput as r } from "../inputs/KapiInput.js";
7
- import { joinClasses as i } from "../rootProps.js";
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";
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";
10
10
  import { TABLE_FILTER_REGION as c } from "./tableLabels.js";
11
11
  /* empty css */
12
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
13
- import { useEffect as d, useId as f, useMemo as p, useRef as m, useState as h } from "react";
12
+ import { useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
13
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
14
14
  import { Search as g } from "lucide-react";
15
15
  //#region src/components/data/KapiTableFilter.tsx
16
16
  var _ = {
@@ -22,18 +22,18 @@ 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 = n("tableFilter", _, D), M = C ?? w ?? 0, N = p(() => o(x), [x]), [P, F] = h(c), I = m(c), [L, R] = h(c);
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);
26
26
  y(L, c) || (R(c), y(I.current, c) || F(c));
27
- let z = m(void 0);
28
- d(() => () => clearTimeout(z.current), []);
27
+ let z = f(void 0);
28
+ l(() => () => clearTimeout(z.current), []);
29
29
  let B = (e) => {
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 = f(), U = /* @__PURE__ */ u(t, {
33
+ }, H = u(), U = /* @__PURE__ */ h(n, {
34
34
  size: E,
35
35
  className: "kapi-tablefilter__group",
36
- children: [/* @__PURE__ */ l(a, {
36
+ children: [/* @__PURE__ */ m(a, {
37
37
  id: `${H}-col`,
38
38
  searchable: !1,
39
39
  "aria-label": j.filterColumn,
@@ -49,13 +49,13 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
49
49
  column: e === v ? null : e
50
50
  }, !0);
51
51
  }
52
- }), /* @__PURE__ */ l(r, {
52
+ }), /* @__PURE__ */ m(i, {
53
53
  id: H,
54
54
  type: "search",
55
55
  "aria-label": T == null ? j.filter : void 0,
56
56
  placeholder: j.filterPlaceholder,
57
57
  spellCheck: !1,
58
- startIcon: /* @__PURE__ */ l(g, {}),
58
+ startIcon: /* @__PURE__ */ m(g, {}),
59
59
  clearable: !0,
60
60
  value: P.text,
61
61
  onChange: (e) => V({
@@ -64,17 +64,17 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
64
64
  }, !1)
65
65
  })]
66
66
  });
67
- return /* @__PURE__ */ u("div", {
67
+ return /* @__PURE__ */ h("div", {
68
68
  ...A,
69
- className: i("kapi-tablefilter", O),
69
+ className: e("kapi-tablefilter", O),
70
70
  role: "search",
71
71
  "aria-label": k ?? j.region,
72
- children: [T == null ? U : /* @__PURE__ */ l(e, {
72
+ children: [T == null ? U : /* @__PURE__ */ m(t, {
73
73
  label: T,
74
74
  htmlFor: H,
75
75
  className: "kapi-tablefilter__field",
76
76
  children: U
77
- }), /* @__PURE__ */ l("span", {
77
+ }), /* @__PURE__ */ m("span", {
78
78
  className: "kapi-tablefilter__count",
79
79
  "aria-live": "polite",
80
80
  children: S && s(c) ? `${S.shown} ${j.of} ${S.total}` : ""
@@ -2,14 +2,14 @@
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 { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
6
- import { memo as l } from "react";
5
+ import { memo as o } from "react";
6
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
7
  import { ChevronDown as u, ChevronRight as d, MoreHorizontal as f } from "lucide-react";
8
8
  //#region src/components/data/KapiTableRow.tsx
9
9
  var p = "button, a, input, select, textarea, label, [role=button]";
10
- function m({ row: l, 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 }) {
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
11
  let R = b && !x, z = x ? (t) => {
12
- a(t.target, t.currentTarget, e(t.currentTarget)?.getSelection() ?? null) && L.rowClick(l, t);
12
+ a(t.target, t.currentTarget, e(t.currentTarget)?.getSelection() ?? null) && L.rowClick(o, t);
13
13
  } : R ? (e) => {
14
14
  e.target.closest(p) || L.activate(m, e.shiftKey);
15
15
  } : void 0, B = x ? (e) => {
@@ -21,10 +21,10 @@ function m({ row: l, id: m, index: h, selected: g, selectLabel: _, open: v, canS
21
21
  r({
22
22
  ...t,
23
23
  isComposing: e.nativeEvent.isComposing
24
- }) && (e.preventDefault(), L.rowClick(l, e));
24
+ }) && (e.preventDefault(), L.rowClick(o, e));
25
25
  } : void 0, V = R ? (e) => {
26
26
  C && e.shiftKey && e.preventDefault();
27
- } : void 0, H = i(S?.(l, h), {
27
+ } : void 0, H = i(S?.(o, h), {
28
28
  className: `${g ? "is-selected" : ""}${R ? " is-rowsel" : ""}${x ? " is-clickable" : ""}`.trim(),
29
29
  style: E === void 0 ? void 0 : { height: E },
30
30
  tabIndex: x ? 0 : void 0,
@@ -32,16 +32,16 @@ function m({ row: l, id: m, index: h, selected: g, selectLabel: _, open: v, canS
32
32
  onMouseDown: V,
33
33
  onKeyDown: B
34
34
  });
35
- return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("tr", {
35
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("tr", {
36
36
  ...H,
37
37
  "data-vindex": D,
38
38
  children: [
39
- w && /* @__PURE__ */ s("td", {
39
+ w && /* @__PURE__ */ c("td", {
40
40
  className: "is-sticky kapi-cbcol",
41
41
  style: { insetInlineStart: 0 },
42
- children: /* @__PURE__ */ s("label", {
42
+ children: /* @__PURE__ */ c("label", {
43
43
  className: "kapi-check kapi-check--block",
44
- children: /* @__PURE__ */ s("input", {
44
+ children: /* @__PURE__ */ c("input", {
45
45
  type: "checkbox",
46
46
  checked: g,
47
47
  disabled: !y,
@@ -53,35 +53,35 @@ function m({ row: l, id: m, index: h, selected: g, selectLabel: _, open: v, canS
53
53
  })
54
54
  })
55
55
  }),
56
- T && /* @__PURE__ */ s("td", {
56
+ T && /* @__PURE__ */ c("td", {
57
57
  className: "kapi-expandcol",
58
- children: /* @__PURE__ */ s("button", {
58
+ children: /* @__PURE__ */ c("button", {
59
59
  type: "button",
60
60
  className: "kapi-expandcol__btn",
61
61
  "aria-label": j.expandRow,
62
62
  "aria-expanded": v,
63
63
  onClick: () => L.toggleExpanded(m),
64
- children: v ? /* @__PURE__ */ s(u, {
64
+ children: v ? /* @__PURE__ */ c(u, {
65
65
  size: 16,
66
66
  strokeWidth: 2
67
- }) : /* @__PURE__ */ s(d, {
67
+ }) : /* @__PURE__ */ c(d, {
68
68
  className: "kapi-flip-rtl",
69
69
  size: 16,
70
70
  strokeWidth: 2
71
71
  })
72
72
  })
73
73
  }),
74
- O.map((e, t) => n(e, t, l, k, A, j, L.copy)),
75
- M && /* @__PURE__ */ s("td", {
74
+ O.map((e, t) => n(e, t, o, k, A, j, L.copy)),
75
+ M && /* @__PURE__ */ c("td", {
76
76
  className: t(k),
77
- children: /* @__PURE__ */ c("div", {
77
+ children: /* @__PURE__ */ l("div", {
78
78
  className: "kapi-actcol__in",
79
- children: [N ? N(l) : null, P && /* @__PURE__ */ s("button", {
79
+ children: [N ? N(o) : null, P && /* @__PURE__ */ c("button", {
80
80
  type: "button",
81
81
  className: "kapi-actcol__dots",
82
82
  "aria-label": j.moreActions,
83
- onClick: (e) => L.openMenu(e, l),
84
- children: /* @__PURE__ */ s(f, {
83
+ onClick: (e) => L.openMenu(e, o),
84
+ children: /* @__PURE__ */ c(f, {
85
85
  size: 16,
86
86
  strokeWidth: 2
87
87
  })
@@ -89,15 +89,15 @@ function m({ row: l, id: m, index: h, selected: g, selectLabel: _, open: v, canS
89
89
  })
90
90
  })
91
91
  ]
92
- }), v && F && /* @__PURE__ */ s("tr", {
92
+ }), v && F && /* @__PURE__ */ c("tr", {
93
93
  className: "kapi-subrow",
94
94
  "data-vindex": D,
95
- children: /* @__PURE__ */ s("td", {
95
+ children: /* @__PURE__ */ c("td", {
96
96
  colSpan: I,
97
- children: F(l)
97
+ children: F(o)
98
98
  })
99
99
  })] });
100
100
  }
101
- var h = l(m);
101
+ var h = o(m);
102
102
  //#endregion
103
103
  export { h as TableRow };
@@ -9,13 +9,13 @@ import { COLUMNS_PANEL_ESTIMATE as o, COLUMNS_PANEL_PLACEMENT as s, columnsPanel
9
9
  import { useFocusReturn as ee } from "../../hooks/useFocusReturn.js";
10
10
  import { KapiContextMenu as f } from "../overlays/KapiContextMenu.js";
11
11
  import { KapiTableFilter as p } from "./KapiTableFilter.js";
12
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
13
- import { useEffect as _, useLayoutEffect as v, useRef as y, useState as b } from "react";
14
- import { ChevronDown as x, Columns3 as te, Download as ne, Loader2 as S, RefreshCw as re, Search as ie } from "lucide-react";
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";
15
15
  //#region src/components/data/KapiTableToolbar.tsx
16
- var ae = (e) => e != null && typeof e != "boolean";
17
- function C({ text: e, filterable: f, filter: C, onFilterChange: w, visibleColumns: T, manualFilter: E, filterDebounce: se, shownCount: D, totalCount: O, content: k, toolbarActions: A, isPending: ce, 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] = b(!1), [U, W] = b(""), G = y(null), K = y(null), q = y(null), { restore: de } = ee(V, {
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, {
19
19
  container: K,
20
20
  target: G
21
21
  }), J = (e) => {
@@ -32,76 +32,76 @@ function C({ text: e, filterable: f, filter: C, onFilterChange: w, visibleColumn
32
32
  estimate: o,
33
33
  ...s,
34
34
  hideUntilPlaced: !1
35
- }), X = Y?.side === "top" ? "top" : "bottom", [pe, me] = b(560);
36
- v(() => {
35
+ }), X = Y?.side === "top" ? "top" : "bottom", [pe, me] = h(560);
36
+ ne(() => {
37
37
  let e = Y?.side, t = e ? G.current?.getBoundingClientRect() : void 0;
38
38
  e && t && me(c(e, t, r(G.current).height));
39
39
  }, [Y]);
40
40
  let he = () => H(!0);
41
- _(() => {
41
+ te(() => {
42
42
  V && K.current?.querySelector("input, [role=\"listbox\"]")?.focus();
43
43
  }, [V]);
44
44
  let Z = P.filter((e) => e.hideable !== !1), ge = P.length > 6, Q = (e) => ({
45
45
  id: e.key,
46
46
  label: e.label,
47
47
  text: l(e)
48
- }), $ = F && Z.length > 0 || I, _e = (A?.length ?? 0) > 0;
49
- return !f && !ae(k) && !_e && !j && !N && !$ ? null : /* @__PURE__ */ g("div", {
48
+ }), $ = F && Z.length > 0 || I, _e = (k?.length ?? 0) > 0;
49
+ return !f && !se(O) && !_e && !j && !N && !$ ? null : /* @__PURE__ */ v("div", {
50
50
  className: "kapi-tabletools",
51
51
  children: [
52
- f && /* @__PURE__ */ h(p, {
53
- value: C,
54
- onChange: w,
55
- columns: T,
56
- count: E ? void 0 : {
57
- shown: D,
58
- total: O
52
+ f && /* @__PURE__ */ _(p, {
53
+ value: x,
54
+ onChange: S,
55
+ columns: C,
56
+ count: w ? void 0 : {
57
+ shown: E,
58
+ total: D
59
59
  },
60
- loadDelay: E ? se : 0,
60
+ loadDelay: w ? T : 0,
61
61
  labels: e
62
62
  }),
63
- k,
64
- A?.map((e) => /* @__PURE__ */ h(oe, {
63
+ O,
64
+ k?.map((e) => /* @__PURE__ */ _(ce, {
65
65
  action: e,
66
- busy: ce(e.id),
66
+ busy: A(e.id),
67
67
  disabled: typeof e.disabled == "function" ? e.disabled(le()) : e.disabled === !0,
68
68
  onRun: (t) => ue(e.id, t)
69
69
  }, e.id)),
70
- j && /* @__PURE__ */ g("button", {
70
+ j && /* @__PURE__ */ v("button", {
71
71
  type: "button",
72
72
  className: "kapi-filterchip kapi-tabletools__chip--icon",
73
73
  "aria-busy": M || void 0,
74
74
  onClick: j,
75
- children: [M ? /* @__PURE__ */ h(S, {
75
+ children: [M ? /* @__PURE__ */ _(b, {
76
76
  size: 14,
77
77
  strokeWidth: 2.2,
78
78
  className: "kapi-table-spin",
79
79
  "aria-hidden": !0
80
- }) : /* @__PURE__ */ h(re, {
80
+ }) : /* @__PURE__ */ _(ae, {
81
81
  size: 14,
82
82
  strokeWidth: 2.2
83
- }), /* @__PURE__ */ h("span", {
83
+ }), /* @__PURE__ */ _("span", {
84
84
  className: "kapi-strong kapi-tabletools__label",
85
85
  children: e.refresh
86
86
  })]
87
87
  }),
88
- N && /* @__PURE__ */ g("button", {
88
+ N && /* @__PURE__ */ v("button", {
89
89
  type: "button",
90
90
  className: "kapi-filterchip kapi-tabletools__chip--icon",
91
91
  onClick: N,
92
- children: [/* @__PURE__ */ h(ne, {
92
+ children: [/* @__PURE__ */ _(ie, {
93
93
  size: 14,
94
94
  strokeWidth: 2.2
95
- }), /* @__PURE__ */ h("span", {
95
+ }), /* @__PURE__ */ _("span", {
96
96
  className: "kapi-strong kapi-tabletools__label",
97
97
  children: e.exportCsv
98
98
  })]
99
99
  }),
100
- $ && /* @__PURE__ */ g("div", {
100
+ $ && /* @__PURE__ */ v("div", {
101
101
  ref: q,
102
102
  className: "kapi-dropdown",
103
103
  onKeyDown: fe,
104
- children: [/* @__PURE__ */ g("button", {
104
+ children: [/* @__PURE__ */ v("button", {
105
105
  ref: G,
106
106
  type: "button",
107
107
  className: "kapi-filterchip kapi-tabletools__chip--icon",
@@ -109,38 +109,38 @@ function C({ text: e, filterable: f, filter: C, onFilterChange: w, visibleColumn
109
109
  "aria-haspopup": "dialog",
110
110
  "aria-expanded": V,
111
111
  children: [
112
- /* @__PURE__ */ h(te, {
112
+ /* @__PURE__ */ _(re, {
113
113
  size: 14,
114
114
  strokeWidth: 2.2
115
115
  }),
116
- /* @__PURE__ */ h("span", {
116
+ /* @__PURE__ */ _("span", {
117
117
  className: "kapi-strong kapi-tabletools__label",
118
118
  children: e.columns
119
119
  }),
120
- /* @__PURE__ */ h(x, {
120
+ /* @__PURE__ */ _(y, {
121
121
  size: 14,
122
122
  strokeWidth: 2.2,
123
123
  color: "var(--kapi-muted-2)",
124
124
  className: "kapi-tabletools__chevron"
125
125
  })
126
126
  ]
127
- }), V && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
127
+ }), V && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
128
128
  className: "kapi-dropdown__backdrop",
129
129
  onClick: () => J(!1)
130
- }), /* @__PURE__ */ g("div", {
130
+ }), /* @__PURE__ */ v("div", {
131
131
  ref: K,
132
132
  className: `kapi-menu kapi-dropdown__menu kapi-dropdown__menu--${X === "top" ? "up" : "down"} kapi-tabletools__menu kapi-tabletools__columns`,
133
133
  style: { maxHeight: pe },
134
134
  role: "dialog",
135
135
  "aria-label": e.columns,
136
136
  children: [
137
- ge && /* @__PURE__ */ h(t, {
137
+ ge && /* @__PURE__ */ _(t, {
138
138
  type: "search",
139
139
  className: "kapi-tabletools__colsearch",
140
140
  "aria-label": e.searchColumns,
141
141
  placeholder: e.searchColumns,
142
142
  spellCheck: !1,
143
- startIcon: /* @__PURE__ */ h(ie, {}),
143
+ startIcon: /* @__PURE__ */ _(oe, {}),
144
144
  clearable: !0,
145
145
  value: U,
146
146
  onChange: (e) => W(e.target.value),
@@ -148,7 +148,7 @@ function C({ text: e, filterable: f, filter: C, onFilterChange: w, visibleColumn
148
148
  (e.key === "ArrowDown" || e.key === "Enter") && (e.preventDefault(), K.current?.querySelector("[role=\"listbox\"]")?.focus());
149
149
  }
150
150
  }),
151
- F && /* @__PURE__ */ h(n, {
151
+ F && /* @__PURE__ */ _(n, {
152
152
  items: Z.map(Q),
153
153
  value: Z.filter((e) => L[e.key] !== !1).map((e) => e.key),
154
154
  onChange: R,
@@ -156,7 +156,7 @@ function C({ text: e, filterable: f, filter: C, onFilterChange: w, visibleColumn
156
156
  searchable: !1,
157
157
  ...I ? { label: e.showColumns } : { "aria-label": e.columns }
158
158
  }),
159
- I && ["left", "right"].map((t) => /* @__PURE__ */ h(n, {
159
+ I && ["left", "right"].map((t) => /* @__PURE__ */ _(n, {
160
160
  label: t === "left" ? e.pinColumns : e.pinColumnsRight,
161
161
  items: d(P, L).map(Q),
162
162
  value: z[t],
@@ -170,14 +170,14 @@ function C({ text: e, filterable: f, filter: C, onFilterChange: w, visibleColumn
170
170
  ]
171
171
  });
172
172
  }
173
- function oe({ action: t, busy: n, disabled: r, onRun: i }) {
174
- let [a, o] = b(null), s = n ? /* @__PURE__ */ h(S, {
173
+ function ce({ action: t, busy: n, disabled: r, onRun: i }) {
174
+ let [a, o] = h(null), s = n ? /* @__PURE__ */ _(b, {
175
175
  size: 14,
176
176
  strokeWidth: 2.2,
177
177
  className: "kapi-table-spin",
178
178
  "aria-hidden": !0
179
179
  }) : 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__ */ g("button", {
180
+ if (c === void 0) return /* @__PURE__ */ v("button", {
181
181
  type: "button",
182
182
  className: u,
183
183
  disabled: r,
@@ -185,7 +185,7 @@ function oe({ action: t, busy: n, disabled: r, onRun: i }) {
185
185
  onClick: () => {
186
186
  l && i(l);
187
187
  },
188
- children: [s, /* @__PURE__ */ h("span", {
188
+ children: [s, /* @__PURE__ */ _("span", {
189
189
  className: "kapi-strong kapi-tabletools__label",
190
190
  children: t.label
191
191
  })]
@@ -197,7 +197,7 @@ function oe({ action: t, busy: n, disabled: r, onRun: i }) {
197
197
  disabled: n || t.disabled === !0,
198
198
  onClick: () => i(t.onAction)
199
199
  });
200
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("button", {
200
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("button", {
201
201
  type: "button",
202
202
  className: u,
203
203
  disabled: r,
@@ -213,18 +213,18 @@ function oe({ action: t, busy: n, disabled: r, onRun: i }) {
213
213
  },
214
214
  children: [
215
215
  s,
216
- /* @__PURE__ */ h("span", {
216
+ /* @__PURE__ */ _("span", {
217
217
  className: "kapi-strong kapi-tabletools__label",
218
218
  children: t.label
219
219
  }),
220
- /* @__PURE__ */ h(x, {
220
+ /* @__PURE__ */ _(y, {
221
221
  size: 14,
222
222
  strokeWidth: 2.2,
223
223
  color: "var(--kapi-muted-2)",
224
224
  className: "kapi-tabletools__chevron"
225
225
  })
226
226
  ]
227
- }), a && /* @__PURE__ */ h(f, {
227
+ }), a && /* @__PURE__ */ _(f, {
228
228
  open: !0,
229
229
  x: a.x,
230
230
  y: a.y,
@@ -234,4 +234,4 @@ function oe({ action: t, busy: n, disabled: r, onRun: i }) {
234
234
  })] });
235
235
  }
236
236
  //#endregion
237
- export { C as KapiTableToolbar };
237
+ export { x as KapiTableToolbar };
@@ -3,8 +3,8 @@ import { useKapiFormatLocale as e, useLabels as t } from "../locale/KapiLocalePr
3
3
  import { useControllableState as n } from "../../hooks/useControllableState.js";
4
4
  import { formatDataValue as r } from "../../hooks/numberFormatLogic.js";
5
5
  import { KapiSegmented as i } from "../inputs/KapiSegmented.js";
6
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { useId as c } from "react";
6
+ import { useId as a } from "react";
7
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
8
  //#region src/components/data/chartFrame.tsx
9
9
  var l = {
10
10
  chartView: "Gráfico",
@@ -26,18 +26,18 @@ var l = {
26
26
  ...e === void 0 ? {} : { "--kapi-chart-slot": `var(--kapi-series-${e + 1})` },
27
27
  ...t === void 0 ? {} : { "--kapi-chart-x": `${t}%` },
28
28
  ...n === void 0 ? {} : { "--kapi-chart-y": `${n}%` }
29
- }), h = ({ block: e, slot: t }) => /* @__PURE__ */ o("span", {
29
+ }), h = ({ block: e, slot: t }) => /* @__PURE__ */ s("span", {
30
30
  className: `${e}__swatch`,
31
31
  style: m({ slot: t })
32
- }), g = ({ title: t, titleId: n, series: c, categories: l, valueAt: u, unit: f, view: p, onViewChange: m, text: g, block: _, children: v }) => {
33
- let y = e(), b = c.length === 0 || l.length === 0;
34
- return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s("div", {
32
+ }), g = ({ title: t, titleId: n, series: a, categories: l, valueAt: u, unit: f, view: p, onViewChange: m, text: g, block: _, children: v }) => {
33
+ let y = e(), b = a.length === 0 || l.length === 0;
34
+ return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("div", {
35
35
  className: `${_}__head`,
36
- children: [t ? /* @__PURE__ */ o("div", {
36
+ children: [t ? /* @__PURE__ */ s("div", {
37
37
  className: `${_}__title`,
38
38
  id: n,
39
39
  children: t
40
- }) : null, /* @__PURE__ */ o(i, {
40
+ }) : null, /* @__PURE__ */ s(i, {
41
41
  "aria-label": g.view,
42
42
  items: [{
43
43
  id: "chart",
@@ -49,40 +49,40 @@ var l = {
49
49
  value: p,
50
50
  onChange: m
51
51
  })]
52
- }), b ? /* @__PURE__ */ o("p", {
52
+ }), b ? /* @__PURE__ */ s("p", {
53
53
  className: `${_}__empty kapi-muted`,
54
54
  children: g.empty
55
- }) : p === "table" ? /* @__PURE__ */ o("div", {
55
+ }) : p === "table" ? /* @__PURE__ */ s("div", {
56
56
  className: `${_}__tablewrap`,
57
- children: /* @__PURE__ */ s("table", {
57
+ children: /* @__PURE__ */ c("table", {
58
58
  className: `${_}__table`,
59
- children: [/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ s("tr", { children: [/* @__PURE__ */ o("th", {
59
+ children: [/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ c("tr", { children: [/* @__PURE__ */ s("th", {
60
60
  scope: "col",
61
61
  children: g.series
62
- }), l.map((e, t) => /* @__PURE__ */ o("th", {
62
+ }), l.map((e, t) => /* @__PURE__ */ s("th", {
63
63
  scope: "col",
64
64
  children: e
65
- }, `${e}-${t}`))] }) }), /* @__PURE__ */ o("tbody", { children: c.map((e, t) => /* @__PURE__ */ s("tr", { children: [/* @__PURE__ */ o("th", {
65
+ }, `${e}-${t}`))] }) }), /* @__PURE__ */ s("tbody", { children: a.map((e, t) => /* @__PURE__ */ c("tr", { children: [/* @__PURE__ */ s("th", {
66
66
  scope: "row",
67
- children: /* @__PURE__ */ s("span", {
67
+ children: /* @__PURE__ */ c("span", {
68
68
  className: `${_}__serie`,
69
- children: [/* @__PURE__ */ o(h, {
69
+ children: [/* @__PURE__ */ s(h, {
70
70
  block: _,
71
71
  slot: t
72
72
  }), e.label]
73
73
  })
74
- }), l.map((e, n) => /* @__PURE__ */ o("td", { children: d(r(u(t, n), y), f) }, `${e}-${n}`))] }, e.id)) })]
74
+ }), l.map((e, n) => /* @__PURE__ */ s("td", { children: d(r(u(t, n), y), f) }, `${e}-${n}`))] }, e.id)) })]
75
75
  })
76
- }) : /* @__PURE__ */ s(a, { children: [c.length > 1 ? /* @__PURE__ */ o("ul", {
76
+ }) : /* @__PURE__ */ c(o, { children: [a.length > 1 ? /* @__PURE__ */ s("ul", {
77
77
  className: `${_}__legend`,
78
- children: c.map((e, t) => /* @__PURE__ */ s("li", {
78
+ children: a.map((e, t) => /* @__PURE__ */ c("li", {
79
79
  className: `${_}__legenditem`,
80
- children: [/* @__PURE__ */ o(h, {
80
+ children: [/* @__PURE__ */ s(h, {
81
81
  block: _,
82
82
  slot: t
83
83
  }), e.label]
84
84
  }, e.id))
85
85
  }) : null, v] })] });
86
- }, _ = () => c();
86
+ }, _ = () => a();
87
87
  //#endregion
88
88
  export { h as ChartSwatch, l as DEFAULT_CHART_LABELS, g as KapiChartFrame, u as chartSummary, m as chartVars, f as useChartLabels, _ as useChartTitleId, p as useChartView, d as withChartUnit };
@@ -3,11 +3,11 @@ import { rafThrottle as e } from "../../hooks/rafThrottle.js";
3
3
  import { directionOf as t, logicalKeyOf as n } from "../../hooks/directionLogic.js";
4
4
  import { clampColumnWidth as r, resizeColumn as i } from "./tableLogic.js";
5
5
  import { draftStickyLefts as a, draftStickyRights as o, endResizeDrag as s, moveResizeDrag as c, needsDraftLeftPaint as l, startResizeDrag as u } from "./tableResizeLogic.js";
6
- import { jsx as d } from "react/jsx-runtime";
7
- import { useCallback as f, useEffect as p, useLayoutEffect as m, useRef as h, useState as g } from "react";
6
+ import { useCallback as d, useEffect as f, useLayoutEffect as p, useRef as m, useState as h } from "react";
7
+ import { jsx as g } from "react/jsx-runtime";
8
8
  //#region src/components/data/useColumnResize.tsx
9
9
  var _ = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&"), v = ({ tableRef: v, columns: y, widths: b, onCommit: x, lefts: S, rights: C, offset: w, rightEnd: T, resizableColumns: E, resizeLabel: D }) => {
10
- let O = h(null), k = (e) => e.resizable ?? E, A = (e) => e.minWidth ?? 60, [j, M] = g({}), N = (e) => r(b[e.key] ?? e.width ?? j[e.key] ?? A(e), A(e)), P = f(() => {
10
+ let O = m(null), k = (e) => e.resizable ?? E, A = (e) => e.minWidth ?? 60, [j, M] = h({}), N = (e) => r(b[e.key] ?? e.width ?? j[e.key] ?? A(e), A(e)), P = d(() => {
11
11
  let e = v.current;
12
12
  if (!e) return;
13
13
  let t = {};
@@ -20,12 +20,12 @@ var _ = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(
20
20
  return n.length === Object.keys(e).length && n.every((n) => e[n] === t[n]) ? e : t;
21
21
  });
22
22
  }, [v]);
23
- m(P, [
23
+ p(P, [
24
24
  P,
25
25
  y,
26
26
  b
27
27
  ]);
28
- let F = h({
28
+ let F = m({
29
29
  columns: y,
30
30
  widths: b,
31
31
  lefts: S,
@@ -41,7 +41,7 @@ var _ = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(
41
41
  offset: w,
42
42
  rightEnd: T
43
43
  };
44
- let I = h(/* @__PURE__ */ new Map()), L = h(/* @__PURE__ */ new Map()), R = h(/* @__PURE__ */ new Map()), [z] = g(() => e((e) => {
44
+ let I = m(/* @__PURE__ */ new Map()), L = m(/* @__PURE__ */ new Map()), R = m(/* @__PURE__ */ new Map()), [z] = h(() => e((e) => {
45
45
  let t = v.current;
46
46
  if (!t) return;
47
47
  let n = F.current, r = a(n.columns, n.widths, e.key, e.width, n.offset), i = o(n.columns, n.widths, e.key, e.width, n.rightEnd);
@@ -66,7 +66,7 @@ var _ = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(
66
66
  t.style.cssText = e;
67
67
  }), I.current.clear(), L.current.clear(), R.current.clear();
68
68
  };
69
- p(() => () => z.cancel(), [z]);
69
+ f(() => () => z.cancel(), [z]);
70
70
  let V = (e, n) => {
71
71
  if (e.button !== 0) return;
72
72
  e.preventDefault(), e.stopPropagation();
@@ -93,7 +93,7 @@ var _ = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(
93
93
  return { resizeHandle: (e) => {
94
94
  if (!k(e)) return null;
95
95
  let t = typeof e.label == "string" ? ` ${e.label}` : "";
96
- return /* @__PURE__ */ d("div", {
96
+ return /* @__PURE__ */ g("div", {
97
97
  role: "separator",
98
98
  "aria-orientation": "vertical",
99
99
  "aria-label": `${D}${t}`,