react-shadcn-table 1.0.4 → 1.0.5

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/README.md CHANGED
@@ -6,7 +6,7 @@ A feature-rich, headless-powered data grid for React — built on [TanStack Tabl
6
6
 
7
7
  ## Features
8
8
 
9
- - Global search + per-column filtering (text, range)
9
+ - Global search + per-column filtering (text, range, select)
10
10
  - Multi-column sorting
11
11
  - Client-side & manual (server-side) pagination
12
12
  - Row selection with checkboxes
@@ -102,6 +102,68 @@ const { data, isLoading, isError, refetch, isFetching } = useUsersQuery({
102
102
  />;
103
103
  ```
104
104
 
105
+ ## Column Filters
106
+
107
+ Each column opts into a filter UI via `meta.filterVariant`. Supported variants: `text`, `number`, `tel`, `url`, `color`, `range`, `select`, `dateRange`, `date`, `datetime-local`, `month`, `time`, `week`, `search`.
108
+
109
+ ```tsx
110
+ {
111
+ id: 'status',
112
+ accessorKey: 'status',
113
+ filterFn: 'equalsString',
114
+ header: () => <div>Status</div>,
115
+ meta: {
116
+ filterVariant: 'text',
117
+ },
118
+ }
119
+ ```
120
+
121
+ ### Select Filters with `options`
122
+
123
+ For `filterVariant: 'select'`, provide a static `options` array in `meta` to control exactly what appears in the dropdown — instead of the grid deriving choices from the values currently loaded in the table (via faceted unique values). This is the recommended approach whenever you know the fixed set of values up front (enums, statuses, categories), especially with `manualFiltering`, where the faceted values are only ever a subset of what's on the server.
124
+
125
+ ```tsx
126
+ {
127
+ id: 'status',
128
+ accessorKey: 'status',
129
+ filterFn: 'equalsString',
130
+ header: () => <div>Status</div>,
131
+ meta: {
132
+ filterVariant: 'select',
133
+ options: [
134
+ { label: 'Pending', value: 'pending' },
135
+ { label: 'Preparing', value: 'preparing' },
136
+ { label: 'Ready', value: 'ready' },
137
+ { label: 'Completed', value: 'completed' },
138
+ { label: 'Cancelled', value: 'cancelled' },
139
+ ],
140
+ },
141
+ }
142
+ ```
143
+
144
+ **Shape:**
145
+
146
+ ```ts
147
+ options?: { label: string; value: string }[];
148
+ ```
149
+
150
+ - `label` — text shown in the dropdown item.
151
+ - `value` — value sent through `column.setFilterValue(...)` and applied by your `filterFn`.
152
+
153
+ **Fallback behavior:** if `options` is omitted (or empty) on a `select` column, the grid falls back to deriving choices from `column.getFacetedUniqueValues()` — useful for ad hoc/free-form columns where the value set isn't known ahead of time, but only reliable for values present in the currently loaded page of data.
154
+
155
+ ```tsx
156
+ // No static options — dropdown is populated from values seen in loaded rows
157
+ {
158
+ id: 'driver',
159
+ accessorKey: 'driver',
160
+ header: () => <div>Driver</div>,
161
+ meta: {
162
+ filterVariant: 'select',
163
+ },
164
+ }
165
+ ```
166
+
105
167
  ## Toolbar Actions
106
168
 
107
169
  Add custom action buttons to the toolbar via `topRightSlot`:
@@ -171,6 +233,13 @@ const selectedIds = pluckSelected(data, rowSelection, 'id');
171
233
  | `name` | `string` | `'munza'` | Storage key for persisting per-grid layout |
172
234
  | `topRightSlot` | `React.ReactNode` | — | Custom content on the right of the toolbar (e.g. action buttons) |
173
235
 
236
+ ### Column `meta` (`MyColumnMeta`)
237
+
238
+ | Field | Type | Description |
239
+ | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
240
+ | `filterVariant` | `'text' \| 'number' \| 'tel' \| 'url' \| 'color' \| 'range' \| 'select' \| 'dateRange' \| 'date' \| 'datetime-local' \| 'month' \| 'time' \| 'week' \| 'search'` | Which filter UI to render in the column header |
241
+ | `options` | `{ label: string; value: string }[]` | Static choices for `filterVariant: 'select'`. Falls back to `getFacetedUniqueValues()` when omitted. |
242
+
174
243
  ### `useGridState()`
175
244
 
176
245
  Manages all controlled state required by `<Grid />`.
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}=e.columnDef.meta??{},{isFetching:r}=L(),i=!r&&n===`select`?Array.from(e.getFacetedUniqueValues().keys()).sort().slice(0,5e3):[];return e.getCanFilter()?(0,f.jsx)(`div`,{style:{padding:`4px`,width:`100%`,borderTop:`1px solid var(--border)`},children:n===`range`?(0,f.jsxs)(`div`,{style:{display:`flex`,gap:`4px`},children:[(0,f.jsx)(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`}),i.map(e=>(0,f.jsx)(lr,{value:String(e),children:String(e)},String(e)))]})})]}):n&&[`text`,`time`,`date`,`datetime-local`,`month`,`week`,`number`,`tel`,`url`,`color`,`search`].includes(n)?(0,f.jsx)(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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),a=t.map(e=>`<th>${i(e)}</th>`).join(``),o=n.map(e=>`<tr>${e.map(e=>`<td>${i(e)}</td>`).join(``)}</tr>`).join(``);r.document.open(),r.document.write(`
13
+ `}),(0,f.jsx)(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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),a=t.map(e=>`<th>${i(e)}</th>`).join(``),o=n.map(e=>`<tr>${e.map(e=>`<td>${i(e)}</td>`).join(``)}</tr>`).join(``);r.document.open(),r.document.write(`
14
14
  <!DOCTYPE html>
15
15
  <html>
16
16
  <head>
package/dist/index.js CHANGED
@@ -3318,7 +3318,10 @@ function qi({ className: e, ...t }) {
3318
3318
  //#region src/package/ui/header/HeaderFilter.tsx
3319
3319
  var Ji = ({ column: e }) => {
3320
3320
  "use no memo";
3321
- let t = e.getFilterValue(), { filterVariant: n } = e.columnDef.meta ?? {}, { isFetching: r } = I(), i = !r && n === "select" ? Array.from(e.getFacetedUniqueValues().keys()).sort().slice(0, 5e3) : [];
3321
+ let t = e.getFilterValue(), { filterVariant: n, options: r } = e.columnDef.meta ?? {}, { isFetching: i } = I(), a = r && r.length > 0 ? r : !i && n === "select" ? Array.from(e.getFacetedUniqueValues().keys()).sort().slice(0, 5e3).map((e) => ({
3322
+ label: String(e),
3323
+ value: String(e)
3324
+ })) : [];
3322
3325
  return e.getCanFilter() ? /* @__PURE__ */ j("div", {
3323
3326
  style: {
3324
3327
  padding: "4px",
@@ -3353,10 +3356,10 @@ var Ji = ({ column: e }) => {
3353
3356
  }), /* @__PURE__ */ j(Wi, { children: /* @__PURE__ */ M(Vi, { children: [/* @__PURE__ */ j(Gi, {
3354
3357
  value: "all",
3355
3358
  children: "All"
3356
- }), i.map((e) => /* @__PURE__ */ j(Gi, {
3357
- value: String(e),
3358
- children: String(e)
3359
- }, String(e)))] }) })]
3359
+ }), a.map((e) => /* @__PURE__ */ j(Gi, {
3360
+ value: e.value,
3361
+ children: e.label
3362
+ }, e.value))] }) })]
3360
3363
  }) : n && [
3361
3364
  "text",
3362
3365
  "time",
@@ -1,5 +1,9 @@
1
1
  interface MyColumnMeta {
2
2
  filterVariant?: 'text' | 'number' | 'tel' | 'url' | 'color' | 'range' | 'select' | 'dateRange' | 'date' | 'datetime-local' | 'month' | 'time' | 'week' | 'search';
3
+ options?: {
4
+ label: string;
5
+ value: string;
6
+ }[];
3
7
  }
4
8
  export declare const features: {
5
9
  rowExpandingFeature: import('@tanstack/react-table').TableFeature;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-shadcn-table",
3
3
  "private": false,
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "files": [