fast-table
Advanced tools
Comparing version 1.4.3 to 1.4.4
@@ -69,3 +69,3 @@ 'use strict'; | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = BaseTable.__proto__ || Object.getPrototypeOf(BaseTable)).call.apply(_ref, [this].concat(args))), _this), _this._children = [], _this.handleExpanded = function (record) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = BaseTable.__proto__ || Object.getPrototypeOf(BaseTable)).call.apply(_ref, [this].concat(args))), _this), _this._children = [], _this._startIndex = 0, _this._stopIndex = 0, _this.handleExpanded = function (record) { | ||
var handleExpandChange = _this.props.handleExpandChange; | ||
@@ -310,4 +310,11 @@ | ||
_createClass(BaseTable, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
key: 'componentWillMount', | ||
value: function componentWillMount() { | ||
var table = this.context.table; | ||
var dataManager = table.dataManager; | ||
var showData = dataManager.showData() || []; | ||
if (showData.length > 0) { | ||
this._stopIndex = showData.length - 1; | ||
} | ||
var _props = this.props, | ||
@@ -314,0 +321,0 @@ registerForce = _props.registerForce, |
@@ -390,3 +390,5 @@ 'use strict'; | ||
_dataHeight: _this.dataManager._bodyHeight, | ||
_dataEmpty: _this.dataManager.isEmpty() | ||
_dataEmpty: _this.dataManager.isEmpty(), | ||
_scrollSizeX: props.scrollSize.x, | ||
_scrollSizeY: props.scrollSize.y | ||
}, _this.columnManager.headerSize())); | ||
@@ -417,15 +419,2 @@ | ||
}, { | ||
key: 'componentWillMount', | ||
value: function componentWillMount() { | ||
var getScrollSize = this.props.getScrollSize; | ||
var scrollSize = getScrollSize(); | ||
if (scrollSize) { | ||
this.sizeManager.update({ | ||
_scrollSizeX: scrollSize.x, | ||
_scrollSizeY: scrollSize.y | ||
}); | ||
} | ||
} | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
@@ -432,0 +421,0 @@ value: function componentWillReceiveProps(nextProps) { |
@@ -12,6 +12,6 @@ 'use strict'; | ||
var _utils = require('./utils'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// import { measureScrollbar } from './utils'; | ||
var TableDefaultParams = exports.TableDefaultParams = { | ||
@@ -46,3 +46,5 @@ prefixCls: 'vt', | ||
}, | ||
getScrollSize: _utils.measureScrollbar, | ||
getScrollSize: function getScrollSize() { | ||
return { x: 8, y: 8 }; | ||
}, | ||
onRow: function onRow() { | ||
@@ -63,2 +65,3 @@ return {}; | ||
scrollSize: { x: 8, y: 8 }, | ||
style: {} | ||
@@ -65,0 +68,0 @@ }; |
{ | ||
"name": "fast-table", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"description": "react table fast", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -29,4 +29,4 @@ import React from 'react'; | ||
_children = []; | ||
_startIndex; | ||
_stopIndex; | ||
_startIndex = 0; | ||
_stopIndex = 0; | ||
@@ -37,3 +37,9 @@ static contextTypes = { | ||
componentDidMount() { | ||
componentWillMount() { | ||
const table = this.context.table; | ||
const {dataManager} = table; | ||
const showData = dataManager.showData() || []; | ||
if (showData.length > 0) { | ||
this._stopIndex = showData.length - 1; | ||
} | ||
const {registerForce, fixed} = this.props; | ||
@@ -40,0 +46,0 @@ if (registerForce) { |
@@ -47,3 +47,5 @@ import React from 'react'; | ||
_dataEmpty: this.dataManager.isEmpty(), | ||
...this.columnManager.headerSize() | ||
_scrollSizeX: props.scrollSize.x, | ||
_scrollSizeY: props.scrollSize.y, | ||
...this.columnManager.headerSize(), | ||
}); | ||
@@ -76,13 +78,2 @@ | ||
componentWillMount() { | ||
const {getScrollSize} = this.props; | ||
const scrollSize = getScrollSize(); | ||
if (scrollSize) { | ||
this.sizeManager.update({ | ||
_scrollSizeX: scrollSize.x, | ||
_scrollSizeY: scrollSize.y | ||
}); | ||
} | ||
} | ||
componentWillReceiveProps(nextProps) { | ||
@@ -89,0 +80,0 @@ if (!shallowEqual(nextProps.dataSource, this.props.dataSource)) { |
import React from 'react'; | ||
import { measureScrollbar } from './utils'; | ||
// import { measureScrollbar } from './utils'; | ||
@@ -42,2 +42,3 @@ export type TableParams = { | ||
scrollSize: Object, | ||
style: Object | ||
@@ -64,3 +65,3 @@ } | ||
onExpandedRowsChange: () => null, | ||
getScrollSize: measureScrollbar, | ||
getScrollSize: () => ({x: 8, y: 8}), | ||
onRow: () => ({}), | ||
@@ -77,2 +78,3 @@ onHeaderRow: () => ({}), | ||
scrollSize: {x: 8, y: 8}, | ||
style: {} | ||
@@ -79,0 +81,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
190103