Skip to content

Commit

Permalink
docs(ui-table): better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasf committed Aug 30, 2024
1 parent 9eaadb1 commit 3e1780d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
25 changes: 25 additions & 0 deletions docs/contributor-docs/v11-upgrade-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Upgrade Guide for Version 11
category: Guides
order: 99
isWIP: true
---

# Upgrade Guide for Version 11

## Removal of deprecated props/components

### Table

[Table](/#Table) is now using `TableContext` to pass down data to its child components, the following props are no longer passed down to their children:

| Component | prop | Substitute / Notes |
| --------- | ----------- | ------------------------------- |
| `Row` | `isStacked` | is now stored in `TableContext` |
| `Body` | `isStacked` | is now stored in `TableContext` |
| `Body` | `hover` | is now stored in `TableContext` |
| `Body` | `headers` | is now stored in `TableContext` |

## Changes

- `ui-dom-utils`/`getComputedStyle` can now return `undefined`: In previous versions sometimes returned an empty object which could lead to runtime exceptions when one tried to call methods of `CSSStyleDeclaration` on it.
6 changes: 3 additions & 3 deletions packages/ui-table/src/Table/Body/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ class Body extends Component<TableBodyProps> {
return safeCloneElement(child, {
key: child.props.name,
// Sent down for compatibility with custom components
// TODO DEPRECATED, remove in next version
// TODO DEPRECATED, remove in v11
hover,
// Sent down for compatibility with custom components
// TODO DEPRECATED, remove in next version
// TODO DEPRECATED, remove in v11
isStacked,
// Sent down for compatibility with custom components
// TODO DEPRECATED, remove in next version
// TODO DEPRECATED, remove in v11
headers
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-table/src/Table/Head/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class Head extends Component<TableHeadProps> {
return this.context.isStacked ? (
this.renderSelect()
) : (
// TODO remove 'hover' exclude in the next version, its passed down for compatibility with custom components
// TODO remove 'hover' exclude in v11, its passed down for compatibility with custom components
<thead
{...omitProps(this.props, Head.allowedProps, ['hover'])}
css={styles?.head}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-table/src/Table/Row/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Row extends Component<TableRowProps> {
return safeCloneElement(child, {
key: child.props.name,
// Sent down for compatibility with custom components
// TODO DEPRECATED, remove in next version
// TODO DEPRECATED, remove in v11
isStacked,
// used by `Cell` to render its column title in `stacked` layout
header: headers && headers[index]
Expand Down

0 comments on commit 3e1780d

Please sign in to comment.