You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: update column pinning terminology from left/right to start/end (#6398)
* feat: update column pinning terminology from left/right to start/end
* update beta number
* update variable names and clarify left to right associations
Copy file name to clipboardExpand all lines: docs/framework/alpine/guide/column-ordering.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ By default, columns are ordered in the order they are defined in the `columns` a
40
40
41
41
There are 3 table features that can reorder columns, which happen in the following order:
42
42
43
-
1.[Column Pinning](./column-pinning) - If pinning, columns are split into left, center (unpinned), and right pinned columns.
43
+
1.[Column Pinning](./column-pinning) - If pinning, columns are split into start, center (unpinned), and end pinned columns.
44
44
2. Manual **Column Ordering** - A manually specified column order is applied.
45
45
3.[Grouping](./grouping) - If grouping is enabled, a grouping state is active, and `tableOptions.groupedColumnMode` is set to `'reorder' | 'remove'`, then the grouped columns are reordered to the start of the column flow.
46
46
@@ -173,9 +173,9 @@ Columns expose helpers for reading their current position after column pinning,
Copy file name to clipboardExpand all lines: docs/framework/alpine/guide/column-pinning.md
+37-35Lines changed: 37 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,17 +36,19 @@ const table = createTable({
36
36
37
37
## Column Pinning (Alpine) Guide
38
38
39
-
TanStack Table offers state and APIs helpful for implementing column pinning features in your table UI. You can implement column pinning in multiple ways. You can either split pinned columns into their own separate tables, or you can keep all columns in the same table, but use the pinning state to order the columns correctly and use sticky CSS to pin the columns to the left or right.
39
+
TanStack Table offers state and APIs helpful for implementing column pinning features in your table UI. You can implement column pinning in multiple ways. You can either split pinned columns into their own separate tables, or you can keep all columns in the same table, but use the pinning state to order the columns correctly and use sticky CSS to pin the columns to the start or end.
40
+
41
+
`start` and `end` are logical pinning regions. In LTR languages/layouts, `start` usually corresponds to left and `end` to right. In RTL languages/layouts, `start` usually corresponds to right and `end` to left.
40
42
41
43
### How Column Pinning Affects Column Order
42
44
43
45
There are 3 table features that can reorder columns, which happen in the following order:
44
46
45
-
1.**Column Pinning** - If pinning, columns are split into left, center (unpinned), and right pinned columns.
47
+
1.**Column Pinning** - If pinning, columns are split into start, center (unpinned), and end pinned columns.
46
48
2. Manual [Column Ordering](./column-ordering) - A manually specified column order is applied.
47
49
3.[Grouping](./grouping) - If grouping is enabled, a grouping state is active, and `tableOptions.groupedColumnMode` is set to `'reorder' | 'remove'`, then the grouped columns are reordered to the start of the column flow.
48
50
49
-
The only way to change the order of the pinned columns is in the `columnPinning.left` and `columnPinning.right` state itself. `columnOrder` state will only affect the order of the unpinned ("center") columns.
51
+
The only way to change the order of the pinned columns is in the `columnPinning.start` and `columnPinning.end` state itself. `columnOrder` state will only affect the order of the unpinned ("center") columns.
50
52
51
53
### Column Pinning State
52
54
@@ -66,8 +68,8 @@ import type { ColumnPinningState } from '@tanstack/alpine-table'
66
68
const features =tableFeatures({ columnPinningFeature })
There are a handful of useful Column API methods to help you implement column pinning features:
136
138
137
139
-`column.getCanPin`: Use to determine if a column can be pinned.
138
-
-`column.pin`: Use to pin a column to the left or right. Or use to unpin a column.
140
+
-`column.pin`: Use to pin a column to the start or end. Or use to unpin a column.
139
141
-`column.getIsPinned`: Use to determine where a column is pinned.
140
142
-`column.getPinnedIndex`: Use to read the column's index within its pinned column group.
141
-
-`column.getStart`: Use to provide the correct `left` CSS value for a pinned column.
142
-
-`column.getAfter`: Use to provide the correct `right` CSS value for a pinned column.
143
+
-`column.getStart`: Use to provide the correct `start` CSS value for a pinned column.
144
+
-`column.getAfter`: Use to provide the correct `end` CSS value for a pinned column.
143
145
-`column.getIsLastColumn`: Use to determine if a column is the last column in its pinned group. Useful for adding a box-shadow.
144
146
-`column.getIsFirstColumn`: Use to determine if a column is the first column in its pinned group. Useful for adding a box-shadow.
145
147
146
148
Use `table.setColumnPinning` to update the pinning state directly. Use `table.resetColumnPinning` to reset to `initialState.columnPinning`, or pass `true` to clear both pinned column arrays.
The table instance exposes pinned column and header helpers for each region:
159
161
160
162
```ts
161
-
table.getLeftLeafColumns()
163
+
table.getStartLeafColumns()
162
164
table.getCenterLeafColumns()
163
-
table.getRightLeafColumns()
165
+
table.getEndLeafColumns()
164
166
165
-
table.getLeftVisibleLeafColumns()
167
+
table.getStartVisibleLeafColumns()
166
168
table.getCenterVisibleLeafColumns()
167
-
table.getRightVisibleLeafColumns()
169
+
table.getEndVisibleLeafColumns()
168
170
169
-
table.getLeftHeaderGroups()
171
+
table.getStartHeaderGroups()
170
172
table.getCenterHeaderGroups()
171
-
table.getRightHeaderGroups()
173
+
table.getEndHeaderGroups()
172
174
173
-
table.getLeftFooterGroups()
175
+
table.getStartFooterGroups()
174
176
table.getCenterFooterGroups()
175
-
table.getRightFooterGroups()
177
+
table.getEndFooterGroups()
176
178
177
-
table.getLeftFlatHeaders()
179
+
table.getStartFlatHeaders()
178
180
table.getCenterFlatHeaders()
179
-
table.getRightFlatHeaders()
181
+
table.getEndFlatHeaders()
180
182
181
-
table.getLeftLeafHeaders()
183
+
table.getStartLeafHeaders()
182
184
table.getCenterLeafHeaders()
183
-
table.getRightLeafHeaders()
185
+
table.getEndLeafHeaders()
184
186
```
185
187
186
188
You can also request pinned leaf columns by region with `table.getPinnedLeafColumns(position)` and visible pinned leaf columns with `table.getPinnedVisibleLeafColumns(position)`.
187
189
188
190
```ts
189
-
table.getPinnedLeafColumns('left')
191
+
table.getPinnedLeafColumns('start')
190
192
table.getPinnedLeafColumns('center')
191
-
table.getPinnedLeafColumns('right')
193
+
table.getPinnedLeafColumns('end')
192
194
193
-
table.getPinnedVisibleLeafColumns('left')
195
+
table.getPinnedVisibleLeafColumns('start')
194
196
table.getPinnedVisibleLeafColumns('center')
195
-
table.getPinnedVisibleLeafColumns('right')
197
+
table.getPinnedVisibleLeafColumns('end')
196
198
```
197
199
198
-
Use `table.getIsSomeColumnsPinned()` to check if any columns are pinned, or pass `'left'` or `'right'` to check one pinned side.
200
+
Use `table.getIsSomeColumnsPinned()` to check if any columns are pinned, or pass `'start'` or `'end'` to check one pinned side.
199
201
200
202
### Wiring up the pinning UI
201
203
@@ -211,8 +213,8 @@ Because Alpine does not initialize directives inside content set with `x-html`,
@@ -223,8 +225,8 @@ Because Alpine does not initialize directives inside content set with `x-html`,
223
225
X
224
226
</button>
225
227
<button
226
-
x-show="header.column.getIsPinned() !== 'right'"
227
-
@click="header.column.pin('right')"
228
+
x-show="header.column.getIsPinned() !== 'end'"
229
+
@click="header.column.pin('end')"
228
230
>
229
231
=>
230
232
</button>
@@ -237,4 +239,4 @@ Because Alpine does not initialize directives inside content set with `x-html`,
237
239
238
240
If you are just using sticky CSS to pin columns, you can for the most part, just render the table as you normally would with the `table.getHeaderGroups` and `row.getVisibleCells` methods.
239
241
240
-
However, if you are splitting up pinned columns into their own separate tables, you can make use of the `table.getLeftHeaderGroups`, `table.getCenterHeaderGroups`, `table.getRightHeaderGroups`, `row.getLeftVisibleCells`, `row.getCenterVisibleCells`, and `row.getRightVisibleCells` methods to only render the columns that are relevant to the current table.
242
+
However, if you are splitting up pinned columns into their own separate tables, you can make use of the `table.getStartHeaderGroups`, `table.getCenterHeaderGroups`, `table.getEndHeaderGroups`, `row.getStartVisibleCells`, `row.getCenterVisibleCells`, and `row.getEndVisibleCells` methods to only render the columns that are relevant to the current table.
Copy file name to clipboardExpand all lines: docs/framework/alpine/guide/column-sizing.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,15 +135,15 @@ Use the column and header APIs to read the calculated size and offsets for rende
135
135
column.getSize()
136
136
header.getSize()
137
137
138
-
column.getStart() //left offset in the current column flow
139
-
column.getStart('left')
138
+
column.getStart() //start offset in the current column flow
139
+
column.getStart('start')
140
140
column.getStart('center')
141
-
column.getStart('right')
141
+
column.getStart('end')
142
142
143
-
column.getAfter() //right offset in the current column flow
144
-
column.getAfter('left')
143
+
column.getAfter() //end offset in the current column flow
144
+
column.getAfter('start')
145
145
column.getAfter('center')
146
-
column.getAfter('right')
146
+
column.getAfter('end')
147
147
148
148
column.resetSize()
149
149
```
@@ -152,9 +152,9 @@ The table instance also exposes total size helpers. These are useful when buildi
152
152
153
153
```ts
154
154
table.getTotalSize()
155
-
table.getLeftTotalSize()
155
+
table.getStartTotalSize()
156
156
table.getCenterTotalSize()
157
-
table.getRightTotalSize()
157
+
table.getEndTotalSize()
158
158
```
159
159
160
160
If you need to update sizing state directly, use `table.setColumnSizing`. Use `table.resetColumnSizing` to reset to `initialState.columnSizing`, or pass `true` to reset to the feature default.
Copy file name to clipboardExpand all lines: docs/framework/alpine/guide/grouping.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Grouping in TanStack table is a feature that applies to columns and allows you t
44
44
45
45
Grouping can also affect column order. There are 3 table features that can reorder columns, which happen in the following order:
46
46
47
-
1.[Column Pinning](./column-pinning) - If pinning, columns are split into left, center (unpinned), and right pinned columns.
47
+
1.[Column Pinning](./column-pinning) - If pinning, columns are split into start, center (unpinned), and end pinned columns.
48
48
2. Manual [Column Ordering](./column-ordering) - A manually specified column order is applied.
49
49
3.**Grouping** - If grouping is enabled, a grouping state is active, and `tableOptions.groupedColumnMode` is set to `'reorder' | 'remove'`, then the grouped columns are reordered to the start of the column flow.
0 commit comments