react-glide-table 2.2.1 → 2.3.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 +33 -30
- package/dist/compound.cjs +561 -139
- package/dist/compound.d.cts +2 -2
- package/dist/compound.d.ts +2 -2
- package/dist/compound.js +465 -43
- package/dist/core.cjs +491 -137
- package/dist/core.d.cts +46 -7
- package/dist/core.d.ts +46 -7
- package/dist/core.js +378 -25
- package/dist/index.cjs +590 -166
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +466 -43
- package/dist/{types-CnsQ8GZb.d.cts → types-DdeVn-9s.d.cts} +23 -6
- package/dist/{types-CnsQ8GZb.d.ts → types-DdeVn-9s.d.ts} +23 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -151,10 +151,11 @@ const buttonRenderer = {
|
|
|
151
151
|
Action
|
|
152
152
|
</ProductTable.Column>
|
|
153
153
|
</ProductTable.Header>
|
|
154
|
-
</ProductTable
|
|
154
|
+
</ProductTable>;
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
Same `kind` in `cellRenderers` overrides the builtin. Extra kinds are added by key.
|
|
158
|
+
|
|
158
159
|
## Escape hatch (`useGlideTable`)
|
|
159
160
|
|
|
160
161
|
```tsx
|
|
@@ -261,7 +262,9 @@ Helpers (`/core`): `buildRowsPastePayload`, `parseClipboardTSV`, `parseClipboard
|
|
|
261
262
|
|
|
262
263
|
## Column width
|
|
263
264
|
|
|
264
|
-
`Column.width` sets
|
|
265
|
+
`Column.width` sets a fixed size. Columns without `width` keep leftover space.
|
|
266
|
+
|
|
267
|
+
`minWidth` / `maxWidth` (without `width`) resolve to a size inside that range, preferring `maxWidth` when space allows so content can stay on one line. Unconstrained columns (no `width`, no min/max) still receive leftover space after that. When the viewport is tight, bounded columns shrink toward `minWidth` first. They do not clamp drag-resize.
|
|
265
268
|
|
|
266
269
|
```tsx
|
|
267
270
|
<ProductTable.Column field="note" minWidth={80} maxWidth={240}>
|
|
@@ -269,7 +272,7 @@ Helpers (`/core`): `buildRowsPastePayload`, `parseClipboardTSV`, `parseClipboard
|
|
|
269
272
|
</ProductTable.Column>
|
|
270
273
|
```
|
|
271
274
|
|
|
272
|
-
With `ColumnDef` (non-compound), put the same values on `meta.minWidth` / `meta.maxWidth`.
|
|
275
|
+
With `ColumnDef` (non-compound), put the same values on `meta.width` / `meta.minWidth` / `meta.maxWidth`.
|
|
273
276
|
|
|
274
277
|
## Column resize
|
|
275
278
|
|
|
@@ -334,13 +337,13 @@ Leaf columns can move across `ColumnGroup`s. Consecutive leaves that still share
|
|
|
334
337
|
</ProductTable>
|
|
335
338
|
```
|
|
336
339
|
|
|
337
|
-
| Prop
|
|
338
|
-
|
|
|
339
|
-
| `enableColumnReorder`
|
|
340
|
-
| `columnOrder` / `onColumnOrderChange`
|
|
341
|
-
| `Column.reorderable={false}`
|
|
342
|
-
| `data-reorderable` / `data-drop-edge`
|
|
343
|
-
| `classNames.dropEdge`
|
|
340
|
+
| Prop | Role |
|
|
341
|
+
| ------------------------------------- | ------------------------------------------------- |
|
|
342
|
+
| `enableColumnReorder` | Turn on header drag reorder (default `false`) |
|
|
343
|
+
| `columnOrder` / `onColumnOrderChange` | Controlled leaf id list (`string[]`) |
|
|
344
|
+
| `Column.reorderable={false}` | Disable drag for one column (still a drop target) |
|
|
345
|
+
| `data-reorderable` / `data-drop-edge` | Drag / drop state hooks on header cells |
|
|
346
|
+
| `classNames.dropEdge` | Extra class while a drop edge is shown |
|
|
344
347
|
|
|
345
348
|
Helpers (`/core`): `applyLeafColumnOrder`, `moveColumnIds`, `collectLeafColumnIds`, `useColumnReorder`, …
|
|
346
349
|
|
|
@@ -367,12 +370,12 @@ Keep vertical stickiness on the header via `classNames.head` (e.g. `sticky top-0
|
|
|
367
370
|
</ProductTable>
|
|
368
371
|
```
|
|
369
372
|
|
|
370
|
-
| Prop
|
|
371
|
-
|
|
|
372
|
-
| `enableColumnFreeze`
|
|
373
|
-
| `Column.frozen` / `meta.frozen`
|
|
374
|
-
| `data-frozen`
|
|
375
|
-
| `data-freeze-edge`
|
|
373
|
+
| Prop | Role |
|
|
374
|
+
| ------------------------------- | ---------------------------------------------------- |
|
|
375
|
+
| `enableColumnFreeze` | Turn on sticky freeze (default `false`) |
|
|
376
|
+
| `Column.frozen` / `meta.frozen` | `true` / `"left"` or `"right"` |
|
|
377
|
+
| `data-frozen` | `"left"` / `"right"` on frozen cells |
|
|
378
|
+
| `data-freeze-edge` | `"left"` / `"right"` / `"both"` on island boundaries |
|
|
376
379
|
|
|
377
380
|
Helpers (`/core`): `buildColumnFreezeOffsets`, `getColumnFreezeEdgeAttr`, `getColumnFreezeStyle`, `resolveColumnFreezeSide`.
|
|
378
381
|
|
|
@@ -390,21 +393,21 @@ On tree tables (`toggleField`), search also scans **collapsed** descendants. Nav
|
|
|
390
393
|
</ProductTable>
|
|
391
394
|
```
|
|
392
395
|
|
|
393
|
-
| Shortcut / control
|
|
394
|
-
|
|
|
395
|
-
| Ctrl/Cmd+F
|
|
396
|
-
| Enter / ↓
|
|
397
|
-
| Shift+Enter / ↑
|
|
398
|
-
| Escape / Ctrl+F (in box) / ✕ | Close
|
|
399
|
-
|
|
400
|
-
| Prop
|
|
401
|
-
|
|
|
402
|
-
| `enableInlineSearch`
|
|
403
|
-
| `showSearch` / `onSearchClose`
|
|
404
|
-
| `searchValue` / `onSearchValueChange`
|
|
396
|
+
| Shortcut / control | Behavior |
|
|
397
|
+
| ---------------------------- | ------------------------------ |
|
|
398
|
+
| Ctrl/Cmd+F | Open (or focus) the search box |
|
|
399
|
+
| Enter / ↓ | Next match |
|
|
400
|
+
| Shift+Enter / ↑ | Previous match |
|
|
401
|
+
| Escape / Ctrl+F (in box) / ✕ | Close |
|
|
402
|
+
|
|
403
|
+
| Prop | Role |
|
|
404
|
+
| ------------------------------------------ | --------------------------------------------------- |
|
|
405
|
+
| `enableInlineSearch` | Turn on search (default `false`) |
|
|
406
|
+
| `showSearch` / `onSearchClose` | Controlled overlay visibility |
|
|
407
|
+
| `searchValue` / `onSearchValueChange` | Controlled query |
|
|
405
408
|
| `searchResults` / `onSearchResultsChanged` | Override / observe matches (`[colIndex, rowIndex]`) |
|
|
406
|
-
| `data-search-match` / `data-search-active` | Match highlight hooks on cells
|
|
407
|
-
| `classNames.search*`
|
|
409
|
+
| `data-search-match` / `data-search-active` | Match highlight hooks on cells |
|
|
410
|
+
| `classNames.search*` | Style the overlay |
|
|
408
411
|
|
|
409
412
|
Helpers (`/core`): `useInlineSearch`, `collectSearchMatchesInRange`, `formatSearchResultLabel`, …
|
|
410
413
|
|