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