react-shadcn-table 1.0.1 → 1.0.2

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/index.cjs CHANGED
@@ -10,7 +10,7 @@
10
10
  transform: rotate(360deg);
11
11
  }
12
12
  }
13
- `}),(0,f.jsx)(m.Loader,{size:16,style:{animation:`grid-skeleton-spin 1s linear infinite`}})]}):[`actions`,`pin`,`drag-handle`,`rowNumber`].includes(e.id)?(0,f.jsx)(nr,{style:{width:`100%`,height:`16px`}}):(0,f.jsx)(nr,{style:{width:`${rr[(t+n)%rr.length]}px`,height:`16px`}})}),ar=()=>{let{table:e,isSplit:t}=R(),n=(t?e.getCenterHeaderGroups():e.getHeaderGroups()).map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Q,{children:n.map((n,r)=>(0,f.jsx)($,{style:{width:n.getSize(),minWidth:n.getSize(),maxWidth:n.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,transition:`padding 0.2s`,padding:e.state.density===`sm`?`4px`:e.state.density===`md`?`8px`:`16px`,...Un(n,t)},children:(0,f.jsx)(ir,{column:n,i,j:r})},r))},i))})})};function or({row:e}){"use no memo";let{table:t,isSplit:n}=R();return(0,f.jsx)(Q,{style:{backgroundColor:`blue`,position:`sticky`,zIndex:10,top:e.getIsPinned()===`top`?`calc(${e.getPinnedIndex()} * var(--cell-h))`:void 0,bottom:e.getIsPinned()===`bottom`?`calc(${t.getBottomRows().length-1-e.getPinnedIndex()} * var(--cell-h))`:void 0},children:(n?e.getCenterVisibleCells():e.getVisibleCells()).map(e=>(0,f.jsx)(Gn,{cell:e},e.id))})}var sr=()=>{"use no memo";let{table:e,isSplit:t,isLoading:n,isError:r,renderSubComponent:i}=R();return n?(0,f.jsx)(ar,{}):r?(0,f.jsx)(tr,{}):e.getRowModel().rows.length===0?(0,f.jsx)($n,{}):(0,f.jsxs)(X,{style:{width:e.getCenterTotalSize()},children:[e.getTopRows().map(e=>(0,f.jsx)(or,{row:e},e.id)),(0,f.jsx)(Z,{children:e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Q,{"data-state":e.getIsSelected()&&`selected`,children:(t?e.getCenterVisibleCells():e.getVisibleCells()).map(e=>(0,f.jsx)(Gn,{cell:e},e.id))}),i&&e.getIsExpanded()&&(0,f.jsx)(Q,{children:(0,f.jsx)($,{colSpan:e.getVisibleCells().length,children:i({row:e})})})]},e.id))}),e.getBottomRows().map(e=>(0,f.jsx)(or,{row:e},e.id))]})};function cr({value:e,onChange:t,debounce:n=500,...r}){let[i,a]=c.default.useState(e);c.default.useEffect(()=>{a(e)},[e]);let o=zn(t,{wait:n});return(0,f.jsx)(Xt,{...r,value:i,onChange:e=>{a(e.target.value),o(e.target.value)}})}function lr({...e}){return(0,f.jsx)(p.Select.Root,{"data-slot":`select`,...e})}function ur({className:e,...t}){return(0,f.jsx)(p.Select.Group,{"data-slot":`select-group`,className:q(`scroll-my-1 p-1`,e),...t})}function dr({...e}){return(0,f.jsx)(p.Select.Value,{"data-slot":`select-value`,...e})}function fr({className:e,size:t=`default`,children:n,...r}){return(0,f.jsxs)(p.Select.Trigger,{"data-slot":`select-trigger`,"data-size":t,className:q(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,f.jsx)(p.Select.Icon,{asChild:!0,children:(0,f.jsx)(m.ChevronDownIcon,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function pr({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,f.jsx)(p.Select.Portal,{children:(0,f.jsxs)(p.Select.Content,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:q(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,f.jsx)(hr,{}),(0,f.jsx)(p.Select.Viewport,{"data-position":n,className:q(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,f.jsx)(gr,{})]})})}function mr({className:e,children:t,...n}){return(0,f.jsxs)(p.Select.Item,{"data-slot":`select-item`,className:q(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,f.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,f.jsx)(p.Select.ItemIndicator,{children:(0,f.jsx)(m.CheckIcon,{className:`pointer-events-none`})})}),(0,f.jsx)(p.Select.ItemText,{children:t})]})}function hr({className:e,...t}){return(0,f.jsx)(p.Select.ScrollUpButton,{"data-slot":`select-scroll-up-button`,className:q(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,f.jsx)(m.ChevronUpIcon,{})})}function gr({className:e,...t}){return(0,f.jsx)(p.Select.ScrollDownButton,{"data-slot":`select-scroll-down-button`,className:q(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,f.jsx)(m.ChevronDownIcon,{})})}var _r=({column:e})=>{"use no memo";let t=e.getFilterValue(),{filterVariant:n}=e.columnDef.meta??{},{isFetching:r}=R(),i=!r&&n===`select`?Array.from(e.getFacetedUniqueValues().keys()).sort().slice(0,5e3):[];return e.getCanFilter()?(0,f.jsx)(`div`,{style:{padding:`4px`,width:`100%`,borderTop:`1px solid var(--border)`},children:n===`range`?(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`4px`},children:[(0,f.jsx)(cr,{style:{height:`28px`},type:`number`,value:t?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(cr,{style:{height:`28px`},type:`number`,value:t?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):n===`select`?(0,f.jsxs)(lr,{value:t?.toString()??`all`,onValueChange:t=>e.setFilterValue(t===`all`?void 0:t),children:[(0,f.jsx)(fr,{style:{width:`100%`},size:`sm`,children:(0,f.jsx)(dr,{})}),(0,f.jsx)(pr,{children:(0,f.jsxs)(ur,{children:[(0,f.jsx)(mr,{value:`all`,children:`All`}),i.map(e=>(0,f.jsx)(mr,{value:String(e),children:String(e)},String(e)))]})})]}):n&&[`text`,`time`,`date`,`datetime-local`,`month`,`week`,`number`,`tel`,`url`,`color`,`search`].includes(n)?(0,f.jsx)(cr,{style:{height:`28px`},onChange:t=>e.setFilterValue(t),placeholder:`Search...`,type:n,value:t??``}):(0,f.jsx)(`div`,{style:{height:`28px`,opacity:0,visibility:`hidden`}})}):null};function vr({...e}){return(0,f.jsx)(p.DropdownMenu.Root,{"data-slot":`dropdown-menu`,...e})}function yr({...e}){return(0,f.jsx)(p.DropdownMenu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function br({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,f.jsx)(p.DropdownMenu.Portal,{children:(0,f.jsx)(p.DropdownMenu.Content,{"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,className:q(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function xr({...e}){return(0,f.jsx)(p.DropdownMenu.Group,{"data-slot":`dropdown-menu-group`,...e})}function Sr({className:e,inset:t,variant:n=`default`,...r}){return(0,f.jsx)(p.DropdownMenu.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:q(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Cr({className:e,...t}){return(0,f.jsx)(p.DropdownMenu.Separator,{"data-slot":`dropdown-menu-separator`,className:q(`-mx-1 my-1 h-px bg-border`,e),...t})}function wr({className:e,...t}){return(0,f.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:q(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,e),...t})}var Tr=({header:e})=>{"use no memo";let{isLoading:t,isError:n}=R();return e.column.getCanFilter()?(0,f.jsxs)(vr,{children:[(0,f.jsx)(yr,{asChild:!0,children:(0,f.jsx)(J,{size:`icon-xs`,variant:`ghost`,disabled:t||n,children:(0,f.jsx)(m.EllipsisVertical,{})})}),(0,f.jsxs)(br,{align:`end`,children:[(0,f.jsxs)(xr,{children:[(0,f.jsxs)(Sr,{onClick:()=>{e.column.toggleSorting(!1)},disabled:!e.column.getCanSort(),children:[`Sort ASC`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.ArrowUp,{})})]}),(0,f.jsxs)(Sr,{onClick:()=>{e.column.toggleSorting(!0)},disabled:!e.column.getCanSort(),children:[`Sort DESC`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.ArrowDown,{})})]})]}),(0,f.jsx)(Cr,{}),!e.isPlaceholder&&e.column.getCanPin()&&(0,f.jsxs)(xr,{children:[e.column.getIsPinned()!==`start`&&(0,f.jsxs)(Sr,{onClick:()=>{e.column.pin(`start`)},children:[`Pin to left`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.PinIcon,{style:{transform:`rotate(45deg)`}})})]}),e.column.getIsPinned()&&(0,f.jsxs)(Sr,{onClick:()=>{e.column.pin(!1)},children:[`Unpin`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.PinOff,{})})]}),e.column.getIsPinned()!==`end`&&(0,f.jsxs)(Sr,{onClick:()=>{e.column.pin(`end`)},children:[`Pin to right`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.PinIcon,{style:{transform:`rotate(-45deg)`}})})]})]}),(0,f.jsx)(Cr,{}),(0,f.jsx)(xr,{children:(0,f.jsxs)(Sr,{onClick:()=>{e.column.toggleVisibility(!1)},disabled:!e.column.getCanHide(),children:[`Hide column`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.EyeOff,{})})]})})]})]}):null},Er=({header:e})=>{"use no memo";let t=e.column.getIsResizing();return(0,f.jsx)(`div`,{className:`header-resizer`,onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),style:{position:`absolute`,top:0,right:0,height:`100%`,width:`5px`,backgroundColor:t?`var(--primary)`:`rgba(0, 0, 0, 0.5)`,cursor:`col-resize`,userSelect:`none`,touchAction:`none`,opacity:+!!t}})},Dr=({header:e})=>{"use no memo";let{table:t}=R(),n=e.column.getCanSort();return(0,f.jsxs)(`div`,{onClick:e.column.getToggleSortingHandler(),title:e.column.getCanSort()?e.column.getNextSortingOrder()===`asc`?`Sort ascending`:e.column.getNextSortingOrder()===`desc`?`Sort descending`:`Clear sort`:void 0,style:{display:`flex`,alignItems:`center`,gap:1,cursor:n?`pointer`:`default`,userSelect:n?`none`:`auto`},children:[(0,f.jsx)(t.FlexRender,{header:e}),{asc:(0,f.jsx)(m.ChevronUpIcon,{style:{width:16,height:16}}),desc:(0,f.jsx)(m.ChevronDownIcon,{style:{width:16,height:16}})}[e.column.getIsSorted()]??null]})},Or=({header:e})=>{"use no memo";let{isSplit:t}=R(),n={position:`relative`,whiteSpace:`nowrap`,width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,padding:0,...Un(e.column,t)};return(0,f.jsxs)(Hn,{colSpan:e.colSpan,style:n,children:[e.isPlaceholder?null:(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,f.jsxs)(`div`,{style:{padding:`8px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`4px`},children:[(0,f.jsx)(Dr,{header:e}),(0,f.jsx)(Tr,{header:e})]}),(0,f.jsx)(_r,{column:e.column})]}),(0,f.jsx)(Er,{header:e})]})},kr=()=>{"use no memo";let{table:e,isSplit:t}=R();return(0,f.jsx)(X,{style:{width:e.getCenterTotalSize()},children:(0,f.jsx)(Vn,{children:(t?e.getCenterHeaderGroups():e.getHeaderGroups()).map(e=>(0,f.jsx)(Q,{children:e.headers.map(e=>(0,f.jsx)(Or,{header:e},e.id))},e.id))})})},Ar=()=>{"use no memo";let{paneRef1:e,paneRef2:t,height:n}=R();return(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Bn,{}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(kr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(sr,{})})]})},jr=()=>{let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{children:e.getEndVisibleLeafColumns().map((e,t)=>(0,f.jsx)($,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},Mr=()=>{let{table:e,isSplit:t}=R(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Q,{children:n.map((n,r)=>(0,f.jsx)($,{style:{width:n.getSize(),minWidth:n.getSize(),maxWidth:n.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,transition:`padding 0.2s`,padding:e.state.density===`sm`?`4px`:e.state.density===`md`?`8px`:`16px`,...Un(n,t)},children:(0,f.jsx)(ir,{column:n,i,j:r})},r))},i))})})};function Nr({row:e}){"use no memo";let{table:t}=R();return(0,f.jsx)(Q,{style:{backgroundColor:`blue`,position:`sticky`,zIndex:10,top:e.getIsPinned()===`top`?`calc(${e.getPinnedIndex()} * var(--cell-h))`:void 0,bottom:e.getIsPinned()===`bottom`?`calc(${t.getBottomRows().length-1-e.getPinnedIndex()} * var(--cell-h))`:void 0},children:e.getEndVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))})}var Pr=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=R();return t?(0,f.jsx)(Mr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(jr,{}):(0,f.jsx)(X,{children:(0,f.jsxs)(Z,{children:[e.getTopRows().map(e=>(0,f.jsx)(Nr,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Q,{"data-state":e.getIsSelected()&&`selected`,children:e.getEndVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Q,{children:(0,f.jsx)($,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getTopRows().map(e=>(0,f.jsx)(Nr,{row:e},e.id))]})})},Fr=()=>{"use no memo";let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Vn,{children:e.getEndHeaderGroups().map(e=>(0,f.jsx)(Q,{children:e.headers.map(e=>(0,f.jsx)(Or,{header:e},e.id))},e.id))})})},Ir=()=>{"use no memo";let{paneRef5:e,paneRef6:t,height:n,isError:r,isSplit:i,table:a}=R();return(0,f.jsx)(f.Fragment,{children:!r&&i&&(a.state.columnPinning?.end?.length??0)>0?(0,f.jsxs)(`div`,{style:{maxWidth:`220px`,overflow:`hidden`},children:[(0,f.jsx)(`div`,{style:{height:`64px`,borderBottom:`1px solid var(--border)`}}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(Fr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(Pr,{})})]}):null})},Lr=()=>{let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{children:e.getStartVisibleLeafColumns().map((e,t)=>(0,f.jsx)($,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},Rr=()=>{let{table:e,isSplit:t}=R(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Q,{children:n.map((n,r)=>(0,f.jsx)($,{style:{width:n.getSize(),minWidth:n.getSize(),maxWidth:n.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,transition:`padding 0.2s`,padding:e.state.density===`sm`?`4px`:e.state.density===`md`?`8px`:`16px`,...Un(n,t)},children:(0,f.jsx)(ir,{column:n,i,j:r})},r))},i))})})};function zr({row:e}){"use no memo";let{table:t}=R();return(0,f.jsx)(Q,{style:{backgroundColor:`blue`,position:`sticky`,zIndex:10,top:e.getIsPinned()===`top`?`calc(${e.getPinnedIndex()} * var(--cell-h))`:void 0,bottom:e.getIsPinned()===`bottom`?`calc(${t.getBottomRows().length-1-e.getPinnedIndex()} * var(--cell-h))`:void 0},children:e.getStartVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))})}var Br=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=R();return t?(0,f.jsx)(Rr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(Lr,{}):(0,f.jsx)(X,{children:(0,f.jsxs)(Z,{children:[e.getTopRows().map(e=>(0,f.jsx)(zr,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Q,{"data-state":e.getIsSelected()&&`selected`,children:e.getStartVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Q,{children:(0,f.jsx)($,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getBottomRows().map(e=>(0,f.jsx)(zr,{row:e},e.id))]})})},Vr=()=>{"use no memo";let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Vn,{children:e.getStartHeaderGroups().map(e=>(0,f.jsx)(Q,{children:e.headers.map(e=>(0,f.jsx)(Or,{header:e},e.id))},e.id))})})},Hr=()=>{"use no memo";let{paneRef3:e,paneRef4:t,height:n,isError:r,isSplit:i,table:a}=R();return(0,f.jsx)(f.Fragment,{children:!r&&i&&(a.state.columnPinning?.start?.length??0)>0?(0,f.jsxs)(`div`,{style:{maxWidth:`220px`,overflow:`hidden`},children:[(0,f.jsx)(`div`,{style:{height:`64px`,borderBottom:`1px solid var(--border)`}}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(Vr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(Br,{})})]}):null})},Ur=()=>{let{table:e}=R();return(0,f.jsxs)(`div`,{style:{minHeight:`50px`,padding:`16px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:`16px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`16px`,fontSize:`14px`,color:`var(--muted-foreground)`},children:[(0,f.jsxs)(`span`,{children:[`Showing `,e.getRowModel().rows.length.toLocaleString(),` of`,` `,e.getRowCount().toLocaleString(),` Rows`]}),e.getSelectedRowModel().rows.length>0&&(0,f.jsxs)(`span`,{children:[e.getSelectedRowModel().rows.length.toLocaleString(),` selected`]}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>e.getSelectedCellCount()>0?(0,f.jsxs)(`span`,{children:[e.getSelectedCellCount().toLocaleString(),` cells selected across `,e.getCellSelectionRowIds().length.toLocaleString(),` `,`rows and `,e.getCellSelectionColumnIds().length,` columns`]}):null})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:`4px`,fontSize:`14px`},children:[`Page`,` `,(0,f.jsxs)(`strong`,{children:[(e.state.pagination.pageIndex+1).toLocaleString(),` of`,` `,e.getPageCount().toLocaleString()]})]}),(0,f.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:`4px`,fontSize:`14px`},children:[`Go to page:`,(0,f.jsx)(Xt,{type:`number`,min:`1`,max:e.getPageCount(),value:e.state.pagination.pageIndex+1,onChange:t=>{let n=t.target.value?Number(t.target.value)-1:0;e.setPageIndex(n)},style:{height:`28px`,width:`64px`}})]}),(0,f.jsxs)(lr,{value:String(e.state.pagination.pageSize),onValueChange:t=>e.setPageSize(Number(t)),children:[(0,f.jsx)(fr,{size:`sm`,children:(0,f.jsx)(dr,{})}),(0,f.jsx)(pr,{children:[20,30,40,50,60,70,80,90,100].map(e=>(0,f.jsxs)(mr,{value:String(e),children:[`Show `,e]},e))})]}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.firstPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(m.ChevronsLeft,{size:16})}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(m.ChevronLeft,{size:16})}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:(0,f.jsx)(m.ChevronRight,{size:16})}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.lastPage(),disabled:!e.getCanLastPage(),children:(0,f.jsx)(m.ChevronsRight,{size:16})})]})]})},Wr=Oe(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function Gr({className:e,orientation:t,...n}){return(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:q(Wr({orientation:t}),e),...n})}function Kr({className:e,...t}){return(0,f.jsx)(p.Checkbox.Root,{"data-slot":`checkbox`,className:q(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,e),...t,children:(0,f.jsx)(p.Checkbox.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,f.jsx)(m.CheckIcon,{})})})}function qr({className:e,...t}){return(0,f.jsx)(p.Label.Root,{"data-slot":`label`,className:q(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Jr=()=>{let{table:e,isSplit:t,setIsSplit:n}=R(),[r,i]=(0,c.useState)(``),a=(0,c.useMemo)(()=>e.getAllLeafColumns().filter(e=>![`rowNumber`].includes(e.id)).filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[r,e]),o=()=>{let t=e.getAllLeafColumns().map(e=>e.id);for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}e.setColumnOrder(t)};return(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:[(0,f.jsxs)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:[`Columns (`,e.getAllLeafColumns().length,`)`]}),(0,f.jsx)(J,{title:`Restore`,variant:`ghost`,size:`icon-sm`,onClick:()=>{e.resetColumnVisibility()},children:(0,f.jsx)(m.RotateCcw,{})})]}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsx)(Xt,{type:`search`,placeholder:`Search columns...`,value:r,onChange:e=>i(e.target.value)})}),(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,flex:1,overflowY:`auto`,paddingInline:`8px`},children:(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:a.length>0?(0,f.jsx)(c.default.Fragment,{children:a.map(e=>(0,f.jsxs)(qr,{style:{display:`flex`,alignItems:`center`,minWidth:0},title:e.id.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),children:[(0,f.jsx)(Kr,{checked:e.getIsVisible(),onCheckedChange:t=>e.toggleVisibility(t===!0)}),(0,f.jsx)(`span`,{style:{overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,minWidth:0,flex:1},children:e.id.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase())})]},e.id))}):(0,f.jsx)(`div`,{className:`text-center`,children:`No columns found`})})}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,paddingInline:`8px`},children:[(0,f.jsxs)(Gr,{style:{width:`100%`},children:[(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Shuffle`,style:{flex:1},onClick:()=>o(),children:(0,f.jsx)(m.Shuffle,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reset Order`,style:{flex:1},onClick:()=>e.resetColumnOrder(),disabled:e.state.columnOrder.length===0,children:(0,f.jsx)(m.RotateCcw,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reverse Order`,style:{flex:1},onClick:()=>e.setColumnOrder([...e.getAllLeafColumns().map(e=>e.id)].reverse()),children:(0,f.jsx)(m.ArrowLeftRight,{})})]}),(0,f.jsxs)(Gr,{style:{width:`100%`},children:[(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reset Pinning`,style:{flex:1},onClick:()=>{e.resetColumnPinning(),n(!1)},disabled:!e.getIsSomeColumnsPinned(),children:(0,f.jsx)(m.PinOff,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reset Sizing`,style:{flex:1},onClick:()=>e.resetColumnSizing(),disabled:Object.keys(e.state.columnSizing).length===0,children:(0,f.jsx)(m.Ruler,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:t?`Exit Split`:`Split View`,style:{flex:1},disabled:!e.getIsSomeColumnsPinned(),onClick:()=>n(!t),children:(0,f.jsx)(m.SquareSplitHorizontal,{})})]})]})]})};function Yr({className:e,...t}){return(0,f.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:q(`group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2`,e),...t})}var Xr=Oe(`group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted`,{variants:{variant:{default:`border-transparent`,outline:`border-border`,muted:`border-transparent bg-muted/50`},size:{default:`gap-2.5 px-3 py-2.5`,sm:`gap-2.5 px-3 py-2.5`,xs:`gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0`}},defaultVariants:{variant:`default`,size:`default`}});function Zr({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?p.Slot.Root:`div`;return(0,f.jsx)(a,{"data-slot":`item`,"data-variant":t,"data-size":n,className:q(Xr({variant:t,size:n,className:e})),...i})}var Qr=Oe(`flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none`,{variants:{variant:{default:`bg-transparent`,icon:`[&_svg:not([class*='size-'])]:size-4`,image:`size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function $r({className:e,variant:t=`default`,...n}){return(0,f.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:q(Qr({variant:t,className:e})),...n})}function ei({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`item-content`,className:q(`flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none`,e),...t})}function ti({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`item-title`,className:q(`line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4`,e),...t})}var ni=({columnId:e,label:t})=>{"use no memo";let{attributes:n,isDragging:r,listeners:i,setNodeRef:a,transform:o,transition:s}=(0,_.useSortable)({id:e}),c={opacity:r?.8:1,transform:ee.CSS.Translate.toString(o),transition:s,zIndex:+!!r};return(0,f.jsxs)(Zr,{ref:a,style:c,variant:`outline`,size:`sm`,title:t.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),children:[(0,f.jsx)($r,{variant:`icon`,...n,...i,style:{cursor:`grab`,color:`var(--muted-foreground)`},children:(0,f.jsx)(m.GripVertical,{})}),(0,f.jsx)(ei,{style:{minWidth:0},children:(0,f.jsx)(ti,{style:{width:`100%`,minWidth:0},children:(0,f.jsx)(`span`,{style:{display:`block`,width:`100%`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase())})})})]})},ri=()=>{"use no memo";let{table:e}=R(),t=e.state.columnOrder.length?e.state.columnOrder:e.getAllLeafColumns().map(e=>e.id),n=n=>{let{active:r,over:i}=n;if(r&&i&&r.id!==i.id){let n=t.indexOf(r.id),a=t.indexOf(i.id);e.setColumnOrder((0,_.arrayMove)(t,n,a))}},r=(0,h.useSensors)((0,h.useSensor)(h.MouseSensor,{}),(0,h.useSensor)(h.TouchSensor,{}),(0,h.useSensor)(h.KeyboardSensor,{}));return(0,f.jsx)(h.DndContext,{collisionDetection:h.closestCenter,modifiers:[g.restrictToVerticalAxis],onDragEnd:n,sensors:r,children:(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:[(0,f.jsxs)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:[`Columns DND (`,e.getAllLeafColumns().length,`)`]}),(0,f.jsx)(J,{variant:`ghost`,size:`icon-sm`,title:`Reset`,onClick:()=>e.resetColumnOrder(),children:(0,f.jsx)(m.RotateCcw,{})})]}),(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,flex:1,overflowY:`auto`,paddingInline:`8px`},children:(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:(0,f.jsx)(_.SortableContext,{items:t,strategy:_.verticalListSortingStrategy,children:(0,f.jsx)(Yr,{children:t.map(t=>{let n=e.getColumn(t);return n?(0,f.jsx)(ni,{columnId:t,label:typeof n.columnDef.header==`string`?n.columnDef.header:t},t):null})})})})})]})})};function ii({...e}){return(0,f.jsx)(p.Collapsible.Root,{"data-slot":`collapsible`,...e})}function ai({...e}){return(0,f.jsx)(p.Collapsible.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}var oi=({column:e})=>{"use no memo";let t=(0,c.useMemo)(()=>e.getCanFilter()?{id:e.id.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),uniqueValues:Array.from(e.getFacetedUniqueValues().keys())}:null,[e]),n=e.getFilterValue(),{filterVariant:r}=e.columnDef.meta??{},[i,a]=(0,c.useState)(!1);return(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{onClick:()=>a(!i),style:{display:`flex`,alignItems:`center`,gap:`8px`,cursor:`pointer`,whiteSpace:`nowrap`},children:[(0,f.jsx)(`div`,{style:{width:`28px`,height:`28px`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`4px`,transition:`all 0.2s`,transform:i?`rotate(90deg)`:`none`},children:(0,f.jsx)(m.ChevronRight,{size:16})}),(0,f.jsx)(`span`,{style:{fontSize:`0.875rem`,whiteSpace:`nowrap`},children:t?.id&&t.id.length>15?`${t.id.slice(0,15)}...`:t?.id})]}),(0,f.jsx)(ii,{open:i,children:(0,f.jsx)(ai,{children:(0,f.jsxs)(`div`,{style:{padding:`12px`,paddingRight:0},children:[(0,f.jsx)(`datalist`,{id:e.id+`list`,children:t?.uniqueValues.map((e,t)=>(0,f.jsx)(`option`,{value:e},t))}),r===`range`?(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,f.jsx)(cr,{type:`number`,value:n?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(cr,{type:`number`,value:n?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):(0,f.jsx)(cr,{type:`text`,value:n??``,onChange:t=>e.setFilterValue(t),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,list:e.id+`list`,disabled:r===void 0})]})})})]})},si=()=>{"use no memo";let{table:e,globalFilter:t,setGlobalFilter:n}=R();return(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`},children:[(0,f.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:(0,f.jsx)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:`Filters`})}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsx)(cr,{style:{width:`100%`},type:`search`,value:String(t),onChange:e=>{n?.(String(e))},placeholder:`Search all columns...`})}),(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,flex:1,overflowY:`auto`,paddingInline:`8px`},children:(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:e.getHeaderGroups().map(e=>(0,f.jsx)(c.default.Fragment,{children:e.headers.filter(e=>![`rowNumber`,`select`,`pin`,`actions`].includes(e.column.id)).map(e=>(0,f.jsx)(oi,{column:e.column},e.id))},e.id))})}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsxs)(J,{variant:`outline`,size:`sm`,style:{width:`100%`},onClick:()=>e.setColumnFilters([]),children:[(0,f.jsx)(m.RotateCcw,{size:16}),`Reset Filters`]})})]})};function ci(e,t,n){let r=window.open(``,`_blank`);if(!r){window.alert(`Print window was blocked. Please allow popups for this site and try again.`);return}let i=e=>(e==null?``:String(e)).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),a=t.map(e=>`<th>${i(e)}</th>`).join(``),o=n.map(e=>`<tr>${e.map(e=>`<td>${i(e)}</td>`).join(``)}</tr>`).join(``);r.document.open(),r.document.write(`
13
+ `}),(0,f.jsx)(m.Loader,{size:16,style:{animation:`grid-skeleton-spin 1s linear infinite`}})]}):[`actions`,`pin`,`drag-handle`,`rowNumber`].includes(e.id)?(0,f.jsx)(nr,{style:{width:`100%`,height:`16px`}}):(0,f.jsx)(nr,{style:{width:`${rr[(t+n)%rr.length]}px`,height:`16px`}})}),ar=()=>{let{table:e,isSplit:t}=R(),n=(t?e.getCenterHeaderGroups():e.getHeaderGroups()).map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(X,{style:{width:e.getCenterTotalSize()},children:(0,f.jsx)(Z,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Q,{children:n.map((n,r)=>(0,f.jsx)($,{style:{width:n.getSize(),minWidth:n.getSize(),maxWidth:n.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,transition:`padding 0.2s`,padding:e.state.density===`sm`?`4px`:e.state.density===`md`?`8px`:`16px`,...Un(n,t)},children:(0,f.jsx)(ir,{column:n,i,j:r})},r))},i))})})};function or({row:e}){"use no memo";let{table:t,isSplit:n}=R();return(0,f.jsx)(Q,{style:{backgroundColor:`blue`,position:`sticky`,zIndex:10,top:e.getIsPinned()===`top`?`calc(${e.getPinnedIndex()} * var(--cell-h))`:void 0,bottom:e.getIsPinned()===`bottom`?`calc(${t.getBottomRows().length-1-e.getPinnedIndex()} * var(--cell-h))`:void 0},children:(n?e.getCenterVisibleCells():e.getVisibleCells()).map(e=>(0,f.jsx)(Gn,{cell:e},e.id))})}var sr=()=>{"use no memo";let{table:e,isSplit:t,isLoading:n,isError:r,renderSubComponent:i}=R();return n?(0,f.jsx)(ar,{}):r?(0,f.jsx)(tr,{}):e.getRowModel().rows.length===0?(0,f.jsx)($n,{}):(0,f.jsxs)(X,{style:{width:e.getCenterTotalSize()},children:[e.getTopRows().map(e=>(0,f.jsx)(or,{row:e},e.id)),(0,f.jsx)(Z,{children:e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Q,{"data-state":e.getIsSelected()&&`selected`,children:(t?e.getCenterVisibleCells():e.getVisibleCells()).map(e=>(0,f.jsx)(Gn,{cell:e},e.id))}),i&&e.getIsExpanded()&&(0,f.jsx)(Q,{children:(0,f.jsx)($,{colSpan:e.getVisibleCells().length,children:i({row:e})})})]},e.id))}),e.getBottomRows().map(e=>(0,f.jsx)(or,{row:e},e.id))]})};function cr({value:e,onChange:t,debounce:n=500,...r}){let[i,a]=c.default.useState(e);c.default.useEffect(()=>{a(e)},[e]);let o=zn(t,{wait:n});return(0,f.jsx)(Xt,{...r,value:i,onChange:e=>{a(e.target.value),o(e.target.value)}})}function lr({...e}){return(0,f.jsx)(p.Select.Root,{"data-slot":`select`,...e})}function ur({className:e,...t}){return(0,f.jsx)(p.Select.Group,{"data-slot":`select-group`,className:q(`scroll-my-1 p-1`,e),...t})}function dr({...e}){return(0,f.jsx)(p.Select.Value,{"data-slot":`select-value`,...e})}function fr({className:e,size:t=`default`,children:n,...r}){return(0,f.jsxs)(p.Select.Trigger,{"data-slot":`select-trigger`,"data-size":t,className:q(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,f.jsx)(p.Select.Icon,{asChild:!0,children:(0,f.jsx)(m.ChevronDownIcon,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function pr({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,f.jsx)(p.Select.Portal,{children:(0,f.jsxs)(p.Select.Content,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:q(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,f.jsx)(hr,{}),(0,f.jsx)(p.Select.Viewport,{"data-position":n,className:q(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,f.jsx)(gr,{})]})})}function mr({className:e,children:t,...n}){return(0,f.jsxs)(p.Select.Item,{"data-slot":`select-item`,className:q(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,f.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,f.jsx)(p.Select.ItemIndicator,{children:(0,f.jsx)(m.CheckIcon,{className:`pointer-events-none`})})}),(0,f.jsx)(p.Select.ItemText,{children:t})]})}function hr({className:e,...t}){return(0,f.jsx)(p.Select.ScrollUpButton,{"data-slot":`select-scroll-up-button`,className:q(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,f.jsx)(m.ChevronUpIcon,{})})}function gr({className:e,...t}){return(0,f.jsx)(p.Select.ScrollDownButton,{"data-slot":`select-scroll-down-button`,className:q(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,f.jsx)(m.ChevronDownIcon,{})})}var _r=({column:e})=>{"use no memo";let t=e.getFilterValue(),{filterVariant:n}=e.columnDef.meta??{},{isFetching:r}=R(),i=!r&&n===`select`?Array.from(e.getFacetedUniqueValues().keys()).sort().slice(0,5e3):[];return e.getCanFilter()?(0,f.jsx)(`div`,{style:{padding:`4px`,width:`100%`,borderTop:`1px solid var(--border)`},children:n===`range`?(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`4px`},children:[(0,f.jsx)(cr,{style:{height:`28px`},type:`number`,value:t?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(cr,{style:{height:`28px`},type:`number`,value:t?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):n===`select`?(0,f.jsxs)(lr,{value:t?.toString()??`all`,onValueChange:t=>e.setFilterValue(t===`all`?void 0:t),children:[(0,f.jsx)(fr,{style:{width:`100%`},size:`sm`,children:(0,f.jsx)(dr,{})}),(0,f.jsx)(pr,{children:(0,f.jsxs)(ur,{children:[(0,f.jsx)(mr,{value:`all`,children:`All`}),i.map(e=>(0,f.jsx)(mr,{value:String(e),children:String(e)},String(e)))]})})]}):n&&[`text`,`time`,`date`,`datetime-local`,`month`,`week`,`number`,`tel`,`url`,`color`,`search`].includes(n)?(0,f.jsx)(cr,{style:{height:`28px`},onChange:t=>e.setFilterValue(t),placeholder:`Search...`,type:n,value:t??``}):(0,f.jsx)(`div`,{style:{height:`28px`,opacity:0,visibility:`hidden`}})}):null};function vr({...e}){return(0,f.jsx)(p.DropdownMenu.Root,{"data-slot":`dropdown-menu`,...e})}function yr({...e}){return(0,f.jsx)(p.DropdownMenu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function br({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,f.jsx)(p.DropdownMenu.Portal,{children:(0,f.jsx)(p.DropdownMenu.Content,{"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,className:q(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function xr({...e}){return(0,f.jsx)(p.DropdownMenu.Group,{"data-slot":`dropdown-menu-group`,...e})}function Sr({className:e,inset:t,variant:n=`default`,...r}){return(0,f.jsx)(p.DropdownMenu.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:q(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Cr({className:e,...t}){return(0,f.jsx)(p.DropdownMenu.Separator,{"data-slot":`dropdown-menu-separator`,className:q(`-mx-1 my-1 h-px bg-border`,e),...t})}function wr({className:e,...t}){return(0,f.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:q(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,e),...t})}var Tr=({header:e})=>{"use no memo";let{isLoading:t,isError:n}=R();return e.column.getCanFilter()?(0,f.jsxs)(vr,{children:[(0,f.jsx)(yr,{asChild:!0,children:(0,f.jsx)(J,{size:`icon-xs`,variant:`ghost`,disabled:t||n,children:(0,f.jsx)(m.EllipsisVertical,{})})}),(0,f.jsxs)(br,{align:`end`,children:[(0,f.jsxs)(xr,{children:[(0,f.jsxs)(Sr,{onClick:()=>{e.column.toggleSorting(!1)},disabled:!e.column.getCanSort(),children:[`Sort ASC`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.ArrowUp,{})})]}),(0,f.jsxs)(Sr,{onClick:()=>{e.column.toggleSorting(!0)},disabled:!e.column.getCanSort(),children:[`Sort DESC`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.ArrowDown,{})})]})]}),(0,f.jsx)(Cr,{}),!e.isPlaceholder&&e.column.getCanPin()&&(0,f.jsxs)(xr,{children:[e.column.getIsPinned()!==`start`&&(0,f.jsxs)(Sr,{onClick:()=>{e.column.pin(`start`)},children:[`Pin to left`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.PinIcon,{style:{transform:`rotate(45deg)`}})})]}),e.column.getIsPinned()&&(0,f.jsxs)(Sr,{onClick:()=>{e.column.pin(!1)},children:[`Unpin`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.PinOff,{})})]}),e.column.getIsPinned()!==`end`&&(0,f.jsxs)(Sr,{onClick:()=>{e.column.pin(`end`)},children:[`Pin to right`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.PinIcon,{style:{transform:`rotate(-45deg)`}})})]})]}),(0,f.jsx)(Cr,{}),(0,f.jsx)(xr,{children:(0,f.jsxs)(Sr,{onClick:()=>{e.column.toggleVisibility(!1)},disabled:!e.column.getCanHide(),children:[`Hide column`,(0,f.jsx)(wr,{children:(0,f.jsx)(m.EyeOff,{})})]})})]})]}):null},Er=({header:e})=>{"use no memo";let t=e.column.getIsResizing();return(0,f.jsx)(`div`,{className:`header-resizer`,onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),style:{position:`absolute`,top:0,right:0,height:`100%`,width:`5px`,backgroundColor:t?`var(--primary)`:`rgba(0, 0, 0, 0.5)`,cursor:`col-resize`,userSelect:`none`,touchAction:`none`,opacity:+!!t}})},Dr=({header:e})=>{"use no memo";let{table:t}=R(),n=e.column.getCanSort();return(0,f.jsxs)(`div`,{onClick:e.column.getToggleSortingHandler(),title:e.column.getCanSort()?e.column.getNextSortingOrder()===`asc`?`Sort ascending`:e.column.getNextSortingOrder()===`desc`?`Sort descending`:`Clear sort`:void 0,style:{display:`flex`,alignItems:`center`,gap:1,cursor:n?`pointer`:`default`,userSelect:n?`none`:`auto`},children:[(0,f.jsx)(t.FlexRender,{header:e}),{asc:(0,f.jsx)(m.ChevronUpIcon,{style:{width:16,height:16}}),desc:(0,f.jsx)(m.ChevronDownIcon,{style:{width:16,height:16}})}[e.column.getIsSorted()]??null]})},Or=({header:e})=>{"use no memo";let{isSplit:t}=R(),n={position:`relative`,whiteSpace:`nowrap`,width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,padding:0,...Un(e.column,t)};return(0,f.jsxs)(Hn,{colSpan:e.colSpan,style:n,children:[e.isPlaceholder?null:(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,f.jsxs)(`div`,{style:{padding:`8px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`4px`},children:[(0,f.jsx)(Dr,{header:e}),(0,f.jsx)(Tr,{header:e})]}),(0,f.jsx)(_r,{column:e.column})]}),(0,f.jsx)(Er,{header:e})]})},kr=()=>{"use no memo";let{table:e,isSplit:t}=R();return(0,f.jsx)(X,{style:{width:e.getCenterTotalSize()},children:(0,f.jsx)(Vn,{children:(t?e.getCenterHeaderGroups():e.getHeaderGroups()).map(e=>(0,f.jsx)(Q,{children:e.headers.map(e=>(0,f.jsx)(Or,{header:e},e.id))},e.id))})})},Ar=()=>{"use no memo";let{paneRef1:e,paneRef2:t,height:n}=R();return(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Bn,{}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(kr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(sr,{})})]})},jr=()=>{let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{children:e.getEndVisibleLeafColumns().map((e,t)=>(0,f.jsx)($,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},Mr=()=>{let{table:e,isSplit:t}=R(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Q,{children:n.map((n,r)=>(0,f.jsx)($,{style:{width:n.getSize(),minWidth:n.getSize(),maxWidth:n.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,transition:`padding 0.2s`,padding:e.state.density===`sm`?`4px`:e.state.density===`md`?`8px`:`16px`,...Un(n,t)},children:(0,f.jsx)(ir,{column:n,i,j:r})},r))},i))})})};function Nr({row:e}){"use no memo";let{table:t}=R();return(0,f.jsx)(Q,{style:{backgroundColor:`blue`,position:`sticky`,zIndex:10,top:e.getIsPinned()===`top`?`calc(${e.getPinnedIndex()} * var(--cell-h))`:void 0,bottom:e.getIsPinned()===`bottom`?`calc(${t.getBottomRows().length-1-e.getPinnedIndex()} * var(--cell-h))`:void 0},children:e.getEndVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))})}var Pr=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=R();return t?(0,f.jsx)(Mr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(jr,{}):(0,f.jsx)(X,{children:(0,f.jsxs)(Z,{children:[e.getTopRows().map(e=>(0,f.jsx)(Nr,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Q,{"data-state":e.getIsSelected()&&`selected`,children:e.getEndVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Q,{children:(0,f.jsx)($,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getTopRows().map(e=>(0,f.jsx)(Nr,{row:e},e.id))]})})},Fr=()=>{"use no memo";let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Vn,{children:e.getEndHeaderGroups().map(e=>(0,f.jsx)(Q,{children:e.headers.map(e=>(0,f.jsx)(Or,{header:e},e.id))},e.id))})})},Ir=()=>{"use no memo";let{paneRef5:e,paneRef6:t,height:n,isError:r,isSplit:i,table:a}=R();return(0,f.jsx)(f.Fragment,{children:!r&&i&&(a.state.columnPinning?.end?.length??0)>0?(0,f.jsxs)(`div`,{style:{maxWidth:`220px`,overflow:`hidden`},children:[(0,f.jsx)(`div`,{style:{height:`64px`,borderBottom:`1px solid var(--border)`}}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(Fr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(Pr,{})})]}):null})},Lr=()=>{let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{children:e.getStartVisibleLeafColumns().map((e,t)=>(0,f.jsx)($,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},Rr=()=>{let{table:e,isSplit:t}=R(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Q,{children:n.map((n,r)=>(0,f.jsx)($,{style:{width:n.getSize(),minWidth:n.getSize(),maxWidth:n.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,transition:`padding 0.2s`,padding:e.state.density===`sm`?`4px`:e.state.density===`md`?`8px`:`16px`,...Un(n,t)},children:(0,f.jsx)(ir,{column:n,i,j:r})},r))},i))})})};function zr({row:e}){"use no memo";let{table:t}=R();return(0,f.jsx)(Q,{style:{backgroundColor:`blue`,position:`sticky`,zIndex:10,top:e.getIsPinned()===`top`?`calc(${e.getPinnedIndex()} * var(--cell-h))`:void 0,bottom:e.getIsPinned()===`bottom`?`calc(${t.getBottomRows().length-1-e.getPinnedIndex()} * var(--cell-h))`:void 0},children:e.getStartVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))})}var Br=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=R();return t?(0,f.jsx)(Rr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(Lr,{}):(0,f.jsx)(X,{children:(0,f.jsxs)(Z,{children:[e.getTopRows().map(e=>(0,f.jsx)(zr,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Q,{"data-state":e.getIsSelected()&&`selected`,children:e.getStartVisibleCells().map(e=>(0,f.jsx)(Gn,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Q,{children:(0,f.jsx)($,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getBottomRows().map(e=>(0,f.jsx)(zr,{row:e},e.id))]})})},Vr=()=>{"use no memo";let{table:e}=R();return(0,f.jsx)(X,{children:(0,f.jsx)(Vn,{children:e.getStartHeaderGroups().map(e=>(0,f.jsx)(Q,{children:e.headers.map(e=>(0,f.jsx)(Or,{header:e},e.id))},e.id))})})},Hr=()=>{"use no memo";let{paneRef3:e,paneRef4:t,height:n,isError:r,isSplit:i,table:a}=R();return(0,f.jsx)(f.Fragment,{children:!r&&i&&(a.state.columnPinning?.start?.length??0)>0?(0,f.jsxs)(`div`,{style:{maxWidth:`220px`,overflow:`hidden`},children:[(0,f.jsx)(`div`,{style:{height:`64px`,borderBottom:`1px solid var(--border)`}}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(Vr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(Br,{})})]}):null})},Ur=()=>{let{table:e}=R();return(0,f.jsxs)(`div`,{style:{minHeight:`50px`,padding:`16px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:`16px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`16px`,fontSize:`14px`,color:`var(--muted-foreground)`},children:[(0,f.jsxs)(`span`,{children:[`Showing `,e.getRowModel().rows.length.toLocaleString(),` of`,` `,e.getRowCount().toLocaleString(),` Rows`]}),e.getSelectedRowModel().rows.length>0&&(0,f.jsxs)(`span`,{children:[e.getSelectedRowModel().rows.length.toLocaleString(),` selected`]}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>e.getSelectedCellCount()>0?(0,f.jsxs)(`span`,{children:[e.getSelectedCellCount().toLocaleString(),` cells selected across `,e.getCellSelectionRowIds().length.toLocaleString(),` `,`rows and `,e.getCellSelectionColumnIds().length,` columns`]}):null})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,f.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:`4px`,fontSize:`14px`},children:[`Page`,` `,(0,f.jsxs)(`strong`,{children:[(e.state.pagination.pageIndex+1).toLocaleString(),` of`,` `,e.getPageCount().toLocaleString()]})]}),(0,f.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:`4px`,fontSize:`14px`},children:[`Go to page:`,(0,f.jsx)(Xt,{type:`number`,min:`1`,max:e.getPageCount(),value:e.state.pagination.pageIndex+1,onChange:t=>{let n=t.target.value?Number(t.target.value)-1:0;e.setPageIndex(n)},style:{height:`28px`,width:`64px`}})]}),(0,f.jsxs)(lr,{value:String(e.state.pagination.pageSize),onValueChange:t=>e.setPageSize(Number(t)),children:[(0,f.jsx)(fr,{size:`sm`,children:(0,f.jsx)(dr,{})}),(0,f.jsx)(pr,{children:[20,30,40,50,60,70,80,90,100].map(e=>(0,f.jsxs)(mr,{value:String(e),children:[`Show `,e]},e))})]}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.firstPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(m.ChevronsLeft,{size:16})}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(m.ChevronLeft,{size:16})}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:(0,f.jsx)(m.ChevronRight,{size:16})}),(0,f.jsx)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>e.lastPage(),disabled:!e.getCanLastPage(),children:(0,f.jsx)(m.ChevronsRight,{size:16})})]})]})},Wr=Oe(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function Gr({className:e,orientation:t,...n}){return(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:q(Wr({orientation:t}),e),...n})}function Kr({className:e,...t}){return(0,f.jsx)(p.Checkbox.Root,{"data-slot":`checkbox`,className:q(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,e),...t,children:(0,f.jsx)(p.Checkbox.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,f.jsx)(m.CheckIcon,{})})})}function qr({className:e,...t}){return(0,f.jsx)(p.Label.Root,{"data-slot":`label`,className:q(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Jr=()=>{let{table:e,isSplit:t,setIsSplit:n}=R(),[r,i]=(0,c.useState)(``),a=(0,c.useMemo)(()=>e.getAllLeafColumns().filter(e=>![`rowNumber`].includes(e.id)).filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[r,e]),o=()=>{let t=e.getAllLeafColumns().map(e=>e.id);for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}e.setColumnOrder(t)};return(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:[(0,f.jsxs)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:[`Columns (`,e.getAllLeafColumns().length,`)`]}),(0,f.jsx)(J,{title:`Restore`,variant:`ghost`,size:`icon-sm`,onClick:()=>{e.resetColumnVisibility()},children:(0,f.jsx)(m.RotateCcw,{})})]}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsx)(Xt,{type:`search`,placeholder:`Search columns...`,value:r,onChange:e=>i(e.target.value)})}),(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,flex:1,overflowY:`auto`,paddingInline:`8px`},children:(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:a.length>0?(0,f.jsx)(c.default.Fragment,{children:a.map(e=>(0,f.jsxs)(qr,{style:{display:`flex`,alignItems:`center`,minWidth:0},title:e.id.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),children:[(0,f.jsx)(Kr,{checked:e.getIsVisible(),onCheckedChange:t=>e.toggleVisibility(t===!0)}),(0,f.jsx)(`span`,{style:{overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,minWidth:0,flex:1},children:e.id.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase())})]},e.id))}):(0,f.jsx)(`div`,{className:`text-center`,children:`No columns found`})})}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,paddingInline:`8px`},children:[(0,f.jsxs)(Gr,{style:{width:`100%`},children:[(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Shuffle`,style:{flex:1},onClick:()=>o(),children:(0,f.jsx)(m.Shuffle,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reset Order`,style:{flex:1},onClick:()=>e.resetColumnOrder(),disabled:e.state.columnOrder.length===0,children:(0,f.jsx)(m.RotateCcw,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reverse Order`,style:{flex:1},onClick:()=>e.setColumnOrder([...e.getAllLeafColumns().map(e=>e.id)].reverse()),children:(0,f.jsx)(m.ArrowLeftRight,{})})]}),(0,f.jsxs)(Gr,{style:{width:`100%`},children:[(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reset Pinning`,style:{flex:1},onClick:()=>{e.resetColumnPinning(),n(!1)},disabled:!e.getIsSomeColumnsPinned(),children:(0,f.jsx)(m.PinOff,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:`Reset Sizing`,style:{flex:1},onClick:()=>e.resetColumnSizing(),disabled:Object.keys(e.state.columnSizing).length===0,children:(0,f.jsx)(m.Ruler,{})}),(0,f.jsx)(J,{variant:`outline`,size:`icon`,title:t?`Exit Split`:`Split View`,style:{flex:1},disabled:!e.getIsSomeColumnsPinned(),onClick:()=>n(!t),children:(0,f.jsx)(m.SquareSplitHorizontal,{})})]})]})]})};function Yr({className:e,...t}){return(0,f.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:q(`group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2`,e),...t})}var Xr=Oe(`group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted`,{variants:{variant:{default:`border-transparent`,outline:`border-border`,muted:`border-transparent bg-muted/50`},size:{default:`gap-2.5 px-3 py-2.5`,sm:`gap-2.5 px-3 py-2.5`,xs:`gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0`}},defaultVariants:{variant:`default`,size:`default`}});function Zr({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?p.Slot.Root:`div`;return(0,f.jsx)(a,{"data-slot":`item`,"data-variant":t,"data-size":n,className:q(Xr({variant:t,size:n,className:e})),...i})}var Qr=Oe(`flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none`,{variants:{variant:{default:`bg-transparent`,icon:`[&_svg:not([class*='size-'])]:size-4`,image:`size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function $r({className:e,variant:t=`default`,...n}){return(0,f.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:q(Qr({variant:t,className:e})),...n})}function ei({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`item-content`,className:q(`flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none`,e),...t})}function ti({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`item-title`,className:q(`line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4`,e),...t})}var ni=({columnId:e,label:t})=>{"use no memo";let{attributes:n,isDragging:r,listeners:i,setNodeRef:a,transform:o,transition:s}=(0,_.useSortable)({id:e}),c={opacity:r?.8:1,transform:ee.CSS.Translate.toString(o),transition:s,zIndex:+!!r};return(0,f.jsxs)(Zr,{ref:a,style:c,variant:`outline`,size:`sm`,title:t.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),children:[(0,f.jsx)($r,{variant:`icon`,...n,...i,style:{cursor:`grab`,color:`var(--muted-foreground)`},children:(0,f.jsx)(m.GripVertical,{})}),(0,f.jsx)(ei,{style:{minWidth:0},children:(0,f.jsx)(ti,{style:{width:`100%`,minWidth:0},children:(0,f.jsx)(`span`,{style:{display:`block`,width:`100%`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase())})})})]})},ri=()=>{"use no memo";let{table:e}=R(),t=e.state.columnOrder.length?e.state.columnOrder:e.getAllLeafColumns().map(e=>e.id),n=n=>{let{active:r,over:i}=n;if(r&&i&&r.id!==i.id){let n=t.indexOf(r.id),a=t.indexOf(i.id);e.setColumnOrder((0,_.arrayMove)(t,n,a))}},r=(0,h.useSensors)((0,h.useSensor)(h.MouseSensor,{}),(0,h.useSensor)(h.TouchSensor,{}),(0,h.useSensor)(h.KeyboardSensor,{}));return(0,f.jsx)(h.DndContext,{collisionDetection:h.closestCenter,modifiers:[g.restrictToVerticalAxis],onDragEnd:n,sensors:r,children:(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`},children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:[(0,f.jsxs)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:[`Columns DND (`,e.getAllLeafColumns().length,`)`]}),(0,f.jsx)(J,{variant:`ghost`,size:`icon-sm`,title:`Reset`,onClick:()=>e.resetColumnOrder(),children:(0,f.jsx)(m.RotateCcw,{})})]}),(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,flex:1,overflowY:`auto`,paddingInline:`8px`},children:(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:(0,f.jsx)(_.SortableContext,{items:t,strategy:_.verticalListSortingStrategy,children:(0,f.jsx)(Yr,{children:t.map(t=>{let n=e.getColumn(t);return n?(0,f.jsx)(ni,{columnId:t,label:typeof n.columnDef.header==`string`?n.columnDef.header:t},t):null})})})})})]})})};function ii({...e}){return(0,f.jsx)(p.Collapsible.Root,{"data-slot":`collapsible`,...e})}function ai({...e}){return(0,f.jsx)(p.Collapsible.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}var oi=({column:e})=>{"use no memo";let t=(0,c.useMemo)(()=>e.getCanFilter()?{id:e.id.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),uniqueValues:Array.from(e.getFacetedUniqueValues().keys())}:null,[e]),n=e.getFilterValue(),{filterVariant:r}=e.columnDef.meta??{},[i,a]=(0,c.useState)(!1);return(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{onClick:()=>a(!i),style:{display:`flex`,alignItems:`center`,gap:`8px`,cursor:`pointer`,whiteSpace:`nowrap`},children:[(0,f.jsx)(`div`,{style:{width:`28px`,height:`28px`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`4px`,transition:`all 0.2s`,transform:i?`rotate(90deg)`:`none`},children:(0,f.jsx)(m.ChevronRight,{size:16})}),(0,f.jsx)(`span`,{style:{fontSize:`0.875rem`,whiteSpace:`nowrap`},children:t?.id&&t.id.length>15?`${t.id.slice(0,15)}...`:t?.id})]}),(0,f.jsx)(ii,{open:i,children:(0,f.jsx)(ai,{children:(0,f.jsxs)(`div`,{style:{padding:`12px`,paddingRight:0},children:[(0,f.jsx)(`datalist`,{id:e.id+`list`,children:t?.uniqueValues.map((e,t)=>(0,f.jsx)(`option`,{value:e},t))}),r===`range`?(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,f.jsx)(cr,{type:`number`,value:n?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(cr,{type:`number`,value:n?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):(0,f.jsx)(cr,{type:`text`,value:n??``,onChange:t=>e.setFilterValue(t),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,list:e.id+`list`,disabled:r===void 0})]})})})]})},si=()=>{"use no memo";let{table:e,globalFilter:t,setGlobalFilter:n}=R();return(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`},children:[(0,f.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:(0,f.jsx)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:`Filters`})}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsx)(cr,{style:{width:`100%`},type:`search`,value:String(t),onChange:e=>{n?.(String(e))},placeholder:`Search all columns...`})}),(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,flex:1,overflowY:`auto`,paddingInline:`8px`},children:(0,f.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:e.getHeaderGroups().map(e=>(0,f.jsx)(c.default.Fragment,{children:e.headers.filter(e=>![`rowNumber`,`select`,`pin`,`actions`].includes(e.column.id)).map(e=>(0,f.jsx)(oi,{column:e.column},e.id))},e.id))})}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsxs)(J,{variant:`outline`,size:`sm`,style:{width:`100%`},onClick:()=>e.setColumnFilters([]),children:[(0,f.jsx)(m.RotateCcw,{size:16}),`Reset Filters`]})})]})};function ci(e,t,n){let r=window.open(``,`_blank`);if(!r){window.alert(`Print window was blocked. Please allow popups for this site and try again.`);return}let i=e=>(e==null?``:String(e)).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),a=t.map(e=>`<th>${i(e)}</th>`).join(``),o=n.map(e=>`<tr>${e.map(e=>`<td>${i(e)}</td>`).join(``)}</tr>`).join(``);r.document.open(),r.document.write(`
14
14
  <!DOCTYPE html>
15
15
  <html>
16
16
  <head>
package/dist/index.js CHANGED
@@ -3218,23 +3218,26 @@ var zi = [
3218
3218
  height: "16px"
3219
3219
  } }) }), Vi = () => {
3220
3220
  let { table: e, isSplit: t } = R(), n = (t ? e.getCenterHeaderGroups() : e.getHeaderGroups()).map((e) => e.headers.filter((e) => !e.isPlaceholder && !e.subHeaders?.length).map((e) => e.column)).flat();
3221
- return /* @__PURE__ */ M(X, { children: /* @__PURE__ */ M(Z, { children: [...Array(20)].map((r, i) => /* @__PURE__ */ M(Q, { children: n.map((n, r) => /* @__PURE__ */ M($, {
3222
- style: {
3223
- width: n.getSize(),
3224
- minWidth: n.getSize(),
3225
- maxWidth: n.getSize(),
3226
- borderRight: "1px solid",
3227
- borderColor: "var(--border)",
3228
- transition: "padding 0.2s",
3229
- padding: e.state.density === "sm" ? "4px" : e.state.density === "md" ? "8px" : "16px",
3230
- ...Ti(n, t)
3231
- },
3232
- children: /* @__PURE__ */ M(Bi, {
3233
- column: n,
3234
- i,
3235
- j: r
3236
- })
3237
- }, r)) }, i)) }) });
3221
+ return /* @__PURE__ */ M(X, {
3222
+ style: { width: e.getCenterTotalSize() },
3223
+ children: /* @__PURE__ */ M(Z, { children: [...Array(20)].map((r, i) => /* @__PURE__ */ M(Q, { children: n.map((n, r) => /* @__PURE__ */ M($, {
3224
+ style: {
3225
+ width: n.getSize(),
3226
+ minWidth: n.getSize(),
3227
+ maxWidth: n.getSize(),
3228
+ borderRight: "1px solid",
3229
+ borderColor: "var(--border)",
3230
+ transition: "padding 0.2s",
3231
+ padding: e.state.density === "sm" ? "4px" : e.state.density === "md" ? "8px" : "16px",
3232
+ ...Ti(n, t)
3233
+ },
3234
+ children: /* @__PURE__ */ M(Bi, {
3235
+ column: n,
3236
+ i,
3237
+ j: r
3238
+ })
3239
+ }, r)) }, i)) })
3240
+ });
3238
3241
  };
3239
3242
  //#endregion
3240
3243
  //#region src/package/ui/grid/sections/center/GridCenterRowPin.tsx
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-shadcn-table",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "files": [