better-table 1.1.0 → 1.3.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 +187 -18
- package/dist/better-table.cjs.js +1 -1
- package/dist/better-table.cjs.js.map +1 -1
- package/dist/better-table.css +1 -1
- package/dist/better-table.es.js +2225 -980
- package/dist/better-table.es.js.map +1 -1
- package/dist/components/BetterTable/__tests__/helpers/test-data.d.ts +125 -0
- package/dist/components/BetterTable/components/TableActionOverflow.d.ts +16 -0
- package/dist/components/BetterTable/components/TableColumnVisibility.d.ts +4 -0
- package/dist/components/BetterTable/components/TableExpandedRow.d.ts +8 -0
- package/dist/components/BetterTable/components/TableFilterPanel.d.ts +7 -0
- package/dist/components/BetterTable/components/TableFloatingFilter.d.ts +8 -0
- package/dist/components/BetterTable/components/TableRow.d.ts +2 -1
- package/dist/components/BetterTable/components/TableVirtualBody.d.ts +10 -0
- package/dist/components/BetterTable/components/index.d.ts +6 -0
- package/dist/components/BetterTable/constants.d.ts +20 -0
- package/dist/components/BetterTable/context/TableContext.d.ts +15 -65
- package/dist/components/BetterTable/context/TableDataContext.d.ts +18 -0
- package/dist/components/BetterTable/context/TableFilterContext.d.ts +17 -0
- package/dist/components/BetterTable/context/TablePaginationContext.d.ts +19 -0
- package/dist/components/BetterTable/context/TableSelectionContext.d.ts +15 -0
- package/dist/components/BetterTable/context/TableSortContext.d.ts +10 -0
- package/dist/components/BetterTable/context/TableUIContext.d.ts +33 -0
- package/dist/components/BetterTable/context/index.d.ts +14 -2
- package/dist/components/BetterTable/hooks/index.d.ts +6 -0
- package/dist/components/BetterTable/hooks/useColumnResize.d.ts +23 -0
- package/dist/components/BetterTable/hooks/useColumnVisibility.d.ts +24 -0
- package/dist/components/BetterTable/hooks/useExpandableRows.d.ts +19 -0
- package/dist/components/BetterTable/hooks/useFocusTrap.d.ts +6 -0
- package/dist/components/BetterTable/hooks/useMediaQuery.d.ts +8 -0
- package/dist/components/BetterTable/hooks/useTableFilter.d.ts +5 -3
- package/dist/components/BetterTable/hooks/useTablePagination.d.ts +3 -1
- package/dist/components/BetterTable/hooks/useTableSearch.d.ts +3 -1
- package/dist/components/BetterTable/hooks/useTableSort.d.ts +14 -2
- package/dist/components/BetterTable/hooks/useVirtualization.d.ts +25 -0
- package/dist/components/BetterTable/index.d.ts +5 -4
- package/dist/components/BetterTable/types.d.ts +178 -5
- package/dist/components/BetterTable/utils/sortData.d.ts +8 -1
- package/dist/index.d.ts +6 -5
- package/package.json +24 -15
package/dist/better-table.es.js
CHANGED
|
@@ -1,417 +1,819 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
1
|
+
import z, { createContext as Z, useContext as Q, useCallback as N, useMemo as A, useState as I, useRef as O, useEffect as $ } from "react";
|
|
2
|
+
import { jsx as n, jsxs as C, Fragment as un } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal as hn } from "react-dom";
|
|
3
4
|
import "./styles.js";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
noData: "No hay datos",
|
|
8
|
-
loading: "Cargando...",
|
|
9
|
-
page: "Página",
|
|
10
|
-
of: "de",
|
|
11
|
-
items: "elementos",
|
|
12
|
-
selected: "seleccionados",
|
|
13
|
-
rowsPerPage: "Filas por página",
|
|
14
|
-
actions: "Acciones",
|
|
15
|
-
sortAsc: "Ordenar ascendente",
|
|
16
|
-
sortDesc: "Ordenar descendente",
|
|
17
|
-
filterBy: "Filtrar por",
|
|
18
|
-
clearFilters: "Limpiar filtros",
|
|
19
|
-
selectAll: "Seleccionar todo",
|
|
20
|
-
deselectAll: "Deseleccionar todo"
|
|
21
|
-
}, $e = Ke(null);
|
|
22
|
-
function w() {
|
|
23
|
-
const e = Ee($e);
|
|
5
|
+
const Tt = Z(null);
|
|
6
|
+
function j() {
|
|
7
|
+
const e = Q(Tt);
|
|
24
8
|
if (!e)
|
|
25
|
-
throw new Error("
|
|
9
|
+
throw new Error("useTableData must be used within a TableProvider");
|
|
26
10
|
return e;
|
|
27
11
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
const bn = Tt.Provider, Pt = Z(null);
|
|
13
|
+
function fn() {
|
|
14
|
+
const e = Q(Pt);
|
|
15
|
+
if (!e)
|
|
16
|
+
throw new Error("useTableSortContext must be used within a TableProvider");
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
const pn = Pt.Provider, Dt = Z(null);
|
|
20
|
+
function ce() {
|
|
21
|
+
const e = Q(Dt);
|
|
22
|
+
if (!e)
|
|
23
|
+
throw new Error("useTableFilterContext must be used within a TableProvider");
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
const mn = Dt.Provider, Lt = Z(null);
|
|
27
|
+
function U() {
|
|
28
|
+
const e = Q(Lt);
|
|
29
|
+
if (!e)
|
|
30
|
+
throw new Error("useTableSelectionContext must be used within a TableProvider");
|
|
31
|
+
return e;
|
|
32
|
+
}
|
|
33
|
+
const gn = Lt.Provider, At = Z(null);
|
|
34
|
+
function vn() {
|
|
35
|
+
const e = Q(At);
|
|
36
|
+
if (!e)
|
|
37
|
+
throw new Error("useTablePaginationContext must be used within a TableProvider");
|
|
38
|
+
return e;
|
|
39
|
+
}
|
|
40
|
+
const yn = At.Provider, It = Z(null);
|
|
41
|
+
function R() {
|
|
42
|
+
const e = Q(It);
|
|
43
|
+
if (!e)
|
|
44
|
+
throw new Error("useTableUI must be used within a TableProvider");
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
const wn = It.Provider;
|
|
48
|
+
function Cn({
|
|
49
|
+
data: e,
|
|
50
|
+
sort: t,
|
|
51
|
+
filter: i,
|
|
52
|
+
selection: r,
|
|
53
|
+
pagination: o,
|
|
54
|
+
ui: l,
|
|
55
|
+
children: s
|
|
31
56
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ n(bn, { value: e, children: /* @__PURE__ */ n(pn, { value: t, children: /* @__PURE__ */ n(mn, { value: i, children: /* @__PURE__ */ n(gn, { value: r, children: /* @__PURE__ */ n(yn, { value: o, children: /* @__PURE__ */ n(wn, { value: l, children: s }) }) }) }) }) });
|
|
33
58
|
}
|
|
34
|
-
function
|
|
35
|
-
var t,
|
|
36
|
-
if (typeof e == "string" || typeof e == "number")
|
|
59
|
+
function Et(e) {
|
|
60
|
+
var t, i, r = "";
|
|
61
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
37
62
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
38
|
-
var
|
|
39
|
-
for (t = 0; t <
|
|
40
|
-
} else for (
|
|
41
|
-
return
|
|
63
|
+
var o = e.length;
|
|
64
|
+
for (t = 0; t < o; t++) e[t] && (i = Et(e[t])) && (r && (r += " "), r += i);
|
|
65
|
+
} else for (i in e) e[i] && (r && (r += " "), r += i);
|
|
66
|
+
return r;
|
|
67
|
+
}
|
|
68
|
+
function D() {
|
|
69
|
+
for (var e, t, i = 0, r = "", o = arguments.length; i < o; i++) (e = arguments[i]) && (t = Et(e)) && (r && (r += " "), r += t);
|
|
70
|
+
return r;
|
|
71
|
+
}
|
|
72
|
+
function Nn() {
|
|
73
|
+
return /* @__PURE__ */ C("svg", { className: "bt-sort-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
74
|
+
/* @__PURE__ */ n("path", { d: "M7 2.5L10 5.5H4L7 2.5Z", fill: "currentColor", opacity: "0.4" }),
|
|
75
|
+
/* @__PURE__ */ n("path", { d: "M7 11.5L4 8.5H10L7 11.5Z", fill: "currentColor", opacity: "0.4" })
|
|
76
|
+
] });
|
|
42
77
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
78
|
+
function xn() {
|
|
79
|
+
return /* @__PURE__ */ C("svg", { className: "bt-sort-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
80
|
+
/* @__PURE__ */ n("path", { d: "M7 2.5L10 5.5H4L7 2.5Z", fill: "currentColor" }),
|
|
81
|
+
/* @__PURE__ */ n("path", { d: "M7 11.5L4 8.5H10L7 11.5Z", fill: "currentColor", opacity: "0.2" })
|
|
82
|
+
] });
|
|
46
83
|
}
|
|
47
|
-
function
|
|
84
|
+
function kn() {
|
|
85
|
+
return /* @__PURE__ */ C("svg", { className: "bt-sort-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
86
|
+
/* @__PURE__ */ n("path", { d: "M7 2.5L10 5.5H4L7 2.5Z", fill: "currentColor", opacity: "0.2" }),
|
|
87
|
+
/* @__PURE__ */ n("path", { d: "M7 11.5L4 8.5H10L7 11.5Z", fill: "currentColor" })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
function Sn({
|
|
48
91
|
column: e
|
|
49
92
|
}) {
|
|
50
|
-
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
filters: n,
|
|
54
|
-
setFilter: s,
|
|
55
|
-
locale: a
|
|
56
|
-
} = w(), r = t.columnId === e.id, b = r ? t.direction : null, o = m(() => {
|
|
57
|
-
e.sortable !== !1 && l(e.id);
|
|
58
|
-
}, [e.id, e.sortable, l]), h = m(
|
|
59
|
-
(u) => {
|
|
60
|
-
const v = u.target.value;
|
|
61
|
-
e.type === "boolean" ? v === "" ? s(e.id, null) : s(e.id, v === "true") : s(e.id, v || null);
|
|
93
|
+
const { sortState: t, handleSort: i, multiSortState: r, isMultiSort: o } = fn(), { locale: l, resizable: s, startResize: d, getColumnWidth: c } = R(), a = e.resizable !== void 0 ? e.resizable : s, u = N(
|
|
94
|
+
(w) => {
|
|
95
|
+
w.preventDefault(), w.stopPropagation(), d(e.id, w.clientX);
|
|
62
96
|
},
|
|
63
|
-
[e.id,
|
|
64
|
-
), f = m(
|
|
65
|
-
(
|
|
66
|
-
|
|
97
|
+
[e.id, d]
|
|
98
|
+
), h = t.columnId === e.id, b = o ? r.findIndex((w) => w.columnId === e.id) : -1, f = b >= 0, v = f ? r[b].direction : null, m = o && r.length > 1 && f, P = o ? f : h, S = o ? v : h ? t.direction : null, x = N(() => {
|
|
99
|
+
e.sortable !== !1 && i(e.id);
|
|
100
|
+
}, [e.id, e.sortable, i]), y = N(
|
|
101
|
+
(w) => {
|
|
102
|
+
w.key === "Enter" && e.sortable !== !1 && i(e.id);
|
|
67
103
|
},
|
|
68
|
-
[e.id, e.sortable,
|
|
69
|
-
),
|
|
70
|
-
"
|
|
71
|
-
{
|
|
72
|
-
className: P("bt-sort-btn", r && "bt-active"),
|
|
73
|
-
onClick: o,
|
|
74
|
-
"aria-label": b === "asc" ? a.sortDesc : a.sortAsc,
|
|
75
|
-
type: "button",
|
|
76
|
-
children: r ? b === "asc" ? "↑" : "↓" : "⇅"
|
|
77
|
-
}
|
|
78
|
-
), p = () => {
|
|
79
|
-
if (e.filterable === !1 || e.type === "custom")
|
|
104
|
+
[e.id, e.sortable, i]
|
|
105
|
+
), g = () => {
|
|
106
|
+
if (e.sortable === !1 || e.type === "custom")
|
|
80
107
|
return null;
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
"
|
|
108
|
+
const w = P ? S === "asc" ? xn : kn : Nn;
|
|
109
|
+
return /* @__PURE__ */ C(
|
|
110
|
+
"button",
|
|
84
111
|
{
|
|
85
|
-
className: "bt-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
112
|
+
className: D("bt-sort-btn", P && "bt-active"),
|
|
113
|
+
onClick: x,
|
|
114
|
+
"aria-label": S === "asc" ? l.sortDesc : l.sortAsc,
|
|
115
|
+
type: "button",
|
|
89
116
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */ i("option", { value: "false", children: "❌" })
|
|
117
|
+
/* @__PURE__ */ n(w, {}),
|
|
118
|
+
m && /* @__PURE__ */ n("span", { className: "bt-sort-priority", "aria-label": `${l.sortPriority} ${b + 1}`, children: b + 1 })
|
|
93
119
|
]
|
|
94
120
|
}
|
|
95
|
-
)
|
|
96
|
-
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
if (e.headerCell) {
|
|
124
|
+
const w = c(e.id);
|
|
125
|
+
return /* @__PURE__ */ C(
|
|
126
|
+
"th",
|
|
97
127
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
128
|
+
className: D("bt-th", e.align && `bt-align-${e.align}`, a && "bt-th-resizable"),
|
|
129
|
+
style: { width: w ?? e.width },
|
|
130
|
+
"data-column-id": e.id,
|
|
131
|
+
children: [
|
|
132
|
+
e.headerCell(e),
|
|
133
|
+
a && /* @__PURE__ */ n(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
className: "bt-resize-handle",
|
|
137
|
+
onMouseDown: u,
|
|
138
|
+
role: "separator",
|
|
139
|
+
"aria-orientation": "vertical",
|
|
140
|
+
"aria-label": `Resize ${e.header}`
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
104
144
|
}
|
|
105
145
|
);
|
|
106
|
-
}
|
|
107
|
-
return
|
|
108
|
-
"th",
|
|
109
|
-
{
|
|
110
|
-
className: P("bt-th", e.align && `bt-align-${e.align}`),
|
|
111
|
-
style: { width: e.width },
|
|
112
|
-
children: e.headerCell(e)
|
|
113
|
-
}
|
|
114
|
-
) : /* @__PURE__ */ i(
|
|
146
|
+
}
|
|
147
|
+
return /* @__PURE__ */ C(
|
|
115
148
|
"th",
|
|
116
149
|
{
|
|
117
|
-
className:
|
|
118
|
-
style: { width: e.width },
|
|
150
|
+
className: D("bt-th", e.align && `bt-align-${e.align}`, P && "bt-sorted", a && "bt-th-resizable"),
|
|
151
|
+
style: { width: c(e.id) ?? e.width },
|
|
152
|
+
"data-column-id": e.id,
|
|
119
153
|
role: "columnheader",
|
|
120
|
-
"aria-sort":
|
|
154
|
+
"aria-sort": P ? S === "asc" ? "ascending" : "descending" : void 0,
|
|
121
155
|
tabIndex: e.sortable !== !1 ? 0 : void 0,
|
|
122
|
-
onKeyDown: e.sortable !== !1 ?
|
|
123
|
-
children:
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
127
|
-
] }),
|
|
128
|
-
|
|
129
|
-
|
|
156
|
+
onKeyDown: e.sortable !== !1 ? y : void 0,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ n("div", { className: "bt-th-content", children: /* @__PURE__ */ C("div", { className: "bt-th-header", children: [
|
|
159
|
+
/* @__PURE__ */ n("span", { className: "bt-th-title", children: e.header }),
|
|
160
|
+
g()
|
|
161
|
+
] }) }),
|
|
162
|
+
a && /* @__PURE__ */ n(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
className: "bt-resize-handle",
|
|
166
|
+
onMouseDown: u,
|
|
167
|
+
role: "separator",
|
|
168
|
+
"aria-orientation": "vertical",
|
|
169
|
+
"aria-label": `Resize ${e.header}`
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
]
|
|
130
173
|
}
|
|
131
174
|
);
|
|
132
175
|
}
|
|
133
|
-
const
|
|
134
|
-
|
|
176
|
+
const Tn = z.memo(
|
|
177
|
+
Sn
|
|
178
|
+
), Nt = () => /* @__PURE__ */ n(
|
|
179
|
+
"svg",
|
|
180
|
+
{
|
|
181
|
+
className: "bt-ff-icon",
|
|
182
|
+
width: "12",
|
|
183
|
+
height: "12",
|
|
184
|
+
viewBox: "0 0 16 16",
|
|
185
|
+
fill: "none",
|
|
186
|
+
stroke: "currentColor",
|
|
187
|
+
strokeWidth: "1.5",
|
|
188
|
+
strokeLinecap: "round",
|
|
189
|
+
strokeLinejoin: "round",
|
|
190
|
+
"aria-hidden": "true",
|
|
191
|
+
children: /* @__PURE__ */ n("path", { d: "M1.5 2h13L9.5 8.5V14l-3-1.5V8.5z" })
|
|
192
|
+
}
|
|
135
193
|
);
|
|
136
|
-
function
|
|
137
|
-
const {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
194
|
+
function Pn() {
|
|
195
|
+
const { visibleColumns: e, rowActions: t, expandableEnabled: i } = j(), { filters: r, setFilter: o } = ce(), { selectable: l, selectionMode: s } = U(), { locale: d, stickyHeader: c } = R(), a = t && t.length > 0;
|
|
196
|
+
return e.some(
|
|
197
|
+
(h) => h.filterable !== !1 && h.type !== "custom"
|
|
198
|
+
) ? /* @__PURE__ */ C("tr", { className: D("bt-tr", "bt-floating-filter-row", c && "bt-sticky-filter"), children: [
|
|
199
|
+
i && /* @__PURE__ */ n("th", { className: "bt-th bt-floating-filter-cell bt-expand-cell" }),
|
|
200
|
+
l && s === "multiple" && /* @__PURE__ */ n("th", { className: "bt-th bt-floating-filter-cell bt-checkbox-cell" }),
|
|
201
|
+
l && s === "single" && /* @__PURE__ */ n("th", { className: "bt-th bt-floating-filter-cell bt-checkbox-cell" }),
|
|
202
|
+
e.map((h) => /* @__PURE__ */ n(
|
|
203
|
+
"th",
|
|
204
|
+
{
|
|
205
|
+
className: D(
|
|
206
|
+
"bt-th",
|
|
207
|
+
"bt-floating-filter-cell",
|
|
208
|
+
h.align && `bt-align-${h.align}`
|
|
209
|
+
),
|
|
210
|
+
style: { width: h.width },
|
|
211
|
+
children: h.filterable !== !1 && h.type !== "custom" ? /* @__PURE__ */ n(
|
|
212
|
+
Ln,
|
|
213
|
+
{
|
|
214
|
+
column: h,
|
|
215
|
+
value: r[h.id],
|
|
216
|
+
setFilter: o,
|
|
217
|
+
locale: d
|
|
218
|
+
}
|
|
219
|
+
) : null
|
|
220
|
+
},
|
|
221
|
+
h.id
|
|
222
|
+
)),
|
|
223
|
+
a && /* @__PURE__ */ n("th", { className: "bt-th bt-floating-filter-cell bt-actions-cell" })
|
|
224
|
+
] }) : null;
|
|
225
|
+
}
|
|
226
|
+
function Dn({
|
|
227
|
+
column: e,
|
|
228
|
+
value: t,
|
|
229
|
+
setFilter: i,
|
|
230
|
+
locale: r
|
|
231
|
+
}) {
|
|
232
|
+
const o = N(
|
|
233
|
+
(c) => {
|
|
234
|
+
const a = c.target.value;
|
|
235
|
+
e.type === "boolean" ? a === "" ? i(e.id, null) : i(e.id, a === "true") : i(e.id, a || null);
|
|
236
|
+
},
|
|
237
|
+
[e.id, e.type, i]
|
|
238
|
+
), l = N(
|
|
239
|
+
(c, a) => {
|
|
240
|
+
const h = { ...t ?? {}, [c]: a || void 0 };
|
|
241
|
+
i(e.id, h);
|
|
242
|
+
},
|
|
243
|
+
[e.id, t, i]
|
|
244
|
+
), s = `bt-ff-${e.id}`, d = A(() => {
|
|
245
|
+
if (t == null) return !1;
|
|
246
|
+
if (typeof t == "object") {
|
|
247
|
+
const c = t;
|
|
248
|
+
return !!(c.from || c.to);
|
|
249
|
+
}
|
|
250
|
+
return t !== "";
|
|
251
|
+
}, [t]);
|
|
252
|
+
if (e.type === "boolean")
|
|
253
|
+
return /* @__PURE__ */ C("div", { className: D("bt-ff-wrapper", d && "bt-ff-active"), children: [
|
|
254
|
+
/* @__PURE__ */ n(Nt, {}),
|
|
255
|
+
/* @__PURE__ */ C(
|
|
256
|
+
"select",
|
|
257
|
+
{
|
|
258
|
+
id: s,
|
|
259
|
+
name: s,
|
|
260
|
+
className: "bt-floating-filter-select",
|
|
261
|
+
value: t == null ? "" : String(t),
|
|
262
|
+
onChange: o,
|
|
263
|
+
"aria-label": `${r.filterBy} ${e.header}`,
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ n("option", { value: "", children: "—" }),
|
|
266
|
+
/* @__PURE__ */ n("option", { value: "true", children: "✅" }),
|
|
267
|
+
/* @__PURE__ */ n("option", { value: "false", children: "❌" })
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
] });
|
|
272
|
+
if (e.type === "date") {
|
|
273
|
+
const c = t ?? {};
|
|
274
|
+
return /* @__PURE__ */ C("div", { className: D("bt-floating-filter-dates", d && "bt-ff-active"), children: [
|
|
275
|
+
/* @__PURE__ */ n(
|
|
276
|
+
"input",
|
|
277
|
+
{
|
|
278
|
+
id: `${s}-from`,
|
|
279
|
+
name: `${s}-from`,
|
|
280
|
+
type: "date",
|
|
281
|
+
className: "bt-floating-filter-input",
|
|
282
|
+
value: c.from ?? "",
|
|
283
|
+
onChange: (a) => l("from", a.target.value),
|
|
284
|
+
"aria-label": `${r.dateFrom} ${e.header}`,
|
|
285
|
+
title: r.dateFrom
|
|
286
|
+
}
|
|
287
|
+
),
|
|
288
|
+
/* @__PURE__ */ n("span", { className: "bt-ff-date-sep", children: "–" }),
|
|
289
|
+
/* @__PURE__ */ n(
|
|
290
|
+
"input",
|
|
291
|
+
{
|
|
292
|
+
id: `${s}-to`,
|
|
293
|
+
name: `${s}-to`,
|
|
294
|
+
type: "date",
|
|
295
|
+
className: "bt-floating-filter-input",
|
|
296
|
+
value: c.to ?? "",
|
|
297
|
+
onChange: (a) => l("to", a.target.value),
|
|
298
|
+
"aria-label": `${r.dateTo} ${e.header}`,
|
|
299
|
+
title: r.dateTo
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
] });
|
|
303
|
+
}
|
|
304
|
+
return /* @__PURE__ */ C("div", { className: D("bt-ff-wrapper", d && "bt-ff-active"), children: [
|
|
305
|
+
/* @__PURE__ */ n(Nt, {}),
|
|
306
|
+
/* @__PURE__ */ n(
|
|
153
307
|
"input",
|
|
154
308
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
onChange:
|
|
162
|
-
"aria-label":
|
|
309
|
+
id: s,
|
|
310
|
+
name: s,
|
|
311
|
+
type: e.type === "number" ? "number" : "text",
|
|
312
|
+
className: "bt-floating-filter-input",
|
|
313
|
+
placeholder: "...",
|
|
314
|
+
value: t != null ? String(t) : "",
|
|
315
|
+
onChange: o,
|
|
316
|
+
"aria-label": `${r.filterBy} ${e.header}`
|
|
163
317
|
}
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
318
|
+
)
|
|
319
|
+
] });
|
|
320
|
+
}
|
|
321
|
+
const Ln = z.memo(Dn), An = z.memo(
|
|
322
|
+
Pn
|
|
323
|
+
);
|
|
324
|
+
function In() {
|
|
325
|
+
const { visibleColumns: e, rowActions: t, expandableEnabled: i } = j(), { selectable: r, selectionMode: o, isAllSelected: l, isPartiallySelected: s, selectAll: d, deselectAll: c } = U(), { locale: a, stickyHeader: u } = R(), { filterMode: h } = ce(), b = t && t.length > 0, f = h === "floating" || h === "both", v = () => {
|
|
326
|
+
l ? c() : d();
|
|
327
|
+
};
|
|
328
|
+
return /* @__PURE__ */ C("thead", { className: D("bt-thead", u && "bt-sticky"), children: [
|
|
329
|
+
/* @__PURE__ */ C("tr", { className: "bt-tr", children: [
|
|
330
|
+
i && /* @__PURE__ */ n("th", { className: "bt-th bt-expand-cell", "aria-label": "Expand" }),
|
|
331
|
+
r && /* @__PURE__ */ n("th", { className: "bt-th bt-checkbox-cell", children: o === "multiple" && /* @__PURE__ */ n(
|
|
332
|
+
"input",
|
|
333
|
+
{
|
|
334
|
+
id: "bt-select-all",
|
|
335
|
+
name: "bt-select-all",
|
|
336
|
+
type: "checkbox",
|
|
337
|
+
className: "bt-checkbox",
|
|
338
|
+
checked: l,
|
|
339
|
+
ref: (m) => {
|
|
340
|
+
m && (m.indeterminate = s);
|
|
341
|
+
},
|
|
342
|
+
onChange: v,
|
|
343
|
+
"aria-label": l ? a.deselectAll : a.selectAll
|
|
344
|
+
}
|
|
345
|
+
) }),
|
|
346
|
+
e.map((m) => /* @__PURE__ */ n(Tn, { column: m }, m.id)),
|
|
347
|
+
b && /* @__PURE__ */ n("th", { className: "bt-th bt-actions-cell", children: a.actions })
|
|
348
|
+
] }),
|
|
349
|
+
f && /* @__PURE__ */ n(An, {})
|
|
350
|
+
] });
|
|
168
351
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
352
|
+
const En = In;
|
|
353
|
+
function W(e, t) {
|
|
171
354
|
if (!e || !t) return;
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
for (const
|
|
175
|
-
if (
|
|
355
|
+
const i = t.split(".");
|
|
356
|
+
let r = e;
|
|
357
|
+
for (const o of i) {
|
|
358
|
+
if (r == null)
|
|
176
359
|
return;
|
|
177
|
-
if (typeof
|
|
178
|
-
|
|
360
|
+
if (typeof r == "object")
|
|
361
|
+
r = r[o];
|
|
179
362
|
else
|
|
180
363
|
return;
|
|
181
364
|
}
|
|
182
|
-
return
|
|
365
|
+
return r;
|
|
183
366
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
367
|
+
function Mt(e, t, i) {
|
|
368
|
+
if (e == null)
|
|
369
|
+
return i === "asc" ? 1 : -1;
|
|
370
|
+
if (t == null)
|
|
371
|
+
return i === "asc" ? -1 : 1;
|
|
372
|
+
if (typeof e == "string" && typeof t == "string") {
|
|
373
|
+
const s = e.localeCompare(t, void 0, {
|
|
374
|
+
sensitivity: "base",
|
|
375
|
+
numeric: !0
|
|
376
|
+
});
|
|
377
|
+
return i === "asc" ? s : -s;
|
|
378
|
+
}
|
|
379
|
+
if (typeof e == "number" && typeof t == "number")
|
|
380
|
+
return i === "asc" ? e - t : t - e;
|
|
381
|
+
if (typeof e == "boolean" && typeof t == "boolean") {
|
|
382
|
+
const s = e === t ? 0 : e ? -1 : 1;
|
|
383
|
+
return i === "asc" ? s : -s;
|
|
384
|
+
}
|
|
385
|
+
if (e instanceof Date && t instanceof Date) {
|
|
386
|
+
const s = e.getTime() - t.getTime();
|
|
387
|
+
return i === "asc" ? s : -s;
|
|
388
|
+
}
|
|
389
|
+
const r = String(e), o = String(t), l = r.localeCompare(o);
|
|
390
|
+
return i === "asc" ? l : -l;
|
|
391
|
+
}
|
|
392
|
+
function Mn(e, t, i) {
|
|
393
|
+
return [...e].sort((r, o) => {
|
|
394
|
+
const l = W(r, t), s = W(o, t);
|
|
395
|
+
return Mt(l, s, i);
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function Rn(e, t) {
|
|
399
|
+
const i = t.filter((r) => r.columnId !== null);
|
|
400
|
+
return i.length === 0 ? e : [...e].sort((r, o) => {
|
|
401
|
+
for (const l of i) {
|
|
402
|
+
const s = W(
|
|
403
|
+
r,
|
|
404
|
+
l.columnId
|
|
405
|
+
), d = W(
|
|
406
|
+
o,
|
|
407
|
+
l.columnId
|
|
408
|
+
), c = Mt(s, d, l.direction);
|
|
409
|
+
if (c !== 0) return c;
|
|
207
410
|
}
|
|
208
|
-
|
|
209
|
-
return l === "asc" ? h : -h;
|
|
411
|
+
return 0;
|
|
210
412
|
});
|
|
211
413
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
|
|
414
|
+
function ae(e) {
|
|
415
|
+
if (e instanceof Date) return e;
|
|
416
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
417
|
+
const t = new Date(e);
|
|
418
|
+
return isNaN(t.getTime()) ? null : t;
|
|
419
|
+
}
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
function Fn(e, t, i) {
|
|
423
|
+
const r = Object.entries(t).filter(
|
|
424
|
+
([, o]) => o != null && o !== ""
|
|
215
425
|
);
|
|
216
|
-
return
|
|
217
|
-
const
|
|
218
|
-
if (!
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
String(
|
|
426
|
+
return r.length === 0 ? e : e.filter((o) => r.every(([l, s]) => {
|
|
427
|
+
const d = i.find((u) => u.id === l);
|
|
428
|
+
if (!d) return !0;
|
|
429
|
+
const c = W(
|
|
430
|
+
o,
|
|
431
|
+
String(d.accessor)
|
|
222
432
|
);
|
|
223
|
-
if (
|
|
433
|
+
if (c == null)
|
|
224
434
|
return !1;
|
|
225
|
-
switch (
|
|
435
|
+
switch (d.type ?? "string") {
|
|
226
436
|
case "boolean":
|
|
227
|
-
return
|
|
437
|
+
return c === s;
|
|
228
438
|
case "number":
|
|
229
|
-
return String(
|
|
230
|
-
case "date":
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
439
|
+
return String(c) === String(s);
|
|
440
|
+
case "date": {
|
|
441
|
+
const u = ae(c);
|
|
442
|
+
if (!u) return !1;
|
|
443
|
+
if (s && typeof s == "object" && ("from" in s || "to" in s)) {
|
|
444
|
+
const b = s;
|
|
445
|
+
if (b.from) {
|
|
446
|
+
const f = ae(b.from);
|
|
447
|
+
if (f && u < f) return !1;
|
|
448
|
+
}
|
|
449
|
+
if (b.to) {
|
|
450
|
+
const f = ae(b.to);
|
|
451
|
+
if (f) {
|
|
452
|
+
const v = new Date(f);
|
|
453
|
+
if (v.setHours(23, 59, 59, 999), u > v) return !1;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return !0;
|
|
234
457
|
}
|
|
235
|
-
|
|
458
|
+
const h = ae(s);
|
|
459
|
+
return h ? u.toDateString() === h.toDateString() : String(c).includes(String(s));
|
|
460
|
+
}
|
|
236
461
|
default:
|
|
237
|
-
return String(
|
|
462
|
+
return String(c).toLowerCase().includes(String(s).toLowerCase());
|
|
238
463
|
}
|
|
239
464
|
}));
|
|
240
465
|
}
|
|
241
|
-
function
|
|
466
|
+
function $n(e, t, i, r) {
|
|
242
467
|
if (!t.trim())
|
|
243
468
|
return e;
|
|
244
|
-
const
|
|
469
|
+
const o = t.toLowerCase().trim(), l = r ? i.filter(
|
|
470
|
+
(s) => r.includes(s.id) || r.includes(String(s.accessor))
|
|
471
|
+
) : i.filter((s) => s.type !== "custom");
|
|
245
472
|
return e.filter(
|
|
246
|
-
(
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
String(
|
|
473
|
+
(s) => l.some((d) => {
|
|
474
|
+
const c = W(
|
|
475
|
+
s,
|
|
476
|
+
String(d.accessor)
|
|
250
477
|
);
|
|
251
|
-
return
|
|
478
|
+
return c == null ? !1 : String(c).toLowerCase().includes(o);
|
|
252
479
|
})
|
|
253
480
|
);
|
|
254
481
|
}
|
|
255
|
-
function
|
|
482
|
+
function zn({
|
|
256
483
|
row: e,
|
|
257
484
|
column: t,
|
|
258
|
-
rowIndex:
|
|
485
|
+
rowIndex: i
|
|
259
486
|
}) {
|
|
260
|
-
const
|
|
487
|
+
const { resizable: r, getColumnWidth: o } = R(), l = W(
|
|
261
488
|
e,
|
|
262
489
|
String(t.accessor)
|
|
263
|
-
),
|
|
490
|
+
), d = (() => {
|
|
264
491
|
if (t.cell)
|
|
265
|
-
return t.cell(
|
|
266
|
-
if (
|
|
267
|
-
return /* @__PURE__ */
|
|
492
|
+
return t.cell(l, e, i);
|
|
493
|
+
if (l == null)
|
|
494
|
+
return /* @__PURE__ */ n("span", { className: "bt-cell-empty", children: "—" });
|
|
268
495
|
switch (t.type) {
|
|
269
496
|
case "boolean":
|
|
270
|
-
return
|
|
497
|
+
return l ? "✅" : "❌";
|
|
271
498
|
case "date":
|
|
272
|
-
if (
|
|
273
|
-
return
|
|
274
|
-
const
|
|
275
|
-
return isNaN(
|
|
499
|
+
if (l instanceof Date)
|
|
500
|
+
return l.toLocaleDateString();
|
|
501
|
+
const a = new Date(String(l));
|
|
502
|
+
return isNaN(a.getTime()) ? String(l) : a.toLocaleDateString();
|
|
276
503
|
case "number":
|
|
277
|
-
return typeof
|
|
504
|
+
return typeof l == "number" ? l.toLocaleString() : l;
|
|
278
505
|
default:
|
|
279
|
-
return String(
|
|
506
|
+
return String(l);
|
|
280
507
|
}
|
|
281
|
-
})();
|
|
282
|
-
return /* @__PURE__ */
|
|
508
|
+
})(), c = r ? o(t.id) ?? t.width : t.width;
|
|
509
|
+
return /* @__PURE__ */ n(
|
|
283
510
|
"td",
|
|
284
511
|
{
|
|
285
|
-
className:
|
|
286
|
-
style: { width:
|
|
287
|
-
children:
|
|
512
|
+
className: D("bt-td", t.align && `bt-align-${t.align}`),
|
|
513
|
+
style: { width: c },
|
|
514
|
+
children: d
|
|
288
515
|
}
|
|
289
516
|
);
|
|
290
517
|
}
|
|
291
|
-
const
|
|
292
|
-
function
|
|
518
|
+
const On = z.memo(zn), jn = "📦";
|
|
519
|
+
function Bn({
|
|
520
|
+
actions: e,
|
|
521
|
+
row: t,
|
|
522
|
+
rowIndex: i,
|
|
523
|
+
onActionClick: r,
|
|
524
|
+
direction: o = "down"
|
|
525
|
+
}) {
|
|
526
|
+
const { locale: l } = R(), [s, d] = I(!1), [c, a] = I({ top: 0, left: 0, openUp: !1 }), u = O(null), h = O(null), b = N((y) => {
|
|
527
|
+
y.stopPropagation(), d((g) => {
|
|
528
|
+
if (!g && u.current) {
|
|
529
|
+
const w = u.current.getBoundingClientRect(), T = window.innerHeight - w.bottom, L = o === "up" || T < 200;
|
|
530
|
+
a({
|
|
531
|
+
top: L ? w.top : w.bottom,
|
|
532
|
+
left: w.right,
|
|
533
|
+
openUp: L
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
return !g;
|
|
537
|
+
});
|
|
538
|
+
}, [o]);
|
|
539
|
+
$(() => {
|
|
540
|
+
if (!s) return;
|
|
541
|
+
const y = (g) => {
|
|
542
|
+
const w = g.target;
|
|
543
|
+
u.current && !u.current.contains(w) && h.current && !h.current.contains(w) && d(!1);
|
|
544
|
+
};
|
|
545
|
+
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
546
|
+
}, [s]), $(() => {
|
|
547
|
+
if (!s) return;
|
|
548
|
+
const y = (g) => {
|
|
549
|
+
g.key === "Escape" && d(!1);
|
|
550
|
+
};
|
|
551
|
+
return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
|
|
552
|
+
}, [s]), $(() => {
|
|
553
|
+
if (!s) return;
|
|
554
|
+
const y = () => d(!1);
|
|
555
|
+
return window.addEventListener("scroll", y, !0), () => window.removeEventListener("scroll", y, !0);
|
|
556
|
+
}, [s]);
|
|
557
|
+
const f = e.filter((y) => y.variant !== "danger"), v = e.filter((y) => y.variant === "danger"), m = [...f, ...v], P = f.length > 0 && v.length > 0, S = f.length, x = c.openUp ? { position: "fixed", bottom: window.innerHeight - c.top, right: window.innerWidth - c.left } : { position: "fixed", top: c.top, right: window.innerWidth - c.left };
|
|
558
|
+
return /* @__PURE__ */ C("div", { className: "bt-overflow-container", children: [
|
|
559
|
+
/* @__PURE__ */ n(
|
|
560
|
+
"button",
|
|
561
|
+
{
|
|
562
|
+
ref: u,
|
|
563
|
+
className: "bt-action-btn bt-overflow-trigger",
|
|
564
|
+
onClick: b,
|
|
565
|
+
"aria-label": l.moreActions,
|
|
566
|
+
"aria-expanded": s,
|
|
567
|
+
"aria-haspopup": "menu",
|
|
568
|
+
title: l.moreActions,
|
|
569
|
+
type: "button",
|
|
570
|
+
children: /* @__PURE__ */ n("span", { className: "bt-overflow-icon", children: /* @__PURE__ */ C("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
571
|
+
/* @__PURE__ */ n("circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
572
|
+
/* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "1.5" }),
|
|
573
|
+
/* @__PURE__ */ n("circle", { cx: "13", cy: "8", r: "1.5" })
|
|
574
|
+
] }) })
|
|
575
|
+
}
|
|
576
|
+
),
|
|
577
|
+
s && hn(
|
|
578
|
+
/* @__PURE__ */ n(
|
|
579
|
+
"div",
|
|
580
|
+
{
|
|
581
|
+
ref: h,
|
|
582
|
+
className: D(
|
|
583
|
+
"bt-overflow-menu",
|
|
584
|
+
c.openUp && "bt-overflow-menu-up"
|
|
585
|
+
),
|
|
586
|
+
style: x,
|
|
587
|
+
role: "menu",
|
|
588
|
+
children: m.map((y, g) => {
|
|
589
|
+
if (y.visible && !y.visible(t))
|
|
590
|
+
return null;
|
|
591
|
+
const w = y.disabled ? y.disabled(t) : !1, T = y.icon ?? jn, L = P && g === S;
|
|
592
|
+
return /* @__PURE__ */ C(z.Fragment, { children: [
|
|
593
|
+
L && /* @__PURE__ */ n("div", { className: "bt-overflow-separator", role: "separator" }),
|
|
594
|
+
y.mode === "link" && y.href ? /* @__PURE__ */ C(
|
|
595
|
+
"a",
|
|
596
|
+
{
|
|
597
|
+
href: typeof y.href == "function" ? y.href(t) : y.href,
|
|
598
|
+
target: "_blank",
|
|
599
|
+
rel: "noopener noreferrer",
|
|
600
|
+
className: D(
|
|
601
|
+
"bt-overflow-item",
|
|
602
|
+
y.variant === "danger" && "bt-overflow-item-danger"
|
|
603
|
+
),
|
|
604
|
+
role: "menuitem",
|
|
605
|
+
onClick: (p) => {
|
|
606
|
+
p.stopPropagation(), d(!1);
|
|
607
|
+
},
|
|
608
|
+
children: [
|
|
609
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-icon", children: T }),
|
|
610
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-label", children: y.label })
|
|
611
|
+
]
|
|
612
|
+
}
|
|
613
|
+
) : /* @__PURE__ */ C(
|
|
614
|
+
"button",
|
|
615
|
+
{
|
|
616
|
+
className: D(
|
|
617
|
+
"bt-overflow-item",
|
|
618
|
+
y.variant === "danger" && "bt-overflow-item-danger"
|
|
619
|
+
),
|
|
620
|
+
role: "menuitem",
|
|
621
|
+
disabled: w,
|
|
622
|
+
onClick: (p) => {
|
|
623
|
+
p.stopPropagation(), r(y), d(!1);
|
|
624
|
+
},
|
|
625
|
+
type: "button",
|
|
626
|
+
children: [
|
|
627
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-icon", children: T }),
|
|
628
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-label", children: y.label })
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
)
|
|
632
|
+
] }, y.id);
|
|
633
|
+
})
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
document.body
|
|
637
|
+
)
|
|
638
|
+
] });
|
|
639
|
+
}
|
|
640
|
+
const Rt = z.memo(
|
|
641
|
+
Bn
|
|
642
|
+
), Wn = "📦";
|
|
643
|
+
function Hn({
|
|
293
644
|
row: e,
|
|
294
645
|
rowIndex: t
|
|
295
646
|
}) {
|
|
296
|
-
const { rowActions:
|
|
647
|
+
const { rowActions: i, maxVisibleActions: r } = j(), { openModal: o, closeModal: l } = R(), s = N(
|
|
297
648
|
(a) => {
|
|
298
649
|
if (a.mode === "callback" && a.onClick)
|
|
299
650
|
a.onClick(e, t);
|
|
300
651
|
else if (a.mode === "modal" && a.modalContent) {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
652
|
+
const u = a.modalContent;
|
|
653
|
+
o(
|
|
654
|
+
/* @__PURE__ */ n(
|
|
655
|
+
u,
|
|
305
656
|
{
|
|
306
657
|
data: e,
|
|
307
|
-
onClose:
|
|
308
|
-
}
|
|
658
|
+
onClose: l
|
|
309
659
|
}
|
|
310
660
|
)
|
|
311
661
|
);
|
|
312
662
|
} else if (a.mode === "link" && a.href) {
|
|
313
|
-
const
|
|
314
|
-
window.open(
|
|
663
|
+
const u = typeof a.href == "function" ? a.href(e) : a.href;
|
|
664
|
+
window.open(u, "_blank");
|
|
315
665
|
}
|
|
316
666
|
},
|
|
317
|
-
[e, t,
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (a.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
667
|
+
[e, t, o, l]
|
|
668
|
+
), { inlineActions: d, overflowActions: c } = A(() => {
|
|
669
|
+
if (!i) return { inlineActions: [], overflowActions: [] };
|
|
670
|
+
const a = i.filter(
|
|
671
|
+
(h) => !h.visible || h.visible(e)
|
|
672
|
+
);
|
|
673
|
+
if (a.length <= r)
|
|
674
|
+
return { inlineActions: a, overflowActions: [] };
|
|
675
|
+
const u = r - 1;
|
|
676
|
+
return {
|
|
677
|
+
inlineActions: a.slice(0, u),
|
|
678
|
+
overflowActions: a.slice(u)
|
|
679
|
+
};
|
|
680
|
+
}, [i, r, e]);
|
|
681
|
+
return !i || i.length === 0 ? null : /* @__PURE__ */ n("td", { className: "bt-td bt-actions-cell", children: /* @__PURE__ */ C("div", { className: "bt-actions-wrapper", children: [
|
|
682
|
+
d.map((a) => {
|
|
683
|
+
const u = a.disabled ? a.disabled(e) : !1, h = a.icon ?? Wn;
|
|
684
|
+
if (a.mode === "link" && a.href) {
|
|
685
|
+
const b = typeof a.href == "function" ? a.href(e) : a.href;
|
|
686
|
+
return /* @__PURE__ */ n(
|
|
687
|
+
"a",
|
|
688
|
+
{
|
|
689
|
+
href: b,
|
|
690
|
+
target: "_blank",
|
|
691
|
+
rel: "noopener noreferrer",
|
|
692
|
+
className: D(
|
|
693
|
+
"bt-action-btn bt-action-icon-only",
|
|
694
|
+
a.variant && `bt-variant-${a.variant}`
|
|
695
|
+
),
|
|
696
|
+
"aria-label": a.label,
|
|
697
|
+
title: a.label,
|
|
698
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: h })
|
|
699
|
+
},
|
|
700
|
+
a.id
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
return /* @__PURE__ */ n(
|
|
704
|
+
"button",
|
|
327
705
|
{
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
rel: "noopener noreferrer",
|
|
331
|
-
className: P(
|
|
332
|
-
"bt-action-btn",
|
|
706
|
+
className: D(
|
|
707
|
+
"bt-action-btn bt-action-icon-only",
|
|
333
708
|
a.variant && `bt-variant-${a.variant}`
|
|
334
709
|
),
|
|
710
|
+
onClick: () => s(a),
|
|
711
|
+
disabled: u,
|
|
335
712
|
"aria-label": a.label,
|
|
336
|
-
|
|
713
|
+
title: a.label,
|
|
714
|
+
type: "button",
|
|
715
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: h })
|
|
337
716
|
},
|
|
338
717
|
a.id
|
|
339
718
|
);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
719
|
+
}),
|
|
720
|
+
c.length > 0 && /* @__PURE__ */ n(
|
|
721
|
+
Rt,
|
|
343
722
|
{
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
type: "button",
|
|
353
|
-
children: a.icon && /* @__PURE__ */ i("span", { className: "bt-action-icon", children: a.icon })
|
|
354
|
-
},
|
|
355
|
-
a.id
|
|
356
|
-
);
|
|
357
|
-
}) }) });
|
|
723
|
+
actions: c,
|
|
724
|
+
row: e,
|
|
725
|
+
rowIndex: t,
|
|
726
|
+
onActionClick: s,
|
|
727
|
+
direction: "down"
|
|
728
|
+
}
|
|
729
|
+
)
|
|
730
|
+
] }) });
|
|
358
731
|
}
|
|
359
|
-
const
|
|
360
|
-
|
|
732
|
+
const Vn = z.memo(
|
|
733
|
+
Hn
|
|
361
734
|
);
|
|
362
|
-
function
|
|
363
|
-
const {
|
|
364
|
-
columns: l,
|
|
365
|
-
selectable: n,
|
|
366
|
-
rowActions: s,
|
|
367
|
-
isSelected: a,
|
|
368
|
-
toggleRow: r,
|
|
369
|
-
striped: b,
|
|
370
|
-
hoverable: o,
|
|
371
|
-
onRowClick: h,
|
|
372
|
-
onRowDoubleClick: f
|
|
373
|
-
} = w(), S = l.filter((k) => !k.hidden), p = s && s.length > 0, u = n && a(e, t), v = !!h, N = m(() => {
|
|
374
|
-
h?.(e, t);
|
|
375
|
-
}, [e, t, h]), D = m(() => {
|
|
735
|
+
function _n({ row: e, rowIndex: t, rowKey: i }) {
|
|
736
|
+
const { visibleColumns: r, rowActions: o, expandableEnabled: l, isExpanded: s, toggleExpand: d } = j(), { selectable: c, isSelected: a, toggleRow: u } = U(), { striped: h, hoverable: b, onRowClick: f, onRowDoubleClick: v, locale: m } = R(), P = o && o.length > 0, S = c && a(e, t), x = !!f, y = l && s(i), g = N(() => {
|
|
376
737
|
f?.(e, t);
|
|
377
|
-
}, [e, t, f]),
|
|
378
|
-
|
|
379
|
-
}, [e, t,
|
|
738
|
+
}, [e, t, f]), w = N(() => {
|
|
739
|
+
v?.(e, t);
|
|
740
|
+
}, [e, t, v]), T = N(() => {
|
|
741
|
+
u(e, t);
|
|
742
|
+
}, [e, t, u]), L = N(() => {
|
|
743
|
+
d(i);
|
|
744
|
+
}, [i, d]), p = N(
|
|
380
745
|
(k) => {
|
|
381
|
-
k.key === "Enter" &&
|
|
746
|
+
k.key === "Enter" && f && g();
|
|
382
747
|
},
|
|
383
|
-
[
|
|
748
|
+
[g, f]
|
|
384
749
|
);
|
|
385
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ C(
|
|
386
751
|
"tr",
|
|
387
752
|
{
|
|
388
|
-
className:
|
|
753
|
+
className: D(
|
|
389
754
|
"bt-tr",
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
755
|
+
h && "bt-striped",
|
|
756
|
+
b && "bt-hoverable",
|
|
757
|
+
S && "bt-selected",
|
|
758
|
+
x && "bt-clickable",
|
|
759
|
+
y && "bt-expanded"
|
|
394
760
|
),
|
|
395
|
-
onClick:
|
|
396
|
-
onDoubleClick:
|
|
397
|
-
onKeyDown:
|
|
398
|
-
tabIndex:
|
|
399
|
-
role:
|
|
400
|
-
"aria-selected":
|
|
761
|
+
onClick: x ? g : void 0,
|
|
762
|
+
onDoubleClick: v ? w : void 0,
|
|
763
|
+
onKeyDown: x ? p : void 0,
|
|
764
|
+
tabIndex: x ? 0 : void 0,
|
|
765
|
+
role: x ? "button" : void 0,
|
|
766
|
+
"aria-selected": c ? S : void 0,
|
|
767
|
+
"aria-expanded": l ? y : void 0,
|
|
401
768
|
children: [
|
|
402
|
-
|
|
769
|
+
l && /* @__PURE__ */ n("td", { className: "bt-td bt-expand-cell", children: /* @__PURE__ */ n(
|
|
770
|
+
"button",
|
|
771
|
+
{
|
|
772
|
+
type: "button",
|
|
773
|
+
className: D("bt-expand-button", y && "bt-expand-button-expanded"),
|
|
774
|
+
onClick: (k) => {
|
|
775
|
+
k.stopPropagation(), L();
|
|
776
|
+
},
|
|
777
|
+
"aria-label": y ? m.collapseRow : m.expandRow,
|
|
778
|
+
"aria-expanded": y,
|
|
779
|
+
children: /* @__PURE__ */ n(
|
|
780
|
+
"svg",
|
|
781
|
+
{
|
|
782
|
+
className: "bt-expand-icon",
|
|
783
|
+
width: "16",
|
|
784
|
+
height: "16",
|
|
785
|
+
viewBox: "0 0 16 16",
|
|
786
|
+
fill: "none",
|
|
787
|
+
"aria-hidden": "true",
|
|
788
|
+
children: /* @__PURE__ */ n(
|
|
789
|
+
"path",
|
|
790
|
+
{
|
|
791
|
+
d: "M6 4l4 4-4 4",
|
|
792
|
+
stroke: "currentColor",
|
|
793
|
+
strokeWidth: "1.5",
|
|
794
|
+
strokeLinecap: "round",
|
|
795
|
+
strokeLinejoin: "round"
|
|
796
|
+
}
|
|
797
|
+
)
|
|
798
|
+
}
|
|
799
|
+
)
|
|
800
|
+
}
|
|
801
|
+
) }),
|
|
802
|
+
c && /* @__PURE__ */ n("td", { className: "bt-td bt-checkbox-cell", children: /* @__PURE__ */ n(
|
|
403
803
|
"input",
|
|
404
804
|
{
|
|
805
|
+
id: `bt-row-select-${t}`,
|
|
806
|
+
name: `bt-row-select-${t}`,
|
|
405
807
|
type: "checkbox",
|
|
406
808
|
className: "bt-checkbox",
|
|
407
|
-
checked:
|
|
408
|
-
onChange:
|
|
809
|
+
checked: S,
|
|
810
|
+
onChange: T,
|
|
409
811
|
onClick: (k) => k.stopPropagation(),
|
|
410
812
|
"aria-label": `Select row ${t + 1}`
|
|
411
813
|
}
|
|
412
814
|
) }),
|
|
413
|
-
|
|
414
|
-
|
|
815
|
+
r.map((k) => /* @__PURE__ */ n(
|
|
816
|
+
On,
|
|
415
817
|
{
|
|
416
818
|
row: e,
|
|
417
819
|
column: k,
|
|
@@ -419,917 +821,1760 @@ function tt({ row: e, rowIndex: t }) {
|
|
|
419
821
|
},
|
|
420
822
|
k.id
|
|
421
823
|
)),
|
|
422
|
-
|
|
824
|
+
P && /* @__PURE__ */ n(Vn, { row: e, rowIndex: t })
|
|
423
825
|
]
|
|
424
826
|
}
|
|
425
827
|
);
|
|
426
828
|
}
|
|
427
|
-
const
|
|
428
|
-
function
|
|
429
|
-
const {
|
|
829
|
+
const Ft = z.memo(_n);
|
|
830
|
+
function Un({ row: e, rowIndex: t }) {
|
|
831
|
+
const { visibleColumns: i, rowActions: r, expandableRender: o } = j(), { selectable: l } = U();
|
|
832
|
+
if (!o) return null;
|
|
833
|
+
const s = r && r.length > 0, d = 1 + (l ? 1 : 0) + i.length + (s ? 1 : 0);
|
|
834
|
+
return /* @__PURE__ */ n("tr", { className: "bt-tr bt-expanded-row", role: "row", children: /* @__PURE__ */ n("td", { className: "bt-td bt-expanded-content", colSpan: d, children: o(e, t) }) });
|
|
835
|
+
}
|
|
836
|
+
const qn = Un;
|
|
837
|
+
function Kn() {
|
|
838
|
+
const { processedData: e, rowKey: t, expandableEnabled: i, isExpanded: r } = j(), o = (l, s) => {
|
|
430
839
|
if (typeof t == "function")
|
|
431
|
-
return t(
|
|
432
|
-
const
|
|
433
|
-
return String(
|
|
840
|
+
return t(l, s);
|
|
841
|
+
const d = l[t];
|
|
842
|
+
return String(d !== void 0 ? d : s);
|
|
434
843
|
};
|
|
435
|
-
return /* @__PURE__ */
|
|
844
|
+
return /* @__PURE__ */ n("tbody", { className: "bt-tbody", children: e.map((l, s) => {
|
|
845
|
+
const d = o(l, s), c = i && r(d);
|
|
846
|
+
return /* @__PURE__ */ C(z.Fragment, { children: [
|
|
847
|
+
/* @__PURE__ */ n(Ft, { row: l, rowIndex: s, rowKey: d }),
|
|
848
|
+
c && /* @__PURE__ */ n(qn, { row: l, rowIndex: s })
|
|
849
|
+
] }, d);
|
|
850
|
+
}) });
|
|
436
851
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
439
|
-
const {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
852
|
+
const Zn = Kn, Qn = "📦";
|
|
853
|
+
function Xn({ row: e, rowIndex: t }) {
|
|
854
|
+
const { visibleColumns: i, rowActions: r, maxVisibleActions: o } = j(), { selectable: l, isSelected: s, toggleRow: d } = U(), { hoverable: c, onRowClick: a, openModal: u, closeModal: h } = R(), b = r && r.length > 0, f = l && s(e, t), v = i[0], m = i.slice(1), { inlineActions: P, overflowActions: S } = A(() => {
|
|
855
|
+
if (!r) return { inlineActions: [], overflowActions: [] };
|
|
856
|
+
const p = r.filter(
|
|
857
|
+
(F) => !F.visible || F.visible(e)
|
|
858
|
+
);
|
|
859
|
+
if (p.length <= o)
|
|
860
|
+
return { inlineActions: p, overflowActions: [] };
|
|
861
|
+
const k = o - 1;
|
|
862
|
+
return {
|
|
863
|
+
inlineActions: p.slice(0, k),
|
|
864
|
+
overflowActions: p.slice(k)
|
|
865
|
+
};
|
|
866
|
+
}, [r, o, e]), x = N(() => {
|
|
867
|
+
d(e, t);
|
|
868
|
+
}, [e, t, d]), y = N(() => {
|
|
869
|
+
a?.(e, t);
|
|
870
|
+
}, [e, t, a]), g = N(
|
|
871
|
+
(p) => {
|
|
872
|
+
p.key === "Enter" && a && y();
|
|
455
873
|
},
|
|
456
|
-
[
|
|
457
|
-
),
|
|
458
|
-
(
|
|
459
|
-
if (
|
|
460
|
-
|
|
461
|
-
else if (
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
window.open(g, "_blank");
|
|
874
|
+
[y, a]
|
|
875
|
+
), w = N(
|
|
876
|
+
(p) => {
|
|
877
|
+
if (p.mode === "callback" && p.onClick)
|
|
878
|
+
p.onClick(e, t);
|
|
879
|
+
else if (p.mode === "modal" && p.modalContent) {
|
|
880
|
+
const k = p.modalContent;
|
|
881
|
+
u(/* @__PURE__ */ n(k, { data: e, onClose: h }));
|
|
882
|
+
} else if (p.mode === "link" && p.href) {
|
|
883
|
+
const k = typeof p.href == "function" ? p.href(e) : p.href;
|
|
884
|
+
window.open(k, "_blank");
|
|
468
885
|
}
|
|
469
886
|
},
|
|
470
|
-
[e, t, h]
|
|
471
|
-
),
|
|
472
|
-
if (
|
|
473
|
-
return
|
|
474
|
-
if (
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
switch (
|
|
887
|
+
[e, t, u, h]
|
|
888
|
+
), T = (p, k) => {
|
|
889
|
+
if (p.cell)
|
|
890
|
+
return p.cell(k, e, t);
|
|
891
|
+
if (k == null)
|
|
892
|
+
return /* @__PURE__ */ n("span", { className: "bt-card-value-empty", children: "—" });
|
|
893
|
+
switch (p.type) {
|
|
477
894
|
case "boolean":
|
|
478
|
-
return
|
|
895
|
+
return k ? "✅" : "❌";
|
|
479
896
|
case "date":
|
|
480
|
-
if (
|
|
481
|
-
return
|
|
482
|
-
const
|
|
483
|
-
return isNaN(
|
|
897
|
+
if (k instanceof Date)
|
|
898
|
+
return k.toLocaleDateString();
|
|
899
|
+
const F = new Date(String(k));
|
|
900
|
+
return isNaN(F.getTime()) ? String(k) : F.toLocaleDateString();
|
|
484
901
|
case "number":
|
|
485
|
-
return typeof
|
|
902
|
+
return typeof k == "number" ? k.toLocaleString() : String(k);
|
|
486
903
|
default:
|
|
487
|
-
return String(
|
|
904
|
+
return String(k);
|
|
488
905
|
}
|
|
489
|
-
},
|
|
490
|
-
return /* @__PURE__ */
|
|
906
|
+
}, L = v ? W(e, String(v.accessor)) : "";
|
|
907
|
+
return /* @__PURE__ */ C(
|
|
491
908
|
"div",
|
|
492
909
|
{
|
|
493
|
-
className:
|
|
910
|
+
className: D(
|
|
494
911
|
"bt-card",
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
912
|
+
c && "bt-hoverable",
|
|
913
|
+
f && "bt-selected",
|
|
914
|
+
a && "bt-clickable"
|
|
498
915
|
),
|
|
499
|
-
onClick:
|
|
500
|
-
onKeyDown:
|
|
501
|
-
tabIndex:
|
|
502
|
-
role:
|
|
503
|
-
"aria-selected":
|
|
916
|
+
onClick: a ? y : void 0,
|
|
917
|
+
onKeyDown: a ? g : void 0,
|
|
918
|
+
tabIndex: a ? 0 : void 0,
|
|
919
|
+
role: a ? "button" : void 0,
|
|
920
|
+
"aria-selected": l ? f : void 0,
|
|
504
921
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
|
|
922
|
+
/* @__PURE__ */ C("div", { className: "bt-card-header", children: [
|
|
923
|
+
l && /* @__PURE__ */ n(
|
|
507
924
|
"input",
|
|
508
925
|
{
|
|
926
|
+
id: `bt-card-select-${t}`,
|
|
927
|
+
name: `bt-card-select-${t}`,
|
|
509
928
|
type: "checkbox",
|
|
510
929
|
className: "bt-checkbox",
|
|
511
|
-
checked:
|
|
512
|
-
onChange:
|
|
513
|
-
onClick: (
|
|
930
|
+
checked: f,
|
|
931
|
+
onChange: x,
|
|
932
|
+
onClick: (p) => p.stopPropagation(),
|
|
514
933
|
"aria-label": `Select row ${t + 1}`
|
|
515
934
|
}
|
|
516
935
|
),
|
|
517
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ n("span", { className: "bt-card-title", children: v ? T(v, L) : `Item ${t + 1}` })
|
|
518
937
|
] }),
|
|
519
|
-
|
|
520
|
-
const
|
|
938
|
+
m.map((p) => {
|
|
939
|
+
const k = W(
|
|
521
940
|
e,
|
|
522
|
-
String(
|
|
523
|
-
),
|
|
524
|
-
return /* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
] },
|
|
941
|
+
String(p.accessor)
|
|
942
|
+
), F = T(p, k);
|
|
943
|
+
return /* @__PURE__ */ C("div", { className: "bt-card-row", children: [
|
|
944
|
+
/* @__PURE__ */ n("span", { className: "bt-card-label", children: p.header }),
|
|
945
|
+
/* @__PURE__ */ n("span", { className: "bt-card-value", children: F })
|
|
946
|
+
] }, p.id);
|
|
528
947
|
}),
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
948
|
+
b && /* @__PURE__ */ C("div", { className: "bt-card-actions", children: [
|
|
949
|
+
P.map((p) => {
|
|
950
|
+
const k = p.disabled ? p.disabled(e) : !1, F = p.icon ?? Qn;
|
|
951
|
+
if (p.mode === "link" && p.href) {
|
|
952
|
+
const B = typeof p.href == "function" ? p.href(e) : p.href;
|
|
953
|
+
return /* @__PURE__ */ n(
|
|
954
|
+
"a",
|
|
955
|
+
{
|
|
956
|
+
href: B,
|
|
957
|
+
target: "_blank",
|
|
958
|
+
rel: "noopener noreferrer",
|
|
959
|
+
className: D(
|
|
960
|
+
"bt-action-btn bt-action-icon-only",
|
|
961
|
+
p.variant && `bt-variant-${p.variant}`
|
|
962
|
+
),
|
|
963
|
+
"aria-label": p.label,
|
|
964
|
+
title: p.label,
|
|
965
|
+
onClick: (_) => _.stopPropagation(),
|
|
966
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: F })
|
|
967
|
+
},
|
|
968
|
+
p.id
|
|
969
|
+
);
|
|
970
|
+
}
|
|
971
|
+
return /* @__PURE__ */ n(
|
|
972
|
+
"button",
|
|
537
973
|
{
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
className: P(
|
|
542
|
-
"bt-action-btn",
|
|
543
|
-
c.variant && `bt-variant-${c.variant}`
|
|
974
|
+
className: D(
|
|
975
|
+
"bt-action-btn bt-action-icon-only",
|
|
976
|
+
p.variant && `bt-variant-${p.variant}`
|
|
544
977
|
),
|
|
545
|
-
onClick: (
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
978
|
+
onClick: (B) => {
|
|
979
|
+
B.stopPropagation(), w(p);
|
|
980
|
+
},
|
|
981
|
+
disabled: k,
|
|
982
|
+
"aria-label": p.label,
|
|
983
|
+
title: p.label,
|
|
984
|
+
type: "button",
|
|
985
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: F })
|
|
550
986
|
},
|
|
551
|
-
|
|
987
|
+
p.id
|
|
552
988
|
);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
|
|
989
|
+
}),
|
|
990
|
+
S.length > 0 && /* @__PURE__ */ n(
|
|
991
|
+
Rt,
|
|
556
992
|
{
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
type: "button",
|
|
566
|
-
children: [
|
|
567
|
-
c.icon && /* @__PURE__ */ i("span", { className: "bt-action-icon", children: c.icon }),
|
|
568
|
-
/* @__PURE__ */ i("span", { children: c.label })
|
|
569
|
-
]
|
|
570
|
-
},
|
|
571
|
-
c.id
|
|
572
|
-
);
|
|
573
|
-
}) })
|
|
993
|
+
actions: S,
|
|
994
|
+
row: e,
|
|
995
|
+
rowIndex: t,
|
|
996
|
+
onActionClick: w,
|
|
997
|
+
direction: "up"
|
|
998
|
+
}
|
|
999
|
+
)
|
|
1000
|
+
] })
|
|
574
1001
|
]
|
|
575
1002
|
}
|
|
576
1003
|
);
|
|
577
1004
|
}
|
|
578
|
-
const
|
|
579
|
-
function
|
|
580
|
-
const { processedData: e, rowKey: t } =
|
|
1005
|
+
const Gn = z.memo(Xn);
|
|
1006
|
+
function Jn() {
|
|
1007
|
+
const { processedData: e, rowKey: t } = j(), i = (r, o) => {
|
|
581
1008
|
if (typeof t == "function")
|
|
582
|
-
return t(
|
|
583
|
-
const
|
|
584
|
-
return String(
|
|
1009
|
+
return t(r, o);
|
|
1010
|
+
const l = r[t];
|
|
1011
|
+
return String(l !== void 0 ? l : o);
|
|
585
1012
|
};
|
|
586
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ n("div", { className: "bt-cards", children: e.map((r, o) => /* @__PURE__ */ n(Gn, { row: r, rowIndex: o }, i(r, o))) });
|
|
1014
|
+
}
|
|
1015
|
+
const Yn = Jn;
|
|
1016
|
+
function xt() {
|
|
1017
|
+
return /* @__PURE__ */ n("svg", { className: "bt-fp-icon", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M1.5 2H10.5L7 5.87V9.5L5 8.5V5.87L1.5 2Z", stroke: "currentColor", strokeWidth: "1.2", strokeLinejoin: "round" }) });
|
|
587
1018
|
}
|
|
588
|
-
|
|
589
|
-
|
|
1019
|
+
function ei({
|
|
1020
|
+
open: e
|
|
1021
|
+
}) {
|
|
1022
|
+
const { columns: t, locale: i } = R(), { filters: r, setFilter: o, clearFilter: l, clearFilters: s } = ce(), d = t.filter(
|
|
1023
|
+
(a) => a.filterable !== !1 && a.type !== "custom" && !a.hidden
|
|
1024
|
+
);
|
|
1025
|
+
if (!e || d.length === 0)
|
|
1026
|
+
return null;
|
|
1027
|
+
const c = Object.keys(r).length;
|
|
1028
|
+
return /* @__PURE__ */ C("div", { className: "bt-filter-panel", role: "region", "aria-label": i.filterBy, children: [
|
|
1029
|
+
/* @__PURE__ */ n("div", { className: "bt-filter-panel-grid", children: d.map((a) => /* @__PURE__ */ n(
|
|
1030
|
+
ni,
|
|
1031
|
+
{
|
|
1032
|
+
column: a,
|
|
1033
|
+
value: r[a.id],
|
|
1034
|
+
setFilter: o,
|
|
1035
|
+
clearFilter: l,
|
|
1036
|
+
locale: i
|
|
1037
|
+
},
|
|
1038
|
+
a.id
|
|
1039
|
+
)) }),
|
|
1040
|
+
c > 0 && /* @__PURE__ */ n("div", { className: "bt-filter-panel-footer", children: /* @__PURE__ */ n(
|
|
1041
|
+
"button",
|
|
1042
|
+
{
|
|
1043
|
+
className: "bt-filter-panel-clear",
|
|
1044
|
+
onClick: s,
|
|
1045
|
+
type: "button",
|
|
1046
|
+
children: i.clearFilters
|
|
1047
|
+
}
|
|
1048
|
+
) })
|
|
1049
|
+
] });
|
|
1050
|
+
}
|
|
1051
|
+
function ti({
|
|
1052
|
+
column: e,
|
|
1053
|
+
value: t,
|
|
1054
|
+
setFilter: i,
|
|
1055
|
+
locale: r
|
|
1056
|
+
}) {
|
|
1057
|
+
const o = N(
|
|
1058
|
+
(u) => {
|
|
1059
|
+
const h = u.target.value;
|
|
1060
|
+
e.type === "boolean" ? h === "" ? i(e.id, null) : i(e.id, h === "true") : i(e.id, h || null);
|
|
1061
|
+
},
|
|
1062
|
+
[e.id, e.type, i]
|
|
1063
|
+
), l = N(
|
|
1064
|
+
(u, h) => {
|
|
1065
|
+
const f = { ...t ?? {}, [u]: h || void 0 };
|
|
1066
|
+
i(e.id, f);
|
|
1067
|
+
},
|
|
1068
|
+
[e.id, t, i]
|
|
1069
|
+
), s = t != null && t !== "", d = s && typeof t == "object" && ("from" in t || "to" in t) && !!(t.from || t.to), c = e.type === "date" ? d : s, a = () => {
|
|
1070
|
+
const u = `bt-filter-${e.id}`;
|
|
1071
|
+
if (e.type === "boolean")
|
|
1072
|
+
return /* @__PURE__ */ C("div", { className: D("bt-fp-wrapper", c && "bt-fp-active"), children: [
|
|
1073
|
+
/* @__PURE__ */ n(xt, {}),
|
|
1074
|
+
/* @__PURE__ */ C(
|
|
1075
|
+
"select",
|
|
1076
|
+
{
|
|
1077
|
+
id: u,
|
|
1078
|
+
name: u,
|
|
1079
|
+
className: "bt-filter-select",
|
|
1080
|
+
value: t == null ? "" : String(t),
|
|
1081
|
+
onChange: o,
|
|
1082
|
+
"aria-label": `${r.filterBy} ${e.header}`,
|
|
1083
|
+
children: [
|
|
1084
|
+
/* @__PURE__ */ n("option", { value: "", children: "—" }),
|
|
1085
|
+
/* @__PURE__ */ n("option", { value: "true", children: "✅" }),
|
|
1086
|
+
/* @__PURE__ */ n("option", { value: "false", children: "❌" })
|
|
1087
|
+
]
|
|
1088
|
+
}
|
|
1089
|
+
)
|
|
1090
|
+
] });
|
|
1091
|
+
if (e.type === "date") {
|
|
1092
|
+
const h = t ?? {};
|
|
1093
|
+
return /* @__PURE__ */ C("div", { className: D("bt-fp-wrapper bt-filter-field-dates", c && "bt-fp-active"), children: [
|
|
1094
|
+
/* @__PURE__ */ n(
|
|
1095
|
+
"input",
|
|
1096
|
+
{
|
|
1097
|
+
id: `${u}-from`,
|
|
1098
|
+
name: `${u}-from`,
|
|
1099
|
+
type: "date",
|
|
1100
|
+
className: "bt-filter-input",
|
|
1101
|
+
value: h.from ?? "",
|
|
1102
|
+
onChange: (b) => l("from", b.target.value),
|
|
1103
|
+
"aria-label": `${r.dateFrom} ${e.header}`,
|
|
1104
|
+
placeholder: r.dateFrom
|
|
1105
|
+
}
|
|
1106
|
+
),
|
|
1107
|
+
/* @__PURE__ */ n("span", { className: "bt-filter-field-separator", children: "–" }),
|
|
1108
|
+
/* @__PURE__ */ n(
|
|
1109
|
+
"input",
|
|
1110
|
+
{
|
|
1111
|
+
id: `${u}-to`,
|
|
1112
|
+
name: `${u}-to`,
|
|
1113
|
+
type: "date",
|
|
1114
|
+
className: "bt-filter-input",
|
|
1115
|
+
value: h.to ?? "",
|
|
1116
|
+
onChange: (b) => l("to", b.target.value),
|
|
1117
|
+
"aria-label": `${r.dateTo} ${e.header}`,
|
|
1118
|
+
placeholder: r.dateTo
|
|
1119
|
+
}
|
|
1120
|
+
)
|
|
1121
|
+
] });
|
|
1122
|
+
}
|
|
1123
|
+
return /* @__PURE__ */ C("div", { className: D("bt-fp-wrapper", c && "bt-fp-active"), children: [
|
|
1124
|
+
/* @__PURE__ */ n(xt, {}),
|
|
1125
|
+
/* @__PURE__ */ n(
|
|
1126
|
+
"input",
|
|
1127
|
+
{
|
|
1128
|
+
id: u,
|
|
1129
|
+
name: u,
|
|
1130
|
+
type: e.type === "number" ? "number" : "text",
|
|
1131
|
+
className: "bt-filter-input",
|
|
1132
|
+
placeholder: "...",
|
|
1133
|
+
value: t != null ? String(t) : "",
|
|
1134
|
+
onChange: o,
|
|
1135
|
+
"aria-label": `${r.filterBy} ${e.header}`
|
|
1136
|
+
}
|
|
1137
|
+
)
|
|
1138
|
+
] });
|
|
1139
|
+
};
|
|
1140
|
+
return /* @__PURE__ */ C("div", { className: D("bt-filter-field", c && "bt-filter-field-active"), children: [
|
|
1141
|
+
/* @__PURE__ */ n("label", { className: "bt-filter-field-label", htmlFor: `bt-filter-${e.id}`, children: e.header }),
|
|
1142
|
+
a()
|
|
1143
|
+
] });
|
|
1144
|
+
}
|
|
1145
|
+
const ni = z.memo(ti), ii = z.memo(
|
|
1146
|
+
ei
|
|
1147
|
+
);
|
|
1148
|
+
function ri() {
|
|
1149
|
+
return /* @__PURE__ */ C("svg", { className: "bt-columns-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
1150
|
+
/* @__PURE__ */ n("rect", { x: "1.5", y: "2", width: "4", height: "10", rx: "1", stroke: "currentColor", strokeWidth: "1.3" }),
|
|
1151
|
+
/* @__PURE__ */ n("rect", { x: "8.5", y: "2", width: "4", height: "10", rx: "1", stroke: "currentColor", strokeWidth: "1.3" })
|
|
1152
|
+
] });
|
|
1153
|
+
}
|
|
1154
|
+
function si() {
|
|
1155
|
+
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M2.5 6L5 8.5L9.5 3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1156
|
+
}
|
|
1157
|
+
function li() {
|
|
1158
|
+
const {
|
|
1159
|
+
columns: e,
|
|
1160
|
+
hiddenColumnIds: t,
|
|
1161
|
+
toggleColumn: i,
|
|
1162
|
+
showAllColumns: r,
|
|
1163
|
+
isColumnVisible: o,
|
|
1164
|
+
locale: l,
|
|
1165
|
+
columnVisibilityEnabled: s
|
|
1166
|
+
} = R(), [d, c] = I(!1), a = O(null), u = O(null), h = t.size;
|
|
1167
|
+
$(() => {
|
|
1168
|
+
if (!d) return;
|
|
1169
|
+
const v = (P) => {
|
|
1170
|
+
a.current && !a.current.contains(P.target) && c(!1);
|
|
1171
|
+
}, m = (P) => {
|
|
1172
|
+
P.key === "Escape" && (c(!1), u.current?.focus());
|
|
1173
|
+
};
|
|
1174
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", m), () => {
|
|
1175
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", m);
|
|
1176
|
+
};
|
|
1177
|
+
}, [d]);
|
|
1178
|
+
const b = N(() => {
|
|
1179
|
+
c((v) => !v);
|
|
1180
|
+
}, []);
|
|
1181
|
+
if (!s) return null;
|
|
1182
|
+
const f = e.filter((v) => v.type !== "custom");
|
|
1183
|
+
return /* @__PURE__ */ C("div", { className: "bt-column-visibility", ref: a, children: [
|
|
1184
|
+
/* @__PURE__ */ C(
|
|
1185
|
+
"button",
|
|
1186
|
+
{
|
|
1187
|
+
ref: u,
|
|
1188
|
+
className: D("bt-column-visibility-btn", d && "bt-column-visibility-btn-active"),
|
|
1189
|
+
onClick: b,
|
|
1190
|
+
"aria-expanded": d,
|
|
1191
|
+
"aria-haspopup": "true",
|
|
1192
|
+
"aria-label": l.columns,
|
|
1193
|
+
title: l.columns,
|
|
1194
|
+
type: "button",
|
|
1195
|
+
children: [
|
|
1196
|
+
/* @__PURE__ */ n(ri, {}),
|
|
1197
|
+
/* @__PURE__ */ n("span", { className: "bt-column-visibility-label", children: l.columns }),
|
|
1198
|
+
h > 0 && /* @__PURE__ */ n("span", { className: "bt-column-visibility-badge", children: h })
|
|
1199
|
+
]
|
|
1200
|
+
}
|
|
1201
|
+
),
|
|
1202
|
+
d && /* @__PURE__ */ C("div", { className: "bt-column-visibility-dropdown", role: "menu", children: [
|
|
1203
|
+
/* @__PURE__ */ C("div", { className: "bt-column-visibility-header", children: [
|
|
1204
|
+
/* @__PURE__ */ n("span", { className: "bt-column-visibility-title", children: l.columns }),
|
|
1205
|
+
h > 0 && /* @__PURE__ */ n(
|
|
1206
|
+
"button",
|
|
1207
|
+
{
|
|
1208
|
+
className: "bt-column-visibility-show-all",
|
|
1209
|
+
onClick: r,
|
|
1210
|
+
type: "button",
|
|
1211
|
+
children: l.showAllColumns
|
|
1212
|
+
}
|
|
1213
|
+
)
|
|
1214
|
+
] }),
|
|
1215
|
+
/* @__PURE__ */ n("div", { className: "bt-column-visibility-list", children: f.map((v) => {
|
|
1216
|
+
const m = o(v.id);
|
|
1217
|
+
return /* @__PURE__ */ C(
|
|
1218
|
+
"button",
|
|
1219
|
+
{
|
|
1220
|
+
className: D(
|
|
1221
|
+
"bt-column-visibility-item",
|
|
1222
|
+
!m && "bt-column-visibility-item-hidden"
|
|
1223
|
+
),
|
|
1224
|
+
onClick: () => i(v.id),
|
|
1225
|
+
role: "menuitemcheckbox",
|
|
1226
|
+
"aria-checked": m,
|
|
1227
|
+
type: "button",
|
|
1228
|
+
children: [
|
|
1229
|
+
/* @__PURE__ */ n("span", { className: D("bt-column-visibility-check", m && "bt-column-visibility-check-active"), children: m && /* @__PURE__ */ n(si, {}) }),
|
|
1230
|
+
/* @__PURE__ */ n("span", { className: "bt-column-visibility-item-label", children: v.header })
|
|
1231
|
+
]
|
|
1232
|
+
},
|
|
1233
|
+
v.id
|
|
1234
|
+
);
|
|
1235
|
+
}) })
|
|
1236
|
+
] })
|
|
1237
|
+
] });
|
|
1238
|
+
}
|
|
1239
|
+
const oi = li;
|
|
1240
|
+
function ai() {
|
|
1241
|
+
return /* @__PURE__ */ n("svg", { className: "bt-pagination-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M9 3L5 7L9 11", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1242
|
+
}
|
|
1243
|
+
function ci() {
|
|
1244
|
+
return /* @__PURE__ */ n("svg", { className: "bt-pagination-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M5 3L9 7L5 11", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1245
|
+
}
|
|
1246
|
+
function di() {
|
|
590
1247
|
const {
|
|
591
1248
|
page: e,
|
|
592
1249
|
pageSize: t,
|
|
593
|
-
totalPages:
|
|
594
|
-
totalItems:
|
|
595
|
-
goToPage:
|
|
596
|
-
nextPage:
|
|
597
|
-
prevPage:
|
|
598
|
-
changePageSize:
|
|
599
|
-
hasNextPage:
|
|
600
|
-
hasPrevPage:
|
|
601
|
-
startIndex:
|
|
602
|
-
endIndex:
|
|
603
|
-
paginationEnabled:
|
|
604
|
-
pageSizeOptions:
|
|
605
|
-
showSizeChanger: v
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
(d) => {
|
|
610
|
-
b(Number(d.target.value));
|
|
1250
|
+
totalPages: i,
|
|
1251
|
+
totalItems: r,
|
|
1252
|
+
goToPage: o,
|
|
1253
|
+
nextPage: l,
|
|
1254
|
+
prevPage: s,
|
|
1255
|
+
changePageSize: d,
|
|
1256
|
+
hasNextPage: c,
|
|
1257
|
+
hasPrevPage: a,
|
|
1258
|
+
startIndex: u,
|
|
1259
|
+
endIndex: h,
|
|
1260
|
+
paginationEnabled: b,
|
|
1261
|
+
pageSizeOptions: f,
|
|
1262
|
+
showSizeChanger: v
|
|
1263
|
+
} = vn(), { locale: m, classNames: P } = R(), S = N(
|
|
1264
|
+
(g) => {
|
|
1265
|
+
d(Number(g.target.value));
|
|
611
1266
|
},
|
|
612
|
-
[
|
|
613
|
-
),
|
|
614
|
-
(
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
!isNaN(
|
|
1267
|
+
[d]
|
|
1268
|
+
), x = N(
|
|
1269
|
+
(g) => {
|
|
1270
|
+
if (g.key === "Enter") {
|
|
1271
|
+
const w = parseInt(g.target.value, 10);
|
|
1272
|
+
!isNaN(w) && w >= 1 && w <= i && o(w);
|
|
618
1273
|
}
|
|
619
1274
|
},
|
|
620
|
-
[
|
|
621
|
-
),
|
|
622
|
-
const
|
|
623
|
-
if (
|
|
624
|
-
for (let
|
|
625
|
-
|
|
1275
|
+
[o, i]
|
|
1276
|
+
), y = A(() => {
|
|
1277
|
+
const g = [];
|
|
1278
|
+
if (i <= 5)
|
|
1279
|
+
for (let T = 1; T <= i; T++)
|
|
1280
|
+
g.push(T);
|
|
626
1281
|
else {
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
-
for (let
|
|
630
|
-
|
|
631
|
-
e <
|
|
1282
|
+
g.push(1), e > 3 && g.push("ellipsis");
|
|
1283
|
+
const T = Math.max(2, e - 1), L = Math.min(i - 1, e + 1);
|
|
1284
|
+
for (let p = T; p <= L; p++)
|
|
1285
|
+
g.push(p);
|
|
1286
|
+
e < i - 2 && g.push("ellipsis"), i > 1 && g.push(i);
|
|
632
1287
|
}
|
|
633
|
-
return
|
|
634
|
-
}, [e,
|
|
635
|
-
return
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
v && /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
|
|
1288
|
+
return g;
|
|
1289
|
+
}, [e, i]);
|
|
1290
|
+
return b ? /* @__PURE__ */ C("div", { className: `bt-pagination ${P.pagination || ""}`, children: [
|
|
1291
|
+
/* @__PURE__ */ n("div", { className: "bt-pagination-info", children: r > 0 ? `${u}-${h} ${m.of} ${r} ${m.items}` : `0 ${m.items}` }),
|
|
1292
|
+
/* @__PURE__ */ C("div", { className: "bt-pagination-controls", children: [
|
|
1293
|
+
v && /* @__PURE__ */ C("div", { className: "bt-page-size", children: [
|
|
1294
|
+
/* @__PURE__ */ C("label", { className: "bt-page-size-label", htmlFor: "bt-page-size", children: [
|
|
1295
|
+
m.rowsPerPage,
|
|
641
1296
|
":"
|
|
642
1297
|
] }),
|
|
643
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ n(
|
|
644
1299
|
"select",
|
|
645
1300
|
{
|
|
1301
|
+
id: "bt-page-size",
|
|
1302
|
+
name: "bt-page-size",
|
|
646
1303
|
className: "bt-page-size-select",
|
|
647
1304
|
value: t,
|
|
648
|
-
onChange:
|
|
649
|
-
"aria-label":
|
|
650
|
-
children:
|
|
1305
|
+
onChange: S,
|
|
1306
|
+
"aria-label": m.rowsPerPage,
|
|
1307
|
+
children: f.map((g) => /* @__PURE__ */ n("option", { value: g, children: g }, g))
|
|
651
1308
|
}
|
|
652
1309
|
)
|
|
653
1310
|
] }),
|
|
654
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ n(
|
|
655
1312
|
"button",
|
|
656
1313
|
{
|
|
657
1314
|
className: "bt-pagination-btn",
|
|
658
|
-
onClick:
|
|
659
|
-
disabled: !
|
|
660
|
-
"aria-label":
|
|
1315
|
+
onClick: s,
|
|
1316
|
+
disabled: !a,
|
|
1317
|
+
"aria-label": m.previousPage,
|
|
661
1318
|
type: "button",
|
|
662
|
-
children:
|
|
1319
|
+
children: /* @__PURE__ */ n(ai, {})
|
|
663
1320
|
}
|
|
664
1321
|
),
|
|
665
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ n("div", { className: "bt-pagination-pages", children: y.map((g, w) => g === "ellipsis" ? /* @__PURE__ */ n("span", { className: "bt-pagination-ellipsis", children: "..." }, `ellipsis-${w}`) : /* @__PURE__ */ n(
|
|
666
1323
|
"button",
|
|
667
1324
|
{
|
|
668
|
-
className: `bt-pagination-btn ${e ===
|
|
669
|
-
onClick: () =>
|
|
670
|
-
"aria-label": `${
|
|
671
|
-
"aria-current": e ===
|
|
1325
|
+
className: `bt-pagination-btn ${e === g ? "bt-active" : ""}`,
|
|
1326
|
+
onClick: () => o(g),
|
|
1327
|
+
"aria-label": `${m.page} ${g}`,
|
|
1328
|
+
"aria-current": e === g ? "page" : void 0,
|
|
672
1329
|
type: "button",
|
|
673
|
-
children:
|
|
1330
|
+
children: g
|
|
674
1331
|
},
|
|
675
|
-
|
|
1332
|
+
g
|
|
676
1333
|
)) }),
|
|
677
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ n(
|
|
678
1335
|
"button",
|
|
679
1336
|
{
|
|
680
1337
|
className: "bt-pagination-btn",
|
|
681
|
-
onClick:
|
|
682
|
-
disabled: !
|
|
683
|
-
"aria-label":
|
|
1338
|
+
onClick: l,
|
|
1339
|
+
disabled: !c,
|
|
1340
|
+
"aria-label": m.nextPage,
|
|
684
1341
|
type: "button",
|
|
685
|
-
children:
|
|
1342
|
+
children: /* @__PURE__ */ n(ci, {})
|
|
686
1343
|
}
|
|
687
1344
|
),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
|
|
1345
|
+
/* @__PURE__ */ C("div", { className: "bt-quick-jumper", children: [
|
|
1346
|
+
/* @__PURE__ */ C("label", { className: "bt-quick-jumper-label", htmlFor: "bt-quick-jumper", children: [
|
|
1347
|
+
m.page,
|
|
691
1348
|
":"
|
|
692
1349
|
] }),
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
1350
|
+
/* @__PURE__ */ C("div", { className: "bt-qj-wrapper", children: [
|
|
1351
|
+
/* @__PURE__ */ n(
|
|
1352
|
+
"input",
|
|
1353
|
+
{
|
|
1354
|
+
id: "bt-quick-jumper",
|
|
1355
|
+
name: "bt-quick-jumper",
|
|
1356
|
+
type: "number",
|
|
1357
|
+
className: "bt-quick-jumper-input",
|
|
1358
|
+
min: 1,
|
|
1359
|
+
max: i,
|
|
1360
|
+
defaultValue: e,
|
|
1361
|
+
onKeyDown: x,
|
|
1362
|
+
"aria-label": m.jumpToPage
|
|
1363
|
+
},
|
|
1364
|
+
e
|
|
1365
|
+
),
|
|
1366
|
+
/* @__PURE__ */ n("span", { className: "bt-qj-hint", "aria-hidden": "true", children: "↵" })
|
|
1367
|
+
] })
|
|
705
1368
|
] })
|
|
706
1369
|
] })
|
|
707
1370
|
] }) : null;
|
|
708
1371
|
}
|
|
709
|
-
function
|
|
1372
|
+
function $t(e) {
|
|
1373
|
+
const [t, i] = I(() => typeof window > "u" ? !1 : window.matchMedia(e).matches);
|
|
1374
|
+
return $(() => {
|
|
1375
|
+
if (typeof window > "u") return;
|
|
1376
|
+
const r = window.matchMedia(e);
|
|
1377
|
+
i(r.matches);
|
|
1378
|
+
const o = (l) => i(l.matches);
|
|
1379
|
+
return r.addEventListener("change", o), () => r.removeEventListener("change", o);
|
|
1380
|
+
}, [e]), t;
|
|
1381
|
+
}
|
|
1382
|
+
function kt() {
|
|
1383
|
+
return /* @__PURE__ */ C("svg", { className: "bt-search-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
1384
|
+
/* @__PURE__ */ n("circle", { cx: "6", cy: "6", r: "4.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1385
|
+
/* @__PURE__ */ n("path", { d: "M9.5 9.5L13 13", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1386
|
+
] });
|
|
1387
|
+
}
|
|
1388
|
+
function St() {
|
|
1389
|
+
return /* @__PURE__ */ n("svg", { className: "bt-clear-svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M3 3L9 9M9 3L3 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
|
|
1390
|
+
}
|
|
1391
|
+
function ui() {
|
|
1392
|
+
return /* @__PURE__ */ n("svg", { className: "bt-check-svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M2.5 6L5 8.5L9.5 3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1393
|
+
}
|
|
1394
|
+
function hi() {
|
|
1395
|
+
return /* @__PURE__ */ n("svg", { className: "bt-filter-toggle-svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M1 2.5H11L7.5 6.5V10L4.5 9V6.5L1 2.5Z", stroke: "currentColor", strokeWidth: "1.2", strokeLinejoin: "round" }) });
|
|
1396
|
+
}
|
|
1397
|
+
function bi() {
|
|
710
1398
|
const {
|
|
711
1399
|
searchable: e,
|
|
712
1400
|
searchValue: t,
|
|
713
|
-
handleSearch:
|
|
714
|
-
clearSearch:
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
} = w(), p = m(
|
|
724
|
-
(v) => {
|
|
725
|
-
l(v.target.value);
|
|
1401
|
+
handleSearch: i,
|
|
1402
|
+
clearSearch: r,
|
|
1403
|
+
filters: o,
|
|
1404
|
+
filterPanelOpen: l,
|
|
1405
|
+
toggleFilterPanel: s,
|
|
1406
|
+
hasFilterableColumns: d,
|
|
1407
|
+
filterMode: c
|
|
1408
|
+
} = ce(), { selectable: a, selectedRows: u, selectedCount: h, deselectAll: b } = U(), { data: f, globalActions: v } = j(), { locale: m, classNames: P, columnVisibilityEnabled: S } = R(), x = $t("(max-width: 640px)"), [y, g] = I(!1), w = O(null), T = Object.keys(o).length, L = N(
|
|
1409
|
+
(M) => {
|
|
1410
|
+
i(M.target.value);
|
|
726
1411
|
},
|
|
727
|
-
[
|
|
728
|
-
)
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
1412
|
+
[i]
|
|
1413
|
+
), p = N(() => {
|
|
1414
|
+
g((M) => (M ? t && r() : setTimeout(() => w.current?.focus(), 50), !M));
|
|
1415
|
+
}, [t, r]);
|
|
1416
|
+
$(() => {
|
|
1417
|
+
t && !y && g(!0);
|
|
1418
|
+
}, [t, y]);
|
|
1419
|
+
const k = d && (c === "panel" || c === "both");
|
|
1420
|
+
if (!(e || k || S || v && v.length > 0 || a && h > 0))
|
|
1421
|
+
return null;
|
|
1422
|
+
const B = x && e && !y, _ = e && (!x || y);
|
|
1423
|
+
return /* @__PURE__ */ C("div", { className: D("bt-toolbar", P.toolbar), children: [
|
|
1424
|
+
/* @__PURE__ */ C("div", { className: "bt-toolbar-left", children: [
|
|
1425
|
+
B && /* @__PURE__ */ n(
|
|
1426
|
+
"button",
|
|
1427
|
+
{
|
|
1428
|
+
className: "bt-search-toggle",
|
|
1429
|
+
onClick: p,
|
|
1430
|
+
"aria-label": m.search,
|
|
1431
|
+
title: m.search,
|
|
1432
|
+
type: "button",
|
|
1433
|
+
children: /* @__PURE__ */ n(kt, {})
|
|
1434
|
+
}
|
|
1435
|
+
),
|
|
1436
|
+
_ && /* @__PURE__ */ C("div", { className: D("bt-search", x && "bt-search-mobile"), children: [
|
|
1437
|
+
/* @__PURE__ */ n("span", { className: "bt-search-icon", children: /* @__PURE__ */ n(kt, {}) }),
|
|
1438
|
+
/* @__PURE__ */ n(
|
|
734
1439
|
"input",
|
|
735
1440
|
{
|
|
1441
|
+
id: "bt-search",
|
|
1442
|
+
name: "bt-search",
|
|
1443
|
+
ref: w,
|
|
736
1444
|
type: "text",
|
|
737
1445
|
className: "bt-search-input",
|
|
738
|
-
placeholder:
|
|
1446
|
+
placeholder: m.searchPlaceholder,
|
|
739
1447
|
value: t,
|
|
740
|
-
onChange:
|
|
741
|
-
"aria-label":
|
|
1448
|
+
onChange: L,
|
|
1449
|
+
"aria-label": m.search
|
|
742
1450
|
}
|
|
743
1451
|
),
|
|
744
|
-
t && /* @__PURE__ */
|
|
1452
|
+
(t || x) && /* @__PURE__ */ n(
|
|
745
1453
|
"button",
|
|
746
1454
|
{
|
|
747
1455
|
className: "bt-search-clear",
|
|
748
|
-
onClick:
|
|
749
|
-
"aria-label":
|
|
1456
|
+
onClick: x ? p : r,
|
|
1457
|
+
"aria-label": m.clearSearch,
|
|
750
1458
|
type: "button",
|
|
751
|
-
children:
|
|
1459
|
+
children: /* @__PURE__ */ n(St, {})
|
|
752
1460
|
}
|
|
753
1461
|
)
|
|
754
1462
|
] }),
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
1463
|
+
k && /* @__PURE__ */ C(
|
|
1464
|
+
"button",
|
|
1465
|
+
{
|
|
1466
|
+
className: D(
|
|
1467
|
+
"bt-filter-toggle",
|
|
1468
|
+
l && "bt-filter-toggle-active"
|
|
1469
|
+
),
|
|
1470
|
+
onClick: s,
|
|
1471
|
+
"aria-expanded": l,
|
|
1472
|
+
"aria-label": m.filterBy,
|
|
1473
|
+
title: m.filterBy,
|
|
1474
|
+
type: "button",
|
|
1475
|
+
children: [
|
|
1476
|
+
/* @__PURE__ */ n("span", { className: "bt-filter-toggle-icon", children: /* @__PURE__ */ n(hi, {}) }),
|
|
1477
|
+
!x && /* @__PURE__ */ n("span", { children: m.filterBy }),
|
|
1478
|
+
T > 0 && /* @__PURE__ */ n("span", { className: "bt-filter-toggle-badge", children: T })
|
|
1479
|
+
]
|
|
1480
|
+
}
|
|
1481
|
+
),
|
|
1482
|
+
/* @__PURE__ */ n(oi, {}),
|
|
1483
|
+
a && h > 0 && /* @__PURE__ */ C("div", { className: "bt-selection-info", children: [
|
|
1484
|
+
/* @__PURE__ */ n(ui, {}),
|
|
1485
|
+
/* @__PURE__ */ C("span", { className: "bt-selection-count", children: [
|
|
1486
|
+
h,
|
|
758
1487
|
" ",
|
|
759
|
-
|
|
1488
|
+
x ? "sel." : m.selected
|
|
760
1489
|
] }),
|
|
761
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ n(
|
|
762
1491
|
"button",
|
|
763
1492
|
{
|
|
764
1493
|
className: "bt-selection-clear",
|
|
765
1494
|
onClick: b,
|
|
766
1495
|
type: "button",
|
|
767
|
-
children:
|
|
1496
|
+
children: x ? /* @__PURE__ */ n(St, {}) : m.deselectAll
|
|
768
1497
|
}
|
|
769
1498
|
)
|
|
770
1499
|
] })
|
|
771
1500
|
] }),
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
return /* @__PURE__ */
|
|
1501
|
+
v && v.length > 0 && /* @__PURE__ */ n("div", { className: "bt-toolbar-right", children: /* @__PURE__ */ n("div", { className: "bt-global-actions", children: v.map((M) => {
|
|
1502
|
+
const de = M.requiresSelection && u.length === 0;
|
|
1503
|
+
return /* @__PURE__ */ C(
|
|
775
1504
|
"button",
|
|
776
1505
|
{
|
|
777
|
-
className:
|
|
1506
|
+
className: D(
|
|
778
1507
|
"bt-global-btn",
|
|
779
|
-
|
|
1508
|
+
M.variant && `bt-variant-${M.variant}`,
|
|
1509
|
+
x && "bt-global-btn-mobile"
|
|
780
1510
|
),
|
|
781
|
-
onClick: () =>
|
|
782
|
-
disabled:
|
|
783
|
-
title:
|
|
1511
|
+
onClick: () => M.onClick(u, f),
|
|
1512
|
+
disabled: de,
|
|
1513
|
+
title: M.label,
|
|
1514
|
+
"aria-label": M.label,
|
|
784
1515
|
type: "button",
|
|
785
1516
|
children: [
|
|
786
|
-
|
|
787
|
-
/* @__PURE__ */
|
|
1517
|
+
M.icon && /* @__PURE__ */ n("span", { className: "bt-global-icon", children: M.icon }),
|
|
1518
|
+
!x && /* @__PURE__ */ n("span", { children: M.label })
|
|
788
1519
|
]
|
|
789
1520
|
},
|
|
790
|
-
|
|
1521
|
+
M.id
|
|
791
1522
|
);
|
|
792
1523
|
}) }) })
|
|
793
|
-
] })
|
|
1524
|
+
] });
|
|
1525
|
+
}
|
|
1526
|
+
const fi = bi;
|
|
1527
|
+
function pi() {
|
|
1528
|
+
return /* @__PURE__ */ C("svg", { className: "bt-empty-svg", width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
1529
|
+
/* @__PURE__ */ n("rect", { x: "12", y: "18", width: "40", height: "32", rx: "3", stroke: "currentColor", strokeWidth: "2", opacity: "0.3" }),
|
|
1530
|
+
/* @__PURE__ */ n("path", { d: "M12 28H52", stroke: "currentColor", strokeWidth: "2", opacity: "0.2" }),
|
|
1531
|
+
/* @__PURE__ */ n("path", { d: "M24 38H40", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", opacity: "0.4" }),
|
|
1532
|
+
/* @__PURE__ */ n("path", { d: "M28 44H36", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", opacity: "0.25" }),
|
|
1533
|
+
/* @__PURE__ */ n("circle", { cx: "32", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2", opacity: "0.2" })
|
|
1534
|
+
] });
|
|
794
1535
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */ i("div", { className: "bt-empty-text", children: e.noData })
|
|
1536
|
+
function mi() {
|
|
1537
|
+
const { locale: e, emptyComponent: t } = R(), { visibleColumns: i, rowActions: r } = j(), { selectable: o } = U(), l = r && r.length > 0, s = i.length + (o ? 1 : 0) + (l ? 1 : 0);
|
|
1538
|
+
return t ? /* @__PURE__ */ n("tbody", { className: "bt-tbody", children: /* @__PURE__ */ n("tr", { className: "bt-tr", children: /* @__PURE__ */ n("td", { className: "bt-td", colSpan: s, children: t }) }) }) : /* @__PURE__ */ n("tbody", { className: "bt-tbody", children: /* @__PURE__ */ n("tr", { className: "bt-tr", children: /* @__PURE__ */ n("td", { className: "bt-td", colSpan: s, children: /* @__PURE__ */ C("div", { className: "bt-empty", children: [
|
|
1539
|
+
/* @__PURE__ */ n("div", { className: "bt-empty-icon", children: /* @__PURE__ */ n(pi, {}) }),
|
|
1540
|
+
/* @__PURE__ */ n("div", { className: "bt-empty-text", children: e.noData })
|
|
801
1541
|
] }) }) }) });
|
|
802
1542
|
}
|
|
803
|
-
function
|
|
804
|
-
const { loadingComponent: t, locale:
|
|
805
|
-
return e ? /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
1543
|
+
function gi({ show: e }) {
|
|
1544
|
+
const { loadingComponent: t, locale: i } = R();
|
|
1545
|
+
return e ? /* @__PURE__ */ n("div", { className: "bt-loading-overlay", role: "status", "aria-live": "polite", children: t || /* @__PURE__ */ C(un, { children: [
|
|
1546
|
+
/* @__PURE__ */ n("div", { className: "bt-loading-spinner", "aria-hidden": "true" }),
|
|
1547
|
+
/* @__PURE__ */ n("span", { className: "bt-loading-text", children: i.loading })
|
|
808
1548
|
] }) }) : null;
|
|
809
1549
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1550
|
+
const vi = [
|
|
1551
|
+
'a[href]:not([disabled]):not([tabindex="-1"])',
|
|
1552
|
+
'button:not([disabled]):not([tabindex="-1"])',
|
|
1553
|
+
'input:not([disabled]):not([tabindex="-1"])',
|
|
1554
|
+
'select:not([disabled]):not([tabindex="-1"])',
|
|
1555
|
+
'textarea:not([disabled]):not([tabindex="-1"])',
|
|
1556
|
+
'[tabindex]:not([tabindex="-1"]):not([disabled])'
|
|
1557
|
+
].join(", ");
|
|
1558
|
+
function yi(e, t) {
|
|
1559
|
+
const i = O(null), r = N(() => e.current ? Array.from(e.current.querySelectorAll(vi)) : [], [e]);
|
|
1560
|
+
$(() => {
|
|
1561
|
+
if (!t) return;
|
|
1562
|
+
i.current = document.activeElement;
|
|
1563
|
+
const l = setTimeout(() => {
|
|
1564
|
+
const s = r();
|
|
1565
|
+
s.length > 0 && s[0].focus();
|
|
1566
|
+
}, 0);
|
|
1567
|
+
return () => {
|
|
1568
|
+
clearTimeout(l), i.current && typeof i.current.focus == "function" && i.current.focus();
|
|
1569
|
+
};
|
|
1570
|
+
}, [t, r]), $(() => {
|
|
1571
|
+
if (!t) return;
|
|
1572
|
+
const o = (l) => {
|
|
1573
|
+
if (l.key !== "Tab") return;
|
|
1574
|
+
const s = r();
|
|
1575
|
+
if (s.length === 0) return;
|
|
1576
|
+
const d = s[0], c = s[s.length - 1];
|
|
1577
|
+
l.shiftKey ? document.activeElement === d && (l.preventDefault(), c.focus()) : document.activeElement === c && (l.preventDefault(), d.focus());
|
|
1578
|
+
};
|
|
1579
|
+
return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
|
|
1580
|
+
}, [t, r]);
|
|
1581
|
+
}
|
|
1582
|
+
function wi() {
|
|
1583
|
+
return /* @__PURE__ */ n("svg", { className: "bt-modal-close-svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M4 4L12 12M12 4L4 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) });
|
|
1584
|
+
}
|
|
1585
|
+
function Ci() {
|
|
1586
|
+
const { isModalOpen: e, modalContent: t, closeModal: i, locale: r } = R(), o = O(null);
|
|
1587
|
+
yi(o, e);
|
|
1588
|
+
const l = N(
|
|
1589
|
+
(d) => {
|
|
1590
|
+
d.target === d.currentTarget && i();
|
|
814
1591
|
},
|
|
815
|
-
[
|
|
816
|
-
), s =
|
|
817
|
-
(
|
|
818
|
-
|
|
1592
|
+
[i]
|
|
1593
|
+
), s = N(
|
|
1594
|
+
(d) => {
|
|
1595
|
+
d.key === "Escape" && i();
|
|
819
1596
|
},
|
|
820
|
-
[
|
|
1597
|
+
[i]
|
|
821
1598
|
);
|
|
822
|
-
return
|
|
1599
|
+
return $(() => (e && (document.addEventListener("keydown", s), document.body.style.overflow = "hidden"), () => {
|
|
823
1600
|
document.removeEventListener("keydown", s), document.body.style.overflow = "";
|
|
824
|
-
}), [e, s]), !e || !t ? null : /* @__PURE__ */
|
|
1601
|
+
}), [e, s]), !e || !t ? null : /* @__PURE__ */ n(
|
|
825
1602
|
"div",
|
|
826
1603
|
{
|
|
827
1604
|
className: "bt-modal-backdrop",
|
|
828
|
-
onClick:
|
|
1605
|
+
onClick: l,
|
|
829
1606
|
role: "dialog",
|
|
830
1607
|
"aria-modal": "true",
|
|
831
|
-
children: /* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */
|
|
1608
|
+
children: /* @__PURE__ */ C("div", { className: "bt-modal bt-modal-md", ref: o, children: [
|
|
1609
|
+
/* @__PURE__ */ C("div", { className: "bt-modal-header", children: [
|
|
1610
|
+
/* @__PURE__ */ n("h2", { className: "bt-modal-title", children: r.details }),
|
|
1611
|
+
/* @__PURE__ */ n(
|
|
835
1612
|
"button",
|
|
836
1613
|
{
|
|
837
1614
|
className: "bt-modal-close",
|
|
838
|
-
onClick:
|
|
839
|
-
"aria-label":
|
|
1615
|
+
onClick: i,
|
|
1616
|
+
"aria-label": r.closeModal,
|
|
840
1617
|
type: "button",
|
|
841
|
-
children:
|
|
1618
|
+
children: /* @__PURE__ */ n(wi, {})
|
|
842
1619
|
}
|
|
843
1620
|
)
|
|
844
1621
|
] }),
|
|
845
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ n("div", { className: "bt-modal-body", children: t })
|
|
846
1623
|
] })
|
|
847
1624
|
}
|
|
848
1625
|
);
|
|
849
1626
|
}
|
|
850
|
-
function
|
|
1627
|
+
function Ni({
|
|
1628
|
+
startIndex: e,
|
|
1629
|
+
endIndex: t,
|
|
1630
|
+
totalHeight: i,
|
|
1631
|
+
offsetTop: r
|
|
1632
|
+
}) {
|
|
1633
|
+
const { processedData: o, rowKey: l } = j(), s = (a, u) => {
|
|
1634
|
+
if (typeof l == "function")
|
|
1635
|
+
return l(a, u);
|
|
1636
|
+
const h = a[l];
|
|
1637
|
+
return String(h !== void 0 ? h : u);
|
|
1638
|
+
}, d = o.slice(e, t), c = i - r - d.length * (i / o.length);
|
|
1639
|
+
return /* @__PURE__ */ C("tbody", { className: "bt-tbody", children: [
|
|
1640
|
+
r > 0 && /* @__PURE__ */ n("tr", { "aria-hidden": "true", children: /* @__PURE__ */ n("td", { style: { height: r, padding: 0, border: "none" } }) }),
|
|
1641
|
+
d.map((a, u) => {
|
|
1642
|
+
const h = e + u;
|
|
1643
|
+
return /* @__PURE__ */ n(
|
|
1644
|
+
Ft,
|
|
1645
|
+
{
|
|
1646
|
+
row: a,
|
|
1647
|
+
rowIndex: h,
|
|
1648
|
+
rowKey: s(a, h)
|
|
1649
|
+
},
|
|
1650
|
+
s(a, h)
|
|
1651
|
+
);
|
|
1652
|
+
}),
|
|
1653
|
+
c > 0 && /* @__PURE__ */ n("tr", { "aria-hidden": "true", children: /* @__PURE__ */ n("td", { style: { height: c, padding: 0, border: "none" } }) })
|
|
1654
|
+
] });
|
|
1655
|
+
}
|
|
1656
|
+
const xi = Ni, zt = {
|
|
1657
|
+
search: "Search",
|
|
1658
|
+
searchPlaceholder: "Search...",
|
|
1659
|
+
noData: "No data",
|
|
1660
|
+
loading: "Loading...",
|
|
1661
|
+
page: "Page",
|
|
1662
|
+
of: "of",
|
|
1663
|
+
items: "items",
|
|
1664
|
+
selected: "selected",
|
|
1665
|
+
rowsPerPage: "Rows per page",
|
|
1666
|
+
actions: "Actions",
|
|
1667
|
+
sortAsc: "Sort ascending",
|
|
1668
|
+
sortDesc: "Sort descending",
|
|
1669
|
+
filterBy: "Filter by",
|
|
1670
|
+
clearFilters: "Clear filters",
|
|
1671
|
+
dateFrom: "From",
|
|
1672
|
+
dateTo: "To",
|
|
1673
|
+
selectAll: "Select all",
|
|
1674
|
+
deselectAll: "Deselect all",
|
|
1675
|
+
moreActions: "More actions",
|
|
1676
|
+
clearSearch: "Clear search",
|
|
1677
|
+
closeModal: "Close",
|
|
1678
|
+
previousPage: "Previous page",
|
|
1679
|
+
nextPage: "Next page",
|
|
1680
|
+
jumpToPage: "Go to page",
|
|
1681
|
+
details: "Details",
|
|
1682
|
+
columns: "Columns",
|
|
1683
|
+
showAllColumns: "Show all",
|
|
1684
|
+
hideColumn: "Hide column",
|
|
1685
|
+
sortPriority: "Sort priority",
|
|
1686
|
+
clearSort: "Clear sort",
|
|
1687
|
+
resultsFound: "{count} results found",
|
|
1688
|
+
noResultsFound: "No results found",
|
|
1689
|
+
rowsSelected: "{count} rows selected",
|
|
1690
|
+
expandRow: "Expand row",
|
|
1691
|
+
collapseRow: "Collapse row"
|
|
1692
|
+
}, ki = {
|
|
1693
|
+
en: zt,
|
|
1694
|
+
es: {
|
|
1695
|
+
search: "Buscar",
|
|
1696
|
+
searchPlaceholder: "Buscar...",
|
|
1697
|
+
noData: "No hay datos",
|
|
1698
|
+
loading: "Cargando...",
|
|
1699
|
+
page: "Página",
|
|
1700
|
+
of: "de",
|
|
1701
|
+
items: "elementos",
|
|
1702
|
+
selected: "seleccionados",
|
|
1703
|
+
rowsPerPage: "Filas por página",
|
|
1704
|
+
actions: "Acciones",
|
|
1705
|
+
sortAsc: "Ordenar ascendente",
|
|
1706
|
+
sortDesc: "Ordenar descendente",
|
|
1707
|
+
filterBy: "Filtrar por",
|
|
1708
|
+
clearFilters: "Limpiar filtros",
|
|
1709
|
+
dateFrom: "Desde",
|
|
1710
|
+
dateTo: "Hasta",
|
|
1711
|
+
selectAll: "Seleccionar todo",
|
|
1712
|
+
deselectAll: "Deseleccionar todo",
|
|
1713
|
+
moreActions: "Más acciones",
|
|
1714
|
+
clearSearch: "Limpiar búsqueda",
|
|
1715
|
+
closeModal: "Cerrar",
|
|
1716
|
+
previousPage: "Página anterior",
|
|
1717
|
+
nextPage: "Página siguiente",
|
|
1718
|
+
jumpToPage: "Ir a página",
|
|
1719
|
+
details: "Detalles",
|
|
1720
|
+
columns: "Columnas",
|
|
1721
|
+
showAllColumns: "Mostrar todas",
|
|
1722
|
+
hideColumn: "Ocultar columna",
|
|
1723
|
+
sortPriority: "Prioridad de orden",
|
|
1724
|
+
clearSort: "Quitar orden",
|
|
1725
|
+
resultsFound: "{count} resultados encontrados",
|
|
1726
|
+
noResultsFound: "No se encontraron resultados",
|
|
1727
|
+
rowsSelected: "{count} filas seleccionadas",
|
|
1728
|
+
expandRow: "Expandir fila",
|
|
1729
|
+
collapseRow: "Colapsar fila"
|
|
1730
|
+
},
|
|
1731
|
+
pt: {
|
|
1732
|
+
search: "Pesquisar",
|
|
1733
|
+
searchPlaceholder: "Pesquisar...",
|
|
1734
|
+
noData: "Sem dados",
|
|
1735
|
+
loading: "Carregando...",
|
|
1736
|
+
page: "Página",
|
|
1737
|
+
of: "de",
|
|
1738
|
+
items: "itens",
|
|
1739
|
+
selected: "selecionados",
|
|
1740
|
+
rowsPerPage: "Linhas por página",
|
|
1741
|
+
actions: "Ações",
|
|
1742
|
+
sortAsc: "Ordenar ascendente",
|
|
1743
|
+
sortDesc: "Ordenar descendente",
|
|
1744
|
+
filterBy: "Filtrar por",
|
|
1745
|
+
clearFilters: "Limpar filtros",
|
|
1746
|
+
dateFrom: "De",
|
|
1747
|
+
dateTo: "Até",
|
|
1748
|
+
selectAll: "Selecionar tudo",
|
|
1749
|
+
deselectAll: "Desselecionar tudo",
|
|
1750
|
+
moreActions: "Mais ações",
|
|
1751
|
+
clearSearch: "Limpar pesquisa",
|
|
1752
|
+
closeModal: "Fechar",
|
|
1753
|
+
previousPage: "Página anterior",
|
|
1754
|
+
nextPage: "Próxima página",
|
|
1755
|
+
jumpToPage: "Ir para página",
|
|
1756
|
+
details: "Detalhes",
|
|
1757
|
+
columns: "Colunas",
|
|
1758
|
+
showAllColumns: "Mostrar todas",
|
|
1759
|
+
hideColumn: "Ocultar coluna",
|
|
1760
|
+
sortPriority: "Prioridade de ordem",
|
|
1761
|
+
clearSort: "Remover ordem",
|
|
1762
|
+
resultsFound: "{count} resultados encontrados",
|
|
1763
|
+
noResultsFound: "Nenhum resultado encontrado",
|
|
1764
|
+
rowsSelected: "{count} linhas selecionadas",
|
|
1765
|
+
expandRow: "Expandir linha",
|
|
1766
|
+
collapseRow: "Recolher linha"
|
|
1767
|
+
}
|
|
1768
|
+
};
|
|
1769
|
+
function Si({
|
|
851
1770
|
data: e,
|
|
852
1771
|
initialSort: t,
|
|
853
|
-
controlledSort:
|
|
854
|
-
onSortChange:
|
|
1772
|
+
controlledSort: i,
|
|
1773
|
+
onSortChange: r,
|
|
1774
|
+
multiSort: o = !1,
|
|
1775
|
+
controlledMultiSort: l,
|
|
1776
|
+
onMultiSortChange: s,
|
|
1777
|
+
manual: d = !1
|
|
855
1778
|
}) {
|
|
856
|
-
const [
|
|
1779
|
+
const [c, a] = I(
|
|
857
1780
|
t ?? { columnId: null, direction: "asc" }
|
|
858
|
-
),
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1781
|
+
), [u, h] = I(
|
|
1782
|
+
[]
|
|
1783
|
+
), b = i ?? c, f = l ?? u, v = N(
|
|
1784
|
+
(S) => {
|
|
1785
|
+
if (o) {
|
|
1786
|
+
const x = f.findIndex(
|
|
1787
|
+
(T) => T.columnId === S
|
|
1788
|
+
);
|
|
1789
|
+
let y;
|
|
1790
|
+
x >= 0 ? f[x].direction === "asc" ? (y = [...f], y[x] = {
|
|
1791
|
+
columnId: S,
|
|
1792
|
+
direction: "desc"
|
|
1793
|
+
}) : y = f.filter((L, p) => p !== x) : y = [...f, { columnId: S, direction: "asc" }], l || h(y), s?.(y);
|
|
1794
|
+
const g = y[0], w = g ? { columnId: g.columnId, direction: g.direction } : { columnId: null, direction: "asc" };
|
|
1795
|
+
i || a(w), r?.(w);
|
|
1796
|
+
} else {
|
|
1797
|
+
let x;
|
|
1798
|
+
b.columnId !== S ? x = { columnId: S, direction: "asc" } : b.direction === "asc" ? x = { columnId: S, direction: "desc" } : x = { columnId: null, direction: "asc" }, i || a(x), r?.(x);
|
|
1799
|
+
}
|
|
865
1800
|
},
|
|
866
|
-
[
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
1801
|
+
[
|
|
1802
|
+
b,
|
|
1803
|
+
f,
|
|
1804
|
+
i,
|
|
1805
|
+
l,
|
|
1806
|
+
r,
|
|
1807
|
+
s,
|
|
1808
|
+
o
|
|
1809
|
+
]
|
|
1810
|
+
), m = N(() => {
|
|
1811
|
+
const S = { columnId: null, direction: "asc" };
|
|
1812
|
+
i || a(S), r?.(S), o && (l || h([]), s?.([]));
|
|
1813
|
+
}, [
|
|
1814
|
+
i,
|
|
1815
|
+
l,
|
|
1816
|
+
r,
|
|
1817
|
+
s,
|
|
1818
|
+
o
|
|
1819
|
+
]);
|
|
1820
|
+
return {
|
|
1821
|
+
sortedData: A(() => d ? e : o && f.length > 0 ? Rn(e, f) : b.columnId ? Mn(e, b.columnId, b.direction) : e, [e, b, f, o, d]),
|
|
1822
|
+
sortState: b,
|
|
1823
|
+
handleSort: v,
|
|
1824
|
+
clearSort: m,
|
|
1825
|
+
multiSortState: f,
|
|
1826
|
+
isMultiSort: o
|
|
1827
|
+
};
|
|
872
1828
|
}
|
|
873
|
-
function
|
|
1829
|
+
function Ti({
|
|
874
1830
|
data: e,
|
|
875
1831
|
columns: t,
|
|
876
|
-
initialFilters:
|
|
877
|
-
controlledFilters:
|
|
878
|
-
onFilterChange:
|
|
1832
|
+
initialFilters: i,
|
|
1833
|
+
controlledFilters: r,
|
|
1834
|
+
onFilterChange: o,
|
|
1835
|
+
manual: l = !1
|
|
879
1836
|
}) {
|
|
880
|
-
const [
|
|
881
|
-
|
|
882
|
-
),
|
|
883
|
-
(
|
|
884
|
-
const
|
|
885
|
-
|
|
1837
|
+
const [s, d] = I(
|
|
1838
|
+
i ?? {}
|
|
1839
|
+
), c = r ?? s, a = N(
|
|
1840
|
+
(f, v) => {
|
|
1841
|
+
const m = { ...c };
|
|
1842
|
+
if (v !== null && typeof v == "object" && "from" in v) {
|
|
1843
|
+
const P = v;
|
|
1844
|
+
!P.from && !P.to ? delete m[f] : m[f] = v;
|
|
1845
|
+
} else v == null || v === "" ? delete m[f] : m[f] = v;
|
|
1846
|
+
r || d(m), o?.(m);
|
|
886
1847
|
},
|
|
887
|
-
[
|
|
888
|
-
),
|
|
889
|
-
(
|
|
890
|
-
const
|
|
891
|
-
delete
|
|
1848
|
+
[c, r, o]
|
|
1849
|
+
), u = N(
|
|
1850
|
+
(f) => {
|
|
1851
|
+
const v = { ...c };
|
|
1852
|
+
delete v[f], r || d(v), o?.(v);
|
|
892
1853
|
},
|
|
893
|
-
[
|
|
894
|
-
),
|
|
895
|
-
|
|
896
|
-
}, [
|
|
897
|
-
return { filteredData:
|
|
1854
|
+
[c, r, o]
|
|
1855
|
+
), h = N(() => {
|
|
1856
|
+
r || d({}), o?.({});
|
|
1857
|
+
}, [r, o]);
|
|
1858
|
+
return { filteredData: A(() => l ? e : Fn(e, c, t), [e, c, t, l]), filters: c, setFilter: a, clearFilters: h, clearFilter: u };
|
|
898
1859
|
}
|
|
899
|
-
function
|
|
1860
|
+
function Pi({
|
|
900
1861
|
data: e,
|
|
901
1862
|
config: t,
|
|
902
|
-
onPageChange:
|
|
1863
|
+
onPageChange: i,
|
|
1864
|
+
manual: r = !1
|
|
903
1865
|
}) {
|
|
904
|
-
const
|
|
905
|
-
(
|
|
906
|
-
const
|
|
907
|
-
|
|
1866
|
+
const o = t !== !1, l = t && typeof t == "object" ? t.page ?? 1 : 1, s = t && typeof t == "object" ? t.pageSize ?? 10 : 10, d = t && typeof t == "object" ? t.totalItems : void 0, [c, a] = I(l), [u, h] = I(s), b = d ?? e.length, f = Math.max(1, Math.ceil(b / u)), v = N(
|
|
1867
|
+
(w) => {
|
|
1868
|
+
const T = Math.max(1, Math.min(w, f));
|
|
1869
|
+
a(T), i?.(T, u);
|
|
908
1870
|
},
|
|
909
|
-
[
|
|
910
|
-
),
|
|
911
|
-
|
|
912
|
-
}, [
|
|
913
|
-
|
|
914
|
-
}, [
|
|
915
|
-
(
|
|
916
|
-
|
|
1871
|
+
[f, u, i]
|
|
1872
|
+
), m = N(() => {
|
|
1873
|
+
c < f && v(c + 1);
|
|
1874
|
+
}, [c, f, v]), P = N(() => {
|
|
1875
|
+
c > 1 && v(c - 1);
|
|
1876
|
+
}, [c, v]), S = N(
|
|
1877
|
+
(w) => {
|
|
1878
|
+
h(w), a(1), i?.(1, w);
|
|
917
1879
|
},
|
|
918
|
-
[
|
|
919
|
-
),
|
|
920
|
-
if (!
|
|
1880
|
+
[i]
|
|
1881
|
+
), x = A(() => {
|
|
1882
|
+
if (!o || r || d !== void 0)
|
|
921
1883
|
return e;
|
|
922
|
-
const
|
|
923
|
-
return e.slice(
|
|
924
|
-
}, [e,
|
|
1884
|
+
const w = (c - 1) * u;
|
|
1885
|
+
return e.slice(w, w + u);
|
|
1886
|
+
}, [e, c, u, o, r, d]), y = (c - 1) * u + 1, g = Math.min(c * u, b);
|
|
925
1887
|
return {
|
|
926
|
-
paginatedData:
|
|
927
|
-
page:
|
|
928
|
-
pageSize:
|
|
929
|
-
totalPages:
|
|
930
|
-
totalItems:
|
|
931
|
-
goToPage:
|
|
932
|
-
nextPage:
|
|
933
|
-
prevPage:
|
|
934
|
-
changePageSize:
|
|
935
|
-
hasNextPage:
|
|
936
|
-
hasPrevPage:
|
|
937
|
-
startIndex:
|
|
938
|
-
endIndex:
|
|
1888
|
+
paginatedData: x,
|
|
1889
|
+
page: c,
|
|
1890
|
+
pageSize: u,
|
|
1891
|
+
totalPages: f,
|
|
1892
|
+
totalItems: b,
|
|
1893
|
+
goToPage: v,
|
|
1894
|
+
nextPage: m,
|
|
1895
|
+
prevPage: P,
|
|
1896
|
+
changePageSize: S,
|
|
1897
|
+
hasNextPage: c < f,
|
|
1898
|
+
hasPrevPage: c > 1,
|
|
1899
|
+
startIndex: y,
|
|
1900
|
+
endIndex: g
|
|
939
1901
|
};
|
|
940
1902
|
}
|
|
941
|
-
function
|
|
1903
|
+
function Di({
|
|
942
1904
|
data: e,
|
|
943
1905
|
rowKey: t,
|
|
944
|
-
mode:
|
|
945
|
-
initialSelection:
|
|
946
|
-
controlledSelection:
|
|
947
|
-
onSelectionChange:
|
|
1906
|
+
mode: i = "multiple",
|
|
1907
|
+
initialSelection: r,
|
|
1908
|
+
controlledSelection: o,
|
|
1909
|
+
onSelectionChange: l
|
|
948
1910
|
}) {
|
|
949
|
-
const [
|
|
950
|
-
|
|
951
|
-
),
|
|
952
|
-
(
|
|
1911
|
+
const [s, d] = I(
|
|
1912
|
+
r ?? []
|
|
1913
|
+
), c = o ?? s, a = N(
|
|
1914
|
+
(g, w) => typeof t == "function" ? t(g, w) : String(g[t]),
|
|
953
1915
|
[t]
|
|
954
|
-
),
|
|
955
|
-
(
|
|
956
|
-
const
|
|
957
|
-
return
|
|
1916
|
+
), u = A(() => new Set(c.map((g, w) => a(g, w))), [c, a]), h = N(
|
|
1917
|
+
(g, w) => {
|
|
1918
|
+
const T = a(g, w);
|
|
1919
|
+
return u.has(T);
|
|
958
1920
|
},
|
|
959
|
-
[
|
|
960
|
-
),
|
|
961
|
-
(
|
|
962
|
-
|
|
1921
|
+
[a, u]
|
|
1922
|
+
), b = N(
|
|
1923
|
+
(g) => {
|
|
1924
|
+
o || d(g), l?.(g);
|
|
963
1925
|
},
|
|
964
|
-
[
|
|
965
|
-
),
|
|
966
|
-
(
|
|
967
|
-
const
|
|
968
|
-
let
|
|
969
|
-
|
|
1926
|
+
[o, l]
|
|
1927
|
+
), f = N(
|
|
1928
|
+
(g, w) => {
|
|
1929
|
+
const T = a(g, w);
|
|
1930
|
+
let L;
|
|
1931
|
+
i === "single" ? L = u.has(T) ? [] : [g] : u.has(T) ? L = c.filter((p, k) => a(p, k) !== T) : L = [...c, g], b(L);
|
|
970
1932
|
},
|
|
971
|
-
[
|
|
972
|
-
), v =
|
|
973
|
-
(
|
|
974
|
-
if (!
|
|
975
|
-
const
|
|
976
|
-
|
|
1933
|
+
[i, u, c, a, b]
|
|
1934
|
+
), v = N(
|
|
1935
|
+
(g, w) => {
|
|
1936
|
+
if (!h(g, w)) {
|
|
1937
|
+
const T = i === "single" ? [g] : [...c, g];
|
|
1938
|
+
b(T);
|
|
977
1939
|
}
|
|
978
1940
|
},
|
|
979
|
-
[
|
|
980
|
-
),
|
|
981
|
-
(
|
|
982
|
-
const
|
|
983
|
-
(
|
|
1941
|
+
[h, i, c, b]
|
|
1942
|
+
), m = N(
|
|
1943
|
+
(g, w) => {
|
|
1944
|
+
const T = a(g, w), L = c.filter(
|
|
1945
|
+
(p, k) => a(p, k) !== T
|
|
984
1946
|
);
|
|
985
|
-
|
|
1947
|
+
b(L);
|
|
986
1948
|
},
|
|
987
|
-
[
|
|
988
|
-
),
|
|
989
|
-
|
|
990
|
-
}, [e,
|
|
991
|
-
|
|
992
|
-
}, [
|
|
1949
|
+
[c, a, b]
|
|
1950
|
+
), P = N(() => {
|
|
1951
|
+
i === "multiple" && b([...e]);
|
|
1952
|
+
}, [e, i, b]), S = N(() => {
|
|
1953
|
+
b([]);
|
|
1954
|
+
}, [b]), x = e.length > 0 && c.length === e.length, y = c.length > 0 && c.length < e.length;
|
|
993
1955
|
return {
|
|
994
|
-
selectedRows:
|
|
995
|
-
isSelected:
|
|
996
|
-
toggleRow:
|
|
1956
|
+
selectedRows: c,
|
|
1957
|
+
isSelected: h,
|
|
1958
|
+
toggleRow: f,
|
|
997
1959
|
selectRow: v,
|
|
998
|
-
deselectRow:
|
|
999
|
-
selectAll:
|
|
1000
|
-
deselectAll:
|
|
1001
|
-
isAllSelected:
|
|
1002
|
-
isPartiallySelected:
|
|
1003
|
-
selectedCount:
|
|
1960
|
+
deselectRow: m,
|
|
1961
|
+
selectAll: P,
|
|
1962
|
+
deselectAll: S,
|
|
1963
|
+
isAllSelected: x,
|
|
1964
|
+
isPartiallySelected: y,
|
|
1965
|
+
selectedCount: c.length
|
|
1004
1966
|
};
|
|
1005
1967
|
}
|
|
1006
|
-
function
|
|
1968
|
+
function Li({
|
|
1007
1969
|
data: e,
|
|
1008
1970
|
columns: t,
|
|
1009
|
-
searchColumns:
|
|
1010
|
-
initialValue:
|
|
1011
|
-
controlledValue:
|
|
1012
|
-
onSearchChange:
|
|
1971
|
+
searchColumns: i,
|
|
1972
|
+
initialValue: r,
|
|
1973
|
+
controlledValue: o,
|
|
1974
|
+
onSearchChange: l,
|
|
1975
|
+
debounceMs: s = 0,
|
|
1976
|
+
manual: d = !1
|
|
1013
1977
|
}) {
|
|
1014
|
-
const [
|
|
1015
|
-
|
|
1016
|
-
|
|
1978
|
+
const [c, a] = I(r ?? ""), [u, h] = I(r ?? ""), b = O(null), f = o ?? c;
|
|
1979
|
+
$(() => {
|
|
1980
|
+
if (s <= 0) {
|
|
1981
|
+
h(f);
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1984
|
+
return b.current = setTimeout(() => {
|
|
1985
|
+
h(f);
|
|
1986
|
+
}, s), () => {
|
|
1987
|
+
b.current && clearTimeout(b.current);
|
|
1988
|
+
};
|
|
1989
|
+
}, [f, s]);
|
|
1990
|
+
const v = N(
|
|
1991
|
+
(S) => {
|
|
1992
|
+
o === void 0 && a(S), l?.(S);
|
|
1993
|
+
},
|
|
1994
|
+
[o, l]
|
|
1995
|
+
), m = N(() => {
|
|
1996
|
+
o === void 0 && a(""), b.current && clearTimeout(b.current), h(""), l?.("");
|
|
1997
|
+
}, [o, l]);
|
|
1998
|
+
return { searchedData: A(() => d ? e : $n(e, u, t, i), [e, u, t, i, d]), searchValue: f, handleSearch: v, clearSearch: m };
|
|
1999
|
+
}
|
|
2000
|
+
function Ai({
|
|
2001
|
+
columns: e,
|
|
2002
|
+
controlledHiddenColumns: t,
|
|
2003
|
+
onColumnVisibilityChange: i
|
|
2004
|
+
}) {
|
|
2005
|
+
const [r, o] = I(
|
|
2006
|
+
() => e.filter((h) => h.hidden).map((h) => h.id)
|
|
2007
|
+
), l = t ?? r, s = A(
|
|
2008
|
+
() => new Set(l),
|
|
2009
|
+
[l]
|
|
2010
|
+
), d = N(
|
|
2011
|
+
(h) => {
|
|
2012
|
+
const b = s.has(h) ? l.filter((f) => f !== h) : [...l, h];
|
|
2013
|
+
t || o(b), i?.(b);
|
|
2014
|
+
},
|
|
2015
|
+
[
|
|
2016
|
+
l,
|
|
2017
|
+
s,
|
|
2018
|
+
t,
|
|
2019
|
+
i
|
|
2020
|
+
]
|
|
2021
|
+
), c = N(() => {
|
|
2022
|
+
t || o([]), i?.([]);
|
|
2023
|
+
}, [t, i]), a = N(
|
|
2024
|
+
(h) => !s.has(h),
|
|
2025
|
+
[s]
|
|
2026
|
+
);
|
|
2027
|
+
return {
|
|
2028
|
+
visibleColumns: A(
|
|
2029
|
+
() => e.filter((h) => !s.has(h.id)),
|
|
2030
|
+
[e, s]
|
|
2031
|
+
),
|
|
2032
|
+
hiddenColumnIds: s,
|
|
2033
|
+
toggleColumn: d,
|
|
2034
|
+
showAllColumns: c,
|
|
2035
|
+
isColumnVisible: a,
|
|
2036
|
+
hiddenColumns: l
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
const Ii = 50;
|
|
2040
|
+
function Ei({
|
|
2041
|
+
columns: e,
|
|
2042
|
+
enabled: t,
|
|
2043
|
+
minWidth: i = Ii,
|
|
2044
|
+
maxWidth: r,
|
|
2045
|
+
onColumnResize: o,
|
|
2046
|
+
tableRef: l
|
|
2047
|
+
}) {
|
|
2048
|
+
const [s, d] = I({}), [c, a] = I(!1), u = O(null), h = N(
|
|
2049
|
+
(m) => {
|
|
2050
|
+
if (!l.current) return 150;
|
|
2051
|
+
const P = l.current.querySelector(`th[data-column-id="${m}"]`);
|
|
2052
|
+
return P ? P.getBoundingClientRect().width : 150;
|
|
2053
|
+
},
|
|
2054
|
+
[l]
|
|
2055
|
+
), b = N(
|
|
2056
|
+
(m, P) => {
|
|
2057
|
+
if (!t) return;
|
|
2058
|
+
const S = s[m] ?? h(m);
|
|
2059
|
+
u.current = { columnId: m, startX: P, startWidth: S }, a(!0);
|
|
2060
|
+
},
|
|
2061
|
+
[t, s, h]
|
|
2062
|
+
);
|
|
2063
|
+
$(() => {
|
|
2064
|
+
if (!c) return;
|
|
2065
|
+
const m = (S) => {
|
|
2066
|
+
if (!u.current) return;
|
|
2067
|
+
S.preventDefault();
|
|
2068
|
+
const { columnId: x, startX: y, startWidth: g } = u.current, w = S.clientX - y;
|
|
2069
|
+
let T = Math.max(g + w, i);
|
|
2070
|
+
r !== void 0 && (T = Math.min(T, r));
|
|
2071
|
+
const L = e.find((p) => p.id === x);
|
|
2072
|
+
if (L) {
|
|
2073
|
+
const p = L.minWidth ?? i, k = L.maxWidth ?? r;
|
|
2074
|
+
T = Math.max(T, p), k !== void 0 && (T = Math.min(T, k));
|
|
2075
|
+
}
|
|
2076
|
+
d((p) => ({ ...p, [x]: T }));
|
|
2077
|
+
}, P = () => {
|
|
2078
|
+
if (u.current) {
|
|
2079
|
+
const { columnId: S } = u.current, x = s[S];
|
|
2080
|
+
x !== void 0 && o && o(S, x);
|
|
2081
|
+
}
|
|
2082
|
+
u.current = null, a(!1);
|
|
2083
|
+
};
|
|
2084
|
+
return document.addEventListener("mousemove", m), document.addEventListener("mouseup", P), document.body.style.userSelect = "none", document.body.style.cursor = "col-resize", () => {
|
|
2085
|
+
document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", P), document.body.style.userSelect = "", document.body.style.cursor = "";
|
|
2086
|
+
};
|
|
2087
|
+
}, [c, s, e, i, r, o]);
|
|
2088
|
+
const f = N(
|
|
2089
|
+
(m) => s[m],
|
|
2090
|
+
[s]
|
|
2091
|
+
), v = N(() => {
|
|
2092
|
+
d({});
|
|
2093
|
+
}, []);
|
|
2094
|
+
return {
|
|
2095
|
+
columnWidths: s,
|
|
2096
|
+
isResizing: c,
|
|
2097
|
+
startResize: b,
|
|
2098
|
+
getColumnWidth: f,
|
|
2099
|
+
resetColumnWidths: v
|
|
2100
|
+
};
|
|
2101
|
+
}
|
|
2102
|
+
function Mi({
|
|
2103
|
+
containerRef: e,
|
|
2104
|
+
itemCount: t,
|
|
2105
|
+
rowHeight: i,
|
|
2106
|
+
buffer: r,
|
|
2107
|
+
enabled: o
|
|
2108
|
+
}) {
|
|
2109
|
+
const [l, s] = I(0), [d, c] = I(0);
|
|
2110
|
+
$(() => {
|
|
2111
|
+
if (!o) return;
|
|
2112
|
+
const u = e.current;
|
|
2113
|
+
if (!u) return;
|
|
2114
|
+
const h = () => {
|
|
2115
|
+
s(u.scrollTop);
|
|
2116
|
+
};
|
|
2117
|
+
c(u.clientHeight), s(u.scrollTop), u.addEventListener("scroll", h, { passive: !0 });
|
|
2118
|
+
const b = new ResizeObserver((f) => {
|
|
2119
|
+
for (const v of f)
|
|
2120
|
+
c(v.contentRect.height);
|
|
2121
|
+
});
|
|
2122
|
+
return b.observe(u), () => {
|
|
2123
|
+
u.removeEventListener("scroll", h), b.disconnect();
|
|
2124
|
+
};
|
|
2125
|
+
}, [e, o]);
|
|
2126
|
+
const a = N(() => {
|
|
2127
|
+
e.current && (e.current.scrollTop = 0, s(0));
|
|
2128
|
+
}, [e]);
|
|
2129
|
+
return $(() => {
|
|
2130
|
+
o && a();
|
|
2131
|
+
}, [t, o, a]), A(() => {
|
|
2132
|
+
if (!o || t === 0)
|
|
2133
|
+
return {
|
|
2134
|
+
totalHeight: 0,
|
|
2135
|
+
startIndex: 0,
|
|
2136
|
+
endIndex: t,
|
|
2137
|
+
offsetTop: 0
|
|
2138
|
+
};
|
|
2139
|
+
const u = t * i, h = Math.floor(l / i), b = Math.ceil(d / i), f = Math.max(0, h - r), v = Math.min(t, h + b + r), m = f * i;
|
|
2140
|
+
return { totalHeight: u, startIndex: f, endIndex: v, offsetTop: m };
|
|
2141
|
+
}, [o, t, i, l, d, r]);
|
|
2142
|
+
}
|
|
2143
|
+
function Ri({
|
|
2144
|
+
controlledExpandedRows: e,
|
|
2145
|
+
onExpandChange: t,
|
|
2146
|
+
accordion: i = !1
|
|
2147
|
+
}) {
|
|
2148
|
+
const [r, o] = I([]), l = e !== void 0, s = l ? e : r, d = A(
|
|
2149
|
+
() => new Set(s),
|
|
2150
|
+
[s]
|
|
2151
|
+
), c = N(
|
|
2152
|
+
(b) => {
|
|
2153
|
+
l || o(b), t?.(b);
|
|
2154
|
+
},
|
|
2155
|
+
[l, t]
|
|
2156
|
+
), a = N(
|
|
2157
|
+
(b) => d.has(b),
|
|
2158
|
+
[d]
|
|
2159
|
+
), u = N(
|
|
2160
|
+
(b) => {
|
|
2161
|
+
d.has(b) ? c(s.filter((f) => f !== b)) : c(i ? [b] : [...s, b]);
|
|
1017
2162
|
},
|
|
1018
|
-
[s,
|
|
1019
|
-
),
|
|
1020
|
-
|
|
1021
|
-
}, [
|
|
1022
|
-
return {
|
|
2163
|
+
[d, s, i, c]
|
|
2164
|
+
), h = N(() => {
|
|
2165
|
+
c([]);
|
|
2166
|
+
}, [c]);
|
|
2167
|
+
return {
|
|
2168
|
+
expandedRowKeys: d,
|
|
2169
|
+
isExpanded: a,
|
|
2170
|
+
toggleExpand: u,
|
|
2171
|
+
collapseAll: h
|
|
2172
|
+
};
|
|
1023
2173
|
}
|
|
1024
|
-
|
|
2174
|
+
const Fi = 500, $i = 48, zi = 5;
|
|
2175
|
+
function Oi(e) {
|
|
1025
2176
|
const {
|
|
1026
2177
|
// Data
|
|
1027
2178
|
data: t,
|
|
1028
|
-
columns:
|
|
1029
|
-
rowKey:
|
|
2179
|
+
columns: i,
|
|
2180
|
+
rowKey: r = "id",
|
|
1030
2181
|
// Actions
|
|
1031
|
-
rowActions:
|
|
1032
|
-
globalActions:
|
|
2182
|
+
rowActions: o,
|
|
2183
|
+
globalActions: l,
|
|
2184
|
+
maxVisibleActions: s = 3,
|
|
1033
2185
|
// Pagination
|
|
1034
|
-
pagination:
|
|
1035
|
-
onPageChange:
|
|
2186
|
+
pagination: d = { pageSize: 10 },
|
|
2187
|
+
onPageChange: c,
|
|
1036
2188
|
// Sort
|
|
1037
|
-
sort:
|
|
1038
|
-
onSortChange:
|
|
2189
|
+
sort: a,
|
|
2190
|
+
onSortChange: u,
|
|
2191
|
+
multiSort: h = !1,
|
|
2192
|
+
multiSortState: b,
|
|
2193
|
+
onMultiSortChange: f,
|
|
1039
2194
|
// Filter
|
|
1040
|
-
filters:
|
|
1041
|
-
onFilterChange:
|
|
2195
|
+
filters: v,
|
|
2196
|
+
onFilterChange: m,
|
|
2197
|
+
filterMode: P = "floating",
|
|
1042
2198
|
// Search
|
|
1043
|
-
searchable:
|
|
1044
|
-
searchValue:
|
|
1045
|
-
onSearchChange:
|
|
1046
|
-
searchColumns:
|
|
2199
|
+
searchable: S = !1,
|
|
2200
|
+
searchValue: x,
|
|
2201
|
+
onSearchChange: y,
|
|
2202
|
+
searchColumns: g,
|
|
2203
|
+
searchDebounceMs: w = 300,
|
|
2204
|
+
// Server-Side / Manual Mode
|
|
2205
|
+
manualSorting: T = !1,
|
|
2206
|
+
manualFiltering: L = !1,
|
|
2207
|
+
manualPagination: p = !1,
|
|
1047
2208
|
// Selection - now auto-inferred if not explicitly set
|
|
1048
|
-
selectable:
|
|
1049
|
-
selectedRows:
|
|
1050
|
-
onSelectionChange:
|
|
1051
|
-
selectionMode:
|
|
2209
|
+
selectable: k,
|
|
2210
|
+
selectedRows: F,
|
|
2211
|
+
onSelectionChange: B,
|
|
2212
|
+
selectionMode: _ = "multiple",
|
|
2213
|
+
// Column Visibility
|
|
2214
|
+
columnVisibility: M = !1,
|
|
2215
|
+
hiddenColumns: de,
|
|
2216
|
+
onColumnVisibilityChange: Ot,
|
|
1052
2217
|
// States
|
|
1053
|
-
loading:
|
|
1054
|
-
loadingComponent:
|
|
1055
|
-
emptyComponent:
|
|
2218
|
+
loading: X = !1,
|
|
2219
|
+
loadingComponent: Ce,
|
|
2220
|
+
emptyComponent: Ne,
|
|
1056
2221
|
// Styling
|
|
1057
|
-
classNames:
|
|
1058
|
-
styles:
|
|
1059
|
-
locale:
|
|
1060
|
-
stickyHeader:
|
|
1061
|
-
maxHeight:
|
|
1062
|
-
bordered:
|
|
1063
|
-
striped:
|
|
1064
|
-
hoverable:
|
|
1065
|
-
size:
|
|
2222
|
+
classNames: ie = {},
|
|
2223
|
+
styles: xe = {},
|
|
2224
|
+
locale: G,
|
|
2225
|
+
stickyHeader: ke = !1,
|
|
2226
|
+
maxHeight: Se,
|
|
2227
|
+
bordered: ue = !1,
|
|
2228
|
+
striped: he = !1,
|
|
2229
|
+
hoverable: be = !0,
|
|
2230
|
+
size: fe = "medium",
|
|
1066
2231
|
// Callbacks
|
|
1067
|
-
onRowClick:
|
|
1068
|
-
onRowDoubleClick:
|
|
2232
|
+
onRowClick: Te,
|
|
2233
|
+
onRowDoubleClick: Pe,
|
|
2234
|
+
// Column Resizing
|
|
2235
|
+
resizable: J = !1,
|
|
2236
|
+
onColumnResize: jt,
|
|
2237
|
+
minColumnWidth: Bt,
|
|
2238
|
+
maxColumnWidth: Wt,
|
|
2239
|
+
// Expandable Rows
|
|
2240
|
+
expandable: Y,
|
|
2241
|
+
expandedRows: Ht,
|
|
2242
|
+
onExpandChange: Vt,
|
|
1069
2243
|
// Accessibility
|
|
1070
|
-
ariaLabel:
|
|
1071
|
-
ariaDescribedBy:
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
G
|
|
1081
|
-
|
|
2244
|
+
ariaLabel: _t,
|
|
2245
|
+
ariaDescribedBy: Ut,
|
|
2246
|
+
// Virtualization
|
|
2247
|
+
virtualize: pe,
|
|
2248
|
+
rowHeight: qt = $i,
|
|
2249
|
+
virtualBuffer: Kt = zi
|
|
2250
|
+
} = e, ee = A(() => k !== void 0 ? k : l?.some(
|
|
2251
|
+
(we) => we.requiresSelection
|
|
2252
|
+
) || B !== void 0, [k, l, B]), q = A(
|
|
2253
|
+
() => ({ ...typeof G == "string" ? ki[G] : zt, ...typeof G == "object" ? G : {} }),
|
|
2254
|
+
[G]
|
|
2255
|
+
), [De, Le] = I(!1), [Ae, Ie] = I(null), [me, Zt] = I(!1), Ee = N(() => {
|
|
2256
|
+
Zt((E) => !E);
|
|
2257
|
+
}, []), Me = A(
|
|
2258
|
+
() => i.some((E) => E.filterable !== !1 && E.type !== "custom" && !E.hidden),
|
|
2259
|
+
[i]
|
|
2260
|
+
), Re = N((E) => {
|
|
2261
|
+
Ie(E), Le(!0);
|
|
2262
|
+
}, []), Fe = N(() => {
|
|
2263
|
+
Le(!1), Ie(null);
|
|
2264
|
+
}, []), H = A(() => d === !1 ? !1 : {
|
|
1082
2265
|
pageSize: 10,
|
|
1083
2266
|
pageSizeOptions: [10, 20, 50, 100],
|
|
1084
2267
|
showSizeChanger: !1,
|
|
1085
|
-
...
|
|
1086
|
-
}, [
|
|
1087
|
-
searchedData:
|
|
1088
|
-
searchValue:
|
|
1089
|
-
handleSearch:
|
|
1090
|
-
clearSearch:
|
|
1091
|
-
} =
|
|
2268
|
+
...d
|
|
2269
|
+
}, [d]), {
|
|
2270
|
+
searchedData: Qt,
|
|
2271
|
+
searchValue: re,
|
|
2272
|
+
handleSearch: $e,
|
|
2273
|
+
clearSearch: ze
|
|
2274
|
+
} = Li({
|
|
1092
2275
|
data: t,
|
|
1093
|
-
columns:
|
|
1094
|
-
searchColumns:
|
|
1095
|
-
controlledValue:
|
|
1096
|
-
onSearchChange:
|
|
2276
|
+
columns: i,
|
|
2277
|
+
searchColumns: g,
|
|
2278
|
+
controlledValue: x,
|
|
2279
|
+
onSearchChange: y,
|
|
2280
|
+
debounceMs: w,
|
|
2281
|
+
manual: L
|
|
2282
|
+
}), {
|
|
2283
|
+
filteredData: Xt,
|
|
2284
|
+
filters: se,
|
|
2285
|
+
setFilter: Oe,
|
|
2286
|
+
clearFilter: je,
|
|
2287
|
+
clearFilters: Be
|
|
2288
|
+
} = Ti({
|
|
2289
|
+
data: Qt,
|
|
2290
|
+
columns: i,
|
|
2291
|
+
controlledFilters: v,
|
|
2292
|
+
onFilterChange: m,
|
|
2293
|
+
manual: L
|
|
2294
|
+
}), { sortedData: V, sortState: We, handleSort: He, clearSort: Ve, multiSortState: _e, isMultiSort: Ue } = Si({
|
|
2295
|
+
data: Xt,
|
|
2296
|
+
controlledSort: a,
|
|
2297
|
+
onSortChange: u,
|
|
2298
|
+
multiSort: h,
|
|
2299
|
+
controlledMultiSort: b,
|
|
2300
|
+
onMultiSortChange: f,
|
|
2301
|
+
manual: T
|
|
1097
2302
|
}), {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
columns:
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
}), { sortedData: se, sortState: re, handleSort: ie } = pt({
|
|
1108
|
-
data: Ie,
|
|
1109
|
-
controlledSort: o,
|
|
1110
|
-
onSortChange: h
|
|
2303
|
+
visibleColumns: le,
|
|
2304
|
+
hiddenColumnIds: qe,
|
|
2305
|
+
toggleColumn: Ke,
|
|
2306
|
+
showAllColumns: Ze,
|
|
2307
|
+
isColumnVisible: Qe
|
|
2308
|
+
} = Ai({
|
|
2309
|
+
columns: i,
|
|
2310
|
+
controlledHiddenColumns: de,
|
|
2311
|
+
onColumnVisibilityChange: Ot
|
|
1111
2312
|
}), {
|
|
1112
|
-
selectedRows:
|
|
1113
|
-
isSelected:
|
|
1114
|
-
toggleRow:
|
|
1115
|
-
selectAll:
|
|
1116
|
-
deselectAll:
|
|
1117
|
-
isAllSelected:
|
|
1118
|
-
isPartiallySelected:
|
|
1119
|
-
selectedCount:
|
|
1120
|
-
} =
|
|
1121
|
-
data:
|
|
1122
|
-
rowKey:
|
|
1123
|
-
mode:
|
|
1124
|
-
controlledSelection:
|
|
1125
|
-
onSelectionChange:
|
|
2313
|
+
selectedRows: Xe,
|
|
2314
|
+
isSelected: Ge,
|
|
2315
|
+
toggleRow: Je,
|
|
2316
|
+
selectAll: Ye,
|
|
2317
|
+
deselectAll: et,
|
|
2318
|
+
isAllSelected: tt,
|
|
2319
|
+
isPartiallySelected: nt,
|
|
2320
|
+
selectedCount: te
|
|
2321
|
+
} = Di({
|
|
2322
|
+
data: V,
|
|
2323
|
+
rowKey: r,
|
|
2324
|
+
mode: _,
|
|
2325
|
+
controlledSelection: F,
|
|
2326
|
+
onSelectionChange: B
|
|
1126
2327
|
}), {
|
|
1127
|
-
paginatedData:
|
|
1128
|
-
page:
|
|
1129
|
-
pageSize:
|
|
1130
|
-
totalPages:
|
|
1131
|
-
totalItems:
|
|
1132
|
-
goToPage:
|
|
1133
|
-
nextPage:
|
|
1134
|
-
prevPage:
|
|
1135
|
-
changePageSize:
|
|
1136
|
-
hasNextPage:
|
|
1137
|
-
hasPrevPage:
|
|
1138
|
-
startIndex:
|
|
1139
|
-
endIndex:
|
|
1140
|
-
} =
|
|
1141
|
-
data:
|
|
1142
|
-
config:
|
|
1143
|
-
onPageChange:
|
|
1144
|
-
|
|
2328
|
+
paginatedData: Gt,
|
|
2329
|
+
page: it,
|
|
2330
|
+
pageSize: rt,
|
|
2331
|
+
totalPages: st,
|
|
2332
|
+
totalItems: lt,
|
|
2333
|
+
goToPage: ot,
|
|
2334
|
+
nextPage: at,
|
|
2335
|
+
prevPage: ct,
|
|
2336
|
+
changePageSize: dt,
|
|
2337
|
+
hasNextPage: ut,
|
|
2338
|
+
hasPrevPage: ht,
|
|
2339
|
+
startIndex: bt,
|
|
2340
|
+
endIndex: ft
|
|
2341
|
+
} = Pi({
|
|
2342
|
+
data: V,
|
|
2343
|
+
config: H,
|
|
2344
|
+
onPageChange: c,
|
|
2345
|
+
manual: p
|
|
2346
|
+
}), ge = d === !1, oe = A(() => pe !== void 0 ? pe : ge && V.length > Fi, [pe, ge, V.length]), pt = O(null), mt = O(null), {
|
|
2347
|
+
columnWidths: gt,
|
|
2348
|
+
isResizing: vt,
|
|
2349
|
+
startResize: yt,
|
|
2350
|
+
getColumnWidth: ve
|
|
2351
|
+
} = Ei({
|
|
2352
|
+
columns: le,
|
|
2353
|
+
enabled: J,
|
|
2354
|
+
minWidth: Bt,
|
|
2355
|
+
maxWidth: Wt,
|
|
2356
|
+
onColumnResize: jt,
|
|
2357
|
+
tableRef: mt
|
|
2358
|
+
}), {
|
|
2359
|
+
isExpanded: wt,
|
|
2360
|
+
toggleExpand: Ct
|
|
2361
|
+
} = Ri({
|
|
2362
|
+
controlledExpandedRows: Ht,
|
|
2363
|
+
onExpandChange: Vt,
|
|
2364
|
+
accordion: Y?.accordion
|
|
2365
|
+
}), ne = ge ? V : Gt, { totalHeight: Jt, startIndex: Yt, endIndex: en, offsetTop: tn } = Mi({
|
|
2366
|
+
containerRef: pt,
|
|
2367
|
+
itemCount: ne.length,
|
|
2368
|
+
rowHeight: qt,
|
|
2369
|
+
buffer: Kt,
|
|
2370
|
+
enabled: oe
|
|
2371
|
+
}), nn = A(
|
|
1145
2372
|
() => ({
|
|
1146
|
-
// Data
|
|
1147
2373
|
data: t,
|
|
1148
|
-
processedData:
|
|
1149
|
-
columns:
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
rowActions:
|
|
1153
|
-
globalActions:
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
setFilter: ne,
|
|
1160
|
-
clearFilters: le,
|
|
1161
|
-
// Search
|
|
1162
|
-
searchValue: Z,
|
|
1163
|
-
handleSearch: ee,
|
|
1164
|
-
clearSearch: te,
|
|
1165
|
-
searchable: p,
|
|
1166
|
-
// Selection
|
|
1167
|
-
selectedRows: ce,
|
|
1168
|
-
isSelected: oe,
|
|
1169
|
-
toggleRow: de,
|
|
1170
|
-
selectAll: be,
|
|
1171
|
-
deselectAll: he,
|
|
1172
|
-
isAllSelected: ue,
|
|
1173
|
-
isPartiallySelected: fe,
|
|
1174
|
-
selectable: _,
|
|
1175
|
-
selectionMode: k,
|
|
1176
|
-
selectedCount: pe,
|
|
1177
|
-
// Pagination
|
|
1178
|
-
page: ge,
|
|
1179
|
-
pageSize: me,
|
|
1180
|
-
totalPages: ve,
|
|
1181
|
-
totalItems: ye,
|
|
1182
|
-
goToPage: Se,
|
|
1183
|
-
nextPage: Ce,
|
|
1184
|
-
prevPage: Ne,
|
|
1185
|
-
changePageSize: ke,
|
|
1186
|
-
hasNextPage: De,
|
|
1187
|
-
hasPrevPage: Pe,
|
|
1188
|
-
startIndex: Te,
|
|
1189
|
-
endIndex: Ae,
|
|
1190
|
-
paginationEnabled: r !== !1,
|
|
1191
|
-
pageSizeOptions: R && typeof R == "object" ? R.pageSizeOptions ?? [10, 20, 50, 100] : [10, 20, 50, 100],
|
|
1192
|
-
showSizeChanger: R && typeof R == "object" ? R.showSizeChanger ?? !1 : !1,
|
|
1193
|
-
// UI State
|
|
1194
|
-
loading: d,
|
|
1195
|
-
loadingComponent: c,
|
|
1196
|
-
emptyComponent: g,
|
|
1197
|
-
// Styling
|
|
1198
|
-
locale: J,
|
|
1199
|
-
classNames: C,
|
|
1200
|
-
size: K,
|
|
1201
|
-
bordered: B,
|
|
1202
|
-
striped: j,
|
|
1203
|
-
hoverable: E,
|
|
1204
|
-
stickyHeader: V,
|
|
1205
|
-
// Callbacks
|
|
1206
|
-
onRowClick: H,
|
|
1207
|
-
onRowDoubleClick: q,
|
|
1208
|
-
// Modal
|
|
1209
|
-
openModal: X,
|
|
1210
|
-
closeModal: Y,
|
|
1211
|
-
modalContent: U,
|
|
1212
|
-
isModalOpen: Q
|
|
2374
|
+
processedData: ne,
|
|
2375
|
+
columns: i,
|
|
2376
|
+
visibleColumns: le,
|
|
2377
|
+
rowKey: r,
|
|
2378
|
+
rowActions: o,
|
|
2379
|
+
globalActions: l,
|
|
2380
|
+
maxVisibleActions: s,
|
|
2381
|
+
expandableRender: Y?.render,
|
|
2382
|
+
isExpanded: wt,
|
|
2383
|
+
toggleExpand: Ct,
|
|
2384
|
+
expandableEnabled: Y !== void 0
|
|
1213
2385
|
}),
|
|
1214
|
-
[
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
2386
|
+
[t, ne, i, le, r, o, l, s, Y, wt, Ct]
|
|
2387
|
+
), rn = A(
|
|
2388
|
+
() => ({
|
|
2389
|
+
sortState: We,
|
|
2390
|
+
handleSort: He,
|
|
2391
|
+
multiSortState: _e,
|
|
2392
|
+
isMultiSort: Ue,
|
|
2393
|
+
clearSort: Ve
|
|
2394
|
+
}),
|
|
2395
|
+
[We, He, _e, Ue, Ve]
|
|
2396
|
+
), sn = A(
|
|
2397
|
+
() => ({
|
|
2398
|
+
filters: se,
|
|
2399
|
+
setFilter: Oe,
|
|
2400
|
+
clearFilter: je,
|
|
2401
|
+
clearFilters: Be,
|
|
2402
|
+
searchValue: re,
|
|
2403
|
+
handleSearch: $e,
|
|
2404
|
+
clearSearch: ze,
|
|
2405
|
+
searchable: S,
|
|
2406
|
+
filterPanelOpen: me,
|
|
2407
|
+
toggleFilterPanel: Ee,
|
|
2408
|
+
hasFilterableColumns: Me,
|
|
2409
|
+
filterMode: P
|
|
2410
|
+
}),
|
|
2411
|
+
[se, Oe, je, Be, re, $e, ze, S, me, Ee, Me, P]
|
|
2412
|
+
), ln = A(
|
|
2413
|
+
() => ({
|
|
2414
|
+
selectedRows: Xe,
|
|
2415
|
+
isSelected: Ge,
|
|
2416
|
+
toggleRow: Je,
|
|
2417
|
+
selectAll: Ye,
|
|
2418
|
+
deselectAll: et,
|
|
2419
|
+
isAllSelected: tt,
|
|
2420
|
+
isPartiallySelected: nt,
|
|
2421
|
+
selectedCount: te,
|
|
2422
|
+
selectable: ee,
|
|
2423
|
+
selectionMode: _
|
|
2424
|
+
}),
|
|
2425
|
+
[Xe, Ge, Je, Ye, et, tt, nt, te, ee, _]
|
|
2426
|
+
), on = A(
|
|
2427
|
+
() => ({
|
|
2428
|
+
page: it,
|
|
2429
|
+
pageSize: rt,
|
|
2430
|
+
totalPages: st,
|
|
2431
|
+
totalItems: lt,
|
|
2432
|
+
goToPage: ot,
|
|
2433
|
+
nextPage: at,
|
|
2434
|
+
prevPage: ct,
|
|
2435
|
+
changePageSize: dt,
|
|
2436
|
+
hasNextPage: ut,
|
|
2437
|
+
hasPrevPage: ht,
|
|
2438
|
+
startIndex: bt,
|
|
2439
|
+
endIndex: ft,
|
|
2440
|
+
paginationEnabled: d !== !1,
|
|
2441
|
+
pageSizeOptions: H && typeof H == "object" ? H.pageSizeOptions ?? [10, 20, 50, 100] : [10, 20, 50, 100],
|
|
2442
|
+
showSizeChanger: H && typeof H == "object" ? H.showSizeChanger ?? !1 : !1
|
|
2443
|
+
}),
|
|
2444
|
+
[it, rt, st, lt, ot, at, ct, dt, ut, ht, bt, ft, d, H]
|
|
2445
|
+
), an = A(
|
|
2446
|
+
() => ({
|
|
2447
|
+
locale: q,
|
|
2448
|
+
classNames: ie,
|
|
2449
|
+
size: fe,
|
|
2450
|
+
bordered: ue,
|
|
2451
|
+
striped: he,
|
|
2452
|
+
hoverable: be,
|
|
2453
|
+
stickyHeader: ke,
|
|
2454
|
+
loading: X,
|
|
2455
|
+
loadingComponent: Ce,
|
|
2456
|
+
emptyComponent: Ne,
|
|
2457
|
+
onRowClick: Te,
|
|
2458
|
+
onRowDoubleClick: Pe,
|
|
2459
|
+
openModal: Re,
|
|
2460
|
+
closeModal: Fe,
|
|
2461
|
+
modalContent: Ae,
|
|
2462
|
+
isModalOpen: De,
|
|
2463
|
+
columnVisibilityEnabled: M,
|
|
2464
|
+
hiddenColumnIds: qe,
|
|
2465
|
+
toggleColumn: Ke,
|
|
2466
|
+
showAllColumns: Ze,
|
|
2467
|
+
isColumnVisible: Qe,
|
|
2468
|
+
columns: i,
|
|
2469
|
+
resizable: J,
|
|
2470
|
+
columnWidths: gt,
|
|
2471
|
+
isResizing: vt,
|
|
2472
|
+
startResize: yt,
|
|
2473
|
+
getColumnWidth: ve
|
|
2474
|
+
}),
|
|
2475
|
+
[q, ie, fe, ue, he, be, ke, X, Ce, Ne, Te, Pe, Re, Fe, Ae, De, M, qe, Ke, Ze, Qe, i, J, gt, vt, yt, ve]
|
|
2476
|
+
), ye = ne.length > 0, cn = $t("(max-width: 640px)"), dn = A(() => {
|
|
2477
|
+
const E = [], K = re.length > 0, we = Object.keys(se).length > 0;
|
|
2478
|
+
return (K || we) && (V.length === 0 ? E.push(q.noResultsFound) : E.push(q.resultsFound.replace("{count}", String(V.length)))), ee && te > 0 && E.push(q.rowsSelected.replace("{count}", String(te))), E.join(". ");
|
|
2479
|
+
}, [V.length, re, se, ee, te, q]);
|
|
2480
|
+
return /* @__PURE__ */ n(Cn, { data: nn, sort: rn, filter: sn, selection: ln, pagination: on, ui: an, children: /* @__PURE__ */ C(
|
|
1273
2481
|
"div",
|
|
1274
2482
|
{
|
|
1275
|
-
className:
|
|
2483
|
+
className: D(
|
|
1276
2484
|
"bt-container",
|
|
1277
|
-
`bt-size-${
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
2485
|
+
`bt-size-${fe}`,
|
|
2486
|
+
he && "bt-striped",
|
|
2487
|
+
ue && "bt-bordered",
|
|
2488
|
+
be && "bt-hoverable",
|
|
2489
|
+
X && "bt-container-loading",
|
|
2490
|
+
ie.container
|
|
1283
2491
|
),
|
|
1284
|
-
style:
|
|
2492
|
+
style: xe.container,
|
|
1285
2493
|
children: [
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
/* @__PURE__ */
|
|
2494
|
+
/* @__PURE__ */ n(fi, {}),
|
|
2495
|
+
(P === "panel" || P === "both") && /* @__PURE__ */ n(ii, { open: me }),
|
|
2496
|
+
/* @__PURE__ */ C(
|
|
1288
2497
|
"div",
|
|
1289
2498
|
{
|
|
2499
|
+
ref: pt,
|
|
1290
2500
|
className: "bt-table-wrapper",
|
|
1291
|
-
style: {
|
|
2501
|
+
style: {
|
|
2502
|
+
maxHeight: Se,
|
|
2503
|
+
...oe && !Se ? { maxHeight: "80vh", overflow: "auto" } : {}
|
|
2504
|
+
},
|
|
1292
2505
|
children: [
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
{
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
"
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
2506
|
+
cn ? (
|
|
2507
|
+
/* Cards (móvil) */
|
|
2508
|
+
ye && /* @__PURE__ */ n(Yn, {})
|
|
2509
|
+
) : (
|
|
2510
|
+
/* Tabla tradicional (desktop/tablet) */
|
|
2511
|
+
/* @__PURE__ */ C(
|
|
2512
|
+
"table",
|
|
2513
|
+
{
|
|
2514
|
+
ref: mt,
|
|
2515
|
+
className: D("bt-table", J && "bt-table-resizable", ie.table),
|
|
2516
|
+
style: xe.table,
|
|
2517
|
+
role: "grid",
|
|
2518
|
+
"aria-label": _t,
|
|
2519
|
+
"aria-describedby": Ut,
|
|
2520
|
+
"aria-busy": X,
|
|
2521
|
+
"aria-rowcount": oe ? ne.length : void 0,
|
|
2522
|
+
children: [
|
|
2523
|
+
J && /* @__PURE__ */ C("colgroup", { children: [
|
|
2524
|
+
Y && /* @__PURE__ */ n("col", { style: { width: 40 } }),
|
|
2525
|
+
ee && /* @__PURE__ */ n("col", { style: { width: 40 } }),
|
|
2526
|
+
le.map((E) => {
|
|
2527
|
+
const K = ve(E.id);
|
|
2528
|
+
return /* @__PURE__ */ n("col", { style: K !== void 0 ? { width: K } : E.width !== void 0 ? { width: E.width } : void 0 }, E.id);
|
|
2529
|
+
}),
|
|
2530
|
+
o && o.length > 0 && /* @__PURE__ */ n("col", {})
|
|
2531
|
+
] }),
|
|
2532
|
+
/* @__PURE__ */ n(En, {}),
|
|
2533
|
+
ye ? oe ? /* @__PURE__ */ n(
|
|
2534
|
+
xi,
|
|
2535
|
+
{
|
|
2536
|
+
startIndex: Yt,
|
|
2537
|
+
endIndex: en,
|
|
2538
|
+
totalHeight: Jt,
|
|
2539
|
+
offsetTop: tn
|
|
2540
|
+
}
|
|
2541
|
+
) : /* @__PURE__ */ n(Zn, {}) : /* @__PURE__ */ n(mi, {})
|
|
2542
|
+
]
|
|
2543
|
+
}
|
|
2544
|
+
)
|
|
1307
2545
|
),
|
|
1308
|
-
|
|
1309
|
-
/* @__PURE__ */ i(ut, { show: d && F })
|
|
2546
|
+
/* @__PURE__ */ n(gi, { show: X && ye })
|
|
1310
2547
|
]
|
|
1311
2548
|
}
|
|
1312
2549
|
),
|
|
1313
|
-
|
|
1314
|
-
/* @__PURE__ */
|
|
2550
|
+
d !== !1 && /* @__PURE__ */ n(di, {}),
|
|
2551
|
+
/* @__PURE__ */ n(Ci, {}),
|
|
2552
|
+
/* @__PURE__ */ n("div", { "aria-live": "polite", "aria-atomic": "true", className: "bt-sr-only", children: dn })
|
|
1315
2553
|
]
|
|
1316
2554
|
}
|
|
1317
2555
|
) });
|
|
1318
2556
|
}
|
|
1319
|
-
const
|
|
2557
|
+
const Vi = Oi;
|
|
1320
2558
|
export {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
2559
|
+
Vi as BetterTable,
|
|
2560
|
+
Cn as TableProvider,
|
|
2561
|
+
zt as defaultLocale,
|
|
2562
|
+
Fn as filterData,
|
|
2563
|
+
W as getValueFromPath,
|
|
2564
|
+
ki as locales,
|
|
2565
|
+
$n as searchData,
|
|
2566
|
+
Mn as sortData,
|
|
2567
|
+
Ai as useColumnVisibility,
|
|
2568
|
+
j as useTableData,
|
|
2569
|
+
Ti as useTableFilter,
|
|
2570
|
+
ce as useTableFilterContext,
|
|
2571
|
+
Pi as useTablePagination,
|
|
2572
|
+
vn as useTablePaginationContext,
|
|
2573
|
+
Li as useTableSearch,
|
|
2574
|
+
Di as useTableSelection,
|
|
2575
|
+
U as useTableSelectionContext,
|
|
2576
|
+
Si as useTableSort,
|
|
2577
|
+
fn as useTableSortContext,
|
|
2578
|
+
R as useTableUI
|
|
1334
2579
|
};
|
|
1335
2580
|
//# sourceMappingURL=better-table.es.js.map
|