react-shadcn-table 1.0.5 → 1.0.6
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 +3 -3
- package/dist/index.js +130 -97
- package/dist/package/ui/grid/shared/GridCellSplit.d.ts +6 -0
- package/package.json +94 -94
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
transform: rotate(360deg);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
`}),(0,f.jsx)(p.Loader,{size:16,style:{animation:`grid-skeleton-spin 1s linear infinite`}})]}):[`actions`,`pin`,`drag-handle`,`rowNumber`].includes(e.id)?(0,f.jsx)(Qn,{style:{width:`100%`,height:`16px`}}):(0,f.jsx)(Qn,{style:{width:`${$n[(t+n)%$n.length]}px`,height:`16px`}})}),tr=()=>{let{table:e,isSplit:t}=L(),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)(Y,{style:{width:e.getCenterTotalSize()},children:(0,f.jsx)(X,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Z,{children:n.map((n,r)=>(0,f.jsx)(Q,{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`,...Fn(n,t)},children:(0,f.jsx)(er,{column:n,i,j:r})},r))},i))})})};function nr({row:e}){"use no memo";let{table:t,isSplit:n}=L();return(0,f.jsx)(Z,{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)(Ln,{cell:e},e.id))})}var rr=()=>{"use no memo";let{table:e,isSplit:t,isLoading:n,isError:r,renderSubComponent:i}=L();return n?(0,f.jsx)(tr,{}):r?(0,f.jsx)(Zn,{}):e.getRowModel().rows.length===0?(0,f.jsx)(Jn,{}):(0,f.jsxs)(Y,{style:{width:e.getCenterTotalSize()},children:[e.getTopRows().map(e=>(0,f.jsx)(nr,{row:e},e.id)),(0,f.jsx)(X,{children:e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Z,{"data-state":e.getIsSelected()&&`selected`,children:(t?e.getCenterVisibleCells():e.getVisibleCells()).map(e=>(0,f.jsx)(Ln,{cell:e},e.id))}),i&&e.getIsExpanded()&&(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{colSpan:e.getVisibleCells().length,children:i({row:e})})})]},e.id))}),e.getBottomRows().map(e=>(0,f.jsx)(nr,{row:e},e.id))]})};function ir({...e}){return(0,f.jsx)(m.Select.Root,{"data-slot":`select`,...e})}function ar({className:e,...t}){return(0,f.jsx)(m.Select.Group,{"data-slot":`select-group`,className:q(`scroll-my-1 p-1`,e),...t})}function or({...e}){return(0,f.jsx)(m.Select.Value,{"data-slot":`select-value`,...e})}function sr({className:e,size:t=`default`,children:n,...r}){return(0,f.jsxs)(m.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)(m.Select.Icon,{asChild:!0,children:(0,f.jsx)(p.ChevronDownIcon,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function cr({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,f.jsx)(m.Select.Portal,{children:(0,f.jsxs)(m.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)(ur,{}),(0,f.jsx)(m.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)(dr,{})]})})}function lr({className:e,children:t,...n}){return(0,f.jsxs)(m.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)(m.Select.ItemIndicator,{children:(0,f.jsx)(p.CheckIcon,{className:`pointer-events-none`})})}),(0,f.jsx)(m.Select.ItemText,{children:t})]})}function ur({className:e,...t}){return(0,f.jsx)(m.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)(p.ChevronUpIcon,{})})}function dr({className:e,...t}){return(0,f.jsx)(m.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)(p.ChevronDownIcon,{})})}var fr=({column:e})=>{"use no memo";let t=e.getFilterValue(),{filterVariant:n,options:r}=e.columnDef.meta??{},{isFetching:i}=L(),a=r&&r.length>0?r:!i&&n===`select`?Array.from(e.getFacetedUniqueValues().keys()).sort().slice(0,5e3).map(e=>({label:String(e),value:String(e)})):[];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)(J,{style:{height:`28px`},type:`number`,value:t?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(J,{style:{height:`28px`},type:`number`,value:t?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):n===`select`?(0,f.jsxs)(ir,{value:t?.toString()??`all`,onValueChange:t=>e.setFilterValue(t===`all`?void 0:t),children:[(0,f.jsx)(sr,{style:{width:`100%`},size:`sm`,children:(0,f.jsx)(or,{})}),(0,f.jsx)(cr,{children:(0,f.jsxs)(ar,{children:[(0,f.jsx)(lr,{value:`all`,children:`All`}),a.map(e=>(0,f.jsx)(lr,{value:e.value,children:e.label},e.value))]})})]}):n&&[`text`,`time`,`date`,`datetime-local`,`month`,`week`,`number`,`tel`,`url`,`color`,`search`].includes(n)?(0,f.jsx)(J,{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 pr({...e}){return(0,f.jsx)(m.DropdownMenu.Root,{"data-slot":`dropdown-menu`,...e})}function mr({...e}){return(0,f.jsx)(m.DropdownMenu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function hr({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,f.jsx)(m.DropdownMenu.Portal,{children:(0,f.jsx)(m.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 gr({...e}){return(0,f.jsx)(m.DropdownMenu.Group,{"data-slot":`dropdown-menu-group`,...e})}function _r({className:e,inset:t,variant:n=`default`,...r}){return(0,f.jsx)(m.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 vr({className:e,...t}){return(0,f.jsx)(m.DropdownMenu.Separator,{"data-slot":`dropdown-menu-separator`,className:q(`-mx-1 my-1 h-px bg-border`,e),...t})}function yr({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 br=({header:e})=>{"use no memo";let{isLoading:t,isError:n}=L();return e.column.getCanFilter()?(0,f.jsxs)(pr,{children:[(0,f.jsx)(mr,{asChild:!0,children:(0,f.jsx)($,{size:`icon-xs`,variant:`ghost`,disabled:t||n,children:(0,f.jsx)(p.EllipsisVertical,{})})}),(0,f.jsxs)(hr,{align:`end`,children:[(0,f.jsxs)(gr,{children:[(0,f.jsxs)(_r,{onClick:()=>{e.column.toggleSorting(!1)},disabled:!e.column.getCanSort(),children:[`Sort ASC`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.ArrowUp,{})})]}),(0,f.jsxs)(_r,{onClick:()=>{e.column.toggleSorting(!0)},disabled:!e.column.getCanSort(),children:[`Sort DESC`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.ArrowDown,{})})]})]}),(0,f.jsx)(vr,{}),!e.isPlaceholder&&e.column.getCanPin()&&(0,f.jsxs)(gr,{children:[e.column.getIsPinned()!==`start`&&(0,f.jsxs)(_r,{onClick:()=>{e.column.pin(`start`)},children:[`Pin to left`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.PinIcon,{style:{transform:`rotate(45deg)`}})})]}),e.column.getIsPinned()&&(0,f.jsxs)(_r,{onClick:()=>{e.column.pin(!1)},children:[`Unpin`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.PinOff,{})})]}),e.column.getIsPinned()!==`end`&&(0,f.jsxs)(_r,{onClick:()=>{e.column.pin(`end`)},children:[`Pin to right`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.PinIcon,{style:{transform:`rotate(-45deg)`}})})]})]}),(0,f.jsx)(vr,{}),(0,f.jsx)(gr,{children:(0,f.jsxs)(_r,{onClick:()=>{e.column.toggleVisibility(!1)},disabled:!e.column.getCanHide(),children:[`Hide column`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.EyeOff,{})})]})})]})]}):null},xr=({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}})},Sr=({header:e})=>{"use no memo";let{table:t}=L(),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)(p.ChevronUpIcon,{style:{width:16,height:16}}),desc:(0,f.jsx)(p.ChevronDownIcon,{style:{width:16,height:16}})}[e.column.getIsSorted()]??null]})},Cr=({header:e})=>{"use no memo";let{isSplit:t}=L(),n={position:`relative`,whiteSpace:`nowrap`,width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,padding:0,...Fn(e.column,t)};return(0,f.jsxs)(Pn,{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)(Sr,{header:e}),(0,f.jsx)(br,{header:e})]}),(0,f.jsx)(fr,{column:e.column})]}),(0,f.jsx)(xr,{header:e})]})},wr=()=>{"use no memo";let{table:e,isSplit:t}=L();return(0,f.jsx)(Y,{style:{width:e.getCenterTotalSize()},children:(0,f.jsx)(Nn,{children:(t?e.getCenterHeaderGroups():e.getHeaderGroups()).map(e=>(0,f.jsx)(Z,{children:e.headers.map(e=>(0,f.jsx)(Cr,{header:e},e.id))},e.id))})})},Tr=()=>{"use no memo";let{paneRef1:e,paneRef2:t,height:n}=L();return(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Mn,{}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(wr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(rr,{})})]})},Er=()=>{let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:e.getEndVisibleLeafColumns().map((e,t)=>(0,f.jsx)(Q,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},Dr=()=>{let{table:e,isSplit:t}=L(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Z,{children:n.map((n,r)=>(0,f.jsx)(Q,{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`,...Fn(n,t)},children:(0,f.jsx)(er,{column:n,i,j:r})},r))},i))})})};function Or({row:e}){"use no memo";let{table:t}=L();return(0,f.jsx)(Z,{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)(Ln,{cell:e},e.id))})}var kr=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=L();return t?(0,f.jsx)(Dr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(Er,{}):(0,f.jsx)(Y,{children:(0,f.jsxs)(X,{children:[e.getTopRows().map(e=>(0,f.jsx)(Or,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Z,{"data-state":e.getIsSelected()&&`selected`,children:e.getEndVisibleCells().map(e=>(0,f.jsx)(Ln,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getTopRows().map(e=>(0,f.jsx)(Or,{row:e},e.id))]})})},Ar=()=>{"use no memo";let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(Nn,{children:e.getEndHeaderGroups().map(e=>(0,f.jsx)(Z,{children:e.headers.map(e=>(0,f.jsx)(Cr,{header:e},e.id))},e.id))})})},jr=()=>{"use no memo";let{paneRef5:e,paneRef6:t,height:n,isError:r,isSplit:i,table:a}=L();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)(Ar,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(kr,{})})]}):null})},Mr=()=>{let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:e.getStartVisibleLeafColumns().map((e,t)=>(0,f.jsx)(Q,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},Nr=()=>{let{table:e,isSplit:t}=L(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Z,{children:n.map((n,r)=>(0,f.jsx)(Q,{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`,...Fn(n,t)},children:(0,f.jsx)(er,{column:n,i,j:r})},r))},i))})})};function Pr({row:e}){"use no memo";let{table:t}=L();return(0,f.jsx)(Z,{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)(Ln,{cell:e},e.id))})}var Fr=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=L();return t?(0,f.jsx)(Nr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(Mr,{}):(0,f.jsx)(Y,{children:(0,f.jsxs)(X,{children:[e.getTopRows().map(e=>(0,f.jsx)(Pr,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Z,{"data-state":e.getIsSelected()&&`selected`,children:e.getStartVisibleCells().map(e=>(0,f.jsx)(Ln,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getBottomRows().map(e=>(0,f.jsx)(Pr,{row:e},e.id))]})})},Ir=()=>{"use no memo";let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(Nn,{children:e.getStartHeaderGroups().map(e=>(0,f.jsx)(Z,{children:e.headers.map(e=>(0,f.jsx)(Cr,{header:e},e.id))},e.id))})})},Lr=()=>{"use no memo";let{paneRef3:e,paneRef4:t,height:n,isError:r,isSplit:i,table:a}=L();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)(Ir,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(Fr,{})})]}):null})},Rr=()=>{let{table:e}=L();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)(jn,{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)(ir,{value:String(e.state.pagination.pageSize),onValueChange:t=>e.setPageSize(Number(t)),children:[(0,f.jsx)(sr,{size:`sm`,children:(0,f.jsx)(or,{})}),(0,f.jsx)(cr,{children:[20,30,40,50,60,70,80,90,100].map(e=>(0,f.jsxs)(lr,{value:String(e),children:[`Show `,e]},e))})]}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.firstPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(p.ChevronsLeft,{size:16})}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(p.ChevronLeft,{size:16})}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:(0,f.jsx)(p.ChevronRight,{size:16})}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.lastPage(),disabled:!e.getCanLastPage(),children:(0,f.jsx)(p.ChevronsRight,{size:16})})]})]})},zr=Bn(`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 Br({className:e,orientation:t,...n}){return(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:q(zr({orientation:t}),e),...n})}function Vr({className:e,...t}){return(0,f.jsx)(m.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)(m.Checkbox.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,f.jsx)(p.CheckIcon,{})})})}function Hr({className:e,...t}){return(0,f.jsx)(m.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 Ur=()=>{let{table:e,isSplit:t,setIsSplit:n}=L(),[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)($,{title:`Restore`,variant:`ghost`,size:`icon-sm`,onClick:()=>{e.resetColumnVisibility()},children:(0,f.jsx)(p.RotateCcw,{})})]}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsx)(jn,{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)(Hr,{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)(Vr,{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)(Br,{style:{width:`100%`},children:[(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Shuffle`,style:{flex:1},onClick:()=>o(),children:(0,f.jsx)(p.Shuffle,{})}),(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Reset Order`,style:{flex:1},onClick:()=>e.resetColumnOrder(),disabled:e.state.columnOrder.length===0,children:(0,f.jsx)(p.RotateCcw,{})}),(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Reverse Order`,style:{flex:1},onClick:()=>e.setColumnOrder([...e.getAllLeafColumns().map(e=>e.id)].reverse()),children:(0,f.jsx)(p.ArrowLeftRight,{})})]}),(0,f.jsxs)(Br,{style:{width:`100%`},children:[(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Reset Pinning`,style:{flex:1},onClick:()=>{e.resetColumnPinning(),n(!1)},disabled:!e.getIsSomeColumnsPinned(),children:(0,f.jsx)(p.PinOff,{})}),(0,f.jsx)($,{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)(p.Ruler,{})}),(0,f.jsx)($,{variant:`outline`,size:`icon`,title:t?`Exit Split`:`Split View`,style:{flex:1},disabled:!e.getIsSomeColumnsPinned(),onClick:()=>n(!t),children:(0,f.jsx)(p.SquareSplitHorizontal,{})})]})]})]})};function Wr({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 Gr=Bn(`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 Kr({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?m.Slot.Root:`div`;return(0,f.jsx)(a,{"data-slot":`item`,"data-variant":t,"data-size":n,className:q(Gr({variant:t,size:n,className:e})),...i})}var qr=Bn(`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 Jr({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 Yr({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 Xr({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 Zr=({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)(Kr,{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)(Jr,{variant:`icon`,...n,...i,style:{cursor:`grab`,color:`var(--muted-foreground)`},children:(0,f.jsx)(p.GripVertical,{})}),(0,f.jsx)(Yr,{style:{minWidth:0},children:(0,f.jsx)(Xr,{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())})})})]})},Qr=()=>{"use no memo";let{table:e}=L(),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)($,{variant:`ghost`,size:`icon-sm`,title:`Reset`,onClick:()=>e.resetColumnOrder(),children:(0,f.jsx)(p.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)(Wr,{children:t.map(t=>{let n=e.getColumn(t);return n?(0,f.jsx)(Zr,{columnId:t,label:typeof n.columnDef.header==`string`?n.columnDef.header:t},t):null})})})})})]})})};function $r({...e}){return(0,f.jsx)(m.Collapsible.Root,{"data-slot":`collapsible`,...e})}function ei({...e}){return(0,f.jsx)(m.Collapsible.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}var ti=({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)(p.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)($r,{open:i,children:(0,f.jsx)(ei,{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)(J,{type:`number`,value:n?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(J,{type:`number`,value:n?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):(0,f.jsx)(J,{type:`text`,value:n??``,onChange:t=>e.setFilterValue(t),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,list:e.id+`list`,disabled:r===void 0})]})})})]})},ni=()=>{"use no memo";let{table:e,globalFilter:t,setGlobalFilter:n}=L();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)(J,{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)(ti,{column:e.column},e.id))},e.id))})}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsxs)($,{variant:`outline`,size:`sm`,style:{width:`100%`},onClick:()=>{e.setColumnFilters([]),n&&n(``)},children:[(0,f.jsx)(p.RotateCcw,{size:16}),`Reset Filters`]})})]})};function ri(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,`&`).replace(/</g,`<`).replace(/>/g,`>`),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)(p.Loader,{size:16,style:{animation:`grid-skeleton-spin 1s linear infinite`}})]}):[`actions`,`pin`,`drag-handle`,`rowNumber`].includes(e.id)?(0,f.jsx)(Qn,{style:{width:`100%`,height:`16px`}}):(0,f.jsx)(Qn,{style:{width:`${$n[(t+n)%$n.length]}px`,height:`16px`}})}),tr=()=>{let{table:e,isSplit:t}=L(),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)(Y,{style:{width:e.getCenterTotalSize()},children:(0,f.jsx)(X,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Z,{children:n.map((n,r)=>(0,f.jsx)(Q,{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`,...Fn(n,t)},children:(0,f.jsx)(er,{column:n,i,j:r})},r))},i))})})};function nr({row:e}){"use no memo";let{table:t,isSplit:n}=L();return(0,f.jsx)(Z,{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)(Ln,{cell:e},e.id))})}var rr=()=>{"use no memo";let{table:e,isSplit:t,isLoading:n,isError:r,renderSubComponent:i}=L();return n?(0,f.jsx)(tr,{}):r?(0,f.jsx)(Zn,{}):e.getRowModel().rows.length===0?(0,f.jsx)(Jn,{}):(0,f.jsxs)(Y,{style:{width:e.getCenterTotalSize()},children:[e.getTopRows().map(e=>(0,f.jsx)(nr,{row:e},e.id)),(0,f.jsx)(X,{children:e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Z,{"data-state":e.getIsSelected()&&`selected`,children:(t?e.getCenterVisibleCells():e.getVisibleCells()).map(e=>(0,f.jsx)(Ln,{cell:e},e.id))}),i&&e.getIsExpanded()&&(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{colSpan:e.getVisibleCells().length,children:i({row:e})})})]},e.id))}),e.getBottomRows().map(e=>(0,f.jsx)(nr,{row:e},e.id))]})};function ir({...e}){return(0,f.jsx)(m.Select.Root,{"data-slot":`select`,...e})}function ar({className:e,...t}){return(0,f.jsx)(m.Select.Group,{"data-slot":`select-group`,className:q(`scroll-my-1 p-1`,e),...t})}function or({...e}){return(0,f.jsx)(m.Select.Value,{"data-slot":`select-value`,...e})}function sr({className:e,size:t=`default`,children:n,...r}){return(0,f.jsxs)(m.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)(m.Select.Icon,{asChild:!0,children:(0,f.jsx)(p.ChevronDownIcon,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function cr({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,f.jsx)(m.Select.Portal,{children:(0,f.jsxs)(m.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)(ur,{}),(0,f.jsx)(m.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)(dr,{})]})})}function lr({className:e,children:t,...n}){return(0,f.jsxs)(m.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)(m.Select.ItemIndicator,{children:(0,f.jsx)(p.CheckIcon,{className:`pointer-events-none`})})}),(0,f.jsx)(m.Select.ItemText,{children:t})]})}function ur({className:e,...t}){return(0,f.jsx)(m.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)(p.ChevronUpIcon,{})})}function dr({className:e,...t}){return(0,f.jsx)(m.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)(p.ChevronDownIcon,{})})}var fr=({column:e})=>{"use no memo";let t=e.getFilterValue(),{filterVariant:n,options:r}=e.columnDef.meta??{},{isFetching:i}=L(),a=r&&r.length>0?r:!i&&n===`select`?Array.from(e.getFacetedUniqueValues().keys()).sort().slice(0,5e3).map(e=>({label:String(e),value:String(e)})):[];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)(J,{style:{height:`28px`},type:`number`,value:t?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(J,{style:{height:`28px`},type:`number`,value:t?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):n===`select`?(0,f.jsxs)(ir,{value:t?.toString()??`all`,onValueChange:t=>e.setFilterValue(t===`all`?void 0:t),children:[(0,f.jsx)(sr,{style:{width:`100%`},size:`sm`,children:(0,f.jsx)(or,{})}),(0,f.jsx)(cr,{children:(0,f.jsxs)(ar,{children:[(0,f.jsx)(lr,{value:`all`,children:`All`}),a.map(e=>(0,f.jsx)(lr,{value:e.value,children:e.label},e.value))]})})]}):n&&[`text`,`time`,`date`,`datetime-local`,`month`,`week`,`number`,`tel`,`url`,`color`,`search`].includes(n)?(0,f.jsx)(J,{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 pr({...e}){return(0,f.jsx)(m.DropdownMenu.Root,{"data-slot":`dropdown-menu`,...e})}function mr({...e}){return(0,f.jsx)(m.DropdownMenu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function hr({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,f.jsx)(m.DropdownMenu.Portal,{children:(0,f.jsx)(m.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 gr({...e}){return(0,f.jsx)(m.DropdownMenu.Group,{"data-slot":`dropdown-menu-group`,...e})}function _r({className:e,inset:t,variant:n=`default`,...r}){return(0,f.jsx)(m.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 vr({className:e,...t}){return(0,f.jsx)(m.DropdownMenu.Separator,{"data-slot":`dropdown-menu-separator`,className:q(`-mx-1 my-1 h-px bg-border`,e),...t})}function yr({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 br=({header:e})=>{"use no memo";let{isLoading:t,isError:n}=L();return e.column.getCanFilter()?(0,f.jsxs)(pr,{children:[(0,f.jsx)(mr,{asChild:!0,children:(0,f.jsx)($,{size:`icon-xs`,variant:`ghost`,disabled:t||n,children:(0,f.jsx)(p.EllipsisVertical,{})})}),(0,f.jsxs)(hr,{align:`end`,children:[(0,f.jsxs)(gr,{children:[(0,f.jsxs)(_r,{onClick:()=>{e.column.toggleSorting(!1)},disabled:!e.column.getCanSort(),children:[`Sort ASC`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.ArrowUp,{})})]}),(0,f.jsxs)(_r,{onClick:()=>{e.column.toggleSorting(!0)},disabled:!e.column.getCanSort(),children:[`Sort DESC`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.ArrowDown,{})})]})]}),(0,f.jsx)(vr,{}),!e.isPlaceholder&&e.column.getCanPin()&&(0,f.jsxs)(gr,{children:[e.column.getIsPinned()!==`start`&&(0,f.jsxs)(_r,{onClick:()=>{e.column.pin(`start`)},children:[`Pin to left`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.PinIcon,{style:{transform:`rotate(45deg)`}})})]}),e.column.getIsPinned()&&(0,f.jsxs)(_r,{onClick:()=>{e.column.pin(!1)},children:[`Unpin`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.PinOff,{})})]}),e.column.getIsPinned()!==`end`&&(0,f.jsxs)(_r,{onClick:()=>{e.column.pin(`end`)},children:[`Pin to right`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.PinIcon,{style:{transform:`rotate(-45deg)`}})})]})]}),(0,f.jsx)(vr,{}),(0,f.jsx)(gr,{children:(0,f.jsxs)(_r,{onClick:()=>{e.column.toggleVisibility(!1)},disabled:!e.column.getCanHide(),children:[`Hide column`,(0,f.jsx)(yr,{children:(0,f.jsx)(p.EyeOff,{})})]})})]})]}):null},xr=({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}})},Sr=({header:e})=>{"use no memo";let{table:t}=L(),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)(p.ChevronUpIcon,{style:{width:16,height:16}}),desc:(0,f.jsx)(p.ChevronDownIcon,{style:{width:16,height:16}})}[e.column.getIsSorted()]??null]})},Cr=({header:e})=>{"use no memo";let{isSplit:t}=L(),n={position:`relative`,whiteSpace:`nowrap`,width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize(),borderRight:`1px solid`,borderColor:`var(--border)`,padding:0,...Fn(e.column,t)};return(0,f.jsxs)(Pn,{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)(Sr,{header:e}),(0,f.jsx)(br,{header:e})]}),(0,f.jsx)(fr,{column:e.column})]}),(0,f.jsx)(xr,{header:e})]})},wr=()=>{"use no memo";let{table:e,isSplit:t}=L();return(0,f.jsx)(Y,{style:{width:e.getCenterTotalSize()},children:(0,f.jsx)(Nn,{children:(t?e.getCenterHeaderGroups():e.getHeaderGroups()).map(e=>(0,f.jsx)(Z,{children:e.headers.map(e=>(0,f.jsx)(Cr,{header:e},e.id))},e.id))})})},Tr=()=>{"use no memo";let{paneRef1:e,paneRef2:t,height:n}=L();return(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Mn,{}),(0,f.jsx)(`div`,{style:{width:`100%`,overflowY:`scroll`,overflowX:`hidden`,scrollbarColor:`transparent transparent`},ref:e,children:(0,f.jsx)(wr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(rr,{})})]})},Er=e=>e.getIsSelected()?{backgroundColor:`rgba(59, 130, 246, 0.30)`}:e.getIsFocused()?{outline:`1px solid var(--ring)`,outlineOffset:`-1px`}:{},Dr=({cell:e})=>{"use no memo";let{table:t,isSplit:n}=L(),r=(0,c.useRef)(null),i={width:e.column.getSize(),minWidth:e.column.getSize(),maxWidth:e.column.getSize(),overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,border:`1px solid`,borderColor:`var(--border)`,height:`var(--cell-h)`,userSelect:`none`,cursor:e.getCanSelect()?`cell`:void 0,transition:`padding 0.2s`,padding:t.state.density===`sm`?`4px`:t.state.density===`md`?`8px`:`16px`,...Fn(e.column,n),...Er(e)},a=e.getRowSpan(),o=e.getColSpan();return a===0||o===0?null:(0,f.jsx)(Q,{ref:r,style:i,rowSpan:a,colSpan:o,tabIndex:e.getCanSelect()?e.getTabIndex():void 0,onMouseDown:e.getCanSelect()?e.getSelectionStartHandler():void 0,onMouseEnter:e.getCanSelect()?e.getSelectionExtendHandler():void 0,title:e.getValue()==null?void 0:String(e.getValue()),children:(0,f.jsx)(t.FlexRender,{cell:e})})},Or=()=>{let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:e.getEndVisibleLeafColumns().map((e,t)=>(0,f.jsx)(Q,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},kr=()=>{let{table:e,isSplit:t}=L(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Z,{children:n.map((n,r)=>(0,f.jsx)(Q,{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`,...Fn(n,t)},children:(0,f.jsx)(er,{column:n,i,j:r})},r))},i))})})};function Ar({row:e}){"use no memo";let{table:t}=L();return(0,f.jsx)(Z,{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)(Ln,{cell:e},e.id))})}var jr=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=L();return t?(0,f.jsx)(kr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(Or,{}):(0,f.jsx)(Y,{children:(0,f.jsxs)(X,{children:[e.getTopRows().map(e=>(0,f.jsx)(Ar,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Z,{"data-state":e.getIsSelected()&&`selected`,children:e.getEndVisibleCells().map(e=>(0,f.jsx)(Dr,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getTopRows().map(e=>(0,f.jsx)(Ar,{row:e},e.id))]})})},Mr=()=>{"use no memo";let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(Nn,{children:e.getEndHeaderGroups().map(e=>(0,f.jsx)(Z,{children:e.headers.map(e=>(0,f.jsx)(Cr,{header:e},e.id))},e.id))})})},Nr=()=>{"use no memo";let{paneRef5:e,paneRef6:t,height:n,isError:r,isSplit:i,table:a}=L();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)(Mr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(jr,{})})]}):null})},Pr=()=>{let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:(0,f.jsx)(Z,{children:e.getStartVisibleLeafColumns().map((e,t)=>(0,f.jsx)(Q,{style:{width:e.getSize(),minWidth:e.getSize(),maxWidth:e.getSize()}},t))})})})},Fr=()=>{let{table:e,isSplit:t}=L(),n=e.getStartHeaderGroups().map(e=>e.headers.filter(e=>!e.isPlaceholder&&!e.subHeaders?.length).map(e=>e.column)).flat();return(0,f.jsx)(Y,{children:(0,f.jsx)(X,{children:[...Array(20)].map((r,i)=>(0,f.jsx)(Z,{children:n.map((n,r)=>(0,f.jsx)(Q,{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`,...Fn(n,t)},children:(0,f.jsx)(er,{column:n,i,j:r})},r))},i))})})};function Ir({row:e}){"use no memo";let{table:t}=L();return(0,f.jsx)(Z,{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)(Ln,{cell:e},e.id))})}var Lr=()=>{"use no memo";let{table:e,isLoading:t,isError:n,renderSubComponent:r}=L();return t?(0,f.jsx)(Fr,{}):n?(0,f.jsx)(`div`,{children:`Error`}):e.getRowModel().rows.length===0?(0,f.jsx)(Pr,{}):(0,f.jsx)(Y,{children:(0,f.jsxs)(X,{children:[e.getTopRows().map(e=>(0,f.jsx)(Ir,{row:e},e.id)),e.getRowModel().rows.map(e=>(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(Z,{"data-state":e.getIsSelected()&&`selected`,children:e.getStartVisibleCells().map(e=>(0,f.jsx)(Dr,{cell:e},e.id))}),r&&e.getIsExpanded()&&(0,f.jsx)(Z,{children:(0,f.jsx)(Q,{colSpan:e.getVisibleCells().length,children:r({row:e})})})]},e.id)),e.getBottomRows().map(e=>(0,f.jsx)(Ir,{row:e},e.id))]})})},Rr=()=>{"use no memo";let{table:e}=L();return(0,f.jsx)(Y,{children:(0,f.jsx)(Nn,{children:e.getStartHeaderGroups().map(e=>(0,f.jsx)(Z,{children:e.headers.map(e=>(0,f.jsx)(Cr,{header:e},e.id))},e.id))})})},zr=()=>{"use no memo";let{paneRef3:e,paneRef4:t,height:n,isError:r,isSplit:i,table:a}=L();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)(Rr,{})}),(0,f.jsx)(`div`,{style:{width:`100%`,overflow:`scroll`,height:n},ref:t,children:(0,f.jsx)(Lr,{})})]}):null})},Br=()=>{let{table:e}=L();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)(jn,{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)(ir,{value:String(e.state.pagination.pageSize),onValueChange:t=>e.setPageSize(Number(t)),children:[(0,f.jsx)(sr,{size:`sm`,children:(0,f.jsx)(or,{})}),(0,f.jsx)(cr,{children:[20,30,40,50,60,70,80,90,100].map(e=>(0,f.jsxs)(lr,{value:String(e),children:[`Show `,e]},e))})]}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.firstPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(p.ChevronsLeft,{size:16})}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:(0,f.jsx)(p.ChevronLeft,{size:16})}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:(0,f.jsx)(p.ChevronRight,{size:16})}),(0,f.jsx)($,{variant:`outline`,size:`icon-sm`,onClick:()=>e.lastPage(),disabled:!e.getCanLastPage(),children:(0,f.jsx)(p.ChevronsRight,{size:16})})]})]})},Vr=Bn(`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 Hr({className:e,orientation:t,...n}){return(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:q(Vr({orientation:t}),e),...n})}function Ur({className:e,...t}){return(0,f.jsx)(m.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)(m.Checkbox.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,f.jsx)(p.CheckIcon,{})})})}function Wr({className:e,...t}){return(0,f.jsx)(m.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 Gr=()=>{let{table:e,isSplit:t,setIsSplit:n}=L(),[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)($,{title:`Restore`,variant:`ghost`,size:`icon-sm`,onClick:()=>{e.resetColumnVisibility()},children:(0,f.jsx)(p.RotateCcw,{})})]}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsx)(jn,{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)(Wr,{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)(Ur,{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)(Hr,{style:{width:`100%`},children:[(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Shuffle`,style:{flex:1},onClick:()=>o(),children:(0,f.jsx)(p.Shuffle,{})}),(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Reset Order`,style:{flex:1},onClick:()=>e.resetColumnOrder(),disabled:e.state.columnOrder.length===0,children:(0,f.jsx)(p.RotateCcw,{})}),(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Reverse Order`,style:{flex:1},onClick:()=>e.setColumnOrder([...e.getAllLeafColumns().map(e=>e.id)].reverse()),children:(0,f.jsx)(p.ArrowLeftRight,{})})]}),(0,f.jsxs)(Hr,{style:{width:`100%`},children:[(0,f.jsx)($,{variant:`outline`,size:`icon`,title:`Reset Pinning`,style:{flex:1},onClick:()=>{e.resetColumnPinning(),n(!1)},disabled:!e.getIsSomeColumnsPinned(),children:(0,f.jsx)(p.PinOff,{})}),(0,f.jsx)($,{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)(p.Ruler,{})}),(0,f.jsx)($,{variant:`outline`,size:`icon`,title:t?`Exit Split`:`Split View`,style:{flex:1},disabled:!e.getIsSomeColumnsPinned(),onClick:()=>n(!t),children:(0,f.jsx)(p.SquareSplitHorizontal,{})})]})]})]})};function Kr({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 qr=Bn(`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 Jr({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?m.Slot.Root:`div`;return(0,f.jsx)(a,{"data-slot":`item`,"data-variant":t,"data-size":n,className:q(qr({variant:t,size:n,className:e})),...i})}var Yr=Bn(`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 Xr({className:e,variant:t=`default`,...n}){return(0,f.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:q(Yr({variant:t,className:e})),...n})}function Zr({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 Qr({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 $r=({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)(Jr,{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)(Xr,{variant:`icon`,...n,...i,style:{cursor:`grab`,color:`var(--muted-foreground)`},children:(0,f.jsx)(p.GripVertical,{})}),(0,f.jsx)(Zr,{style:{minWidth:0},children:(0,f.jsx)(Qr,{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())})})})]})},ei=()=>{"use no memo";let{table:e}=L(),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)($,{variant:`ghost`,size:`icon-sm`,title:`Reset`,onClick:()=>e.resetColumnOrder(),children:(0,f.jsx)(p.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)(Kr,{children:t.map(t=>{let n=e.getColumn(t);return n?(0,f.jsx)($r,{columnId:t,label:typeof n.columnDef.header==`string`?n.columnDef.header:t},t):null})})})})})]})})};function ti({...e}){return(0,f.jsx)(m.Collapsible.Root,{"data-slot":`collapsible`,...e})}function ni({...e}){return(0,f.jsx)(m.Collapsible.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}var ri=({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)(p.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)(ti,{open:i,children:(0,f.jsx)(ni,{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)(J,{type:`number`,value:n?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min`}),(0,f.jsx)(J,{type:`number`,value:n?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max`})]}):(0,f.jsx)(J,{type:`text`,value:n??``,onChange:t=>e.setFilterValue(t),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,list:e.id+`list`,disabled:r===void 0})]})})})]})},ii=()=>{"use no memo";let{table:e,globalFilter:t,setGlobalFilter:n}=L();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)(J,{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)(ri,{column:e.column},e.id))},e.id))})}),(0,f.jsx)(`div`,{style:{paddingInline:`8px`},children:(0,f.jsxs)($,{variant:`outline`,size:`sm`,style:{width:`100%`},onClick:()=>{e.setColumnFilters([]),n&&n(``)},children:[(0,f.jsx)(p.RotateCcw,{size:16}),`Reset Filters`]})})]})};function ai(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,`&`).replace(/</g,`<`).replace(/>/g,`>`),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>
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
</table>
|
|
34
34
|
</body>
|
|
35
35
|
</html>
|
|
36
|
-
`),r.document.close();let s=()=>{r.focus(),r.print()};r.document.readyState===`complete`?setTimeout(s,100):(r.onload=()=>setTimeout(s,100),setTimeout(s,500))}var
|
|
37
|
-
`);await navigator.clipboard.writeText(t)},l=()=>({columnOrder:e.state.columnOrder,columnPinning:e.state.columnPinning,columnVisibility:e.state.columnVisibility,columnSizing:e.state.columnSizing,sorting:e.state.sorting,columnFilters:e.state.columnFilters}),u=(0,c.useRef)([]),d=(0,c.useRef)([]),m=(0,c.useRef)(!1),h=(0,c.useRef)(``),[,g]=(0,c.useState)(0),_=t=>{m.current=!0,e.setColumnOrder(t.columnOrder),e.setColumnPinning(t.columnPinning),e.setColumnVisibility(t.columnVisibility),e.setColumnSizing(t.columnSizing),e.setSorting(t.sorting),e.setColumnFilters(t.columnFilters),h.current=JSON.stringify(t),setTimeout(()=>{m.current=!1},0)};return(0,c.useEffect)(()=>{let e=l(),t=JSON.stringify(e);if(h.current===``){h.current=t;return}if(t===h.current)return;if(m.current){h.current=t;return}let n=JSON.parse(h.current);u.current.push(n),d.current=[],h.current=t,g(e=>e+1)},[e.state.columnOrder,e.state.columnPinning,e.state.columnVisibility,e.state.columnSizing,e.state.sorting,e.state.columnFilters]),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`,position:`relative`},children:[(0,f.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:(0,f.jsx)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:`Rows`})}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,paddingInline:`8px`},children:[(0,f.jsx)(Hr,{children:`History`}),(0,f.jsxs)(Br,{children:[(0,f.jsx)($,{size:`icon`,variant:`outline`,title:`Undo`,disabled:u.current.length===0,onClick:()=>{let e=u.current.pop();e&&(d.current.push(l()),_(e),g(e=>e+1))},children:(0,f.jsx)(p.Undo2,{})}),(0,f.jsx)($,{size:`icon`,variant:`outline`,title:`Redo`,disabled:d.current.length===0,onClick:()=>{let e=d.current.pop();e&&(u.current.push(l()),_(e),g(e=>e+1))},children:(0,f.jsx)(p.Redo2,{})})]})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,paddingInline:`8px`},children:[(0,f.jsx)(Hr,{children:`Density`}),(0,f.jsxs)(Br,{children:[(0,f.jsx)($,{size:`icon`,variant:e.state.density===`sm`?`default`:`outline`,onClick:()=>e.setDensity(`sm`),title:`Small`,children:(0,f.jsx)(p.Rows4,{})}),(0,f.jsx)($,{size:`icon`,variant:e.state.density===`md`?`default`:`outline`,onClick:()=>e.setDensity(`md`),title:`Default`,children:(0,f.jsx)(p.Rows3,{})}),(0,f.jsx)($,{size:`icon`,variant:e.state.density===`lg`?`default`:`outline`,onClick:()=>e.setDensity(`lg`),title:`Large`,children:(0,f.jsx)(p.Rows2,{})})]})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,paddingInline:`8px`},children:[(0,f.jsx)(Hr,{children:`Selection`}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`},children:[(0,f.jsxs)(Br,{children:[(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Copy Selection`,onClick:s,children:(0,f.jsx)(p.Copy,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Export to Excel`,onClick:r,children:(0,f.jsx)(p.FileSpreadsheet,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Export to PDF`,onClick:i,children:(0,f.jsx)(p.FileText,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Export to JSON`,onClick:a,children:(0,f.jsx)(p.FileJson,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Print Selection`,onClick:o,children:(0,f.jsx)(p.Printer,{})})}),(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getRowModel().rows.length===0,title:`Select All Cells`,onClick:()=>e.selectAllCells(),children:(0,f.jsx)(p.MousePointerClick,{})})]}),(0,f.jsx)(Br,{children:(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Clear Selection`,onClick:()=>e.resetCellSelection(!0),children:(0,f.jsx)(p.X,{})})})})]})]})]})};function oi({className:e,...t}){return(0,f.jsx)(p.Loader2Icon,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:q(`size-4 animate-spin`,e),...t})}var si=()=>{"use no memo";let{table:e,setIsSplit:t,gridWrapperRef:n,isFetching:r,refetch:i,setGlobalFilter:a}=L(),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=()=>{s(document.fullscreenElement===n.current)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[n]),(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:`Settings`})}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,paddingInline:`8px`,flex:1,gap:`8px`},children:[(0,f.jsxs)($,{variant:`outline`,onClick:()=>{n.current&&(document.fullscreenElement?document.exitFullscreen():n.current.requestFullscreen())},children:[o?(0,f.jsx)(p.Shrink,{}):(0,f.jsx)(p.Expand,{}),o?`Exit Fullscreen`:`Fullscreen`]}),(0,f.jsxs)($,{variant:`outline`,onClick:()=>i?.(),disabled:r,children:[r&&(0,f.jsx)(oi,{}),r?`Refreshing...`:`Refresh Data`]}),(0,f.jsx)($,{variant:`outline`,onClick:()=>{window.confirm(`Are you sure you want to reset all settings to default?`)&&(e.resetColumnPinning(),e.resetRowPinning(),e.resetColumnVisibility(),e.resetColumnOrder(),e.resetColumnSizing(),e.resetColumnFilters(),e.resetGlobalFilter(),e.resetSorting(),e.resetRowSelection(),e.resetCellSelection(!0),e.resetPagination(),e.setDensity(`md`),t(!1),a&&a(``),window.alert(`Settings have been reset to default.`))},children:`Reset to Default`})]})]})},ci=({height:e})=>{"use no memo";let[t,n]=(0,c.useState)(null),r=e=>{n(t===e?null:e)},i={width:208,borderLeft:`1px solid var(--border)`,height:`100%`};return(0,f.jsxs)(`div`,{style:{display:`flex`,overflow:`hidden`,height:e,borderBottom:`1px solid var(--border)`},children:[t===`columns`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(Ur,{})}),t===`rows`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(ai,{})}),t===`filter`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(ni,{})}),t===`dnd`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(Qr,{})}),t===`settings`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(si,{})}),(0,f.jsx)(`div`,{style:{width:28,borderLeft:`1px solid var(--border)`},children:[{value:`columns`,label:`Columns`,icon:p.Columns3},{value:`rows`,label:`Rows`,icon:p.Rows3},{value:`filter`,label:`Filter`,icon:p.Filter},{value:`dnd`,label:`Dnd`,icon:p.GripVertical},{value:`settings`,label:`Settings`,icon:p.Settings}].map(({value:e,label:n,icon:i})=>(0,f.jsxs)($,{onClick:()=>r(e),variant:t===e?`secondary`:`ghost`,style:{writingMode:`vertical-rl`,minWidth:28,width:28,fontSize:12,height:`auto`,borderRadius:`none`},children:[(0,f.jsx)(i,{size:14}),n]},e))})]})},li=({payload:e,columns:t,name:n,state:r,onColumnFiltersChange:i,onPaginationChange:a,onSortingChange:o,onRowSelectionChange:s,setGlobalFilter:c,manualPagination:l,manualFiltering:u,manualSorting:d,isLoading:p,isError:m,isFetching:h,refetch:g,height:_,getRowCanExpand:ee,renderSubComponent:v,enableCellSelection:y,enableCellSpanning:b,enableRowSelection:x,topRightSlot:te})=>{"use no memo";return(0,f.jsx)(we,{payload:e,columns:t,name:n,state:r,onColumnFiltersChange:i,onPaginationChange:a,onSortingChange:o,onRowSelectionChange:s,setGlobalFilter:c,manualPagination:l,manualFiltering:u,manualSorting:d,isLoading:p,isError:m,isFetching:h,refetch:g,height:_,getRowCanExpand:ee,renderSubComponent:v,enableCellSelection:y,enableCellSpanning:b,enableRowSelection:x,topRightSlot:te,children:(0,f.jsx)(ui,{})})},ui=()=>{"use no memo";let{gridWrapperRef:e}=L(),t=(0,c.useRef)(null),[n,r]=(0,c.useState)(0);return(0,c.useLayoutEffect)(()=>{t.current&&r(t.current.getBoundingClientRect().height)},[]),(0,c.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{r(e.getBoundingClientRect().height)},i=new ResizeObserver(n);return i.observe(e),document.addEventListener(`fullscreenchange`,n),window.addEventListener(`resize`,n),()=>{i.disconnect(),document.removeEventListener(`fullscreenchange`,n),window.removeEventListener(`resize`,n)}},[]),(0,f.jsxs)(`div`,{style:{position:`relative`,background:`color-mix(in srgb, var(--muted) 50%, transparent)`,border:`1px solid var(--border)`,borderRadius:`6px`},ref:e,children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,overflow:`hidden`,width:`100%`},children:[(0,f.jsx)(Lr,{}),(0,f.jsx)(`div`,{style:{overflow:`hidden`,flex:1},ref:t,children:(0,f.jsx)(Tr,{})}),(0,f.jsx)(jr,{}),(0,f.jsx)(ci,{height:n})]}),(0,f.jsx)(Rr,{})]})},di=()=>{let[e,t]=c.default.useState([]),[n,r]=c.default.useState({pageIndex:0,pageSize:20}),[i,a]=c.default.useState([]),[o,s]=c.default.useState({}),[l,u]=c.default.useState(``);return{state:{columnFilters:e,globalFilter:l,pagination:n,sorting:i,rowSelection:o},handlers:{onColumnFiltersChange:t,onPaginationChange:r,onSortingChange:a,setGlobalFilter:u,onRowSelectionChange:s},rowSelection:o}},fi=e=>new URLSearchParams(e.flatMap(({id:e,value:t})=>{let n=e.replace(/_/g,`.`);return Array.isArray(t)&&t.length===2?[...t[0]!=null&&t[0]!==``?[[`${n}[gte]`,String(t[0])]]:[],...t[1]!=null&&t[1]!==``?[[`${n}[lte]`,String(t[1])]]:[]]:typeof t==`object`&&t?Object.entries(t).flatMap(([e,t])=>`eq.ne.gt.gte.lt.lte.in.nin.regex.exists.all.size.elemMatch.type.mod.not.and.or.nor.text.where.geoWithin.geoIntersects.near.nearSphere.expr.jsonSchema.bitsAllClear.bitsAllSet.bitsAnyClear.bitsAnySet.rand`.split(`.`).includes(e)&&t!=null&&t!==``?[[`${n}[${e}]`,String(t)]]:[]):t!=null&&t!==``?[[n,String(t)]]:[]})).toString();function pi(e){if(!e||e.length===0)return``;let t=e.filter(e=>e.id!=null&&e.id.trim()!==``).map(e=>e.desc?e.id:`-${e.id}`);return t.length===0?``:`sort=${t.join(`,`)}`}var mi=e=>(0,c.useMemo)(()=>({pagination:e.pagination,queryParams:fi(e.columnFilters),sort:pi(e.sorting),globalFilter:e.globalFilter}),[e]);function hi(e,t,n){return Object.entries(t).filter(([,e])=>e).map(([t])=>e[Number(t)]).filter(e=>e!==void 0).map(e=>e[n])}var gi=`eq.ne.gt.gte.lt.lte.in.nin.regex.exists.all.size.elemMatch.type.mod.not.and.or.nor.text.where.geoWithin.geoIntersects.near.nearSphere.expr.jsonSchema.bitsAllClear.bitsAllSet.bitsAnyClear.bitsAnySet.rand`.split(`.`);function _i(e,t){let{id:n,value:r}=t,i=n.replace(/_/g,`.`);if(Array.isArray(r)&&r.length===2){r[0]!=null&&r[0]!==``&&e.set(`${i}[gte]`,String(r[0])),r[1]!=null&&r[1]!==``&&e.set(`${i}[lte]`,String(r[1]));return}if(typeof r==`object`&&r){Object.entries(r).forEach(([t,n])=>{gi.includes(t)&&n!=null&&n!==``&&e.set(`${i}[${t}]`,String(n))});return}r!=null&&r!==``&&e.set(i,String(r))}function vi(e){let t=new URLSearchParams;if(t.set(`page`,String(e.pagination.pageIndex+1)),t.set(`limit`,String(e.pagination.pageSize)),e.columnFilters.forEach(e=>{_i(t,e)}),e.sorting.length>0){let n=e.sorting.map(e=>e.desc?`-${e.id}`:e.id).join(`,`);t.set(`sort`,n)}return e.globalFilter&&t.set(`q`,e.globalFilter),`?${t.toString()}`}exports.Grid=li,exports.URLSearch=vi,exports.pluckSelected=hi,exports.useGrid=L,exports.useGridState=di,exports.useQueryArgs=mi;
|
|
36
|
+
`),r.document.close();let s=()=>{r.focus(),r.print()};r.document.readyState===`complete`?setTimeout(s,100):(r.onload=()=>setTimeout(s,100),setTimeout(s,500))}var oi=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),si=()=>{let{table:e,name:t}=L(),n=()=>{let t=e.getCellSelectionRowIds(),n=e.getCellSelectionColumnIds();if(t.length===0||n.length===0)return null;let r=new Set(t),i=new Set(n),a=e.getRowModel().rows.filter(e=>r.has(e.id)),o=e.getVisibleLeafColumns().filter(e=>i.has(e.id));return{header:o.map(e=>{let t=e.columnDef.header;return typeof t==`string`?t:oi(e.id)}),body:a.map(e=>{let t=new Map(e.getAllCells().map(e=>[e.column.id,e]));return o.map(e=>{let n=t.get(e.id);return n?.getIsSelected()?n.getValue():``})})}},r=()=>{let e=n();if(!e)return;let{header:r,body:i}=e,a=[r,...i],o=b.utils.aoa_to_sheet(a);o[`!cols`]=r.map((e,t)=>({wch:a.reduce((e,n)=>{let r=n[t],i=r==null?0:String(r).length;return Math.max(e,i)},0)+2}));let s=b.utils.book_new();b.utils.book_append_sheet(s,o,`Selection`),b.writeFile(s,`${t??`export`}-${Date.now()}.xlsx`)},i=()=>{let e=n();if(!e)return;let{header:r,body:i}=e,a=t??`Grid`,o=new v.default({orientation:`landscape`});o.setFontSize(12),o.text(a,14,14),(0,y.default)(o,{head:[r],body:i.map(e=>e.map(e=>e==null?``:String(e))),startY:20,styles:{fontSize:8},headStyles:{fillColor:[51,51,51]}}),o.save(`${a}-${Date.now()}.pdf`)},a=()=>{let e=n();if(!e)return;let{header:r,body:i}=e,a=t??`Grid`,o=i.map(e=>Object.fromEntries(r.map((t,n)=>[t,e[n]]))),s=new Blob([JSON.stringify(o,null,2)],{type:`application/json`}),c=URL.createObjectURL(s),l=document.createElement(`a`);l.href=c,l.download=`${a}-${Date.now()}.json`,l.click(),URL.revokeObjectURL(c)},o=()=>{let e=n();e&&ai(t??`Grid`,e.header,e.body)},s=async()=>{let e=n();if(!e)return;let t=e.body.map(e=>e.map(e=>e==null?``:String(e)).join(` `)).join(`
|
|
37
|
+
`);await navigator.clipboard.writeText(t)},l=()=>({columnOrder:e.state.columnOrder,columnPinning:e.state.columnPinning,columnVisibility:e.state.columnVisibility,columnSizing:e.state.columnSizing,sorting:e.state.sorting,columnFilters:e.state.columnFilters}),u=(0,c.useRef)([]),d=(0,c.useRef)([]),m=(0,c.useRef)(!1),h=(0,c.useRef)(``),[,g]=(0,c.useState)(0),_=t=>{m.current=!0,e.setColumnOrder(t.columnOrder),e.setColumnPinning(t.columnPinning),e.setColumnVisibility(t.columnVisibility),e.setColumnSizing(t.columnSizing),e.setSorting(t.sorting),e.setColumnFilters(t.columnFilters),h.current=JSON.stringify(t),setTimeout(()=>{m.current=!1},0)};return(0,c.useEffect)(()=>{let e=l(),t=JSON.stringify(e);if(h.current===``){h.current=t;return}if(t===h.current)return;if(m.current){h.current=t;return}let n=JSON.parse(h.current);u.current.push(n),d.current=[],h.current=t,g(e=>e+1)},[e.state.columnOrder,e.state.columnPinning,e.state.columnVisibility,e.state.columnSizing,e.state.sorting,e.state.columnFilters]),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,paddingBlock:`8px`,gap:`8px`,position:`relative`},children:[(0,f.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,paddingInline:`8px`,paddingBottom:`8px`,height:`36px`,borderBottom:`1px solid var(--border)`},children:(0,f.jsx)(`h1`,{style:{fontSize:`14px`,fontWeight:`500`},children:`Rows`})}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,paddingInline:`8px`},children:[(0,f.jsx)(Wr,{children:`History`}),(0,f.jsxs)(Hr,{children:[(0,f.jsx)($,{size:`icon`,variant:`outline`,title:`Undo`,disabled:u.current.length===0,onClick:()=>{let e=u.current.pop();e&&(d.current.push(l()),_(e),g(e=>e+1))},children:(0,f.jsx)(p.Undo2,{})}),(0,f.jsx)($,{size:`icon`,variant:`outline`,title:`Redo`,disabled:d.current.length===0,onClick:()=>{let e=d.current.pop();e&&(u.current.push(l()),_(e),g(e=>e+1))},children:(0,f.jsx)(p.Redo2,{})})]})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,paddingInline:`8px`},children:[(0,f.jsx)(Wr,{children:`Density`}),(0,f.jsxs)(Hr,{children:[(0,f.jsx)($,{size:`icon`,variant:e.state.density===`sm`?`default`:`outline`,onClick:()=>e.setDensity(`sm`),title:`Small`,children:(0,f.jsx)(p.Rows4,{})}),(0,f.jsx)($,{size:`icon`,variant:e.state.density===`md`?`default`:`outline`,onClick:()=>e.setDensity(`md`),title:`Default`,children:(0,f.jsx)(p.Rows3,{})}),(0,f.jsx)($,{size:`icon`,variant:e.state.density===`lg`?`default`:`outline`,onClick:()=>e.setDensity(`lg`),title:`Large`,children:(0,f.jsx)(p.Rows2,{})})]})]}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,paddingInline:`8px`},children:[(0,f.jsx)(Wr,{children:`Selection`}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`},children:[(0,f.jsxs)(Hr,{children:[(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Copy Selection`,onClick:s,children:(0,f.jsx)(p.Copy,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Export to Excel`,onClick:r,children:(0,f.jsx)(p.FileSpreadsheet,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Export to PDF`,onClick:i,children:(0,f.jsx)(p.FileText,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Export to JSON`,onClick:a,children:(0,f.jsx)(p.FileJson,{})})}),(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Print Selection`,onClick:o,children:(0,f.jsx)(p.Printer,{})})}),(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getRowModel().rows.length===0,title:`Select All Cells`,onClick:()=>e.selectAllCells(),children:(0,f.jsx)(p.MousePointerClick,{})})]}),(0,f.jsx)(Hr,{children:(0,f.jsx)(e.Subscribe,{source:e.atoms.cellSelection,children:()=>(0,f.jsx)($,{size:`icon`,variant:`outline`,disabled:e.getSelectedCellCount()===0,title:`Clear Selection`,onClick:()=>e.resetCellSelection(!0),children:(0,f.jsx)(p.X,{})})})})]})]})]})};function ci({className:e,...t}){return(0,f.jsx)(p.Loader2Icon,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:q(`size-4 animate-spin`,e),...t})}var li=()=>{"use no memo";let{table:e,setIsSplit:t,gridWrapperRef:n,isFetching:r,refetch:i,setGlobalFilter:a}=L(),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=()=>{s(document.fullscreenElement===n.current)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[n]),(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:`Settings`})}),(0,f.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,paddingInline:`8px`,flex:1,gap:`8px`},children:[(0,f.jsxs)($,{variant:`outline`,onClick:()=>{n.current&&(document.fullscreenElement?document.exitFullscreen():n.current.requestFullscreen())},children:[o?(0,f.jsx)(p.Shrink,{}):(0,f.jsx)(p.Expand,{}),o?`Exit Fullscreen`:`Fullscreen`]}),(0,f.jsxs)($,{variant:`outline`,onClick:()=>i?.(),disabled:r,children:[r&&(0,f.jsx)(ci,{}),r?`Refreshing...`:`Refresh Data`]}),(0,f.jsx)($,{variant:`outline`,onClick:()=>{window.confirm(`Are you sure you want to reset all settings to default?`)&&(e.resetColumnPinning(),e.resetRowPinning(),e.resetColumnVisibility(),e.resetColumnOrder(),e.resetColumnSizing(),e.resetColumnFilters(),e.resetGlobalFilter(),e.resetSorting(),e.resetRowSelection(),e.resetCellSelection(!0),e.resetPagination(),e.setDensity(`md`),t(!1),a&&a(``),window.alert(`Settings have been reset to default.`))},children:`Reset to Default`})]})]})},ui=({height:e})=>{"use no memo";let[t,n]=(0,c.useState)(null),r=e=>{n(t===e?null:e)},i={width:208,borderLeft:`1px solid var(--border)`,height:`100%`};return(0,f.jsxs)(`div`,{style:{display:`flex`,overflow:`hidden`,height:e,borderBottom:`1px solid var(--border)`},children:[t===`columns`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(Gr,{})}),t===`rows`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(si,{})}),t===`filter`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(ii,{})}),t===`dnd`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(ei,{})}),t===`settings`&&(0,f.jsx)(`div`,{style:i,children:(0,f.jsx)(li,{})}),(0,f.jsx)(`div`,{style:{width:28,borderLeft:`1px solid var(--border)`},children:[{value:`columns`,label:`Columns`,icon:p.Columns3},{value:`rows`,label:`Rows`,icon:p.Rows3},{value:`filter`,label:`Filter`,icon:p.Filter},{value:`dnd`,label:`Dnd`,icon:p.GripVertical},{value:`settings`,label:`Settings`,icon:p.Settings}].map(({value:e,label:n,icon:i})=>(0,f.jsxs)($,{onClick:()=>r(e),variant:t===e?`secondary`:`ghost`,style:{writingMode:`vertical-rl`,minWidth:28,width:28,fontSize:12,height:`auto`,borderRadius:`none`},children:[(0,f.jsx)(i,{size:14}),n]},e))})]})},di=({payload:e,columns:t,name:n,state:r,onColumnFiltersChange:i,onPaginationChange:a,onSortingChange:o,onRowSelectionChange:s,setGlobalFilter:c,manualPagination:l,manualFiltering:u,manualSorting:d,isLoading:p,isError:m,isFetching:h,refetch:g,height:_,getRowCanExpand:ee,renderSubComponent:v,enableCellSelection:y,enableCellSpanning:b,enableRowSelection:x,topRightSlot:te})=>{"use no memo";return(0,f.jsx)(we,{payload:e,columns:t,name:n,state:r,onColumnFiltersChange:i,onPaginationChange:a,onSortingChange:o,onRowSelectionChange:s,setGlobalFilter:c,manualPagination:l,manualFiltering:u,manualSorting:d,isLoading:p,isError:m,isFetching:h,refetch:g,height:_,getRowCanExpand:ee,renderSubComponent:v,enableCellSelection:y,enableCellSpanning:b,enableRowSelection:x,topRightSlot:te,children:(0,f.jsx)(fi,{})})},fi=()=>{"use no memo";let{gridWrapperRef:e}=L(),t=(0,c.useRef)(null),[n,r]=(0,c.useState)(0);return(0,c.useLayoutEffect)(()=>{t.current&&r(t.current.getBoundingClientRect().height)},[]),(0,c.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{r(e.getBoundingClientRect().height)},i=new ResizeObserver(n);return i.observe(e),document.addEventListener(`fullscreenchange`,n),window.addEventListener(`resize`,n),()=>{i.disconnect(),document.removeEventListener(`fullscreenchange`,n),window.removeEventListener(`resize`,n)}},[]),(0,f.jsxs)(`div`,{style:{position:`relative`,background:`color-mix(in srgb, var(--muted) 50%, transparent)`,border:`1px solid var(--border)`,borderRadius:`6px`},ref:e,children:[(0,f.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,overflow:`hidden`,width:`100%`},children:[(0,f.jsx)(zr,{}),(0,f.jsx)(`div`,{style:{overflow:`hidden`,flex:1},ref:t,children:(0,f.jsx)(Tr,{})}),(0,f.jsx)(Nr,{}),(0,f.jsx)(ui,{height:n})]}),(0,f.jsx)(Br,{})]})},pi=()=>{let[e,t]=c.default.useState([]),[n,r]=c.default.useState({pageIndex:0,pageSize:20}),[i,a]=c.default.useState([]),[o,s]=c.default.useState({}),[l,u]=c.default.useState(``);return{state:{columnFilters:e,globalFilter:l,pagination:n,sorting:i,rowSelection:o},handlers:{onColumnFiltersChange:t,onPaginationChange:r,onSortingChange:a,setGlobalFilter:u,onRowSelectionChange:s},rowSelection:o}},mi=e=>new URLSearchParams(e.flatMap(({id:e,value:t})=>{let n=e.replace(/_/g,`.`);return Array.isArray(t)&&t.length===2?[...t[0]!=null&&t[0]!==``?[[`${n}[gte]`,String(t[0])]]:[],...t[1]!=null&&t[1]!==``?[[`${n}[lte]`,String(t[1])]]:[]]:typeof t==`object`&&t?Object.entries(t).flatMap(([e,t])=>`eq.ne.gt.gte.lt.lte.in.nin.regex.exists.all.size.elemMatch.type.mod.not.and.or.nor.text.where.geoWithin.geoIntersects.near.nearSphere.expr.jsonSchema.bitsAllClear.bitsAllSet.bitsAnyClear.bitsAnySet.rand`.split(`.`).includes(e)&&t!=null&&t!==``?[[`${n}[${e}]`,String(t)]]:[]):t!=null&&t!==``?[[n,String(t)]]:[]})).toString();function hi(e){if(!e||e.length===0)return``;let t=e.filter(e=>e.id!=null&&e.id.trim()!==``).map(e=>e.desc?e.id:`-${e.id}`);return t.length===0?``:`sort=${t.join(`,`)}`}var gi=e=>(0,c.useMemo)(()=>({pagination:e.pagination,queryParams:mi(e.columnFilters),sort:hi(e.sorting),globalFilter:e.globalFilter}),[e]);function _i(e,t,n){return Object.entries(t).filter(([,e])=>e).map(([t])=>e[Number(t)]).filter(e=>e!==void 0).map(e=>e[n])}var vi=`eq.ne.gt.gte.lt.lte.in.nin.regex.exists.all.size.elemMatch.type.mod.not.and.or.nor.text.where.geoWithin.geoIntersects.near.nearSphere.expr.jsonSchema.bitsAllClear.bitsAllSet.bitsAnyClear.bitsAnySet.rand`.split(`.`);function yi(e,t){let{id:n,value:r}=t,i=n.replace(/_/g,`.`);if(Array.isArray(r)&&r.length===2){r[0]!=null&&r[0]!==``&&e.set(`${i}[gte]`,String(r[0])),r[1]!=null&&r[1]!==``&&e.set(`${i}[lte]`,String(r[1]));return}if(typeof r==`object`&&r){Object.entries(r).forEach(([t,n])=>{vi.includes(t)&&n!=null&&n!==``&&e.set(`${i}[${t}]`,String(n))});return}r!=null&&r!==``&&e.set(i,String(r))}function bi(e){let t=new URLSearchParams;if(t.set(`page`,String(e.pagination.pageIndex+1)),t.set(`limit`,String(e.pagination.pageSize)),e.columnFilters.forEach(e=>{yi(t,e)}),e.sorting.length>0){let n=e.sorting.map(e=>e.desc?`-${e.id}`:e.id).join(`,`);t.set(`sort`,n)}return e.globalFilter&&t.set(`q`,e.globalFilter),`?${t.toString()}`}exports.Grid=di,exports.URLSearch=bi,exports.pluckSelected=_i,exports.useGrid=L,exports.useGridState=pi,exports.useQueryArgs=gi;
|
package/dist/index.js
CHANGED
|
@@ -3607,14 +3607,47 @@ var na = ({ header: e }) => {
|
|
|
3607
3607
|
children: /* @__PURE__ */ j(zi, {})
|
|
3608
3608
|
})
|
|
3609
3609
|
] });
|
|
3610
|
-
}, ca = () => {
|
|
3610
|
+
}, ca = (e) => e.getIsSelected() ? { backgroundColor: "rgba(59, 130, 246, 0.30)" } : e.getIsFocused() ? {
|
|
3611
|
+
outline: "1px solid var(--ring)",
|
|
3612
|
+
outlineOffset: "-1px"
|
|
3613
|
+
} : {}, la = ({ cell: e }) => {
|
|
3614
|
+
"use no memo";
|
|
3615
|
+
let { table: t, isSplit: n } = I(), r = s(null), i = {
|
|
3616
|
+
width: e.column.getSize(),
|
|
3617
|
+
minWidth: e.column.getSize(),
|
|
3618
|
+
maxWidth: e.column.getSize(),
|
|
3619
|
+
overflow: "hidden",
|
|
3620
|
+
whiteSpace: "nowrap",
|
|
3621
|
+
textOverflow: "ellipsis",
|
|
3622
|
+
border: "1px solid",
|
|
3623
|
+
borderColor: "var(--border)",
|
|
3624
|
+
height: "var(--cell-h)",
|
|
3625
|
+
userSelect: "none",
|
|
3626
|
+
cursor: e.getCanSelect() ? "cell" : void 0,
|
|
3627
|
+
transition: "padding 0.2s",
|
|
3628
|
+
padding: t.state.density === "sm" ? "4px" : t.state.density === "md" ? "8px" : "16px",
|
|
3629
|
+
..._i(e.column, n),
|
|
3630
|
+
...ca(e)
|
|
3631
|
+
}, a = e.getRowSpan(), o = e.getColSpan();
|
|
3632
|
+
return a === 0 || o === 0 ? null : /* @__PURE__ */ j(Q, {
|
|
3633
|
+
ref: r,
|
|
3634
|
+
style: i,
|
|
3635
|
+
rowSpan: a,
|
|
3636
|
+
colSpan: o,
|
|
3637
|
+
tabIndex: e.getCanSelect() ? e.getTabIndex() : void 0,
|
|
3638
|
+
onMouseDown: e.getCanSelect() ? e.getSelectionStartHandler() : void 0,
|
|
3639
|
+
onMouseEnter: e.getCanSelect() ? e.getSelectionExtendHandler() : void 0,
|
|
3640
|
+
title: e.getValue() == null ? void 0 : String(e.getValue()),
|
|
3641
|
+
children: /* @__PURE__ */ j(t.FlexRender, { cell: e })
|
|
3642
|
+
});
|
|
3643
|
+
}, ua = () => {
|
|
3611
3644
|
let { table: e } = I();
|
|
3612
3645
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(Z, { children: e.getEndVisibleLeafColumns().map((e, t) => /* @__PURE__ */ j(Q, { style: {
|
|
3613
3646
|
width: e.getSize(),
|
|
3614
3647
|
minWidth: e.getSize(),
|
|
3615
3648
|
maxWidth: e.getSize()
|
|
3616
3649
|
} }, t)) }) }) });
|
|
3617
|
-
},
|
|
3650
|
+
}, da = () => {
|
|
3618
3651
|
let { table: e, isSplit: t } = I(), n = e.getStartHeaderGroups().map((e) => e.headers.filter((e) => !e.isPlaceholder && !e.subHeaders?.length).map((e) => e.column)).flat();
|
|
3619
3652
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(X, { children: [...Array(20)].map((r, i) => /* @__PURE__ */ j(Z, { children: n.map((n, r) => /* @__PURE__ */ j(Q, {
|
|
3620
3653
|
style: {
|
|
@@ -3636,7 +3669,7 @@ var na = ({ header: e }) => {
|
|
|
3636
3669
|
};
|
|
3637
3670
|
//#endregion
|
|
3638
3671
|
//#region src/package/ui/grid/sections/end/GridEndRowPin.tsx
|
|
3639
|
-
function
|
|
3672
|
+
function fa({ row: e }) {
|
|
3640
3673
|
"use no memo";
|
|
3641
3674
|
let { table: t } = I();
|
|
3642
3675
|
return /* @__PURE__ */ j(Z, {
|
|
@@ -3652,25 +3685,25 @@ function ua({ row: e }) {
|
|
|
3652
3685
|
}
|
|
3653
3686
|
//#endregion
|
|
3654
3687
|
//#region src/package/ui/grid/sections/end/GridEndBody.tsx
|
|
3655
|
-
var
|
|
3688
|
+
var pa = () => {
|
|
3656
3689
|
"use no memo";
|
|
3657
3690
|
let { table: t, isLoading: n, isError: r, renderSubComponent: i } = I();
|
|
3658
|
-
return n ? /* @__PURE__ */ j(
|
|
3659
|
-
t.getTopRows().map((e) => /* @__PURE__ */ j(
|
|
3691
|
+
return n ? /* @__PURE__ */ j(da, {}) : r ? /* @__PURE__ */ j("div", { children: "Error" }) : t.getRowModel().rows.length === 0 ? /* @__PURE__ */ j(ua, {}) : /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ M(X, { children: [
|
|
3692
|
+
t.getTopRows().map((e) => /* @__PURE__ */ j(fa, { row: e }, e.id)),
|
|
3660
3693
|
t.getRowModel().rows.map((t) => /* @__PURE__ */ M(e.Fragment, { children: [/* @__PURE__ */ j(Z, {
|
|
3661
3694
|
"data-state": t.getIsSelected() && "selected",
|
|
3662
|
-
children: t.getEndVisibleCells().map((e) => /* @__PURE__ */ j(
|
|
3695
|
+
children: t.getEndVisibleCells().map((e) => /* @__PURE__ */ j(la, { cell: e }, e.id))
|
|
3663
3696
|
}), i && t.getIsExpanded() && /* @__PURE__ */ j(Z, { children: /* @__PURE__ */ j(Q, {
|
|
3664
3697
|
colSpan: t.getVisibleCells().length,
|
|
3665
3698
|
children: i({ row: t })
|
|
3666
3699
|
}) })] }, t.id)),
|
|
3667
|
-
t.getTopRows().map((e) => /* @__PURE__ */ j(
|
|
3700
|
+
t.getTopRows().map((e) => /* @__PURE__ */ j(fa, { row: e }, e.id))
|
|
3668
3701
|
] }) });
|
|
3669
|
-
},
|
|
3702
|
+
}, ma = () => {
|
|
3670
3703
|
"use no memo";
|
|
3671
3704
|
let { table: e } = I();
|
|
3672
3705
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(hi, { children: e.getEndHeaderGroups().map((e) => /* @__PURE__ */ j(Z, { children: e.headers.map((e) => /* @__PURE__ */ j(aa, { header: e }, e.id)) }, e.id)) }) });
|
|
3673
|
-
},
|
|
3706
|
+
}, ha = () => {
|
|
3674
3707
|
"use no memo";
|
|
3675
3708
|
let { paneRef5: e, paneRef6: t, height: n, isError: r, isSplit: i, table: a } = I();
|
|
3676
3709
|
return /* @__PURE__ */ j(A, { children: !r && i && (a.state.columnPinning?.end?.length ?? 0) > 0 ? /* @__PURE__ */ M("div", {
|
|
@@ -3691,7 +3724,7 @@ var da = () => {
|
|
|
3691
3724
|
scrollbarColor: "transparent transparent"
|
|
3692
3725
|
},
|
|
3693
3726
|
ref: e,
|
|
3694
|
-
children: /* @__PURE__ */ j(
|
|
3727
|
+
children: /* @__PURE__ */ j(ma, {})
|
|
3695
3728
|
}),
|
|
3696
3729
|
/* @__PURE__ */ j("div", {
|
|
3697
3730
|
style: {
|
|
@@ -3700,18 +3733,18 @@ var da = () => {
|
|
|
3700
3733
|
height: n
|
|
3701
3734
|
},
|
|
3702
3735
|
ref: t,
|
|
3703
|
-
children: /* @__PURE__ */ j(
|
|
3736
|
+
children: /* @__PURE__ */ j(pa, {})
|
|
3704
3737
|
})
|
|
3705
3738
|
]
|
|
3706
3739
|
}) : null });
|
|
3707
|
-
},
|
|
3740
|
+
}, ga = () => {
|
|
3708
3741
|
let { table: e } = I();
|
|
3709
3742
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(Z, { children: e.getStartVisibleLeafColumns().map((e, t) => /* @__PURE__ */ j(Q, { style: {
|
|
3710
3743
|
width: e.getSize(),
|
|
3711
3744
|
minWidth: e.getSize(),
|
|
3712
3745
|
maxWidth: e.getSize()
|
|
3713
3746
|
} }, t)) }) }) });
|
|
3714
|
-
},
|
|
3747
|
+
}, _a = () => {
|
|
3715
3748
|
let { table: e, isSplit: t } = I(), n = e.getStartHeaderGroups().map((e) => e.headers.filter((e) => !e.isPlaceholder && !e.subHeaders?.length).map((e) => e.column)).flat();
|
|
3716
3749
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(X, { children: [...Array(20)].map((r, i) => /* @__PURE__ */ j(Z, { children: n.map((n, r) => /* @__PURE__ */ j(Q, {
|
|
3717
3750
|
style: {
|
|
@@ -3733,7 +3766,7 @@ var da = () => {
|
|
|
3733
3766
|
};
|
|
3734
3767
|
//#endregion
|
|
3735
3768
|
//#region src/package/ui/grid/sections/start/GridStartRowPin.tsx
|
|
3736
|
-
function
|
|
3769
|
+
function va({ row: e }) {
|
|
3737
3770
|
"use no memo";
|
|
3738
3771
|
let { table: t } = I();
|
|
3739
3772
|
return /* @__PURE__ */ j(Z, {
|
|
@@ -3749,25 +3782,25 @@ function ga({ row: e }) {
|
|
|
3749
3782
|
}
|
|
3750
3783
|
//#endregion
|
|
3751
3784
|
//#region src/package/ui/grid/sections/start/GridStartBody.tsx
|
|
3752
|
-
var
|
|
3785
|
+
var ya = () => {
|
|
3753
3786
|
"use no memo";
|
|
3754
3787
|
let { table: t, isLoading: n, isError: r, renderSubComponent: i } = I();
|
|
3755
|
-
return n ? /* @__PURE__ */ j(
|
|
3756
|
-
t.getTopRows().map((e) => /* @__PURE__ */ j(
|
|
3788
|
+
return n ? /* @__PURE__ */ j(_a, {}) : r ? /* @__PURE__ */ j("div", { children: "Error" }) : t.getRowModel().rows.length === 0 ? /* @__PURE__ */ j(ga, {}) : /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ M(X, { children: [
|
|
3789
|
+
t.getTopRows().map((e) => /* @__PURE__ */ j(va, { row: e }, e.id)),
|
|
3757
3790
|
t.getRowModel().rows.map((t) => /* @__PURE__ */ M(e.Fragment, { children: [/* @__PURE__ */ j(Z, {
|
|
3758
3791
|
"data-state": t.getIsSelected() && "selected",
|
|
3759
|
-
children: t.getStartVisibleCells().map((e) => /* @__PURE__ */ j(
|
|
3792
|
+
children: t.getStartVisibleCells().map((e) => /* @__PURE__ */ j(la, { cell: e }, e.id))
|
|
3760
3793
|
}), i && t.getIsExpanded() && /* @__PURE__ */ j(Z, { children: /* @__PURE__ */ j(Q, {
|
|
3761
3794
|
colSpan: t.getVisibleCells().length,
|
|
3762
3795
|
children: i({ row: t })
|
|
3763
3796
|
}) })] }, t.id)),
|
|
3764
|
-
t.getBottomRows().map((e) => /* @__PURE__ */ j(
|
|
3797
|
+
t.getBottomRows().map((e) => /* @__PURE__ */ j(va, { row: e }, e.id))
|
|
3765
3798
|
] }) });
|
|
3766
|
-
},
|
|
3799
|
+
}, ba = () => {
|
|
3767
3800
|
"use no memo";
|
|
3768
3801
|
let { table: e } = I();
|
|
3769
3802
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(hi, { children: e.getStartHeaderGroups().map((e) => /* @__PURE__ */ j(Z, { children: e.headers.map((e) => /* @__PURE__ */ j(aa, { header: e }, e.id)) }, e.id)) }) });
|
|
3770
|
-
},
|
|
3803
|
+
}, xa = () => {
|
|
3771
3804
|
"use no memo";
|
|
3772
3805
|
let { paneRef3: e, paneRef4: t, height: n, isError: r, isSplit: i, table: a } = I();
|
|
3773
3806
|
return /* @__PURE__ */ j(A, { children: !r && i && (a.state.columnPinning?.start?.length ?? 0) > 0 ? /* @__PURE__ */ M("div", {
|
|
@@ -3788,7 +3821,7 @@ var _a = () => {
|
|
|
3788
3821
|
scrollbarColor: "transparent transparent"
|
|
3789
3822
|
},
|
|
3790
3823
|
ref: e,
|
|
3791
|
-
children: /* @__PURE__ */ j(
|
|
3824
|
+
children: /* @__PURE__ */ j(ba, {})
|
|
3792
3825
|
}),
|
|
3793
3826
|
/* @__PURE__ */ j("div", {
|
|
3794
3827
|
style: {
|
|
@@ -3797,11 +3830,11 @@ var _a = () => {
|
|
|
3797
3830
|
height: n
|
|
3798
3831
|
},
|
|
3799
3832
|
ref: t,
|
|
3800
|
-
children: /* @__PURE__ */ j(
|
|
3833
|
+
children: /* @__PURE__ */ j(ya, {})
|
|
3801
3834
|
})
|
|
3802
3835
|
]
|
|
3803
3836
|
}) : null });
|
|
3804
|
-
},
|
|
3837
|
+
}, Sa = () => {
|
|
3805
3838
|
let { table: e } = I();
|
|
3806
3839
|
return /* @__PURE__ */ M("div", {
|
|
3807
3840
|
style: {
|
|
@@ -3943,25 +3976,25 @@ var _a = () => {
|
|
|
3943
3976
|
]
|
|
3944
3977
|
})]
|
|
3945
3978
|
});
|
|
3946
|
-
},
|
|
3979
|
+
}, Ca = Si("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", {
|
|
3947
3980
|
variants: { orientation: {
|
|
3948
3981
|
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!",
|
|
3949
3982
|
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!"
|
|
3950
3983
|
} },
|
|
3951
3984
|
defaultVariants: { orientation: "horizontal" }
|
|
3952
3985
|
});
|
|
3953
|
-
function
|
|
3986
|
+
function wa({ className: e, orientation: t, ...n }) {
|
|
3954
3987
|
return /* @__PURE__ */ j("div", {
|
|
3955
3988
|
role: "group",
|
|
3956
3989
|
"data-slot": "button-group",
|
|
3957
3990
|
"data-orientation": t,
|
|
3958
|
-
className: q(
|
|
3991
|
+
className: q(Ca({ orientation: t }), e),
|
|
3959
3992
|
...n
|
|
3960
3993
|
});
|
|
3961
3994
|
}
|
|
3962
3995
|
//#endregion
|
|
3963
3996
|
//#region src/components/ui/checkbox.tsx
|
|
3964
|
-
function
|
|
3997
|
+
function Ta({ className: e, ...t }) {
|
|
3965
3998
|
return /* @__PURE__ */ j(nt.Root, {
|
|
3966
3999
|
"data-slot": "checkbox",
|
|
3967
4000
|
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),
|
|
@@ -3975,7 +4008,7 @@ function Ca({ className: e, ...t }) {
|
|
|
3975
4008
|
}
|
|
3976
4009
|
//#endregion
|
|
3977
4010
|
//#region src/components/ui/label.tsx
|
|
3978
|
-
function
|
|
4011
|
+
function Ea({ className: e, ...t }) {
|
|
3979
4012
|
return /* @__PURE__ */ j(it.Root, {
|
|
3980
4013
|
"data-slot": "label",
|
|
3981
4014
|
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),
|
|
@@ -3984,7 +4017,7 @@ function wa({ className: e, ...t }) {
|
|
|
3984
4017
|
}
|
|
3985
4018
|
//#endregion
|
|
3986
4019
|
//#region src/package/ui/toolbar/right/ToolbarRightColumns.tsx
|
|
3987
|
-
var
|
|
4020
|
+
var Da = () => {
|
|
3988
4021
|
let { table: t, isSplit: n, setIsSplit: r } = I(), [i, a] = c(""), s = o(() => t.getAllLeafColumns().filter((e) => !["rowNumber"].includes(e.id)).filter((e) => e.id.toLowerCase().includes(i.toLowerCase())), [i, t]), l = () => {
|
|
3989
4022
|
let e = t.getAllLeafColumns().map((e) => e.id);
|
|
3990
4023
|
for (let t = e.length - 1; t > 0; t--) {
|
|
@@ -4055,14 +4088,14 @@ var Ta = () => {
|
|
|
4055
4088
|
flexDirection: "column",
|
|
4056
4089
|
gap: "16px"
|
|
4057
4090
|
},
|
|
4058
|
-
children: s.length > 0 ? /* @__PURE__ */ j(e.Fragment, { children: s.map((e) => /* @__PURE__ */ M(
|
|
4091
|
+
children: s.length > 0 ? /* @__PURE__ */ j(e.Fragment, { children: s.map((e) => /* @__PURE__ */ M(Ea, {
|
|
4059
4092
|
style: {
|
|
4060
4093
|
display: "flex",
|
|
4061
4094
|
alignItems: "center",
|
|
4062
4095
|
minWidth: 0
|
|
4063
4096
|
},
|
|
4064
4097
|
title: e.id.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()),
|
|
4065
|
-
children: [/* @__PURE__ */ j(
|
|
4098
|
+
children: [/* @__PURE__ */ j(Ta, {
|
|
4066
4099
|
checked: e.getIsVisible(),
|
|
4067
4100
|
onCheckedChange: (t) => e.toggleVisibility(t === !0)
|
|
4068
4101
|
}), /* @__PURE__ */ j("span", {
|
|
@@ -4088,7 +4121,7 @@ var Ta = () => {
|
|
|
4088
4121
|
gap: "8px",
|
|
4089
4122
|
paddingInline: "8px"
|
|
4090
4123
|
},
|
|
4091
|
-
children: [/* @__PURE__ */ M(
|
|
4124
|
+
children: [/* @__PURE__ */ M(wa, {
|
|
4092
4125
|
style: { width: "100%" },
|
|
4093
4126
|
children: [
|
|
4094
4127
|
/* @__PURE__ */ j($, {
|
|
@@ -4117,7 +4150,7 @@ var Ta = () => {
|
|
|
4117
4150
|
children: /* @__PURE__ */ j(ve, {})
|
|
4118
4151
|
})
|
|
4119
4152
|
]
|
|
4120
|
-
}), /* @__PURE__ */ M(
|
|
4153
|
+
}), /* @__PURE__ */ M(wa, {
|
|
4121
4154
|
style: { width: "100%" },
|
|
4122
4155
|
children: [
|
|
4123
4156
|
/* @__PURE__ */ j($, {
|
|
@@ -4157,7 +4190,7 @@ var Ta = () => {
|
|
|
4157
4190
|
};
|
|
4158
4191
|
//#endregion
|
|
4159
4192
|
//#region src/components/ui/item.tsx
|
|
4160
|
-
function
|
|
4193
|
+
function Oa({ className: e, ...t }) {
|
|
4161
4194
|
return /* @__PURE__ */ j("div", {
|
|
4162
4195
|
role: "list",
|
|
4163
4196
|
"data-slot": "item-group",
|
|
@@ -4165,7 +4198,7 @@ function Ea({ className: e, ...t }) {
|
|
|
4165
4198
|
...t
|
|
4166
4199
|
});
|
|
4167
4200
|
}
|
|
4168
|
-
var
|
|
4201
|
+
var ka = Si("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", {
|
|
4169
4202
|
variants: {
|
|
4170
4203
|
variant: {
|
|
4171
4204
|
default: "border-transparent",
|
|
@@ -4183,13 +4216,13 @@ var Da = Si("group/item flex w-full flex-wrap items-center rounded-lg border tex
|
|
|
4183
4216
|
size: "default"
|
|
4184
4217
|
}
|
|
4185
4218
|
});
|
|
4186
|
-
function
|
|
4219
|
+
function Aa({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
|
|
4187
4220
|
let a = r ? at.Root : "div";
|
|
4188
4221
|
return /* @__PURE__ */ j(a, {
|
|
4189
4222
|
"data-slot": "item",
|
|
4190
4223
|
"data-variant": t,
|
|
4191
4224
|
"data-size": n,
|
|
4192
|
-
className: q(
|
|
4225
|
+
className: q(ka({
|
|
4193
4226
|
variant: t,
|
|
4194
4227
|
size: n,
|
|
4195
4228
|
className: e
|
|
@@ -4197,7 +4230,7 @@ function Oa({ className: e, variant: t = "default", size: n = "default", asChild
|
|
|
4197
4230
|
...i
|
|
4198
4231
|
});
|
|
4199
4232
|
}
|
|
4200
|
-
var
|
|
4233
|
+
var ja = Si("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", {
|
|
4201
4234
|
variants: { variant: {
|
|
4202
4235
|
default: "bg-transparent",
|
|
4203
4236
|
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
@@ -4205,25 +4238,25 @@ var ka = Si("flex shrink-0 items-center justify-center gap-2 group-has-data-[slo
|
|
|
4205
4238
|
} },
|
|
4206
4239
|
defaultVariants: { variant: "default" }
|
|
4207
4240
|
});
|
|
4208
|
-
function
|
|
4241
|
+
function Ma({ className: e, variant: t = "default", ...n }) {
|
|
4209
4242
|
return /* @__PURE__ */ j("div", {
|
|
4210
4243
|
"data-slot": "item-media",
|
|
4211
4244
|
"data-variant": t,
|
|
4212
|
-
className: q(
|
|
4245
|
+
className: q(ja({
|
|
4213
4246
|
variant: t,
|
|
4214
4247
|
className: e
|
|
4215
4248
|
})),
|
|
4216
4249
|
...n
|
|
4217
4250
|
});
|
|
4218
4251
|
}
|
|
4219
|
-
function
|
|
4252
|
+
function Na({ className: e, ...t }) {
|
|
4220
4253
|
return /* @__PURE__ */ j("div", {
|
|
4221
4254
|
"data-slot": "item-content",
|
|
4222
4255
|
className: q("flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none", e),
|
|
4223
4256
|
...t
|
|
4224
4257
|
});
|
|
4225
4258
|
}
|
|
4226
|
-
function
|
|
4259
|
+
function Pa({ className: e, ...t }) {
|
|
4227
4260
|
return /* @__PURE__ */ j("div", {
|
|
4228
4261
|
"data-slot": "item-title",
|
|
4229
4262
|
className: q("line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4", e),
|
|
@@ -4232,7 +4265,7 @@ function Ma({ className: e, ...t }) {
|
|
|
4232
4265
|
}
|
|
4233
4266
|
//#endregion
|
|
4234
4267
|
//#region src/package/ui/toolbar/right/ToolbarRightDnd.tsx
|
|
4235
|
-
var
|
|
4268
|
+
var Fa = ({ columnId: e, label: t }) => {
|
|
4236
4269
|
"use no memo";
|
|
4237
4270
|
let { attributes: n, isDragging: r, listeners: i, setNodeRef: a, transform: o, transition: s } = gt({ id: e }), c = {
|
|
4238
4271
|
opacity: r ? .8 : 1,
|
|
@@ -4240,13 +4273,13 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4240
4273
|
transition: s,
|
|
4241
4274
|
zIndex: +!!r
|
|
4242
4275
|
};
|
|
4243
|
-
return /* @__PURE__ */ M(
|
|
4276
|
+
return /* @__PURE__ */ M(Aa, {
|
|
4244
4277
|
ref: a,
|
|
4245
4278
|
style: c,
|
|
4246
4279
|
variant: "outline",
|
|
4247
4280
|
size: "sm",
|
|
4248
4281
|
title: t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()),
|
|
4249
|
-
children: [/* @__PURE__ */ j(
|
|
4282
|
+
children: [/* @__PURE__ */ j(Ma, {
|
|
4250
4283
|
variant: "icon",
|
|
4251
4284
|
...n,
|
|
4252
4285
|
...i,
|
|
@@ -4255,9 +4288,9 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4255
4288
|
color: "var(--muted-foreground)"
|
|
4256
4289
|
},
|
|
4257
4290
|
children: /* @__PURE__ */ j(Ie, {})
|
|
4258
|
-
}), /* @__PURE__ */ j(
|
|
4291
|
+
}), /* @__PURE__ */ j(Na, {
|
|
4259
4292
|
style: { minWidth: 0 },
|
|
4260
|
-
children: /* @__PURE__ */ j(
|
|
4293
|
+
children: /* @__PURE__ */ j(Pa, {
|
|
4261
4294
|
style: {
|
|
4262
4295
|
width: "100%",
|
|
4263
4296
|
minWidth: 0
|
|
@@ -4276,7 +4309,7 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4276
4309
|
})
|
|
4277
4310
|
})]
|
|
4278
4311
|
});
|
|
4279
|
-
},
|
|
4312
|
+
}, Ia = () => {
|
|
4280
4313
|
"use no memo";
|
|
4281
4314
|
let { table: e } = I(), t = e.state.columnOrder.length ? e.state.columnOrder : e.getAllLeafColumns().map((e) => e.id), n = (n) => {
|
|
4282
4315
|
let { active: r, over: i } = n;
|
|
@@ -4342,9 +4375,9 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4342
4375
|
children: /* @__PURE__ */ j(mt, {
|
|
4343
4376
|
items: t,
|
|
4344
4377
|
strategy: _t,
|
|
4345
|
-
children: /* @__PURE__ */ j(
|
|
4378
|
+
children: /* @__PURE__ */ j(Oa, { children: t.map((t) => {
|
|
4346
4379
|
let n = e.getColumn(t);
|
|
4347
|
-
return n ? /* @__PURE__ */ j(
|
|
4380
|
+
return n ? /* @__PURE__ */ j(Fa, {
|
|
4348
4381
|
columnId: t,
|
|
4349
4382
|
label: typeof n.columnDef.header == "string" ? n.columnDef.header : t
|
|
4350
4383
|
}, t) : null;
|
|
@@ -4357,13 +4390,13 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4357
4390
|
};
|
|
4358
4391
|
//#endregion
|
|
4359
4392
|
//#region src/components/ui/collapsible.tsx
|
|
4360
|
-
function
|
|
4393
|
+
function La({ ...e }) {
|
|
4361
4394
|
return /* @__PURE__ */ j(rt.Root, {
|
|
4362
4395
|
"data-slot": "collapsible",
|
|
4363
4396
|
...e
|
|
4364
4397
|
});
|
|
4365
4398
|
}
|
|
4366
|
-
function
|
|
4399
|
+
function Ra({ ...e }) {
|
|
4367
4400
|
return /* @__PURE__ */ j(rt.CollapsibleContent, {
|
|
4368
4401
|
"data-slot": "collapsible-content",
|
|
4369
4402
|
...e
|
|
@@ -4371,7 +4404,7 @@ function Ia({ ...e }) {
|
|
|
4371
4404
|
}
|
|
4372
4405
|
//#endregion
|
|
4373
4406
|
//#region src/package/ui/toolbar/right/ToolbarRightFilter.tsx
|
|
4374
|
-
var
|
|
4407
|
+
var za = ({ column: e }) => {
|
|
4375
4408
|
"use no memo";
|
|
4376
4409
|
let t = o(() => e.getCanFilter() ? {
|
|
4377
4410
|
id: e.id.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()),
|
|
@@ -4405,9 +4438,9 @@ var La = ({ column: e }) => {
|
|
|
4405
4438
|
},
|
|
4406
4439
|
children: t?.id && t.id.length > 15 ? `${t.id.slice(0, 15)}...` : t?.id
|
|
4407
4440
|
})]
|
|
4408
|
-
}), /* @__PURE__ */ j(
|
|
4441
|
+
}), /* @__PURE__ */ j(La, {
|
|
4409
4442
|
open: i,
|
|
4410
|
-
children: /* @__PURE__ */ j(
|
|
4443
|
+
children: /* @__PURE__ */ j(Ra, { children: /* @__PURE__ */ M("div", {
|
|
4411
4444
|
style: {
|
|
4412
4445
|
padding: "12px",
|
|
4413
4446
|
paddingRight: 0
|
|
@@ -4441,7 +4474,7 @@ var La = ({ column: e }) => {
|
|
|
4441
4474
|
})]
|
|
4442
4475
|
}) })
|
|
4443
4476
|
})] });
|
|
4444
|
-
},
|
|
4477
|
+
}, Ba = () => {
|
|
4445
4478
|
"use no memo";
|
|
4446
4479
|
let { table: t, globalFilter: n, setGlobalFilter: r } = I();
|
|
4447
4480
|
return /* @__PURE__ */ M("div", {
|
|
@@ -4502,7 +4535,7 @@ var La = ({ column: e }) => {
|
|
|
4502
4535
|
"select",
|
|
4503
4536
|
"pin",
|
|
4504
4537
|
"actions"
|
|
4505
|
-
].includes(e.column.id)).map((e) => /* @__PURE__ */ j(
|
|
4538
|
+
].includes(e.column.id)).map((e) => /* @__PURE__ */ j(za, { column: e.column }, e.id)) }, t.id))
|
|
4506
4539
|
})
|
|
4507
4540
|
}),
|
|
4508
4541
|
/* @__PURE__ */ j("div", {
|
|
@@ -4522,7 +4555,7 @@ var La = ({ column: e }) => {
|
|
|
4522
4555
|
};
|
|
4523
4556
|
//#endregion
|
|
4524
4557
|
//#region src/package/utils/printTable.ts
|
|
4525
|
-
function
|
|
4558
|
+
function Va(e, t, n) {
|
|
4526
4559
|
let r = window.open("", "_blank");
|
|
4527
4560
|
if (!r) {
|
|
4528
4561
|
window.alert("Print window was blocked. Please allow popups for this site and try again.");
|
|
@@ -4560,7 +4593,7 @@ function za(e, t, n) {
|
|
|
4560
4593
|
}
|
|
4561
4594
|
//#endregion
|
|
4562
4595
|
//#region src/package/ui/toolbar/right/ToolbarRightRows.tsx
|
|
4563
|
-
var
|
|
4596
|
+
var Ha = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()), Ua = () => {
|
|
4564
4597
|
let { table: e, name: t } = I(), n = () => {
|
|
4565
4598
|
let t = e.getCellSelectionRowIds(), n = e.getCellSelectionColumnIds();
|
|
4566
4599
|
if (t.length === 0 || n.length === 0) return null;
|
|
@@ -4568,7 +4601,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4568
4601
|
return {
|
|
4569
4602
|
header: o.map((e) => {
|
|
4570
4603
|
let t = e.columnDef.header;
|
|
4571
|
-
return typeof t == "string" ? t :
|
|
4604
|
+
return typeof t == "string" ? t : Ha(e.id);
|
|
4572
4605
|
}),
|
|
4573
4606
|
body: a.map((e) => {
|
|
4574
4607
|
let t = new Map(e.getAllCells().map((e) => [e.column.id, e]));
|
|
@@ -4610,7 +4643,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4610
4643
|
l.href = c, l.download = `${a}-${Date.now()}.json`, l.click(), URL.revokeObjectURL(c);
|
|
4611
4644
|
}, l = () => {
|
|
4612
4645
|
let e = n();
|
|
4613
|
-
e &&
|
|
4646
|
+
e && Va(t ?? "Grid", e.header, e.body);
|
|
4614
4647
|
}, u = async () => {
|
|
4615
4648
|
let e = n();
|
|
4616
4649
|
if (!e) return;
|
|
@@ -4682,7 +4715,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4682
4715
|
gap: "12px",
|
|
4683
4716
|
paddingInline: "8px"
|
|
4684
4717
|
},
|
|
4685
|
-
children: [/* @__PURE__ */ j(
|
|
4718
|
+
children: [/* @__PURE__ */ j(Ea, { children: "History" }), /* @__PURE__ */ M(wa, { children: [/* @__PURE__ */ j($, {
|
|
4686
4719
|
size: "icon",
|
|
4687
4720
|
variant: "outline",
|
|
4688
4721
|
title: "Undo",
|
|
@@ -4711,7 +4744,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4711
4744
|
gap: "12px",
|
|
4712
4745
|
paddingInline: "8px"
|
|
4713
4746
|
},
|
|
4714
|
-
children: [/* @__PURE__ */ j(
|
|
4747
|
+
children: [/* @__PURE__ */ j(Ea, { children: "Density" }), /* @__PURE__ */ M(wa, { children: [
|
|
4715
4748
|
/* @__PURE__ */ j($, {
|
|
4716
4749
|
size: "icon",
|
|
4717
4750
|
variant: e.state.density === "sm" ? "default" : "outline",
|
|
@@ -4742,13 +4775,13 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4742
4775
|
gap: "12px",
|
|
4743
4776
|
paddingInline: "8px"
|
|
4744
4777
|
},
|
|
4745
|
-
children: [/* @__PURE__ */ j(
|
|
4778
|
+
children: [/* @__PURE__ */ j(Ea, { children: "Selection" }), /* @__PURE__ */ M("div", {
|
|
4746
4779
|
style: {
|
|
4747
4780
|
display: "flex",
|
|
4748
4781
|
flexDirection: "column",
|
|
4749
4782
|
gap: "8px"
|
|
4750
4783
|
},
|
|
4751
|
-
children: [/* @__PURE__ */ M(
|
|
4784
|
+
children: [/* @__PURE__ */ M(wa, { children: [
|
|
4752
4785
|
/* @__PURE__ */ j(e.Subscribe, {
|
|
4753
4786
|
source: e.atoms.cellSelection,
|
|
4754
4787
|
children: () => /* @__PURE__ */ j($, {
|
|
@@ -4812,7 +4845,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4812
4845
|
onClick: () => e.selectAllCells(),
|
|
4813
4846
|
children: /* @__PURE__ */ j(ze, {})
|
|
4814
4847
|
})
|
|
4815
|
-
] }), /* @__PURE__ */ j(
|
|
4848
|
+
] }), /* @__PURE__ */ j(wa, { children: /* @__PURE__ */ j(e.Subscribe, {
|
|
4816
4849
|
source: e.atoms.cellSelection,
|
|
4817
4850
|
children: () => /* @__PURE__ */ j($, {
|
|
4818
4851
|
size: "icon",
|
|
@@ -4830,7 +4863,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4830
4863
|
};
|
|
4831
4864
|
//#endregion
|
|
4832
4865
|
//#region src/components/ui/spinner.tsx
|
|
4833
|
-
function
|
|
4866
|
+
function Wa({ className: e, ...t }) {
|
|
4834
4867
|
return /* @__PURE__ */ j(Re, {
|
|
4835
4868
|
"data-slot": "spinner",
|
|
4836
4869
|
role: "status",
|
|
@@ -4841,7 +4874,7 @@ function Ha({ className: e, ...t }) {
|
|
|
4841
4874
|
}
|
|
4842
4875
|
//#endregion
|
|
4843
4876
|
//#region src/package/ui/toolbar/right/ToolbarRightSettings.tsx
|
|
4844
|
-
var
|
|
4877
|
+
var Ga = () => {
|
|
4845
4878
|
"use no memo";
|
|
4846
4879
|
let { table: e, setIsSplit: t, gridWrapperRef: n, isFetching: r, refetch: a, setGlobalFilter: o } = I(), [s, l] = c(!1);
|
|
4847
4880
|
return i(() => {
|
|
@@ -4894,7 +4927,7 @@ var Ua = () => {
|
|
|
4894
4927
|
variant: "outline",
|
|
4895
4928
|
onClick: () => a?.(),
|
|
4896
4929
|
disabled: r,
|
|
4897
|
-
children: [r && /* @__PURE__ */ j(
|
|
4930
|
+
children: [r && /* @__PURE__ */ j(Wa, {}), r ? "Refreshing..." : "Refresh Data"]
|
|
4898
4931
|
}),
|
|
4899
4932
|
/* @__PURE__ */ j($, {
|
|
4900
4933
|
variant: "outline",
|
|
@@ -4906,7 +4939,7 @@ var Ua = () => {
|
|
|
4906
4939
|
]
|
|
4907
4940
|
})]
|
|
4908
4941
|
});
|
|
4909
|
-
},
|
|
4942
|
+
}, Ka = ({ height: e }) => {
|
|
4910
4943
|
"use no memo";
|
|
4911
4944
|
let [t, n] = c(null), r = (e) => {
|
|
4912
4945
|
n(t === e ? null : e);
|
|
@@ -4925,23 +4958,23 @@ var Ua = () => {
|
|
|
4925
4958
|
children: [
|
|
4926
4959
|
t === "columns" && /* @__PURE__ */ j("div", {
|
|
4927
4960
|
style: i,
|
|
4928
|
-
children: /* @__PURE__ */ j(
|
|
4961
|
+
children: /* @__PURE__ */ j(Da, {})
|
|
4929
4962
|
}),
|
|
4930
4963
|
t === "rows" && /* @__PURE__ */ j("div", {
|
|
4931
4964
|
style: i,
|
|
4932
|
-
children: /* @__PURE__ */ j(
|
|
4965
|
+
children: /* @__PURE__ */ j(Ua, {})
|
|
4933
4966
|
}),
|
|
4934
4967
|
t === "filter" && /* @__PURE__ */ j("div", {
|
|
4935
4968
|
style: i,
|
|
4936
|
-
children: /* @__PURE__ */ j(
|
|
4969
|
+
children: /* @__PURE__ */ j(Ba, {})
|
|
4937
4970
|
}),
|
|
4938
4971
|
t === "dnd" && /* @__PURE__ */ j("div", {
|
|
4939
4972
|
style: i,
|
|
4940
|
-
children: /* @__PURE__ */ j(
|
|
4973
|
+
children: /* @__PURE__ */ j(Ia, {})
|
|
4941
4974
|
}),
|
|
4942
4975
|
t === "settings" && /* @__PURE__ */ j("div", {
|
|
4943
4976
|
style: i,
|
|
4944
|
-
children: /* @__PURE__ */ j(
|
|
4977
|
+
children: /* @__PURE__ */ j(Ga, {})
|
|
4945
4978
|
}),
|
|
4946
4979
|
/* @__PURE__ */ j("div", {
|
|
4947
4980
|
style: {
|
|
@@ -4990,7 +5023,7 @@ var Ua = () => {
|
|
|
4990
5023
|
})
|
|
4991
5024
|
]
|
|
4992
5025
|
});
|
|
4993
|
-
},
|
|
5026
|
+
}, qa = ({ payload: e, columns: t, name: n, state: r, onColumnFiltersChange: i, onPaginationChange: a, onSortingChange: o, onRowSelectionChange: s, setGlobalFilter: c, manualPagination: l, manualFiltering: u, manualSorting: d, isLoading: f, isError: p, isFetching: m, refetch: h, height: g, getRowCanExpand: _, renderSubComponent: ee, enableCellSelection: te, enableCellSpanning: v, enableRowSelection: ne, topRightSlot: re }) => {
|
|
4994
5027
|
"use no memo";
|
|
4995
5028
|
return /* @__PURE__ */ j(cn, {
|
|
4996
5029
|
payload: e,
|
|
@@ -5016,9 +5049,9 @@ var Ua = () => {
|
|
|
5016
5049
|
enableCellSpanning: v,
|
|
5017
5050
|
enableRowSelection: ne,
|
|
5018
5051
|
topRightSlot: re,
|
|
5019
|
-
children: /* @__PURE__ */ j(
|
|
5052
|
+
children: /* @__PURE__ */ j(Ja, {})
|
|
5020
5053
|
});
|
|
5021
|
-
},
|
|
5054
|
+
}, Ja = () => {
|
|
5022
5055
|
"use no memo";
|
|
5023
5056
|
let { gridWrapperRef: e } = I(), t = s(null), [n, r] = c(0);
|
|
5024
5057
|
return a(() => {
|
|
@@ -5048,7 +5081,7 @@ var Ua = () => {
|
|
|
5048
5081
|
width: "100%"
|
|
5049
5082
|
},
|
|
5050
5083
|
children: [
|
|
5051
|
-
/* @__PURE__ */ j(
|
|
5084
|
+
/* @__PURE__ */ j(xa, {}),
|
|
5052
5085
|
/* @__PURE__ */ j("div", {
|
|
5053
5086
|
style: {
|
|
5054
5087
|
overflow: "hidden",
|
|
@@ -5057,12 +5090,12 @@ var Ua = () => {
|
|
|
5057
5090
|
ref: t,
|
|
5058
5091
|
children: /* @__PURE__ */ j(sa, {})
|
|
5059
5092
|
}),
|
|
5060
|
-
/* @__PURE__ */ j(
|
|
5061
|
-
/* @__PURE__ */ j(
|
|
5093
|
+
/* @__PURE__ */ j(ha, {}),
|
|
5094
|
+
/* @__PURE__ */ j(Ka, { height: n })
|
|
5062
5095
|
]
|
|
5063
|
-
}), /* @__PURE__ */ j(
|
|
5096
|
+
}), /* @__PURE__ */ j(Sa, {})]
|
|
5064
5097
|
});
|
|
5065
|
-
},
|
|
5098
|
+
}, Ya = () => {
|
|
5066
5099
|
let [t, n] = e.useState([]), [r, i] = e.useState({
|
|
5067
5100
|
pageIndex: 0,
|
|
5068
5101
|
pageSize: 20
|
|
@@ -5084,34 +5117,34 @@ var Ua = () => {
|
|
|
5084
5117
|
},
|
|
5085
5118
|
rowSelection: s
|
|
5086
5119
|
};
|
|
5087
|
-
},
|
|
5120
|
+
}, Xa = (e) => new URLSearchParams(e.flatMap(({ id: e, value: t }) => {
|
|
5088
5121
|
let n = e.replace(/_/g, ".");
|
|
5089
5122
|
return Array.isArray(t) && t.length === 2 ? [...t[0] != null && t[0] !== "" ? [[`${n}[gte]`, String(t[0])]] : [], ...t[1] != null && t[1] !== "" ? [[`${n}[lte]`, String(t[1])]] : []] : typeof t == "object" && t ? Object.entries(t).flatMap(([e, t]) => (/* @__PURE__ */ "eq.ne.gt.gte.lt.lte.in.nin.regex.exists.all.size.elemMatch.type.mod.not.and.or.nor.text.where.geoWithin.geoIntersects.near.nearSphere.expr.jsonSchema.bitsAllClear.bitsAllSet.bitsAnyClear.bitsAnySet.rand".split(".")).includes(e) && t != null && t !== "" ? [[`${n}[${e}]`, String(t)]] : []) : t != null && t !== "" ? [[n, String(t)]] : [];
|
|
5090
5123
|
})).toString();
|
|
5091
5124
|
//#endregion
|
|
5092
5125
|
//#region src/package/utils/buildSortString.ts
|
|
5093
|
-
function
|
|
5126
|
+
function Za(e) {
|
|
5094
5127
|
if (!e || e.length === 0) return "";
|
|
5095
5128
|
let t = e.filter((e) => e.id != null && e.id.trim() !== "").map((e) => e.desc ? e.id : `-${e.id}`);
|
|
5096
5129
|
return t.length === 0 ? "" : `sort=${t.join(",")}`;
|
|
5097
5130
|
}
|
|
5098
5131
|
//#endregion
|
|
5099
5132
|
//#region src/package/hooks/useQueryArgs.ts
|
|
5100
|
-
var
|
|
5133
|
+
var Qa = (e) => o(() => ({
|
|
5101
5134
|
pagination: e.pagination,
|
|
5102
|
-
queryParams:
|
|
5103
|
-
sort:
|
|
5135
|
+
queryParams: Xa(e.columnFilters),
|
|
5136
|
+
sort: Za(e.sorting),
|
|
5104
5137
|
globalFilter: e.globalFilter
|
|
5105
5138
|
}), [e]);
|
|
5106
5139
|
//#endregion
|
|
5107
5140
|
//#region src/package/utils/pluckSelected.ts
|
|
5108
|
-
function
|
|
5141
|
+
function $a(e, t, n) {
|
|
5109
5142
|
return Object.entries(t).filter(([, e]) => e).map(([t]) => e[Number(t)]).filter((e) => e !== void 0).map((e) => e[n]);
|
|
5110
5143
|
}
|
|
5111
5144
|
//#endregion
|
|
5112
5145
|
//#region src/package/utils/URLSearch.ts
|
|
5113
|
-
var
|
|
5114
|
-
function
|
|
5146
|
+
var eo = /* @__PURE__ */ "eq.ne.gt.gte.lt.lte.in.nin.regex.exists.all.size.elemMatch.type.mod.not.and.or.nor.text.where.geoWithin.geoIntersects.near.nearSphere.expr.jsonSchema.bitsAllClear.bitsAllSet.bitsAnyClear.bitsAnySet.rand".split(".");
|
|
5147
|
+
function to(e, t) {
|
|
5115
5148
|
let { id: n, value: r } = t, i = n.replace(/_/g, ".");
|
|
5116
5149
|
if (Array.isArray(r) && r.length === 2) {
|
|
5117
5150
|
r[0] != null && r[0] !== "" && e.set(`${i}[gte]`, String(r[0])), r[1] != null && r[1] !== "" && e.set(`${i}[lte]`, String(r[1]));
|
|
@@ -5119,16 +5152,16 @@ function $a(e, t) {
|
|
|
5119
5152
|
}
|
|
5120
5153
|
if (typeof r == "object" && r) {
|
|
5121
5154
|
Object.entries(r).forEach(([t, n]) => {
|
|
5122
|
-
|
|
5155
|
+
eo.includes(t) && n != null && n !== "" && e.set(`${i}[${t}]`, String(n));
|
|
5123
5156
|
});
|
|
5124
5157
|
return;
|
|
5125
5158
|
}
|
|
5126
5159
|
r != null && r !== "" && e.set(i, String(r));
|
|
5127
5160
|
}
|
|
5128
|
-
function
|
|
5161
|
+
function no(e) {
|
|
5129
5162
|
let t = new URLSearchParams();
|
|
5130
5163
|
if (t.set("page", String(e.pagination.pageIndex + 1)), t.set("limit", String(e.pagination.pageSize)), e.columnFilters.forEach((e) => {
|
|
5131
|
-
|
|
5164
|
+
to(t, e);
|
|
5132
5165
|
}), e.sorting.length > 0) {
|
|
5133
5166
|
let n = e.sorting.map((e) => e.desc ? `-${e.id}` : e.id).join(",");
|
|
5134
5167
|
t.set("sort", n);
|
|
@@ -5136,4 +5169,4 @@ function eo(e) {
|
|
|
5136
5169
|
return e.globalFilter && t.set("q", e.globalFilter), `?${t.toString()}`;
|
|
5137
5170
|
}
|
|
5138
5171
|
//#endregion
|
|
5139
|
-
export {
|
|
5172
|
+
export { qa as Grid, no as URLSearch, $a as pluckSelected, I as useGrid, Ya as useGridState, Qa as useQueryArgs };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GridFeatures } from '../../../features';
|
|
2
|
+
import { Cell, RowData } from '@tanstack/react-table';
|
|
3
|
+
declare const GridCellSplit: ({ cell, }: {
|
|
4
|
+
cell: Cell<GridFeatures, RowData, unknown>;
|
|
5
|
+
}) => import("react").JSX.Element | null;
|
|
6
|
+
export default GridCellSplit;
|
package/package.json
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-shadcn-table",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"module": "./dist/index.js",
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"import": "./dist/index.js",
|
|
15
|
-
"types": "./dist/index.d.ts"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"dev": "vite",
|
|
20
|
-
"build": "tsc -b && vite build",
|
|
21
|
-
"lint": "eslint .",
|
|
22
|
-
"preview": "vite preview"
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/jsdev-robin/react-shadcn-table.git"
|
|
27
|
-
},
|
|
28
|
-
"bugs": {
|
|
29
|
-
"url": "https://github.com/jsdev-robin/react-shadcn-table/issues"
|
|
30
|
-
},
|
|
31
|
-
"peerDependencies": {
|
|
32
|
-
"react": "^18 || ^19",
|
|
33
|
-
"react-dom": "^18 || ^19"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@dnd-kit/core": "^6.3.1",
|
|
37
|
-
"@dnd-kit/modifiers": "^9.0.0",
|
|
38
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
39
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
40
|
-
"@tanstack/react-hotkeys": "^0.10.0",
|
|
41
|
-
"@tanstack/react-pacer": "^0.23.0",
|
|
42
|
-
"@tanstack/react-store": "^0.11.1",
|
|
43
|
-
"@tanstack/react-table": "^9.
|
|
44
|
-
"jspdf": "^4.2.1",
|
|
45
|
-
"jspdf-autotable": "^5.0.8",
|
|
46
|
-
"xlsx": "^0.18.5"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@babel/core": "^7.29.7",
|
|
50
|
-
"@eslint/js": "^10.0.1",
|
|
51
|
-
"@rolldown/plugin-babel": "^0.2.3",
|
|
52
|
-
"@tailwindcss/vite": "^4.3.3",
|
|
53
|
-
"@types/babel__core": "^7.20.5",
|
|
54
|
-
"@types/node": "^24.13.3",
|
|
55
|
-
"@types/react": "^19.2.17",
|
|
56
|
-
"@types/react-dom": "^19.2.3",
|
|
57
|
-
"@vitejs/plugin-react": "^6.0.4",
|
|
58
|
-
"babel-plugin-react-compiler": "^1.0.0",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"eslint
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
},
|
|
76
|
-
"keywords": [
|
|
77
|
-
"react",
|
|
78
|
-
"table",
|
|
79
|
-
"data-table",
|
|
80
|
-
"shadcn",
|
|
81
|
-
"shadcn-ui",
|
|
82
|
-
"tanstack-table",
|
|
83
|
-
"radix-ui",
|
|
84
|
-
"tailwindcss",
|
|
85
|
-
"typescript",
|
|
86
|
-
"vite",
|
|
87
|
-
"dnd-kit",
|
|
88
|
-
"drag-and-drop",
|
|
89
|
-
"xlsx",
|
|
90
|
-
"excel-export",
|
|
91
|
-
"pdf-export",
|
|
92
|
-
"ui-components"
|
|
93
|
-
]
|
|
94
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-shadcn-table",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.0.6",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite",
|
|
20
|
+
"build": "tsc -b && vite build",
|
|
21
|
+
"lint": "eslint .",
|
|
22
|
+
"preview": "vite preview"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/jsdev-robin/react-shadcn-table.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/jsdev-robin/react-shadcn-table/issues"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": "^18 || ^19",
|
|
33
|
+
"react-dom": "^18 || ^19"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@dnd-kit/core": "^6.3.1",
|
|
37
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
38
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
39
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
40
|
+
"@tanstack/react-hotkeys": "^0.10.0",
|
|
41
|
+
"@tanstack/react-pacer": "^0.23.0",
|
|
42
|
+
"@tanstack/react-store": "^0.11.1",
|
|
43
|
+
"@tanstack/react-table": "^9.2.4",
|
|
44
|
+
"jspdf": "^4.2.1",
|
|
45
|
+
"jspdf-autotable": "^5.0.8",
|
|
46
|
+
"xlsx": "^0.18.5"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@babel/core": "^7.29.7",
|
|
50
|
+
"@eslint/js": "^10.0.1",
|
|
51
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
52
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
53
|
+
"@types/babel__core": "^7.20.5",
|
|
54
|
+
"@types/node": "^24.13.3",
|
|
55
|
+
"@types/react": "^19.2.17",
|
|
56
|
+
"@types/react-dom": "^19.2.3",
|
|
57
|
+
"@vitejs/plugin-react": "^6.0.4",
|
|
58
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
59
|
+
"class-variance-authority": "^0.7.1",
|
|
60
|
+
"clsx": "^2.1.1",
|
|
61
|
+
"eslint": "^10.8.0",
|
|
62
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
63
|
+
"eslint-plugin-react-refresh": "^0.5.3",
|
|
64
|
+
"globals": "^17.7.0",
|
|
65
|
+
"lucide-react": "^1.31.0",
|
|
66
|
+
"radix-ui": "^1.6.7",
|
|
67
|
+
"shadcn": "^4.18.0",
|
|
68
|
+
"tailwind-merge": "^3.6.0",
|
|
69
|
+
"tailwindcss": "^4.3.3",
|
|
70
|
+
"tw-animate-css": "^1.4.0",
|
|
71
|
+
"typescript": "~6.0.2",
|
|
72
|
+
"typescript-eslint": "^8.65.0",
|
|
73
|
+
"vite": "^8.2.0",
|
|
74
|
+
"vite-plugin-dts": "^5.0.3"
|
|
75
|
+
},
|
|
76
|
+
"keywords": [
|
|
77
|
+
"react",
|
|
78
|
+
"table",
|
|
79
|
+
"data-table",
|
|
80
|
+
"shadcn",
|
|
81
|
+
"shadcn-ui",
|
|
82
|
+
"tanstack-table",
|
|
83
|
+
"radix-ui",
|
|
84
|
+
"tailwindcss",
|
|
85
|
+
"typescript",
|
|
86
|
+
"vite",
|
|
87
|
+
"dnd-kit",
|
|
88
|
+
"drag-and-drop",
|
|
89
|
+
"xlsx",
|
|
90
|
+
"excel-export",
|
|
91
|
+
"pdf-export",
|
|
92
|
+
"ui-components"
|
|
93
|
+
]
|
|
94
|
+
}
|