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