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