react-glide-table 2.0.2 → 2.2.0
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 +35 -0
- package/dist/compound.cjs +590 -126
- package/dist/compound.d.cts +3 -3
- package/dist/compound.d.ts +3 -3
- package/dist/compound.js +571 -102
- package/dist/core.cjs +444 -11
- package/dist/core.d.cts +53 -14
- package/dist/core.d.ts +53 -14
- package/dist/core.js +443 -11
- package/dist/index.cjs +509 -33
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +492 -17
- package/dist/{types-bgEceyRV.d.cts → types-Iot4g4sq.d.cts} +38 -2
- package/dist/{types-bgEceyRV.d.ts → types-Iot4g4sq.d.ts} +38 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -291,6 +291,41 @@ Opt in with `enableColumnResize`. Drag the handle on the right edge of a header
|
|
|
291
291
|
| `Column.resizable={false}` | Disable resize for one column |
|
|
292
292
|
| `classNames.resizeHandle` | Style hook for the drag handle |
|
|
293
293
|
|
|
294
|
+
## Column reorder
|
|
295
|
+
|
|
296
|
+
Opt in with `enableColumnReorder`. Drag a column header to a new position; a drop edge marks the insert point ([demo](https://glideapps.github.io/glide-data-grid/?path=/story/glide-data-grid-dataeditor-demos--rearrange-columns)). Movement below a small threshold still counts as a click, so sortable headers keep working. The resize handle does not start a reorder.
|
|
297
|
+
|
|
298
|
+
Leaf columns can move across `ColumnGroup`s. Consecutive leaves that still share a group stay wrapped; interleaved leaves split that group (Glide-style). Frozen columns keep their freeze after the move.
|
|
299
|
+
|
|
300
|
+
```tsx
|
|
301
|
+
<ProductTable
|
|
302
|
+
data={data}
|
|
303
|
+
enableColumnReorder
|
|
304
|
+
// optional controlled order (leaf column ids)
|
|
305
|
+
// columnOrder={order}
|
|
306
|
+
// onColumnOrderChange={setOrder}
|
|
307
|
+
>
|
|
308
|
+
<ProductTable.Header>
|
|
309
|
+
<ProductTable.Column field="name" width={200}>
|
|
310
|
+
Name
|
|
311
|
+
</ProductTable.Column>
|
|
312
|
+
<ProductTable.Column field="sku" reorderable={false}>
|
|
313
|
+
SKU
|
|
314
|
+
</ProductTable.Column>
|
|
315
|
+
</ProductTable.Header>
|
|
316
|
+
</ProductTable>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
| Prop | Role |
|
|
320
|
+
| --------------------------------------- | ------------------------------------------------- |
|
|
321
|
+
| `enableColumnReorder` | Turn on header drag reorder (default `false`) |
|
|
322
|
+
| `columnOrder` / `onColumnOrderChange` | Controlled leaf id list (`string[]`) |
|
|
323
|
+
| `Column.reorderable={false}` | Disable drag for one column (still a drop target) |
|
|
324
|
+
| `data-reorderable` / `data-drop-edge` | Drag / drop state hooks on header cells |
|
|
325
|
+
| `classNames.dropEdge` | Extra class while a drop edge is shown |
|
|
326
|
+
|
|
327
|
+
Helpers (`/core`): `applyLeafColumnOrder`, `moveColumnIds`, `collectLeafColumnIds`, `useColumnReorder`, …
|
|
328
|
+
|
|
294
329
|
## Column freeze
|
|
295
330
|
|
|
296
331
|
Opt in with `enableColumnFreeze`. Mark columns with `frozen` — sticky insets are stacked so frozen cells never overlap, and **column order is unchanged** (middle columns may also freeze).
|