@lotics/ui 7.15.0 → 7.16.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/package.json +1 -1
- package/src/table.tsx +29 -24
package/package.json
CHANGED
package/src/table.tsx
CHANGED
|
@@ -80,30 +80,35 @@ export function Table(props: TableProps) {
|
|
|
80
80
|
|
|
81
81
|
return (
|
|
82
82
|
<TableContext.Provider value={{ columns, leading, trailing }}>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<View
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
83
|
+
{/* ONE layout node: without this wrapper the header band + body land as two
|
|
84
|
+
direct flex children of the app's container, and a parent column `gap`
|
|
85
|
+
(the standard section spacing) opens a hole between the header and rows. */}
|
|
86
|
+
<View>
|
|
87
|
+
<View style={styles.headerBand}>
|
|
88
|
+
{leading > 0 ? <View style={{ width: leading }}>{selectAll}</View> : null}
|
|
89
|
+
{columns.map((col) => (
|
|
90
|
+
<View key={col.key} style={colStyle(col)}>
|
|
91
|
+
{col.label ? (
|
|
92
|
+
col.sortable && onSort ? (
|
|
93
|
+
<SortHeader label={col.label} sortKey={col.key} sort={sort ?? null} onSort={onSort} align={col.align} labels={sortLabels} />
|
|
94
|
+
) : (
|
|
95
|
+
<Text size="xs" color="muted" transform="uppercase" numberOfLines={1}>
|
|
96
|
+
{col.label}
|
|
97
|
+
</Text>
|
|
98
|
+
)
|
|
99
|
+
) : null}
|
|
100
|
+
</View>
|
|
101
|
+
))}
|
|
102
|
+
{trailing > 0 ? <View style={{ width: trailing }} /> : null}
|
|
103
|
+
</View>
|
|
104
|
+
<View style={styles.body}>
|
|
105
|
+
{rows.map((row, i) => (
|
|
106
|
+
<View key={i}>
|
|
107
|
+
{i > 0 ? <Divider /> : null}
|
|
108
|
+
{row}
|
|
109
|
+
</View>
|
|
110
|
+
))}
|
|
111
|
+
</View>
|
|
107
112
|
</View>
|
|
108
113
|
</TableContext.Provider>
|
|
109
114
|
);
|