dgz-ui-shared 1.1.29 → 1.1.31

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 (38) hide show
  1. package/dist/{DateRangePicker-hhQndFoD.js → DateRangePicker-BbvT7XEr.js} +6 -6
  2. package/dist/{DateRangePicker-DqzcyN7H.cjs → DateRangePicker-DlH-0Nyv.cjs} +1 -1
  3. package/dist/{Empty-DspeyPQa.js → Empty-R6tJosqw.js} +7 -7
  4. package/dist/Empty-RpS8tJNv.cjs +6 -0
  5. package/dist/{FilterWrapper-OjCn16Bf.cjs → FilterWrapper-D0oACPk3.cjs} +4 -4
  6. package/dist/{FilterWrapper-BU6BOSt1.js → FilterWrapper-vMOeud_S.js} +4 -4
  7. package/dist/MyLimitSelect-CFjO6tYM.cjs +6 -0
  8. package/dist/MyLimitSelect-JkR-SZXb.js +221 -0
  9. package/dist/components/confirm/index.cjs.js +1 -1
  10. package/dist/components/confirm/index.es.js +1 -1
  11. package/dist/components/datatable/index.cjs.js +5 -5
  12. package/dist/components/datatable/index.es.js +164 -160
  13. package/dist/components/datepicker/index.cjs.js +1 -1
  14. package/dist/components/datepicker/index.es.js +1 -1
  15. package/dist/components/empty/index.cjs.js +1 -1
  16. package/dist/components/empty/index.es.js +1 -1
  17. package/dist/components/filters/index.cjs.js +1 -1
  18. package/dist/components/filters/index.es.js +15 -15
  19. package/dist/components/form/index.cjs.js +1 -1
  20. package/dist/components/form/index.es.js +1 -1
  21. package/dist/components/pagination/index.cjs.js +1 -1
  22. package/dist/components/pagination/index.es.js +1 -1
  23. package/dist/components/theme/index.cjs.js +2 -2
  24. package/dist/components/theme/index.es.js +5 -5
  25. package/dist/hooks/index.cjs.js +1 -1
  26. package/dist/hooks/index.es.js +1 -1
  27. package/dist/types/components/datatable/DataTable.d.ts +6 -2
  28. package/dist/types/components/datatable/DataTable.d.ts.map +1 -1
  29. package/dist/types/components/pagination/MyPagination.d.ts +4 -3
  30. package/dist/types/components/pagination/MyPagination.d.ts.map +1 -1
  31. package/dist/{unstyled-3gQZkMky.js → unstyled-B5s-hwxJ.js} +1 -1
  32. package/dist/{unstyled-CD5LId4m.cjs → unstyled-D8OC13a0.cjs} +1 -1
  33. package/package.json +3 -1
  34. package/dist/Empty-DPsWiBRX.cjs +0 -6
  35. package/dist/MyLimitSelect-BU1FClXt.cjs +0 -6
  36. package/dist/MyLimitSelect-D5ZWDY-s.js +0 -209
  37. package/dist/useTranslation-CZf20ucv.cjs +0 -1
  38. package/dist/useTranslation-dH-uwymc.js +0 -147
@@ -6,8 +6,8 @@ import { c as _n, m as be } from "./utils-B6fNqzRf-B1_jG1K7.js";
6
6
  import { J as _t, o as Lt, c as Et, z as vt, n as Ln } from "./react-select-DVPHHTAP-D2u3DqGr.js";
7
7
  import { k as En } from "./createLucideIcon-B950nf2d-9wLYOF5y.js";
8
8
  import { g as Pn } from "./_commonjsHelpers-DaMA6jEr.js";
9
- import { _ as jn, w as Fn, u as Hn } from "./popover-OZcfKDD9-C2PVWPLS.js";
10
- import { u as In } from "./useTranslation-dH-uwymc.js";
9
+ import { useTranslation as jn } from "react-i18next";
10
+ import { _ as Fn, w as Hn, u as In } from "./popover-OZcfKDD9-C2PVWPLS.js";
11
11
  import { c as zn } from "./createLucideIcon-B950nf2d.js";
