1import{R as w,j as e}from"./main-BkpAS6Tt.js";import{u as f,c as N,f as c,d as y}from"./index-D2HWtwv1.js";import{B as C}from"./badge-BVkGl1_x.js";import{T as D}from"./TitleIconCard-C90bp_g5.js";import{u as d}from"./user-2-CmbXL6KQ.js";import{u as j}from"./user-1-BJMQmRW9.js";import{u as n}from"./user-3-BrFpV_SU.js";import{u as v}from"./user-5-BOjRhHJK.js";import{u as S}from"./user-7-Cy4w0EX7.js";import{I as k}from"./iconify-BLAYqHQO.js";import{D as R,a as P,b as T,c as M}from"./dropdown-menu-CLPKr1dO.js";import{u as E}from"./user-6-CT9FDbIU.js";import{u as U}from"./user-8-Cqpk29vu.js";import{u as B}from"./user-4-Bo4yhbeF.js";import{u as V}from"./user-9-CrCkmjX6.js";import{I as A}from"./IconDots-DERIX5Dr.js";import{B as H}from"./BreadcrumbComp-DdXArMCY.js";import{s as $}from"./blog-img1-BZ1eGbjc.js";import{s as z,a as L,b as F}from"./blog-img5-ioVUBwdk.js";import{i as I}from"./blog-img3-BvqI8_pA.js";import"./_commonjsHelpers-CE1G-McA.js";import"./index-Cft9Cwv8.js";import"./utils-4perknFd.js";import"./card-DoRMGzGn.js";import"./button-CVuE7h15.js";import"./index-QqyytP6n.js";import"./index-L0SKbviM.js";import"./index-DRcYnjBa.js";import"./index-CfThMl9f.js";import"./index-DhQbCedW.js";import"./index-Jo9Y0u8a.js";import"./index-BHinUB-C.js";import"./index-aJTH1M9Z.js";import"./tslib.es6-CmEaCU22.js";import"./index-DfANd6nE.js";import"./index-Ddz03csu.js";import"./floating-ui.dom-D7G01c1r.js";import"./index-B_H36sPx.js";import"./index-DjxFjNHx.js";import"./index-C0QJ8CHZ.js";import"./chevron-right-DFxpASjY.js";import"./createLucideIcon-DRlH1f4M.js";import"./check-DIOPK-zC.js";import"./circle-DoQ76Nbd.js";import"./createReactComponent-DOWdMep2.js";import"./CardBox-CY_4CfKs.js";const W=[{avatar:j,name:"Sunil Joshi",post:"Web Designer",pname:"Elite Admin",status:"Active",statuscolor:"lightSuccess",teams:[{id:"1",color:"error",text:"S"},{id:"2",color:"secondary ",text:"D"}],budget:"$3.9"},{avatar:d,name:"Andrew McDownland",post:"Project Manager",pname:"Real Homes WP Theme",status:"Pending",statuscolor:"lightWarning",teams:[{id:"1",color:"secondary",text:"N"},{id:"2",color:"warning ",text:"X"},{id:"3",color:"primary ",text:"A"}],budget:"$24.5k"},{avatar:n,name:"Christopher Jamil",post:"Project Manager",pname:"MedicalPro WP Theme",status:"Completed",statuscolor:"lightPrimary",teams:[{id:"1",color:"secondary",text:"X"}],budget:"$12.8k"},{avatar:S,name:"Nirav Joshi",post:"Frontend Engineer",pname:"Hosting Press HTML",status:"Active",statuscolor:"lightSuccess",teams:[{id:"1",color:"primary",text:"X"},{id:"2",color:"error",text:"Y"}],budget:"$2.4k"},{avatar:v,name:"Micheal Doe",post:"Content Writer",pname:"Helping Hands WP Theme",status:"Cancel",statuscolor:"lightError",teams:[{id:"1",color:"secondary",text:"S"}],budget:"$9.3k"}],x=y(),O=[x.accessor("avatar",{cell:s=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx("img",{src:s.getValue(),alt:"icon",height:50,width:50,className:"h-10 w-10 rounded-full"}),e.jsxs("div",{className:"truncate line-clamp-2 max-w-56",children:[e.jsx("h6",{className:"text-base",children:s.row.original.name}),e.jsx("p",{className:"text-sm ",children:s.row.original.post})]})]}),header:()=>e.jsx("span",{children:"User"})}),x.accessor("pname",{header:()=>e.jsx("span",{children:"Project Name"}),cell:s=>e.jsx("p",{className:" text-base",children:s.getValue()})}),x.accessor("teams",{header:()=>e.jsx("span",{children:"Team"}),cell:s=>e.jsx("div",{className:"flex",children:s.getValue().map(r=>e.jsx("div",{className:"-ms-2",children:e.jsx("div",{className:`bg-${r.color} text-white border-2 border-white dark:border-darkborder h-10 w-10 flex justify-center items-center text-xl font-medium text-ld rounded-full`,children:r.text})},r.id))})}),x.accessor("status",{header:()=>e.jsx("span",{children:"Status"}),cell:s=>e.jsx(C,{variant:s.row.original.statuscolor,className:"capitalize",children:s.getValue()})}),x.accessor("budget",{header:()=>e.jsx("span",{children:"Budget"}),cell:s=>e.jsx("h6",{className:"text-base",children:s.getValue()})})],X=()=>{const[s]=w.useState(W),r=f({data:s,columns:O,getCoreRowModel:N()}),i=()=>{const a=["Name","post","pname","status","statuscolor","teams","budget"],t=s.map(o=>[o.name,o.post,o.pname,o.status,o.statuscolor,o.teams.map(h=>h.text).join(", "),o.budget]),m=[a.join(","),...t.map(o=>o.join(","))].join(` 2`),u=new Blob([m],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(u),l=document.createElement("a");l.href=p,l.setAttribute("download","table-data.csv"),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return e.jsx(e.Fragment,{children:e.jsx(D,{title:"Footer Row Table",onDownload:i,children:e.jsx("div",{className:"border rounded-md border-ld overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full",children:[e.jsx("thead",{children:r.getHeaderGroups().map(a=>e.jsx("tr",{children:a.headers.map(t=>e.jsx("th",{className:"text-base text-ld font-semibold text-left border-b border-ld px-4 py-3",children:t.isPlaceholder?null:c(t.column.columnDef.header,t.getContext())},t.id))},a.id))}),e.jsxs("tbody",{className:"divide-y divide-border dark:divide-darkborder",children:[r.getRowModel().rows.map(a=>e.jsx("tr",{children:a.getVisibleCells().map(t=>e.jsx("td",{className:"whitespace-nowrap py-3 px-4 ",children:c(t.column.columnDef.cell,t.getContext())},t.id))},a.id)),r.getHeaderGroups().map(a=>e.jsx("tr",{children:a.headers.map(t=>e.jsx("th",{className:"text-base font-semibold text-ld text-left px-4 py-3 ",children:t.isPlaceholder?null:c(t.column.columnDef.header,t.getContext())},t.id))},a.id))]})]})})})})})},q=[{avatar:j,name:"Olivia Rhye",post:"Xtreme admin",status:"active",statuscolor:"lightError",users:[{id:"1",icon:d},{id:"2",icon:n}]},{avatar:U,name:"Barbara Steele",post:"Adminpro admin",status:"cancel",statuscolor:"lightError",users:[{id:"1",icon:n},{id:"2",icon:d},{id:"3",icon:j}]},{avatar:n,name:"Leonard Gordon",post:"Monster admin",status:"active",statuscolor:"lightPrimary",users:[{id:"1",icon:d},{id:"2",icon:n}]},{avatar:n,name:"Evelyn Pope",post:"matdashpro admin",status:"pending",statuscolor:"lightSuccess",users:[{id:"1",icon:n},{id:"2",icon:d},{id:"3",icon:j}]},{avatar:v,name:"Tommy Garza",post:"Elegant admin",status:"cancel",statuscolor:"lightError",users:[{id:"1",icon:E},{id:"2",icon:v}]},{avatar:V,name:"Isabel Vasquez",post:"Modernize admin",status:"pending",statuscolor:"lightPrimary",users:[{id:"1",icon:B},{id:"2",icon:d}]}],J={active:"lightPrimary",cancel:"lightError",pending:"lightSuccess",default:"default"},g=y(),G=[g.accessor("avatar",{cell:s=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx("img",{src:s.getValue()||"/path/to/default-avatar.jpg",width:50,height:50,alt:"avatar",className:"h-10 w-10 rounded-full"}),e.jsx("div",{className:"truncate line-clamp-2 sm:max-w-56",children:e.jsx("h6",{className:"text-base",children:s.row.original.n
2ame})})]}),header:()=>e.jsx("span",{children:"User"})}),g.accessor("post",{header:()=>e.jsx("span",{children:"Project Name"}),cell:s=>e.jsx("p",{className:"text-darklink dark:text-bodytext text-base",children:s.getValue()})}),g.accessor("users",{header:()=>e.jsx("span",{children:"Users"}),cell:s=>e.jsx("div",{className:"flex",children:s.getValue().map(r=>e.jsx("div",{className:"-ms-2",children:e.jsx("img",{src:r.icon||j,width:50,height:50,className:"border-2 border-white dark:border-darkborder rounded-full h-10 w-10 max-w-none",alt:"user icon"})},r.id))})}),g.accessor("status",{header:()=>e.jsx("span",{children:"Status"}),cell:s=>e.jsx(C,{variant:J[s.getValue()]||"default",className:"capitalize",children:s.getValue()})}),g.accessor("actions",{header:()=>e.jsx("span",{}),cell:()=>e.jsxs(R,{children:[e.jsx(P,{asChild:!0,children:e.jsx("span",{className:"h-9 w-9 flex justify-center items-center rounded-full hover:bg-lightprimary hover:text-primary cursor-pointer",children:e.jsx(A,{size:22})})}),e.jsx(T,{align:"end",className:"w-40",children:[{icon:"solar:add-circle-outline",listtitle:"Add"},{icon:"solar:pen-new-square-broken",listtitle:"Edit"},{icon:"solar:trash-bin-minimalistic-outline",listtitle:"Delete"}].map((s,r)=>e.jsxs(M,{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx(k,{icon:s.icon,height:18}),e.jsx("span",{children:s.listtitle})]},r))})]})})],Y=()=>{const[s]=w.useState(()=>[...q]),r=f({data:s,columns:G,getCoreRowModel:N()}),i=()=>{const a=["Name","post","status","users"],t=s.map(o=>[o.name,o.post,o.status,o.users.map(h=>h.id).join(", ")]),m=[a.join(","),...t.map(o=>o.join(","))].join(` 3`),u=new Blob([m],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(u),l=document.createElement("a");l.href=p,l.setAttribute("download","table-data.csv"),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return e.jsx(D,{title:"Striped Row Table",onDownload:i,children:e.jsx("div",{className:"border rounded-md border-ld overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full",children:[e.jsx("thead",{children:r.getHeaderGroups().map(a=>e.jsx("tr",{children:a.headers.map(t=>e.jsx("th",{className:"text-base text-ld font-semibold text-left border-b border-ld px-4 py-3",children:t.isPlaceholder?null:c(t.column.columnDef.header,t.getContext())},t.id))},a.id))}),e.jsx("tbody",{className:"divide-y divide-border dark:divide-darkborder",children:r.getRowModel().rows.map(a=>e.jsx("tr",{className:"odd:bg-transparent even:bg-lightprimary dark:even:bg-lightprimary",children:a.getVisibleCells().map(t=>e.jsx("td",{className:"whitespace-nowrap py-3 px-4",children:c(t.column.columnDef.cell,t.getContext())},t.id))},a.id))})]})})})})},K=[{avatar:$,name:"Top Authors",handle:"Successful Fellas",users:"4300 Users",courses:[{status:"Angular",statuscolor:"lightError"},{status:"PHP",statuscolor:"lightPrimary"}]},{avatar:z,name:"Popular Authors",handle:"Most Successful",users:"1200 Users",courses:[{status:"Bootstrap",statuscolor:"lightPrimary"}]},{avatar:I,name:"New Users",handle:"Awesome Users",users:"2000 Users",courses:[{status:"Reactjs",statuscolor:"lightSuccess"},{status:"Angular",statuscolor:"lightError"}]},{avatar:L,name:"Active Customers",handle:"Best Customers",users:"1500 Users",courses:[{status:"Bootstrap",statuscolor:"lightPrimary"}]},{avatar:F,name:"Bestseller Theme",handle:"Amazing Templates",users:"9500 Users",courses:[{status:"Angular",statuscolor:"lightError"},{status:"Reactjs",statuscolor:"lightSuccess"}]}],b=y(),Q=[b.accessor("avatar",{cell:s=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx("img",{src:s.getValue(),width:50,height:50,alt:"icon",className:"h-10 w-10 rounded-md"}),e.jsxs("div",{className:"truncate line-clamp-2 max-w-56",children:[e.jsx("h6",{className:"text-base",children:s.row.original.name}),e.jsx("p",{className:"text-sm ",children:s.row.original.handle})]})]}),header:()=>e.jsx("span",{children:"Authors"})}),b.accessor("courses",{cell:s=>e.jsx("div",{className:"flex gap-2",children:s.getValue().map((r,i)=>e.jsx(C,{variant:r.statuscolor,className:"capitalize",children:r.status},i))}),header:()=>e.jsx("span",{children:"Courses"})}),b.accessor("users",{cell:s=>e.jsx("p",{className:"text-sm",children:s.getValue()}),header:()=>e.jsx("span",{children:"Users"})}),b.accessor("actions",{cell:()=>e.jsxs(R,{children:[e.jsx(P,{asChild:!0,children:e.jsx("span",{className:"h-9 w-9 flex justify-center items-center rounded-full hover:bg-lightprimary hover:text-primary curs
3or-pointer",children:e.jsx(A,{size:22})})}),e.jsx(T,{align:"end",className:"w-40",children:[{icon:"solar:add-circle-outline",listtitle:"Add"},{icon:"solar:pen-new-square-broken",listtitle:"Edit"},{icon:"solar:trash-bin-minimalistic-outline",listtitle:"Delete"}].map((s,r)=>e.jsxs(M,{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx(k,{icon:s.icon,height:18}),e.jsx("span",{children:s.listtitle})]},r))})]}),header:()=>e.jsx("span",{})})];function Z(){const[s]=w.useState(()=>[...K]),r=f({data:s,columns:Q,getCoreRowModel:N()}),i=()=>{const a=["Name","Handle","Users","Courses"],t=s.map(o=>[o.name,o.handle,o.users,o.courses.map(h=>h.status).join(", ")]),m=[a.join(","),...t.map(o=>o.join(","))].join(` 4`),u=new Blob([m],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(u),l=document.createElement("a");l.href=p,l.setAttribute("download","table-data.csv"),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return e.jsx(e.Fragment,{children:e.jsx(D,{title:"Basic Table",onDownload:i,children:e.jsx("div",{className:"border rounded-md border-ld overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full",children:[e.jsx("thead",{children:r.getHeaderGroups().map(a=>e.jsx("tr",{children:a.headers.map(t=>e.jsx("th",{className:"text-base text-ld font-semibold text-left border-b border-ld px-4 py-3",children:t.isPlaceholder?null:c(t.column.columnDef.header,t.getContext())},t.id))},a.id))}),e.jsx("tbody",{className:"divide-y divide-border dark:divide-darkborder",children:r.getRowModel().rows.map(a=>e.jsx("tr",{children:a.getVisibleCells().map(t=>e.jsx("td",{className:"whitespace-nowrap py-3 px-4",children:c(t.column.columnDef.cell,t.getContext())},t.id))},a.id))})]})})})})})}const _=[{to:"/",title:"Home"},{to:"",title:"React Tables"}];function qe(){return e.jsxs(e.Fragment,{children:[e.jsx(H,{title:"Basic Tables List",items:_}),e.jsxs("div",{className:"grid grid-cols-12 gap-7",children:[e.jsx("div",{className:"col-span-12",children:e.jsx(Z,{})}),e.jsx("div",{className:"col-span-12",children:e.jsx(Y,{})}),e.jsx("div",{className:"col-span-12",children:e.jsx(X,{})})]})]})}export{qe as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.