react-table-hoc-fixed-columns
Advanced tools
Comparing version 2.0.0-beta.4 to 2.0.0-beta.5
@@ -86,3 +86,4 @@ "use strict"; | ||
var isFirstFixed = fixed && (parentIsfixed ? parentIsfixed === 'right' && parentIsFirstFixed : true) && (parentIsfixed && !prevColumn || !parentIsfixed && prevColumn && !prevColumn.fixed); | ||
return _objectSpread({}, column, { | ||
var output = _objectSpread({}, column, { | ||
fixed: fixed, | ||
@@ -98,5 +99,10 @@ className: (0, _classnames.default)(column.className, fixed && 'rthfc-td-fixed', (0, _helpers.isLeftFixed)({ | ||
fixed: fixed | ||
}) && 'rthfc-th-fixed-right', (_parentIsLastFixed || parentIsLastFixed && isLastFixed) && 'rthfc-th-fixed-left-last', (_parentIsFirstFixed || parentIsFirstFixed && isFirstFixed) && 'rthfc-th-fixed-right-first'), | ||
columns: column.columns && _this.getColumnsWithFixed(column.columns, fixed, _parentIsLastFixed, _parentIsFirstFixed) | ||
}) && 'rthfc-th-fixed-right', (_parentIsLastFixed || parentIsLastFixed && isLastFixed) && 'rthfc-th-fixed-left-last', (_parentIsFirstFixed || parentIsFirstFixed && isFirstFixed) && 'rthfc-th-fixed-right-first') | ||
}); | ||
if (column.columns) { | ||
output.columns = _this.getColumnsWithFixed(column.columns, fixed, _parentIsLastFixed, _parentIsFirstFixed); | ||
} | ||
return output; | ||
}); | ||
@@ -103,0 +109,0 @@ }; |
@@ -154,3 +154,3 @@ "use strict"; | ||
return _objectSpread({}, column, { | ||
var output = _objectSpread({}, column, { | ||
fixed: fixed, | ||
@@ -166,5 +166,10 @@ className: (0, _classnames.default)(column.className, fixed && 'rthfc-td-fixed', columnIsLeftFixed && 'rthfc-td-fixed-left', columnIsRightFixed && 'rthfc-td-fixed-right', isLastFixed && 'rthfc-td-fixed-left-last', isFirstFixed && 'rthfc-td-fixed-right-first'), | ||
right: right | ||
}), | ||
columns: column.columns && _this2.getColumnsWithFixed(column.columns, fixed, _parentIsLastFixed, _parentIsFirstFixed) | ||
}) | ||
}); | ||
if (column.columns) { | ||
output.columns = _this2.getColumnsWithFixed(column.columns, fixed, _parentIsLastFixed, _parentIsFirstFixed); | ||
} | ||
return output; | ||
}); | ||
@@ -171,0 +176,0 @@ } |
{ | ||
"name": "react-table-hoc-fixed-columns", | ||
"version": "2.0.0-beta.4", | ||
"version": "2.0.0-beta.5", | ||
"description": "ReactTable HOC for fixed columns", | ||
@@ -42,3 +42,3 @@ "main": "lib/index.js", | ||
"react-dom": "^16.2.0", | ||
"react-table": "^6.8.2", | ||
"react-table": "^6.9.0", | ||
"style-loader": "^0.19.1", | ||
@@ -45,0 +45,0 @@ "webpack": "^3.10.0", |
ReactTable HOC fixed columns | ||
ReactTable HOC fixed columns - v2 beta | ||
--- | ||
@@ -11,3 +11,3 @@ [![npm version](https://img.shields.io/npm/v/react-table-hoc-fixed-columns.svg?style=flat-square)](https://www.npmjs.com/package/react-table-hoc-fixed-columns) | ||
* [Demo on CodeSandbox](https://codesandbox.io/s/jnjv6j495y) | ||
* [Demo v2 on CodeSandbox](https://codesandbox.io/s/kowzlm5jp7) | ||
* [Install](#install) | ||
@@ -44,4 +44,5 @@ * [Simple example](#simple-example) | ||
import ReactTable from 'react-table'; | ||
import "react-table/react-table.css"; | ||
import withFixedColumns from 'react-table-hoc-fixed-columns'; | ||
import 'react-table-hoc-fixed-columns/lib/styles.css' | ||
import 'react-table-hoc-fixed-columns/lib/styles.css' // important: this line must be placed after react-table css import | ||
@@ -83,4 +84,5 @@ const ReactTableFixedColumns = withFixedColumns(ReactTable); | ||
import ReactTable from 'react-table'; | ||
import "react-table/react-table.css"; | ||
import withFixedColumns from 'react-table-hoc-fixed-columns'; | ||
import 'react-table-hoc-fixed-columns/lib/styles.css' | ||
import 'react-table-hoc-fixed-columns/lib/styles.css' // important: this line must be placed after react-table css import | ||
@@ -158,2 +160,5 @@ const ReactTableFixedColumns = withFixedColumns(ReactTable); | ||
### ES7 requirement | ||
If your browser doesn't support ES7, please import [es7-shim](https://www.npmjs.com/package/es7-shim). Alternatively, you could just use the [polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Polyfill) for the Array `includes` method. | ||
## Migrate `v0` to `v1` | ||
@@ -160,0 +165,0 @@ For migration to `v0.1.x` to `v1.x.x` , `fixed: true` is equivalent to `fixed: left`, no need to change the value. |
36598
516
182