@snowpact/react-tanstack-query-table 1.5.6 → 1.6.1
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 +53 -0
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +19 -2
- package/dist/index.js +1149 -1142
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -375,6 +375,59 @@ const columns: SnowColumnConfig<User>[] = [
|
|
|
375
375
|
];
|
|
376
376
|
```
|
|
377
377
|
|
|
378
|
+
### Column Metadata (meta)
|
|
379
|
+
|
|
380
|
+
Use `meta` to customize column appearance and behavior:
|
|
381
|
+
|
|
382
|
+
```tsx
|
|
383
|
+
import { SnowColumnConfig, SnowColumnMeta } from '@snowpact/react-tanstack-query-table';
|
|
384
|
+
|
|
385
|
+
const columns: SnowColumnConfig<User>[] = [
|
|
386
|
+
{
|
|
387
|
+
key: 'id',
|
|
388
|
+
label: 'ID',
|
|
389
|
+
meta: {
|
|
390
|
+
width: '80px',
|
|
391
|
+
center: true,
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
key: 'name',
|
|
396
|
+
label: 'Name',
|
|
397
|
+
meta: {
|
|
398
|
+
minWidth: '150px',
|
|
399
|
+
maxWidth: '300px',
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
key: 'description',
|
|
404
|
+
label: 'Description',
|
|
405
|
+
meta: {
|
|
406
|
+
defaultHidden: true, // Hidden by default in column configuration
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
key: 'actions',
|
|
411
|
+
label: '',
|
|
412
|
+
meta: {
|
|
413
|
+
width: 'auto',
|
|
414
|
+
disableColumnClick: true, // Don't trigger onRowClick for this column
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
];
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
#### SnowColumnMeta options
|
|
421
|
+
|
|
422
|
+
| Option | Type | Description |
|
|
423
|
+
| -------------------- | ------------------ | ------------------------------------------------ |
|
|
424
|
+
| `width` | `string \| number` | Column width (e.g., `'200px'`, `'20%'`, `'auto'`) |
|
|
425
|
+
| `minWidth` | `string \| number` | Minimum column width |
|
|
426
|
+
| `maxWidth` | `string \| number` | Maximum column width |
|
|
427
|
+
| `defaultHidden` | `boolean` | Hide column by default (with `enableColumnConfiguration`) |
|
|
428
|
+
| `disableColumnClick` | `boolean` | Disable `onRowClick` for this column |
|
|
429
|
+
| `center` | `boolean` | Center column content |
|
|
430
|
+
|
|
378
431
|
---
|
|
379
432
|
|
|
380
433
|
## API Reference
|