Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed May 24, 2019
1 parent 5c6b101 commit 8a8fe7f
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 99 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/vxe-table/favicon.ico><title>vxe-table 表格</title><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=preload as=style><link href=/vxe-table/static/css/index.16692c0f.css rel=preload as=style><link href=/vxe-table/static/js/chunk-vendors.59abef37.js rel=preload as=script><link href=/vxe-table/static/js/index.0e5b2959.js rel=preload as=script><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=stylesheet><link href=/vxe-table/static/css/index.16692c0f.css rel=stylesheet></head><body><noscript><strong>We're sorry but vxe-table doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/vxe-table/static/js/chunk-vendors.59abef37.js></script><script src=/vxe-table/static/js/index.0e5b2959.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/vxe-table/favicon.ico><title>vxe-table 表格</title><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=preload as=style><link href=/vxe-table/static/css/index.27cffe0e.css rel=preload as=style><link href=/vxe-table/static/js/chunk-vendors.59abef37.js rel=preload as=script><link href=/vxe-table/static/js/index.286c7350.js rel=preload as=script><link href=/vxe-table/static/css/chunk-vendors.27509805.css rel=stylesheet><link href=/vxe-table/static/css/index.27cffe0e.css rel=stylesheet></head><body><noscript><strong>We're sorry but vxe-table doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/vxe-table/static/js/chunk-vendors.59abef37.js></script><script src=/vxe-table/static/js/index.286c7350.js></script></body></html>

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/static/js/index.0e5b2959.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/static/js/index.286c7350.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/views/table/advanced/Menu.vue
Expand Up @@ -215,7 +215,7 @@ export default {
this.tableData = window.MOCK_DATA_LIST.slice(0, 6)
},
methods: {
contextMenuLinkEvent (menu) {
contextMenuLinkEvent ({ menu }) {
alert(menu.name)
},
footerMethod ({ columns, data }) {
Expand Down Expand Up @@ -247,7 +247,7 @@ export default {
})
},
methods: {
contextMenuLinkEvent (menu) {
contextMenuLinkEvent ({ menu }) {
alert(menu.name)
},
footerMethod ({ columns, data }) {
Expand Down
2 changes: 1 addition & 1 deletion examples/views/table/api/Table.vue
Expand Up @@ -959,7 +959,7 @@ export default {
desc: '当点击快捷菜单后触发',
type: '',
enum: '',
defVal: 'menu,{type,row,rowIndex,column,columnIndex,cell},event',
defVal: '{menu,type,row,rowIndex,column,columnIndex,cell},event',
list: []
},
{
Expand Down
66 changes: 31 additions & 35 deletions lib/index.common.js
Expand Up @@ -7438,6 +7438,7 @@ function renderFixed(h, $table, fixedType, footerData) {
this.tableFullData = tableFullData;
this.scrollYLoad = scrollYLoad;
this.tableData = this.getTableData().tableData;
this.checkSelectionStatus();
var rest = this.$nextTick();

if (!init) {
Expand All @@ -7456,6 +7457,7 @@ function renderFixed(h, $table, fixedType, footerData) {
this.clearScroll();
this.clearSort();
this.clearFilter();
this.clearSelection();
this.clearRowExpand();
this.clearTreeExpand();
return this.load(data).then(this.handleDefaultExpand);
Expand Down Expand Up @@ -7665,7 +7667,7 @@ function renderFixed(h, $table, fixedType, footerData) {
getAllRecords: function getAllRecords() {
return {
records: this.getRecords(),
selecteds: this.getSelecteds(),
selecteds: this.getSelectionRecords(),
insertRecords: this.getInsertRecords(),
removeRecords: this.getRemoveRecords(),
updateRecords: this.getUpdateRecords()
Expand Down Expand Up @@ -8544,7 +8546,9 @@ function renderFixed(h, $table, fixedType, footerData) {
* 快捷菜单点击事件
*/
ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) {
utils.emitEvent(this, 'context-menu-link', [menu, this.ctxMenuStore.args, evnt]);
utils.emitEvent(this, 'context-menu-link', [assign_default()({
menu: menu
}, this.ctxMenuStore.args), evnt]);
this.closeContextMenu();
},

Expand Down Expand Up @@ -8826,43 +8830,34 @@ function renderFixed(h, $table, fixedType, footerData) {
var tableFullData = this.tableFullData,
_this$selectConfig3 = this.selectConfig,
selectConfig = _this$selectConfig3 === void 0 ? {} : _this$selectConfig3,
selection = this.selection,
treeConfig = this.treeConfig;
selection = this.selection;
var property = selectConfig.checkProp,
selectMethod = selectConfig.selectMethod;

if (property) {
if (selectMethod) {
this.isAllSelected = tableFullData.every(function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || utils.getCellValue(row, property);
});
} else {
this.isAllSelected = tableFullData.every(function (row, rowIndex) {
return utils.getCellValue(row, property);
});
}

this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (item) {
return utils.getCellValue(item, property);
this.isAllSelected = tableFullData.length && tableFullData.every(selectMethod ? function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || utils.getCellValue(row, property);
} : function (row) {
return utils.getCellValue(row, property);
});
this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (row) {
return utils.getCellValue(row, property);
});
} else {
if (selectMethod) {
this.isAllSelected = tableFullData.every(function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || selection.indexOf(row) > -1;
});
} else {
this.isAllSelected = selection.length && (treeConfig ? tableFullData.every(function (row, rowIndex) {
return selection.indexOf(row) > -1;
}) : tableFullData.length === selection.length);
}

this.isIndeterminate = !this.isAllSelected && selection.length;
this.isAllSelected = tableFullData.length && tableFullData.every(selectMethod ? function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || selection.indexOf(row) > -1;
} : function (row) {
return selection.indexOf(row) > -1;
});
this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (row) {
return selection.indexOf(row) > -1;
});
}
},

Expand Down Expand Up @@ -11509,8 +11504,9 @@ func.forEach(function (name) {
});
}
},
contextMenuLinkEvent: function contextMenuLinkEvent(menu, _ref5, evnt) {
var row = _ref5.row,
contextMenuLinkEvent: function contextMenuLinkEvent(_ref5, evnt) {
var menu = _ref5.menu,
row = _ref5.row,
column = _ref5.column;
var xTable = this.$refs.xTable;
var property = column.property;
Expand Down
2 changes: 1 addition & 1 deletion lib/index.css

Large diffs are not rendered by default.

66 changes: 31 additions & 35 deletions lib/index.umd.js
Expand Up @@ -7447,6 +7447,7 @@ function renderFixed(h, $table, fixedType, footerData) {
this.tableFullData = tableFullData;
this.scrollYLoad = scrollYLoad;
this.tableData = this.getTableData().tableData;
this.checkSelectionStatus();
var rest = this.$nextTick();

if (!init) {
Expand All @@ -7465,6 +7466,7 @@ function renderFixed(h, $table, fixedType, footerData) {
this.clearScroll();
this.clearSort();
this.clearFilter();
this.clearSelection();
this.clearRowExpand();
this.clearTreeExpand();
return this.load(data).then(this.handleDefaultExpand);
Expand Down Expand Up @@ -7674,7 +7676,7 @@ function renderFixed(h, $table, fixedType, footerData) {
getAllRecords: function getAllRecords() {
return {
records: this.getRecords(),
selecteds: this.getSelecteds(),
selecteds: this.getSelectionRecords(),
insertRecords: this.getInsertRecords(),
removeRecords: this.getRemoveRecords(),
updateRecords: this.getUpdateRecords()
Expand Down Expand Up @@ -8553,7 +8555,9 @@ function renderFixed(h, $table, fixedType, footerData) {
* 快捷菜单点击事件
*/
ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) {
utils.emitEvent(this, 'context-menu-link', [menu, this.ctxMenuStore.args, evnt]);
utils.emitEvent(this, 'context-menu-link', [assign_default()({
menu: menu
}, this.ctxMenuStore.args), evnt]);
this.closeContextMenu();
},

Expand Down Expand Up @@ -8835,43 +8839,34 @@ function renderFixed(h, $table, fixedType, footerData) {
var tableFullData = this.tableFullData,
_this$selectConfig3 = this.selectConfig,
selectConfig = _this$selectConfig3 === void 0 ? {} : _this$selectConfig3,
selection = this.selection,
treeConfig = this.treeConfig;
selection = this.selection;
var property = selectConfig.checkProp,
selectMethod = selectConfig.selectMethod;

if (property) {
if (selectMethod) {
this.isAllSelected = tableFullData.every(function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || utils.getCellValue(row, property);
});
} else {
this.isAllSelected = tableFullData.every(function (row, rowIndex) {
return utils.getCellValue(row, property);
});
}

this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (item) {
return utils.getCellValue(item, property);
this.isAllSelected = tableFullData.length && tableFullData.every(selectMethod ? function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || utils.getCellValue(row, property);
} : function (row) {
return utils.getCellValue(row, property);
});
this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (row) {
return utils.getCellValue(row, property);
});
} else {
if (selectMethod) {
this.isAllSelected = tableFullData.every(function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || selection.indexOf(row) > -1;
});
} else {
this.isAllSelected = selection.length && (treeConfig ? tableFullData.every(function (row, rowIndex) {
return selection.indexOf(row) > -1;
}) : tableFullData.length === selection.length);
}

this.isIndeterminate = !this.isAllSelected && selection.length;
this.isAllSelected = tableFullData.length && tableFullData.every(selectMethod ? function (row, rowIndex) {
return !selectMethod({
row: row,
rowIndex: rowIndex
}) || selection.indexOf(row) > -1;
} : function (row) {
return selection.indexOf(row) > -1;
});
this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (row) {
return selection.indexOf(row) > -1;
});
}
},

Expand Down Expand Up @@ -11518,8 +11513,9 @@ func.forEach(function (name) {
});
}
},
contextMenuLinkEvent: function contextMenuLinkEvent(menu, _ref5, evnt) {
var row = _ref5.row,
contextMenuLinkEvent: function contextMenuLinkEvent(_ref5, evnt) {
var menu = _ref5.menu,
row = _ref5.row,
column = _ref5.column;
var xTable = this.$refs.xTable;
var property = column.property;
Expand Down
2 changes: 1 addition & 1 deletion lib/index.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "0.8.5",
"version": "0.8.9",
"description": "A very powerful Vue table component.",
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
2 changes: 1 addition & 1 deletion src/components/table/src/excel.js
Expand Up @@ -204,7 +204,7 @@ export default {
})
}
},
contextMenuLinkEvent (menu, { row, column }, evnt) {
contextMenuLinkEvent ({ menu, row, column }, evnt) {
let xTable = this.$refs.xTable
let { property } = column
switch (menu.code) {
Expand Down
32 changes: 17 additions & 15 deletions src/components/table/src/table.js
Expand Up @@ -591,6 +591,7 @@ export default {
this.tableFullData = tableFullData
this.scrollYLoad = scrollYLoad
this.tableData = this.getTableData().tableData
this.checkSelectionStatus()
let rest = this.$nextTick()
if (!init) {
if (autoWidth) {
Expand All @@ -605,6 +606,7 @@ export default {
this.clearScroll()
this.clearSort()
this.clearFilter()
this.clearSelection()
this.clearRowExpand()
this.clearTreeExpand()
return this.load(data).then(this.handleDefaultExpand)
Expand Down Expand Up @@ -759,7 +761,7 @@ export default {
getAllRecords () {
return {
records: this.getRecords(),
selecteds: this.getSelecteds(),
selecteds: this.getSelectionRecords(),
insertRecords: this.getInsertRecords(),
removeRecords: this.getRemoveRecords(),
updateRecords: this.getUpdateRecords()
Expand Down Expand Up @@ -1449,7 +1451,7 @@ export default {
* 快捷菜单点击事件
*/
ctxMenuLinkEvent (evnt, menu) {
UtilTools.emitEvent(this, 'context-menu-link', [menu, this.ctxMenuStore.args, evnt])
UtilTools.emitEvent(this, 'context-menu-link', [Object.assign({ menu }, this.ctxMenuStore.args), evnt])
this.closeContextMenu()
},
/**
Expand Down Expand Up @@ -1630,22 +1632,22 @@ export default {
}
},
checkSelectionStatus () {
let { tableFullData, selectConfig = {}, selection, treeConfig } = this
let { tableFullData, selectConfig = {}, selection } = this
let { checkProp: property, selectMethod } = selectConfig
if (property) {
if (selectMethod) {
this.isAllSelected = tableFullData.every((row, rowIndex) => !selectMethod({ row, rowIndex }) || UtilTools.getCellValue(row, property))
} else {
this.isAllSelected = tableFullData.every((row, rowIndex) => UtilTools.getCellValue(row, property))
}
this.isIndeterminate = !this.isAllSelected && tableFullData.some(item => UtilTools.getCellValue(item, property))
this.isAllSelected = tableFullData.every(
selectMethod
? (row, rowIndex) => !selectMethod({ row, rowIndex }) || UtilTools.getCellValue(row, property)
: row => UtilTools.getCellValue(row, property)
)
this.isIndeterminate = !this.isAllSelected && tableFullData.some(row => UtilTools.getCellValue(row, property))
} else {
if (selectMethod) {
this.isAllSelected = tableFullData.every((row, rowIndex) => !selectMethod({ row, rowIndex }) || selection.indexOf(row) > -1)
} else {
this.isAllSelected = selection.length && (treeConfig ? tableFullData.every((row, rowIndex) => selection.indexOf(row) > -1) : tableFullData.length === selection.length)
}
this.isIndeterminate = !this.isAllSelected && selection.length
this.isAllSelected = tableFullData.every(
selectMethod
? (row, rowIndex) => !selectMethod({ row, rowIndex }) || selection.indexOf(row) > -1
: row => selection.indexOf(row) > -1
)
this.isIndeterminate = !this.isAllSelected && tableFullData.some(row => selection.indexOf(row) > -1)
}
},
/**
Expand Down
15 changes: 11 additions & 4 deletions src/style/table.scss
@@ -1,11 +1,18 @@
%boxSizing {
box-sizing: border-box;
}
.vxe-table,
.vxe-table--filter-wrapper,
.vxe-table--tooltip-wrapper,
.vxe-table--ctxmenu-wrapper,
.vxe-checkbox {
box-sizing: border-box;
*, :after, :before {
box-sizing: border-box;
.vxe-table--valid-error-wrapper,
.vxe-checkbox,
.vxe-radio,
.vxe-input--wrapper,
.vxe-pagination {
@extend %boxSizing;
*, *:after, *:before {
@extend %boxSizing;
}
}

Expand Down

0 comments on commit 8a8fe7f

Please sign in to comment.