dgz-ui-shared 1.1.5 → 1.1.7

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.
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-DUiatUiq.cjs"),n=require("./dropdown-menu-CxOevPOj-Iyvvp16W.cjs"),x=require("./button-Bp2lHjov-D9UnCnYX.cjs"),t=require("./index-CGv7FLNy.cjs"),u=require("./useTranslation-CZf20ucv.cjs"),c=({actions:i})=>{const{t:r}=u.useTranslation();return s.jsxRuntimeExports.jsxs(n.jt,{children:[s.jsxRuntimeExports.jsx(n.Tt,{asChild:!0,children:s.jsxRuntimeExports.jsxs(x.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[s.jsxRuntimeExports.jsx(t.Wg,{})," ",s.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:r("Actions")}),s.jsxRuntimeExports.jsx(t.f1,{})]})}),s.jsxRuntimeExports.jsx(n.it,{align:"end",children:i.map((e,o)=>s.jsxRuntimeExports.jsx(n.ut,{onClick:()=>e.onClick(),children:e.label},o))})]})};exports.Actions=c;
@@ -3,7 +3,7 @@ import { j as t, T as e, i as o, u as l } from "./dropdown-menu-CxOevPOj-ezMrzPH
3
3
  import { u as m } from "./button-Bp2lHjov-BTlHPcva.js";
4
4
  import { W as c, f as d } from "./index-BrQ82Wyu.js";
5
5
  import { u as j } from "./useTranslation-dH-uwymc.js";
