react-table-hoc-fixed-columns
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -12,2 +12,4 @@ "use strict"; | ||
var _reactTable = require("react-table"); | ||
var _uniqid = _interopRequireDefault(require("uniqid")); | ||
@@ -76,2 +78,3 @@ | ||
return columns.map(function (column, index) { | ||
var defaultColumn = _this.props.column; | ||
var fixed = column.fixed || parentIsfixed || false; | ||
@@ -91,3 +94,3 @@ var nextColumn = (0, _helpers.findNextColumnNotHidden)(columns, index); | ||
fixed: fixed, | ||
className: (0, _classnames.default)(column.className, fixed && 'rthfc-td-fixed', (0, _helpers.isLeftFixed)({ | ||
className: (0, _classnames.default)(defaultColumn.className, column.className, fixed && 'rthfc-td-fixed', (0, _helpers.isLeftFixed)({ | ||
fixed: fixed | ||
@@ -97,3 +100,3 @@ }) && 'rthfc-td-fixed-left', (0, _helpers.isRightFixed)({ | ||
}) && 'rthfc-td-fixed-right', isLastFixed && 'rthfc-td-fixed-left-last', isFirstFixed && 'rthfc-td-fixed-right-first'), | ||
headerClassName: (0, _classnames.default)(column.headerClassName, fixed && 'rthfc-th-fixed', (0, _helpers.isLeftFixed)({ | ||
headerClassName: (0, _classnames.default)(defaultColumn.headerClassName, column.headerClassName, fixed && 'rthfc-th-fixed', (0, _helpers.isLeftFixed)({ | ||
fixed: fixed | ||
@@ -205,3 +208,4 @@ }) && 'rthfc-th-fixed-left', (0, _helpers.isRightFixed)({ | ||
className: _propTypes.default.string, | ||
uniqClassName: _propTypes.default.string | ||
uniqClassName: _propTypes.default.string, | ||
column: _propTypes.default.object | ||
}; | ||
@@ -212,3 +216,4 @@ ReactTableFixedColumns.defaultProps = { | ||
className: null, | ||
uniqClassName: null | ||
uniqClassName: null, | ||
column: _reactTable.ReactTableDefaults.column | ||
}; | ||
@@ -215,0 +220,0 @@ return ReactTableFixedColumns; |
@@ -12,2 +12,4 @@ "use strict"; | ||
var _reactTable = require("react-table"); | ||
var _uniqid = _interopRequireDefault(require("uniqid")); | ||
@@ -144,2 +146,3 @@ | ||
var defaultColumn = this.props.column; | ||
return columns.map(function (column, index) { | ||
@@ -170,9 +173,9 @@ var fixed = column.fixed || parentIsfixed || false; | ||
fixed: fixed, | ||
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'), | ||
style: _objectSpread({}, column.style, { | ||
className: (0, _classnames.default)(defaultColumn.className, 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'), | ||
style: _objectSpread({}, defaultColumn.style, column.style, { | ||
left: left, | ||
right: right | ||
}), | ||
headerClassName: (0, _classnames.default)(column.headerClassName, fixed && 'rthfc-th-fixed', columnIsLeftFixed && 'rthfc-th-fixed-left', columnIsRightFixed && 'rthfc-th-fixed-right', (_parentIsLastFixed || parentIsLastFixed && isLastFixed) && 'rthfc-th-fixed-left-last', (_parentIsFirstFixed || parentIsFirstFixed && isFirstFixed) && 'rthfc-th-fixed-right-first'), | ||
headerStyle: _objectSpread({}, column.headerStyle, { | ||
headerClassName: (0, _classnames.default)(defaultColumn.headerClassName, column.headerClassName, fixed && 'rthfc-th-fixed', columnIsLeftFixed && 'rthfc-th-fixed-left', columnIsRightFixed && 'rthfc-th-fixed-right', (_parentIsLastFixed || parentIsLastFixed && isLastFixed) && 'rthfc-th-fixed-left-last', (_parentIsFirstFixed || parentIsFirstFixed && isFirstFixed) && 'rthfc-th-fixed-right-first'), | ||
headerStyle: _objectSpread({}, defaultColumn.headerStyle, column.headerStyle, { | ||
left: left, | ||
@@ -223,3 +226,4 @@ right: right | ||
onResizedChange: _propTypes.default.func, | ||
uniqClassName: _propTypes.default.string | ||
uniqClassName: _propTypes.default.string, | ||
column: _propTypes.default.object | ||
}; | ||
@@ -230,3 +234,4 @@ ReactTableFixedColumns.defaultProps = { | ||
onResizedChange: null, | ||
uniqClassName: null | ||
uniqClassName: null, | ||
column: _reactTable.ReactTableDefaults.column | ||
}; | ||
@@ -233,0 +238,0 @@ return ReactTableFixedColumns; |
{ | ||
"name": "react-table-hoc-fixed-columns", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "ReactTable HOC for fixed columns", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"lib": "rm -rf lib && eslint src/lib/index.js && babel src/lib -d lib --copy-files", | ||
"lib": "rm -rf lib && yarn test && babel src/lib -d lib --copy-files", | ||
"lib:watch": "babel src/lib -w -d lib --copy-files", | ||
"demo": "webpack-dev-server" | ||
"demo": "webpack-dev-server", | ||
"test": "yarn test:eslint", | ||
"test:eslint": "npx eslint --ext .js --ext .jsx src/lib" | ||
}, | ||
@@ -39,3 +41,3 @@ "publishConfig": { | ||
"eslint-plugin-react": "^7.7.0", | ||
"html-webpack-plugin": "^2.30.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"react": "^16.2.0", | ||
@@ -45,4 +47,5 @@ "react-dom": "^16.2.0", | ||
"style-loader": "^0.19.1", | ||
"webpack": "^3.10.0", | ||
"webpack-dev-server": "^2.11.0" | ||
"webpack": "^4.41.2", | ||
"webpack-cli": "^3.3.10", | ||
"webpack-dev-server": "^3.9.0" | ||
}, | ||
@@ -49,0 +52,0 @@ "author": "Guillaume Jasmin", |
ReactTable HOC fixed columns - v2 | ||
ReactTable HOC fixed columns | ||
--- | ||
@@ -7,3 +7,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) | ||
Higher Order Components for [ReactTable](https://react-table.js.org). It make possible to fixed one or more columns on the left and/or on the right. It use `position: sticky` for recent browsers, and [fallback for legacy browser](#legacy-browsers). | ||
Higher Order Components for [ReactTable v6](https://github.com/tannerlinsley/react-table/tree/v6). It make possible to fixed one or more columns on the left and/or on the right. It use `position: sticky` for recent browsers, and [fallback for legacy browser](#legacy-browsers). | ||
@@ -10,0 +10,0 @@ # Documentation |
38194
544
23