@kapiuara/ui 0.9.0 → 0.11.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 (91) hide show
  1. package/README.md +29 -11
  2. package/dist/components/data/KapiBarChart.d.ts +84 -0
  3. package/dist/components/data/KapiBarChart.js +87 -0
  4. package/dist/components/data/KapiEventCalendar.d.ts +70 -0
  5. package/dist/components/data/KapiEventCalendar.js +225 -0
  6. package/dist/components/data/KapiHeatmap.d.ts +62 -0
  7. package/dist/components/data/KapiHeatmap.js +120 -0
  8. package/dist/components/data/KapiLineChart.d.ts +50 -0
  9. package/dist/components/data/KapiLineChart.js +105 -0
  10. package/dist/components/data/KapiPaginationFooter.js +6 -5
  11. package/dist/components/data/KapiSparkline.d.ts +41 -0
  12. package/dist/components/data/KapiSparkline.js +55 -0
  13. package/dist/components/data/KapiTable.d.ts +1 -1
  14. package/dist/components/data/KapiTable.js +371 -359
  15. package/dist/components/data/barChartLogic.d.ts +59 -0
  16. package/dist/components/data/barChartLogic.js +53 -0
  17. package/dist/components/data/chartFrame.d.ts +96 -0
  18. package/dist/components/data/chartFrame.js +89 -0
  19. package/dist/components/data/eventCalendarLogic.d.ts +70 -0
  20. package/dist/components/data/eventCalendarLogic.js +45 -0
  21. package/dist/components/data/heatmapLogic.d.ts +15 -0
  22. package/dist/components/data/heatmapLogic.js +15 -0
  23. package/dist/components/data/index.d.ts +19 -0
  24. package/dist/components/data/lineChartLogic.d.ts +30 -0
  25. package/dist/components/data/lineChartLogic.js +21 -0
  26. package/dist/components/data/sparklineLogic.d.ts +28 -0
  27. package/dist/components/data/sparklineLogic.js +18 -0
  28. package/dist/components/display/KapiStat.d.ts +1 -1
  29. package/dist/components/feedback/KapiBulkBar.d.ts +1 -1
  30. package/dist/components/inputs/KapiDatePicker.d.ts +8 -2
  31. package/dist/components/inputs/KapiDatePicker.js +120 -106
  32. package/dist/components/inputs/KapiDateRangePicker.d.ts +26 -5
  33. package/dist/components/inputs/KapiDateRangePicker.js +146 -111
  34. package/dist/components/inputs/datePickerLogic.d.ts +9 -0
  35. package/dist/components/inputs/datePickerLogic.js +25 -25
  36. package/dist/components/inputs/dateRangeLogic.d.ts +23 -4
  37. package/dist/components/inputs/dateRangeLogic.js +48 -22
  38. package/dist/components/inputs/facetedSearchLogic.d.ts +1 -1
  39. package/dist/components/layout/KapiContextSlot.js +108 -88
  40. package/dist/components/layout/KapiMasonry.d.ts +30 -0
  41. package/dist/components/layout/KapiMasonry.js +33 -0
  42. package/dist/components/layout/KapiPageHeader.js +136 -58
  43. package/dist/components/layout/KapiRail.d.ts +8 -2
  44. package/dist/components/layout/KapiRail.js +118 -67
  45. package/dist/components/layout/KapiShell.js +67 -37
  46. package/dist/components/layout/index.d.ts +2 -0
  47. package/dist/components/layout/masonryLogic.d.ts +40 -0
  48. package/dist/components/layout/masonryLogic.js +8 -0
  49. package/dist/components/layout/pageHeaderLogic.d.ts +25 -0
  50. package/dist/components/layout/pageHeaderLogic.js +16 -2
  51. package/dist/components/layout/railLogic.d.ts +41 -1
  52. package/dist/components/layout/railLogic.js +36 -4
  53. package/dist/components/layout/reopenBus.d.ts +53 -0
  54. package/dist/components/layout/reopenBus.js +6 -0
  55. package/dist/components/layout/useMasonrySpans.d.ts +32 -0
  56. package/dist/components/layout/useMasonrySpans.js +44 -0
  57. package/dist/components/layout/useRailOverflow.d.ts +17 -0
  58. package/dist/components/layout/useRailOverflow.js +41 -0
  59. package/dist/components/locale/labelRegistry.d.ts +10 -1
  60. package/dist/components/navigation/KapiFilterChips.js +1 -1
  61. package/dist/components/navigation/filterChipsLogic.d.ts +7 -1
  62. package/dist/components/navigation/filterChipsLogic.js +3 -3
  63. package/dist/components/overlays/KapiContextMenu.d.ts +3 -0
  64. package/dist/components/overlays/KapiContextMenu.js +2 -1
  65. package/dist/components/overlays/KapiDropdown.d.ts +3 -1
  66. package/dist/components/overlays/KapiDropdown.js +29 -26
  67. package/dist/components/overlays/KapiMenuButton.js +1 -0
  68. package/dist/components/overlays/KapiOffcanvasStack.d.ts +2 -2
  69. package/dist/hooks/breakpointOpenLogic.d.ts +20 -5
  70. package/dist/hooks/breakpointOpenLogic.js +2 -2
  71. package/dist/hooks/dataColorLogic.d.ts +23 -0
  72. package/dist/hooks/index.d.ts +3 -1
  73. package/dist/hooks/numberFormatLogic.d.ts +7 -0
  74. package/dist/hooks/numberFormatLogic.js +5 -2
  75. package/dist/hooks/seriesPaletteLogic.d.ts +24 -0
  76. package/dist/hooks/themeContrastLogic.js +1 -0
  77. package/dist/hooks/themeDeriveLogic.d.ts +11 -1
  78. package/dist/hooks/themeDeriveLogic.js +40 -31
  79. package/dist/hooks/themeRadiiLogic.d.ts +1 -1
  80. package/dist/hooks/themeRadiiLogic.js +1 -0
  81. package/dist/hooks/useKapiTheme.js +27 -27
  82. package/dist/hooks/useMediaQuery.d.ts +7 -0
  83. package/dist/hooks/useMediaQuery.js +4 -4
  84. package/dist/hooks/useWheelZoom.d.ts +30 -0
  85. package/dist/hooks/useWheelZoom.js +27 -0
  86. package/dist/hooks/wheelZoomLogic.d.ts +18 -0
  87. package/dist/hooks/wheelZoomLogic.js +9 -0
  88. package/dist/index.js +125 -113
  89. package/dist/kapi.css +1 -1
  90. package/dist/kapi.layered.css +1 -1
  91. package/package.json +3 -7
@@ -4,24 +4,24 @@ import { rafThrottle as n } from "../../hooks/rafThrottle.js";
4
4
  import { joinClasses as r } from "../rootProps.js";
5
5
  import { formatCount as i } from "../../hooks/numberFormatLogic.js";
6
6
  /* empty css */
