@jamsrui/data-grid 0.0.13 → 0.0.14

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.
@@ -1 +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};
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-AW7NOWAF.mjs";import{b as d}from"./chunk-OFHYDD43.mjs";import{a as m}from"./chunk-WQ7NFOUK.mjs";import{a as n}from"./chunk-MCE7DXVJ.mjs";import{a as p}from"./chunk-LMGRMZB5.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{b as s}from"./chunk-MDBTVFQY.mjs";import{Button as p}from"@jamsrui/button";import{useRenderElement as d}from"@jamsrui/hooks";import{Settings2Icon as u}from"@jamsrui/icons";import{AnimatedTickIcon as c}from"@jamsrui/icons/animated";import{Menu as r,MenuItem as f}from"@jamsrui/menu";import{jsx as t,jsxs as n}from"react/jsx-runtime";var M=m=>{let{table:a}=s(),l=n(r,{children:[t(r.Trigger,{children:n(p,{size:"sm",variant:"flat",children:[t(u,{}),"Column Visibility"]})}),t(r.Content,{children:a.getAllLeafColumns().map(e=>{let i=e.columnDef.header,o=typeof i=="function"?i({}):i;return n(f,{preventCloseOnClick:!0,disabled:!e.getCanHide(),onClick:e.getToggleVisibilityHandler(),textValue:o,children:[t(c,{className:"text-primary",isSelected:e.getIsVisible()}),o]},e.id)})})]});return d("div",{props:[m,{children:l}]})};export{M as a};
@@ -0,0 +1 @@
1
+ import{b as a}from"./chunk-MDBTVFQY.mjs";import{Checkbox as t}from"@jamsrui/checkbox";import{jsx as o}from"react/jsx-runtime";var n=({row:e})=>o(t,{"aria-label":"Select Row",isChecked:e.getIsSelected(),onCheckedChange:l=>e.toggleSelected(l),children:o(t.Control,{})}),s=()=>{let{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 a,s as b};
@@ -0,0 +1 @@
1
+ import{b as l}from"./chunk-MDBTVFQY.mjs";import{useState as v}from"react";import{IconButton as s}from"@jamsrui/icon-button";import{ChevronDoubleLeftIcon as h,ChevronDoubleRightIcon as x,ChevronLeftIcon as C,ChevronRightIcon as b}from"@jamsrui/icons";import{Select as o}from"@jamsrui/select";import{Label as I}from"@jamsrui/label";import{jsx as e,jsxs as a}from"react/jsx-runtime";var D=()=>{let{table:t,isEmpty:r}=l(),[g,c]=v(["10"]),m=()=>{t.nextPage()},u=()=>{t.previousPage()},d=()=>{t.setPageIndex(0)},p=()=>{t.setPageIndex(t.getPageCount()-1)},i=t.getPageCount(),f=i?t.getState().pagination.pageIndex+1:0,P=n=>{t.setPageSize(Number(Array.from(n)[0]??[10])),c(n)};return r?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:P,returnFocus:!1,size:"sm",value:g,className:"flex flex-row items-center gap-2",children:[e(I,{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 ",f," of ",i]}),a("div",{className:"flex items-center",children:[a(s,{disabled:!t.getCanPreviousPage(),label:"First Page",onClick:d,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to first page"}),e(h,{height:20,width:20})]}),a(s,{disabled:!t.getCanPreviousPage(),label:"Previous Page",onClick:u,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(C,{height:20,width:20})]}),a(s,{disabled:!t.getCanNextPage(),label:"Next Page",onClick:m,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to next page"}),e(b,{height:20,width:20})]}),a(s,{disabled:!t.getCanNextPage(),label:"Last Page",onClick:p,radius:"full",size:"sm",variant:"light",children:[e("span",{className:"sr-only",children:"Go to last page"}),e(x,{height:20,width:20})]})]})]})]})};export{D as a};
@@ -0,0 +1 @@
1
+ import{a as l}from"./chunk-CCUO624J.mjs";import{b as r}from"./chunk-MDBTVFQY.mjs";import{IconButton as d}from"@jamsrui/icon-button";import{ArrowDownIcon as c,ArrowLeftToLineIcon as p,ArrowRightToLineIcon as g,ArrowUpIcon as u,ChevronsUpDownIcon as f,EllipsisVerticalIcon as I,EyeClosedIcon as C}from"@jamsrui/icons";import{Menu as o}from"@jamsrui/menu";import{TableColumn as R,TableHeader as b,TableRow as S}from"@jamsrui/table";import{cn as s}from"@jamsrui/utils";import{flexRender as w}from"@tanstack/react-table";import{jsx as e,jsxs as a}from"react/jsx-runtime";var v=({column:t})=>a(o,{children:[e(o.Trigger,{children:e(d,{label:"More",size:"sm",variant:"light",children:e(I,{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(u,{}),"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(c,{}),"Desc",e(o.ItemIndicator,{className:"ml-auto"})]})]})}),e(o.Separator,{}),a(o.Item,{disabled:!t.getCanHide(),onClick:t.getToggleVisibilityHandler(),textValue:"Hide Column",children:[e(C,{}),"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(p,{}),"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(g,{}),"Pin To Right",e(o.ItemIndicator,{className:"ml-auto"})]})]})})]})]}),N=()=>{let{table:t}=r(),m=t.getHeaderGroups();return e(b,{children:m.map(i=>e(S,{children:i.headers.map(n=>e(R,{className:"relative",colSpan:n.colSpan,"data-pinned":n.column.getIsPinned()||void 0,style:{width:n.getSize(),...l(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:[w(n.column.columnDef.header,n.getContext()),{asc:e(u,{className:"size-3 shrink-0"}),desc:e(c,{className:"size-3 shrink-0"}),empty:e(f,{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 a};
@@ -1 +1 @@
1
- import{a}from"./chunk-PE4TM6CB.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridColumnVisibility};
1
+ import{a}from"./chunk-AW7NOWAF.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridColumnVisibility};
@@ -1 +1 @@
1
- import{a}from"./chunk-C5POVXMG.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridHeader};
1
+ import{a}from"./chunk-WQ7NFOUK.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridHeader};
@@ -1 +1 @@
1
- import{a}from"./chunk-AEU4XHNY.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridPagination};
1
+ import{a}from"./chunk-LMGRMZB5.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridPagination};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-AZT7GSYJ.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridRowSelect,b as DataGridRowSelectAll};
1
+ import{a,b}from"./chunk-IOAUYS6F.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGridRowSelect,b as DataGridRowSelectAll};
@@ -1 +1 @@
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};
1
+ import{a}from"./chunk-435MU36W.mjs";import"./chunk-HCDVDP56.mjs";import"./chunk-WWXQKSAV.mjs";import"./chunk-ROT3HK7K.mjs";import"./chunk-AW7NOWAF.mjs";import"./chunk-OFHYDD43.mjs";import"./chunk-2T3XPDLU.mjs";import"./chunk-WQ7NFOUK.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MCE7DXVJ.mjs";import"./chunk-LMGRMZB5.mjs";import"./chunk-MDBTVFQY.mjs";export{a as DataGrid};
package/dist/index.mjs CHANGED
@@ -1 +1 @@
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};
1
+ "use client";import{a,b as e}from"./chunk-IOAUYS6F.mjs";import{a as o}from"./chunk-435MU36W.mjs";import"./chunk-HCDVDP56.mjs";import"./chunk-WWXQKSAV.mjs";import"./chunk-ROT3HK7K.mjs";import"./chunk-AW7NOWAF.mjs";import{a as r,b as t}from"./chunk-OFHYDD43.mjs";import"./chunk-2T3XPDLU.mjs";import"./chunk-WQ7NFOUK.mjs";import"./chunk-CCUO624J.mjs";import"./chunk-MCE7DXVJ.mjs";import"./chunk-LMGRMZB5.mjs";import"./chunk-MDBTVFQY.mjs";export{o as DataGrid,r as DataGridConfig,a as DataGridRowSelect,e as DataGridRowSelectAll,t as useDataGridConfig};
@@ -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: "md" | "sm" | "lg" | "xl" | "2xl" | "3xl" | "full" | "none" | undefined;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamsrui/data-grid",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
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/checkbox": "^0.0.12",
14
- "@jamsrui/hooks": "^0.0.12",
15
- "@jamsrui/button": "^0.0.12",
16
- "@jamsrui/divider": "^0.0.12",
17
- "@jamsrui/core": "^0.0.10",
18
- "@jamsrui/table": "^0.0.12",
19
- "@jamsrui/select": "^0.0.12",
20
- "@jamsrui/linear-progress": "^0.0.12",
21
- "@jamsrui/icon-button": "^0.0.12",
22
- "@jamsrui/input": "^0.0.13",
23
- "@jamsrui/utils": "^0.0.12",
24
- "@jamsrui/menu": "^0.0.12",
25
- "@jamsrui/icons": "^0.0.10"
13
+ "@jamsrui/core": "^0.0.11",
14
+ "@jamsrui/button": "^0.0.13",
15
+ "@jamsrui/checkbox": "^0.0.13",
16
+ "@jamsrui/divider": "^0.0.13",
17
+ "@jamsrui/hooks": "^0.0.13",
18
+ "@jamsrui/icon-button": "^0.0.13",
19
+ "@jamsrui/icons": "^0.0.11",
20
+ "@jamsrui/input": "^0.0.14",
21
+ "@jamsrui/label": "^0.0.6",
22
+ "@jamsrui/linear-progress": "^0.0.13",
23
+ "@jamsrui/menu": "^0.0.13",
24
+ "@jamsrui/table": "^0.0.13",
25
+ "@jamsrui/select": "^0.0.13",
26
+ "@jamsrui/utils": "^0.0.13"
26
27
  },
27
28
  "exports": {
28
29
  ".": {
@@ -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};
@@ -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};
@@ -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};
@@ -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};