dgz-ui-shared 1.2.26 → 1.2.28

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