6
- const g = ({ actions: i = [] }) => {
6
+ const g = ({ actions: i }) => {
7
7
  const { t: n } = j();
8
8
  return /* @__PURE__ */ s.jsxs(t, { children: [
9
9
  /* @__PURE__ */ s.jsx(e, { asChild: !0, children: /* @__PURE__ */ s.jsxs(
@@ -0,0 +1,29 @@
1
+ import { j as s } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { j as e, T as o, i as l, u as m } from "./dropdown-menu-CxOevPOj-ezMrzPHK.js";
3
+ import { u as x } from "./button-Bp2lHjov-BTlHPcva.js";
4
+ import { Z as c, f as d } from "./index-BrQ82Wyu.js";
5
+ import { S as j } from "./Spin-4v-RUSBk.js";
6
+ import { u as p } from "./useTranslation-dH-uwymc.js";
7
+ const T = ({ options: a, loading: i = !1 }) => {
8
+ const { t: n } = p();
9
+ return /* @__PURE__ */ s.jsxs(e, { children: [
10
+ /* @__PURE__ */ s.jsx(o, { asChild: !0, children: /* @__PURE__ */ s.jsxs(
11
+ x,
12
+ {
13
+ variant: "secondary",
14
+ size: "sm",
15
+ className: "ml-auto rounded-lg px-3",
16
+ children: [
17
+ i ? /* @__PURE__ */ s.jsx(j, {}) : /* @__PURE__ */ s.jsx(c, {}),
18
+ " ",
19
+ /* @__PURE__ */ s.jsx("span", { className: "hidden lg:!inline", children: n("Export") }),
20
+ /* @__PURE__ */ s.jsx(d, {})
21
+ ]
22
+ }
23
+ ) }),
24
+ /* @__PURE__ */ s.jsx(l, { align: "end", children: a.map((r, t) => /* @__PURE__ */ s.jsx(m, { onClick: () => r.onClick(), children: r.label }, t)) })
25
+ ] });
26
+ };
27
+ export {
28
+ T as E
29
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-DUiatUiq.cjs"),e=require("./dropdown-menu-CxOevPOj-Iyvvp16W.cjs"),u=require("./button-Bp2lHjov-D9UnCnYX.cjs"),n=require("./index-CGv7FLNy.cjs"),a=require("./Spin-BtIXLZuq.cjs"),j=require("./useTranslation-CZf20ucv.cjs"),l=({options:r,loading:i=!1})=>{const{t:x}=j.useTranslation();return s.jsxRuntimeExports.jsxs(e.jt,{children:[s.jsxRuntimeExports.jsx(e.Tt,{asChild:!0,children:s.jsxRuntimeExports.jsxs(u.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[i?s.jsxRuntimeExports.jsx(a.Spin,{}):s.jsxRuntimeExports.jsx(n.ZC,{})," ",s.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:x("Export")}),s.jsxRuntimeExports.jsx(n.f1,{})]})}),s.jsxRuntimeExports.jsx(e.it,{align:"end",children:r.map((t,o)=>s.jsxRuntimeExports.jsx(e.ut,{onClick:()=>t.onClick(),children:t.label},o))})]})};exports.ExportData=l;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./jsx-runtime-DUiatUiq.cjs"),s=require("./Spin-BtIXLZuq.cjs"),r=t=>e.jsxRuntimeExports.jsx("div",{className:"text-item-primary mx-auto flex w-full items-center justify-center p-4",...t,children:e.jsxRuntimeExports.jsx(s.Spin,{className:"text-item-primary size-6"})});exports.Loader=r;
@@ -0,0 +1,13 @@
1
+ import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { S as r } from "./Spin-4v-RUSBk.js";
3
+ const m = (t) => /* @__PURE__ */ e.jsx(
4
+ "div",
5
+ {
6
+ className: "text-item-primary mx-auto flex w-full items-center justify-center p-4",
7
+ ...t,
8
+ children: /* @__PURE__ */ e.jsx(r, { className: "text-item-primary size-6" })
9
+ }
10
+ );
11
+ export {
12
+ m as L
13
+ };
@@ -1,15 +1,15 @@
1
- import { j as t } from "./jsx-runtime-C5mzlN2N.js";
2
- import { m as s } from "./utils-B6fNqzRf-B1_jG1K7.js";
3
- const a = (e) => /* @__PURE__ */ t.jsxs(
1
+ import { j as s } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { m as e } from "./utils-B6fNqzRf-B1_jG1K7.js";
3
+ const r = (t) => /* @__PURE__ */ s.jsxs(
4
4
  "svg",
5
5
  {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  fill: "none",
8
8
  viewBox: "0 0 24 24",
9
- ...e,
10
- className: s("mr-1 size-5 animate-spin text-white", e == null ? void 0 : e.className),
9
+ ...t,
10
+ className: e("mr-1 size-5 animate-spin text-white", t == null ? void 0 : t.className),
11
11
  children: [
12
- /* @__PURE__ */ t.jsx(
12
+ /* @__PURE__ */ s.jsx(
13
13
  "circle",
14
14
  {
15
15
  className: "opacity-25",
@@ -20,7 +20,7 @@ const a = (e) => /* @__PURE__ */ t.jsxs(
20
20
  strokeWidth: "4"
21
21
  }
22
22
  ),
23
- /* @__PURE__ */ t.jsx(
23
+ /* @__PURE__ */ s.jsx(
24
24
  "path",
25
25
  {
26
26
  className: "opacity-75",
@@ -30,15 +30,7 @@ const a = (e) => /* @__PURE__ */ t.jsxs(
30
30
  )
31
31
  ]
32
32
  }
33
- ), m = (e) => /* @__PURE__ */ t.jsx(
34
- "div",
35
- {
36
- className: "text-item-primary mx-auto flex w-full items-center justify-center p-4",
37
- ...e,
38
- children: /* @__PURE__ */ t.jsx(a, { className: "text-item-primary size-6" })
39
- }
40
33
  );
41
34
  export {
42
- m as L,
43
- a as S
35
+ r as S
44
36
  };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-DUiatUiq.cjs"),e=require("./utils-B6fNqzRf-BNysSCt9.cjs"),i=t=>s.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...t,className:e.mo("mr-1 size-5 animate-spin text-white",t==null?void 0:t.className),children:[s.jsxRuntimeExports.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsxRuntimeExports.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});exports.Spin=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../Actions-OOat6KFm.cjs");exports.Actions=t.Actions;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../Actions-Bg4_0weq.cjs");exports.Actions=t.Actions;
@@ -1,4 +1,4 @@
1
- import { A as s } from "../../Actions-lri6QFUm.js";
1
+ import { A as s } from "../../Actions-BuREhr4C.js";
2
2
  export {
3
3
  s as Actions
4
4
  };
@@ -1,21 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),Q=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),R=require("../../dropdown-menu-CxOevPOj-Iyvvp16W.cjs"),T=require("../../MyLimitSelect-DlOUfv_X.cjs"),$=require("../../index-CGv7FLNy.cjs"),n=require("react"),N=require("../../lodash-C5w_OPmE.cjs"),m=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),c=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),z=require("../../useSortable-ByFhUHQb.cjs"),H=require("../../input-mask-PwosgXFZ-DkKZA7fM.cjs"),S=require("../../SortOrder-81BrXp3i.cjs"),Y=require("../../Empty--unTFnpg.cjs"),L=require("../../createLucideIcon-BnAj0RnC.cjs"),V=require("../../FilterWrapper-D-9XhNZS.cjs"),U=require("../../Loader-bUUShWXh.cjs"),K=require("../../Actions-OOat6KFm.cjs"),C=require("../../ExportData-DaEw8iEt.cjs"),P=require("../../useTranslation-CZf20ucv.cjs"),W=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("table",{ref:i,className:c.mo("w-full caption-bottom text-sm",s),...r}));W.displayName="Table";const B=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("thead",{ref:i,className:c.mo("[&_tr]:border-b",s),...r}));B.displayName="TableHeader";const O=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("tbody",{ref:i,className:c.mo("[&_tr:last-child]:border-0",s),...r}));O.displayName="TableBody";const ee=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("tfoot",{ref:i,className:c.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...r}));ee.displayName="TableFooter";const q=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("tr",{ref:i,className:c.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...r}));q.displayName="TableRow";const M=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("th",{ref:i,className:c.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...r}));M.displayName="TableHead";const w=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("td",{ref:i,className:c.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r}));w.displayName="TableCell";const se=n.forwardRef(({className:s,...r},i)=>m.ae.jsx("caption",{ref:i,className:c.mo("text-muted-foreground mt-4 text-sm",s),...r}));se.displayName="TableCaption";/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),Y=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),N=require("../../dropdown-menu-CxOevPOj-Iyvvp16W.cjs"),T=require("../../MyLimitSelect-DlOUfv_X.cjs"),H=require("../../index-CGv7FLNy.cjs"),n=require("react"),y=require("../../lodash-C5w_OPmE.cjs"),m=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),c=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),z=require("../../useSortable-ByFhUHQb.cjs"),S=require("../../input-mask-PwosgXFZ-DkKZA7fM.cjs"),V=require("../../SortOrder-81BrXp3i.cjs"),U=require("../../Empty--unTFnpg.cjs"),L=require("../../createLucideIcon-BnAj0RnC.cjs"),W=require("../../FilterWrapper-D-9XhNZS.cjs"),K=require("../../Loader-BMHIikqX.cjs"),C=require("../../Actions-Bg4_0weq.cjs"),P=require("../../ExportData-DspH4HLF.cjs"),ee=require("../../useTranslation-CZf20ucv.cjs"),B=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("table",{ref:i,className:c.mo("w-full caption-bottom text-sm",s),...t}));B.displayName="Table";const O=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("thead",{ref:i,className:c.mo("[&_tr]:border-b",s),...t}));O.displayName="TableHeader";const Z=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tbody",{ref:i,className:c.mo("[&_tr:last-child]:border-0",s),...t}));Z.displayName="TableBody";const se=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tfoot",{ref:i,className:c.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...t}));se.displayName="TableFooter";const q=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("tr",{ref:i,className:c.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...t}));q.displayName="TableRow";const M=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("th",{ref:i,className:c.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...t}));M.displayName="TableHead";const w=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("td",{ref:i,className:c.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...t}));w.displayName="TableCell";const te=n.forwardRef(({className:s,...t},i)=>m.ae.jsx("caption",{ref:i,className:c.mo("text-muted-foreground mt-4 text-sm",s),...t}));te.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 te=[["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"}]],re=L.createLucideIcon("arrow-down-wide-narrow",te);/**
6
+ */const re=[["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"}]],ie=L.createLucideIcon("arrow-down-wide-narrow",re);/**
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 ie=[["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"}]],xe=L.createLucideIcon("arrow-up-down",ie);/**
11
+ */const le=[["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"}]],xe=L.createLucideIcon("arrow-up-down",le);/**
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 le=[["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"}]],oe=L.createLucideIcon("arrow-up-wide-narrow",le);/**
16
+ */const oe=[["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"}]],de=L.createLucideIcon("arrow-up-wide-narrow",oe);/**
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 de=[["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"}]],ce=L.createLucideIcon("refresh-cw",de),Z=({rows:s=[],columns:r,onRowClick:i,rowKey:p,params:a={page:1,limit:T.DEFAULT_LIMIT},hasNumbers:h=!1,hasCheckbox:u=!1,selectedItems:I,onSelectedItemsChange:k,onSortOrderChange:_,isStickyHeader:x})=>{const{sortObject:d,handleSort:A}=z.useSortable({sortField:a==null?void 0:a.sortField,sortOrder:a==null?void 0:a.sortField,onSortOrderChange:_}),{selectedRows:f,isRowSelected:E,isAllRowsSelected:g,handleSelectAllRows:y,handleSelectRow:j}=z.useDataTable({rows:s,defaultSelectedRows:I});return n.useEffect(()=>{k&&k(f)},[f]),e.jsxRuntimeExports.jsxs(W,{className:"relative",children:[e.jsxRuntimeExports.jsx(B,{className:c.mo("bg-bg",x&&"sticky top-0 z-10"),children:e.jsxRuntimeExports.jsxs(q,{children:[u&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-3",children:e.jsxRuntimeExports.jsx(H.Zf,{className:"mt-1",checked:g(p),onCheckedChange:t=>y(p,!!t),"aria-label":"Select all"})}),h&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-2",children:"#"}),r.filter(t=>!t.hidden).map(t=>e.jsxRuntimeExports.jsx(M,{style:t.styles,className:c.mo("p-2",t.sortable&&"cursor-pointer"),onClick:()=>t.sortable&&A(t.dataIndex),children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[t.name," ",t.sortable&&((d==null?void 0:d.sortField)===t.key?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(d==null?void 0:d.sortOrder)===S.SortOrder.DESC&&e.jsxRuntimeExports.jsx(re,{size:15}),(d==null?void 0:d.sortOrder)===S.SortOrder.ASC&&e.jsxRuntimeExports.jsx(oe,{size:15})]}):e.jsxRuntimeExports.jsx(xe,{size:15}))]})},t.key))]})}),e.jsxRuntimeExports.jsx(O,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:s.length?s.map((t,b)=>e.jsxRuntimeExports.jsxs(q,{onClick:()=>i==null?void 0:i(t),className:c.mo(i&&"cursor-pointer"),"data-state":E(t[p])&&"selected",children:[u&&e.jsxRuntimeExports.jsx(w,{className:"w-12 p-3",onClick:l=>l.stopPropagation(),children:e.jsxRuntimeExports.jsx(H.Zf,{className:"mt-1",checked:E(t[p]),onCheckedChange:l=>j(t[p],!!l),"aria-label":"Select row"})}),h&&e.jsxRuntimeExports.jsx(w,{className:"w-12 p-2",children:(a.page-1)*(a.limit||T.DEFAULT_LIMIT)+b+1}),r.filter(l=>!l.hidden).map(l=>e.jsxRuntimeExports.jsx(w,{className:"text-body-xs-medium max-w-xs p-2",style:l.styles,children:l.render?l.render(N.lodashExports.get(t,l.dataIndex),t):N.lodashExports.get(t,l.dataIndex,"")},`${b}-${l.key}`))]},`${t[p]}`)):e.jsxRuntimeExports.jsx(q,{children:e.jsxRuntimeExports.jsx(w,{colSpan:h?u?r.length+2:r.length+1:r.length,children:e.jsxRuntimeExports.jsx(Y.Empty,{})})})})]})},ne=({dataSource:s,columns:r,onRowClick:i,rowKey:p,hasNumbers:a,hasSearch:h,exportOptions:u,hasCheckbox:I,hasPagination:k,isStickyHeader:_,onParamChange:x,dataKey:d="docs",loading:A,tableKey:f,filters:E,actions:g,handleFilterChange:y,params:j,onColumnsUpdate:t,hasColumnsVisibilityDropdown:b})=>{const{t:l}=P.useTranslation(),[F,X]=n.useState([]),{formattedColumns:v,handleColumnsChange:G,resetColumns:J}=z.useColumns({key:f,columns:r});return n.useEffect(()=>{t==null||t(v)},[v,t]),e.jsxRuntimeExports.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[(h||b&&f||!N.lodashExports.isEmpty(u)||!N.lodashExports.isEmpty(E))&&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:h&&e.jsxRuntimeExports.jsx(V.Search,{defaultValue:N.lodashExports.get(j,"search",""),onSearchChange:o=>x==null?void 0:x({...j,search:o,page:1})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[u&&e.jsxRuntimeExports.jsx(C.ExportData,{options:u}),b&&f&&e.jsxRuntimeExports.jsxs(R.jt,{children:[e.jsxRuntimeExports.jsx(R.Tt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(Q.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[e.jsxRuntimeExports.jsx($.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:l("Customize columns")}),e.jsxRuntimeExports.jsx($.f1,{})]})}),e.jsxRuntimeExports.jsxs(R.it,{align:"end",children:[e.jsxRuntimeExports.jsxs(R.ut,{className:"capitalize",onClick:J,children:[e.jsxRuntimeExports.jsx(ce,{})," ",l("Reset columns")]}),e.jsxRuntimeExports.jsx(R.ft,{}),v.map(o=>e.jsxRuntimeExports.jsx(R.dt,{className:"capitalize",checked:!o.hidden,onCheckedChange:D=>G(o,!D),children:o.name},o.key))]})]}),g&&e.jsxRuntimeExports.jsx(K.Actions,{actions:g}),E&&e.jsxRuntimeExports.jsx(V.FilterWrapper,{filters:E,onFilter:o=>{x==null||x({...j,...o,page:1}),y==null||y(o)}})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col overflow-auto border-y",children:A?e.jsxRuntimeExports.jsx(U.Loader,{}):e.jsxRuntimeExports.jsx(Z,{params:j,rows:N.lodashExports.get(s,d,[]),rowKey:p,selectedItems:F,isStickyHeader:_,columns:v,hasCheckbox:I,hasNumbers:a,onRowClick:i,onSelectedItemsChange:X,onSortOrderChange:({sortField:o,sortOrder:D})=>{x==null||x({...j,sortField:o,sortOrder:D})}})}),k&&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(T.MyLimitSelect,{onLimitChange:o=>x==null?void 0:x({...j,limit:o,page:1}),defaultValue:s==null?void 0:s.limit})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground text-sm",children:[F.length," of ",(s==null?void 0:s.total)||0," row(s) selected."]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(T.MyPagination,{onPageChange:o=>x==null?void 0:x({...j,page:o}),currentPage:s==null?void 0:s.page,totalPages:s==null?void 0:s.totalPages})})]})]})};exports.DataTable=ne;exports.MyTable=Z;
21
+ */const ce=[["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"}]],ne=L.createLucideIcon("refresh-cw",ce),X=({rows:s=[],columns:t,onRowClick:i,rowKey:p,params:a={page:1,limit:T.DEFAULT_LIMIT},hasNumbers:f=!1,hasCheckbox:u=!1,selectedItems:I,onSelectedItemsChange:k,onSortOrderChange:_,isStickyHeader:l})=>{const{sortObject:d,handleSort:A}=z.useSortable({sortField:a==null?void 0:a.sortField,sortOrder:a==null?void 0:a.sortField,onSortOrderChange:_}),{selectedRows:E,isRowSelected:R,isAllRowsSelected:g,handleSelectAllRows:b,handleSelectRow:j}=z.useDataTable({rows:s,defaultSelectedRows:I});return n.useEffect(()=>{k&&k(E)},[E]),e.jsxRuntimeExports.jsxs(B,{className:"relative",children:[e.jsxRuntimeExports.jsx(O,{className:c.mo("bg-bg",l&&"sticky top-0 z-10"),children:e.jsxRuntimeExports.jsxs(q,{children:[u&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-3",children:e.jsxRuntimeExports.jsx(S.Zf,{className:"mt-1",checked:g(p),onCheckedChange:r=>b(p,!!r),"aria-label":"Select all"})}),f&&e.jsxRuntimeExports.jsx(M,{className:"w-12 p-2",children:"#"}),t.filter(r=>!r.hidden).map(r=>e.jsxRuntimeExports.jsx(M,{style:r.styles,className:c.mo("p-2",r.sortable&&"cursor-pointer"),onClick:()=>r.sortable&&A(r.dataIndex),children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.name," ",r.sortable&&((d==null?void 0:d.sortField)===r.key?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(d==null?void 0:d.sortOrder)===V.SortOrder.DESC&&e.jsxRuntimeExports.jsx(ie,{size:15}),(d==null?void 0:d.sortOrder)===V.SortOrder.ASC&&e.jsxRuntimeExports.jsx(de,{size:15})]}):e.jsxRuntimeExports.jsx(xe,{size:15}))]})},r.key))]})}),e.jsxRuntimeExports.jsx(Z,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:s.length?s.map((r,h)=>e.jsxRuntimeExports.jsxs(q,{onClick:()=>i==null?void 0:i(r),className:c.mo(i&&"cursor-pointer"),"data-state":R(r[p])&&"selected",children:[u&&e.jsxRuntimeExports.jsx(w,{className:"w-12 p-3",onClick:x=>x.stopPropagation(),children:e.jsxRuntimeExports.jsx(S.Zf,{className:"mt-1",checked:R(r[p]),onCheckedChange:x=>j(r[p],!!x),"aria-label":"Select row"})}),f&&e.jsxRuntimeExports.jsx(w,{className:"w-12 p-2",children:(a.page-1)*(a.limit||T.DEFAULT_LIMIT)+h+1}),t.filter(x=>!x.hidden).map(x=>e.jsxRuntimeExports.jsx(w,{className:"text-body-xs-medium max-w-xs p-2",style:x.styles,children:x.render?x.render(y.lodashExports.get(r,x.dataIndex),r):y.lodashExports.get(r,x.dataIndex,"")},`${h}-${x.key}`))]},`${r[p]}`)):e.jsxRuntimeExports.jsx(q,{children:e.jsxRuntimeExports.jsx(w,{colSpan:f?u?t.length+2:t.length+1:t.length,children:e.jsxRuntimeExports.jsx(U.Empty,{})})})})]})},ae=({dataSource:s,columns:t,onRowClick:i,rowKey:p,hasNumbers:a,hasSearch:f,exportOptions:u,hasCheckbox:I,hasPagination:k,isStickyHeader:_,onParamChange:l,dataKey:d="docs",loading:A,tableKey:E,filters:R,actions:g,handleFilterChange:b,params:j,exportLoading:r=!1,onColumnsUpdate:h,hasColumnsVisibilityDropdown:x})=>{const{t:F}=ee.useTranslation(),[$,G]=n.useState([]),{formattedColumns:v,handleColumnsChange:J,resetColumns:Q}=z.useColumns({key:E,columns:t});return n.useEffect(()=>{h==null||h(v)},[v,h]),e.jsxRuntimeExports.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[(f||x&&E||!y.lodashExports.isEmpty(u)||!y.lodashExports.isEmpty(R))&&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:f&&e.jsxRuntimeExports.jsx(W.Search,{defaultValue:y.lodashExports.get(j,"search",""),onSearchChange:o=>l==null?void 0:l({...j,search:o,page:1})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[u&&e.jsxRuntimeExports.jsx(P.ExportData,{options:u,loading:r}),x&&E&&e.jsxRuntimeExports.jsxs(N.jt,{children:[e.jsxRuntimeExports.jsx(N.Tt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(Y.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[e.jsxRuntimeExports.jsx(H.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:F("Customize columns")}),e.jsxRuntimeExports.jsx(H.f1,{})]})}),e.jsxRuntimeExports.jsxs(N.it,{align:"end",children:[e.jsxRuntimeExports.jsxs(N.ut,{className:"capitalize",onClick:Q,children:[e.jsxRuntimeExports.jsx(ne,{})," ",F("Reset columns")]}),e.jsxRuntimeExports.jsx(N.ft,{}),v.map(o=>e.jsxRuntimeExports.jsx(N.dt,{className:"capitalize",checked:!o.hidden,onCheckedChange:D=>J(o,!D),children:o.name},o.key))]})]}),g&&e.jsxRuntimeExports.jsx(C.Actions,{actions:g}),R&&e.jsxRuntimeExports.jsx(W.FilterWrapper,{filters:R,onFilter:o=>{l==null||l({...j,...o,page:1}),b==null||b(o)}})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col overflow-auto border-y",children:A?e.jsxRuntimeExports.jsx(K.Loader,{}):e.jsxRuntimeExports.jsx(X,{params:j,rows:y.lodashExports.get(s,d,[]),rowKey:p,selectedItems:$,isStickyHeader:_,columns:v,hasCheckbox:I,hasNumbers:a,onRowClick:i,onSelectedItemsChange:G,onSortOrderChange:({sortField:o,sortOrder:D})=>{l==null||l({...j,sortField:o,sortOrder:D})}})}),k&&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(T.MyLimitSelect,{onLimitChange:o=>l==null?void 0:l({...j,limit:o,page:1}),defaultValue:s==null?void 0:s.limit})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground text-sm",children:[$.length," of ",(s==null?void 0:s.total)||0," row(s) selected."]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(T.MyPagination,{onPageChange:o=>l==null?void 0:l({...j,page:o}),currentPage:s==null?void 0:s.page,totalPages:s==null?void 0:s.totalPages})})]})]})};exports.DataTable=ae;exports.MyTable=X;