12
12
  /**
13
13
  * @license lucide-react v0.511.0 - ISC
@@ -3751,7 +3751,7 @@ const Qe = /* @__PURE__ */ Pn(as), ys = ({
3751
3751
  error: s,
3752
3752
  ...i
3753
3753
  }) => {
3754
- const { t: u } = In(), [h, v] = me(!1), [l, M] = me();
3754
+ const { t: u } = jn(), [h, v] = me(!1), [l, M] = me();
3755
3755
  Je(() => {
3756
3756
  M(t);
3757
3757
  }, [t]);
@@ -3803,8 +3803,8 @@ const Qe = /* @__PURE__ */ Pn(as), ys = ({
3803
3803
  const { from: k, to: $ } = b;
3804
3804
  M({ from: k, to: $ }), k && $ && (a({ from: k, to: $ }), v(!1));
3805
3805
  };
3806
- return /* @__PURE__ */ ce.jsx("div", { className: be("grid gap-2", e), children: /* @__PURE__ */ ce.jsxs(jn, { open: h, onOpenChange: v, children: [
3807
- /* @__PURE__ */ ce.jsx(Fn, { asChild: !0, children: /* @__PURE__ */ ce.jsxs(
3806
+ return /* @__PURE__ */ ce.jsx("div", { className: be("grid gap-2", e), children: /* @__PURE__ */ ce.jsxs(Fn, { open: h, onOpenChange: v, children: [
3807
+ /* @__PURE__ */ ce.jsx(Hn, { asChild: !0, children: /* @__PURE__ */ ce.jsxs(
3808
3808
  ge,
3809
3809
  {
3810
3810
  id: "date",
@@ -3827,7 +3827,7 @@ const Qe = /* @__PURE__ */ Pn(as), ys = ({
3827
3827
  ]
3828
3828
  }
3829
3829
  ) }),
3830
- /* @__PURE__ */ ce.jsxs(Hn, { className: "flex w-auto p-0", align: "end", side: "bottom", children: [
3830
+ /* @__PURE__ */ ce.jsxs(In, { className: "flex w-auto p-0", align: "end", side: "bottom", children: [
3831
3831
  /* @__PURE__ */ ce.jsx(
3832
3832
  "div",
3833
3833
  {
@@ -1,4 +1,4 @@
1
- "use strict";const ce=require("./jsx-runtime-h4oGeKUK.cjs"),m=require("react"),A=require("./index-BL59b1Bz-COeLljOH.cjs"),fe=require("./button-CdZDBhmr-3yMPCRDo.cjs"),me=require("./utils-B6fNqzRf-BNysSCt9.cjs"),De=require("./react-select-DVPHHTAP-DKDInFsM.cjs"),kn=require("./createLucideIcon-B950nf2d-DrrWmvZU.cjs"),xn=require("./_commonjsHelpers-DKOUU3wS.cjs"),Ve=require("./popover-OZcfKDD9-KUWOsIOs.cjs"),On=require("./useTranslation-CZf20ucv.cjs"),Sn=require("./createLucideIcon-BnAj0RnC.cjs");/**
1
+ "use strict";const ce=require("./jsx-runtime-h4oGeKUK.cjs"),m=require("react"),A=require("./index-BL59b1Bz-COeLljOH.cjs"),fe=require("./button-CdZDBhmr-3yMPCRDo.cjs"),me=require("./utils-B6fNqzRf-BNysSCt9.cjs"),De=require("./react-select-DVPHHTAP-DKDInFsM.cjs"),kn=require("./createLucideIcon-B950nf2d-DrrWmvZU.cjs"),xn=require("./_commonjsHelpers-DKOUU3wS.cjs"),On=require("react-i18next"),Ve=require("./popover-OZcfKDD9-KUWOsIOs.cjs"),Sn=require("./createLucideIcon-BnAj0RnC.cjs");/**
2
2
  * @license lucide-react v0.511.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
1
  import { j as e } from "./jsx-runtime-DS1N_tNq.js";
2
- import { m as n } from "./utils-B6fNqzRf-B1_jG1K7.js";
3
- import { u as c } from "./useTranslation-dH-uwymc.js";
2
+ import { useTranslation as n } from "react-i18next";
3
+ import { m as c } from "./utils-B6fNqzRf-B1_jG1K7.js";
4
4
  import { c as m } from "./createLucideIcon-B950nf2d.js";
5
5
  /**
6
6
  * @license lucide-react v0.511.0 - ISC
@@ -16,18 +16,18 @@ const i = [
16
16
  key: "usdka0"
17
17
  }
18
18
  ]
19
- ], l = m("folder-open", i), u = ({ children: t, icon: s, className: o, ...r }) => {
20
- const { t: a } = c();
19
+ ], l = m("folder-open", i), u = ({ children: t, icon: o, className: s, ...r }) => {
20
+ const { t: a } = n();
21
21
  return /* @__PURE__ */ e.jsxs(
22
22
  "div",
23
23
  {
24
24
  ...r,
25
- className: n(
25
+ className: c(
26
26
  "flex h-16 flex-col items-center justify-center text-center text-base",
27
- o
27
+ s
28
28
  ),
29
29
  children: [
30
- s || /* @__PURE__ */ e.jsx(l, { size: 48, strokeWidth: 1 }),
30
+ o || /* @__PURE__ */ e.jsx(l, { size: 48, strokeWidth: 1 }),
31
31
  t || a("No results")
32
32
  ]
33
33
  }
@@ -0,0 +1,6 @@
1
+ "use strict";const e=require("./jsx-runtime-h4oGeKUK.cjs"),o=require("react-i18next"),i=require("./utils-B6fNqzRf-BNysSCt9.cjs"),a=require("./createLucideIcon-BnAj0RnC.cjs");/**
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 u=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],l=a.createLucideIcon("folder-open",u),x=({children:t,icon:s,className:r,...n})=>{const{t:c}=o.useTranslation();return e.jsxRuntimeExports.jsxs("div",{...n,className:i.mo("flex h-16 flex-col items-center justify-center text-center text-base",r),children:[s||e.jsxRuntimeExports.jsx(l,{size:48,strokeWidth:1}),t||c("No results")]})};exports.Empty=x;
@@ -1,14 +1,14 @@
1
- "use strict";const e=require("./jsx-runtime-h4oGeKUK.cjs"),b=require("./input-mask-DBLFIvhN-C_0RAR2l.cjs"),i=require("./button-CdZDBhmr-3yMPCRDo.cjs"),z=require("./utils-B6fNqzRf-BNysSCt9.cjs"),F=require("./useTranslation-CZf20ucv.cjs"),u=require("./createLucideIcon-BnAj0RnC.cjs"),o=require("react"),$=require("./lodash-C5w_OPmE.cjs"),j=require("./popover-OZcfKDD9-KUWOsIOs.cjs"),B=require("./MyInput-OECIw9XS.cjs"),C=require("./MySelect-ClBq6zbD.cjs"),O=require("./useFilter-Cwz8oftI.cjs");/**
1
+ "use strict";const e=require("./jsx-runtime-h4oGeKUK.cjs"),b=require("./input-mask-DBLFIvhN-C_0RAR2l.cjs"),z=require("react-i18next"),i=require("./button-CdZDBhmr-3yMPCRDo.cjs"),F=require("./utils-B6fNqzRf-BNysSCt9.cjs"),u=require("./createLucideIcon-BnAj0RnC.cjs"),c=require("react"),$=require("./lodash-C5w_OPmE.cjs"),j=require("./popover-OZcfKDD9-KUWOsIOs.cjs"),B=require("./MyInput-OECIw9XS.cjs"),C=require("./MySelect-ClBq6zbD.cjs"),O=require("./useFilter-Cwz8oftI.cjs");/**
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 A=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],T=u.createLucideIcon("chevron-down",A);/**
6
+ */const A=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],W=u.createLucideIcon("chevron-down",A);/**
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 W=[["path",{d:"M10 18h4",key:"1ulq68"}],["path",{d:"M11 6H3",key:"1u26ik"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"M18 9V3",key:"xwwp7m"}],["path",{d:"M7 12h8",key:"7a1bxv"}]],P=u.createLucideIcon("list-filter-plus",W);/**
11
+ */const P=[["path",{d:"M10 18h4",key:"1ulq68"}],["path",{d:"M11 6H3",key:"1u26ik"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"M18 9V3",key:"xwwp7m"}],["path",{d:"M7 12h8",key:"7a1bxv"}]],T=u.createLucideIcon("list-filter-plus",P);/**
12
12
  * @license lucide-react v0.511.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
@@ -18,4 +18,4 @@
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 G=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],H=u.createLucideIcon("search",G),K=({name:l="search",defaultValue:n,onSearchChange:r,placeholder:t,className:c,...y})=>{const{t:x}=F.useTranslation(),p=a=>{const d=new FormData(a.currentTarget);r(d.get(l)||void 0),a.preventDefault(),a.stopPropagation()};return e.jsxRuntimeExports.jsxs("form",{className:z.mo("relative w-full max-w-64 min-w-40",c),onSubmit:p,children:[e.jsxRuntimeExports.jsx(b.yp,{...y,className:"h-8 rounded-lg",name:l,placeholder:t||x("Search..."),defaultValue:n?`${n}`:""}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",size:"sm",children:e.jsxRuntimeExports.jsx(H,{})})]})},J=o.memo(function({filters:n,params:r,onFilter:t,onChange:c,onCancel:y,triggerProps:x,contentProps:p,title:a,resetText:d,applyText:v,...N}){const[q,f]=o.useState(!1),[M,m]=o.useState(!1),{form:E}=O.useFilter({params:r}),{watch:w,getValues:S,handleSubmit:g,control:R,reset:k}=E;o.useEffect(()=>{let s=!1;n.map(L=>{const h=$.lodashExports.get(r,`${L.name}`);(Array.isArray(h)?h.length>0:h)&&(s=!0),f(s)})},[n,r]);const I=w();o.useEffect(()=>{c==null||c(S())},[I]);const _=o.useCallback((s={})=>{t==null||t(s),m(!1)},[t]),D=o.useCallback(()=>{k(),t&&r&&t({...r,...Object.fromEntries(n.map(s=>[s.name,void 0]))}),m(!1)},[t,k,r,n]);return e.jsxRuntimeExports.jsxs(j._e,{open:M,onOpenChange:m,children:[e.jsxRuntimeExports.jsx(j.we,{...x,children:e.jsxRuntimeExports.jsx(i.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...N,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[q?e.jsxRuntimeExports.jsx(P,{className:"size-5"}):e.jsxRuntimeExports.jsx(Z,{className:"size-5"})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:a||"Filter"}),e.jsxRuntimeExports.jsx(T,{})]})})}),e.jsxRuntimeExports.jsx(j.ue,{side:"bottom",align:"end",...p,children:e.jsxRuntimeExports.jsx(b.Gx,{...E,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:g(_),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:n.map(s=>s.options?e.jsxRuntimeExports.jsx(C.MySelect,{control:R,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(B.MyInput,{control:R,placeholder:s.placeholder,name:s.name,label:s.label},s.name))}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 justify-end gap-2",children:[e.jsxRuntimeExports.jsx(i.u,{variant:"destructive",type:"reset",size:"sm",onClick:D,children:d||"Reset"}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",size:"sm",children:v||"Apply"})]})]})})})]})});exports.FilterWrapper=J;exports.Search=K;
21
+ */const G=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],H=u.createLucideIcon("search",G),K=({name:l="search",defaultValue:n,onSearchChange:r,placeholder:t,className:o,...y})=>{const{t:x}=z.useTranslation(),p=a=>{const d=new FormData(a.currentTarget);r(d.get(l)||void 0),a.preventDefault(),a.stopPropagation()};return e.jsxRuntimeExports.jsxs("form",{className:F.mo("relative w-full max-w-64 min-w-40",o),onSubmit:p,children:[e.jsxRuntimeExports.jsx(b.yp,{...y,className:"h-8 rounded-lg",name:l,placeholder:t||x("Search..."),defaultValue:n?`${n}`:""}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",size:"sm",children:e.jsxRuntimeExports.jsx(H,{})})]})},J=c.memo(function({filters:n,params:r,onFilter:t,onChange:o,onCancel:y,triggerProps:x,contentProps:p,title:a,resetText:d,applyText:v,...N}){const[q,f]=c.useState(!1),[M,m]=c.useState(!1),{form:E}=O.useFilter({params:r}),{watch:w,getValues:S,handleSubmit:g,control:R,reset:k}=E;c.useEffect(()=>{let s=!1;n.map(L=>{const h=$.lodashExports.get(r,`${L.name}`);(Array.isArray(h)?h.length>0:h)&&(s=!0),f(s)})},[n,r]);const I=w();c.useEffect(()=>{o==null||o(S())},[I]);const _=c.useCallback((s={})=>{t==null||t(s),m(!1)},[t]),D=c.useCallback(()=>{k(),t&&r&&t({...r,...Object.fromEntries(n.map(s=>[s.name,void 0]))}),m(!1)},[t,k,r,n]);return e.jsxRuntimeExports.jsxs(j._e,{open:M,onOpenChange:m,children:[e.jsxRuntimeExports.jsx(j.we,{...x,children:e.jsxRuntimeExports.jsx(i.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...N,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[q?e.jsxRuntimeExports.jsx(T,{className:"size-5"}):e.jsxRuntimeExports.jsx(Z,{className:"size-5"})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:a||"Filter"}),e.jsxRuntimeExports.jsx(W,{})]})})}),e.jsxRuntimeExports.jsx(j.ue,{side:"bottom",align:"end",...p,children:e.jsxRuntimeExports.jsx(b.Gx,{...E,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:g(_),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:n.map(s=>s.options?e.jsxRuntimeExports.jsx(C.MySelect,{control:R,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(B.MyInput,{control:R,placeholder:s.placeholder,name:s.name,label:s.label},s.name))}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 justify-end gap-2",children:[e.jsxRuntimeExports.jsx(i.u,{variant:"destructive",type:"reset",size:"sm",onClick:D,children:d||"Reset"}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",size:"sm",children:v||"Apply"})]})]})})})]})});exports.FilterWrapper=J;exports.Search=K;
@@ -1,8 +1,8 @@
1
1
  import { j as e } from "./jsx-runtime-DS1N_tNq.js";
2
2
  import { y as A, b as I } from "./input-mask-DBLFIvhN-BBxoZxnd.js";
3
+ import { useTranslation as L } from "react-i18next";
3
4
  import { u as c } from "./button-CdZDBhmr-BT_j3ig5.js";
4
- import { m as L } from "./utils-B6fNqzRf-B1_jG1K7.js";
5
- import { u as O } from "./useTranslation-dH-uwymc.js";
5
+ import { m as O } from "./utils-B6fNqzRf-B1_jG1K7.js";
6
6
  import { c as l } from "./createLucideIcon-B950nf2d.js";
7
7
  import { memo as R, useState as b, useEffect as k, useCallback as v } from "react";
8
8
  import { l as C } from "./lodash-CYNxjS-I.js";
@@ -58,14 +58,14 @@ const Y = [
58
58
  className: r,
59
59
  ...x
60
60
  }) => {
61
- const { t: m } = O(), d = (n) => {
61
+ const { t: m } = L(), d = (n) => {
62
62
  const p = new FormData(n.currentTarget);
63
63
  o(p.get(i) || void 0), n.preventDefault(), n.stopPropagation();
64
64
  };
65
65
  return /* @__PURE__ */ e.jsxs(
66
66
  "form",
67
67
  {
68
- className: L("relative w-full max-w-64 min-w-40", r),
68
+ className: O("relative w-full max-w-64 min-w-40", r),
69
69
  onSubmit: d,
70
70
  children: [
71
71
  /* @__PURE__ */ e.jsx(
@@ -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("react-i18next");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"}]],g=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(g,{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 k=({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,T=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],O=({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(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=k;
@@ -0,0 +1,221 @@
1
+ import { j as e } from "./jsx-runtime-DS1N_tNq.js";
2
+ import { a as m } from "./index-BL59b1Bz-C9bJE_xn.js";
3
+ import * as f from "react";
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
+ import { m as n } from "./utils-B6fNqzRf-B1_jG1K7.js";
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
+ import { useTranslation as N } from "react-i18next";
11
+ /**
12
+ * @license lucide-react v0.511.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
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
+ "nav",
19
+ {
20
+ role: "navigation",
21
+ "aria-label": "pagination",
22
+ className: n("flex w-full justify-center", s),
23
+ ...a
24
+ }
25
+ );
26
+ v.displayName = "Pagination";
27
+ const u = f.forwardRef(({ className: s, ...a }, l) => /* @__PURE__ */ m.jsx(
28
+ "ul",
29
+ {
30
+ ref: l,
31
+ className: n("flex flex-row items-center gap-1", s),
32
+ ...a
33
+ }
34
+ ));
35
+ u.displayName = "PaginationContent";
36
+ const r = f.forwardRef(({ className: s, ...a }, l) => /* @__PURE__ */ m.jsx("li", { ref: l, className: n("", s), ...a }));
37
+ r.displayName = "PaginationItem";
38
+ const x = ({
39
+ className: s,
40
+ isActive: a,
41
+ size: l = "icon",
42
+ ...c
43
+ }) => /* @__PURE__ */ m.jsx(
44
+ "a",
45
+ {
46
+ "aria-current": a ? "page" : void 0,
47
+ className: n(
48
+ M({
49
+ variant: a ? "tertiary" : "ghost",
50
+ size: l
51
+ }),
52
+ "cursor-pointer",
53
+ s
54
+ ),
55
+ ...c
56
+ }
57
+ );
58
+ x.displayName = "PaginationLink";
59
+ const b = ({
60
+ className: s,
61
+ ...a
62
+ }) => /* @__PURE__ */ m.jsx(
63
+ x,
64
+ {
65
+ "aria-label": "Go to previous page",
66
+ size: "default",
67
+ className: n("gap-1 px-2.5", s),
68
+ ...a,
69
+ children: /* @__PURE__ */ m.jsx(g, { className: "h-4 w-4" })
70
+ }
71
+ );
72
+ b.displayName = "PaginationPrevious";
73
+ const w = ({
74
+ className: s,
75
+ ...a
76
+ }) => /* @__PURE__ */ m.jsx(
77
+ x,
78
+ {
79
+ "aria-label": "Go to next page",
80
+ size: "default",
81
+ className: n("gap-1 px-2.5", s),
82
+ ...a,
83
+ children: /* @__PURE__ */ m.jsx(A, { className: "h-4 w-4" })
84
+ }
85
+ );
86
+ w.displayName = "PaginationNext";
87
+ const q = ({
88
+ currentPage: s = 1,
89
+ totalPages: a = 0,
90
+ onPageChange: l,
91
+ className: c,
92
+ ...t
93
+ }) => {
94
+ const { t: y } = N(), R = k(() => {
95
+ const i = [];
96
+ i.push(1), s - 1 > 2 && i.push("...");
97
+ for (let d = Math.max(2, s - 1); d <= Math.min(a - 1, s + 1); d++)
98
+ i.push(d);
99
+ return s + 1 < a - 1 && i.push("..."), a > 1 && i.push(a), i;
100
+ }, [s, a]), $ = z(() => {
101
+ const i = [];
102
+ for (let o = 0; o < a; o++)
103
+ i.push({
104
+ value: `${o + 1}`,
105
+ label: `${o + 1}`
106
+ });
107
+ return i;
108
+ }, [a]);
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,
125
+ {
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
+ ]
132
+ }
133
+ )
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 = [
184
+ {
185
+ value: 10,
186
+ label: "10"
187
+ },
188
+ {
189
+ value: 20,
190
+ label: "20"
191
+ },
192
+ {
193
+ value: 50,
194
+ label: "50"
195
+ },
196
+ {
197
+ value: 100,
198
+ label: "100"
199
+ }
200
+ ], B = ({
201
+ defaultValue: s = D,
202
+ options: a = E,
203
+ onLimitChange: l
204
+ }) => {
205
+ const { t: c } = N();
206
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
207
+ /* @__PURE__ */ e.jsxs("span", { className: "font-semibold", children: [
208
+ c("Rows per page"),
209
+ ":"
210
+ ] }),
211
+ /* @__PURE__ */ e.jsxs(p, { onValueChange: l, value: `${s}`, children: [
212
+ /* @__PURE__ */ e.jsx(h, { className: "h-8.5 w-17", children: /* @__PURE__ */ e.jsx(j, {}) }),
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)) })
214
+ ] })
215
+ ] });
216
+ };
217
+ export {
218
+ D,
219
+ q as M,
220
+ B as a
221
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../unstyled-CD5LId4m.cjs");exports.Confirm=r.Confirm;exports.ConfirmContainer=r.Lt;exports.PasswordConfirm=r.PasswordConfirm;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../unstyled-D8OC13a0.cjs");exports.Confirm=r.Confirm;exports.ConfirmContainer=r.Lt;exports.PasswordConfirm=r.PasswordConfirm;
@@ -1,4 +1,4 @@
1
- import { C as a, L as n, P as s } from "../../unstyled-3gQZkMky.js";
1
+ import { C as a, L as n, P as s } from "../../unstyled-B5s-hwxJ.js";
2
2
  export {
3
3
  a as Confirm,
4
4
  n as ConfirmContainer,
@@ -1,21 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-h4oGeKUK.cjs"),se=require("../../button-CdZDBhmr-3yMPCRDo.cjs"),k=require("../../dropdown-menu-TWRSm6RK-DQ03CnVw.cjs"),A=require("../../MyLimitSelect-BU1FClXt.cjs"),I=require("../../index-CGv7FLNy.cjs"),c=require("react"),g=require("../../lodash-C5w_OPmE.cjs"),f=require("../../index-BL59b1Bz-COeLljOH.cjs"),n=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),O=require("../../useSortable-BvLbSWXW.cjs"),J=require("../../input-mask-DBLFIvhN-C_0RAR2l.cjs"),Z=require("../../SortOrder-81BrXp3i.cjs"),te=require("../../Empty-DPsWiBRX.cjs"),D=require("../../createLucideIcon-BnAj0RnC.cjs"),G=require("../../FilterWrapper-OjCn16Bf.cjs"),re=require("../../Loader-BsYF7B7O.cjs"),xe=require("../../Actions-Dh8TPahn.cjs"),ie=require("../../ExportData-DV3HcBlK.cjs"),le=require("../../useTranslation-CZf20ucv.cjs"),Q=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("table",{ref:x,className:n.mo("w-full caption-bottom text-sm",s),...r}));Q.displayName="Table";const X=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("thead",{ref:x,className:n.mo("[&_tr]:border-b",s),...r}));X.displayName="TableHeader";const Y=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("tbody",{ref:x,className:n.mo("[&_tr:last-child]:border-0",s),...r}));Y.displayName="TableBody";const de=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("tfoot",{ref:x,className:n.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...r}));de.displayName="TableFooter";const L=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("tr",{ref:x,className:n.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...r}));L.displayName="TableRow";const _=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("th",{ref:x,className:n.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...r}));_.displayName="TableHead";const M=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("td",{ref:x,className:n.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r}));M.displayName="TableCell";const oe=c.forwardRef(({className:s,...r},x)=>f.ae.jsx("caption",{ref:x,className:n.mo("text-muted-foreground mt-4 text-sm",s),...r}));oe.displayName="TableCaption";/**
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-CFjO6tYM.cjs"),xe=require("react-i18next"),O=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"),I=require("../../useSortable-BvLbSWXW.cjs"),H=require("../../input-mask-DBLFIvhN-C_0RAR2l.cjs"),J=require("../../SortOrder-81BrXp3i.cjs"),de=require("../../Empty-RpS8tJNv.cjs"),D=require("../../createLucideIcon-BnAj0RnC.cjs"),Z=require("../../FilterWrapper-D0oACPk3.cjs"),le=require("../../Loader-BsYF7B7O.cjs"),ie=require("../../Actions-Dh8TPahn.cjs"),oe=require("../../ExportData-DV3HcBlK.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 ne=[["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"}]],ce=D.createLucideIcon("arrow-down-wide-narrow",ne);/**
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 je=[["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"}]],pe=D.createLucideIcon("arrow-up-down",je);/**
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 ae=[["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"}]],me=D.createLucideIcon("arrow-up-wide-narrow",ae);/**
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 fe=[["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"}]],ue=D.createLucideIcon("refresh-cw",fe),U=({rows:s=[],columns:r,onRowClick:x,rowKey:m,params:j={page:1,limit:A.DEFAULT_LIMIT},hasNumbers:R=!1,hasCheckbox:u=!1,selectedItems:v,onSelectedItemsChange:N,onSortOrderChange:z,isStickyHeader:i,className:F,...$})=>{const{sortObject:o,handleSort:b}=O.useSortable({sortField:j==null?void 0:j.sortField,sortOrder:j==null?void 0:j.sortOrder,onSortOrderChange:z}),{selectedRows:h,isRowSelected:y,isAllRowsSelected:p,handleSelectAllRows:B,handleSelectRow:w}=O.useDataTable({rows:s,defaultSelectedRows:v});return c.useEffect(()=>{JSON.stringify(v)!==JSON.stringify(h)&&h&&(N==null||N(h))},[h,v,N]),e.jsxRuntimeExports.jsxs(Q,{...$,className:n.mo("relative",F),children:[e.jsxRuntimeExports.jsx(X,{className:n.mo("bg-bg",i&&"sticky top-0 z-10"),children:e.jsxRuntimeExports.jsxs(L,{children:[u&&e.jsxRuntimeExports.jsx(_,{className:"w-12 p-3",children:e.jsxRuntimeExports.jsx(J.vp,{className:"mt-1",checked:p(m),onCheckedChange:t=>B(m,!!t),"aria-label":"Select all"})}),R&&e.jsxRuntimeExports.jsx(_,{className:"w-12 p-2",children:"#"}),r.filter(t=>!t.hidden).map(t=>e.jsxRuntimeExports.jsx(_,{style:t.styles,className:n.mo("p-2",t.sortable&&"cursor-pointer"),onClick:()=>t.sortable&&b(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)===Z.SortOrder.DESC&&e.jsxRuntimeExports.jsx(ce,{size:15}),(o==null?void 0:o.sortOrder)===Z.SortOrder.ASC&&e.jsxRuntimeExports.jsx(me,{size:15})]}):e.jsxRuntimeExports.jsx(pe,{size:15}))]})},t.key))]})}),e.jsxRuntimeExports.jsx(Y,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:s.length?s.map((t,E)=>e.jsxRuntimeExports.jsxs(L,{onClick:()=>x==null?void 0:x(t),className:n.mo(x&&"cursor-pointer"),"data-state":y(t[m])&&"selected",children:[u&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-3",onClick:d=>d.stopPropagation(),children:e.jsxRuntimeExports.jsx(J.vp,{className:"mt-1",checked:y(t[m]),onCheckedChange:d=>w(t[m],!!d),"aria-label":"Select row"})}),R&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-2",children:(j.page-1)*(j.limit||A.DEFAULT_LIMIT)+E+1}),r.filter(d=>!d.hidden).map(d=>e.jsxRuntimeExports.jsx(M,{className:"text-body-xs-medium max-w-xs p-2",style:d.styles,children:d.render?d.render(g.lodashExports.get(t,d.dataIndex),t):g.lodashExports.get(t,d.dataIndex,"")},`${E}-${d.key}`))]},`${t[m]}`)):e.jsxRuntimeExports.jsx(L,{children:e.jsxRuntimeExports.jsx(M,{colSpan:R?u?r.length+2:r.length+1:r.length,children:e.jsxRuntimeExports.jsx(te.Empty,{})})})})]})},he=({dataSource:s,columns:r,onRowClick:x,rowKey:m,hasNumbers:j,hasSearch:R,exportOptions:u,hasCheckbox:v,hasPagination:N,isStickyHeader:z,onParamChange:i,dataKey:F="docs",loading:$,tableKey:o,filters:b,actions:h,handleFilterChange:y,params:p,exportLoading:B=!1,onColumnsUpdate:w,hasColumnsVisibilityDropdown:t,onSelectedItemsChange:E,actionProps:d,filterWrapperProps:K,exportOptionsProps:V,columnsVisibilityProps:a,...S})=>{const{t:H}=le.useTranslation(),[q,C]=c.useState([]),{formattedColumns:T,handleColumnsChange:P,resetColumns:ee}=O.useColumns({key:o,columns:r});return c.useEffect(()=>{w==null||w(T)},[T,w]),c.useEffect(()=>{E==null||E(q)},[q,E]),e.jsxRuntimeExports.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[(R||t&&o||!g.lodashExports.isEmpty(u)||!g.lodashExports.isEmpty(b))&&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:R&&e.jsxRuntimeExports.jsx(G.Search,{defaultValue:g.lodashExports.get(p,"search",""),onSearchChange:l=>i==null?void 0:i({...p,search:l,page:1})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[u&&e.jsxRuntimeExports.jsx(ie.ExportData,{...V,options:u,loading:B}),t&&o&&e.jsxRuntimeExports.jsxs(k.Tt,{children:[e.jsxRuntimeExports.jsx(k.At,{asChild:!0,...a==null?void 0:a.triggerProps,children:e.jsxRuntimeExports.jsx(se.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:(a==null?void 0:a.title)||e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(I.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:H("Customize columns")}),e.jsxRuntimeExports.jsx(I.f1,{})]})})}),e.jsxRuntimeExports.jsxs(k.it,{align:"end",...a==null?void 0:a.contentProps,children:[e.jsxRuntimeExports.jsxs(k.ut,{className:"capitalize",onClick:ee,children:[e.jsxRuntimeExports.jsx(ue,{})," ",H("Reset columns")]}),e.jsxRuntimeExports.jsx(k.ft,{}),T.map(l=>e.jsxRuntimeExports.jsx(k.dt,{className:"capitalize",checked:!l.hidden,onCheckedChange:W=>P(l,!W),children:l.name},l.key))]})]}),h&&e.jsxRuntimeExports.jsx(xe.Actions,{...d,actions:h}),b&&e.jsxRuntimeExports.jsx(G.FilterWrapper,{...K,filters:b,params:p,onFilter:l=>{i==null||i({...p,...l,page:1}),y==null||y(l)}})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col overflow-auto border-y",children:$?e.jsxRuntimeExports.jsx(re.Loader,{}):e.jsxRuntimeExports.jsx(U,{...S,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:q,isStickyHeader:z,columns:T,hasCheckbox:v,hasNumbers:j,onRowClick:x,onSelectedItemsChange:C,onSortOrderChange:({sortField:l,sortOrder:W})=>{i==null||i({...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=>i==null?void 0:i({...p,limit:l,page:1}),defaultValue:s==null?void 0:s.limit})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground text-sm",children:[q.length," of ",(s==null?void 0:s.total)||0," row(s) selected."]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(A.MyPagination,{onPageChange:l=>i==null?void 0:i({...p,page:l}),currentPage:s==null?void 0:s.page,totalPages:s==null?void 0:s.totalPages})})]})]})};exports.DataTable=he;exports.MyTable=U;
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}=I.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}=I.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(H.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(H.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(de.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}=xe.useTranslation(),[T,ee]=j.useState([]),{formattedColumns:b,handleColumnsChange:se,resetColumns:te}=I.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(oe.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(O.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:P("Customize columns")}),e.jsxRuntimeExports.jsx(O.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(ie.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(le.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;