react-shadcn-table 1.0.4 → 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/README.md +70 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +138 -102
- package/dist/package/features/index.d.ts +4 -0
- package/dist/package/ui/grid/shared/GridCellSplit.d.ts +6 -0
- package/package.json +94 -94
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,`&`).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
|
@@ -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:
|
|
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
|
-
}),
|
|
3357
|
-
value:
|
|
3358
|
-
children:
|
|
3359
|
-
},
|
|
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",
|
|
@@ -3604,14 +3607,47 @@ var na = ({ header: e }) => {
|
|
|
3604
3607
|
children: /* @__PURE__ */ j(zi, {})
|
|
3605
3608
|
})
|
|
3606
3609
|
] });
|
|
3607
|
-
}, 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 = () => {
|
|
3608
3644
|
let { table: e } = I();
|
|
3609
3645
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(Z, { children: e.getEndVisibleLeafColumns().map((e, t) => /* @__PURE__ */ j(Q, { style: {
|
|
3610
3646
|
width: e.getSize(),
|
|
3611
3647
|
minWidth: e.getSize(),
|
|
3612
3648
|
maxWidth: e.getSize()
|
|
3613
3649
|
} }, t)) }) }) });
|
|
3614
|
-
},
|
|
3650
|
+
}, da = () => {
|
|
3615
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();
|
|
3616
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, {
|
|
3617
3653
|
style: {
|
|
@@ -3633,7 +3669,7 @@ var na = ({ header: e }) => {
|
|
|
3633
3669
|
};
|
|
3634
3670
|
//#endregion
|
|
3635
3671
|
//#region src/package/ui/grid/sections/end/GridEndRowPin.tsx
|
|
3636
|
-
function
|
|
3672
|
+
function fa({ row: e }) {
|
|
3637
3673
|
"use no memo";
|
|
3638
3674
|
let { table: t } = I();
|
|
3639
3675
|
return /* @__PURE__ */ j(Z, {
|
|
@@ -3649,25 +3685,25 @@ function ua({ row: e }) {
|
|
|
3649
3685
|
}
|
|
3650
3686
|
//#endregion
|
|
3651
3687
|
//#region src/package/ui/grid/sections/end/GridEndBody.tsx
|
|
3652
|
-
var
|
|
3688
|
+
var pa = () => {
|
|
3653
3689
|
"use no memo";
|
|
3654
3690
|
let { table: t, isLoading: n, isError: r, renderSubComponent: i } = I();
|
|
3655
|
-
return n ? /* @__PURE__ */ j(
|
|
3656
|
-
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)),
|
|
3657
3693
|
t.getRowModel().rows.map((t) => /* @__PURE__ */ M(e.Fragment, { children: [/* @__PURE__ */ j(Z, {
|
|
3658
3694
|
"data-state": t.getIsSelected() && "selected",
|
|
3659
|
-
children: t.getEndVisibleCells().map((e) => /* @__PURE__ */ j(
|
|
3695
|
+
children: t.getEndVisibleCells().map((e) => /* @__PURE__ */ j(la, { cell: e }, e.id))
|
|
3660
3696
|
}), i && t.getIsExpanded() && /* @__PURE__ */ j(Z, { children: /* @__PURE__ */ j(Q, {
|
|
3661
3697
|
colSpan: t.getVisibleCells().length,
|
|
3662
3698
|
children: i({ row: t })
|
|
3663
3699
|
}) })] }, t.id)),
|
|
3664
|
-
t.getTopRows().map((e) => /* @__PURE__ */ j(
|
|
3700
|
+
t.getTopRows().map((e) => /* @__PURE__ */ j(fa, { row: e }, e.id))
|
|
3665
3701
|
] }) });
|
|
3666
|
-
},
|
|
3702
|
+
}, ma = () => {
|
|
3667
3703
|
"use no memo";
|
|
3668
3704
|
let { table: e } = I();
|
|
3669
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)) }) });
|
|
3670
|
-
},
|
|
3706
|
+
}, ha = () => {
|
|
3671
3707
|
"use no memo";
|
|
3672
3708
|
let { paneRef5: e, paneRef6: t, height: n, isError: r, isSplit: i, table: a } = I();
|
|
3673
3709
|
return /* @__PURE__ */ j(A, { children: !r && i && (a.state.columnPinning?.end?.length ?? 0) > 0 ? /* @__PURE__ */ M("div", {
|
|
@@ -3688,7 +3724,7 @@ var da = () => {
|
|
|
3688
3724
|
scrollbarColor: "transparent transparent"
|
|
3689
3725
|
},
|
|
3690
3726
|
ref: e,
|
|
3691
|
-
children: /* @__PURE__ */ j(
|
|
3727
|
+
children: /* @__PURE__ */ j(ma, {})
|
|
3692
3728
|
}),
|
|
3693
3729
|
/* @__PURE__ */ j("div", {
|
|
3694
3730
|
style: {
|
|
@@ -3697,18 +3733,18 @@ var da = () => {
|
|
|
3697
3733
|
height: n
|
|
3698
3734
|
},
|
|
3699
3735
|
ref: t,
|
|
3700
|
-
children: /* @__PURE__ */ j(
|
|
3736
|
+
children: /* @__PURE__ */ j(pa, {})
|
|
3701
3737
|
})
|
|
3702
3738
|
]
|
|
3703
3739
|
}) : null });
|
|
3704
|
-
},
|
|
3740
|
+
}, ga = () => {
|
|
3705
3741
|
let { table: e } = I();
|
|
3706
3742
|
return /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(Z, { children: e.getStartVisibleLeafColumns().map((e, t) => /* @__PURE__ */ j(Q, { style: {
|
|
3707
3743
|
width: e.getSize(),
|
|
3708
3744
|
minWidth: e.getSize(),
|
|
3709
3745
|
maxWidth: e.getSize()
|
|
3710
3746
|
} }, t)) }) }) });
|
|
3711
|
-
},
|
|
3747
|
+
}, _a = () => {
|
|
3712
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();
|
|
3713
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, {
|
|
3714
3750
|
style: {
|
|
@@ -3730,7 +3766,7 @@ var da = () => {
|
|
|
3730
3766
|
};
|
|
3731
3767
|
//#endregion
|
|
3732
3768
|
//#region src/package/ui/grid/sections/start/GridStartRowPin.tsx
|
|
3733
|
-
function
|
|
3769
|
+
function va({ row: e }) {
|
|
3734
3770
|
"use no memo";
|
|
3735
3771
|
let { table: t } = I();
|
|
3736
3772
|
return /* @__PURE__ */ j(Z, {
|
|
@@ -3746,25 +3782,25 @@ function ga({ row: e }) {
|
|
|
3746
3782
|
}
|
|
3747
3783
|
//#endregion
|
|
3748
3784
|
//#region src/package/ui/grid/sections/start/GridStartBody.tsx
|
|
3749
|
-
var
|
|
3785
|
+
var ya = () => {
|
|
3750
3786
|
"use no memo";
|
|
3751
3787
|
let { table: t, isLoading: n, isError: r, renderSubComponent: i } = I();
|
|
3752
|
-
return n ? /* @__PURE__ */ j(
|
|
3753
|
-
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)),
|
|
3754
3790
|
t.getRowModel().rows.map((t) => /* @__PURE__ */ M(e.Fragment, { children: [/* @__PURE__ */ j(Z, {
|
|
3755
3791
|
"data-state": t.getIsSelected() && "selected",
|
|
3756
|
-
children: t.getStartVisibleCells().map((e) => /* @__PURE__ */ j(
|
|
3792
|
+
children: t.getStartVisibleCells().map((e) => /* @__PURE__ */ j(la, { cell: e }, e.id))
|
|
3757
3793
|
}), i && t.getIsExpanded() && /* @__PURE__ */ j(Z, { children: /* @__PURE__ */ j(Q, {
|
|
3758
3794
|
colSpan: t.getVisibleCells().length,
|
|
3759
3795
|
children: i({ row: t })
|
|
3760
3796
|
}) })] }, t.id)),
|
|
3761
|
-
t.getBottomRows().map((e) => /* @__PURE__ */ j(
|
|
3797
|
+
t.getBottomRows().map((e) => /* @__PURE__ */ j(va, { row: e }, e.id))
|
|
3762
3798
|
] }) });
|
|
3763
|
-
},
|
|
3799
|
+
}, ba = () => {
|
|
3764
3800
|
"use no memo";
|
|
3765
3801
|
let { table: e } = I();
|
|
3766
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)) }) });
|
|
3767
|
-
},
|
|
3803
|
+
}, xa = () => {
|
|
3768
3804
|
"use no memo";
|
|
3769
3805
|
let { paneRef3: e, paneRef4: t, height: n, isError: r, isSplit: i, table: a } = I();
|
|
3770
3806
|
return /* @__PURE__ */ j(A, { children: !r && i && (a.state.columnPinning?.start?.length ?? 0) > 0 ? /* @__PURE__ */ M("div", {
|
|
@@ -3785,7 +3821,7 @@ var _a = () => {
|
|
|
3785
3821
|
scrollbarColor: "transparent transparent"
|
|
3786
3822
|
},
|
|
3787
3823
|
ref: e,
|
|
3788
|
-
children: /* @__PURE__ */ j(
|
|
3824
|
+
children: /* @__PURE__ */ j(ba, {})
|
|
3789
3825
|
}),
|
|
3790
3826
|
/* @__PURE__ */ j("div", {
|
|
3791
3827
|
style: {
|
|
@@ -3794,11 +3830,11 @@ var _a = () => {
|
|
|
3794
3830
|
height: n
|
|
3795
3831
|
},
|
|
3796
3832
|
ref: t,
|
|
3797
|
-
children: /* @__PURE__ */ j(
|
|
3833
|
+
children: /* @__PURE__ */ j(ya, {})
|
|
3798
3834
|
})
|
|
3799
3835
|
]
|
|
3800
3836
|
}) : null });
|
|
3801
|
-
},
|
|
3837
|
+
}, Sa = () => {
|
|
3802
3838
|
let { table: e } = I();
|
|
3803
3839
|
return /* @__PURE__ */ M("div", {
|
|
3804
3840
|
style: {
|
|
@@ -3940,25 +3976,25 @@ var _a = () => {
|
|
|
3940
3976
|
]
|
|
3941
3977
|
})]
|
|
3942
3978
|
});
|
|
3943
|
-
},
|
|
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", {
|
|
3944
3980
|
variants: { orientation: {
|
|
3945
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!",
|
|
3946
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!"
|
|
3947
3983
|
} },
|
|
3948
3984
|
defaultVariants: { orientation: "horizontal" }
|
|
3949
3985
|
});
|
|
3950
|
-
function
|
|
3986
|
+
function wa({ className: e, orientation: t, ...n }) {
|
|
3951
3987
|
return /* @__PURE__ */ j("div", {
|
|
3952
3988
|
role: "group",
|
|
3953
3989
|
"data-slot": "button-group",
|
|
3954
3990
|
"data-orientation": t,
|
|
3955
|
-
className: q(
|
|
3991
|
+
className: q(Ca({ orientation: t }), e),
|
|
3956
3992
|
...n
|
|
3957
3993
|
});
|
|
3958
3994
|
}
|
|
3959
3995
|
//#endregion
|
|
3960
3996
|
//#region src/components/ui/checkbox.tsx
|
|
3961
|
-
function
|
|
3997
|
+
function Ta({ className: e, ...t }) {
|
|
3962
3998
|
return /* @__PURE__ */ j(nt.Root, {
|
|
3963
3999
|
"data-slot": "checkbox",
|
|
3964
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),
|
|
@@ -3972,7 +4008,7 @@ function Ca({ className: e, ...t }) {
|
|
|
3972
4008
|
}
|
|
3973
4009
|
//#endregion
|
|
3974
4010
|
//#region src/components/ui/label.tsx
|
|
3975
|
-
function
|
|
4011
|
+
function Ea({ className: e, ...t }) {
|
|
3976
4012
|
return /* @__PURE__ */ j(it.Root, {
|
|
3977
4013
|
"data-slot": "label",
|
|
3978
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),
|
|
@@ -3981,7 +4017,7 @@ function wa({ className: e, ...t }) {
|
|
|
3981
4017
|
}
|
|
3982
4018
|
//#endregion
|
|
3983
4019
|
//#region src/package/ui/toolbar/right/ToolbarRightColumns.tsx
|
|
3984
|
-
var
|
|
4020
|
+
var Da = () => {
|
|
3985
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 = () => {
|
|
3986
4022
|
let e = t.getAllLeafColumns().map((e) => e.id);
|
|
3987
4023
|
for (let t = e.length - 1; t > 0; t--) {
|
|
@@ -4052,14 +4088,14 @@ var Ta = () => {
|
|
|
4052
4088
|
flexDirection: "column",
|
|
4053
4089
|
gap: "16px"
|
|
4054
4090
|
},
|
|
4055
|
-
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, {
|
|
4056
4092
|
style: {
|
|
4057
4093
|
display: "flex",
|
|
4058
4094
|
alignItems: "center",
|
|
4059
4095
|
minWidth: 0
|
|
4060
4096
|
},
|
|
4061
4097
|
title: e.id.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()),
|
|
4062
|
-
children: [/* @__PURE__ */ j(
|
|
4098
|
+
children: [/* @__PURE__ */ j(Ta, {
|
|
4063
4099
|
checked: e.getIsVisible(),
|
|
4064
4100
|
onCheckedChange: (t) => e.toggleVisibility(t === !0)
|
|
4065
4101
|
}), /* @__PURE__ */ j("span", {
|
|
@@ -4085,7 +4121,7 @@ var Ta = () => {
|
|
|
4085
4121
|
gap: "8px",
|
|
4086
4122
|
paddingInline: "8px"
|
|
4087
4123
|
},
|
|
4088
|
-
children: [/* @__PURE__ */ M(
|
|
4124
|
+
children: [/* @__PURE__ */ M(wa, {
|
|
4089
4125
|
style: { width: "100%" },
|
|
4090
4126
|
children: [
|
|
4091
4127
|
/* @__PURE__ */ j($, {
|
|
@@ -4114,7 +4150,7 @@ var Ta = () => {
|
|
|
4114
4150
|
children: /* @__PURE__ */ j(ve, {})
|
|
4115
4151
|
})
|
|
4116
4152
|
]
|
|
4117
|
-
}), /* @__PURE__ */ M(
|
|
4153
|
+
}), /* @__PURE__ */ M(wa, {
|
|
4118
4154
|
style: { width: "100%" },
|
|
4119
4155
|
children: [
|
|
4120
4156
|
/* @__PURE__ */ j($, {
|
|
@@ -4154,7 +4190,7 @@ var Ta = () => {
|
|
|
4154
4190
|
};
|
|
4155
4191
|
//#endregion
|
|
4156
4192
|
//#region src/components/ui/item.tsx
|
|
4157
|
-
function
|
|
4193
|
+
function Oa({ className: e, ...t }) {
|
|
4158
4194
|
return /* @__PURE__ */ j("div", {
|
|
4159
4195
|
role: "list",
|
|
4160
4196
|
"data-slot": "item-group",
|
|
@@ -4162,7 +4198,7 @@ function Ea({ className: e, ...t }) {
|
|
|
4162
4198
|
...t
|
|
4163
4199
|
});
|
|
4164
4200
|
}
|
|
4165
|
-
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", {
|
|
4166
4202
|
variants: {
|
|
4167
4203
|
variant: {
|
|
4168
4204
|
default: "border-transparent",
|
|
@@ -4180,13 +4216,13 @@ var Da = Si("group/item flex w-full flex-wrap items-center rounded-lg border tex
|
|
|
4180
4216
|
size: "default"
|
|
4181
4217
|
}
|
|
4182
4218
|
});
|
|
4183
|
-
function
|
|
4219
|
+
function Aa({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
|
|
4184
4220
|
let a = r ? at.Root : "div";
|
|
4185
4221
|
return /* @__PURE__ */ j(a, {
|
|
4186
4222
|
"data-slot": "item",
|
|
4187
4223
|
"data-variant": t,
|
|
4188
4224
|
"data-size": n,
|
|
4189
|
-
className: q(
|
|
4225
|
+
className: q(ka({
|
|
4190
4226
|
variant: t,
|
|
4191
4227
|
size: n,
|
|
4192
4228
|
className: e
|
|
@@ -4194,7 +4230,7 @@ function Oa({ className: e, variant: t = "default", size: n = "default", asChild
|
|
|
4194
4230
|
...i
|
|
4195
4231
|
});
|
|
4196
4232
|
}
|
|
4197
|
-
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", {
|
|
4198
4234
|
variants: { variant: {
|
|
4199
4235
|
default: "bg-transparent",
|
|
4200
4236
|
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
@@ -4202,25 +4238,25 @@ var ka = Si("flex shrink-0 items-center justify-center gap-2 group-has-data-[slo
|
|
|
4202
4238
|
} },
|
|
4203
4239
|
defaultVariants: { variant: "default" }
|
|
4204
4240
|
});
|
|
4205
|
-
function
|
|
4241
|
+
function Ma({ className: e, variant: t = "default", ...n }) {
|
|
4206
4242
|
return /* @__PURE__ */ j("div", {
|
|
4207
4243
|
"data-slot": "item-media",
|
|
4208
4244
|
"data-variant": t,
|
|
4209
|
-
className: q(
|
|
4245
|
+
className: q(ja({
|
|
4210
4246
|
variant: t,
|
|
4211
4247
|
className: e
|
|
4212
4248
|
})),
|
|
4213
4249
|
...n
|
|
4214
4250
|
});
|
|
4215
4251
|
}
|
|
4216
|
-
function
|
|
4252
|
+
function Na({ className: e, ...t }) {
|
|
4217
4253
|
return /* @__PURE__ */ j("div", {
|
|
4218
4254
|
"data-slot": "item-content",
|
|
4219
4255
|
className: q("flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none", e),
|
|
4220
4256
|
...t
|
|
4221
4257
|
});
|
|
4222
4258
|
}
|
|
4223
|
-
function
|
|
4259
|
+
function Pa({ className: e, ...t }) {
|
|
4224
4260
|
return /* @__PURE__ */ j("div", {
|
|
4225
4261
|
"data-slot": "item-title",
|
|
4226
4262
|
className: q("line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4", e),
|
|
@@ -4229,7 +4265,7 @@ function Ma({ className: e, ...t }) {
|
|
|
4229
4265
|
}
|
|
4230
4266
|
//#endregion
|
|
4231
4267
|
//#region src/package/ui/toolbar/right/ToolbarRightDnd.tsx
|
|
4232
|
-
var
|
|
4268
|
+
var Fa = ({ columnId: e, label: t }) => {
|
|
4233
4269
|
"use no memo";
|
|
4234
4270
|
let { attributes: n, isDragging: r, listeners: i, setNodeRef: a, transform: o, transition: s } = gt({ id: e }), c = {
|
|
4235
4271
|
opacity: r ? .8 : 1,
|
|
@@ -4237,13 +4273,13 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4237
4273
|
transition: s,
|
|
4238
4274
|
zIndex: +!!r
|
|
4239
4275
|
};
|
|
4240
|
-
return /* @__PURE__ */ M(
|
|
4276
|
+
return /* @__PURE__ */ M(Aa, {
|
|
4241
4277
|
ref: a,
|
|
4242
4278
|
style: c,
|
|
4243
4279
|
variant: "outline",
|
|
4244
4280
|
size: "sm",
|
|
4245
4281
|
title: t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()),
|
|
4246
|
-
children: [/* @__PURE__ */ j(
|
|
4282
|
+
children: [/* @__PURE__ */ j(Ma, {
|
|
4247
4283
|
variant: "icon",
|
|
4248
4284
|
...n,
|
|
4249
4285
|
...i,
|
|
@@ -4252,9 +4288,9 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4252
4288
|
color: "var(--muted-foreground)"
|
|
4253
4289
|
},
|
|
4254
4290
|
children: /* @__PURE__ */ j(Ie, {})
|
|
4255
|
-
}), /* @__PURE__ */ j(
|
|
4291
|
+
}), /* @__PURE__ */ j(Na, {
|
|
4256
4292
|
style: { minWidth: 0 },
|
|
4257
|
-
children: /* @__PURE__ */ j(
|
|
4293
|
+
children: /* @__PURE__ */ j(Pa, {
|
|
4258
4294
|
style: {
|
|
4259
4295
|
width: "100%",
|
|
4260
4296
|
minWidth: 0
|
|
@@ -4273,7 +4309,7 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4273
4309
|
})
|
|
4274
4310
|
})]
|
|
4275
4311
|
});
|
|
4276
|
-
},
|
|
4312
|
+
}, Ia = () => {
|
|
4277
4313
|
"use no memo";
|
|
4278
4314
|
let { table: e } = I(), t = e.state.columnOrder.length ? e.state.columnOrder : e.getAllLeafColumns().map((e) => e.id), n = (n) => {
|
|
4279
4315
|
let { active: r, over: i } = n;
|
|
@@ -4339,9 +4375,9 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4339
4375
|
children: /* @__PURE__ */ j(mt, {
|
|
4340
4376
|
items: t,
|
|
4341
4377
|
strategy: _t,
|
|
4342
|
-
children: /* @__PURE__ */ j(
|
|
4378
|
+
children: /* @__PURE__ */ j(Oa, { children: t.map((t) => {
|
|
4343
4379
|
let n = e.getColumn(t);
|
|
4344
|
-
return n ? /* @__PURE__ */ j(
|
|
4380
|
+
return n ? /* @__PURE__ */ j(Fa, {
|
|
4345
4381
|
columnId: t,
|
|
4346
4382
|
label: typeof n.columnDef.header == "string" ? n.columnDef.header : t
|
|
4347
4383
|
}, t) : null;
|
|
@@ -4354,13 +4390,13 @@ var Na = ({ columnId: e, label: t }) => {
|
|
|
4354
4390
|
};
|
|
4355
4391
|
//#endregion
|
|
4356
4392
|
//#region src/components/ui/collapsible.tsx
|
|
4357
|
-
function
|
|
4393
|
+
function La({ ...e }) {
|
|
4358
4394
|
return /* @__PURE__ */ j(rt.Root, {
|
|
4359
4395
|
"data-slot": "collapsible",
|
|
4360
4396
|
...e
|
|
4361
4397
|
});
|
|
4362
4398
|
}
|
|
4363
|
-
function
|
|
4399
|
+
function Ra({ ...e }) {
|
|
4364
4400
|
return /* @__PURE__ */ j(rt.CollapsibleContent, {
|
|
4365
4401
|
"data-slot": "collapsible-content",
|
|
4366
4402
|
...e
|
|
@@ -4368,7 +4404,7 @@ function Ia({ ...e }) {
|
|
|
4368
4404
|
}
|
|
4369
4405
|
//#endregion
|
|
4370
4406
|
//#region src/package/ui/toolbar/right/ToolbarRightFilter.tsx
|
|
4371
|
-
var
|
|
4407
|
+
var za = ({ column: e }) => {
|
|
4372
4408
|
"use no memo";
|
|
4373
4409
|
let t = o(() => e.getCanFilter() ? {
|
|
4374
4410
|
id: e.id.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()),
|
|
@@ -4402,9 +4438,9 @@ var La = ({ column: e }) => {
|
|
|
4402
4438
|
},
|
|
4403
4439
|
children: t?.id && t.id.length > 15 ? `${t.id.slice(0, 15)}...` : t?.id
|
|
4404
4440
|
})]
|
|
4405
|
-
}), /* @__PURE__ */ j(
|
|
4441
|
+
}), /* @__PURE__ */ j(La, {
|
|
4406
4442
|
open: i,
|
|
4407
|
-
children: /* @__PURE__ */ j(
|
|
4443
|
+
children: /* @__PURE__ */ j(Ra, { children: /* @__PURE__ */ M("div", {
|
|
4408
4444
|
style: {
|
|
4409
4445
|
padding: "12px",
|
|
4410
4446
|
paddingRight: 0
|
|
@@ -4438,7 +4474,7 @@ var La = ({ column: e }) => {
|
|
|
4438
4474
|
})]
|
|
4439
4475
|
}) })
|
|
4440
4476
|
})] });
|
|
4441
|
-
},
|
|
4477
|
+
}, Ba = () => {
|
|
4442
4478
|
"use no memo";
|
|
4443
4479
|
let { table: t, globalFilter: n, setGlobalFilter: r } = I();
|
|
4444
4480
|
return /* @__PURE__ */ M("div", {
|
|
@@ -4499,7 +4535,7 @@ var La = ({ column: e }) => {
|
|
|
4499
4535
|
"select",
|
|
4500
4536
|
"pin",
|
|
4501
4537
|
"actions"
|
|
4502
|
-
].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))
|
|
4503
4539
|
})
|
|
4504
4540
|
}),
|
|
4505
4541
|
/* @__PURE__ */ j("div", {
|
|
@@ -4519,7 +4555,7 @@ var La = ({ column: e }) => {
|
|
|
4519
4555
|
};
|
|
4520
4556
|
//#endregion
|
|
4521
4557
|
//#region src/package/utils/printTable.ts
|
|
4522
|
-
function
|
|
4558
|
+
function Va(e, t, n) {
|
|
4523
4559
|
let r = window.open("", "_blank");
|
|
4524
4560
|
if (!r) {
|
|
4525
4561
|
window.alert("Print window was blocked. Please allow popups for this site and try again.");
|
|
@@ -4557,7 +4593,7 @@ function za(e, t, n) {
|
|
|
4557
4593
|
}
|
|
4558
4594
|
//#endregion
|
|
4559
4595
|
//#region src/package/ui/toolbar/right/ToolbarRightRows.tsx
|
|
4560
|
-
var
|
|
4596
|
+
var Ha = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase()), Ua = () => {
|
|
4561
4597
|
let { table: e, name: t } = I(), n = () => {
|
|
4562
4598
|
let t = e.getCellSelectionRowIds(), n = e.getCellSelectionColumnIds();
|
|
4563
4599
|
if (t.length === 0 || n.length === 0) return null;
|
|
@@ -4565,7 +4601,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4565
4601
|
return {
|
|
4566
4602
|
header: o.map((e) => {
|
|
4567
4603
|
let t = e.columnDef.header;
|
|
4568
|
-
return typeof t == "string" ? t :
|
|
4604
|
+
return typeof t == "string" ? t : Ha(e.id);
|
|
4569
4605
|
}),
|
|
4570
4606
|
body: a.map((e) => {
|
|
4571
4607
|
let t = new Map(e.getAllCells().map((e) => [e.column.id, e]));
|
|
@@ -4607,7 +4643,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4607
4643
|
l.href = c, l.download = `${a}-${Date.now()}.json`, l.click(), URL.revokeObjectURL(c);
|
|
4608
4644
|
}, l = () => {
|
|
4609
4645
|
let e = n();
|
|
4610
|
-
e &&
|
|
4646
|
+
e && Va(t ?? "Grid", e.header, e.body);
|
|
4611
4647
|
}, u = async () => {
|
|
4612
4648
|
let e = n();
|
|
4613
4649
|
if (!e) return;
|
|
@@ -4679,7 +4715,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4679
4715
|
gap: "12px",
|
|
4680
4716
|
paddingInline: "8px"
|
|
4681
4717
|
},
|
|
4682
|
-
children: [/* @__PURE__ */ j(
|
|
4718
|
+
children: [/* @__PURE__ */ j(Ea, { children: "History" }), /* @__PURE__ */ M(wa, { children: [/* @__PURE__ */ j($, {
|
|
4683
4719
|
size: "icon",
|
|
4684
4720
|
variant: "outline",
|
|
4685
4721
|
title: "Undo",
|
|
@@ -4708,7 +4744,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4708
4744
|
gap: "12px",
|
|
4709
4745
|
paddingInline: "8px"
|
|
4710
4746
|
},
|
|
4711
|
-
children: [/* @__PURE__ */ j(
|
|
4747
|
+
children: [/* @__PURE__ */ j(Ea, { children: "Density" }), /* @__PURE__ */ M(wa, { children: [
|
|
4712
4748
|
/* @__PURE__ */ j($, {
|
|
4713
4749
|
size: "icon",
|
|
4714
4750
|
variant: e.state.density === "sm" ? "default" : "outline",
|
|
@@ -4739,13 +4775,13 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4739
4775
|
gap: "12px",
|
|
4740
4776
|
paddingInline: "8px"
|
|
4741
4777
|
},
|
|
4742
|
-
children: [/* @__PURE__ */ j(
|
|
4778
|
+
children: [/* @__PURE__ */ j(Ea, { children: "Selection" }), /* @__PURE__ */ M("div", {
|
|
4743
4779
|
style: {
|
|
4744
4780
|
display: "flex",
|
|
4745
4781
|
flexDirection: "column",
|
|
4746
4782
|
gap: "8px"
|
|
4747
4783
|
},
|
|
4748
|
-
children: [/* @__PURE__ */ M(
|
|
4784
|
+
children: [/* @__PURE__ */ M(wa, { children: [
|
|
4749
4785
|
/* @__PURE__ */ j(e.Subscribe, {
|
|
4750
4786
|
source: e.atoms.cellSelection,
|
|
4751
4787
|
children: () => /* @__PURE__ */ j($, {
|
|
@@ -4809,7 +4845,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4809
4845
|
onClick: () => e.selectAllCells(),
|
|
4810
4846
|
children: /* @__PURE__ */ j(ze, {})
|
|
4811
4847
|
})
|
|
4812
|
-
] }), /* @__PURE__ */ j(
|
|
4848
|
+
] }), /* @__PURE__ */ j(wa, { children: /* @__PURE__ */ j(e.Subscribe, {
|
|
4813
4849
|
source: e.atoms.cellSelection,
|
|
4814
4850
|
children: () => /* @__PURE__ */ j($, {
|
|
4815
4851
|
size: "icon",
|
|
@@ -4827,7 +4863,7 @@ var Ba = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.
|
|
|
4827
4863
|
};
|
|
4828
4864
|
//#endregion
|
|
4829
4865
|
//#region src/components/ui/spinner.tsx
|
|
4830
|
-
function
|
|
4866
|
+
function Wa({ className: e, ...t }) {
|
|
4831
4867
|
return /* @__PURE__ */ j(Re, {
|
|
4832
4868
|
"data-slot": "spinner",
|
|
4833
4869
|
role: "status",
|
|
@@ -4838,7 +4874,7 @@ function Ha({ className: e, ...t }) {
|
|
|
4838
4874
|
}
|
|
4839
4875
|
//#endregion
|
|
4840
4876
|
//#region src/package/ui/toolbar/right/ToolbarRightSettings.tsx
|
|
4841
|
-
var
|
|
4877
|
+
var Ga = () => {
|
|
4842
4878
|
"use no memo";
|
|
4843
4879
|
let { table: e, setIsSplit: t, gridWrapperRef: n, isFetching: r, refetch: a, setGlobalFilter: o } = I(), [s, l] = c(!1);
|
|
4844
4880
|
return i(() => {
|
|
@@ -4891,7 +4927,7 @@ var Ua = () => {
|
|
|
4891
4927
|
variant: "outline",
|
|
4892
4928
|
onClick: () => a?.(),
|
|
4893
4929
|
disabled: r,
|
|
4894
|
-
children: [r && /* @__PURE__ */ j(
|
|
4930
|
+
children: [r && /* @__PURE__ */ j(Wa, {}), r ? "Refreshing..." : "Refresh Data"]
|
|
4895
4931
|
}),
|
|
4896
4932
|
/* @__PURE__ */ j($, {
|
|
4897
4933
|
variant: "outline",
|
|
@@ -4903,7 +4939,7 @@ var Ua = () => {
|
|
|
4903
4939
|
]
|
|
4904
4940
|
})]
|
|
4905
4941
|
});
|
|
4906
|
-
},
|
|
4942
|
+
}, Ka = ({ height: e }) => {
|
|
4907
4943
|
"use no memo";
|
|
4908
4944
|
let [t, n] = c(null), r = (e) => {
|
|
4909
4945
|
n(t === e ? null : e);
|
|
@@ -4922,23 +4958,23 @@ var Ua = () => {
|
|
|
4922
4958
|
children: [
|
|
4923
4959
|
t === "columns" && /* @__PURE__ */ j("div", {
|
|
4924
4960
|
style: i,
|
|
4925
|
-
children: /* @__PURE__ */ j(
|
|
4961
|
+
children: /* @__PURE__ */ j(Da, {})
|
|
4926
4962
|
}),
|
|
4927
4963
|
t === "rows" && /* @__PURE__ */ j("div", {
|
|
4928
4964
|
style: i,
|
|
4929
|
-
children: /* @__PURE__ */ j(
|
|
4965
|
+
children: /* @__PURE__ */ j(Ua, {})
|
|
4930
4966
|
}),
|
|
4931
4967
|
t === "filter" && /* @__PURE__ */ j("div", {
|
|
4932
4968
|
style: i,
|
|
4933
|
-
children: /* @__PURE__ */ j(
|
|
4969
|
+
children: /* @__PURE__ */ j(Ba, {})
|
|
4934
4970
|
}),
|
|
4935
4971
|
t === "dnd" && /* @__PURE__ */ j("div", {
|
|
4936
4972
|
style: i,
|
|
4937
|
-
children: /* @__PURE__ */ j(
|
|
4973
|
+
children: /* @__PURE__ */ j(Ia, {})
|
|
4938
4974
|
}),
|
|
4939
4975
|
t === "settings" && /* @__PURE__ */ j("div", {
|
|
4940
4976
|
style: i,
|
|
4941
|
-
children: /* @__PURE__ */ j(
|
|
4977
|
+
children: /* @__PURE__ */ j(Ga, {})
|
|
4942
4978
|
}),
|
|
4943
4979
|
/* @__PURE__ */ j("div", {
|
|
4944
4980
|
style: {
|
|
@@ -4987,7 +5023,7 @@ var Ua = () => {
|
|
|
4987
5023
|
})
|
|
4988
5024
|
]
|
|
4989
5025
|
});
|
|
4990
|
-
},
|
|
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 }) => {
|
|
4991
5027
|
"use no memo";
|
|
4992
5028
|
return /* @__PURE__ */ j(cn, {
|
|
4993
5029
|
payload: e,
|
|
@@ -5013,9 +5049,9 @@ var Ua = () => {
|
|
|
5013
5049
|
enableCellSpanning: v,
|
|
5014
5050
|
enableRowSelection: ne,
|
|
5015
5051
|
topRightSlot: re,
|
|
5016
|
-
children: /* @__PURE__ */ j(
|
|
5052
|
+
children: /* @__PURE__ */ j(Ja, {})
|
|
5017
5053
|
});
|
|
5018
|
-
},
|
|
5054
|
+
}, Ja = () => {
|
|
5019
5055
|
"use no memo";
|
|
5020
5056
|
let { gridWrapperRef: e } = I(), t = s(null), [n, r] = c(0);
|
|
5021
5057
|
return a(() => {
|
|
@@ -5045,7 +5081,7 @@ var Ua = () => {
|
|
|
5045
5081
|
width: "100%"
|
|
5046
5082
|
},
|
|
5047
5083
|
children: [
|
|
5048
|
-
/* @__PURE__ */ j(
|
|
5084
|
+
/* @__PURE__ */ j(xa, {}),
|
|
5049
5085
|
/* @__PURE__ */ j("div", {
|
|
5050
5086
|
style: {
|
|
5051
5087
|
overflow: "hidden",
|
|
@@ -5054,12 +5090,12 @@ var Ua = () => {
|
|
|
5054
5090
|
ref: t,
|
|
5055
5091
|
children: /* @__PURE__ */ j(sa, {})
|
|
5056
5092
|
}),
|
|
5057
|
-
/* @__PURE__ */ j(
|
|
5058
|
-
/* @__PURE__ */ j(
|
|
5093
|
+
/* @__PURE__ */ j(ha, {}),
|
|
5094
|
+
/* @__PURE__ */ j(Ka, { height: n })
|
|
5059
5095
|
]
|
|
5060
|
-
}), /* @__PURE__ */ j(
|
|
5096
|
+
}), /* @__PURE__ */ j(Sa, {})]
|
|
5061
5097
|
});
|
|
5062
|
-
},
|
|
5098
|
+
}, Ya = () => {
|
|
5063
5099
|
let [t, n] = e.useState([]), [r, i] = e.useState({
|
|
5064
5100
|
pageIndex: 0,
|
|
5065
5101
|
pageSize: 20
|
|
@@ -5081,34 +5117,34 @@ var Ua = () => {
|
|
|
5081
5117
|
},
|
|
5082
5118
|
rowSelection: s
|
|
5083
5119
|
};
|
|
5084
|
-
},
|
|
5120
|
+
}, Xa = (e) => new URLSearchParams(e.flatMap(({ id: e, value: t }) => {
|
|
5085
5121
|
let n = e.replace(/_/g, ".");
|
|
5086
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)]] : [];
|
|
5087
5123
|
})).toString();
|
|
5088
5124
|
//#endregion
|
|
5089
5125
|
//#region src/package/utils/buildSortString.ts
|
|
5090
|
-
function
|
|
5126
|
+
function Za(e) {
|
|
5091
5127
|
if (!e || e.length === 0) return "";
|
|
5092
5128
|
let t = e.filter((e) => e.id != null && e.id.trim() !== "").map((e) => e.desc ? e.id : `-${e.id}`);
|
|
5093
5129
|
return t.length === 0 ? "" : `sort=${t.join(",")}`;
|
|
5094
5130
|
}
|
|
5095
5131
|
//#endregion
|
|
5096
5132
|
//#region src/package/hooks/useQueryArgs.ts
|
|
5097
|
-
var
|
|
5133
|
+
var Qa = (e) => o(() => ({
|
|
5098
5134
|
pagination: e.pagination,
|
|
5099
|
-
queryParams:
|
|
5100
|
-
sort:
|
|
5135
|
+
queryParams: Xa(e.columnFilters),
|
|
5136
|
+
sort: Za(e.sorting),
|
|
5101
5137
|
globalFilter: e.globalFilter
|
|
5102
5138
|
}), [e]);
|
|
5103
5139
|
//#endregion
|
|
5104
5140
|
//#region src/package/utils/pluckSelected.ts
|
|
5105
|
-
function
|
|
5141
|
+
function $a(e, t, n) {
|
|
5106
5142
|
return Object.entries(t).filter(([, e]) => e).map(([t]) => e[Number(t)]).filter((e) => e !== void 0).map((e) => e[n]);
|
|
5107
5143
|
}
|
|
5108
5144
|
//#endregion
|
|
5109
5145
|
//#region src/package/utils/URLSearch.ts
|
|
5110
|
-
var
|
|
5111
|
-
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) {
|
|
5112
5148
|
let { id: n, value: r } = t, i = n.replace(/_/g, ".");
|
|
5113
5149
|
if (Array.isArray(r) && r.length === 2) {
|
|
5114
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]));
|
|
@@ -5116,16 +5152,16 @@ function $a(e, t) {
|
|
|
5116
5152
|
}
|
|
5117
5153
|
if (typeof r == "object" && r) {
|
|
5118
5154
|
Object.entries(r).forEach(([t, n]) => {
|
|
5119
|
-
|
|
5155
|
+
eo.includes(t) && n != null && n !== "" && e.set(`${i}[${t}]`, String(n));
|
|
5120
5156
|
});
|
|
5121
5157
|
return;
|
|
5122
5158
|
}
|
|
5123
5159
|
r != null && r !== "" && e.set(i, String(r));
|
|
5124
5160
|
}
|
|
5125
|
-
function
|
|
5161
|
+
function no(e) {
|
|
5126
5162
|
let t = new URLSearchParams();
|
|
5127
5163
|
if (t.set("page", String(e.pagination.pageIndex + 1)), t.set("limit", String(e.pagination.pageSize)), e.columnFilters.forEach((e) => {
|
|
5128
|
-
|
|
5164
|
+
to(t, e);
|
|
5129
5165
|
}), e.sorting.length > 0) {
|
|
5130
5166
|
let n = e.sorting.map((e) => e.desc ? `-${e.id}` : e.id).join(",");
|
|
5131
5167
|
t.set("sort", n);
|
|
@@ -5133,4 +5169,4 @@ function eo(e) {
|
|
|
5133
5169
|
return e.globalFilter && t.set("q", e.globalFilter), `?${t.toString()}`;
|
|
5134
5170
|
}
|
|
5135
5171
|
//#endregion
|
|
5136
|
-
export {
|
|
5172
|
+
export { qa as Grid, no as URLSearch, $a as pluckSelected, I as useGrid, Ya as useGridState, Qa as useQueryArgs };
|
|
@@ -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;
|
|
@@ -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
|
+
}
|