publish 2.1.2
This commit is contained in:
parent
cab1f66b56
commit
8dd48af754
|
@ -153,6 +153,13 @@
|
||||||
.u-loading.u-loading-line.u-loading-line-warning > div {
|
.u-loading.u-loading-line.u-loading-line-warning > div {
|
||||||
background-color: #ff9800; }
|
background-color: #ff9800; }
|
||||||
|
|
||||||
|
.u-loading.u-loading-custom > div {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
-webkit-transform: translate(-50%, -50%);
|
||||||
|
transform: translate(-50%, -50%); }
|
||||||
|
|
||||||
@keyframes line-scale {
|
@keyframes line-scale {
|
||||||
0% {
|
0% {
|
||||||
-webkit-transform: scaley(1);
|
-webkit-transform: scaley(1);
|
||||||
|
|
|
@ -96,11 +96,13 @@ var TableHeader = function (_Component) {
|
||||||
_this.drag.minWidth = currentObj.style.minWidth != "" ? parseInt(currentObj.style.minWidth) : defaultWidth;
|
_this.drag.minWidth = currentObj.style.minWidth != "" ? parseInt(currentObj.style.minWidth) : defaultWidth;
|
||||||
_this.drag.tableWidth = parseInt(_this.table.table.style.width ? _this.table.table.style.width : _this.table.table.scrollWidth);
|
_this.drag.tableWidth = parseInt(_this.table.table.style.width ? _this.table.table.style.width : _this.table.table.scrollWidth);
|
||||||
} else if (type != 'online' && _this.props.draggable) {
|
} else if (type != 'online' && _this.props.draggable) {
|
||||||
if (!_this.props.draggable || targetEvent.nodeName.toUpperCase() != "TH") return;
|
// if (!this.props.draggable || targetEvent.nodeName.toUpperCase() != "TH") return;
|
||||||
targetEvent.setAttribute('draggable', true); //添加交换列效果
|
if (!_this.props.draggable) return;
|
||||||
|
var th = _this.getTargetToTh(targetEvent);
|
||||||
|
th.setAttribute('draggable', true); //添加交换列效果
|
||||||
_this.drag.option = 'dragAble';
|
_this.drag.option = 'dragAble';
|
||||||
_this.currentDome = event.target;
|
_this.currentDome = th;
|
||||||
var _currentIndex = parseInt(currentElement.getAttribute("data-line-index"));
|
var _currentIndex = parseInt(th.getAttribute("data-line-index"));
|
||||||
_this.drag.currIndex = _currentIndex;
|
_this.drag.currIndex = _currentIndex;
|
||||||
} else {
|
} else {
|
||||||
// console.log("onTrMouseDown dragborder or draggable is all false !");
|
// console.log("onTrMouseDown dragborder or draggable is all false !");
|
||||||
|
@ -108,6 +110,15 @@ var TableHeader = function (_Component) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_this.getTargetToTh = function (targetEvent) {
|
||||||
|
var th = targetEvent;
|
||||||
|
if (targetEvent.nodeName.toUpperCase() != "TH") {
|
||||||
|
th = _this.getThDome(targetEvent);
|
||||||
|
}
|
||||||
|
console.log(" getTargetToTh: ", th);
|
||||||
|
return th;
|
||||||
|
};
|
||||||
|
|
||||||
_this.onTrMouseMove = function (e) {
|
_this.onTrMouseMove = function (e) {
|
||||||
if (!_this.props.dragborder && !_this.props.draggable) return;
|
if (!_this.props.dragborder && !_this.props.draggable) return;
|
||||||
var _this$props2 = _this.props,
|
var _this$props2 = _this.props,
|
||||||
|
@ -221,8 +232,9 @@ var TableHeader = function (_Component) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var event = _utils.Event.getEvent(e),
|
var event = _utils.Event.getEvent(e),
|
||||||
target = _utils.Event.getTarget(event);
|
|
||||||
|
|
||||||
|
// target = Event.getTarget(event);
|
||||||
|
target = _this.getTargetToTh(_utils.Event.getTarget(event));
|
||||||
var currentIndex = parseInt(target.getAttribute("data-line-index"));
|
var currentIndex = parseInt(target.getAttribute("data-line-index"));
|
||||||
var currentKey = target.getAttribute('data-line-key');
|
var currentKey = target.getAttribute('data-line-key');
|
||||||
|
|
||||||
|
@ -571,6 +583,11 @@ var TableHeader = function (_Component) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前的target 是否是 th,如果不是,直接递归查找。
|
||||||
|
* @memberof TableHeader
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调整列宽的move事件
|
* 调整列宽的move事件
|
||||||
* @memberof TableHeader
|
* @memberof TableHeader
|
||||||
|
@ -667,6 +684,26 @@ var TableHeader = function (_Component) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据当前鼠标点击的节点,进行递归遍历,最终找到th
|
||||||
|
* @param {*} element
|
||||||
|
* @returns <th />对象
|
||||||
|
* @memberof TableHeader
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
TableHeader.prototype.getThDome = function getThDome(element) {
|
||||||
|
var _tagName = element.tagName.toLowerCase();
|
||||||
|
if (element.getAttribute('data-filter-type') === 'filterContext') return null;
|
||||||
|
if (_tagName === 'i') return null;
|
||||||
|
if (_tagName != 'th') {
|
||||||
|
return this.getThDome(element.parentElement);
|
||||||
|
} else {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//---拖拽列交换----end-----
|
//---拖拽列交换----end-----
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -142,6 +142,12 @@
|
||||||
.u-loading.u-loading-line.u-loading-line-warning > div {
|
.u-loading.u-loading-line.u-loading-line-warning > div {
|
||||||
background-color: #ff9800; }
|
background-color: #ff9800; }
|
||||||
|
|
||||||
|
.u-loading.u-loading-custom > div {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%); }
|
||||||
|
|
||||||
@keyframes line-scale {
|
@keyframes line-scale {
|
||||||
0% {
|
0% {
|
||||||
transform: scaley(1); }
|
transform: scaley(1); }
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bee-table",
|
"name": "bee-table",
|
||||||
"version": "2.1.1",
|
"version": "2.1.2",
|
||||||
"description": "Table ui component for react",
|
"description": "Table ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
|
Loading…
Reference in New Issue