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