@jinaan/uikit 0.1.36 → 0.1.38
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 +578 -555
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/data-table.tsx +22 -1
package/package.json
CHANGED
package/src/data-table.tsx
CHANGED
|
@@ -672,9 +672,11 @@ export function DataTable<T>({
|
|
|
672
672
|
}}
|
|
673
673
|
>
|
|
674
674
|
<colgroup>
|
|
675
|
+
{selectable && <col key="selectable" style={{ width: "2.75rem" }} />}
|
|
675
676
|
{columnWidths.map((width, i) => (
|
|
676
677
|
<col key={i} style={{ width }} />
|
|
677
678
|
))}
|
|
679
|
+
{rowActions && <col key="actions" style={{ width: "11rem" }} />}
|
|
678
680
|
</colgroup>
|
|
679
681
|
<thead>
|
|
680
682
|
<tr>
|
|
@@ -763,7 +765,26 @@ export function DataTable<T>({
|
|
|
763
765
|
action={empty?.action}
|
|
764
766
|
/>
|
|
765
767
|
) : (
|
|
766
|
-
<table
|
|
768
|
+
<table
|
|
769
|
+
ref={bodyTableRef}
|
|
770
|
+
className={cn(
|
|
771
|
+
"border-collapse text-left",
|
|
772
|
+
// Unmeasured: content-sized so intrinsic column widths can be
|
|
773
|
+
// measured (w-full would squeeze columns into the container).
|
|
774
|
+
// Measured: pinned to the band's colgroup pixel widths.
|
|
775
|
+
columnWidths.length > 0 ? "w-full table-fixed" : "table-auto",
|
|
776
|
+
)}
|
|
777
|
+
style={{ width: totalWidth > 0 ? totalWidth : undefined }}
|
|
778
|
+
>
|
|
779
|
+
{columnWidths.length > 0 && (
|
|
780
|
+
<colgroup>
|
|
781
|
+
{selectable && <col key="selectable" style={{ width: "2.75rem" }} />}
|
|
782
|
+
{columnWidths.map((width, i) => (
|
|
783
|
+
<col key={i} style={{ width }} />
|
|
784
|
+
))}
|
|
785
|
+
{rowActions && <col key="actions" style={{ width: "11rem" }} />}
|
|
786
|
+
</colgroup>
|
|
787
|
+
)}
|
|
767
788
|
{/* Semantic headers for assistive tech; the visible band is presentational. */}
|
|
768
789
|
<thead className="sr-only">
|
|
769
790
|
<tr>
|