@jinaan/uikit 0.1.38 → 0.1.39
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/dist/data-table.d.ts.map +1 -1
- package/dist/index.js +144 -152
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/data-table.tsx +3 -4
package/package.json
CHANGED
package/src/data-table.tsx
CHANGED
|
@@ -372,6 +372,9 @@ export function DataTable<T>({
|
|
|
372
372
|
setColumnWidths((prev) => (prev.length === 0 ? prev : []));
|
|
373
373
|
return;
|
|
374
374
|
}
|
|
375
|
+
// Widths cover every rendered column — including the selection checkbox
|
|
376
|
+
// and row-actions cells — in order, so one <col> per entry maps 1:1 in
|
|
377
|
+
// both colgroups. Never add extra <col> elements alongside these.
|
|
375
378
|
const widths = Array.from(cells, (cell, i) =>
|
|
376
379
|
Math.max(
|
|
377
380
|
Math.round(cell.getBoundingClientRect().width),
|
|
@@ -672,11 +675,9 @@ export function DataTable<T>({
|
|
|
672
675
|
}}
|
|
673
676
|
>
|
|
674
677
|
<colgroup>
|
|
675
|
-
{selectable && <col key="selectable" style={{ width: "2.75rem" }} />}
|
|
676
678
|
{columnWidths.map((width, i) => (
|
|
677
679
|
<col key={i} style={{ width }} />
|
|
678
680
|
))}
|
|
679
|
-
{rowActions && <col key="actions" style={{ width: "11rem" }} />}
|
|
680
681
|
</colgroup>
|
|
681
682
|
<thead>
|
|
682
683
|
<tr>
|
|
@@ -778,11 +779,9 @@ export function DataTable<T>({
|
|
|
778
779
|
>
|
|
779
780
|
{columnWidths.length > 0 && (
|
|
780
781
|
<colgroup>
|
|
781
|
-
{selectable && <col key="selectable" style={{ width: "2.75rem" }} />}
|
|
782
782
|
{columnWidths.map((width, i) => (
|
|
783
783
|
<col key={i} style={{ width }} />
|
|
784
784
|
))}
|
|
785
|
-
{rowActions && <col key="actions" style={{ width: "11rem" }} />}
|
|
786
785
|
</colgroup>
|
|
787
786
|
)}
|
|
788
787
|
{/* Semantic headers for assistive tech; the visible band is presentational. */}
|