Skip to content

Commit 040e5c2

Browse files
committed
Renamed FlexTable->Table and FlexColumn->Column
1 parent 06275b0 commit 040e5c2

35 files changed

+188
-188
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ For example:
144144
###### Public methods
145145

146146
`Grid` and `Collection` components can be forcefully re-rendered using [`forceUpdate`](https://facebook.github.io/react/docs/component-api.html#forceupdate).
147-
For `FlexTable` and `List`, you'll need to call [`forceUpdateGrid`](https://github.com/bvaughn/react-virtualized/blob/master/docs/FlexTable.md#forceupdategrid)) to ensure that the inner `Grid` is also updated.
147+
For `Table` and `List`, you'll need to call [`forceUpdateGrid`](https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md#forceupdategrid)) to ensure that the inner `Grid` is also updated.
148148

149149
Documentation
150150
---------------
@@ -170,7 +170,7 @@ Here are some online demos of each component:
170170
* [CellMeasurer](https://bvaughn.github.io/react-virtualized/?component=CellMeasurer)
171171
* [Collection](https://bvaughn.github.io/react-virtualized/?component=Collection)
172172
* [ColumnSizer](https://bvaughn.github.io/react-virtualized/?component=ColumnSizer)
173-
* [FlexTable](https://bvaughn.github.io/react-virtualized/?component=FlexTable)
173+
* [Table](https://bvaughn.github.io/react-virtualized/?component=Table)
174174
* [Grid](https://bvaughn.github.io/react-virtualized/?component=Grid)
175175
* [InfiniteLoader](https://bvaughn.github.io/react-virtualized/?component=InfiniteLoader)
176176
* [ScrollSync](https://bvaughn.github.io/react-virtualized/?component=ScrollSync)

docs/ArrowKeyStepper.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The appearance of this wrapper element can be customized using the `className` p
1212
|:---|:---|:---:|:---|
1313
| children | Function || Function respondible for rendering children. This function should implement the following signature: `({ onSectionRendered: Function, scrollToColumn: number, scrollToRow: number }) => PropTypes.element` |
1414
| className | String | | CSS class name to attach to the wrapper `<div>`. |
15-
| columnCount | Number || Number of columns in grid; for `FlexTable` and `List` this property should always be `1`. |
15+
| columnCount | Number || Number of columns in grid; for `Table` and `List` this property should always be `1`. |
1616
| rowCount | Number || Number of rows in grid. |
1717

1818
### Children function
@@ -27,7 +27,7 @@ The child function is passed the following named parameters:
2727

2828
### Examples
2929

30-
You can decorate any virtualized component (eg. `FlexTable`, `Grid`, or `List`) with arrow-key snapping like so:
30+
You can decorate any virtualized component (eg. `Table`, `Grid`, or `List`) with arrow-key snapping like so:
3131

3232
```javascript
3333
import React from 'react';

docs/FlexColumn.md renamed to docs/Column.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FlexColumn
1+
Column
22
---------------
33

44
Describes the header and cell contents of a table column.
@@ -31,7 +31,7 @@ It should implement the following signature:
3131
function ({ columnData: any, dataKey: string, rowData: any }): any
3232
```
3333

34-
A [default `cellDataGetter`](https://github.com/bvaughn/react-virtualized/blob/master/source/FlexTable/defaultCellDataGetter.js) is provided that simply returns the attribute as a String.
34+
A [default `cellDataGetter`](https://github.com/bvaughn/react-virtualized/blob/master/source/Table/defaultCellDataGetter.js) is provided that simply returns the attribute as a String.
3535
This function expects to operate on either a vanilla Object or a Map-like object with a get method.
3636
You should override this default method if your data is calculated or requires any custom processing.
3737

@@ -44,7 +44,7 @@ It should implement the following signature:
4444
function ({ cellData: any, columnData: any, dataKey: string, isScrolling: boolean, rowData: any, rowIndex: number }): node
4545
```
4646

47-
A [default `cellRenderer`](https://github.com/bvaughn/react-virtualized/blob/master/source/FlexTable/defaultCellRenderer.js) is provided that displays an attribute as a simple string
47+
A [default `cellRenderer`](https://github.com/bvaughn/react-virtualized/blob/master/source/Table/defaultCellRenderer.js) is provided that displays an attribute as a simple string
4848
You should override this default method if your data is some other type of object or requires custom formatting.
4949

5050
#### headerRenderer
@@ -56,5 +56,5 @@ It should implement the following signature:
5656
function ({ columnData: any, dataKey: string, disableSort: boolean, label: string, sortBy: string, sortDirection: SortDirection }): element
5757
```
5858

59-
A [default `headerRenderer`](https://github.com/bvaughn/react-virtualized/blob/master/source/FlexTable/defaultHeaderRenderer.js) is provided that displays the column `label` along with a sort indicator if the column is sort-enabled and active.
59+
A [default `headerRenderer`](https://github.com/bvaughn/react-virtualized/blob/master/source/Table/defaultHeaderRenderer.js) is provided that displays the column `label` along with a sort indicator if the column is sort-enabled and active.
6060
You should override this default method if you want to customize the appearance of table columns.

docs/ColumnSizer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ High-order component that auto-calculates column-widths for `Grid` cells.
99
| children | Function || Function respondible for rendering a virtualized Grid. This function should implement the following signature: `({ adjustedWidth: number, getColumnWidth: Function, registerChild: Function }) => PropTypes.element` |
1010
| columnMaxWidth | Number | | Optional maximum allowed column width |
1111
| columnMinWidth | Number | | Optional minimum allowed column width |
12-
| width | Number || Width of Grid or `FlexTable` child |
12+
| width | Number || Width of Grid or `Table` child |
1313

1414
### Children function
1515

docs/InfiniteLoader.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ InfiniteLoader
44
High-order component that manages just-in-time fetching of data as a user scrolls up or down in a list.
55

66
Note that this component is inteded to assist with row-loading.
7-
As such it is best suited for use with `FlexTable` and `List` (although it can also be used with `Grid`).
7+
As such it is best suited for use with `Table` and `List` (although it can also be used with `Grid`).
88
This HOC is not compatible with the `Collection` component.
99

1010
This is an advanced component and can be confusing in certain situations.

docs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Documentation
44
### Components
55

66
* [Collection](Collection.md)
7-
* [FlexTable](FlexTable.md)
8-
* [FlexColumn](FlexColumn.md)
9-
* [SortDirection](SortDirection.md)
107
* [Grid](Grid.md)
118
* [List](List.md)
9+
* [Table](Table.md)
10+
* [Column](Column.md)
11+
* [SortDirection](SortDirection.md)
1212

1313
### High-Order Components
1414

docs/SortDirection.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SortDirection
22
---------------
33

4-
Specifies which direction [FlexTable](FlexTable.md) data is currently sorted in.
4+
Specifies which direction [Table](Table.md) data is currently sorted in.
55

66
#### SortDirection.ASC
77
Sort items in ascending order.

docs/FlexTable.md renamed to docs/Table.md

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FlexTable
1+
Table
22
---------------
33

44
Table component with fixed headers and virtualized rows for improved performance with large data sets.
@@ -7,10 +7,10 @@ This component expects explicit width, height, and padding parameters.
77
### Prop Types
88
| Property | Type | Required? | Description |
99
|:---|:---|:---:|:---|
10-
| children | [FlexColumn](FlexColumn.md) || One or more FlexColumns describing the data displayed in this table |
11-
| className | String | | Optional custom CSS class name to attach to root `FlexTable` element. |
10+
| children | [Column](Column.md) || One or more Columns describing the data displayed in this table |
11+
| className | String | | Optional custom CSS class name to attach to root `Table` element. |
1212
| disableHeader | Boolean | | Do not render the table header (only the rows) |
13-
| estimatedRowSize | Number | | Used to estimate the total height of a `FlexTable` before all of its rows have actually been measured. The estimated total height is adjusted as rows are rendered. |
13+
| estimatedRowSize | Number | | Used to estimate the total height of a `Table` before all of its rows have actually been measured. The estimated total height is adjusted as rows are rendered. |
1414
| gridClassName | String | | Optional custom CSS class name to attach to inner Grid element |
1515
| gridStyle | Object | | Optional inline style to attach to inner Grid element |
1616
| headerClassName | String | | CSS class to apply to all column headers |
@@ -40,7 +40,7 @@ This component expects explicit width, height, and padding parameters.
4040
| sort | Function | | Sort function to be called if a sortable header is clicked. `({ sortBy: string, sortDirection: SortDirection }): void` |
4141
| sortBy | String | | Data is currently sorted by this `dataKey` (if it is sorted at all) |
4242
| sortDirection | [SortDirection](SortDirection.md) | | Data is currently sorted in this direction (if it is sorted at all) |
43-
| style | Object | | Optional custom inline style to attach to root `FlexTable` element. |
43+
| style | Object | | Optional custom inline style to attach to root `Table` element. |
4444
| tabIndex | Number | | Optional override of inner `Grid` tab index default; defaults to `0`. |
4545
| width | Number || Width of the table |
4646

@@ -49,67 +49,67 @@ This component expects explicit width, height, and padding parameters.
4949
##### forceUpdateGrid
5050
Forcefull re-render the inner `Grid` component.
5151

52-
Calling `forceUpdate` on `FlexTable` may not re-render the inner `Grid` since it uses `shallowCompare` as a performance optimization.
52+
Calling `forceUpdate` on `Table` may not re-render the inner `Grid` since it uses `shallowCompare` as a performance optimization.
5353
Use this method if you want to manually trigger a re-render.
5454
This may be appropriate if the underlying row data has changed but the row sizes themselves have not.
5555

5656
##### measureAllRows
57-
Pre-measure all rows in a `FlexTable`.
57+
Pre-measure all rows in a `Table`.
5858

5959
Typically rows are only measured as needed and estimated heights are used for cells that have not yet been measured.
6060
This method ensures that the next call to getTotalSize() returns an exact size (as opposed to just an estimated one).
6161

6262
##### recomputeRowHeights (index: number)
6363
Recompute row heights and offsets after the specified index (defaults to 0).
6464

65-
`FlexTable` has no way of knowing when its underlying list data has changed since it only receives a `rowHeight` property.
65+
`Table` has no way of knowing when its underlying list data has changed since it only receives a `rowHeight` property.
6666
If the `rowHeight` is a number it can compare before and after values but if it is a function that comparison is error prone.
6767
In the event that a dynamic `rowHeight` function is in use and the row heights have changed this function should be manually called by the "smart" container parent.
6868

6969
This method will also force a render cycle (via `forceUpdate`) to ensure that the updated measurements are reflected in the rendered table.
7070

7171
### Class names
7272

73-
The FlexTable component supports the following static class names
73+
The Table component supports the following static class names
7474

7575
| Property | Description |
7676
|:---|:---|
77-
| FlexTable | Main (outer) element |
78-
| FlexTable__headerColumn | Header cell (similar to `thead > tr > th`) |
79-
| FlexTable__headerRow | Header row (similar to `thead > tr`) |
80-
| FlexTable__row | Table row (akin to `tbody > tr`) |
81-
| FlexTable__rowColumn | Table column (akin to `tbody > tr > td`) |
82-
| FlexTable__sortableHeaderColumn | Applied to header columns that are sortable |
83-
| FlexTable__sortableHeaderIcon | SVG sort indicator |
77+
| Table | Main (outer) element |
78+
| Table__headerColumn | Header cell (similar to `thead > tr > th`) |
79+
| Table__headerRow | Header row (similar to `thead > tr`) |
80+
| Table__row | Table row (akin to `tbody > tr`) |
81+
| Table__rowColumn | Table column (akin to `tbody > tr > td`) |
82+
| Table__sortableHeaderColumn | Applied to header columns that are sortable |
83+
| Table__sortableHeaderIcon | SVG sort indicator |
8484

8585
### rowRenderer
8686

8787
This is an advanced property.
88-
It is useful for situations where you require additional hooks into `FlexTable` (eg integration with a library like `react-sortable-hoc`).
88+
It is useful for situations where you require additional hooks into `Table` (eg integration with a library like `react-sortable-hoc`).
8989
If you do want to override `rowRenderer` the easiest way is to decorate the default implementation like so:
9090

9191
```js
9292
import { SortableContainer, SortableElement } from 'react-sortable-hoc'
93-
import { defaultFlexTableRowRenderer, FlexTable } from 'react-virtualized'
93+
import { defaultTableRowRenderer, Table } from 'react-virtualized'
9494

95-
const SortableFlexTable = SortableContainer(FlexTable)
96-
const SortableFlexTableRowRenderer = SortableElement(defaultFlexTableRowRenderer)
95+
const SortableTable = SortableContainer(Table)
96+
const SortableTableRowRenderer = SortableElement(defaultTableRowRenderer)
9797

9898
function rowRenderer (props) {
99-
return <SortableFlexTableRowRenderer {...props} />
99+
return <SortableTableRowRenderer {...props} />
100100
}
101101

102-
function CustomizedFlexTable (props) {
102+
function CustomizedTable (props) {
103103
return (
104-
<SortableFlexTable
104+
<SortableTable
105105
rowRenderer={rowRenderer}
106106
{...props}
107107
/>
108108
)
109109
}
110110
```
111111

112-
If you require greater customization, you may want to fork the [`defaultFlexTableRowRenderer`](https://github.com/bvaughn/react-virtualized/blob/master/source/FlexTable/defaultRowRenderer.js) function.
112+
If you require greater customization, you may want to fork the [`defaultTableRowRenderer`](https://github.com/bvaughn/react-virtualized/blob/master/source/Table/defaultRowRenderer.js) function.
113113

114114
This function accepts the following named parameters:
115115

@@ -118,7 +118,7 @@ This function accepts the following named parameters:
118118
| className | Row-level class name |
119119
| columns | Array of React nodes |
120120
| index | Row index |
121-
| isScrolling | Boolean flag indicating if `FlexTable` is currently being scrolled |
121+
| isScrolling | Boolean flag indicating if `Table` is currently being scrolled |
122122
| onRowClick | Optional row `onClick` handler |
123123
| onRowDoubleClick | Optional row `onDoubleClick` handler |
124124
| onRowMouseOver | Optional row `onMouseOver` handler |
@@ -128,12 +128,12 @@ This function accepts the following named parameters:
128128

129129
### Examples
130130

131-
Below is a very basic `FlexTable` example. This table has only 2 columns, each containing a simple string. Both have a fixed width and neither is sortable. [See here](../source/FlexTable/FlexTable.example.js) for a more full-featured example including custom cell renderers, sortable headers, and more.
131+
Below is a very basic `Table` example. This table has only 2 columns, each containing a simple string. Both have a fixed width and neither is sortable. [See here](../source/Table/Table.example.js) for a more full-featured example including custom cell renderers, sortable headers, and more.
132132

133133
```javascript
134134
import React from 'react';
135135
import ReactDOM from 'react-dom';
136-
import { FlexTable, FlexColumn } from 'react-virtualized';
136+
import { Table, Column } from 'react-virtualized';
137137
import 'react-virtualized/styles.css'; // only needs to be imported once
138138

139139
// Table data as a array of objects
@@ -144,7 +144,7 @@ const list = [
144144

145145
// Render your table
146146
ReactDOM.render(
147-
<FlexTable
147+
<Table
148148
width={300}
149149
height={300}
150150
headerHeight={20}
@@ -154,17 +154,17 @@ ReactDOM.render(
154154
({ index }) => list[index]
155155
}
156156
>
157-
<FlexColumn
157+
<Column
158158
label='Name'
159159
dataKey='name'
160160
width={100}
161161
/>
162-
<FlexColumn
162+
<Column
163163
width={200}
164164
label='Description'
165165
dataKey='description'
166166
/>
167-
</FlexTable>,
167+
</Table>,
168168
document.getElementById('example')
169169
);
170170
```

docs/WindowScroller.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
WindowScroller
22
---------------
33

4-
High-order component that enables a `FlexTable` or `List` component to be scrolled based on the window's scroll positions.
4+
High-order component that enables a `Table` or `List` component to be scrolled based on the window's scroll positions.
55
This can be used to create layouts similar to Facebook or Twitter news feeds.
66

77
**Note** that this HOC does not currently work with a horizontally-scrolling `Grid` as horizontal scrolls reset the internal `scrollTop`.
8-
This may change with a future release but for the time being this HOC is should be used with `FlexTable` or `List` only.
8+
This may change with a future release but for the time being this HOC is should be used with `Table` or `List` only.
99

1010
### Prop Types
1111
| Property | Type | Required? | Description |

docs/customizingStyles.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ You can also customize component styles.
1313
Fork the react-virtualized `styles.css` file and load your own, totally custom styles.
1414

1515
#### Global CSS
16-
Load an additional, external CSS file that defines global classes (eg. `FlexTable`, `FlexTable__row`) to append to default inline styles.
16+
Load an additional, external CSS file that defines global classes (eg. `Table`, `Table__row`) to append to default inline styles.
1717

1818
Learn more about which class names a component supports in the [API docs](https://github.com/bvaughn/react-virtualized/blob/master/docs/).
1919

2020
#### CSS Modules
21-
If you are using CSS modules you can specify custom class names to be appended to a component instance (eg. `FlexTable` supports `className`, `headerClassName`, and `rowClassName` properties).
21+
If you are using CSS modules you can specify custom class names to be appended to a component instance (eg. `Table` supports `className`, `headerClassName`, and `rowClassName` properties).
2222

2323
Learn more about which class names are supported in the [API docs](https://github.com/bvaughn/react-virtualized/blob/master/docs/).

docs/usingAutoSizer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Using AutoSizer
22
---------------
33

4-
The `AutoSizer` component decorates a React element and automatically manages `width` and `height` properties so that decorated element fills the available space. This simplifies usage of components like `Grid`, `FlexTable`, and `List` that require explicit dimensions.
4+
The `AutoSizer` component decorates a React element and automatically manages `width` and `height` properties so that decorated element fills the available space. This simplifies usage of components like `Grid`, `Table`, and `List` that require explicit dimensions.
55

66
This guide covers a few of the most commonly asked questions about using the component.
77

playground/table.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var App = React.createClass({
1414
for (var i = 0; i < NUM_COLUMNS; i++) {
1515
flexColumns.push(
1616
React.createElement(
17-
ReactVirtualized.FlexColumn,
17+
ReactVirtualized.Column,
1818
{
1919
dataKey: i,
2020
flexGrow: 1,
@@ -30,7 +30,7 @@ var App = React.createClass({
3030
null,
3131
function (params) {
3232
return React.createElement(
33-
ReactVirtualized.FlexTable,
33+
ReactVirtualized.Table,
3434
{
3535
height: params.height,
3636
overscanRowCount: 0,

source/ArrowKeyStepper/ArrowKeyStepper.example.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class ArrowKeyStepperExample extends Component {
2727
/>
2828

2929
<ContentBoxParagraph>
30-
This high-order component decorates a <code>List</code>, <code>FlexTable</code>, or <code>Grid</code> and responds to arrow-key events by scrolling one row or column at a time.
30+
This high-order component decorates a <code>List</code>, <code>Table</code>, or <code>Grid</code> and responds to arrow-key events by scrolling one row or column at a time.
3131
Focus in the `Grid` below and use the left, right, up, or down arrow keys to move around within the grid.
3232
</ContentBoxParagraph>
3333

source/AutoSizer/AutoSizer.example.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class AutoSizerExample extends Component {
5454

5555
{!hideDescription &&
5656
<ContentBoxParagraph>
57-
This component decorates <code>List</code>, <code>FlexTable</code>, or any other component and automatically manages its width and height.
57+
This component decorates <code>List</code>, <code>Table</code>, or any other component and automatically manages its width and height.
5858
It uses Sebastian Decima's <a href='https://github.com/sdecima/javascript-detect-element-resize' target='_blank'>element resize event</a> to determine the appropriate size.
5959
In this example <code>AutoSizer</code> grows to fill the remaining width and height of this flex column.
6060
</ContentBoxParagraph>

0 commit comments

Comments
 (0)