Merge remote-tracking branch 'origin/master'

# Conflicts:
#	demo/index.js
#	dist/demo.js
#	dist/demo.js.map
#	package.json
This commit is contained in:
cw 2019-08-07 11:25:56 +08:00
commit 1aeea1d4bc
6 changed files with 68 additions and 14 deletions

View File

@ -1,3 +1,18 @@
<a name="2.1.11"></a>
## [2.1.11](https://github.com/tinper-bee/bee-table/compare/v2.1.10...v2.1.11) (2019-08-05)
<a name="2.1.10"></a>
## [2.1.10](https://github.com/tinper-bee/bee-table/compare/v2.1.9...v2.1.10) (2019-08-03)
<a name="2.1.9"></a>
## [2.1.9](https://github.com/tinper-bee/bee-table/compare/v2.1.8...v2.1.9) (2019-08-01)
<a name="2.1.8"></a> <a name="2.1.8"></a>
## [2.1.8](https://github.com/tinper-bee/bee-table/compare/v2.1.6...v2.1.8) (2019-07-26) ## [2.1.8](https://github.com/tinper-bee/bee-table/compare/v2.1.6...v2.1.8) (2019-07-26)

View File

@ -81,7 +81,7 @@ var TableHeader = function (_Component) {
lastShowIndex = _this$props.lastShowIndex; lastShowIndex = _this$props.lastShowIndex;
// let currentElement = this.getOnLineObject(targetEvent); // let currentElement = this.getOnLineObject(targetEvent);
var currentElement = _this.getTargetToTh(targetEvent); var currentElement = _this.getTargetToType(targetEvent);
if (!currentElement) return; if (!currentElement) return;
var type = currentElement.getAttribute('data-type'); var type = currentElement.getAttribute('data-type');
if (!_this.props.dragborder && !_this.props.draggable) return; if (!_this.props.dragborder && !_this.props.draggable) return;
@ -130,6 +130,14 @@ var TableHeader = function (_Component) {
return tableWidth - offWidth; return tableWidth - offWidth;
}; };
_this.getTargetToType = function (targetEvent) {
var tag = targetEvent;
if (targetEvent && !targetEvent.getAttribute("data-type")) {
tag = _this.getTargetToType(targetEvent.parentElement);
}
return tag;
};
_this.getTargetToTh = function (targetEvent) { _this.getTargetToTh = function (targetEvent) {
var th = targetEvent; var th = targetEvent;
if (targetEvent.nodeName.toUpperCase() != "TH") { if (targetEvent.nodeName.toUpperCase() != "TH") {
@ -632,6 +640,12 @@ var TableHeader = function (_Component) {
*/ */
/**
* 根据当前节点查找到有data-type类型的容器返回
* @memberof TableHeader
*/
/** /**
* 判断当前的target 是否是 th如果不是直接递归查找 * 判断当前的target 是否是 th如果不是直接递归查找
* @memberof TableHeader * @memberof TableHeader

16
dist/demo.js vendored
View File

@ -40515,7 +40515,7 @@
lastShowIndex = _this$props.lastShowIndex; lastShowIndex = _this$props.lastShowIndex;
// let currentElement = this.getOnLineObject(targetEvent); // let currentElement = this.getOnLineObject(targetEvent);
var currentElement = _this.getTargetToTh(targetEvent); var currentElement = _this.getTargetToType(targetEvent);
if (!currentElement) return; if (!currentElement) return;
var type = currentElement.getAttribute('data-type'); var type = currentElement.getAttribute('data-type');
if (!_this.props.dragborder && !_this.props.draggable) return; if (!_this.props.dragborder && !_this.props.draggable) return;
@ -40564,6 +40564,14 @@
return tableWidth - offWidth; return tableWidth - offWidth;
}; };
_this.getTargetToType = function (targetEvent) {
var tag = targetEvent;
if (targetEvent && !targetEvent.getAttribute("data-type")) {
tag = _this.getTargetToType(targetEvent.parentElement);
}
return tag;
};
_this.getTargetToTh = function (targetEvent) { _this.getTargetToTh = function (targetEvent) {
var th = targetEvent; var th = targetEvent;
if (targetEvent.nodeName.toUpperCase() != "TH") { if (targetEvent.nodeName.toUpperCase() != "TH") {
@ -41066,6 +41074,12 @@
*/ */
/**
* 根据当前节点查找到有data-type类型的容器返回
* @memberof TableHeader
*/
/** /**
* 判断当前的target 是否是 th如果不是直接递归查找 * 判断当前的target 是否是 th如果不是直接递归查找
* @memberof TableHeader * @memberof TableHeader

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,14 +1,12 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.2.0-alpha.0", "version": "2.1.11",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",
"react-component", "react-component",
"bee-table", "bee-table",
"iuap-design", "iuap-design"
"tinper-bee",
"Table"
], ],
"engines": { "engines": {
"node": ">=6.0.0" "node": ">=6.0.0"

View File

@ -198,7 +198,7 @@ class TableHeader extends Component {
targetEvent = Event.getTarget(event); targetEvent = Event.getTarget(event);
const { clsPrefix, contentTable,lastShowIndex } = this.props; const { clsPrefix, contentTable,lastShowIndex } = this.props;
// let currentElement = this.getOnLineObject(targetEvent); // let currentElement = this.getOnLineObject(targetEvent);
let currentElement = this.getTargetToTh(targetEvent); let currentElement = this.getTargetToType(targetEvent);
if(!currentElement)return; if(!currentElement)return;
let type = currentElement.getAttribute('data-type'); let type = currentElement.getAttribute('data-type');
if(!this.props.dragborder && !this.props.draggable)return; if(!this.props.dragborder && !this.props.draggable)return;
@ -246,6 +246,19 @@ class TableHeader extends Component {
return (tableWidth-offWidth); return (tableWidth-offWidth);
} }
/**
* 根据当前节点查找到有data-type类型的容器返回
* @memberof TableHeader
*/
getTargetToType = (targetEvent) => {
let tag = targetEvent;
if(targetEvent && !targetEvent.getAttribute("data-type")){
tag = this.getTargetToType(targetEvent.parentElement);
}
return tag;
}
/** /**
* 判断当前的target 是否是 th如果不是直接递归查找 * 判断当前的target 是否是 th如果不是直接递归查找
* @memberof TableHeader * @memberof TableHeader