7
- import { applyRangeSelection as a, buildCsv as o, clampColumnWidth as ee, computePagination as s, computeStickyOffsets as te, computeVisibleRange as ne, csvFileName as re, csvHeaderOf as ie, effectiveColumnWidth as ae, filterRows as oe, filterSearchColumns as c, lastStickyIndex as se, nextScrollWindow as ce, nextSortState as le, rangeBetween as ue, readCell as l, resizeColumn as de, rowSelectLabel as u, selectOnlyWithin as fe, selectionState as pe, sortRowsByColumn as me, toggleAllIds as he, toggleColumnVisibility as ge, toggleId as _e, visibleColumnsOf as ve } from "./tableLogic.js";
8
- import { KapiContextMenu as ye } from "../overlays/KapiContextMenu.js";
9
- import { KapiMenuButton as be } from "../overlays/KapiMenuButton.js";
10
- import { downloadBlob as xe } from "../../hooks/downloadLogic.js";
11
- import { useDragScroll as Se } from "../../hooks/useDragScroll.js";
12
- import { draftStickyLefts as Ce, endResizeDrag as we, moveResizeDrag as Te, needsDraftLeftPaint as Ee, startResizeDrag as De } from "./tableResizeLogic.js";
13
- import { datasetActionLabel as Oe, datasetHintLabel as ke, datasetNoticeState as Ae, datasetSelectedLabel as je } from "./datasetSelectionLogic.js";
14
- import { KapiSkeleton as Me } from "../feedback/KapiSkeleton.js";
15
- import { KapiBulkBar as Ne } from "../feedback/KapiBulkBar.js";
7
+ import { applyRangeSelection as a, buildCsv as o, clampColumnWidth as ee, computePagination as te, computeStickyOffsets as ne, computeVisibleRange as re, csvFileName as ie, csvHeaderOf as ae, effectiveColumnWidth as oe, filterRows as se, filterSearchColumns as s, lastStickyIndex as ce, nextScrollWindow as le, nextSortState as ue, rangeBetween as de, readCell as c, resizeColumn as fe, rowSelectLabel as l, selectOnlyWithin as pe, selectionState as me, sortRowsByColumn as he, toggleAllIds as ge, toggleColumnVisibility as _e, toggleId as ve, visibleColumnsOf as ye } from "./tableLogic.js";
8
+ import { KapiContextMenu as be } from "../overlays/KapiContextMenu.js";
9
+ import { KapiMenuButton as xe } from "../overlays/KapiMenuButton.js";
10
+ import { downloadBlob as Se } from "../../hooks/downloadLogic.js";
11
+ import { useDragScroll as Ce } from "../../hooks/useDragScroll.js";
12
+ import { draftStickyLefts as we, endResizeDrag as Te, moveResizeDrag as Ee, needsDraftLeftPaint as De, startResizeDrag as Oe } from "./tableResizeLogic.js";
13
+ import { datasetActionLabel as ke, datasetHintLabel as Ae, datasetNoticeState as je, datasetSelectedLabel as Me } from "./datasetSelectionLogic.js";
14
+ import { KapiSkeleton as Ne } from "../feedback/KapiSkeleton.js";
15
+ import { KapiBulkBar as Pe } from "../feedback/KapiBulkBar.js";
16
16
  /* empty css */
17
- import { KapiPaginationFooter as Pe } from "./KapiPaginationFooter.js";
18
- import { DEFAULT_TABLE_FILTER_LABELS as d, KapiTableFilter as Fe } from "./KapiTableFilter.js";
19
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
20
- import { memo as h, useCallback as Ie, useEffect as g, useLayoutEffect as Le, useMemo as _, useRef as v, useState as y } from "react";
17
+ import { KapiPaginationFooter as Fe } from "./KapiPaginationFooter.js";
18
+ import { DEFAULT_TABLE_FILTER_LABELS as u, KapiTableFilter as Ie } from "./KapiTableFilter.js";
19
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
20
+ import { memo as m, useCallback as h, useEffect as g, useLayoutEffect as Le, useMemo as _, useRef as v, useState as y } from "react";
21
21
  import { Check as Re, ChevronDown as ze, ChevronRight as b, ChevronUp as Be, ChevronsUpDown as Ve, Columns3 as He, Copy as x, Download as Ue, Loader2 as We, MoreHorizontal as Ge } from "lucide-react";
22
22
  //#region src/components/data/KapiTable.tsx
