Compare commits

..
2 Commits
Author SHA1 Message Date
Tanner Linsley e059ceec75 4.1.1 2017-01-13 09:42:16 -07:00
Tanner Linsley 09f425aeb3 Redux package size to 5kb 2017-01-13 09:42:07 -07:00
4 changed files with 20 additions and 27 deletions
+2 -3
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "4.1.0",
"version": "4.1.1",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
@@ -35,8 +35,7 @@
"deploy": "build-storybook && zab deploy"
},
"dependencies": {
"classnames": "^2.2.5",
"inline-style-prefixer": "^2.0.5"
"classnames": "^2.2.5"
},
"peerDependencies": {
"react": "^15.x.x"
+12 -8
View File
@@ -1,6 +1,5 @@
import React from 'react'
import classnames from 'classnames'
import prefixAll from 'inline-style-prefixer/static'
//
import _ from './utils'
@@ -27,6 +26,7 @@ export const ReactTableDefaults = {
onExpand: undefined,
onPageChange: undefined,
onPageSizeChange: undefined,
onSortingChange: undefined,
// General Callbacks
onChange: () => null,
@@ -276,7 +276,7 @@ export default React.createClass({
{SubComponent && (
<ThComponent
className={classnames(thClassname, 'rt-expander-header')}
style={prefixAll({
style={_.prefixAll({
flex: `0 0 auto`,
width: `${expanderColumnWidth}px`
})}
@@ -287,7 +287,7 @@ export default React.createClass({
<ThComponent
key={i}
className={classnames(thClassname, column.headerClassName)}
style={Object.assign({}, thStyle, column.headerStyle, prefixAll({
style={Object.assign({}, thStyle, column.headerStyle, _.prefixAll({
flex: `${column.columns.length * columnPercentage} 0 auto`,
width: `${_.sum(column.columns.map(d => d.minWidth))}px`
}))}
@@ -317,7 +317,7 @@ export default React.createClass({
{SubComponent && (
<ThComponent
className={classnames(thClassname, 'rt-expander-header')}
style={prefixAll({
style={_.prefixAll({
flex: `0 0 auto`,
width: `${expanderColumnWidth}px`
})}
@@ -338,7 +338,7 @@ export default React.createClass({
'-hidden': !show
}
)}
style={Object.assign({}, thStyle, column.headerStyle, prefixAll({
style={Object.assign({}, thStyle, column.headerStyle, _.prefixAll({
flex: `${columnPercentage} 0 auto`,
width: `${column.minWidth}px`
}))}
@@ -382,7 +382,7 @@ export default React.createClass({
{SubComponent && (
<ThComponent
className={classnames(thClassname, 'rt-expander-wrap')}
style={prefixAll({
style={_.prefixAll({
flex: `0 0 auto`,
width: `${expanderColumnWidth}px`
})}
@@ -418,7 +418,7 @@ export default React.createClass({
<TdComponent
key={i2}
className={classnames(column.className, {hidden: !show})}
style={Object.assign({}, tdStyle, column.style, prefixAll({
style={Object.assign({}, tdStyle, column.style, _.prefixAll({
flex: `${columnPercentage} 0 auto`,
width: `${column.minWidth}px`
}))}
@@ -450,7 +450,7 @@ export default React.createClass({
{SubComponent && (
<ThComponent
className={classnames(thClassname, 'rt-expander-header')}
style={prefixAll({
style={_.prefixAll({
flex: `0 0 auto`,
width: `${expanderColumnWidth}px`
})}
@@ -606,6 +606,10 @@ export default React.createClass({
})
},
sortColumn (column, additive) {
const { onSortingChange } = this.props
if (onSortingChange) {
return onSortingChange(column, additive)
}
const existingSorting = this.getSorting()
let sorting = _.clone(this.state.sorting || [])
const existingIndex = sorting.findIndex(d => d.id === column.id)
+6 -1
View File
@@ -11,7 +11,8 @@ export default {
remove,
getFirstDefined,
sum,
makeTemplateComponent
makeTemplateComponent,
prefixAll
}
function remove (a, b) {
@@ -115,3 +116,7 @@ function makeTemplateComponent (compClass) {
</div>
)
}
function prefixAll (obj) {
return obj
}
-15
View File
@@ -1362,10 +1362,6 @@ boom@2.x.x:
dependencies:
hoek "2.x.x"
bowser@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.6.0.tgz#37fc387b616cb6aef370dab4d6bd402b74c5c54d"
brace-expansion@^1.0.0:
version "1.1.6"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
@@ -3000,10 +2996,6 @@ https-browserify@~0.0.0, https-browserify@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
hyphenate-style-name@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b"
iconv-lite@^0.4.13, iconv-lite@~0.4.13:
version "0.4.15"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
@@ -3071,13 +3063,6 @@ inline-source-map@~0.6.0:
dependencies:
source-map "~0.5.3"
inline-style-prefixer:
version "2.0.5"
resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-2.0.5.tgz#c153c7e88fd84fef5c602e95a8168b2770671fe7"
dependencies:
bowser "^1.0.0"
hyphenate-style-name "^1.0.1"
inquirer@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e"