@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/table.tsx +29 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/ui",
3
- "version": "7.15.0",
3
+ "version": "7.16.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tokens": "./src/tokens.ts",
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
- <View style={styles.headerBand}>
84
- {leading > 0 ? <View style={{ width: leading }}>{selectAll}</View> : null}
85
- {columns.map((col) => (
86
- <View key={col.key} style={colStyle(col)}>
87
- {col.label ? (
88
- col.sortable && onSort ? (
89
- <SortHeader label={col.label} sortKey={col.key} sort={sort ?? null} onSort={onSort} align={col.align} labels={sortLabels} />
90
- ) : (
91
- <Text size="xs" color="muted" transform="uppercase" numberOfLines={1}>
92
- {col.label}
93
- </Text>
94
- )
95
- ) : null}
96
- </View>
97
- ))}
98
- {trailing > 0 ? <View style={{ width: trailing }} /> : null}
99
- </View>
100
- <View style={styles.body}>
101
- {rows.map((row, i) => (
102
- <View key={i}>
103
- {i > 0 ? <Divider /> : null}
104
- {row}
105
- </View>
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
  );