23
23
  var Ke = {
24
- region: d.region,
24
+ region: u.region,
25
25
  empty: "Sin resultados",
26
26
  loading: "Cargando…",
27
27
  selectAll: "Seleccionar todo",
@@ -76,267 +76,279 @@ var Ke = {
76
76
  maxWidth: r
77
77
  };
78
78
  }, tt = (e, t = !1) => `${e.sticky ? "is-sticky" : ""}${e.sticky && t ? " is-sticky-last" : ""}${e.flex ? " is-flex" : ""}${e.align ? ` is-align-${e.align}` : ""}`, nt = (e, t, n, r) => {
79
- let i = e.render ? e.render(t) : l(t, e.key);
79
+ let i = e.render ? e.render(t) : c(t, e.key);
80
80
  if (!e.copyable) return i;
81
- let a = e.copyValue ? e.copyValue(t) : l(t, e.key);
82
- return /* @__PURE__ */ m("span", {
81
+ let a = e.copyValue ? e.copyValue(t) : c(t, e.key);
82
+ return /* @__PURE__ */ p("span", {
83
83
  className: "kapi-cell",
84
- children: [/* @__PURE__ */ p("span", {
84
+ children: [/* @__PURE__ */ f("span", {
85
85
  className: "kapi-cell__v",
86
86
  children: i
87
- }), /* @__PURE__ */ p("button", {
87
+ }), /* @__PURE__ */ f("button", {
88
88
  type: "button",
89
89
  className: "kapi-cell__copy",
90
90
  "aria-label": n.copy,
91
91
  onClick: (e) => {
92
92
  e.stopPropagation(), Qe(a, r);
93
93
  },
94
- children: /* @__PURE__ */ p(x, {
94
+ children: /* @__PURE__ */ f(x, {
95
95
  size: 13,
96
96
  strokeWidth: 2
97
97
  })
98
98
  })]
99
99
  });
100
- }, rt = (e) => e === "asc" ? /* @__PURE__ */ p(Be, {
100
+ }, rt = (e) => e === "asc" ? /* @__PURE__ */ f(Be, {
101
101
  size: 13,
102
102
  strokeWidth: 2.4
103
- }) : e === "desc" ? /* @__PURE__ */ p(ze, {
103
+ }) : e === "desc" ? /* @__PURE__ */ f(ze, {
104
104
  size: 13,
105
105
  strokeWidth: 2.4
106
- }) : /* @__PURE__ */ p(Ve, {
106
+ }) : /* @__PURE__ */ f(Ve, {
107
107
  size: 13,
108
108
  strokeWidth: 2
109
109
  });
110
- function it({ columns: d, rows: h, keyField: b = "id", maxHeight: Be = "58vh", fill: Ve = !1, bulkActionsPlacement: x = "bottom", className: Ge, style: qe, id: Qe, labels: nt, actions: it, rowMenu: S, contextMenu: ot, onCopy: st, selectable: C = !1, rowSelect: ct = !1, rowLabel: lt, selectedIds: ut, onSelectedIdsChange: dt, bulkActions: ft, rangeSelect: pt = !0, selectionPresets: w, virtual: T = !1, rowHeight: E = 46, sort: mt, defaultSort: ht = null, onSortChange: gt, manualSort: _t = !1, pagination: D, dataset: O, loading: k = !1, loadingRows: vt = Ye, card: yt = !1, emptyMessage: bt, loadingMessage: xt, isRowSelectable: A, renderSubComponent: St, expandedIds: Ct, onExpandedIdsChange: wt, density: Tt = "default", rowHover: Et = !1, columnToggle: Dt = !1, columnVisibility: Ot, defaultColumnVisibility: kt, onColumnVisibilityChange: At, resizableColumns: jt = !1, columnWidths: Mt, defaultColumnWidths: Nt, onColumnWidthsChange: Pt, filterable: Ft = !1, filter: It, defaultFilter: Lt = Ze, onFilterChange: Rt, manualFilter: j = !1, filterDebounce: zt = 300, exportCsv: M, toolbar: Bt, mobileCards: Vt = !1 }) {
111
- let N = t("table", Ke, nt), Ht = bt === void 0 ? N.empty : bt, Ut = xt === void 0 ? N.loading : xt, Wt = e(), [Gt, Kt] = y(null), [P, qt] = y(null), [Jt, Yt] = y({
110
+ function it({ columns: u, rows: m, keyField: b = "id", maxHeight: Be = "58vh", fill: Ve = !1, bulkActionsPlacement: x = "bottom", className: Ge, style: qe, id: Qe, labels: nt, actions: it, rowMenu: S, contextMenu: ot, onCopy: st, selectable: C = !1, rowSelect: ct = !1, rowLabel: lt, selectedIds: ut, onSelectedIdsChange: dt, bulkActions: ft, rangeSelect: pt = !0, selectionPresets: w, virtual: T = !1, rowHeight: E = 46, sort: mt, defaultSort: ht = null, onSortChange: gt, manualSort: _t = !1, pagination: D, dataset: O, loading: k = !1, loadingRows: vt = Ye, card: yt = !1, emptyMessage: bt, loadingMessage: xt, isRowSelectable: A, renderSubComponent: St, expandedIds: Ct, onExpandedIdsChange: wt, density: Tt = "default", rowHover: Et = !1, columnToggle: Dt = !1, columnVisibility: Ot, defaultColumnVisibility: kt, onColumnVisibilityChange: At, resizableColumns: jt = !1, columnWidths: Mt, defaultColumnWidths: Nt, onColumnWidthsChange: Pt, filterable: Ft = !1, filter: It, defaultFilter: Lt = Ze, onFilterChange: Rt, manualFilter: zt = !1, filterDebounce: Bt = 300, exportCsv: j, toolbar: Vt, mobileCards: Ht = !1 }) {
111
+ let M = t("table", Ke, nt), Ut = bt === void 0 ? M.empty : bt, Wt = xt === void 0 ? M.loading : xt, Gt = e(), [Kt, qt] = y(null), [N, Jt] = y(null), [Yt, Xt] = y({
112
112
  scrollTop: 0,
113
113
  viewHeight: Je
114
- }), F = Se({ onMenu: ot ? (e, t) => Kt({
114
+ }), P = Ce({ onMenu: ot ? (e, t) => qt({
115
115
  x: e,
116
116
  y: t
117
- }) : void 0 }), Xt = ut !== void 0, [Zt, Qt] = y(() => /* @__PURE__ */ new Set()), I = _(() => Xt ? new Set(ut) : Zt, [
118
- Xt,
117
+ }) : void 0 }), Zt = ut !== void 0, [Qt, $t] = y(() => /* @__PURE__ */ new Set()), F = _(() => Zt ? new Set(ut) : Qt, [
118
+ Zt,
119
119
  ut,
120
- Zt
121
- ]), L = (e) => {
122
- Xt || Qt(e), dt?.([...e]);
123
- }, $t = () => L(/* @__PURE__ */ new Set()), en = [...I], tn = v(null), nn = mt !== void 0, [rn, an] = y(ht), R = nn ? mt : rn, on = (e) => {
124
- let t = le(R, e);
125
- nn || an(t), gt?.(t);
126
- }, z = !!St && !T, sn = Ct !== void 0, [cn, ln] = y(() => /* @__PURE__ */ new Set()), un = _(() => sn ? new Set(Ct) : cn, [
127
- sn,
120
+ Qt
121
+ ]), I = (e) => {
122
+ Zt || $t(e), dt?.([...e]);
123
+ }, en = () => I(/* @__PURE__ */ new Set()), tn = [...F], nn = v(null), rn = mt !== void 0, [an, on] = y(ht), L = rn ? mt : an, sn = (e) => {
124
+ let t = ue(L, e);
125
+ rn || on(t), gt?.(t);
126
+ }, R = !!St && !T, cn = Ct !== void 0, [ln, un] = y(() => /* @__PURE__ */ new Set()), dn = _(() => cn ? new Set(Ct) : ln, [
127
+ cn,
128
128
  Ct,
129
- cn
130
- ]), dn = (e) => {
131
- let t = _e(un, e);
132
- sn || ln(t), wt?.([...t]);
133
- }, fn = Ot !== void 0, [pn, mn] = y(kt ?? {}), B = fn ? Ot : pn, [hn, gn] = y(!1), _n = (e) => {
134
- let t = ge(B, e);
135
- fn || mn(t), At?.(t);
136
- }, vn = Mt !== void 0, [yn, bn] = y(Nt ?? {}), V = vn ? Mt : yn, xn = (e) => {
137
- vn || bn(e), Pt?.(e);
138
- }, H = v(null), Sn = v(null), U = _(() => ve(d, B), [d, B]), Cn = It !== void 0, [wn, Tn] = y(Lt), W = Cn ? It : wn, En = (e) => {
139
- Cn || Tn(e), Rt?.(e);
140
- }, Dn = _(() => {
141
- if (j) return h;
142
- let e = c(U, W.column);
143
- return oe(h, (t) => e.map((e) => e.filterValue ? e.filterValue(t) : l(t, e.key)), W.text);
129
+ ln
130
+ ]), fn = (e) => {
131
+ let t = ve(dn, e);
132
+ cn || un(t), wt?.([...t]);
133
+ }, pn = Ot !== void 0, [mn, hn] = y(kt ?? {}), z = pn ? Ot : mn, [gn, _n] = y(!1), vn = (e) => {
134
+ let t = _e(z, e);
135
+ pn || hn(t), At?.(t);
136
+ }, yn = Mt !== void 0, [bn, xn] = y(Nt ?? {}), B = yn ? Mt : bn, Sn = (e) => {
137
+ yn || xn(e), Pt?.(e);
138
+ }, V = v(null), Cn = v(null), H = _(() => ye(u, z), [u, z]), wn = It !== void 0, [Tn, En] = y(Lt), U = wn ? It : Tn, Dn = (e) => {
139
+ wn || En(e), Rt?.(e);
140
+ }, On = _(() => {
141
+ if (zt) return m;
142
+ let e = s(H, U.column);
143
+ return se(m, (t) => e.map((e) => e.filterValue ? e.filterValue(t) : c(t, e.key)), U.text);
144
144
  }, [
145
- h,
145
+ m,
146
+ H,
146
147
  U,
147
- W,
148
- j
149
- ]), G = _(() => _t ? Dn : me(Dn, d, R, Wt), [
150
- Dn,
151
- d,
152
- R,
148
+ zt
149
+ ]), W = _(() => _t ? On : he(On, u, L, Gt), [
150
+ On,
151
+ u,
152
+ L,
153
153
  _t,
154
- Wt
155
- ]), K = C && w !== void 0 && w.length > 0, On = K ? 80 : 46, q = _(() => te(U.map((e) => ({
154
+ Gt
155
+ ]), G = C && w !== void 0 && w.length > 0, kn = G ? 80 : 46, K = _(() => ne(H.map((e) => ({
156
156
  sticky: e.sticky,
157
- width: ae(e, V)
158
- })), (C ? On : 0) + (z ? 44 : 0)), [
159
- U,
160
- V,
157
+ width: oe(e, B)
158
+ })), (C ? kn : 0) + (R ? 44 : 0)), [
159
+ H,
160
+ B,
161
161
  C,
162
- On,
163
- z
164
- ]), kn = _(() => se(U), [U]), An = d.filter((e) => e.hideable !== !1), J = !!(it || S), Y = U.length + +!!C + +!!J + +!!z, X = _(() => G.filter((e) => !A || A(e)), [G, A]), Z = _(() => X.map((e) => e[b]), [X, b]), jn = _(() => K && w ? w.map((e) => ({
162
+ kn,
163
+ R
164
+ ]), An = _(() => ce(H), [H]), jn = u.filter((e) => e.hideable !== !1), q = !!(it || S), J = H.length + +!!C + +!!q + +!!R, Y = _(() => W.filter((e) => !A || A(e)), [W, A]), X = _(() => Y.map((e) => e[b]), [Y, b]), Mn = _(() => G && w ? w.map((e) => ({
165
165
  preset: e,
166
- matching: e.match === void 0 ? [] : X.filter(e.match).map((e) => e[b])
166
+ matching: e.match === void 0 ? [] : Y.filter(e.match).map((e) => e[b])
167
167
  })) : [], [
168
- K,
168
+ G,
169
169
  w,
170
- X,
170
+ Y,
171
171
  b
172
172
  ]).map(({ preset: e, matching: t }) => {
173
- let n = e.onSelect === void 0 ? t.length : e.count, r = e.pending === !0, a = r ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(We, {
173
+ let n = e.onSelect === void 0 ? t.length : e.count, r = e.pending === !0, a = r ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(We, {
174
174
  size: 14,
175
175
  strokeWidth: 2.2,
176
176
  className: "kapi-table-spin",
177
177
  "aria-hidden": !0
178
- }), /* @__PURE__ */ p("span", {
178
+ }), /* @__PURE__ */ f("span", {
179
179
  className: "kapi-sr-only",
180
- children: N.loading
180
+ children: M.loading
181
181
  })] }) : e.icon;
182
182
  return {
183
- label: r ? e.label : `${e.label} (${i(n, Wt)})`,
183
+ label: r ? e.label : `${e.label} (${i(n, Gt)})`,
184
184
  ...a !== void 0 && { icon: a },
185
185
  disabled: r || n === 0,
186
- onClick: e.onSelect ?? (() => L(fe(I, Z, t)))
186
+ onClick: e.onSelect ?? (() => I(pe(F, X, t)))
187
187
  };
188
- }), Mn = pe(Z, I), Nn = O !== void 0 && C ? Ae({
189
- headerState: Mn,
190
- shown: Z.length,
188
+ }), Nn = me(X, F), Pn = O !== void 0 && C ? je({
189
+ headerState: Nn,
190
+ shown: X.length,
191
191
  total: O.total,
192
192
  selected: O.selected === !0
193
- }) : "none", Pn = (e, t) => {
194
- let n = !I.has(e), r = tn.current;
193
+ }) : "none", Fn = (e, t) => {
194
+ let n = !F.has(e), r = nn.current;
195
195
  if (pt && t && r !== null && r !== e) {
196
- let t = ue(Z, r, e);
196
+ let t = de(X, r, e);
197
197
  if (t.length > 0) {
198
- L(a(I, t, n));
198
+ I(a(F, t, n));
199
199
  return;
200
200
  }
201
201
  }
202
- tn.current = e, L(_e(I, e));
203
- }, { start: Fn, end: In, padTop: Ln, padBottom: Rn } = T ? ne({
204
- total: G.length,
202
+ nn.current = e, I(ve(F, e));
203
+ }, { start: In, end: Ln, padTop: Rn, padBottom: zn } = T ? re({
204
+ total: W.length,
205
205
  rowHeight: E,
206
- ...Jt
206
+ ...Yt
207
207
  }) : {
208
208
  start: 0,
209
- end: G.length,
209
+ end: W.length,
210
210
  padTop: 0,
211
211
  padBottom: 0
212
- }, zn = G.slice(Fn, In), Bn = D ? Math.max(0, D.page - 1) * D.pageSize : 0, Vn = v({
213
- total: G.length,
212
+ }, Bn = W.slice(In, Ln), Vn = D ? Math.max(0, D.page - 1) * D.pageSize : 0, Hn = v({
213
+ total: W.length,
214
214
  rowHeight: E
215
215
  });
216
- Vn.current = {
217
- total: G.length,
216
+ Hn.current = {
217
+ total: W.length,
218
218
  rowHeight: E
219
219
  };
220
- let Hn = Ie((e) => {
220
+ let Un = h((e) => {
221
221
  let t = {
222
222
  scrollTop: e.scrollTop,
223
223
  viewHeight: e.clientHeight || Je
224
224
  };
225
- Yt((e) => ce(e, t, Vn.current));
226
- }, []), Un = Ie(() => {
227
- let e = F.current;
228
- e && Hn(e);
229
- }, [F, Hn]);
225
+ Xt((e) => le(e, t, Hn.current));
226
+ }, []), [Wn, Gn] = y(!1), Kn = h((e) => {
227
+ let t = e.scrollWidth - e.getBoundingClientRect().width;
228
+ Gn(e.scrollLeft < t - 1);
229
+ }, []), qn = h(() => {
230
+ let e = P.current;
231
+ e && Un(e);
232
+ }, [P, Un]);
230
233
  Le(() => {
231
- T && Un();
234
+ T && qn();
232
235
  }, [
233
236
  T,
234
237
  Be,
235
238
  E,
236
- Un
239
+ qn
240
+ ]), g(() => {
241
+ let e = P.current;
242
+ if (!e || (Kn(e), typeof ResizeObserver > "u")) return;
243
+ let t = new ResizeObserver(() => Kn(e));
244
+ return t.observe(e), () => t.disconnect();
245
+ }, [
246
+ P,
247
+ Kn,
248
+ H
237
249
  ]), g(() => {
238
- let e = F.current;
250
+ let e = P.current;
239
251
  if (!T || !e || typeof ResizeObserver > "u") return;
240
- let t = new ResizeObserver(Un);
252
+ let t = new ResizeObserver(qn);
241
253
  return t.observe(e), () => t.disconnect();
242
254
  }, [
243
255
  T,
244
- F,
245
- Un
256
+ P,
257
+ qn
246
258
  ]);
247
- let Wn = (e) => {
248
- T && Hn(e.currentTarget);
249
- }, Gn = v(!0);
259
+ let Jn = (e) => {
260
+ T && Un(e.currentTarget), Kn(e.currentTarget);
261
+ }, Yn = v(!0);
250
262
  g(() => {
251
- if (Gn.current) {
252
- Gn.current = !1;
263
+ if (Yn.current) {
264
+ Yn.current = !1;
253
265
  return;
254
266
  }
255
- let e = F.current;
267
+ let e = P.current;
256
268
  e && e.scrollTop > 0 && (e.scrollTop = 0);
257
269
  }, [
258
- W.text,
259
- W.column,
260
- F
270
+ U.text,
271
+ U.column,
272
+ P
261
273
  ]);
262
- let Kn = typeof M == "object" ? M : {}, qn = () => {
263
- let e = U.map(ie), t = Kn.rows, n = (t === void 0 ? G : typeof t == "function" ? t() : t).map((e) => U.map((t) => t.csvValue ? t.csvValue(e) : t.copyValue ? t.copyValue(e) : l(e, t.key)));
264
- xe(new Blob([`\uFEFF${o(e, n, Kn.separator)}`], { type: "text/csv;charset=utf-8" }), re(Kn.fileName));
265
- }, Jn = Vt && !T, Yn = (e, t) => {
274
+ let Xn = typeof j == "object" ? j : {}, Zn = () => {
275
+ let e = H.map(ae), t = Xn.rows, n = (t === void 0 ? W : typeof t == "function" ? t() : t).map((e) => H.map((t) => t.csvValue ? t.csvValue(e) : t.copyValue ? t.copyValue(e) : c(e, t.key)));
276
+ Se(new Blob([`\uFEFF${o(e, n, Xn.separator)}`], { type: "text/csv;charset=utf-8" }), ie(Xn.fileName));
277
+ }, Qn = Ht && !T, $n = (e, t) => {
266
278
  if (!S) return;
267
279
  let n = e.currentTarget.getBoundingClientRect();
268
- qt({
280
+ Jt({
269
281
  x: n.right,
270
282
  y: n.bottom + 4,
271
283
  items: S(t)
272
284
  });
273
- }, Xn = v({
274
- activateRow: Pn,
275
- toggleExpanded: dn,
276
- openRowMenu: Yn
285
+ }, Z = v({
286
+ activateRow: Fn,
287
+ toggleExpanded: fn,
288
+ openRowMenu: $n
277
289
  });
278
- Xn.current = {
279
- activateRow: Pn,
280
- toggleExpanded: dn,
281
- openRowMenu: Yn
290
+ Z.current = {
291
+ activateRow: Fn,
292
+ toggleExpanded: fn,
293
+ openRowMenu: $n
282
294
  };
283
- let Zn = _(() => ({
284
- activate: (e, t) => Xn.current.activateRow(e, t),
285
- toggleExpanded: (e) => Xn.current.toggleExpanded(e),
286
- openMenu: (e, t) => Xn.current.openRowMenu(e, t)
287
- }), []), Qn = (e) => {
295
+ let er = _(() => ({
296
+ activate: (e, t) => Z.current.activateRow(e, t),
297
+ toggleExpanded: (e) => Z.current.toggleExpanded(e),
298
+ openMenu: (e, t) => Z.current.openRowMenu(e, t)
299
+ }), []), tr = (e) => {
288
300
  if (!e.sortable) return e.label;
289
- let t = R?.key === e.key ? R.direction : "none";
290
- return /* @__PURE__ */ m("button", {
301
+ let t = L?.key === e.key ? L.direction : "none";
302
+ return /* @__PURE__ */ p("button", {
291
303
  type: "button",
292
304
  className: `kapi-thsort${t === "none" ? "" : " is-active"}`,
293
- onClick: () => on(e.key),
294
- title: typeof e.label == "string" ? `${N.sortBy} ${e.label}` : void 0,
295
- children: [/* @__PURE__ */ p("span", { children: e.label }), rt(t)]
305
+ onClick: () => sn(e.key),
306
+ title: typeof e.label == "string" ? `${M.sortBy} ${e.label}` : void 0,
307
+ children: [/* @__PURE__ */ f("span", { children: e.label }), rt(t)]
296
308
  });
297
- }, $n = (e) => {
298
- if (e.sortable) return R?.key === e.key ? R.direction === "asc" ? "ascending" : "descending" : "none";
299
- }, er = (e) => e.resizable ?? jt, Q = (e) => e.minWidth ?? 60, [tr, nr] = y({}), rr = (e) => ee(V[e.key] ?? e.width ?? tr[e.key] ?? Q(e), Q(e)), ir = Ie(() => {
300
- let e = Sn.current;
309
+ }, nr = (e) => {
310
+ if (e.sortable) return L?.key === e.key ? L.direction === "asc" ? "ascending" : "descending" : "none";
311
+ }, rr = (e) => e.resizable ?? jt, Q = (e) => e.minWidth ?? 60, [ir, ar] = y({}), or = (e) => ee(B[e.key] ?? e.width ?? ir[e.key] ?? Q(e), Q(e)), sr = h(() => {
312
+ let e = Cn.current;
301
313
  if (!e) return;
302
314
  let t = {};
303
315
  for (let n of e.querySelectorAll(":scope > thead .kapi-colresize[data-col]")) {
304
316
  let e = n.dataset.col, r = n.parentElement?.getBoundingClientRect().width;
305
317
  e && r && (t[e] = Math.round(r));
306
318
  }
307
- nr((e) => {
319
+ ar((e) => {
308
320
  let n = Object.keys(t);
309
321
  return n.length === Object.keys(e).length && n.every((n) => e[n] === t[n]) ? e : t;
310
322
  });
311
323
  }, []);
312
- Le(ir, [
313
- ir,
314
- U,
315
- V
324
+ Le(sr, [
325
+ sr,
326
+ H,
327
+ B
316
328
  ]);
317
- let ar = v({
318
- visibleColumns: U,
319
- widths: V,
320
- lefts: q,
329
+ let cr = v({
330
+ visibleColumns: H,
331
+ widths: B,
332
+ lefts: K,
321
333
  offset: 0
322
334
  });
323
- ar.current = {
324
- visibleColumns: U,
325
- widths: V,
326
- lefts: q,
327
- offset: (C ? On : 0) + (z ? 44 : 0)
335
+ cr.current = {
336
+ visibleColumns: H,
337
+ widths: B,
338
+ lefts: K,
339
+ offset: (C ? kn : 0) + (R ? 44 : 0)
328
340
  };
329
- let or = v(/* @__PURE__ */ new Map()), sr = v(/* @__PURE__ */ new Map()), [cr] = y(() => n((e) => {
330
- let t = Sn.current;
341
+ let lr = v(/* @__PURE__ */ new Map()), ur = v(/* @__PURE__ */ new Map()), [dr] = y(() => n((e) => {
342
+ let t = Cn.current;
331
343
  if (!t) return;
332
- let n = ar.current, r = Ce(n.visibleColumns, n.widths, e.key, e.width, n.offset);
344
+ let n = cr.current, r = we(n.visibleColumns, n.widths, e.key, e.width, n.offset);
333
345
  n.visibleColumns.forEach((i, a) => {
334
- let o = i.key === e.key, ee = sr.current.get(i.key);
335
- if (!o && !Ee(r[a], n.lefts[a], ee)) return;
336
- sr.current.set(i.key, r[a]);
337
- let s = `[data-col="${$e(i.key)}"]`;
338
- t.querySelectorAll(`:scope > thead > tr > ${s}, :scope > tbody > tr > ${s}`).forEach((t) => {
339
- if (or.current.has(t) || or.current.set(t, t.style.cssText), o) {
346
+ let o = i.key === e.key, ee = ur.current.get(i.key);
347
+ if (!o && !De(r[a], n.lefts[a], ee)) return;
348
+ ur.current.set(i.key, r[a]);
349
+ let te = `[data-col="${$e(i.key)}"]`;
350
+ t.querySelectorAll(`:scope > thead > tr > ${te}, :scope > tbody > tr > ${te}`).forEach((t) => {
351
+ if (lr.current.has(t) || lr.current.set(t, t.style.cssText), o) {
340
352
  let n = `${e.width}px`;
341
353
  t.style.width = n, t.style.minWidth = n, t.style.maxWidth = n;
342
354
  }
@@ -344,106 +356,106 @@ function it({ columns: d, rows: h, keyField: b = "id", maxHeight: Be = "58vh", f
344
356
  n !== void 0 && (t.style.left = `${n}px`);
345
357
  });
346
358
  });
347
- })), lr = () => {
348
- cr.cancel(), or.current.forEach((e, t) => {
359
+ })), fr = () => {
360
+ dr.cancel(), lr.current.forEach((e, t) => {
349
361
  t.style.cssText = e;
350
- }), or.current.clear(), sr.current.clear();
362
+ }), lr.current.clear(), ur.current.clear();
351
363
  };
352
- g(() => () => cr.cancel(), [cr]);
353
- let ur = (e, t) => {
364
+ g(() => () => dr.cancel(), [dr]);
365
+ let pr = (e, t) => {
354
366
  if (e.button !== 0) return;
355
367
  e.preventDefault(), e.stopPropagation();
356
368
  let n = e.currentTarget.parentElement, r = n ? n.getBoundingClientRect().width : t.width ?? 120;
357
- H.current = De(t.key, e.clientX, r, Q(t)), e.currentTarget.setPointerCapture(e.pointerId);
358
- }, dr = (e) => {
359
- let t = H.current;
369
+ V.current = Oe(t.key, e.clientX, r, Q(t)), e.currentTarget.setPointerCapture(e.pointerId);
370
+ }, mr = (e) => {
371
+ let t = V.current;
360
372
  if (!t) return;
361
- let n = Te(t, e.clientX);
362
- n && (H.current = n, cr(n));
363
- }, fr = (e) => {
364
- let t = H.current;
365
- if (H.current = null, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), !t) return;
366
- lr();
367
- let n = e.type === "pointercancel" ? t : Te(t, e.clientX) ?? t, r = we(n, V, e.type === "pointercancel" ? "cancel" : "commit");
368
- r && xn(r);
369
- }, pr = (e, t) => {
373
+ let n = Ee(t, e.clientX);
374
+ n && (V.current = n, dr(n));
375
+ }, hr = (e) => {
376
+ let t = V.current;
377
+ if (V.current = null, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), !t) return;
378
+ fr();
379
+ let n = e.type === "pointercancel" ? t : Ee(t, e.clientX) ?? t, r = Te(n, B, e.type === "pointercancel" ? "cancel" : "commit");
380
+ r && Sn(r);
381
+ }, gr = (e, t) => {
370
382
  if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
371
383
  e.preventDefault();
372
- let n = e.currentTarget.parentElement, r = V[t.key] ?? (n ? n.getBoundingClientRect().width : t.width ?? 120), i = e.key === "ArrowRight" ? 16 : -16;
373
- xn(de(V, t.key, r, i, Q(t)));
374
- }, mr = (e) => {
375
- if (!er(e)) return null;
384
+ let n = e.currentTarget.parentElement, r = B[t.key] ?? (n ? n.getBoundingClientRect().width : t.width ?? 120), i = e.key === "ArrowRight" ? 16 : -16;
385
+ Sn(fe(B, t.key, r, i, Q(t)));
386
+ }, _r = (e) => {
387
+ if (!rr(e)) return null;
376
388
  let t = typeof e.label == "string" ? ` ${e.label}` : "";
377
- return /* @__PURE__ */ p("div", {
389
+ return /* @__PURE__ */ f("div", {
378
390
  role: "separator",
379
391
  "aria-orientation": "vertical",
380
- "aria-label": `${N.resizeColumn}${t}`,
392
+ "aria-label": `${M.resizeColumn}${t}`,
381
393
  "aria-valuemin": Q(e),
382
- "aria-valuenow": rr(e),
394
+ "aria-valuenow": or(e),
383
395
  tabIndex: 0,
384
396
  className: "kapi-colresize",
385
397
  "data-col": e.key,
386
- onFocus: ir,
387
- onPointerDown: (t) => ur(t, e),
388
- onPointerMove: dr,
389
- onPointerUp: fr,
390
- onPointerCancel: fr,
398
+ onFocus: sr,
399
+ onPointerDown: (t) => pr(t, e),
400
+ onPointerMove: mr,
401
+ onPointerUp: hr,
402
+ onPointerCancel: hr,
391
403
  onClick: (e) => e.stopPropagation(),
392
- onKeyDown: (t) => pr(t, e)
404
+ onKeyDown: (t) => gr(t, e)
393
405
  });
394
- }, $ = D ? s(D) : null, hr = D && $ && $.page !== D.page ? $.page : null, gr = v(D?.onPageChange);
395
- gr.current = D?.onPageChange, g(() => {
396
- hr !== null && gr.current?.(hr);
397
- }, [hr]);
398
- let _r = (e, t = !1) => /* @__PURE__ */ p("tr", {
406
+ }, $ = D ? te(D) : null, vr = D && $ && $.page !== D.page ? $.page : null, yr = v(D?.onPageChange);
407
+ yr.current = D?.onPageChange, g(() => {
408
+ vr !== null && yr.current?.(vr);
409
+ }, [vr]);
410
+ let br = (e, t = !1) => /* @__PURE__ */ f("tr", {
399
411
  className: "kapi-table-staterow",
400
- children: /* @__PURE__ */ m("td", {
401
- colSpan: Y,
412
+ children: /* @__PURE__ */ p("td", {
413
+ colSpan: J,
402
414
  className: "kapi-table-state",
403
- children: [t && /* @__PURE__ */ p(We, {
415
+ children: [t && /* @__PURE__ */ f(We, {
404
416
  size: 16,
405
417
  strokeWidth: 2.2,
406
418
  className: "kapi-table-spin",
407
419
  "aria-hidden": !0
408
- }), /* @__PURE__ */ p("span", { children: e })]
420
+ }), /* @__PURE__ */ f("span", { children: e })]
409
421
  })
410
- }), vr = (e, t, n) => {
422
+ }), xr = (e, t, n) => {
411
423
  let r = e.flex ? `${[
412
424
  70,
413
425
  55,
414
426
  80
415
427
  ][n % 3]}%` : Math.max(32, Math.min(Xe[(t + n) % Xe.length] ?? 72, (e.width ?? 120) - 36));
416
- return /* @__PURE__ */ p(Me, {
428
+ return /* @__PURE__ */ f(Ne, {
417
429
  width: r,
418
430
  height: 14,
419
431
  radius: 6
420
432
  });
421
- }, yr = Array.from({ length: vt }, (e, t) => /* @__PURE__ */ m("tr", {
433
+ }, Sr = Array.from({ length: vt }, (e, t) => /* @__PURE__ */ p("tr", {
422
434
  className: "kapi-table-skrow",
423
435
  "aria-hidden": !0,
424
436
  children: [
425
- C && /* @__PURE__ */ p("td", {
437
+ C && /* @__PURE__ */ f("td", {
426
438
  className: "is-sticky kapi-cbcol",
427
439
  style: { left: 0 },
428
- children: /* @__PURE__ */ p(Me, {
440
+ children: /* @__PURE__ */ f(Ne, {
429
441
  width: 16,
430
442
  height: 16,
431
443
  radius: 5
432
444
  })
433
445
  }),
434
- z && /* @__PURE__ */ p("td", { className: "kapi-expandcol" }),
435
- U.map((e, n) => /* @__PURE__ */ p("td", {
446
+ R && /* @__PURE__ */ f("td", { className: "kapi-expandcol" }),
447
+ H.map((e, n) => /* @__PURE__ */ f("td", {
436
448
  "data-col": e.key,
437
- className: tt(e, n === kn),
449
+ className: tt(e, n === An),
438
450
  style: {
439
- left: q[n],
440
- ...et(e, "td", V)
451
+ left: K[n],
452
+ ...et(e, "td", B)
441
453
  },
442
- children: vr(e, n, t)
454
+ children: xr(e, n, t)
443
455
  }, e.key)),
444
- J && /* @__PURE__ */ p("td", {
456
+ q && /* @__PURE__ */ f("td", {
445
457
  className: "kapi-actcol",
446
- children: /* @__PURE__ */ p(Me, {
458
+ children: /* @__PURE__ */ f(Ne, {
447
459
  width: 28,
448
460
  height: 14,
449
461
  radius: 6,
@@ -451,90 +463,90 @@ function it({ columns: d, rows: h, keyField: b = "id", maxHeight: Be = "58vh", f
451
463
  })
452
464
  })
453
465
  ]
454
- }, `sk-${t}`)), br = C && ft && en.length > 0 ? /* @__PURE__ */ p(Ne, {
455
- count: en.length,
456
- onClear: $t,
466
+ }, `sk-${t}`)), Cr = C && ft && tn.length > 0 ? /* @__PURE__ */ f(Pe, {
467
+ count: tn.length,
468
+ onClear: en,
457
469
  placement: x,
458
470
  children: ft({
459
- ids: en,
460
- clear: $t
471
+ ids: tn,
472
+ clear: en
461
473
  })
462
- }) : null, xr = Bt != null && typeof Bt != "boolean";
463
- return /* @__PURE__ */ m("div", {
474
+ }) : null, wr = Vt != null && typeof Vt != "boolean";
475
+ return /* @__PURE__ */ p("div", {
464
476
  id: Qe,
465
477
  style: qe,
466
- className: r("kapi-table-shell", yt && "kapi-table-shell--card", Ve && "kapi-table-shell--fill", Jn && "kapi-table-shell--cards", Ge),
478
+ className: r("kapi-table-shell", yt && "kapi-table-shell--card", Ve && "kapi-table-shell--fill", Qn && "kapi-table-shell--cards", Ge),
467
479
  children: [
468
- x === "top" && br,
469
- (Ft || xr || M || Dt && An.length > 0) && /* @__PURE__ */ m("div", {
480
+ x === "top" && Cr,
481
+ (Ft || wr || j || Dt && jn.length > 0) && /* @__PURE__ */ p("div", {
470
482
  className: "kapi-tabletools",
471
483
  children: [
472
- Ft && /* @__PURE__ */ p(Fe, {
473
- value: W,
474
- onChange: En,
475
- columns: U,
476
- count: j ? void 0 : {
477
- shown: G.length,
478
- total: h.length
484
+ Ft && /* @__PURE__ */ f(Ie, {
485
+ value: U,
486
+ onChange: Dn,
487
+ columns: H,
488
+ count: zt ? void 0 : {
489
+ shown: W.length,
490
+ total: m.length
479
491
  },
480
- debounce: j ? zt : 0,
481
- labels: N
492
+ debounce: zt ? Bt : 0,
493
+ labels: M
482
494
  }),
483
- Bt,
484
- M && /* @__PURE__ */ m("button", {
495
+ Vt,
496
+ j && /* @__PURE__ */ p("button", {
485
497
  type: "button",
486
498
  className: "kapi-filterchip",
487
- onClick: qn,
488
- children: [/* @__PURE__ */ p(Ue, {
499
+ onClick: Zn,
500
+ children: [/* @__PURE__ */ f(Ue, {
489
501
  size: 14,
490
502
  strokeWidth: 2.2
491
- }), /* @__PURE__ */ p("span", {
503
+ }), /* @__PURE__ */ f("span", {
492
504
  className: "kapi-strong",
493
- children: N.exportCsv
505
+ children: M.exportCsv
494
506
  })]
495
507
  }),
496
- Dt && An.length > 0 && /* @__PURE__ */ m("div", {
508
+ Dt && jn.length > 0 && /* @__PURE__ */ p("div", {
497
509
  className: "kapi-dropdown",
498
510
  onKeyDown: (e) => {
499
- e.key === "Escape" && gn(!1);
511
+ e.key === "Escape" && _n(!1);
500
512
  },
501
- children: [/* @__PURE__ */ m("button", {
513
+ children: [/* @__PURE__ */ p("button", {
502
514
  type: "button",
503
515
  className: "kapi-filterchip",
504
- onClick: () => gn((e) => !e),
516
+ onClick: () => _n((e) => !e),
505
517
  "aria-haspopup": "menu",
506
- "aria-expanded": hn,
518
+ "aria-expanded": gn,
507
519
  children: [
508
- /* @__PURE__ */ p(He, {
520
+ /* @__PURE__ */ f(He, {
509
521
  size: 14,
510
522
  strokeWidth: 2.2
511
523
  }),
512
- /* @__PURE__ */ p("span", {
524
+ /* @__PURE__ */ f("span", {
513
525
  className: "kapi-strong",
514
- children: N.columns
526
+ children: M.columns
515
527
  }),
516
- /* @__PURE__ */ p(ze, {
528
+ /* @__PURE__ */ f(ze, {
517
529
  size: 14,
518
530
  strokeWidth: 2.2,
519
531
  color: "var(--kapi-muted-2)"
520
532
  })
521
533
  ]
522
- }), hn && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
534
+ }), gn && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
523
535
  className: "kapi-dropdown__backdrop",
524
- onClick: () => gn(!1)
525
- }), /* @__PURE__ */ p("div", {
536
+ onClick: () => _n(!1)
537
+ }), /* @__PURE__ */ f("div", {
526
538
  className: "kapi-menu kapi-dropdown__menu kapi-dropdown__menu--down kapi-tabletools__menu",
527
539
  role: "menu",
528
- "aria-label": N.columns,
529
- children: An.map((e) => {
530
- let t = B[e.key] !== !1;
531
- return /* @__PURE__ */ m("button", {
540
+ "aria-label": M.columns,
541
+ children: jn.map((e) => {
542
+ let t = z[e.key] !== !1;
543
+ return /* @__PURE__ */ p("button", {
532
544
  type: "button",
533
545
  role: "menuitemcheckbox",
534
546
  "aria-checked": t,
535
547
  className: `kapi-menu__item${t ? " kapi-menu__item--on" : ""}`,
536
- onClick: () => _n(e.key),
537
- children: [/* @__PURE__ */ p("span", { children: e.label }), t && /* @__PURE__ */ p(Re, {
548
+ onClick: () => vn(e.key),
549
+ children: [/* @__PURE__ */ f("span", { children: e.label }), t && /* @__PURE__ */ f(Re, {
538
550
  size: 14,
539
551
  strokeWidth: 2.6,
540
552
  color: "var(--kapi-primary)"
@@ -545,142 +557,142 @@ function it({ columns: d, rows: h, keyField: b = "id", maxHeight: Be = "58vh", f
545
557
  })
546
558
  ]
547
559
  }),
548
- O !== void 0 && C && /* @__PURE__ */ m("div", {
549
- className: Nn === "none" ? void 0 : "kapi-table__dataset",
560
+ O !== void 0 && C && /* @__PURE__ */ p("div", {
561
+ className: Pn === "none" ? void 0 : "kapi-table__dataset",
550
562
  role: "status",
551
- children: [Nn === "offer" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", { children: (O.hintLabel ?? ke)(Z.length, O.total) }), /* @__PURE__ */ p("button", {
563
+ children: [Pn === "offer" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", { children: (O.hintLabel ?? Ae)(X.length, O.total) }), /* @__PURE__ */ f("button", {
552
564
  type: "button",
553
565
  className: "kapi-link",
554
566
  onClick: O.onSelect,
555
- children: (O.actionLabel ?? Oe)(O.total)
556
- })] }), Nn === "selected" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", { children: (O.selectedLabel ?? je)(O.total) }), O.onClear && /* @__PURE__ */ p("button", {
567
+ children: (O.actionLabel ?? ke)(O.total)
568
+ })] }), Pn === "selected" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", { children: (O.selectedLabel ?? Me)(O.total) }), O.onClear && /* @__PURE__ */ f("button", {
557
569
  type: "button",
558
570
  className: "kapi-link",
559
571
  onClick: O.onClear,
560
- children: N.datasetClear
572
+ children: M.datasetClear
561
573
  })] })]
562
574
  }),
563
- /* @__PURE__ */ m("div", {
564
- className: "kapi-tablewrap",
565
- ref: F,
575
+ /* @__PURE__ */ p("div", {
576
+ className: `kapi-tablewrap${Wn ? " is-corta-derecha" : ""}`,
577
+ ref: P,
566
578
  tabIndex: 0,
567
579
  style: Ve ? void 0 : { maxHeight: Be },
568
- onScroll: Wn,
580
+ onScroll: Jn,
569
581
  children: [
570
- /* @__PURE__ */ m("table", {
571
- ref: Sn,
582
+ /* @__PURE__ */ p("table", {
583
+ ref: Cn,
572
584
  className: `kapi-table2${T ? " is-virtual" : ""}${Tt === "card" ? " kapi-table2--card" : ""}${Et ? " kapi-table2--hover" : ""}`,
573
- children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [
574
- C && /* @__PURE__ */ m("th", {
575
- className: `is-sticky kapi-cbcol${K ? " kapi-cbcol--presets" : ""}`,
585
+ children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [
586
+ C && /* @__PURE__ */ p("th", {
587
+ className: `is-sticky kapi-cbcol${G ? " kapi-cbcol--presets" : ""}`,
576
588
  style: { left: 0 },
577
- children: [/* @__PURE__ */ p("label", {
589
+ children: [/* @__PURE__ */ f("label", {
578
590
  className: "kapi-check kapi-check--block",
579
- children: /* @__PURE__ */ p("input", {
591
+ children: /* @__PURE__ */ f("input", {
580
592
  type: "checkbox",
581
- checked: Mn === "all",
593
+ checked: Nn === "all",
582
594
  ref: (e) => {
583
- e && (e.indeterminate = Mn === "some");
595
+ e && (e.indeterminate = Nn === "some");
584
596
  },
585
- onChange: () => L(he(I, Z)),
586
- "aria-label": N.selectAll
597
+ onChange: () => I(ge(F, X)),
598
+ "aria-label": M.selectAll
587
599
  })
588
- }), K && /* @__PURE__ */ p(be, {
600
+ }), G && /* @__PURE__ */ f(xe, {
589
601
  label: null,
590
- "aria-label": N.selectMatching,
602
+ "aria-label": M.selectMatching,
591
603
  variant: "ghost",
592
- items: jn
604
+ items: Mn
593
605
  })]
594
606
  }),
595
- z && /* @__PURE__ */ p("th", {
607
+ R && /* @__PURE__ */ f("th", {
596
608
  className: "kapi-expandcol",
597
- children: /* @__PURE__ */ p("span", {
609
+ children: /* @__PURE__ */ f("span", {
598
610
  className: "kapi-sr-only",
599
- children: N.expandColumn
611
+ children: M.expandColumn
600
612
  })
601
613
  }),
602
- U.map((e, t) => /* @__PURE__ */ m("th", {
614
+ H.map((e, t) => /* @__PURE__ */ p("th", {
603
615
  "data-col": e.key,
604
- className: `${tt(e, t === kn)}${e.sortable ? " is-sortable" : ""}`,
605
- "aria-sort": $n(e),
616
+ className: `${tt(e, t === An)}${e.sortable ? " is-sortable" : ""}`,
617
+ "aria-sort": nr(e),
606
618
  style: {
607
- left: q[t],
608
- ...et(e, "th", V),
619
+ left: K[t],
620
+ ...et(e, "th", B),
609
621
  textAlign: e.align
610
622
  },
611
- children: [Qn(e), mr(e)]
623
+ children: [tr(e), _r(e)]
612
624
  }, e.key)),
613
- J && /* @__PURE__ */ p("th", {
625
+ q && /* @__PURE__ */ f("th", {
614
626
  className: "kapi-actcol",
615
- children: N.actions
627
+ children: M.actions
616
628
  })
617
- ] }) }), /* @__PURE__ */ m("tbody", { children: [
618
- k && (vt > 0 ? yr : _r(Ut, !0)),
619
- !k && G.length === 0 && _r(Ht),
620
- !k && G.length > 0 && Ln > 0 && /* @__PURE__ */ p("tr", {
629
+ ] }) }), /* @__PURE__ */ p("tbody", { children: [
630
+ k && (vt > 0 ? Sr : br(Wt, !0)),
631
+ !k && W.length === 0 && br(Ut),
632
+ !k && W.length > 0 && Rn > 0 && /* @__PURE__ */ f("tr", {
621
633
  "aria-hidden": !0,
622
- style: { height: Ln },
623
- children: /* @__PURE__ */ p("td", {
624
- colSpan: Y,
634
+ style: { height: Rn },
635
+ children: /* @__PURE__ */ f("td", {
636
+ colSpan: J,
625
637
  className: "kapi-table-pad"
626
638
  })
627
639
  }),
628
- !k && zn.map((e, t) => {
629
- let n = e[b], r = !A || A(e), i = Bn + Fn + t + 1;
630
- return /* @__PURE__ */ p(at, {
640
+ !k && Bn.map((e, t) => {
641
+ let n = e[b], r = !A || A(e), i = Vn + In + t + 1;
642
+ return /* @__PURE__ */ f(at, {
631
643
  row: e,
632
644
  id: n,
633
- selected: I.has(n),
634
- selectLabel: C ? u(e, U, i, N, lt) : "",
635
- open: z && un.has(n),
645
+ selected: F.has(n),
646
+ selectLabel: C ? l(e, H, i, M, lt) : "",
647
+ open: R && dn.has(n),
636
648
  canSelect: r,
637
649
  clickSelect: C && ct && r,
638
650
  rangeSelect: pt,
639
651
  selectable: C,
640
- expandable: z,
652
+ expandable: R,
641
653
  rowHeight: T ? E : void 0,
642
- columns: U,
643
- lefts: q,
644
- lastSticky: kn,
645
- widths: V,
646
- text: N,
654
+ columns: H,
655
+ lefts: K,
656
+ lastSticky: An,
657
+ widths: B,
658
+ text: M,
647
659
  onCopy: st,
648
- hasActions: J,
660
+ hasActions: q,
649
661
  actions: it,
650
662
  rowMenu: S,
651
663
  renderSubComponent: St,
652
- colSpan: Y,
653
- handlers: Zn
664
+ colSpan: J,
665
+ handlers: er
654
666
  }, n);
655
667
  }),
656
- !k && G.length > 0 && Rn > 0 && /* @__PURE__ */ p("tr", {
668
+ !k && W.length > 0 && zn > 0 && /* @__PURE__ */ f("tr", {
657
669
  "aria-hidden": !0,
658
- style: { height: Rn },
659
- children: /* @__PURE__ */ p("td", {
660
- colSpan: Y,
670
+ style: { height: zn },
671
+ children: /* @__PURE__ */ f("td", {
672
+ colSpan: J,
661
673
  className: "kapi-table-pad"
662
674
  })
663
675
  })
664
676
  ] })]
665
677
  }),
666
- Gt && ot && /* @__PURE__ */ p(ye, {
678
+ Kt && ot && /* @__PURE__ */ f(be, {
667
679
  open: !0,
668
- x: Gt.x,
669
- y: Gt.y,
680
+ x: Kt.x,
681
+ y: Kt.y,
670
682
  items: ot,
671
- onClose: () => Kt(null)
683
+ onClose: () => qt(null)
672
684
  }),
673
- P && /* @__PURE__ */ p(ye, {
685
+ N && /* @__PURE__ */ f(be, {
674
686
  open: !0,
675
- x: P.x,
676
- y: P.y,
677
- items: P.items,
678
- onClose: () => qt(null)
687
+ x: N.x,
688
+ y: N.y,
689
+ items: N.items,
690
+ onClose: () => Jt(null)
679
691
  })
680
692
  ]
681
693
  }),
682
- x === "bottom" && br,
683
- D && $ && /* @__PURE__ */ p(Pe, {
694
+ x === "bottom" && Cr,
695
+ D && $ && /* @__PURE__ */ f(Fe, {
684
696
  as: "div",
685
697
  info: $,
686
698
  pageSize: D.pageSize,
@@ -689,74 +701,74 @@ function it({ columns: d, rows: h, keyField: b = "id", maxHeight: Be = "58vh", f
689
701
  pageSizeOptions: D.pageSizeOptions,
690
702
  onPageSizeChange: D.onPageSizeChange,
691
703
  showEdges: D.showEdges ?? !0,
692
- labels: N
704
+ labels: M
693
705
  })
694
706
  ]
695
707
  });
696
708
  }
697
- function S({ row: e, id: t, selected: n, selectLabel: r, open: i, canSelect: a, clickSelect: o, rangeSelect: ee, selectable: s, expandable: te, rowHeight: ne, columns: re, lefts: ie, lastSticky: ae, widths: oe, text: c, onCopy: se, hasActions: ce, actions: le, rowMenu: ue, renderSubComponent: l, colSpan: de, handlers: u }) {
698
- return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("tr", {
709
+ function S({ row: e, id: t, selected: n, selectLabel: r, open: i, canSelect: a, clickSelect: o, rangeSelect: ee, selectable: te, expandable: ne, rowHeight: re, columns: ie, lefts: ae, lastSticky: oe, widths: se, text: s, onCopy: ce, hasActions: le, actions: ue, rowMenu: de, renderSubComponent: c, colSpan: fe, handlers: l }) {
710
+ return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("tr", {
699
711
  className: `${n ? "is-selected" : ""}${o ? " is-rowsel" : ""}`,
700
- style: ne === void 0 ? void 0 : { height: ne },
712
+ style: re === void 0 ? void 0 : { height: re },
701
713
  onClick: o ? (e) => {
702
- e.target.closest(qe) || u.activate(t, e.shiftKey);
714
+ e.target.closest(qe) || l.activate(t, e.shiftKey);
703
715
  } : void 0,
704
716
  onMouseDown: o ? (e) => {
705
717
  ee && e.shiftKey && e.preventDefault();
706
718
  } : void 0,
707
719
  children: [
708
- s && /* @__PURE__ */ p("td", {
720
+ te && /* @__PURE__ */ f("td", {
709
721
  className: "is-sticky kapi-cbcol",
710
722
  style: { left: 0 },
711
- children: /* @__PURE__ */ p("label", {
723
+ children: /* @__PURE__ */ f("label", {
712
724
  className: "kapi-check kapi-check--block",
713
- children: /* @__PURE__ */ p("input", {
725
+ children: /* @__PURE__ */ f("input", {
714
726
  type: "checkbox",
715
727
  checked: n,
716
728
  disabled: !a,
717
729
  onClick: (e) => {
718
- a && u.activate(t, e.shiftKey);
730
+ a && l.activate(t, e.shiftKey);
719
731
  },
720
732
  onChange: () => void 0,
721
733
  "aria-label": r
722
734
  })
723
735
  })
724
736
  }),
725
- te && /* @__PURE__ */ p("td", {
737
+ ne && /* @__PURE__ */ f("td", {
726
738
  className: "kapi-expandcol",
727
- children: /* @__PURE__ */ p("button", {
739
+ children: /* @__PURE__ */ f("button", {
728
740
  type: "button",
729
741
  className: "kapi-expandcol__btn",
730
- "aria-label": c.expandRow,
742
+ "aria-label": s.expandRow,
731
743
  "aria-expanded": i,
732
- onClick: () => u.toggleExpanded(t),
733
- children: p(i ? ze : b, {
744
+ onClick: () => l.toggleExpanded(t),
745
+ children: f(i ? ze : b, {
734
746
  size: 16,
735
747
  strokeWidth: 2
736
748
  })
737
749
  })
738
750
  }),
739
- re.map((t, n) => /* @__PURE__ */ p("td", {
751
+ ie.map((t, n) => /* @__PURE__ */ f("td", {
740
752
  "data-col": t.key,
741
- className: tt(t, n === ae),
753
+ className: tt(t, n === oe),
742
754
  style: {
743
- left: ie[n],
744
- ...et(t, "td", oe),
755
+ left: ae[n],
756
+ ...et(t, "td", se),
745
757
  textAlign: t.align
746
758
  },
747
759
  "data-label": typeof t.label == "string" || typeof t.label == "number" ? String(t.label) : void 0,
748
- children: nt(t, e, c, se)
760
+ children: nt(t, e, s, ce)
749
761
  }, t.key)),
750
- ce && /* @__PURE__ */ p("td", {
762
+ le && /* @__PURE__ */ f("td", {
751
763
  className: "kapi-actcol",
752
- children: /* @__PURE__ */ m("div", {
764
+ children: /* @__PURE__ */ p("div", {
753
765
  className: "kapi-actcol__in",
754
- children: [le ? le(e) : null, ue && /* @__PURE__ */ p("button", {
766
+ children: [ue ? ue(e) : null, de && /* @__PURE__ */ f("button", {
755
767
  type: "button",
756
768
  className: "kapi-actcol__dots",
757
- "aria-label": c.moreActions,
758
- onClick: (t) => u.openMenu(t, e),
759
- children: /* @__PURE__ */ p(Ge, {
769
+ "aria-label": s.moreActions,
770
+ onClick: (t) => l.openMenu(t, e),
771
+ children: /* @__PURE__ */ f(Ge, {
760
772
  size: 16,
761
773
  strokeWidth: 2
762
774
  })
@@ -764,14 +776,14 @@ function S({ row: e, id: t, selected: n, selectLabel: r, open: i, canSelect: a,
764
776
  })
765
777
  })
766
778
  ]
767
- }), i && l && /* @__PURE__ */ p("tr", {
779
+ }), i && c && /* @__PURE__ */ f("tr", {
768
780
  className: "kapi-subrow",
769
- children: /* @__PURE__ */ p("td", {
770
- colSpan: de,
771
- children: l(e)
781
+ children: /* @__PURE__ */ f("td", {
782
+ colSpan: fe,
783
+ children: c(e)
772
784
  })
773
785
  })] });
774
786
  }
775
- var at = h(S);
787
+ var at = m(S);
776
788
  //#endregion
777
789
  export { Ke as DEFAULT_TABLE_LABELS, it as KapiTable };