@jamsrui/data-grid 0.0.8 → 0.0.10

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
+ import{b as t}from"./chunk-MDBTVFQY.mjs";import{TableCell as l,TableRow as r}from"@jamsrui/table";import{jsx as a}from"react/jsx-runtime";var m=()=>{let{table:o}=t(),e=o.getAllColumns().length;return a(r,{children:a(l,{colSpan:e,children:"No data available"})})};export{m as a};
@@ -0,0 +1 @@
1
+ import{b as i}from"./chunk-MDBTVFQY.mjs";import{useState as P}from"react";import{IconButton as o}from"@jamsrui/icon-button";import{ChevronDoubleLeftIcon as h,ChevronDoubleRightIcon as v,ChevronLeftIcon as x,ChevronRightIcon as C}from"@jamsrui/icons";import{Select as b,SelectItem as I}from"@jamsrui/select";import{jsx as t,jsxs as a}from"react/jsx-runtime";var G=()=>{let{table:e,isEmpty:l}=i(),[r,g]=P(["10"]),c=()=>{e.nextPage()},m=()=>{e.previousPage()},u=()=>{e.setPageIndex(0)},d=()=>{e.setPageIndex(e.getPageCount()-1)},s=e.getPageCount(),p=s?e.getState().pagination.pageIndex+1:0,f=n=>{e.setPageSize(Number(Array.from(n)[0]??[10])),g(n)};return l?null:a("div",{className:"flex flex-col w-full justify-between gap-4 md:flex-row md:items-center","data-slot":"pagination",children:[t(b,{label:"Rows Per Page:",onValueChange:f,returnFocus:!1,size:"sm",value:r,classNames:{root:"items-center flex max-w-[80px] flex-row gap-2",label:"shrink-0"},children:[10,20,50,100,500].map(n=>t(I,{value:n.toString(),children:n.toString()},n.toString()))}),a("div",{className:"flex gap-1 md:gap-4",children:[a("div",{className:"flex items-center justify-center text-sm font-medium",children:["Page ",p," of ",s]}),a("div",{className:"flex items-center",children:[a(o,{isDisabled:!e.getCanPreviousPage(),label:"First Page",onClick:u,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to first page"}),t(h,{height:20,width:20})]}),a(o,{isDisabled:!e.getCanPreviousPage(),label:"Previous Page",onClick:m,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to previous page"}),t(x,{height:20,width:20})]}),a(o,{isDisabled:!e.getCanNextPage(),label:"Next Page",onClick:c,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to next page"}),t(C,{height:20,width:20})]}),a(o,{isDisabled:!e.getCanNextPage(),label:"Last Page",onClick:d,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to last page"}),t(v,{height:20,width:20})]})]})]})]})};export{G as a};
@@ -0,0 +1 @@
1
+ import{b as o}from"./chunk-MDBTVFQY.mjs";import{Checkbox as l}from"@jamsrui/checkbox";import{jsx as a}from"react/jsx-runtime";var s=({row:e})=>a(l,{"aria-label":"Select Row",isChecked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(t)}),d=()=>{let{table:e}=o();return a(l,{"aria-label":"Select All Rows",isChecked:e.getIsAllPageRowsSelected(),isIntermediate:e.getIsSomePageRowsSelected(),onCheckedChange:t=>e.toggleAllPageRowsSelected(t)})};export{s as a,d as b};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-CCUO624J.mjs";import{b as a}from"./chunk-MDBTVFQY.mjs";import{IconButton as f}from"@jamsrui/icon-button";import{ArrowDownIcon as d,ArrowLeftToLineIcon as C,ArrowRightToLineIcon as I,ArrowUpIcon as g,ChevronsUpDownIcon as b,EllipsisVerticalIcon as M,EyeClosedIcon as k}from"@jamsrui/icons";import{Menu as v,MenuContent as w,MenuGroup as l,MenuItem as S,MenuRadioGroup as c,MenuRadioItem as i,MenuSeparator as u,MenuTrigger as R}from"@jamsrui/menu";import{TableColumn as y,TableHeader as T,TableRow as z}from"@jamsrui/table";import{cn as p}from"@jamsrui/utils";import{flexRender as D}from"@tanstack/react-table";import{jsx as e,jsxs as o}from"react/jsx-runtime";var P=({column:t})=>o(v,{classNames:{content:"border border-divider"},children:[e(R,{children:e(f,{label:"More",size:"xs",variant:"light",children:e(M,{className:"size-4"})})}),o(w,{children:[e(l,{children:o(c,{value:t.getIsSorted()||"",children:[e(i,{isDisabled:!t.getCanSort(),preventCloseOnClick:!1,startContent:e(g,{}),tickPlacement:"end",value:"asc",onClick:()=>{t.getIsSorted()==="asc"?t.clearSorting():t.toggleSorting(!1)},children:"Asc"}),e(i,{isDisabled:!t.getCanSort(),preventCloseOnClick:!1,startContent:e(d,{}),tickPlacement:"end",value:"desc",onClick:()=>{t.getIsSorted()==="desc"?t.clearSorting():t.toggleSorting(!0)},children:"Desc"})]})}),e(u,{}),e(S,{isDisabled:!t.getCanHide(),onClick:t.getToggleVisibilityHandler(),startContent:e(k,{}),children:"Hide Column"}),e(u,{}),e(l,{children:o(c,{value:t.getIsPinned()||"",children:[e(i,{preventCloseOnClick:!1,startContent:e(C,{}),tickPlacement:"end",value:"left",onClick:()=>{t.pin(t.getIsPinned()==="left"?!1:"left")},children:"Pin To Left"}),e(i,{preventCloseOnClick:!1,startContent:e(I,{}),tickPlacement:"end",value:"right",onClick:()=>t.pin(t.getIsPinned()==="right"?!1:"right"),children:"Pin To Right"})]})})]})]}),B=()=>{let{table:t}=a(),m=t.getHeaderGroups();return e(T,{children:m.map(r=>e(z,{children:r.headers.map(n=>e(y,{className:"relative",colSpan:n.colSpan,"data-pinned":n.column.getIsPinned()||void 0,style:{width:n.getSize(),...s(n.column)},children:n.isPlaceholder?null:o("div",{className:"flex",children:[e("button",{onClick:n.column.getToggleSortingHandler(),type:"button",className:p("flex w-full cursor-pointer select-none gap-1 overflow-hidden pr-1 text-transform-inherit",{"":n.column.getCanSort()}),children:o("span",{className:"flex w-full grow items-center overflow-hidden font-medium",children:[D(n.column.columnDef.header,n.getContext()),{asc:e(g,{className:"size-3 shrink-0"}),desc:e(d,{className:"size-3 shrink-0"}),empty:e(b,{className:"size-3 shrink-0"})}[n.column.getIsSorted()||"empty"]]})}),e(P,{column:n.column}),e("span",{"aria-label":"resize",onDoubleClick:()=>n.column.resetSize(),onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler(),role:"presentation",className:p("absolute right-0 top-1/2 h-3/5 w-[2px] -translate-y-1/2 cursor-ew-resize bg-slate-300/30 opacity-0 transition-all duration-500 group-hover/table:opacity-100 select-none touch-none",{"isResizing cursor-ew-resize":n.column.getIsResizing()})})]})},n.id))},r.id))})};export{B as a};
@@ -0,0 +1 @@
1
+ function i(t){let e=t.getIsPinned();return{left:e==="left"?`${t.getStart("left")}px`:void 0,right:e==="right"?`${t.getAfter("right")}px`:void 0,position:e?"sticky":"relative",width:t.getSize(),zIndex:e?1:0}}export{i as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-MDBTVFQY.mjs";import{Table as o}from"@jamsrui/table";import{jsx as l}from"react/jsx-runtime";var p=a=>{let{children:r}=a,{rootProps:t}=e();return l(o,{className:"w-full table-fixed",...t,children:r})};export{p as a};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-HCDVDP56.mjs";import{a as f}from"./chunk-WWXQKSAV.mjs";import{a as i}from"./chunk-ROT3HK7K.mjs";import{a as e}from"./chunk-PE4TM6CB.mjs";import{b as d}from"./chunk-OFHYDD43.mjs";import{a as m}from"./chunk-C5POVXMG.mjs";import{a as n}from"./chunk-MCE7DXVJ.mjs";import{a as p}from"./chunk-AEU4XHNY.mjs";import{a}from"./chunk-MDBTVFQY.mjs";import{useRenderElement as x}from"@jamsrui/hooks";import{mergeConfigProps as u}from"@jamsrui/utils";import{Fragment as C,jsx as r,jsxs as l}from"react/jsx-runtime";var R=D=>{let o=d(),G=u(o,o,D),t=f(G),c=l(C,{children:[r(e,{}),!!t.isLoading&&r(n,{}),l(s,{children:[r(m,{}),r(i,{})]}),r(p,{})]}),g=x("div",{props:[{"data-component":"data-grid","data-slot":"root",className:"relative flex flex-col gap-2"},{children:c}]});return r(a,{value:t,children:g})};export{R as a};
@@ -0,0 +1 @@
1
+ import{LinearProgress as r}from"@jamsrui/linear-progress";import{jsx as o}from"react/jsx-runtime";var t=a=>o(r,{className:"absolute inset-0",...a});export{t as a};
@@ -0,0 +1 @@
1
+ import{createContext as e,use as r}from"react";var a=e(null),n=()=>{let t=r(a);if(!t)throw new Error("useDataGridContext must be used within a DataGridContext");return t};export{a,n as b};
@@ -0,0 +1 @@
1
+ import{createConfigContext as a}from"@jamsrui/utils";var[r,e]=a({displayName:"DataGridConfig"});export{r as a,e as b};
@@ -0,0 +1 @@
1
+ import{b as n}from"./chunk-MDBTVFQY.mjs";import{Button as m}from"@jamsrui/button";import{useRenderElement as l}from"@jamsrui/hooks";import{Settings2Icon as p}from"@jamsrui/icons";import{AnimatedTickIcon as d}from"@jamsrui/icons/animated";import{Menu as u,MenuContent as C,MenuItem as c,MenuTrigger as f}from"@jamsrui/menu";import{Fragment as y,jsx as e,jsxs as g}from"react/jsx-runtime";var k=r=>{let{table:o}=n(),s=e(y,{children:g(u,{children:[e(f,{children:e(m,{size:"sm",startContent:e(p,{}),variant:"flat",children:"Column Visibility"})}),e(C,{children:o.getAllLeafColumns().map(t=>{let i=t.columnDef.header,a=typeof i=="function"?i({}):i;return e(c,{preventCloseOnClick:!0,isDisabled:!t.getCanHide(),onClick:t.getToggleVisibilityHandler(),startContent:e(d,{className:"text-primary",isSelected:t.getIsVisible()}),children:a},t.id)})})]})});return l("div",{props:[r,{children:s}]})};export{k as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-2T3XPDLU.mjs";import{a as i}from"./chunk-CCUO624J.mjs";import{b as r}from"./chunk-MDBTVFQY.mjs";import{TableBody as d,TableCell as l,TableRow as p}from"@jamsrui/table";import{flexRender as s}from"@tanstack/react-table";import{jsx as e,jsxs as y}from"react/jsx-runtime";var w=()=>{let{table:n,isEmpty:m}=r();return y(d,{children:[!!m&&e(a,{}),n.getRowModel().rows.map(o=>e(p,{children:o.getVisibleCells().map(t=>e(l,{"data-pinned":t.column.getIsPinned()||void 0,style:{width:t.column.getSize(),...i(t.column)},children:s(t.column.columnDef.cell,t.getContext())},t.id))},o.id))]})};export{w as a};
@@ -0,0 +1 @@
1
+ import{useMemo as m,useState as t}from"react";import{getCoreRowModel as k,getExpandedRowModel as V,getFilteredRowModel as v,getPaginationRowModel as H,getSortedRowModel as z,useReactTable as E}from"@tanstack/react-table";var I=S=>{let{columns:u,data:e,state:p,isLoading:o,isHeaderSticky:n,variant:a,radius:i,density:s,allowHover:r,separateRows:l,...w}=S,[R,C]=t([]),[P,b]=t({pageSize:10,pageIndex:0}),[y,M]=t({}),[T,h]=t([]),[D,O]=t({}),[G,x]=t({bottom:[],top:[]}),[F,f]=t([]),d=e.length===0,g=E({columnResizeMode:"onChange",columnResizeDirection:"ltr",getCoreRowModel:k(),getPaginationRowModel:H(),getSortedRowModel:z(),getFilteredRowModel:v(),onSortingChange:C,onColumnFiltersChange:h,onColumnVisibilityChange:M,onRowSelectionChange:O,onPaginationChange:b,getExpandedRowModel:V(),onColumnOrderChange:f,onRowPinningChange:x,...w,state:{sorting:R,columnFilters:T,columnVisibility:y,rowSelection:D,pagination:P,columnOrder:F,...p},data:e,columns:u}),c=m(()=>({isHeaderSticky:n,variant:a,radius:i,density:s,allowHover:r,separateRows:l}),[r,s,n,i,l,a]);return m(()=>({table:g,isLoading:o,isEmpty:d,rootProps:c}),[d,o,c,g])};export{I as a};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as b}from"react/jsx-runtime";import{TableBody as l,TableCell as m,TableRow as i}from"@jamsrui/table";import{flexRender as p}from"@tanstack/react-table";import{useDataGridContext as d}from"./data-grid-context";import{DataGridEmpty as n}from"./data-grid-empty";const w=()=>{const{table:r,isEmtpy:a}=d();return b(l,{children:[!!a&&o(n,{}),r.getRowModel().rows.map(t=>o(i,{children:t.getVisibleCells().map(e=>o(m,{children:p(e.column.columnDef.cell,e.getContext())},e.id))},t.id))]})};export{w as DataGridBody};
1
+ import{a}from"./chunk-ROT3HK7K.mjs";import"./chunk-2T3XPDLU.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridBody};
@@ -1 +1 @@
1
- import{Fragment as b,jsx as i,jsxs as n}from"react/jsx-runtime";import{useRenderElement as p}from"@jamsrui/hooks";import{IconButton as a}from"@jamsrui/icon-button";import{InfoIcon as d}from"@jamsrui/icons";import{Menu as g,MenuContent as u,MenuItem as l,MenuTrigger as c}from"@jamsrui/menu";import{useDataGridContext as C}from"./data-grid-context";const M=r=>{const{table:t}=C(),s=i(b,{children:n(g,{children:[i(c,{children:i(a,{label:"Column Visibility",size:"sm",children:i(d,{})})}),n(u,{children:[n(l,{preventCloseOnClick:!0,onClick:t.getToggleAllColumnsVisibilityHandler(),children:[i("input",{type:"checkbox",checked:t.getIsAllColumnsVisible(),onChange:t.getToggleAllColumnsVisibilityHandler()})," ","Toggle All"]}),t.getAllLeafColumns().map(e=>{const o=e.columnDef.header,m=typeof o=="function"?o({}):o;return n(l,{preventCloseOnClick:!0,isDisabled:!e.getCanHide(),onClick:e.getToggleVisibilityHandler(),children:[i("input",{type:"checkbox",checked:e.getIsVisible(),onChange:e.getToggleVisibilityHandler()})," ",m]},e.id)})]})]})});return p("div",{props:[r,{children:s}]})};export{M as DataGridColumnVisibility};
1
+ import{a}from"./chunk-PE4TM6CB.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridColumnVisibility};
@@ -1,5 +1,5 @@
1
- import { DataGrid } from './data-grid.mjs';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { DataGrid } from './data-grid.mjs';
3
3
  import './use-data-grid.mjs';
4
4
  import '@tanstack/react-table';
5
5
  import '@jamsrui/table';
@@ -1 +1 @@
1
- import{createConfigContext as a}from"@jamsrui/utils";const[r,e]=a({displayName:"DataGridConfig"});export{r as DataGridConfig,e as useDataGridConfig};
1
+ import{a,b}from"./chunk-OFHYDD43.mjs";export{a as DataGridConfig,b as useDataGridConfig};
@@ -1 +1 @@
1
- import{createContext as e,use as r}from"react";const a=e(null),n=()=>{const t=r(a);if(!t)throw new Error("useDataGridContext must be used within a DataGridContext");return t};export{a as DataGridContext,n as useDataGridContext};
1
+ import{a,b}from"./chunk-MDBTVFQY.mjs";export{a as DataGridContext,b as useDataGridContext};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{TableCell as e,TableRow as l}from"@jamsrui/table";import{useDataGridContext as r}from"./data-grid-context";const m=()=>{const{table:a}=r(),o=a.getAllColumns().length;return t(l,{children:t(e,{colSpan:o,children:"No data available"})})};export{m as DataGridEmpty};
1
+ import{a}from"./chunk-2T3XPDLU.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridEmpty};
@@ -1 +1 @@
1
- import{Fragment as d,jsx as o,jsxs as n}from"react/jsx-runtime";import{ChevronDownIcon as l,ChevronUpIcon as i}from"@jamsrui/icons";import{TableColumn as c,TableHeader as m,TableRow as u}from"@jamsrui/table";import{cn as r}from"@jamsrui/utils";import{flexRender as p}from"@tanstack/react-table";import{useDataGridContext as g}from"./data-grid-context";const C=()=>{const{table:a}=g(),s=a.getHeaderGroups();return o(m,{children:s.map(t=>o(u,{children:t.headers.map(e=>o(c,{children:e.isPlaceholder?null:n(d,{children:[o("button",{onClick:e.column.getToggleSortingHandler(),type:"button",className:r("flex w-full cursor-pointer select-none gap-1 overflow-hidden pr-1 text-transform-inherit",{"":e.column.getCanSort()}),children:n("span",{className:"flex w-full grow items-center overflow-hidden font-medium",children:[p(e.column.columnDef.header,e.getContext()),{asc:o(i,{className:"size-4 shrink-0"}),desc:o(l,{className:"size-4 shrink-0"})}[e.column.getIsSorted()]??null]})}),o("span",{"aria-label":"resize",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),role:"presentation",className:r("absolute right-0 top-1/2 h-3/5 w-[2px] -translate-y-1/2 cursor-ew-resize bg-slate-300/30 opacity-0 transition-all duration-500 group-hover/table:opacity-100",{"isResizing cursor-ew-resize":e.column.getIsResizing()})})]})},e.id))},t.id))})};export{C as DataGridHeader};
1
+ import{a}from"./chunk-C5POVXMG.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridHeader};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{LinearProgress as r}from"@jamsrui/linear-progress";const t=a=>o(r,{className:"absolute inset-0",...a});export{t as DataGridLoading};
1
+ import{a}from"./chunk-MCE7DXVJ.mjs";export{a as DataGridLoading};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as f}from"react";import{IconButton as o}from"@jamsrui/icon-button";import{ChevronDoubleLeftIcon as P,ChevronDoubleRightIcon as h,ChevronLeftIcon as v,ChevronRightIcon as x}from"@jamsrui/icons";import{Select as C,SelectItem as b}from"@jamsrui/select";import{useDataGridContext as I}from"./data-grid-context";const G=()=>{const{table:e,isEmtpy:i}=I(),[l,r]=f(["10"]),g=()=>{e.nextPage()},c=()=>{e.previousPage()},m=()=>{e.setPageIndex(0)},u=()=>{e.setPageIndex(e.getPageCount()-1)},s=e.getPageCount(),d=s?e.getState().pagination.pageIndex+1:0,p=n=>{e.setPageSize(Number(Array.from(n)[0]??[10])),r(n)};return i?null:a("div",{className:"flex flex-col w-full justify-between gap-4 md:flex-row md:items-center","data-slot":"pagination",children:[t(C,{label:"Rows Per Page:",onValueChange:p,returnFocus:!1,size:"sm",value:l,classNames:{root:"items-center flex max-w-[80px] flex-row gap-2",label:"shrink-0"},children:[10,20,50,100,500].map(n=>t(b,{value:n.toString(),children:n.toString()},n.toString()))}),a("div",{className:"flex gap-1 md:gap-4",children:[a("div",{className:"flex items-center justify-center text-sm font-medium",children:["Page ",d," of ",s]}),a("div",{className:"flex items-center",children:[a(o,{isDisabled:!e.getCanPreviousPage(),label:"First Page",onClick:m,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to first page"}),t(P,{height:20,width:20})]}),a(o,{isDisabled:!e.getCanPreviousPage(),label:"Previous Page",onClick:c,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to previous page"}),t(v,{height:20,width:20})]}),a(o,{isDisabled:!e.getCanNextPage(),label:"Next Page",onClick:g,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to next page"}),t(x,{height:20,width:20})]}),a(o,{isDisabled:!e.getCanNextPage(),label:"Last Page",onClick:u,radius:"full",size:"sm",variant:"light",children:[t("span",{className:"sr-only",children:"Go to last page"}),t(h,{height:20,width:20})]})]})]})]})};export{G as DataGridPagination};
1
+ import{a}from"./chunk-AEU4XHNY.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridPagination};
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Row } from '@tanstack/react-table';
3
+
4
+ declare const DataGridRowSelect: ({ row }: {
5
+ row: Row<any>;
6
+ }) => react_jsx_runtime.JSX.Element;
7
+ declare const DataGridRowSelectAll: () => react_jsx_runtime.JSX.Element;
8
+
9
+ export { DataGridRowSelect, DataGridRowSelectAll };
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-AZT7GSYJ.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridRowSelect,b as DataGridRowSelectAll};
@@ -1 +1 @@
1
- import{jsx as p}from"react/jsx-runtime";import{Table as o}from"@jamsrui/table";import{useDataGridContext as t}from"./data-grid-context";const n=e=>{const{children:r}=e,{rootProps:a}=t();return p(o,{...a,children:r})};export{n as DataGridTable};
1
+ import{a}from"./chunk-HCDVDP56.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridTable};
@@ -1 +1 @@
1
- import{Fragment as C,jsx as r,jsxs as a}from"react/jsx-runtime";import{useRenderElement as n}from"@jamsrui/hooks";import{mergeConfigProps as p}from"@jamsrui/utils";import{DataGridBody as s}from"./data-grid-body";import{DataGridColumnVisibility as f}from"./data-grid-column-visibility";import{useDataGridConfig as l}from"./data-grid-config";import{DataGridContext as D}from"./data-grid-context";import{DataGridHeader as G}from"./data-grid-header";import{DataGridLoading as c}from"./data-grid-loading";import{DataGridPagination as g}from"./data-grid-pagination";import{DataGridTable as x}from"./data-grid-table";import{useDataGrid as u}from"./use-data-grid";const R=i=>{const o=l(),e=p(o,o,i),t=u(e),d=a(C,{children:[r(f,{}),!!t.isLoading&&r(c,{}),a(x,{children:[r(G,{}),r(s,{})]}),r(g,{})]}),m=n("div",{props:[{"data-component":"data-grid","data-slot":"root",className:"relative flex flex-col gap-2"},{children:d}]});return r(D,{value:t,children:m})};export{R as DataGrid};
1
+ import{a}from"./chunk-IEMKYLNI.mjs";import"./chunk-HCDVDP56.mjs";import"./chunk-WWXQKSAV.mjs";import"./chunk-ROT3HK7K.mjs";import"./chunk-PE4TM6CB.mjs";import"./chunk-OFHYDD43.mjs";import"./chunk-2T3XPDLU.mjs";import"./chunk-C5POVXMG.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MCE7DXVJ.mjs";import"./chunk-AEU4XHNY.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGrid};
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { DataGrid } from './data-grid.mjs';
2
2
  export { DataGridConfig, useDataGridConfig } from './data-grid-config.mjs';
3
+ export { DataGridRowSelect, DataGridRowSelectAll } from './data-grid-row-select.mjs';
3
4
  import 'react/jsx-runtime';
4
5
  import './use-data-grid.mjs';
5
6
  import '@tanstack/react-table';
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{DataGrid as i}from"./data-grid";import{DataGridConfig as t,useDataGridConfig as e}from"./data-grid-config";export{i as DataGrid,t as DataGridConfig,e as useDataGridConfig};
1
+ "use client";import{a,b as e}from"./chunk-AZT7GSYJ.mjs";import{a as o}from"./chunk-IEMKYLNI.mjs";import"./chunk-HCDVDP56.mjs";import"./chunk-WWXQKSAV.mjs";import"./chunk-ROT3HK7K.mjs";import"./chunk-PE4TM6CB.mjs";import{a as r,b as t}from"./chunk-OFHYDD43.mjs";import"./chunk-2T3XPDLU.mjs";import"./chunk-C5POVXMG.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MCE7DXVJ.mjs";import"./chunk-AEU4XHNY.mjs";import"./chunk-MDBTVFQY.mjs";export{o as DataGrid,r as DataGridConfig,a as DataGridRowSelect,e as DataGridRowSelectAll,t as useDataGridConfig};
@@ -5,10 +5,10 @@ import { Table } from '@jamsrui/table';
5
5
  declare const useDataGrid: <TData>(props: useDataGrid.Props<TData>) => {
6
6
  table: _tanstack_react_table.Table<TData>;
7
7
  isLoading: boolean | undefined;
8
- isEmtpy: boolean;
8
+ isEmpty: boolean;
9
9
  rootProps: {
10
10
  isHeaderSticky: boolean | undefined;
11
- variant: "solid" | "bordered" | undefined;
11
+ variant: "bordered" | "solid" | undefined;
12
12
  radius: "md" | "sm" | "lg" | "xl" | "2xl" | "3xl" | "full" | "none" | undefined;
13
13
  density: "compact" | "standard" | "comfortable" | undefined;
14
14
  allowHover: boolean | undefined;
@@ -1 +1 @@
1
- import{useMemo as m,useState as t}from"react";import{getCoreRowModel as k,getExpandedRowModel as V,getFilteredRowModel as v,getPaginationRowModel as H,getSortedRowModel as E,useReactTable as G}from"@tanstack/react-table";const I=S=>{const{columns:p,data:e,state:u,isLoading:o,isHeaderSticky:n,variant:a,radius:i,density:s,allowHover:r,separateRows:l,...w}=S,[R,C]=t([]),[P,b]=t({pageSize:10,pageIndex:0}),[y,M]=t({}),[T,h]=t([]),[O,D]=t({}),[z,x]=t({bottom:[],top:[]}),[F,f]=t([]),d=e.length===0,g=G({columnResizeMode:"onChange",getCoreRowModel:k(),getPaginationRowModel:H(),getSortedRowModel:E(),getFilteredRowModel:v(),onSortingChange:C,onColumnFiltersChange:h,onColumnVisibilityChange:M,onRowSelectionChange:D,onPaginationChange:b,getExpandedRowModel:V(),onColumnOrderChange:f,onRowPinningChange:x,...w,state:{sorting:R,columnFilters:T,columnVisibility:y,rowSelection:O,pagination:P,columnOrder:F,...u},data:e,columns:p}),c=m(()=>({isHeaderSticky:n,variant:a,radius:i,density:s,allowHover:r,separateRows:l}),[r,s,n,i,l,a]);return m(()=>({table:g,isLoading:o,isEmtpy:d,rootProps:c}),[d,o,c,g])};export{I as useDataGrid};
1
+ import{a}from"./chunk-WWXQKSAV.mjs";export{a as useDataGrid};
@@ -0,0 +1,5 @@
1
+ import { Column } from '@tanstack/react-table';
2
+
3
+ declare function getPinningStyles<TData>(column: Column<TData>): React.CSSProperties;
4
+
5
+ export { getPinningStyles };
package/dist/utils.mjs ADDED
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-CCUO624J.mjs";export{a as getPinningStyles};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamsrui/data-grid",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "peerDependencies": {
5
5
  "@tanstack/react-table": ">=8",
6
6
  "react": ">=19"
@@ -10,22 +10,24 @@
10
10
  "@dnd-kit/modifiers": "^9.0.0",
11
11
  "@dnd-kit/sortable": "^10.0.0",
12
12
  "@dnd-kit/utilities": "^3.2.2",
13
- "@jamsrui/hooks": "^0.0.8",
14
- "@jamsrui/core": "^0.0.7",
15
- "@jamsrui/icons": "^0.0.7",
16
- "@jamsrui/icon-button": "^0.0.8",
17
- "@jamsrui/linear-progress": "^0.0.8",
18
- "@jamsrui/input": "^0.0.8",
19
- "@jamsrui/utils": "^0.0.8",
20
- "@jamsrui/select": "^0.0.8",
21
- "@jamsrui/menu": "^0.0.8",
22
- "@jamsrui/table": "^0.0.8"
13
+ "@jamsrui/button": "^0.0.10",
14
+ "@jamsrui/core": "^0.0.9",
15
+ "@jamsrui/checkbox": "^0.0.10",
16
+ "@jamsrui/divider": "^0.0.10",
17
+ "@jamsrui/hooks": "^0.0.10",
18
+ "@jamsrui/icon-button": "^0.0.10",
19
+ "@jamsrui/linear-progress": "^0.0.10",
20
+ "@jamsrui/icons": "^0.0.9",
21
+ "@jamsrui/input": "^0.0.10",
22
+ "@jamsrui/table": "^0.0.10",
23
+ "@jamsrui/utils": "^0.0.10",
24
+ "@jamsrui/menu": "^0.0.10",
25
+ "@jamsrui/select": "^0.0.10"
23
26
  },
24
27
  "exports": {
25
28
  ".": {
26
29
  "types": "./dist/index.d.ts",
27
- "import": "./dist/index.mjs",
28
- "require": "./dist/index.js"
30
+ "import": "./dist/index.mjs"
29
31
  }
30
32
  },
31
33
  "description": "A modern and beautiful Next.js UI components library.",