dgz-ui-shared 1.2.30 → 1.2.32
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/dist/components/datatable/index.cjs.js +1 -1
- package/dist/components/datatable/index.cjs.js.map +1 -1
- package/dist/components/datatable/index.es.js +245 -238
- package/dist/components/datatable/index.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/datatable/DataTable.d.ts +1 -1
- package/dist/types/components/datatable/DataTable.d.ts.map +1 -1
- package/dist/types/components/datatable/MyTable.d.ts +12 -0
- package/dist/types/components/datatable/MyTable.d.ts.map +1 -1
- package/dist/types/components/filters/AppliedFilters.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,394 +1,401 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { y as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { DropdownMenu as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { l as
|
|
7
|
-
import { XIcon as
|
|
8
|
-
import { memo as
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { y as C, f as P } from "../../chunks/index-E1NtSoNr.es.js";
|
|
3
|
+
import { Button as q } from "dgz-ui/button";
|
|
4
|
+
import { DropdownMenu as ee, DropdownMenuTrigger as te, DropdownMenuContent as le, DropdownMenuItem as de, DropdownMenuSeparator as se, DropdownMenuCheckboxItem as ie } from "dgz-ui/dropdown";
|
|
5
|
+
import { cn as z } from "dgz-ui/utils";
|
|
6
|
+
import { l as A } from "../../chunks/lodash-CRDOWzbs.es.js";
|
|
7
|
+
import { XIcon as Z, ArrowDownWideNarrow as fe, ArrowUpWideNarrow as re, ArrowUpDown as pe, RefreshCw as Ne } from "lucide-react";
|
|
8
|
+
import { memo as ce, useMemo as h, useEffect as Q, useState as xe } from "react";
|
|
9
9
|
import { useTranslation as b } from "react-i18next";
|
|
10
|
-
import { u as
|
|
11
|
-
import { A as
|
|
12
|
-
import { E as
|
|
13
|
-
import { S as
|
|
14
|
-
import { ButtonGroup as
|
|
15
|
-
import { L as
|
|
16
|
-
import { D as I, M as
|
|
10
|
+
import { u as me, a as we, b as ge } from "../../chunks/useSortable-BXNk8Wth.es.js";
|
|
11
|
+
import { A as ne } from "../../chunks/Actions-Du8iQ3WR.es.js";
|
|
12
|
+
import { E as Ee } from "../../chunks/ExportData-CwotVgye.es.js";
|
|
13
|
+
import { S as Te, F as Ae } from "../../chunks/Search-BtiKC-dt.es.js";
|
|
14
|
+
import { ButtonGroup as De } from "dgz-ui";
|
|
15
|
+
import { L as ve } from "../../chunks/Loader-zvzAi0F6.es.js";
|
|
16
|
+
import { D as I, M as Me, a as ze } from "../../chunks/MyPagination-B0czoGZK.es.js";
|
|
17
17
|
import { Checkbox as U } from "dgz-ui/form";
|
|
18
|
-
import { Table as
|
|
18
|
+
import { Table as ke, TableHeader as Le, TableRow as G, TableHead as X, TableBody as Re, TableCell as $ } from "dgz-ui/table";
|
|
19
19
|
import { S as j } from "../../chunks/SortOrder-CwuehjY1.es.js";
|
|
20
|
-
import { E as
|
|
21
|
-
const
|
|
22
|
-
filters:
|
|
23
|
-
params:
|
|
20
|
+
import { E as oe } from "../../chunks/Empty-BReVQKje.es.js";
|
|
21
|
+
const We = ce(function({
|
|
22
|
+
filters: g,
|
|
23
|
+
params: n,
|
|
24
24
|
onFilter: x,
|
|
25
25
|
className: w,
|
|
26
|
-
...
|
|
26
|
+
...M
|
|
27
27
|
}) {
|
|
28
|
-
const { t
|
|
28
|
+
const { t } = b(), f = h(
|
|
29
29
|
() => Object.fromEntries(
|
|
30
|
-
(
|
|
31
|
-
var
|
|
30
|
+
(g == null ? void 0 : g.map((p) => {
|
|
31
|
+
var N;
|
|
32
32
|
return [
|
|
33
|
-
|
|
33
|
+
p.name,
|
|
34
34
|
Object.fromEntries(
|
|
35
|
-
((
|
|
35
|
+
((N = p.options) == null ? void 0 : N.map(({ label: v, value: c }) => [c, v])) || []
|
|
36
36
|
)
|
|
37
37
|
];
|
|
38
38
|
})) || []
|
|
39
39
|
),
|
|
40
|
-
[
|
|
40
|
+
[g]
|
|
41
|
+
), D = h(
|
|
42
|
+
() => Object.entries(n || {}).filter(
|
|
43
|
+
([p, N]) => !!(f != null && f[p]) && !A.isEmpty(N)
|
|
44
|
+
),
|
|
45
|
+
[f, n]
|
|
41
46
|
);
|
|
42
|
-
return /* @__PURE__ */ e("div", { ...
|
|
43
|
-
([
|
|
44
|
-
var
|
|
45
|
-
return Array.isArray(
|
|
46
|
-
var
|
|
47
|
-
return ((
|
|
48
|
-
}).map((
|
|
49
|
-
var
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
47
|
+
return !A.isEmpty(D) && /* @__PURE__ */ e("div", { ...M, className: z("flex flex-wrap gap-2", w), children: D.map(
|
|
48
|
+
([p, N]) => {
|
|
49
|
+
var v;
|
|
50
|
+
return Array.isArray(N) ? /* @__PURE__ */ e(De, { children: N.filter((c) => {
|
|
51
|
+
var s;
|
|
52
|
+
return ((s = f == null ? void 0 : f[p]) == null ? void 0 : s[c]) && c;
|
|
53
|
+
}).map((c, s) => {
|
|
54
|
+
var k;
|
|
55
|
+
return /* @__PURE__ */ m(
|
|
56
|
+
q,
|
|
52
57
|
{
|
|
53
58
|
size: "sm",
|
|
54
59
|
onClick: () => {
|
|
55
60
|
x == null || x({
|
|
56
|
-
...
|
|
57
|
-
[
|
|
61
|
+
...n,
|
|
62
|
+
[p]: N.filter((E) => E !== c)
|
|
58
63
|
});
|
|
59
64
|
},
|
|
60
65
|
children: [
|
|
61
|
-
|
|
66
|
+
t(String(((k = f == null ? void 0 : f[p]) == null ? void 0 : k[c]) || "")),
|
|
62
67
|
" ",
|
|
63
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e(Z, {})
|
|
64
69
|
]
|
|
65
70
|
},
|
|
66
|
-
|
|
71
|
+
s
|
|
67
72
|
);
|
|
68
|
-
}) },
|
|
69
|
-
|
|
73
|
+
}) }, p) : /* @__PURE__ */ m(
|
|
74
|
+
q,
|
|
70
75
|
{
|
|
71
76
|
size: "sm",
|
|
72
77
|
onClick: () => {
|
|
73
|
-
x == null || x(
|
|
78
|
+
x == null || x(A.omit(n, p));
|
|
74
79
|
},
|
|
75
80
|
children: [
|
|
76
|
-
|
|
81
|
+
t(String(((v = f == null ? void 0 : f[p]) == null ? void 0 : v[N]) || "")),
|
|
77
82
|
" ",
|
|
78
|
-
/* @__PURE__ */ e(
|
|
83
|
+
/* @__PURE__ */ e(Z, {})
|
|
79
84
|
]
|
|
80
85
|
}
|
|
81
86
|
);
|
|
82
87
|
}
|
|
83
88
|
) });
|
|
84
|
-
}),
|
|
85
|
-
rows:
|
|
86
|
-
columns:
|
|
87
|
-
onRowClick:
|
|
89
|
+
}), Be = ({
|
|
90
|
+
rows: d = [],
|
|
91
|
+
columns: g,
|
|
92
|
+
onRowClick: n,
|
|
88
93
|
rowKey: x,
|
|
89
94
|
params: w = {
|
|
90
95
|
page: 1,
|
|
91
96
|
limit: I
|
|
92
97
|
},
|
|
93
|
-
hasNumbers:
|
|
94
|
-
hasCheckbox:
|
|
95
|
-
selectedItems:
|
|
96
|
-
onSelectedItemsChange:
|
|
97
|
-
onSortOrderChange:
|
|
98
|
-
isStickyHeader:
|
|
99
|
-
className:
|
|
100
|
-
...
|
|
98
|
+
hasNumbers: M = !1,
|
|
99
|
+
hasCheckbox: t = !1,
|
|
100
|
+
selectedItems: f,
|
|
101
|
+
onSelectedItemsChange: D,
|
|
102
|
+
onSortOrderChange: p,
|
|
103
|
+
isStickyHeader: N,
|
|
104
|
+
className: v,
|
|
105
|
+
...c
|
|
101
106
|
}) => {
|
|
102
|
-
const { sortObject:
|
|
107
|
+
const { sortObject: s, handleSort: k } = me({
|
|
103
108
|
sortField: w == null ? void 0 : w.sortField,
|
|
104
109
|
sortOrder: w == null ? void 0 : w.sortOrder,
|
|
105
|
-
onSortOrderChange:
|
|
110
|
+
onSortOrderChange: p
|
|
106
111
|
}), {
|
|
107
|
-
selectedRows:
|
|
108
|
-
isRowSelected:
|
|
109
|
-
isAllRowsSelected:
|
|
110
|
-
handleSelectAllRows:
|
|
111
|
-
handleSelectRow:
|
|
112
|
-
} =
|
|
113
|
-
return
|
|
114
|
-
JSON.stringify(
|
|
115
|
-
}, [
|
|
112
|
+
selectedRows: E,
|
|
113
|
+
isRowSelected: R,
|
|
114
|
+
isAllRowsSelected: y,
|
|
115
|
+
handleSelectAllRows: L,
|
|
116
|
+
handleSelectRow: H
|
|
117
|
+
} = we({ rows: d, defaultSelectedRows: f });
|
|
118
|
+
return Q(() => {
|
|
119
|
+
JSON.stringify(f) !== JSON.stringify(E) && E && (D == null || D(E));
|
|
120
|
+
}, [E, f, D]), /* @__PURE__ */ m(ke, { ...c, children: [
|
|
116
121
|
/* @__PURE__ */ e(
|
|
117
|
-
|
|
122
|
+
Le,
|
|
118
123
|
{
|
|
119
|
-
className:
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
|
|
124
|
+
className: z("bg-bg", N && "sticky top-0 z-1"),
|
|
125
|
+
children: /* @__PURE__ */ m(G, { children: [
|
|
126
|
+
t && /* @__PURE__ */ e(X, { className: "w-12 p-3", children: /* @__PURE__ */ e(
|
|
122
127
|
U,
|
|
123
128
|
{
|
|
124
129
|
className: "mt-1",
|
|
125
|
-
checked:
|
|
126
|
-
onCheckedChange: (
|
|
130
|
+
checked: y(x),
|
|
131
|
+
onCheckedChange: (i) => L(x, !!i),
|
|
127
132
|
"aria-label": "Select all"
|
|
128
133
|
}
|
|
129
134
|
) }),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
135
|
+
M && /* @__PURE__ */ e(X, { className: "w-12 p-2", children: "#" }),
|
|
136
|
+
g.filter((i) => !i.hidden).map((i) => /* @__PURE__ */ e(
|
|
137
|
+
X,
|
|
133
138
|
{
|
|
134
|
-
style:
|
|
135
|
-
className:
|
|
136
|
-
onClick: () =>
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
|
|
139
|
+
style: i.styles,
|
|
140
|
+
className: z("p-2", i.sortable && "cursor-pointer"),
|
|
141
|
+
onClick: () => i.sortable && k(i.dataIndex),
|
|
142
|
+
children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
143
|
+
i.name,
|
|
139
144
|
" ",
|
|
140
|
-
|
|
141
|
-
(
|
|
142
|
-
(
|
|
143
|
-
] }) : /* @__PURE__ */ e(
|
|
145
|
+
i.sortable && ((s == null ? void 0 : s.sortField) === i.key ? /* @__PURE__ */ m(O, { children: [
|
|
146
|
+
(s == null ? void 0 : s.sortOrder) === j.DESC && /* @__PURE__ */ e(fe, { size: 15 }),
|
|
147
|
+
(s == null ? void 0 : s.sortOrder) === j.ASC && /* @__PURE__ */ e(re, { size: 15 })
|
|
148
|
+
] }) : /* @__PURE__ */ e(pe, { size: 15 }))
|
|
144
149
|
] })
|
|
145
150
|
},
|
|
146
|
-
|
|
151
|
+
i.key
|
|
147
152
|
))
|
|
148
153
|
] })
|
|
149
154
|
}
|
|
150
155
|
),
|
|
151
|
-
/* @__PURE__ */ e(
|
|
152
|
-
|
|
156
|
+
/* @__PURE__ */ e(Re, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: d.length ? d.map((i, o) => /* @__PURE__ */ m(
|
|
157
|
+
G,
|
|
153
158
|
{
|
|
154
|
-
onClick: () =>
|
|
155
|
-
className:
|
|
156
|
-
"data-state":
|
|
159
|
+
onClick: () => n == null ? void 0 : n(i),
|
|
160
|
+
className: z(n && "cursor-pointer"),
|
|
161
|
+
"data-state": R(i[x]) && "selected",
|
|
157
162
|
children: [
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
t && /* @__PURE__ */ e(
|
|
164
|
+
$,
|
|
160
165
|
{
|
|
161
166
|
className: "w-12 p-3",
|
|
162
|
-
onClick: (
|
|
167
|
+
onClick: (l) => l.stopPropagation(),
|
|
163
168
|
children: /* @__PURE__ */ e(
|
|
164
169
|
U,
|
|
165
170
|
{
|
|
166
171
|
className: "mt-1",
|
|
167
|
-
checked:
|
|
168
|
-
onCheckedChange: (
|
|
172
|
+
checked: R(i[x]),
|
|
173
|
+
onCheckedChange: (l) => H(i[x], !!l),
|
|
169
174
|
"aria-label": "Select row"
|
|
170
175
|
}
|
|
171
176
|
)
|
|
172
177
|
}
|
|
173
178
|
),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
179
|
+
M && /* @__PURE__ */ e($, { className: "w-12 p-2", children: (w.page - 1) * (w.limit || I) + o + 1 }),
|
|
180
|
+
g.filter((l) => !l.hidden).map((l) => /* @__PURE__ */ e(
|
|
181
|
+
$,
|
|
177
182
|
{
|
|
178
183
|
className: "text-body-xs-medium max-w-xs p-2",
|
|
179
|
-
style:
|
|
180
|
-
children:
|
|
184
|
+
style: l.styles,
|
|
185
|
+
children: l.render ? l.render(A.get(i, l.dataIndex), i) : A.get(i, l.dataIndex, "")
|
|
181
186
|
},
|
|
182
|
-
`${
|
|
187
|
+
`${o}-${l.key}`
|
|
183
188
|
))
|
|
184
189
|
]
|
|
185
190
|
},
|
|
186
|
-
`${
|
|
187
|
-
)) : /* @__PURE__ */ e(
|
|
188
|
-
|
|
191
|
+
`${i[x]}`
|
|
192
|
+
)) : /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
|
|
193
|
+
$,
|
|
189
194
|
{
|
|
190
|
-
colSpan:
|
|
191
|
-
children: /* @__PURE__ */ e(
|
|
195
|
+
colSpan: M ? t ? g.length + 2 : g.length + 1 : g.length,
|
|
196
|
+
children: /* @__PURE__ */ e(oe, {})
|
|
192
197
|
}
|
|
193
198
|
) }) })
|
|
194
199
|
] });
|
|
195
|
-
},
|
|
196
|
-
dataSource:
|
|
197
|
-
columns:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
exportOptions: T,
|
|
203
|
-
hasCheckbox: s,
|
|
204
|
-
hasPagination: f,
|
|
205
|
-
isStickyHeader: c,
|
|
200
|
+
}, Ve = ({
|
|
201
|
+
dataSource: d,
|
|
202
|
+
columns: g,
|
|
203
|
+
rowKey: n,
|
|
204
|
+
hasSearch: x,
|
|
205
|
+
exportOptions: w,
|
|
206
|
+
hasPagination: M,
|
|
206
207
|
onParamChange: t,
|
|
207
|
-
dataKey:
|
|
208
|
-
loading:
|
|
208
|
+
dataKey: f = "docs",
|
|
209
|
+
loading: D,
|
|
209
210
|
tableKey: p,
|
|
210
|
-
filters:
|
|
211
|
-
actions:
|
|
212
|
-
handleFilterChange:
|
|
213
|
-
params:
|
|
214
|
-
exportLoading:
|
|
215
|
-
onColumnsUpdate:
|
|
216
|
-
hasColumnsVisibilityDropdown:
|
|
217
|
-
showAppliedFilters:
|
|
218
|
-
onSelectedItemsChange:
|
|
219
|
-
actionProps:
|
|
220
|
-
filterWrapperProps:
|
|
221
|
-
exportOptionsProps:
|
|
222
|
-
columnsVisibilityProps:
|
|
223
|
-
paginationProps:
|
|
224
|
-
searchProps:
|
|
225
|
-
|
|
211
|
+
filters: N,
|
|
212
|
+
actions: v,
|
|
213
|
+
handleFilterChange: c,
|
|
214
|
+
params: s,
|
|
215
|
+
exportLoading: k = !1,
|
|
216
|
+
onColumnsUpdate: E,
|
|
217
|
+
hasColumnsVisibilityDropdown: R,
|
|
218
|
+
showAppliedFilters: y = !1,
|
|
219
|
+
onSelectedItemsChange: L,
|
|
220
|
+
actionProps: H,
|
|
221
|
+
filterWrapperProps: i,
|
|
222
|
+
exportOptionsProps: o,
|
|
223
|
+
columnsVisibilityProps: l,
|
|
224
|
+
paginationProps: K,
|
|
225
|
+
searchProps: T,
|
|
226
|
+
className: F,
|
|
227
|
+
...S
|
|
226
228
|
}) => {
|
|
227
|
-
var
|
|
228
|
-
const { t:
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
}, [
|
|
232
|
-
|
|
233
|
-
}, [
|
|
229
|
+
var Y;
|
|
230
|
+
const { t: J } = b(), [W, V] = xe([]), { formattedColumns: B, handleColumnsChange: u, resetColumns: a } = ge({ key: p, columns: g });
|
|
231
|
+
return Q(() => {
|
|
232
|
+
E == null || E(B);
|
|
233
|
+
}, [B, E]), Q(() => {
|
|
234
|
+
L == null || L(W);
|
|
235
|
+
}, [W, L]), /* @__PURE__ */ m(
|
|
234
236
|
"div",
|
|
235
237
|
{
|
|
236
238
|
className: "border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",
|
|
237
239
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
(
|
|
240
|
-
/* @__PURE__ */ e("div", { className: "grow", children:
|
|
241
|
-
|
|
240
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
241
|
+
(x || R && p || !A.isEmpty(w) || !A.isEmpty(N)) && /* @__PURE__ */ m("div", { className: "flex flex-col justify-between gap-3 lg:flex-row lg:items-center", children: [
|
|
242
|
+
/* @__PURE__ */ e("div", { className: "grow", children: x && /* @__PURE__ */ e(
|
|
243
|
+
Te,
|
|
242
244
|
{
|
|
243
|
-
...
|
|
245
|
+
...T,
|
|
244
246
|
inputProps: {
|
|
245
|
-
...
|
|
246
|
-
className:
|
|
247
|
+
...T == null ? void 0 : T.inputProps,
|
|
248
|
+
className: z(
|
|
247
249
|
"h-8 grow",
|
|
248
|
-
(
|
|
250
|
+
(Y = T == null ? void 0 : T.inputProps) == null ? void 0 : Y.className
|
|
249
251
|
)
|
|
250
252
|
},
|
|
251
|
-
className:
|
|
252
|
-
"max-w-full lg:max-w-80 [&_button]:-top-1",
|
|
253
|
-
|
|
253
|
+
className: z(
|
|
254
|
+
"max-w-full lg:max-w-80! [&_button]:-top-1",
|
|
255
|
+
T == null ? void 0 : T.className
|
|
254
256
|
),
|
|
255
|
-
defaultValue:
|
|
256
|
-
onSearchChange: (
|
|
257
|
+
defaultValue: A.get(s, "search", ""),
|
|
258
|
+
onSearchChange: (r) => t == null ? void 0 : t({ ...s, search: r, page: 1 })
|
|
257
259
|
}
|
|
258
260
|
) }),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
|
|
261
|
-
|
|
261
|
+
/* @__PURE__ */ m("div", { className: "flex items-center justify-end gap-3", children: [
|
|
262
|
+
w && /* @__PURE__ */ e(
|
|
263
|
+
Ee,
|
|
262
264
|
{
|
|
263
|
-
...
|
|
264
|
-
options:
|
|
265
|
-
loading:
|
|
265
|
+
...o,
|
|
266
|
+
options: w,
|
|
267
|
+
loading: k
|
|
266
268
|
}
|
|
267
269
|
),
|
|
268
|
-
|
|
270
|
+
R && p && /* @__PURE__ */ m(ee, { children: [
|
|
269
271
|
/* @__PURE__ */ e(
|
|
270
|
-
|
|
272
|
+
te,
|
|
271
273
|
{
|
|
272
274
|
asChild: !0,
|
|
273
275
|
className: "grow",
|
|
274
|
-
...
|
|
276
|
+
...l == null ? void 0 : l.triggerProps,
|
|
275
277
|
children: /* @__PURE__ */ e(
|
|
276
|
-
|
|
278
|
+
q,
|
|
277
279
|
{
|
|
278
280
|
variant: "secondary",
|
|
279
281
|
size: "sm",
|
|
280
282
|
className: "ml-auto rounded-lg px-3",
|
|
281
|
-
children: (
|
|
282
|
-
/* @__PURE__ */ e(
|
|
283
|
+
children: (l == null ? void 0 : l.title) || /* @__PURE__ */ m(O, { children: [
|
|
284
|
+
/* @__PURE__ */ e(C, {}),
|
|
283
285
|
" ",
|
|
284
|
-
/* @__PURE__ */ e("span", { className: "hidden md:inline!", children:
|
|
285
|
-
/* @__PURE__ */ e(
|
|
286
|
+
/* @__PURE__ */ e("span", { className: "hidden md:inline!", children: J("Customize columns") }),
|
|
287
|
+
/* @__PURE__ */ e(P, {})
|
|
286
288
|
] })
|
|
287
289
|
}
|
|
288
290
|
)
|
|
289
291
|
}
|
|
290
292
|
),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
293
|
+
/* @__PURE__ */ m(
|
|
294
|
+
le,
|
|
293
295
|
{
|
|
294
296
|
align: "end",
|
|
295
|
-
...
|
|
297
|
+
...l == null ? void 0 : l.contentProps,
|
|
296
298
|
children: [
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
|
|
299
|
+
/* @__PURE__ */ m(
|
|
300
|
+
de,
|
|
299
301
|
{
|
|
300
302
|
className: "capitalize",
|
|
301
|
-
onClick:
|
|
303
|
+
onClick: a,
|
|
302
304
|
children: [
|
|
303
|
-
/* @__PURE__ */ e(
|
|
305
|
+
/* @__PURE__ */ e(Ne, {}),
|
|
304
306
|
" ",
|
|
305
|
-
(
|
|
307
|
+
(l == null ? void 0 : l.resetText) || J("Reset columns")
|
|
306
308
|
]
|
|
307
309
|
}
|
|
308
310
|
),
|
|
309
|
-
/* @__PURE__ */ e(
|
|
310
|
-
|
|
311
|
-
|
|
311
|
+
/* @__PURE__ */ e(se, {}),
|
|
312
|
+
B.map((r) => /* @__PURE__ */ e(
|
|
313
|
+
ie,
|
|
312
314
|
{
|
|
313
315
|
className: "capitalize",
|
|
314
|
-
checked: !
|
|
315
|
-
onCheckedChange: (
|
|
316
|
-
children:
|
|
316
|
+
checked: !r.hidden,
|
|
317
|
+
onCheckedChange: (_) => u(r, !_),
|
|
318
|
+
children: r.name
|
|
317
319
|
},
|
|
318
|
-
|
|
320
|
+
r.key
|
|
319
321
|
))
|
|
320
322
|
]
|
|
321
323
|
}
|
|
322
324
|
)
|
|
323
325
|
] }),
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
326
|
+
v && /* @__PURE__ */ e(ne, { ...H, actions: v }),
|
|
327
|
+
N && /* @__PURE__ */ e(
|
|
328
|
+
Ae,
|
|
327
329
|
{
|
|
328
|
-
...
|
|
329
|
-
filters:
|
|
330
|
-
params:
|
|
331
|
-
onChange:
|
|
332
|
-
onFilter: (
|
|
333
|
-
t == null || t({ ...
|
|
330
|
+
...i,
|
|
331
|
+
filters: N,
|
|
332
|
+
params: s,
|
|
333
|
+
onChange: c,
|
|
334
|
+
onFilter: (r) => {
|
|
335
|
+
t == null || t({ ...r, page: 1 }), c == null || c(r);
|
|
334
336
|
}
|
|
335
337
|
}
|
|
336
338
|
)
|
|
337
339
|
] })
|
|
338
340
|
] }),
|
|
339
|
-
|
|
340
|
-
|
|
341
|
+
y && !A.isEmpty(N) && /* @__PURE__ */ e(
|
|
342
|
+
We,
|
|
341
343
|
{
|
|
342
|
-
filters:
|
|
343
|
-
params:
|
|
344
|
-
onFilter: (
|
|
345
|
-
t == null || t({ ...
|
|
344
|
+
filters: N,
|
|
345
|
+
params: s,
|
|
346
|
+
onFilter: (r) => {
|
|
347
|
+
t == null || t({ ...r, page: 1 }), c == null || c(r);
|
|
346
348
|
}
|
|
347
349
|
}
|
|
348
350
|
)
|
|
349
351
|
] }),
|
|
350
|
-
/* @__PURE__ */ e(
|
|
351
|
-
|
|
352
|
+
/* @__PURE__ */ e(
|
|
353
|
+
"div",
|
|
352
354
|
{
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
355
|
+
className: z(
|
|
356
|
+
"relative flex flex-col overflow-auto border-y",
|
|
357
|
+
F
|
|
358
|
+
),
|
|
359
|
+
children: D ? /* @__PURE__ */ e(ve, {}) : /* @__PURE__ */ e(
|
|
360
|
+
Be,
|
|
361
|
+
{
|
|
362
|
+
...S,
|
|
363
|
+
params: {
|
|
364
|
+
page: (d == null ? void 0 : d.page) || 1,
|
|
365
|
+
limit: d == null ? void 0 : d.limit,
|
|
366
|
+
...s
|
|
367
|
+
},
|
|
368
|
+
rows: A.get(d, f, []),
|
|
369
|
+
rowKey: n,
|
|
370
|
+
selectedItems: W,
|
|
371
|
+
columns: B,
|
|
372
|
+
onSelectedItemsChange: V,
|
|
373
|
+
onSortOrderChange: ({ sortField: r, sortOrder: _ }) => {
|
|
374
|
+
t == null || t({ ...s, sortField: r, sortOrder: _ });
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
)
|
|
371
378
|
}
|
|
372
|
-
)
|
|
373
|
-
|
|
379
|
+
),
|
|
380
|
+
M && /* @__PURE__ */ m("div", { className: "flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between", children: [
|
|
374
381
|
/* @__PURE__ */ e("div", { className: "text-sm", children: /* @__PURE__ */ e(
|
|
375
|
-
|
|
382
|
+
Me,
|
|
376
383
|
{
|
|
377
|
-
onLimitChange: (
|
|
378
|
-
defaultValue:
|
|
384
|
+
onLimitChange: (r) => t == null ? void 0 : t({ ...s, limit: r, page: 1 }),
|
|
385
|
+
defaultValue: d == null ? void 0 : d.limit
|
|
379
386
|
}
|
|
380
387
|
) }),
|
|
381
|
-
/* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children:
|
|
382
|
-
selectedCount:
|
|
383
|
-
total: (
|
|
388
|
+
/* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children: J("{{selectedCount}} of {{total}} row(s) selected", {
|
|
389
|
+
selectedCount: W.length,
|
|
390
|
+
total: (d == null ? void 0 : d.total) || 0
|
|
384
391
|
}) }),
|
|
385
392
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
386
|
-
|
|
393
|
+
ze,
|
|
387
394
|
{
|
|
388
|
-
...
|
|
389
|
-
onPageChange: (
|
|
390
|
-
currentPage:
|
|
391
|
-
totalPages:
|
|
395
|
+
...K,
|
|
396
|
+
onPageChange: (r) => t == null ? void 0 : t({ ...s, page: r }),
|
|
397
|
+
currentPage: d == null ? void 0 : d.page,
|
|
398
|
+
totalPages: d == null ? void 0 : d.totalPages
|
|
392
399
|
}
|
|
393
400
|
) })
|
|
394
401
|
] })
|
|
@@ -397,7 +404,7 @@ const He = me(function({
|
|
|
397
404
|
);
|
|
398
405
|
};
|
|
399
406
|
export {
|
|
400
|
-
|
|
401
|
-
|
|
407
|
+
Ve as DataTable,
|
|
408
|
+
Be as MyTable
|
|
402
409
|
};
|
|
403
410
|
//# sourceMappingURL=index.es.js.map
|