fast-table
Advanced tools
Comparing version 1.4.5 to 1.4.6
@@ -703,3 +703,3 @@ 'use strict'; | ||
'renderChild', | ||
function() { | ||
function(params) { | ||
if (!_this._renderEnable) { | ||
@@ -709,2 +709,4 @@ return null; | ||
_this.onResize(params); | ||
var _this$props5 = _this.props, | ||
@@ -711,0 +713,0 @@ style = _this$props5.style, |
@@ -79,2 +79,20 @@ 'use strict'; | ||
function _typeof(obj) { | ||
if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { | ||
_typeof = function _typeof(obj) { | ||
return typeof obj; | ||
}; | ||
} else { | ||
_typeof = function _typeof(obj) { | ||
return obj && | ||
typeof Symbol === 'function' && | ||
obj.constructor === Symbol && | ||
obj !== Symbol.prototype | ||
? 'symbol' | ||
: typeof obj; | ||
}; | ||
} | ||
return _typeof(obj); | ||
} | ||
function _classCallCheck(instance, Constructor) { | ||
@@ -257,5 +275,29 @@ if (!(instance instanceof Constructor)) { | ||
_this._cached = {}; | ||
_this.columns = _this._uColumns(columns); | ||
_this._cached['groupedColumns'] = columns; | ||
}); | ||
_defineProperty(this, '_uColumns', function(columns) { | ||
return columns.map(function(c) { | ||
var column = {}; | ||
for (var key in c) { | ||
if ( | ||
_typeof(key) !== 'symbol' && | ||
Object.prototype.hasOwnProperty.call(c, key) | ||
) { | ||
column[key] = c[key]; | ||
} | ||
} | ||
var children = column.children || []; | ||
if (children.length > 0) { | ||
column.children = _this._uColumns(children); | ||
} | ||
return column; | ||
}); | ||
}); | ||
_defineProperty(this, '_calcWidth', function(width, wrapperWidth) { | ||
@@ -262,0 +304,0 @@ if (typeof width === 'string' && percentReg.test(width)) { |
@@ -14,3 +14,2 @@ 'use strict'; | ||
// import { measureScrollbar } from './utils'; | ||
function defaultFunction() { | ||
@@ -17,0 +16,0 @@ return {}; |
{ | ||
"name": "fast-table", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"description": "react table fast", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -1,9 +0,23 @@ | ||
# fast-table | ||
<p align="center"> | ||
<a href="https://github.com/Paul-Long/fast-table"> | ||
<img width="200" src="http://houym-1254119810.picsh.myqcloud.com/logo-200_150.png"> | ||
</a> | ||
</p> | ||
**React表格组件,支持多数据首次快速渲染。** | ||
<h1 align="center">Fast Table</h1> | ||
# future | ||
<div align="center"> | ||
add drag table header,Immature version can be viewed [demo](https://paul-long.github.io/react-components/) | ||
React表格组件,支持多数据首次快速渲染 | ||
[](https://www.npmjs.com/package/fast-table) | ||
[](http://npmjs.com/fast-table) | ||
[](https://david-dm.org/paul-long/fast-table) | ||
[](https://david-dm.org/paul-long/fast-table?type=dev) | ||
[](https://gitter.im/paul-long/paul-long?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
[](https://codecov.io/gh/paul-long/fast-table/branch/master) | ||
[](https://github.com/paul-long/fast-table/issues?q=label%3A%22help+wanted%22) | ||
</div> | ||
# 在线Demo | ||
@@ -14,2 +28,4 @@ https://paul-long.github.io/react-components/ | ||
[](https://npmjs.org/package/fast-table) | ||
```bash | ||
@@ -28,2 +44,3 @@ npm install fast-table --save-dev | ||
- 子表格订制 | ||
- 表头自由排序 | ||
@@ -30,0 +47,0 @@ # API |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -143,16 +143,17 @@ import React from 'react'; | ||
onResize = ({width, height}) => { | ||
this._renderEnable = true; | ||
this._width = width; | ||
this._height = height; | ||
this.cacheManager.reset(); | ||
this.sizeManager.update({ | ||
_wrapperWidth: width, | ||
_wrapperHeight: height, | ||
_scrollSizeX: measureScrollbar('horizontal'), | ||
_scrollSizeY: measureScrollbar() | ||
}); | ||
this.getShowCount(); | ||
this.updateColumn(); | ||
this.resetShowData(); | ||
// this.setState({width, height}); | ||
if (this._width !== width || this._height !== height) { | ||
this._renderEnable = true; | ||
this._width = width; | ||
this._height = height; | ||
this.cacheManager.reset(); | ||
this.sizeManager.update({ | ||
_wrapperWidth: width, | ||
_wrapperHeight: height, | ||
_scrollSizeX: measureScrollbar('horizontal'), | ||
_scrollSizeY: measureScrollbar() | ||
}); | ||
this.getShowCount(); | ||
this.updateColumn(); | ||
this.resetShowData(); | ||
} | ||
}; | ||
@@ -448,6 +449,7 @@ | ||
renderChild = () => { | ||
renderChild = (params) => { | ||
if (!this._renderEnable) { | ||
return null; | ||
} | ||
this.onResize(params); | ||
const {style, prefixCls} = this.props; | ||
@@ -454,0 +456,0 @@ const hasLeftFixed = this.columnManager.isAnyColumnsLeftFixed(); |
@@ -157,5 +157,25 @@ import React from 'react'; | ||
this._cached = {}; | ||
this.columns = this._uColumns(columns); | ||
this._cached['groupedColumns'] = columns; | ||
}; | ||
_uColumns = (columns) => { | ||
return columns.map((c) => { | ||
let column = {}; | ||
for (let key in c) { | ||
if ( | ||
typeof key !== 'symbol' && | ||
Object.prototype.hasOwnProperty.call(c, key) | ||
) { | ||
column[key] = c[key]; | ||
} | ||
} | ||
const children = column.children || []; | ||
if (children.length > 0) { | ||
column.children = this._uColumns(children); | ||
} | ||
return column; | ||
}); | ||
}; | ||
_calcWidth = (width, wrapperWidth) => { | ||
@@ -162,0 +182,0 @@ if (typeof width === 'string' && percentReg.test(width)) { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
252201
7790
260
0