dgz-ui-shared 1.1.29 → 1.1.30
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/MyLimitSelect-BNdB8P5s.cjs +6 -0
- package/dist/{MyLimitSelect-D5ZWDY-s.js → MyLimitSelect-CNRAneFY.js} +94 -82
- package/dist/components/datatable/index.cjs.js +5 -5
- package/dist/components/datatable/index.es.js +164 -160
- package/dist/components/pagination/index.cjs.js +1 -1
- package/dist/components/pagination/index.es.js +1 -1
- package/dist/types/components/datatable/DataTable.d.ts +6 -2
- package/dist/types/components/datatable/DataTable.d.ts.map +1 -1
- package/dist/types/components/pagination/MyPagination.d.ts +4 -3
- package/dist/types/components/pagination/MyPagination.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/MyLimitSelect-BU1FClXt.cjs +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const i=require("./jsx-runtime-h4oGeKUK.cjs"),x=require("./index-BL59b1Bz-COeLljOH.cjs"),p=require("react"),I=require("./button-CdZDBhmr-3yMPCRDo.cjs"),L=require("./chevron-right-HWBijj-I-CZBu0GKg.cjs"),M=require("./createLucideIcon-B950nf2d-DrrWmvZU.cjs"),n=require("./utils-B6fNqzRf-BNysSCt9.cjs"),l=require("./input-mask-DBLFIvhN-C_0RAR2l.cjs"),d=require("./useTranslation-CZf20ucv.cjs");function q(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const f=q(p);/**
|
|
2
|
+
* @license lucide-react v0.511.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const z=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],T=M.k("chevron-left",z),h=({className:s,...e})=>x.ae.jsx("nav",{role:"navigation","aria-label":"pagination",className:n.mo("flex w-full justify-center",s),...e});h.displayName="Pagination";const N=f.forwardRef(({className:s,...e},t)=>x.ae.jsx("ul",{ref:t,className:n.mo("flex flex-row items-center gap-1",s),...e}));N.displayName="PaginationContent";const r=f.forwardRef(({className:s,...e},t)=>x.ae.jsx("li",{ref:t,className:n.mo("",s),...e}));r.displayName="PaginationItem";const u=({className:s,isActive:e,size:t="icon",...o})=>x.ae.jsx("a",{"aria-current":e?"page":void 0,className:n.mo(I.g({variant:e?"tertiary":"ghost",size:t}),"cursor-pointer",s),...o});u.displayName="PaginationLink";const v=({className:s,...e})=>x.ae.jsx(u,{"aria-label":"Go to previous page",size:"default",className:n.mo("gap-1 px-2.5",s),...e,children:x.ae.jsx(T,{className:"h-4 w-4"})});v.displayName="PaginationPrevious";const R=({className:s,...e})=>x.ae.jsx(u,{"aria-label":"Go to next page",size:"default",className:n.mo("gap-1 px-2.5",s),...e,children:x.ae.jsx(L.e,{className:"h-4 w-4"})});R.displayName="PaginationNext";const g=({currentPage:s=1,totalPages:e=0,onPageChange:t,className:o,...m})=>{const{t:E}=d.useTranslation(),y=p.useCallback(()=>{const a=[];a.push(1),s-1>2&&a.push("...");for(let j=Math.max(2,s-1);j<=Math.min(e-1,s+1);j++)a.push(j);return s+1<e-1&&a.push("..."),e>1&&a.push(e),a},[s,e]),w=p.useMemo(()=>{const a=[];for(let c=0;c<e;c++)a.push({value:`${c+1}`,label:`${c+1}`});return a},[e]);return i.jsxRuntimeExports.jsxs("div",{...m,className:n.mo("flex flex-col items-center justify-end gap-3 lg:flex-row",o),children:[i.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsxRuntimeExports.jsxs("div",{className:"min-w-20 font-semibold",children:[E("Go to page"),":"]}),i.jsxRuntimeExports.jsxs(l.Zx,{onValueChange:a=>t(parseInt(a)),value:`${s}`,children:[i.jsxRuntimeExports.jsx(l.jm,{className:"h-8.5 w-16",children:i.jsxRuntimeExports.jsx(l.Qx,{})}),i.jsxRuntimeExports.jsx(l.Um,{options:w})]})]}),i.jsxRuntimeExports.jsx(h,{className:"justify-end",children:i.jsxRuntimeExports.jsxs(N,{children:[i.jsxRuntimeExports.jsx(r,{children:i.jsxRuntimeExports.jsx(v,{isActive:s>1,size:"sm",className:n.mo(s>1?"disabled":"shadow"),onClick:()=>{s>1&&t(s-1)}})}),y().map((a,c)=>i.jsxRuntimeExports.jsx(r,{onClick:()=>{typeof a=="number"&&t(a)},children:i.jsxRuntimeExports.jsx(u,{size:"sm",className:n.mo("w-9 px-0 text-center",a===s&&"shadow"),isActive:a===s,children:a})},c)),i.jsxRuntimeExports.jsx(r,{children:i.jsxRuntimeExports.jsx(R,{size:"sm",onClick:()=>{s<e&&t(s+1)},className:n.mo(s<e?"disabled":"shadow"),isActive:s<e})})]})})]})},b=50,k=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],O=({defaultValue:s=b,options:e=k,onLimitChange:t})=>{const{t:o}=d.useTranslation();return i.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxRuntimeExports.jsxs("span",{className:"font-semibold",children:[o("Rows per page"),":"]}),i.jsxRuntimeExports.jsxs(l.Zx,{onValueChange:t,value:`${s}`,children:[i.jsxRuntimeExports.jsx(l.jm,{className:"h-8.5 w-17",children:i.jsxRuntimeExports.jsx(l.Qx,{})}),i.jsxRuntimeExports.jsx(l.Jh,{children:e==null?void 0:e.map(m=>i.jsxRuntimeExports.jsx(l.ed,{value:`${m.value}`,children:m.label},m.value))})]})]})};exports.DEFAULT_LIMIT=b;exports.MyLimitSelect=O;exports.MyPagination=g;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-DS1N_tNq.js";
|
|
2
2
|
import { a as m } from "./index-BL59b1Bz-C9bJE_xn.js";
|
|
3
3
|
import * as f from "react";
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { g as
|
|
6
|
-
import { e as
|
|
7
|
-
import { k as
|
|
4
|
+
import { useCallback as k, useMemo as z } from "react";
|
|
5
|
+
import { g as M } from "./button-CdZDBhmr-BT_j3ig5.js";
|
|
6
|
+
import { e as A } from "./chevron-right-HWBijj-I-DsFUufdU.js";
|
|
7
|
+
import { k as I } from "./createLucideIcon-B950nf2d-9wLYOF5y.js";
|
|
8
8
|
import { m as n } from "./utils-B6fNqzRf-B1_jG1K7.js";
|
|
9
|
-
import { Z as p, j as h, Q as j, U as
|
|
9
|
+
import { Z as p, j as h, Q as j, U as L, J as T, e as C } from "./input-mask-DBLFIvhN-BBxoZxnd.js";
|
|
10
10
|
import { u as N } from "./useTranslation-dH-uwymc.js";
|
|
11
11
|
/**
|
|
12
12
|
* @license lucide-react v0.511.0 - ISC
|
|
@@ -14,7 +14,7 @@ import { u as N } from "./useTranslation-dH-uwymc.js";
|
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const U = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], g = I("chevron-left", U), v = ({ className: s, ...a }) => /* @__PURE__ */ m.jsx(
|
|
18
18
|
"nav",
|
|
19
19
|
{
|
|
20
20
|
role: "navigation",
|
|
@@ -45,7 +45,7 @@ const x = ({
|
|
|
45
45
|
{
|
|
46
46
|
"aria-current": a ? "page" : void 0,
|
|
47
47
|
className: n(
|
|
48
|
-
|
|
48
|
+
M({
|
|
49
49
|
variant: a ? "tertiary" : "ghost",
|
|
50
50
|
size: l
|
|
51
51
|
}),
|
|
@@ -66,7 +66,7 @@ const b = ({
|
|
|
66
66
|
size: "default",
|
|
67
67
|
className: n("gap-1 px-2.5", s),
|
|
68
68
|
...a,
|
|
69
|
-
children: /* @__PURE__ */ m.jsx(
|
|
69
|
+
children: /* @__PURE__ */ m.jsx(g, { className: "h-4 w-4" })
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
b.displayName = "PaginationPrevious";
|
|
@@ -80,22 +80,24 @@ const w = ({
|
|
|
80
80
|
size: "default",
|
|
81
81
|
className: n("gap-1 px-2.5", s),
|
|
82
82
|
...a,
|
|
83
|
-
children: /* @__PURE__ */ m.jsx(
|
|
83
|
+
children: /* @__PURE__ */ m.jsx(A, { className: "h-4 w-4" })
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
86
|
w.displayName = "PaginationNext";
|
|
87
|
-
const
|
|
87
|
+
const q = ({
|
|
88
88
|
currentPage: s = 1,
|
|
89
89
|
totalPages: a = 0,
|
|
90
|
-
onPageChange: l
|
|
90
|
+
onPageChange: l,
|
|
91
|
+
className: c,
|
|
92
|
+
...t
|
|
91
93
|
}) => {
|
|
92
|
-
const { t:
|
|
94
|
+
const { t: y } = N(), R = k(() => {
|
|
93
95
|
const i = [];
|
|
94
96
|
i.push(1), s - 1 > 2 && i.push("...");
|
|
95
97
|
for (let d = Math.max(2, s - 1); d <= Math.min(a - 1, s + 1); d++)
|
|
96
98
|
i.push(d);
|
|
97
99
|
return s + 1 < a - 1 && i.push("..."), a > 1 && i.push(a), i;
|
|
98
|
-
}, [s, a]),
|
|
100
|
+
}, [s, a]), $ = z(() => {
|
|
99
101
|
const i = [];
|
|
100
102
|
for (let o = 0; o < a; o++)
|
|
101
103
|
i.push({
|
|
@@ -104,71 +106,81 @@ const Z = ({
|
|
|
104
106
|
});
|
|
105
107
|
return i;
|
|
106
108
|
}, [a]);
|
|
107
|
-
return /* @__PURE__ */ e.jsxs(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
] }),
|
|
125
|
-
/* @__PURE__ */ e.jsx(v, { className: "justify-end", children: /* @__PURE__ */ e.jsxs(u, { children: [
|
|
126
|
-
/* @__PURE__ */ e.jsx(r, { children: /* @__PURE__ */ e.jsx(
|
|
127
|
-
b,
|
|
128
|
-
{
|
|
129
|
-
isActive: s > 1,
|
|
130
|
-
size: "sm",
|
|
131
|
-
className: n(s > 1 ? "disabled" : "shadow"),
|
|
132
|
-
onClick: () => {
|
|
133
|
-
s > 1 && l(s - 1);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
) }),
|
|
137
|
-
t().map((i, o) => /* @__PURE__ */ e.jsx(
|
|
138
|
-
r,
|
|
139
|
-
{
|
|
140
|
-
onClick: () => {
|
|
141
|
-
typeof i == "number" && l(i);
|
|
142
|
-
},
|
|
143
|
-
children: /* @__PURE__ */ e.jsx(
|
|
144
|
-
x,
|
|
109
|
+
return /* @__PURE__ */ e.jsxs(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
...t,
|
|
113
|
+
className: n(
|
|
114
|
+
"flex flex-col items-center justify-end gap-3 lg:flex-row",
|
|
115
|
+
c
|
|
116
|
+
),
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 text-sm", children: [
|
|
119
|
+
/* @__PURE__ */ e.jsxs("div", { className: "min-w-20 font-semibold", children: [
|
|
120
|
+
y("Go to page"),
|
|
121
|
+
":"
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ e.jsxs(
|
|
124
|
+
p,
|
|
145
125
|
{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
children: i
|
|
126
|
+
onValueChange: (i) => l(parseInt(i)),
|
|
127
|
+
value: `${s}`,
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ e.jsx(h, { className: "h-8.5 w-16", children: /* @__PURE__ */ e.jsx(j, {}) }),
|
|
130
|
+
/* @__PURE__ */ e.jsx(L, { options: $ })
|
|
131
|
+
]
|
|
153
132
|
}
|
|
154
133
|
)
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ e.jsx(v, { className: "justify-end", children: /* @__PURE__ */ e.jsxs(u, { children: [
|
|
136
|
+
/* @__PURE__ */ e.jsx(r, { children: /* @__PURE__ */ e.jsx(
|
|
137
|
+
b,
|
|
138
|
+
{
|
|
139
|
+
isActive: s > 1,
|
|
140
|
+
size: "sm",
|
|
141
|
+
className: n(s > 1 ? "disabled" : "shadow"),
|
|
142
|
+
onClick: () => {
|
|
143
|
+
s > 1 && l(s - 1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
) }),
|
|
147
|
+
R().map((i, o) => /* @__PURE__ */ e.jsx(
|
|
148
|
+
r,
|
|
149
|
+
{
|
|
150
|
+
onClick: () => {
|
|
151
|
+
typeof i == "number" && l(i);
|
|
152
|
+
},
|
|
153
|
+
children: /* @__PURE__ */ e.jsx(
|
|
154
|
+
x,
|
|
155
|
+
{
|
|
156
|
+
size: "sm",
|
|
157
|
+
className: n(
|
|
158
|
+
"w-9 px-0 text-center",
|
|
159
|
+
i === s && "shadow"
|
|
160
|
+
),
|
|
161
|
+
isActive: i === s,
|
|
162
|
+
children: i
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
},
|
|
166
|
+
o
|
|
167
|
+
)),
|
|
168
|
+
/* @__PURE__ */ e.jsx(r, { children: /* @__PURE__ */ e.jsx(
|
|
169
|
+
w,
|
|
170
|
+
{
|
|
171
|
+
size: "sm",
|
|
172
|
+
onClick: () => {
|
|
173
|
+
s < a && l(s + 1);
|
|
174
|
+
},
|
|
175
|
+
className: n(s < a ? "disabled" : "shadow"),
|
|
176
|
+
isActive: s < a
|
|
177
|
+
}
|
|
178
|
+
) })
|
|
179
|
+
] }) })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}, D = 50, E = [
|
|
172
184
|
{
|
|
173
185
|
value: 10,
|
|
174
186
|
label: "10"
|
|
@@ -185,9 +197,9 @@ const Z = ({
|
|
|
185
197
|
value: 100,
|
|
186
198
|
label: "100"
|
|
187
199
|
}
|
|
188
|
-
],
|
|
189
|
-
defaultValue: s =
|
|
190
|
-
options: a =
|
|
200
|
+
], B = ({
|
|
201
|
+
defaultValue: s = D,
|
|
202
|
+
options: a = E,
|
|
191
203
|
onLimitChange: l
|
|
192
204
|
}) => {
|
|
193
205
|
const { t: c } = N();
|
|
@@ -198,12 +210,12 @@ const Z = ({
|
|
|
198
210
|
] }),
|
|
199
211
|
/* @__PURE__ */ e.jsxs(p, { onValueChange: l, value: `${s}`, children: [
|
|
200
212
|
/* @__PURE__ */ e.jsx(h, { className: "h-8.5 w-17", children: /* @__PURE__ */ e.jsx(j, {}) }),
|
|
201
|
-
/* @__PURE__ */ e.jsx(
|
|
213
|
+
/* @__PURE__ */ e.jsx(T, { children: a == null ? void 0 : a.map((t) => /* @__PURE__ */ e.jsx(C, { value: `${t.value}`, children: t.label }, t.value)) })
|
|
202
214
|
] })
|
|
203
215
|
] });
|
|
204
216
|
};
|
|
205
217
|
export {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
218
|
+
D,
|
|
219
|
+
q as M,
|
|
220
|
+
B as a
|
|
209
221
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-h4oGeKUK.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-h4oGeKUK.cjs"),re=require("../../button-CdZDBhmr-3yMPCRDo.cjs"),y=require("../../dropdown-menu-TWRSm6RK-DQ03CnVw.cjs"),A=require("../../MyLimitSelect-BNdB8P5s.cjs"),H=require("../../index-CGv7FLNy.cjs"),j=require("react"),g=require("../../lodash-C5w_OPmE.cjs"),f=require("../../index-BL59b1Bz-COeLljOH.cjs"),c=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),O=require("../../useSortable-BvLbSWXW.cjs"),I=require("../../input-mask-DBLFIvhN-C_0RAR2l.cjs"),J=require("../../SortOrder-81BrXp3i.cjs"),xe=require("../../Empty-DPsWiBRX.cjs"),D=require("../../createLucideIcon-BnAj0RnC.cjs"),Z=require("../../FilterWrapper-OjCn16Bf.cjs"),de=require("../../Loader-BsYF7B7O.cjs"),le=require("../../Actions-Dh8TPahn.cjs"),ie=require("../../ExportData-DV3HcBlK.cjs"),oe=require("../../useTranslation-CZf20ucv.cjs"),G=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("table",{ref:x,className:c.mo("w-full caption-bottom text-sm",s),...r}));G.displayName="Table";const Q=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("thead",{ref:x,className:c.mo("[&_tr]:border-b",s),...r}));Q.displayName="TableHeader";const X=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("tbody",{ref:x,className:c.mo("[&_tr:last-child]:border-0",s),...r}));X.displayName="TableBody";const ne=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("tfoot",{ref:x,className:c.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...r}));ne.displayName="TableFooter";const L=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("tr",{ref:x,className:c.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...r}));L.displayName="TableRow";const _=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("th",{ref:x,className:c.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...r}));_.displayName="TableHead";const q=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("td",{ref:x,className:c.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r}));q.displayName="TableCell";const ce=j.forwardRef(({className:s,...r},x)=>f.ae.jsx("caption",{ref:x,className:c.mo("text-muted-foreground mt-4 text-sm",s),...r}));ce.displayName="TableCaption";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const je=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],ae=D.createLucideIcon("arrow-down-wide-narrow",je);/**
|
|
7
7
|
* @license lucide-react v0.511.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const pe=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],me=D.createLucideIcon("arrow-up-down",pe);/**
|
|
12
12
|
* @license lucide-react v0.511.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const fe=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]],he=D.createLucideIcon("arrow-up-wide-narrow",fe);/**
|
|
17
17
|
* @license lucide-react v0.511.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const Ee=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Re=D.createLucideIcon("refresh-cw",Ee),Y=({rows:s=[],columns:r,onRowClick:x,rowKey:m,params:a={page:1,limit:A.DEFAULT_LIMIT},hasNumbers:u=!1,hasCheckbox:h=!1,selectedItems:v,onSelectedItemsChange:N,onSortOrderChange:z,isStickyHeader:d,className:F,...$})=>{const{sortObject:o,handleSort:M}=O.useSortable({sortField:a==null?void 0:a.sortField,sortOrder:a==null?void 0:a.sortOrder,onSortOrderChange:z}),{selectedRows:E,isRowSelected:w,isAllRowsSelected:p,handleSelectAllRows:B,handleSelectRow:k}=O.useDataTable({rows:s,defaultSelectedRows:v});return j.useEffect(()=>{JSON.stringify(v)!==JSON.stringify(E)&&E&&(N==null||N(E))},[E,v,N]),e.jsxRuntimeExports.jsxs(G,{...$,className:c.mo("relative",F),children:[e.jsxRuntimeExports.jsx(Q,{className:c.mo("bg-bg",d&&"sticky top-0 z-10"),children:e.jsxRuntimeExports.jsxs(L,{children:[h&&e.jsxRuntimeExports.jsx(_,{className:"w-12 p-3",children:e.jsxRuntimeExports.jsx(I.vp,{className:"mt-1",checked:p(m),onCheckedChange:t=>B(m,!!t),"aria-label":"Select all"})}),u&&e.jsxRuntimeExports.jsx(_,{className:"w-12 p-2",children:"#"}),r.filter(t=>!t.hidden).map(t=>e.jsxRuntimeExports.jsx(_,{style:t.styles,className:c.mo("p-2",t.sortable&&"cursor-pointer"),onClick:()=>t.sortable&&M(t.dataIndex),children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[t.name," ",t.sortable&&((o==null?void 0:o.sortField)===t.key?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(o==null?void 0:o.sortOrder)===J.SortOrder.DESC&&e.jsxRuntimeExports.jsx(ae,{size:15}),(o==null?void 0:o.sortOrder)===J.SortOrder.ASC&&e.jsxRuntimeExports.jsx(he,{size:15})]}):e.jsxRuntimeExports.jsx(me,{size:15}))]})},t.key))]})}),e.jsxRuntimeExports.jsx(X,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:s.length?s.map((t,R)=>e.jsxRuntimeExports.jsxs(L,{onClick:()=>x==null?void 0:x(t),className:c.mo(x&&"cursor-pointer"),"data-state":w(t[m])&&"selected",children:[h&&e.jsxRuntimeExports.jsx(q,{className:"w-12 p-3",onClick:i=>i.stopPropagation(),children:e.jsxRuntimeExports.jsx(I.vp,{className:"mt-1",checked:w(t[m]),onCheckedChange:i=>k(t[m],!!i),"aria-label":"Select row"})}),u&&e.jsxRuntimeExports.jsx(q,{className:"w-12 p-2",children:(a.page-1)*(a.limit||A.DEFAULT_LIMIT)+R+1}),r.filter(i=>!i.hidden).map(i=>e.jsxRuntimeExports.jsx(q,{className:"text-body-xs-medium max-w-xs p-2",style:i.styles,children:i.render?i.render(g.lodashExports.get(t,i.dataIndex),t):g.lodashExports.get(t,i.dataIndex,"")},`${R}-${i.key}`))]},`${t[m]}`)):e.jsxRuntimeExports.jsx(L,{children:e.jsxRuntimeExports.jsx(q,{colSpan:u?h?r.length+2:r.length+1:r.length,children:e.jsxRuntimeExports.jsx(xe.Empty,{})})})})]})},ue=({dataSource:s,columns:r,onRowClick:x,rowKey:m,hasNumbers:a,hasSearch:u,exportOptions:h,hasCheckbox:v,hasPagination:N,isStickyHeader:z,onParamChange:d,dataKey:F="docs",loading:$,tableKey:o,filters:M,actions:E,handleFilterChange:w,params:p,exportLoading:B=!1,onColumnsUpdate:k,hasColumnsVisibilityDropdown:t,onSelectedItemsChange:R,actionProps:i,filterWrapperProps:U,exportOptionsProps:K,columnsVisibilityProps:n,paginationProps:S,searchProps:V,...C})=>{const{t:P}=oe.useTranslation(),[T,ee]=j.useState([]),{formattedColumns:b,handleColumnsChange:se,resetColumns:te}=O.useColumns({key:o,columns:r});return j.useEffect(()=>{k==null||k(b)},[b,k]),j.useEffect(()=>{R==null||R(T)},[T,R]),e.jsxRuntimeExports.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[(u||t&&o||!g.lodashExports.isEmpty(h)||!g.lodashExports.isEmpty(M))&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row",children:[e.jsxRuntimeExports.jsx("div",{className:"w-full shrink",children:u&&e.jsxRuntimeExports.jsx(Z.Search,{...V,defaultValue:g.lodashExports.get(p,"search",""),onSearchChange:l=>d==null?void 0:d({...p,search:l,page:1})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[h&&e.jsxRuntimeExports.jsx(ie.ExportData,{...K,options:h,loading:B}),t&&o&&e.jsxRuntimeExports.jsxs(y.Tt,{children:[e.jsxRuntimeExports.jsx(y.At,{asChild:!0,...n==null?void 0:n.triggerProps,children:e.jsxRuntimeExports.jsx(re.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:(n==null?void 0:n.title)||e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:P("Customize columns")}),e.jsxRuntimeExports.jsx(H.f1,{})]})})}),e.jsxRuntimeExports.jsxs(y.it,{align:"end",...n==null?void 0:n.contentProps,children:[e.jsxRuntimeExports.jsxs(y.ut,{className:"capitalize",onClick:te,children:[e.jsxRuntimeExports.jsx(Re,{})," ",(n==null?void 0:n.resetText)||"Reset columns"]}),e.jsxRuntimeExports.jsx(y.ft,{}),b.map(l=>e.jsxRuntimeExports.jsx(y.dt,{className:"capitalize",checked:!l.hidden,onCheckedChange:W=>se(l,!W),children:l.name},l.key))]})]}),E&&e.jsxRuntimeExports.jsx(le.Actions,{...i,actions:E}),M&&e.jsxRuntimeExports.jsx(Z.FilterWrapper,{...U,filters:M,params:p,onFilter:l=>{d==null||d({...p,...l,page:1}),w==null||w(l)}})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col overflow-auto border-y",children:$?e.jsxRuntimeExports.jsx(de.Loader,{}):e.jsxRuntimeExports.jsx(Y,{...C,params:{page:(s==null?void 0:s.page)||1,limit:s==null?void 0:s.limit,...p},rows:g.lodashExports.get(s,F,[]),rowKey:m,selectedItems:T,isStickyHeader:z,columns:b,hasCheckbox:v,hasNumbers:a,onRowClick:x,onSelectedItemsChange:ee,onSortOrderChange:({sortField:l,sortOrder:W})=>{d==null||d({...p,sortField:l,sortOrder:W})}})}),N&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm",children:e.jsxRuntimeExports.jsx(A.MyLimitSelect,{onLimitChange:l=>d==null?void 0:d({...p,limit:l,page:1}),defaultValue:s==null?void 0:s.limit})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground text-sm",children:[T.length," of ",(s==null?void 0:s.total)||0," row(s) selected."]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(A.MyPagination,{...S,onPageChange:l=>d==null?void 0:d({...p,page:l}),currentPage:s==null?void 0:s.page,totalPages:s==null?void 0:s.totalPages})})]})]})};exports.DataTable=ue;exports.MyTable=Y;
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import { j as e } from "../../jsx-runtime-DS1N_tNq.js";
|
|
2
|
-
import { u as
|
|
3
|
-
import { T as
|
|
4
|
-
import { D as
|
|
5
|
-
import { y as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { l as
|
|
2
|
+
import { u as P } from "../../button-CdZDBhmr-BT_j3ig5.js";
|
|
3
|
+
import { T as ee, A as se, i as te, u as le, f as de, d as re } from "../../dropdown-menu-TWRSm6RK-D_FJpI4C.js";
|
|
4
|
+
import { D as J, a as ae, M as xe } from "../../MyLimitSelect-CNRAneFY.js";
|
|
5
|
+
import { y as ce, f as ie } from "../../index-BrQ82Wyu.js";
|
|
6
|
+
import { forwardRef as N, useEffect as W, useState as fe } from "react";
|
|
7
|
+
import { l as M } from "../../lodash-CYNxjS-I.js";
|
|
8
8
|
import { a as m } from "../../index-BL59b1Bz-C9bJE_xn.js";
|
|
9
|
-
import { m as
|
|
10
|
-
import { u as
|
|
11
|
-
import { v as
|
|
12
|
-
import { S as
|
|
13
|
-
import { E as
|
|
9
|
+
import { m as f } from "../../utils-B6fNqzRf-B1_jG1K7.js";
|
|
10
|
+
import { u as he, a as je, b as pe } from "../../useSortable-DwSvT1qU.js";
|
|
11
|
+
import { v as B } from "../../input-mask-DBLFIvhN-BBxoZxnd.js";
|
|
12
|
+
import { S as O } from "../../SortOrder-CwuehjY1.js";
|
|
13
|
+
import { E as Ne } from "../../Empty-DspeyPQa.js";
|
|
14
14
|
import { c as R } from "../../createLucideIcon-B950nf2d.js";
|
|
15
|
-
import { S as
|
|
16
|
-
import { L as
|
|
17
|
-
import { A as
|
|
18
|
-
import { E as
|
|
15
|
+
import { S as me, F as oe } from "../../FilterWrapper-BU6BOSt1.js";
|
|
16
|
+
import { L as ne } from "../../Loader-gLl5AAz4.js";
|
|
17
|
+
import { A as ke } from "../../Actions-DYmkv_J9.js";
|
|
18
|
+
import { E as we } from "../../ExportData-DvwQ6UCI.js";
|
|
19
19
|
import { u as ye } from "../../useTranslation-dH-uwymc.js";
|
|
20
|
-
const
|
|
20
|
+
const G = N(
|
|
21
21
|
({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
22
22
|
"table",
|
|
23
23
|
{
|
|
24
24
|
ref: d,
|
|
25
|
-
className:
|
|
25
|
+
className: f("w-full caption-bottom text-sm", s),
|
|
26
26
|
...l
|
|
27
27
|
}
|
|
28
28
|
)
|
|
29
29
|
);
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
30
|
+
G.displayName = "Table";
|
|
31
|
+
const Q = N(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx("thead", { ref: d, className: f("[&_tr]:border-b", s), ...l }));
|
|
32
|
+
Q.displayName = "TableHeader";
|
|
33
|
+
const X = N(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
34
34
|
"tbody",
|
|
35
35
|
{
|
|
36
36
|
ref: d,
|
|
37
|
-
className:
|
|
37
|
+
className: f("[&_tr:last-child]:border-0", s),
|
|
38
38
|
...l
|
|
39
39
|
}
|
|
40
40
|
));
|
|
41
|
-
|
|
42
|
-
const
|
|
41
|
+
X.displayName = "TableBody";
|
|
42
|
+
const ge = N(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
43
43
|
"tfoot",
|
|
44
44
|
{
|
|
45
45
|
ref: d,
|
|
46
|
-
className:
|
|
46
|
+
className: f(
|
|
47
47
|
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
48
48
|
s
|
|
49
49
|
),
|
|
50
50
|
...l
|
|
51
51
|
}
|
|
52
52
|
));
|
|
53
|
-
|
|
54
|
-
const L =
|
|
53
|
+
ge.displayName = "TableFooter";
|
|
54
|
+
const L = N(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
55
55
|
"tr",
|
|
56
56
|
{
|
|
57
57
|
ref: d,
|
|
58
|
-
className:
|
|
58
|
+
className: f(
|
|
59
59
|
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
|
|
60
60
|
s
|
|
61
61
|
),
|
|
@@ -63,11 +63,11 @@ const L = j(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
|
63
63
|
}
|
|
64
64
|
));
|
|
65
65
|
L.displayName = "TableRow";
|
|
66
|
-
const z =
|
|
66
|
+
const z = N(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
67
67
|
"th",
|
|
68
68
|
{
|
|
69
69
|
ref: d,
|
|
70
|
-
className:
|
|
70
|
+
className: f(
|
|
71
71
|
"text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",
|
|
72
72
|
s
|
|
73
73
|
),
|
|
@@ -75,37 +75,37 @@ const z = j(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
|
75
75
|
}
|
|
76
76
|
));
|
|
77
77
|
z.displayName = "TableHead";
|
|
78
|
-
const A =
|
|
78
|
+
const A = N(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
79
79
|
"td",
|
|
80
80
|
{
|
|
81
81
|
ref: d,
|
|
82
|
-
className:
|
|
82
|
+
className: f("p-4 align-middle [&:has([role=checkbox])]:pr-0", s),
|
|
83
83
|
...l
|
|
84
84
|
}
|
|
85
85
|
));
|
|
86
86
|
A.displayName = "TableCell";
|
|
87
|
-
const
|
|
87
|
+
const ve = N(({ className: s, ...l }, d) => /* @__PURE__ */ m.jsx(
|
|
88
88
|
"caption",
|
|
89
89
|
{
|
|
90
90
|
ref: d,
|
|
91
|
-
className:
|
|
91
|
+
className: f("text-muted-foreground mt-4 text-sm", s),
|
|
92
92
|
...l
|
|
93
93
|
}
|
|
94
94
|
));
|
|
95
|
-
|
|
95
|
+
ve.displayName = "TableCaption";
|
|
96
96
|
/**
|
|
97
97
|
* @license lucide-react v0.511.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
101
|
*/
|
|
102
|
-
const
|
|
102
|
+
const Me = [
|
|
103
103
|
["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
|
|
104
104
|
["path", { d: "M7 20V4", key: "1yoxec" }],
|
|
105
105
|
["path", { d: "M11 4h10", key: "1w87gc" }],
|
|
106
106
|
["path", { d: "M11 8h7", key: "djye34" }],
|
|
107
107
|
["path", { d: "M11 12h4", key: "q8tih4" }]
|
|
108
|
-
],
|
|
108
|
+
], Te = R("arrow-down-wide-narrow", Me);
|
|
109
109
|
/**
|
|
110
110
|
* @license lucide-react v0.511.0 - ISC
|
|
111
111
|
*
|
|
@@ -117,91 +117,91 @@ const be = [
|
|
|
117
117
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
118
118
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
119
119
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
120
|
-
],
|
|
120
|
+
], Ae = R("arrow-up-down", be);
|
|
121
121
|
/**
|
|
122
122
|
* @license lucide-react v0.511.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
126
|
*/
|
|
127
|
-
const
|
|
127
|
+
const Ee = [
|
|
128
128
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
129
129
|
["path", { d: "M7 4v16", key: "1glfcx" }],
|
|
130
130
|
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
131
131
|
["path", { d: "M11 16h7", key: "uosisv" }],
|
|
132
132
|
["path", { d: "M11 20h4", key: "1krc32" }]
|
|
133
|
-
],
|
|
133
|
+
], _e = R("arrow-up-wide-narrow", Ee);
|
|
134
134
|
/**
|
|
135
135
|
* @license lucide-react v0.511.0 - ISC
|
|
136
136
|
*
|
|
137
137
|
* This source code is licensed under the ISC license.
|
|
138
138
|
* See the LICENSE file in the root directory of this source tree.
|
|
139
139
|
*/
|
|
140
|
-
const
|
|
140
|
+
const Le = [
|
|
141
141
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
142
142
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
143
143
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
144
144
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
145
|
-
],
|
|
145
|
+
], ze = R("refresh-cw", Le), Re = ({
|
|
146
146
|
rows: s = [],
|
|
147
147
|
columns: l,
|
|
148
148
|
onRowClick: d,
|
|
149
|
-
rowKey:
|
|
150
|
-
params:
|
|
149
|
+
rowKey: p,
|
|
150
|
+
params: h = {
|
|
151
151
|
page: 1,
|
|
152
|
-
limit:
|
|
152
|
+
limit: J
|
|
153
153
|
},
|
|
154
|
-
hasNumbers:
|
|
155
|
-
hasCheckbox:
|
|
156
|
-
selectedItems:
|
|
157
|
-
onSelectedItemsChange:
|
|
154
|
+
hasNumbers: w = !1,
|
|
155
|
+
hasCheckbox: o = !1,
|
|
156
|
+
selectedItems: T,
|
|
157
|
+
onSelectedItemsChange: y,
|
|
158
158
|
onSortOrderChange: D,
|
|
159
159
|
isStickyHeader: r,
|
|
160
160
|
className: F,
|
|
161
161
|
...$
|
|
162
162
|
}) => {
|
|
163
|
-
const { sortObject:
|
|
164
|
-
sortField:
|
|
165
|
-
sortOrder:
|
|
163
|
+
const { sortObject: c, handleSort: b } = he({
|
|
164
|
+
sortField: h == null ? void 0 : h.sortField,
|
|
165
|
+
sortOrder: h == null ? void 0 : h.sortOrder,
|
|
166
166
|
onSortOrderChange: D
|
|
167
167
|
}), {
|
|
168
168
|
selectedRows: n,
|
|
169
169
|
isRowSelected: g,
|
|
170
|
-
isAllRowsSelected:
|
|
170
|
+
isAllRowsSelected: j,
|
|
171
171
|
handleSelectAllRows: q,
|
|
172
172
|
handleSelectRow: v
|
|
173
|
-
} =
|
|
173
|
+
} = je({ rows: s, defaultSelectedRows: T });
|
|
174
174
|
return W(() => {
|
|
175
|
-
JSON.stringify(
|
|
176
|
-
}, [n,
|
|
175
|
+
JSON.stringify(T) !== JSON.stringify(n) && n && (y == null || y(n));
|
|
176
|
+
}, [n, T, y]), /* @__PURE__ */ e.jsxs(G, { ...$, className: f("relative", F), children: [
|
|
177
177
|
/* @__PURE__ */ e.jsx(
|
|
178
|
-
|
|
178
|
+
Q,
|
|
179
179
|
{
|
|
180
|
-
className:
|
|
180
|
+
className: f("bg-bg", r && "sticky top-0 z-10"),
|
|
181
181
|
children: /* @__PURE__ */ e.jsxs(L, { children: [
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
o && /* @__PURE__ */ e.jsx(z, { className: "w-12 p-3", children: /* @__PURE__ */ e.jsx(
|
|
183
|
+
B,
|
|
184
184
|
{
|
|
185
185
|
className: "mt-1",
|
|
186
|
-
checked: p
|
|
187
|
-
onCheckedChange: (t) => q(
|
|
186
|
+
checked: j(p),
|
|
187
|
+
onCheckedChange: (t) => q(p, !!t),
|
|
188
188
|
"aria-label": "Select all"
|
|
189
189
|
}
|
|
190
190
|
) }),
|
|
191
|
-
|
|
191
|
+
w && /* @__PURE__ */ e.jsx(z, { className: "w-12 p-2", children: "#" }),
|
|
192
192
|
l.filter((t) => !t.hidden).map((t) => /* @__PURE__ */ e.jsx(
|
|
193
193
|
z,
|
|
194
194
|
{
|
|
195
195
|
style: t.styles,
|
|
196
|
-
className:
|
|
197
|
-
onClick: () => t.sortable &&
|
|
196
|
+
className: f("p-2", t.sortable && "cursor-pointer"),
|
|
197
|
+
onClick: () => t.sortable && b(t.dataIndex),
|
|
198
198
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
199
199
|
t.name,
|
|
200
200
|
" ",
|
|
201
|
-
t.sortable && ((
|
|
202
|
-
(
|
|
203
|
-
(
|
|
204
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
201
|
+
t.sortable && ((c == null ? void 0 : c.sortField) === t.key ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
202
|
+
(c == null ? void 0 : c.sortOrder) === O.DESC && /* @__PURE__ */ e.jsx(Te, { size: 15 }),
|
|
203
|
+
(c == null ? void 0 : c.sortOrder) === O.ASC && /* @__PURE__ */ e.jsx(_e, { size: 15 })
|
|
204
|
+
] }) : /* @__PURE__ */ e.jsx(Ae, { size: 15 }))
|
|
205
205
|
] })
|
|
206
206
|
},
|
|
207
207
|
t.key
|
|
@@ -209,203 +209,206 @@ const Ee = [
|
|
|
209
209
|
] })
|
|
210
210
|
}
|
|
211
211
|
),
|
|
212
|
-
/* @__PURE__ */ e.jsx(
|
|
212
|
+
/* @__PURE__ */ e.jsx(X, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: s.length ? s.map((t, k) => /* @__PURE__ */ e.jsxs(
|
|
213
213
|
L,
|
|
214
214
|
{
|
|
215
215
|
onClick: () => d == null ? void 0 : d(t),
|
|
216
|
-
className:
|
|
217
|
-
"data-state": g(t[
|
|
216
|
+
className: f(d && "cursor-pointer"),
|
|
217
|
+
"data-state": g(t[p]) && "selected",
|
|
218
218
|
children: [
|
|
219
|
-
|
|
219
|
+
o && /* @__PURE__ */ e.jsx(
|
|
220
220
|
A,
|
|
221
221
|
{
|
|
222
222
|
className: "w-12 p-3",
|
|
223
|
-
onClick: (
|
|
223
|
+
onClick: (x) => x.stopPropagation(),
|
|
224
224
|
children: /* @__PURE__ */ e.jsx(
|
|
225
|
-
|
|
225
|
+
B,
|
|
226
226
|
{
|
|
227
227
|
className: "mt-1",
|
|
228
|
-
checked: g(t[
|
|
229
|
-
onCheckedChange: (
|
|
228
|
+
checked: g(t[p]),
|
|
229
|
+
onCheckedChange: (x) => v(t[p], !!x),
|
|
230
230
|
"aria-label": "Select row"
|
|
231
231
|
}
|
|
232
232
|
)
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
|
-
|
|
236
|
-
l.filter((
|
|
235
|
+
w && /* @__PURE__ */ e.jsx(A, { className: "w-12 p-2", children: (h.page - 1) * (h.limit || J) + k + 1 }),
|
|
236
|
+
l.filter((x) => !x.hidden).map((x) => /* @__PURE__ */ e.jsx(
|
|
237
237
|
A,
|
|
238
238
|
{
|
|
239
239
|
className: "text-body-xs-medium max-w-xs p-2",
|
|
240
|
-
style:
|
|
241
|
-
children:
|
|
240
|
+
style: x.styles,
|
|
241
|
+
children: x.render ? x.render(M.get(t, x.dataIndex), t) : M.get(t, x.dataIndex, "")
|
|
242
242
|
},
|
|
243
|
-
`${
|
|
243
|
+
`${k}-${x.key}`
|
|
244
244
|
))
|
|
245
245
|
]
|
|
246
246
|
},
|
|
247
|
-
`${t[
|
|
247
|
+
`${t[p]}`
|
|
248
248
|
)) : /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsx(
|
|
249
249
|
A,
|
|
250
250
|
{
|
|
251
|
-
colSpan:
|
|
252
|
-
children: /* @__PURE__ */ e.jsx(
|
|
251
|
+
colSpan: w ? o ? l.length + 2 : l.length + 1 : l.length,
|
|
252
|
+
children: /* @__PURE__ */ e.jsx(Ne, {})
|
|
253
253
|
}
|
|
254
254
|
) }) })
|
|
255
255
|
] });
|
|
256
|
-
},
|
|
256
|
+
}, Se = ({
|
|
257
257
|
dataSource: s,
|
|
258
258
|
columns: l,
|
|
259
259
|
onRowClick: d,
|
|
260
|
-
rowKey:
|
|
261
|
-
hasNumbers:
|
|
262
|
-
hasSearch:
|
|
263
|
-
exportOptions:
|
|
264
|
-
hasCheckbox:
|
|
265
|
-
hasPagination:
|
|
260
|
+
rowKey: p,
|
|
261
|
+
hasNumbers: h,
|
|
262
|
+
hasSearch: w,
|
|
263
|
+
exportOptions: o,
|
|
264
|
+
hasCheckbox: T,
|
|
265
|
+
hasPagination: y,
|
|
266
266
|
isStickyHeader: D,
|
|
267
267
|
onParamChange: r,
|
|
268
268
|
dataKey: F = "docs",
|
|
269
269
|
loading: $,
|
|
270
|
-
tableKey:
|
|
271
|
-
filters:
|
|
270
|
+
tableKey: c,
|
|
271
|
+
filters: b,
|
|
272
272
|
actions: n,
|
|
273
273
|
handleFilterChange: g,
|
|
274
|
-
params:
|
|
274
|
+
params: j,
|
|
275
275
|
exportLoading: q = !1,
|
|
276
276
|
onColumnsUpdate: v,
|
|
277
277
|
hasColumnsVisibilityDropdown: t,
|
|
278
|
-
onSelectedItemsChange:
|
|
279
|
-
actionProps:
|
|
280
|
-
filterWrapperProps:
|
|
281
|
-
exportOptionsProps:
|
|
282
|
-
columnsVisibilityProps:
|
|
283
|
-
|
|
278
|
+
onSelectedItemsChange: k,
|
|
279
|
+
actionProps: x,
|
|
280
|
+
filterWrapperProps: Y,
|
|
281
|
+
exportOptionsProps: Z,
|
|
282
|
+
columnsVisibilityProps: i,
|
|
283
|
+
paginationProps: U,
|
|
284
|
+
searchProps: I,
|
|
285
|
+
...K
|
|
284
286
|
}) => {
|
|
285
|
-
const { t:
|
|
287
|
+
const { t: u } = ye(), [E, V] = fe([]), { formattedColumns: _, handleColumnsChange: S, resetColumns: C } = pe({ key: c, columns: l });
|
|
286
288
|
return W(() => {
|
|
287
289
|
v == null || v(_);
|
|
288
290
|
}, [_, v]), W(() => {
|
|
289
|
-
|
|
290
|
-
}, [E,
|
|
291
|
+
k == null || k(E);
|
|
292
|
+
}, [E, k]), /* @__PURE__ */ e.jsxs(
|
|
291
293
|
"div",
|
|
292
294
|
{
|
|
293
295
|
className: "border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",
|
|
294
296
|
children: [
|
|
295
|
-
(
|
|
296
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-full shrink", children:
|
|
297
|
-
|
|
297
|
+
(w || t && c || !M.isEmpty(o) || !M.isEmpty(b)) && /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row", children: [
|
|
298
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full shrink", children: w && /* @__PURE__ */ e.jsx(
|
|
299
|
+
me,
|
|
298
300
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
+
...I,
|
|
302
|
+
defaultValue: M.get(j, "search", ""),
|
|
303
|
+
onSearchChange: (a) => r == null ? void 0 : r({ ...j, search: a, page: 1 })
|
|
301
304
|
}
|
|
302
305
|
) }),
|
|
303
306
|
/* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 items-center justify-end gap-3", children: [
|
|
304
|
-
|
|
305
|
-
|
|
307
|
+
o && /* @__PURE__ */ e.jsx(
|
|
308
|
+
we,
|
|
306
309
|
{
|
|
307
|
-
...
|
|
308
|
-
options:
|
|
310
|
+
...Z,
|
|
311
|
+
options: o,
|
|
309
312
|
loading: q
|
|
310
313
|
}
|
|
311
314
|
),
|
|
312
|
-
t &&
|
|
315
|
+
t && c && /* @__PURE__ */ e.jsxs(ee, { children: [
|
|
313
316
|
/* @__PURE__ */ e.jsx(
|
|
314
|
-
|
|
317
|
+
se,
|
|
315
318
|
{
|
|
316
319
|
asChild: !0,
|
|
317
|
-
...
|
|
320
|
+
...i == null ? void 0 : i.triggerProps,
|
|
318
321
|
children: /* @__PURE__ */ e.jsx(
|
|
319
|
-
|
|
322
|
+
P,
|
|
320
323
|
{
|
|
321
324
|
variant: "secondary",
|
|
322
325
|
size: "sm",
|
|
323
326
|
className: "ml-auto rounded-lg px-3",
|
|
324
|
-
children: (
|
|
325
|
-
/* @__PURE__ */ e.jsx(
|
|
327
|
+
children: (i == null ? void 0 : i.title) || /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
328
|
+
/* @__PURE__ */ e.jsx(ce, {}),
|
|
326
329
|
" ",
|
|
327
|
-
/* @__PURE__ */ e.jsx("span", { className: "hidden lg:!inline", children:
|
|
328
|
-
/* @__PURE__ */ e.jsx(
|
|
330
|
+
/* @__PURE__ */ e.jsx("span", { className: "hidden lg:!inline", children: u("Customize columns") }),
|
|
331
|
+
/* @__PURE__ */ e.jsx(ie, {})
|
|
329
332
|
] })
|
|
330
333
|
}
|
|
331
334
|
)
|
|
332
335
|
}
|
|
333
336
|
),
|
|
334
337
|
/* @__PURE__ */ e.jsxs(
|
|
335
|
-
|
|
338
|
+
te,
|
|
336
339
|
{
|
|
337
340
|
align: "end",
|
|
338
|
-
...
|
|
341
|
+
...i == null ? void 0 : i.contentProps,
|
|
339
342
|
children: [
|
|
340
343
|
/* @__PURE__ */ e.jsxs(
|
|
341
|
-
|
|
344
|
+
le,
|
|
342
345
|
{
|
|
343
346
|
className: "capitalize",
|
|
344
|
-
onClick:
|
|
347
|
+
onClick: C,
|
|
345
348
|
children: [
|
|
346
|
-
/* @__PURE__ */ e.jsx(
|
|
349
|
+
/* @__PURE__ */ e.jsx(ze, {}),
|
|
347
350
|
" ",
|
|
348
|
-
|
|
351
|
+
(i == null ? void 0 : i.resetText) || "Reset columns"
|
|
349
352
|
]
|
|
350
353
|
}
|
|
351
354
|
),
|
|
352
|
-
/* @__PURE__ */ e.jsx(
|
|
353
|
-
_.map((
|
|
354
|
-
|
|
355
|
+
/* @__PURE__ */ e.jsx(de, {}),
|
|
356
|
+
_.map((a) => /* @__PURE__ */ e.jsx(
|
|
357
|
+
re,
|
|
355
358
|
{
|
|
356
359
|
className: "capitalize",
|
|
357
|
-
checked: !
|
|
358
|
-
onCheckedChange: (H) =>
|
|
359
|
-
children:
|
|
360
|
+
checked: !a.hidden,
|
|
361
|
+
onCheckedChange: (H) => S(a, !H),
|
|
362
|
+
children: a.name
|
|
360
363
|
},
|
|
361
|
-
|
|
364
|
+
a.key
|
|
362
365
|
))
|
|
363
366
|
]
|
|
364
367
|
}
|
|
365
368
|
)
|
|
366
369
|
] }),
|
|
367
|
-
n && /* @__PURE__ */ e.jsx(
|
|
368
|
-
|
|
369
|
-
|
|
370
|
+
n && /* @__PURE__ */ e.jsx(ke, { ...x, actions: n }),
|
|
371
|
+
b && /* @__PURE__ */ e.jsx(
|
|
372
|
+
oe,
|
|
370
373
|
{
|
|
371
|
-
...
|
|
372
|
-
filters:
|
|
373
|
-
params:
|
|
374
|
-
onFilter: (
|
|
375
|
-
r == null || r({ ...
|
|
374
|
+
...Y,
|
|
375
|
+
filters: b,
|
|
376
|
+
params: j,
|
|
377
|
+
onFilter: (a) => {
|
|
378
|
+
r == null || r({ ...j, ...a, page: 1 }), g == null || g(a);
|
|
376
379
|
}
|
|
377
380
|
}
|
|
378
381
|
)
|
|
379
382
|
] })
|
|
380
383
|
] }),
|
|
381
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col overflow-auto border-y", children: $ ? /* @__PURE__ */ e.jsx(
|
|
382
|
-
|
|
384
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col overflow-auto border-y", children: $ ? /* @__PURE__ */ e.jsx(ne, {}) : /* @__PURE__ */ e.jsx(
|
|
385
|
+
Re,
|
|
383
386
|
{
|
|
384
|
-
...
|
|
387
|
+
...K,
|
|
385
388
|
params: {
|
|
386
389
|
page: (s == null ? void 0 : s.page) || 1,
|
|
387
390
|
limit: s == null ? void 0 : s.limit,
|
|
388
|
-
...
|
|
391
|
+
...j
|
|
389
392
|
},
|
|
390
|
-
rows:
|
|
391
|
-
rowKey:
|
|
393
|
+
rows: M.get(s, F, []),
|
|
394
|
+
rowKey: p,
|
|
392
395
|
selectedItems: E,
|
|
393
396
|
isStickyHeader: D,
|
|
394
397
|
columns: _,
|
|
395
|
-
hasCheckbox:
|
|
396
|
-
hasNumbers:
|
|
398
|
+
hasCheckbox: T,
|
|
399
|
+
hasNumbers: h,
|
|
397
400
|
onRowClick: d,
|
|
398
|
-
onSelectedItemsChange:
|
|
399
|
-
onSortOrderChange: ({ sortField:
|
|
400
|
-
r == null || r({ ...
|
|
401
|
+
onSelectedItemsChange: V,
|
|
402
|
+
onSortOrderChange: ({ sortField: a, sortOrder: H }) => {
|
|
403
|
+
r == null || r({ ...j, sortField: a, sortOrder: H });
|
|
401
404
|
}
|
|
402
405
|
}
|
|
403
406
|
) }),
|
|
404
|
-
|
|
407
|
+
y && /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row", children: [
|
|
405
408
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm", children: /* @__PURE__ */ e.jsx(
|
|
406
|
-
|
|
409
|
+
ae,
|
|
407
410
|
{
|
|
408
|
-
onLimitChange: (
|
|
411
|
+
onLimitChange: (a) => r == null ? void 0 : r({ ...j, limit: a, page: 1 }),
|
|
409
412
|
defaultValue: s == null ? void 0 : s.limit
|
|
410
413
|
}
|
|
411
414
|
) }),
|
|
@@ -416,9 +419,10 @@ const Ee = [
|
|
|
416
419
|
" row(s) selected."
|
|
417
420
|
] }),
|
|
418
421
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
419
|
-
|
|
422
|
+
xe,
|
|
420
423
|
{
|
|
421
|
-
|
|
424
|
+
...U,
|
|
425
|
+
onPageChange: (a) => r == null ? void 0 : r({ ...j, page: a }),
|
|
422
426
|
currentPage: s == null ? void 0 : s.page,
|
|
423
427
|
totalPages: s == null ? void 0 : s.totalPages
|
|
424
428
|
}
|
|
@@ -429,6 +433,6 @@ const Ee = [
|
|
|
429
433
|
);
|
|
430
434
|
};
|
|
431
435
|
export {
|
|
432
|
-
|
|
433
|
-
|
|
436
|
+
Se as DataTable,
|
|
437
|
+
Re as MyTable
|
|
434
438
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../MyLimitSelect-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../MyLimitSelect-BNdB8P5s.cjs");exports.MyLimitSelect=e.MyLimitSelect;exports.MyPagination=e.MyPagination;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type DropdownContainerProps } from 'dgz-ui/dropdown';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import { type MyTableProps } from './MyTable';
|
|
4
|
-
import { type FilterInterface, type FilterWrapperProps } from '../filters';
|
|
4
|
+
import { type FilterInterface, type FilterWrapperProps, type SearchProps } from '../filters';
|
|
5
5
|
import { type ActionInterface, type ActionsProps } from '../actions';
|
|
6
6
|
import { type ExportDataInterface, type ExportDataProps } from '../export';
|
|
7
7
|
import type { ColumnType } from '../../types';
|
|
8
|
+
import type { MyPaginationProps } from '../pagination/MyPagination.tsx';
|
|
8
9
|
/**
|
|
9
10
|
* Minimal pagination wrapper contract used by `DataTable`.
|
|
10
11
|
*
|
|
@@ -79,9 +80,12 @@ export interface DataTableProps<TData, TPaginationData extends PaginationInterfa
|
|
|
79
80
|
filterWrapperProps?: Partial<FilterWrapperProps>;
|
|
80
81
|
/** Props for the ExportData component. */
|
|
81
82
|
exportOptionsProps?: Partial<ExportDataProps>;
|
|
83
|
+
searchProps?: Partial<SearchProps>;
|
|
84
|
+
paginationProps?: Partial<MyPaginationProps>;
|
|
82
85
|
/** Props for the columns visibility dropdown. */
|
|
83
86
|
columnsVisibilityProps?: DropdownContainerProps & {
|
|
84
87
|
title?: ReactNode;
|
|
88
|
+
resetText?: ReactNode;
|
|
85
89
|
};
|
|
86
90
|
}
|
|
87
91
|
/**
|
|
@@ -186,5 +190,5 @@ export interface DataTableProps<TData, TPaginationData extends PaginationInterfa
|
|
|
186
190
|
* Returns
|
|
187
191
|
* - React element that renders a complete data table experience.
|
|
188
192
|
*/
|
|
189
|
-
export declare const DataTable: <TData, TPaginationData extends PaginationInterface<TData> = PaginationInterface<TData>>({ dataSource, columns, onRowClick, rowKey, hasNumbers, hasSearch, exportOptions, hasCheckbox, hasPagination, isStickyHeader, onParamChange, dataKey, loading, tableKey, filters, actions, handleFilterChange, params, exportLoading, onColumnsUpdate, hasColumnsVisibilityDropdown, onSelectedItemsChange, actionProps, filterWrapperProps, exportOptionsProps, columnsVisibilityProps, ...props }: DataTableProps<TData, TPaginationData>) => import("react/jsx-runtime").JSX.Element;
|
|
193
|
+
export declare const DataTable: <TData, TPaginationData extends PaginationInterface<TData> = PaginationInterface<TData>>({ dataSource, columns, onRowClick, rowKey, hasNumbers, hasSearch, exportOptions, hasCheckbox, hasPagination, isStickyHeader, onParamChange, dataKey, loading, tableKey, filters, actions, handleFilterChange, params, exportLoading, onColumnsUpdate, hasColumnsVisibilityDropdown, onSelectedItemsChange, actionProps, filterWrapperProps, exportOptionsProps, columnsVisibilityProps, paginationProps, searchProps, ...props }: DataTableProps<TData, TPaginationData>) => import("react/jsx-runtime").JSX.Element;
|
|
190
194
|
//# sourceMappingURL=DataTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/components/datatable/DataTable.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,sBAAsB,EAO5B,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/components/datatable/DataTable.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* Props for the MyPagination component.
|
|
3
4
|
*/
|
|
4
|
-
interface MyPaginationProps {
|
|
5
|
+
export interface MyPaginationProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
6
|
/** The current 1-based page index. Defaults to 1. */
|
|
6
7
|
currentPage?: number;
|
|
7
8
|
/** Total number of pages. Defaults to 0. */
|
|
@@ -19,6 +20,7 @@ interface MyPaginationProps {
|
|
|
19
20
|
* selects a page via the page links or the dropdown.
|
|
20
21
|
* - The component uses i18n for the "Go to page" label via `react-i18next`.
|
|
21
22
|
*
|
|
23
|
+
* @param className
|
|
22
24
|
* @param props - Component props
|
|
23
25
|
* @param props.currentPage - The current 1-based page index. Defaults to 1.
|
|
24
26
|
* @param props.totalPages - Total number of pages. Defaults to 0.
|
|
@@ -33,6 +35,5 @@ interface MyPaginationProps {
|
|
|
33
35
|
* />
|
|
34
36
|
* ```
|
|
35
37
|
*/
|
|
36
|
-
export declare const MyPagination: ({ currentPage, totalPages, onPageChange, }: MyPaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export {};
|
|
38
|
+
export declare const MyPagination: ({ currentPage, totalPages, onPageChange, className, ...props }: MyPaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
39
|
//# sourceMappingURL=MyPagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyPagination.d.ts","sourceRoot":"","sources":["../../../../src/components/pagination/MyPagination.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MyPagination.d.ts","sourceRoot":"","sources":["../../../../src/components/pagination/MyPagination.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,YAAY,GAAI,gEAM1B,iBAAiB,4CAkHnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dgz-ui-shared",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -198,6 +198,8 @@
|
|
|
198
198
|
"vitest": "^3.1.4"
|
|
199
199
|
},
|
|
200
200
|
"peerDependencies": {
|
|
201
|
+
"i18next": "^25.2.1",
|
|
202
|
+
"react-i18next": "^15.5.2",
|
|
201
203
|
"react": "^19.1.2",
|
|
202
204
|
"react-dom": "^19.1.2"
|
|
203
205
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./jsx-runtime-h4oGeKUK.cjs"),x=require("./index-BL59b1Bz-COeLljOH.cjs"),p=require("react"),y=require("./button-CdZDBhmr-3yMPCRDo.cjs"),w=require("./chevron-right-HWBijj-I-CZBu0GKg.cjs"),I=require("./createLucideIcon-B950nf2d-DrrWmvZU.cjs"),l=require("./utils-B6fNqzRf-BNysSCt9.cjs"),n=require("./input-mask-DBLFIvhN-C_0RAR2l.cjs"),d=require("./useTranslation-CZf20ucv.cjs");function L(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const f=L(p);/**
|
|
2
|
-
* @license lucide-react v0.511.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const M=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],q=I.k("chevron-left",M),h=({className:s,...e})=>x.ae.jsx("nav",{role:"navigation","aria-label":"pagination",className:l.mo("flex w-full justify-center",s),...e});h.displayName="Pagination";const N=f.forwardRef(({className:s,...e},t)=>x.ae.jsx("ul",{ref:t,className:l.mo("flex flex-row items-center gap-1",s),...e}));N.displayName="PaginationContent";const m=f.forwardRef(({className:s,...e},t)=>x.ae.jsx("li",{ref:t,className:l.mo("",s),...e}));m.displayName="PaginationItem";const u=({className:s,isActive:e,size:t="icon",...o})=>x.ae.jsx("a",{"aria-current":e?"page":void 0,className:l.mo(y.g({variant:e?"tertiary":"ghost",size:t}),"cursor-pointer",s),...o});u.displayName="PaginationLink";const v=({className:s,...e})=>x.ae.jsx(u,{"aria-label":"Go to previous page",size:"default",className:l.mo("gap-1 px-2.5",s),...e,children:x.ae.jsx(q,{className:"h-4 w-4"})});v.displayName="PaginationPrevious";const R=({className:s,...e})=>x.ae.jsx(u,{"aria-label":"Go to next page",size:"default",className:l.mo("gap-1 px-2.5",s),...e,children:x.ae.jsx(w.e,{className:"h-4 w-4"})});R.displayName="PaginationNext";const z=({currentPage:s=1,totalPages:e=0,onPageChange:t})=>{const{t:o}=d.useTranslation(),r=p.useCallback(()=>{const a=[];a.push(1),s-1>2&&a.push("...");for(let j=Math.max(2,s-1);j<=Math.min(e-1,s+1);j++)a.push(j);return s+1<e-1&&a.push("..."),e>1&&a.push(e),a},[s,e]),E=p.useMemo(()=>{const a=[];for(let c=0;c<e;c++)a.push({value:`${c+1}`,label:`${c+1}`});return a},[e]);return i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-end gap-3 lg:flex-row",children:[i.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsxRuntimeExports.jsxs("div",{className:"min-w-20 font-semibold",children:[o("Go to page"),":"]}),i.jsxRuntimeExports.jsxs(n.Zx,{onValueChange:a=>t(parseInt(a)),value:`${s}`,children:[i.jsxRuntimeExports.jsx(n.jm,{className:"h-8.5 w-16",children:i.jsxRuntimeExports.jsx(n.Qx,{})}),i.jsxRuntimeExports.jsx(n.Um,{options:E})]})]}),i.jsxRuntimeExports.jsx(h,{className:"justify-end",children:i.jsxRuntimeExports.jsxs(N,{children:[i.jsxRuntimeExports.jsx(m,{children:i.jsxRuntimeExports.jsx(v,{isActive:s>1,size:"sm",className:l.mo(s>1?"disabled":"shadow"),onClick:()=>{s>1&&t(s-1)}})}),r().map((a,c)=>i.jsxRuntimeExports.jsx(m,{onClick:()=>{typeof a=="number"&&t(a)},children:i.jsxRuntimeExports.jsx(u,{size:"sm",className:l.mo("w-9 px-0 text-center",a===s&&"shadow"),isActive:a===s,children:a})},c)),i.jsxRuntimeExports.jsx(m,{children:i.jsxRuntimeExports.jsx(R,{size:"sm",onClick:()=>{s<e&&t(s+1)},className:l.mo(s<e?"disabled":"shadow"),isActive:s<e})})]})})]})},b=50,T=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],g=({defaultValue:s=b,options:e=T,onLimitChange:t})=>{const{t:o}=d.useTranslation();return i.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxRuntimeExports.jsxs("span",{className:"font-semibold",children:[o("Rows per page"),":"]}),i.jsxRuntimeExports.jsxs(n.Zx,{onValueChange:t,value:`${s}`,children:[i.jsxRuntimeExports.jsx(n.jm,{className:"h-8.5 w-17",children:i.jsxRuntimeExports.jsx(n.Qx,{})}),i.jsxRuntimeExports.jsx(n.Jh,{children:e==null?void 0:e.map(r=>i.jsxRuntimeExports.jsx(n.ed,{value:`${r.value}`,children:r.label},r.value))})]})]})};exports.DEFAULT_LIMIT=b;exports.MyLimitSelect=g;exports.MyPagination=z;
|