@jamsrui/data-grid 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-grid-body.mjs +1 -1
- package/dist/data-grid-column-visibility.mjs +1 -1
- package/dist/data-grid-config.mjs +1 -1
- package/dist/data-grid-context.mjs +1 -1
- package/dist/data-grid-empty.mjs +1 -1
- package/dist/data-grid-header.mjs +1 -1
- package/dist/data-grid-loading.mjs +1 -1
- package/dist/data-grid-pagination.mjs +1 -1
- package/dist/data-grid-row-select.mjs +1 -1
- package/dist/data-grid-table.mjs +1 -1
- package/dist/data-grid.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/use-data-grid.d.mts +1 -1
- package/dist/use-data-grid.mjs +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +15 -14
- package/dist/chunk-2T3XPDLU.mjs +0 -1
- package/dist/chunk-AEU4XHNY.mjs +0 -1
- package/dist/chunk-AZT7GSYJ.mjs +0 -1
- package/dist/chunk-C5POVXMG.mjs +0 -1
- package/dist/chunk-CCUO624J.mjs +0 -1
- package/dist/chunk-HCDVDP56.mjs +0 -1
- package/dist/chunk-IEMKYLNI.mjs +0 -1
- package/dist/chunk-MCE7DXVJ.mjs +0 -1
- package/dist/chunk-MDBTVFQY.mjs +0 -1
- package/dist/chunk-OFHYDD43.mjs +0 -1
- package/dist/chunk-PE4TM6CB.mjs +0 -1
- package/dist/chunk-ROT3HK7K.mjs +0 -1
- package/dist/chunk-WWXQKSAV.mjs +0 -1
package/dist/data-grid-body.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs as y}from"react/jsx-runtime";import{TableBody as i,TableCell as n,TableRow as m}from"@jamsrui/table";import{flexRender as d}from"@tanstack/react-table";import{useDataGridContext as l}from"./data-grid-context.mjs";import{DataGridEmpty as p}from"./data-grid-empty.mjs";import{getPinningStyles as s}from"./utils.mjs";const w=()=>{const{table:r,isEmpty:a}=l();return y(i,{children:[!!a&&e(p,{}),r.getRowModel().rows.map(o=>e(m,{children:o.getVisibleCells().map(t=>e(n,{"data-pinned":t.column.getIsPinned()||void 0,style:{width:t.column.getSize(),...s(t.column)},children:d(t.column.columnDef.cell,t.getContext())},t.id))},o.id))]})};export{w as DataGridBody};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as t,jsxs as n}from"react/jsx-runtime";import{Button as l}from"@jamsrui/button";import{useRenderElement as p}from"@jamsrui/hooks";import{Settings2Icon as d}from"@jamsrui/icons";import{AnimatedTickIcon as u}from"@jamsrui/icons/animated";import{Menu as r,MenuItem as c}from"@jamsrui/menu";import{useDataGridContext as f}from"./data-grid-context.mjs";const M=s=>{const{table:m}=f(),a=n(r,{children:[t(r.Trigger,{children:n(l,{size:"sm",variant:"flat",children:[t(d,{}),"Column Visibility"]})}),t(r.Content,{children:m.getAllLeafColumns().map(e=>{const i=e.columnDef.header,o=typeof i=="function"?i({}):i;return n(c,{preventCloseOnClick:!0,disabled:!e.getCanHide(),onClick:e.getToggleVisibilityHandler(),textValue:o,children:[t(u,{className:"text-primary",isSelected:e.getIsVisible()}),o]},e.id)})})]});return p("div",{props:[s,{children:a}]})};export{M as DataGridColumnVisibility};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{createConfigContext as a}from"@jamsrui/utils";const[r,e]=a({displayName:"DataGridConfig"});export{r as DataGridConfig,e as useDataGridConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/data-grid-empty.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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.mjs";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 +1 @@
|
|
|
1
|
-
import{a}from"
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{IconButton as u}from"@jamsrui/icon-button";import{ArrowDownIcon as r,ArrowLeftToLineIcon as m,ArrowRightToLineIcon as d,ArrowUpIcon as l,ChevronsUpDownIcon as p,EllipsisVerticalIcon as g,EyeClosedIcon as f}from"@jamsrui/icons";import{Menu as o}from"@jamsrui/menu";import{TableColumn as I,TableHeader as C,TableRow as R}from"@jamsrui/table";import{cn as s}from"@jamsrui/utils";import{flexRender as b}from"@tanstack/react-table";import{useDataGridContext as S}from"./data-grid-context.mjs";import{getPinningStyles as w}from"./utils.mjs";const v=({column:t})=>a(o,{children:[e(o.Trigger,{children:e(u,{label:"More",size:"sm",variant:"light",children:e(g,{className:"size-4"})})}),a(o.Content,{children:[e(o.Group,{children:a(o.RadioGroup,{value:t.getIsSorted()||"",children:[a(o.RadioItem,{disabled:!t.getCanSort(),preventCloseOnClick:!1,value:"asc",onClick:()=>{t.getIsSorted()==="asc"?t.clearSorting():t.toggleSorting(!1)},textValue:"Asc",children:[e(l,{}),"Asc",e(o.ItemIndicator,{className:"ml-auto"})]}),a(o.RadioItem,{disabled:!t.getCanSort(),preventCloseOnClick:!1,value:"desc",onClick:()=>{t.getIsSorted()==="desc"?t.clearSorting():t.toggleSorting(!0)},textValue:"Desc",children:[e(r,{}),"Desc",e(o.ItemIndicator,{className:"ml-auto"})]})]})}),e(o.Separator,{}),a(o.Item,{disabled:!t.getCanHide(),onClick:t.getToggleVisibilityHandler(),textValue:"Hide Column",children:[e(f,{}),"Hide Column"]}),e(o.Separator,{}),e(o.Group,{children:a(o.RadioGroup,{value:t.getIsPinned()||"",children:[a(o.RadioItem,{preventCloseOnClick:!1,value:"left",onClick:()=>{t.pin(t.getIsPinned()==="left"?!1:"left")},textValue:"Pin To Left",children:[e(m,{}),"Pin To Left",e(o.ItemIndicator,{className:"ml-auto"})]}),a(o.RadioItem,{preventCloseOnClick:!1,value:"right",onClick:()=>t.pin(t.getIsPinned()==="right"?!1:"right"),textValue:"Pin To Right",children:[e(d,{}),"Pin To Right",e(o.ItemIndicator,{className:"ml-auto"})]})]})})]})]}),N=()=>{const{table:t}=S(),c=t.getHeaderGroups();return e(C,{children:c.map(i=>e(R,{children:i.headers.map(n=>e(I,{className:"relative",colSpan:n.colSpan,"data-pinned":n.column.getIsPinned()||void 0,style:{width:n.getSize(),...w(n.column)},children:n.isPlaceholder?null:a("div",{className:"flex",children:[e("button",{onClick:n.column.getToggleSortingHandler(),type:"button",className:s("flex w-full cursor-pointer select-none gap-1 overflow-hidden pr-1 text-transform-inherit",{"":n.column.getCanSort()}),children:a("span",{className:"flex w-full grow items-center overflow-hidden font-medium",children:[b(n.column.columnDef.header,n.getContext()),{asc:e(l,{className:"size-3 shrink-0"}),desc:e(r,{className:"size-3 shrink-0"}),empty:e(p,{className:"size-3 shrink-0"})}[n.column.getIsSorted()||"empty"]]})}),e(v,{column:n.column}),e("span",{"aria-label":"resize",onDoubleClick:()=>n.column.resetSize(),onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler(),role:"presentation",className:s("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))},i.id))})};export{N as DataGridHeader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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 +1 @@
|
|
|
1
|
-
import{a}from"
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useState as P}from"react";import{IconButton as s}from"@jamsrui/icon-button";import{ChevronDoubleLeftIcon as v,ChevronDoubleRightIcon as h,ChevronLeftIcon as x,ChevronRightIcon as C}from"@jamsrui/icons";import{Select as o}from"@jamsrui/select";import{Label as b}from"@jamsrui/label";import{useDataGridContext as I}from"./data-grid-context.mjs";const D=()=>{const{table:t,isEmpty:l}=I(),[r,g]=P(["10"]),c=()=>{t.nextPage()},m=()=>{t.previousPage()},u=()=>{t.setPageIndex(0)},d=()=>{t.setPageIndex(t.getPageCount()-1)},i=t.getPageCount(),p=i?t.getState().pagination.pageIndex+1:0,f=n=>{t.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:[a(o,{onValueChange:f,returnFocus:!1,size:"sm",value:r,className:"flex flex-row items-center gap-2",children:[e(b,{children:"Rows Per Page:"}),e(o.Trigger,{}),e(o.Popover,{children:e(o.Content,{children:[10,20,50,100,500].map(n=>e(o.Item,{value:n.toString(),textValue: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 ",i]}),a("div",{className:"flex items-center",children:[a(s,{disabled:!t.getCanPreviousPage(),label:"First Page",onClick:u,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to first page"}),e(v,{height:20,width:20})]}),a(s,{disabled:!t.getCanPreviousPage(),label:"Previous Page",onClick:m,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(x,{height:20,width:20})]}),a(s,{disabled:!t.getCanNextPage(),label:"Next Page",onClick:c,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to next page"}),e(C,{height:20,width:20})]}),a(s,{disabled:!t.getCanNextPage(),label:"Last Page",onClick:d,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to last page"}),e(h,{height:20,width:20})]})]})]})]})};export{D as DataGridPagination};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{Checkbox as t}from"@jamsrui/checkbox";import{useDataGridContext as a}from"./data-grid-context.mjs";const n=({row:e})=>o(t,{"aria-label":"Select Row",isChecked:e.getIsSelected(),onCheckedChange:l=>e.toggleSelected(l),children:o(t.Control,{})}),s=()=>{const{table:e}=a();return o(t,{"aria-label":"Select All Rows",isChecked:e.getIsAllPageRowsSelected(),isIntermediate:e.getIsSomePageRowsSelected(),onCheckedChange:l=>e.toggleAllPageRowsSelected(l),children:o(t.Control,{})})};export{n as DataGridRowSelect,s as DataGridRowSelectAll};
|
package/dist/data-grid-table.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{Table as t}from"@jamsrui/table";import{useDataGridContext as o}from"./data-grid-context.mjs";const p=e=>{const{children:a}=e,{rootProps:r}=o();return l(t,{className:"w-full table-fixed",...r,children:a})};export{p as DataGridTable};
|
package/dist/data-grid.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"
|
|
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.mjs";import{DataGridColumnVisibility as f}from"./data-grid-column-visibility.mjs";import{useDataGridConfig as l}from"./data-grid-config.mjs";import{DataGridContext as D}from"./data-grid-context.mjs";import{DataGridHeader as G}from"./data-grid-header.mjs";import{DataGridLoading as c}from"./data-grid-loading.mjs";import{DataGridPagination as g}from"./data-grid-pagination.mjs";import{DataGridTable as x}from"./data-grid-table.mjs";import{useDataGrid as u}from"./use-data-grid.mjs";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};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{DataGrid as a}from"./data-grid.mjs";import{DataGridConfig as o,useDataGridConfig as i}from"./data-grid-config.mjs";import{DataGridRowSelect as f,DataGridRowSelectAll as l}from"./data-grid-row-select.mjs";export{a as DataGrid,o as DataGridConfig,f as DataGridRowSelect,l as DataGridRowSelectAll,i as useDataGridConfig};
|
package/dist/use-data-grid.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ declare const useDataGrid: <TData>(props: useDataGrid.Props<TData>) => {
|
|
|
9
9
|
rootProps: {
|
|
10
10
|
isHeaderSticky: boolean | undefined;
|
|
11
11
|
variant: "bordered" | "solid" | undefined;
|
|
12
|
-
radius: "
|
|
12
|
+
radius: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "none" | undefined;
|
|
13
13
|
density: "compact" | "standard" | "comfortable" | undefined;
|
|
14
14
|
allowHover: boolean | undefined;
|
|
15
15
|
separateRows: boolean | undefined;
|
package/dist/use-data-grid.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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";const I=S=>{const{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 useDataGrid};
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function i(t){const 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 getPinningStyles};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/data-grid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@tanstack/react-table": ">=8",
|
|
6
6
|
"react": ">=19"
|
|
@@ -10,19 +10,20 @@
|
|
|
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/
|
|
14
|
-
"@jamsrui/
|
|
15
|
-
"@jamsrui/
|
|
16
|
-
"@jamsrui/
|
|
17
|
-
"@jamsrui/
|
|
18
|
-
"@jamsrui/
|
|
19
|
-
"@jamsrui/
|
|
20
|
-
"@jamsrui/
|
|
21
|
-
"@jamsrui/
|
|
22
|
-
"@jamsrui/
|
|
23
|
-
"@jamsrui/
|
|
24
|
-
"@jamsrui/
|
|
25
|
-
"@jamsrui/
|
|
13
|
+
"@jamsrui/button": "^0.0.14",
|
|
14
|
+
"@jamsrui/checkbox": "^0.0.14",
|
|
15
|
+
"@jamsrui/divider": "^0.0.14",
|
|
16
|
+
"@jamsrui/core": "^0.0.12",
|
|
17
|
+
"@jamsrui/hooks": "^0.0.14",
|
|
18
|
+
"@jamsrui/icon-button": "^0.0.14",
|
|
19
|
+
"@jamsrui/icons": "^0.0.12",
|
|
20
|
+
"@jamsrui/input": "^0.0.15",
|
|
21
|
+
"@jamsrui/linear-progress": "^0.0.14",
|
|
22
|
+
"@jamsrui/menu": "^0.0.14",
|
|
23
|
+
"@jamsrui/table": "^0.0.14",
|
|
24
|
+
"@jamsrui/select": "^0.0.14",
|
|
25
|
+
"@jamsrui/label": "^0.0.7",
|
|
26
|
+
"@jamsrui/utils": "^0.0.14"
|
|
26
27
|
},
|
|
27
28
|
"exports": {
|
|
28
29
|
".": {
|
package/dist/chunk-2T3XPDLU.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-AEU4XHNY.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-AZT7GSYJ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-C5POVXMG.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-CCUO624J.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-HCDVDP56.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-IEMKYLNI.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-MCE7DXVJ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-MDBTVFQY.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-OFHYDD43.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createConfigContext as a}from"@jamsrui/utils";var[r,e]=a({displayName:"DataGridConfig"});export{r as a,e as b};
|
package/dist/chunk-PE4TM6CB.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-ROT3HK7K.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-WWXQKSAV.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|