vxe-table 4.17.0 → 4.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/README.zh-TW.md +1 -1
- package/es/grid/src/grid.js +13 -5
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/en-US.js +22 -22
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +2 -4
- package/es/table/module/custom/panel.js +3 -0
- package/es/table/module/menu/hook.js +7 -1
- package/es/table/src/cell.js +4 -5
- package/es/table/src/table.js +79 -25
- package/es/table/src/util.js +19 -16
- package/es/table/style.css +29 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +29 -2
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +12 -4
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +54 -46
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +22 -22
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +22 -22
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +2 -4
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +3 -0
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/menu/hook.js +7 -1
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/src/cell.js +5 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/table.js +16 -12
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +7 -16
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +29 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +29 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +53 -45
- package/packages/locale/lang/en-US.ts +22 -22
- package/packages/table/module/custom/hook.ts +2 -4
- package/packages/table/module/custom/panel.ts +3 -0
- package/packages/table/module/menu/hook.ts +8 -1
- package/packages/table/src/cell.ts +4 -5
- package/packages/table/src/table.ts +82 -25
- package/packages/table/src/util.ts +27 -16
- package/styles/components/table.scss +52 -2
- /package/es/{iconfont.1760925752102.ttf → iconfont.1761269928256.ttf} +0 -0
- /package/es/{iconfont.1760925752102.woff → iconfont.1761269928256.woff} +0 -0
- /package/es/{iconfont.1760925752102.woff2 → iconfont.1761269928256.woff2} +0 -0
- /package/lib/{iconfont.1760925752102.ttf → iconfont.1761269928256.ttf} +0 -0
- /package/lib/{iconfont.1760925752102.woff → iconfont.1761269928256.woff} +0 -0
- /package/lib/{iconfont.1760925752102.woff2 → iconfont.1761269928256.woff2} +0 -0
|
@@ -19,7 +19,7 @@ import type { VxeTableMethods, VxeGridConstructor, VxeGridEmits, GridReactData,
|
|
|
19
19
|
const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI
|
|
20
20
|
|
|
21
21
|
const tableComponentPropKeys = Object.keys(tableProps) as (keyof VxeTableProps)[]
|
|
22
|
-
const tableComponentMethodKeys: (keyof VxeTableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar']
|
|
22
|
+
const tableComponentMethodKeys: (keyof VxeTableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar']
|
|
23
23
|
|
|
24
24
|
function createInternalData (): GridInternalData {
|
|
25
25
|
return {
|
|
@@ -1015,6 +1015,7 @@ export default defineVxeComponent({
|
|
|
1015
1015
|
if (!isInited && reactData.tableLoading) {
|
|
1016
1016
|
return nextTick()
|
|
1017
1017
|
}
|
|
1018
|
+
let operPromise = null
|
|
1018
1019
|
let sortList: any[] = []
|
|
1019
1020
|
let filterList: VxeTableDefines.FilterCheckedParams[] = []
|
|
1020
1021
|
let pageParams: any = {}
|
|
@@ -1068,7 +1069,7 @@ export default defineVxeComponent({
|
|
|
1068
1069
|
} else {
|
|
1069
1070
|
if ($xeTable) {
|
|
1070
1071
|
if (isReload) {
|
|
1071
|
-
$xeTable.clearAll()
|
|
1072
|
+
operPromise = $xeTable.clearAll()
|
|
1072
1073
|
} else {
|
|
1073
1074
|
sortList = $xeTable.getSortColumns()
|
|
1074
1075
|
filterList = $xeTable.getCheckedFilters()
|
|
@@ -1093,50 +1094,53 @@ export default defineVxeComponent({
|
|
|
1093
1094
|
reactData.sortData = sortList
|
|
1094
1095
|
reactData.filterData = filterList
|
|
1095
1096
|
reactData.tableLoading = true
|
|
1096
|
-
return Promise.
|
|
1097
|
-
.
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
const listProp = resConfigs.list
|
|
1114
|
-
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
|
|
1097
|
+
return Promise.all([
|
|
1098
|
+
Promise.resolve((beforeQuery || ajaxMethods)(commitParams, ...args)),
|
|
1099
|
+
operPromise
|
|
1100
|
+
]).then(([rest]) => {
|
|
1101
|
+
let tableData: any[] = []
|
|
1102
|
+
reactData.tableLoading = false
|
|
1103
|
+
if (rest) {
|
|
1104
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
1105
|
+
const totalProp = resConfigs.total
|
|
1106
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, totalProp || 'page.total')) || 0
|
|
1107
|
+
tablePage.total = XEUtils.toNumber(total)
|
|
1108
|
+
const resultProp = resConfigs.result
|
|
1109
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, resultProp || 'result')) || []
|
|
1110
|
+
// 检验当前页码,不能超出当前最大页数
|
|
1111
|
+
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
|
|
1112
|
+
if (tablePage.currentPage > pageCount) {
|
|
1113
|
+
tablePage.currentPage = pageCount
|
|
1115
1114
|
}
|
|
1116
|
-
}
|
|
1117
|
-
if ($xeTable as any) {
|
|
1118
|
-
$xeTable.loadData(tableData)
|
|
1119
1115
|
} else {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
$xeTable.loadData(tableData)
|
|
1123
|
-
}
|
|
1124
|
-
})
|
|
1125
|
-
}
|
|
1126
|
-
if (afterQuery) {
|
|
1127
|
-
afterQuery(commitParams, ...args)
|
|
1116
|
+
const listProp = resConfigs.list
|
|
1117
|
+
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
|
|
1128
1118
|
}
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
}
|
|
1119
|
+
}
|
|
1120
|
+
if ($xeTable) {
|
|
1121
|
+
$xeTable.loadData(tableData)
|
|
1122
|
+
} else {
|
|
1123
|
+
nextTick(() => {
|
|
1124
|
+
const $xeTable = refTable.value
|
|
1125
|
+
if ($xeTable) {
|
|
1126
|
+
$xeTable.loadData(tableData)
|
|
1127
|
+
}
|
|
1128
|
+
})
|
|
1129
|
+
}
|
|
1130
|
+
if (afterQuery) {
|
|
1131
|
+
afterQuery(commitParams, ...args)
|
|
1132
|
+
}
|
|
1133
|
+
if (querySuccessMethods) {
|
|
1134
|
+
querySuccessMethods({ ...commitParams, response: rest })
|
|
1135
|
+
}
|
|
1136
|
+
return { status: true }
|
|
1137
|
+
}).catch((rest) => {
|
|
1138
|
+
reactData.tableLoading = false
|
|
1139
|
+
if (queryErrorMethods) {
|
|
1140
|
+
queryErrorMethods({ ...commitParams, response: rest })
|
|
1141
|
+
}
|
|
1142
|
+
return { status: false }
|
|
1143
|
+
})
|
|
1140
1144
|
} else {
|
|
1141
1145
|
errLog('vxe.error.notFunc', ['[grid] proxy-config.ajax.query'])
|
|
1142
1146
|
}
|
|
@@ -1469,6 +1473,7 @@ export default defineVxeComponent({
|
|
|
1469
1473
|
* 获取需要排除的高度
|
|
1470
1474
|
*/
|
|
1471
1475
|
getExcludeHeight () {
|
|
1476
|
+
const { height } = props
|
|
1472
1477
|
const { isZMax } = reactData
|
|
1473
1478
|
const el = refElem.value
|
|
1474
1479
|
if (el) {
|
|
@@ -1477,8 +1482,11 @@ export default defineVxeComponent({
|
|
|
1477
1482
|
const topWrapper = refTopWrapper.value
|
|
1478
1483
|
const bottomWrapper = refBottomWrapper.value
|
|
1479
1484
|
const pagerWrapper = refPagerWrapper.value
|
|
1480
|
-
const parentEl = el.parentElement
|
|
1481
|
-
|
|
1485
|
+
const parentEl = el.parentElement
|
|
1486
|
+
let parentPaddingSize = 0
|
|
1487
|
+
if (parentEl && (height === '100%' || height === 'auto')) {
|
|
1488
|
+
parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(parentEl)
|
|
1489
|
+
}
|
|
1482
1490
|
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper)
|
|
1483
1491
|
}
|
|
1484
1492
|
return 0
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
fullStop: '。'
|
|
8
8
|
},
|
|
9
9
|
loading: {
|
|
10
|
-
text: '
|
|
10
|
+
text: 'Loading...'
|
|
11
11
|
},
|
|
12
12
|
error: {
|
|
13
13
|
downErr: 'Download failed',
|
|
@@ -181,7 +181,7 @@ export default {
|
|
|
181
181
|
insertBottom: 'Append at the bottom (append new data at the bottom of the table)'
|
|
182
182
|
},
|
|
183
183
|
impTitle: 'Import data',
|
|
184
|
-
impFile: '
|
|
184
|
+
impFile: 'File name',
|
|
185
185
|
impSelect: 'Select file',
|
|
186
186
|
impType: 'File type',
|
|
187
187
|
impOpts: 'Parameter settings',
|
|
@@ -207,9 +207,9 @@ export default {
|
|
|
207
207
|
},
|
|
208
208
|
printTitle: 'Print data',
|
|
209
209
|
expTitle: 'Export data',
|
|
210
|
-
expName: '
|
|
210
|
+
expName: 'File name',
|
|
211
211
|
expNamePlaceholder: 'Please enter a file name',
|
|
212
|
-
expSheetName: '
|
|
212
|
+
expSheetName: 'Title',
|
|
213
213
|
expSheetNamePlaceholder: 'Please enter a title',
|
|
214
214
|
expType: 'Save type',
|
|
215
215
|
expMode: 'Select data',
|
|
@@ -643,10 +643,10 @@ export default {
|
|
|
643
643
|
},
|
|
644
644
|
cases: {
|
|
645
645
|
equal: 'equal',
|
|
646
|
-
gt: 'Greater
|
|
647
|
-
lt: 'Less
|
|
648
|
-
begin: '
|
|
649
|
-
endin: '
|
|
646
|
+
gt: 'Greater',
|
|
647
|
+
lt: 'Less',
|
|
648
|
+
begin: 'Start',
|
|
649
|
+
endin: 'End',
|
|
650
650
|
include: 'Include',
|
|
651
651
|
isSensitive: 'case sensitive'
|
|
652
652
|
}
|
|
@@ -675,14 +675,14 @@ export default {
|
|
|
675
675
|
},
|
|
676
676
|
cases: {
|
|
677
677
|
equal: 'equal',
|
|
678
|
-
unequal: 'Not equal
|
|
679
|
-
gt: 'Greater
|
|
680
|
-
ge: 'Greater
|
|
681
|
-
lt: 'Less
|
|
682
|
-
le: 'Less
|
|
683
|
-
begin: '
|
|
678
|
+
unequal: 'Not equal',
|
|
679
|
+
gt: 'Greater',
|
|
680
|
+
ge: 'Greater or equal',
|
|
681
|
+
lt: 'Less',
|
|
682
|
+
le: 'Less or equal',
|
|
683
|
+
begin: 'Start',
|
|
684
684
|
notbegin: "It's not at the beginning",
|
|
685
|
-
endin: '
|
|
685
|
+
endin: 'End',
|
|
686
686
|
notendin: 'The ending is not',
|
|
687
687
|
include: 'Include',
|
|
688
688
|
exclude: 'Not included',
|
|
@@ -740,14 +740,14 @@ export default {
|
|
|
740
740
|
search: 'search',
|
|
741
741
|
cases: {
|
|
742
742
|
equal: 'equal',
|
|
743
|
-
unequal: 'Not equal
|
|
744
|
-
gt: 'Greater
|
|
745
|
-
ge: 'Greater
|
|
746
|
-
lt: 'Less
|
|
747
|
-
le: 'Less
|
|
748
|
-
begin: '
|
|
743
|
+
unequal: 'Not equal',
|
|
744
|
+
gt: 'Greater',
|
|
745
|
+
ge: 'Greater or equal',
|
|
746
|
+
lt: 'Less',
|
|
747
|
+
le: 'Less or equal',
|
|
748
|
+
begin: 'Start',
|
|
749
749
|
notbegin: "It's not at the beginning",
|
|
750
|
-
endin: '
|
|
750
|
+
endin: 'End',
|
|
751
751
|
notendin: 'The ending is not',
|
|
752
752
|
include: 'Include',
|
|
753
753
|
exclude: 'Not included',
|
|
@@ -5,7 +5,7 @@ import { getColumnList } from '../../src/util'
|
|
|
5
5
|
|
|
6
6
|
import type { TableCustomMethods, TableCustomPrivateMethods, VxeColumnPropTypes, VxeTableDefines } from '../../../../types'
|
|
7
7
|
|
|
8
|
-
const tableCustomMethodKeys: (keyof TableCustomMethods)[] = ['openCustom', 'closeCustom', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox']
|
|
8
|
+
const tableCustomMethodKeys: (keyof TableCustomMethods)[] = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox']
|
|
9
9
|
|
|
10
10
|
VxeUI.hooks.add('tableCustomModule', {
|
|
11
11
|
setupTable ($xeTable) {
|
|
@@ -13,7 +13,6 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
13
13
|
const { computeCustomOpts, computeRowGroupFields } = $xeTable.getComputeMaps()
|
|
14
14
|
const { refElem } = $xeTable.getRefMaps()
|
|
15
15
|
|
|
16
|
-
const $xeGrid = $xeTable.xeGrid
|
|
17
16
|
const $xeGantt = $xeTable.xeGantt
|
|
18
17
|
|
|
19
18
|
const calcMaxHeight = () => {
|
|
@@ -289,8 +288,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
289
288
|
}
|
|
290
289
|
|
|
291
290
|
const emitCustomEvent = (type: VxeTableDefines.CustomType, evnt: Event) => {
|
|
292
|
-
|
|
293
|
-
comp.dispatchEvent('custom', { type }, evnt)
|
|
291
|
+
$xeTable.dispatchEvent('custom', { type }, evnt)
|
|
294
292
|
}
|
|
295
293
|
|
|
296
294
|
const customPrivateMethods: TableCustomPrivateMethods = {
|
|
@@ -91,6 +91,7 @@ export default defineVxeComponent({
|
|
|
91
91
|
$xeTable.saveCustom()
|
|
92
92
|
$xeTable.closeCustom()
|
|
93
93
|
$xeTable.emitCustomEvent('confirm', $event)
|
|
94
|
+
$xeTable.emitCustomEvent('close', $event)
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
const cancelCloseEvent: VxeButtonEvents.Click = ({ $event }) => {
|
|
@@ -102,12 +103,14 @@ export default defineVxeComponent({
|
|
|
102
103
|
$xeTable.cancelCustom()
|
|
103
104
|
$xeTable.closeCustom()
|
|
104
105
|
$xeTable.emitCustomEvent('cancel', $event)
|
|
106
|
+
$xeTable.emitCustomEvent('close', $event)
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
const handleResetCustomEvent = (evnt: Event) => {
|
|
108
110
|
$xeTable.resetCustom(true)
|
|
109
111
|
$xeTable.closeCustom()
|
|
110
112
|
$xeTable.emitCustomEvent('reset', evnt)
|
|
113
|
+
$xeTable.emitCustomEvent('close', evnt)
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
const resetCustomEvent: VxeButtonEvents.Click = ({ $event }) => {
|
|
@@ -16,6 +16,10 @@ hooks.add('tableMenuModule', {
|
|
|
16
16
|
const { refElem, refTableFilter, refTableMenu } = $xeTable.getRefMaps()
|
|
17
17
|
const { computeMouseOpts, computeIsContentMenu, computeMenuOpts } = $xeTable.getComputeMaps()
|
|
18
18
|
|
|
19
|
+
const $xeGrid = $xeTable.xeGrid
|
|
20
|
+
const $xeGantt = $xeTable.xeGantt
|
|
21
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
22
|
+
|
|
19
23
|
let menuMethods = {} as TableMenuMethods
|
|
20
24
|
let menuPrivateMethods = {} as TableMenuPrivateMethods
|
|
21
25
|
|
|
@@ -38,7 +42,10 @@ hooks.add('tableMenuModule', {
|
|
|
38
42
|
if (!visibleMethod || visibleMethod(params)) {
|
|
39
43
|
evnt.preventDefault()
|
|
40
44
|
$xeTable.updateZindex()
|
|
41
|
-
const el = refElem.value
|
|
45
|
+
const el = $xeGGWrapper ? $xeGGWrapper.getRefMaps().refElem.value : refElem.value
|
|
46
|
+
if (!el) {
|
|
47
|
+
return
|
|
48
|
+
}
|
|
42
49
|
const tableRect = el.getBoundingClientRect()
|
|
43
50
|
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
|
|
44
51
|
|
|
@@ -412,11 +412,9 @@ export const Cell = {
|
|
|
412
412
|
const tableReactData = $table.reactData
|
|
413
413
|
const tableInternalData = $table.internalData
|
|
414
414
|
const { isRowGroupStatus } = tableReactData
|
|
415
|
-
const { computeEditOpts } = $table.getComputeMaps()
|
|
416
415
|
const { editConfig } = tableProps
|
|
417
|
-
const
|
|
418
|
-
const
|
|
419
|
-
const renderOpts = editConfig && isEnableConf(editOpts) && editRender ? editRender : cellRender
|
|
416
|
+
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc, formatter } = column
|
|
417
|
+
const renderOpts = editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null)
|
|
420
418
|
const defaultSlot = slots ? slots.default : null
|
|
421
419
|
const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null
|
|
422
420
|
let cellValue: string | number | null = ''
|
|
@@ -476,7 +474,8 @@ export const Cell = {
|
|
|
476
474
|
if (defaultSlot) {
|
|
477
475
|
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params))
|
|
478
476
|
}
|
|
479
|
-
|
|
477
|
+
// formatter > (renderTableCell | renderTableDefault)
|
|
478
|
+
if (renderOpts && !formatter) {
|
|
480
479
|
const compConf = renderer.get(renderOpts.name)
|
|
481
480
|
if (compConf) {
|
|
482
481
|
const rtCell = compConf.renderTableCell || compConf.renderCell
|
|
@@ -1598,7 +1598,7 @@ export default defineVxeComponent({
|
|
|
1598
1598
|
}
|
|
1599
1599
|
|
|
1600
1600
|
const calcTableHeight = (key: 'height' | 'minHeight' | 'maxHeight') => {
|
|
1601
|
-
const { editConfig } = props
|
|
1601
|
+
const { editConfig, editRules } = props
|
|
1602
1602
|
const { parentHeight } = reactData
|
|
1603
1603
|
let val = props[key]
|
|
1604
1604
|
if (key === 'minHeight') {
|
|
@@ -1606,7 +1606,7 @@ export default defineVxeComponent({
|
|
|
1606
1606
|
if (XEUtils.eqNull(val)) {
|
|
1607
1607
|
if (eqEmptyValue(defMinHeight)) {
|
|
1608
1608
|
// 编辑模式默认最小高度
|
|
1609
|
-
if (isEnableConf(editConfig)) {
|
|
1609
|
+
if (editRules && isEnableConf(editConfig)) {
|
|
1610
1610
|
val = 144
|
|
1611
1611
|
}
|
|
1612
1612
|
} else {
|
|
@@ -2464,7 +2464,7 @@ export default defineVxeComponent({
|
|
|
2464
2464
|
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
2465
2465
|
const $xeGanttView = internalData.xeGanttView
|
|
2466
2466
|
const el = refElem.value
|
|
2467
|
-
if (!el || !el.clientHeight) {
|
|
2467
|
+
if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
|
|
2468
2468
|
return
|
|
2469
2469
|
}
|
|
2470
2470
|
const containerList = ['main', 'left', 'right']
|
|
@@ -7027,14 +7027,40 @@ export default defineVxeComponent({
|
|
|
7027
7027
|
* 获取表格的滚动状态
|
|
7028
7028
|
*/
|
|
7029
7029
|
getScroll () {
|
|
7030
|
-
|
|
7030
|
+
return $xeTable.getScrollData()
|
|
7031
|
+
},
|
|
7032
|
+
/**
|
|
7033
|
+
* 获取表格的滚动数据
|
|
7034
|
+
*/
|
|
7035
|
+
getScrollData () {
|
|
7036
|
+
const { scrollXLoad, scrollYLoad, scrollbarHeight, scrollbarWidth } = reactData
|
|
7031
7037
|
const { elemStore } = internalData
|
|
7032
7038
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
7039
|
+
const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0
|
|
7040
|
+
const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
7041
|
+
const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0
|
|
7042
|
+
const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0
|
|
7043
|
+
const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0
|
|
7044
|
+
const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0
|
|
7045
|
+
const isTop = scrollTop <= 0
|
|
7046
|
+
const isBottom = scrollTop + clientHeight >= scrollHeight
|
|
7047
|
+
const isLeft = scrollLeft <= 0
|
|
7048
|
+
const isRight = scrollLeft + clientWidth >= scrollWidth
|
|
7033
7049
|
return {
|
|
7034
7050
|
virtualX: scrollXLoad,
|
|
7035
7051
|
virtualY: scrollYLoad,
|
|
7036
|
-
|
|
7037
|
-
|
|
7052
|
+
isTop,
|
|
7053
|
+
isBottom,
|
|
7054
|
+
isLeft,
|
|
7055
|
+
isRight,
|
|
7056
|
+
scrollbarHeight,
|
|
7057
|
+
scrollbarWidth,
|
|
7058
|
+
scrollTop,
|
|
7059
|
+
scrollLeft,
|
|
7060
|
+
scrollHeight,
|
|
7061
|
+
scrollWidth,
|
|
7062
|
+
clientHeight,
|
|
7063
|
+
clientWidth
|
|
7038
7064
|
}
|
|
7039
7065
|
},
|
|
7040
7066
|
/**
|
|
@@ -7158,7 +7184,10 @@ export default defineVxeComponent({
|
|
|
7158
7184
|
scrollYStore.visibleStartIndex = 0
|
|
7159
7185
|
scrollYStore.endIndex = scrollYStore.visibleSize
|
|
7160
7186
|
scrollYStore.visibleEndIndex = scrollYStore.visibleSize
|
|
7187
|
+
|
|
7161
7188
|
return nextTick().then(() => {
|
|
7189
|
+
internalData.lastScrollLeft = 0
|
|
7190
|
+
internalData.lastScrollTop = 0
|
|
7162
7191
|
internalData.intoRunScroll = false
|
|
7163
7192
|
})
|
|
7164
7193
|
},
|
|
@@ -7528,11 +7557,12 @@ export default defineVxeComponent({
|
|
|
7528
7557
|
// 如果点击自定义列容器
|
|
7529
7558
|
} else {
|
|
7530
7559
|
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
|
|
7531
|
-
|
|
7532
|
-
|
|
7560
|
+
if (customStore.visible && $xeTable.closeCustom) {
|
|
7561
|
+
tablePrivateMethods.preventEvent(evnt, 'event.clearCustom', {}, () => {
|
|
7533
7562
|
$xeTable.closeCustom()
|
|
7534
|
-
|
|
7535
|
-
|
|
7563
|
+
$xeTable.dispatchEvent('custom', { type: 'close' }, evnt)
|
|
7564
|
+
})
|
|
7565
|
+
}
|
|
7536
7566
|
}
|
|
7537
7567
|
}
|
|
7538
7568
|
}
|
|
@@ -8364,7 +8394,7 @@ export default defineVxeComponent({
|
|
|
8364
8394
|
const el = refElem.value
|
|
8365
8395
|
if (el) {
|
|
8366
8396
|
const parentElem = el.parentNode as HTMLElement
|
|
8367
|
-
|
|
8397
|
+
let parentPaddingSize = 0
|
|
8368
8398
|
let parentWrapperHeight = 0
|
|
8369
8399
|
if (parentElem) {
|
|
8370
8400
|
if ($xeGantt && hasClass(parentElem, 'vxe-gantt--table-wrapper')) {
|
|
@@ -8373,6 +8403,7 @@ export default defineVxeComponent({
|
|
|
8373
8403
|
parentWrapperHeight = $xeGrid.getParentHeight()
|
|
8374
8404
|
} else {
|
|
8375
8405
|
parentWrapperHeight = parentElem.clientHeight
|
|
8406
|
+
parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
|
|
8376
8407
|
}
|
|
8377
8408
|
}
|
|
8378
8409
|
return Math.floor(parentWrapperHeight - parentPaddingSize)
|
|
@@ -11404,12 +11435,11 @@ export default defineVxeComponent({
|
|
|
11404
11435
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
11405
11436
|
const leftFixedWidth = computeLeftFixedWidth.value
|
|
11406
11437
|
const rightFixedWidth = computeRightFixedWidth.value
|
|
11407
|
-
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11408
|
-
return
|
|
11409
|
-
}
|
|
11410
11438
|
|
|
11411
11439
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
11412
11440
|
const rowOpts = computeRowOpts.value
|
|
11441
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
11442
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
11413
11443
|
const xHandleEl = refScrollXHandleElem.value
|
|
11414
11444
|
const yHandleEl = refScrollYHandleElem.value
|
|
11415
11445
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
@@ -11418,12 +11448,6 @@ export default defineVxeComponent({
|
|
|
11418
11448
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
11419
11449
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
11420
11450
|
const rowExpandEl = refRowExpandElem.value
|
|
11421
|
-
if (!xHandleEl) {
|
|
11422
|
-
return
|
|
11423
|
-
}
|
|
11424
|
-
if (!yHandleEl) {
|
|
11425
|
-
return
|
|
11426
|
-
}
|
|
11427
11451
|
if (!bodyScrollElem) {
|
|
11428
11452
|
return
|
|
11429
11453
|
}
|
|
@@ -11440,7 +11464,19 @@ export default defineVxeComponent({
|
|
|
11440
11464
|
const isRollX = scrollLeft !== lastScrollLeft
|
|
11441
11465
|
const isRollY = scrollTop !== lastScrollTop
|
|
11442
11466
|
|
|
11467
|
+
if (isRollX) {
|
|
11468
|
+
// 如果禁用滚动
|
|
11469
|
+
if (scrollbarXOpts.visible === 'hidden') {
|
|
11470
|
+
evnt.preventDefault()
|
|
11471
|
+
return
|
|
11472
|
+
}
|
|
11473
|
+
}
|
|
11443
11474
|
if (isRollY) {
|
|
11475
|
+
// 如果禁用滚动
|
|
11476
|
+
if (scrollbarYOpts.visible === 'hidden') {
|
|
11477
|
+
evnt.preventDefault()
|
|
11478
|
+
return
|
|
11479
|
+
}
|
|
11444
11480
|
const isTopWheel = deltaTop < 0
|
|
11445
11481
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
11446
11482
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
@@ -11448,9 +11484,14 @@ export default defineVxeComponent({
|
|
|
11448
11484
|
}
|
|
11449
11485
|
}
|
|
11450
11486
|
|
|
11487
|
+
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11488
|
+
return
|
|
11489
|
+
}
|
|
11490
|
+
|
|
11451
11491
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
11452
11492
|
$xeTable.clearHoverRow()
|
|
11453
11493
|
}
|
|
11494
|
+
|
|
11454
11495
|
// 用于鼠标纵向滚轮处理
|
|
11455
11496
|
if (isRollX) {
|
|
11456
11497
|
evnt.preventDefault()
|
|
@@ -11972,7 +12013,7 @@ export default defineVxeComponent({
|
|
|
11972
12013
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
|
|
11973
12014
|
return h('div', {
|
|
11974
12015
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
11975
|
-
class: [`vxe-table--fixed-${fixedType}-wrapper`, {
|
|
12016
|
+
class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
|
|
11976
12017
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
11977
12018
|
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
11978
12019
|
}]
|
|
@@ -12290,7 +12331,7 @@ export default defineVxeComponent({
|
|
|
12290
12331
|
}]
|
|
12291
12332
|
}, [
|
|
12292
12333
|
h('div', {
|
|
12293
|
-
class: 'vxe-table--main-wrapper'
|
|
12334
|
+
class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
|
|
12294
12335
|
}, [
|
|
12295
12336
|
/**
|
|
12296
12337
|
* 表头
|
|
@@ -12466,11 +12507,15 @@ export default defineVxeComponent({
|
|
|
12466
12507
|
h('div', {
|
|
12467
12508
|
key: 'tn',
|
|
12468
12509
|
ref: refEmptyPlaceholder,
|
|
12469
|
-
class: 'vxe-table--empty-
|
|
12510
|
+
class: 'vxe-table--empty-place-wrapper'
|
|
12470
12511
|
}, [
|
|
12471
12512
|
h('div', {
|
|
12472
|
-
class: 'vxe-table--empty-
|
|
12473
|
-
},
|
|
12513
|
+
class: 'vxe-table--empty-placeholder'
|
|
12514
|
+
}, [
|
|
12515
|
+
h('div', {
|
|
12516
|
+
class: 'vxe-table--empty-content'
|
|
12517
|
+
}, renderEmptyBody())
|
|
12518
|
+
])
|
|
12474
12519
|
]),
|
|
12475
12520
|
/**
|
|
12476
12521
|
* 边框线
|
|
@@ -12783,6 +12828,18 @@ export default defineVxeComponent({
|
|
|
12783
12828
|
watch(() => VxeUI.getLanguage(), () => {
|
|
12784
12829
|
reLayoutFlag.value++
|
|
12785
12830
|
})
|
|
12831
|
+
watch(() => {
|
|
12832
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
12833
|
+
return scrollbarXOpts.visible
|
|
12834
|
+
}, () => {
|
|
12835
|
+
reLayoutFlag.value++
|
|
12836
|
+
})
|
|
12837
|
+
watch(() => {
|
|
12838
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
12839
|
+
return scrollbarYOpts.visible
|
|
12840
|
+
}, () => {
|
|
12841
|
+
reLayoutFlag.value++
|
|
12842
|
+
})
|
|
12786
12843
|
watch(reLayoutFlag, () => {
|
|
12787
12844
|
$xeTable.recalculate(true)
|
|
12788
12845
|
})
|
|
@@ -702,29 +702,40 @@ export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prev
|
|
|
702
702
|
|
|
703
703
|
export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
704
704
|
const { props, internalData } = $xeTable
|
|
705
|
+
|
|
705
706
|
internalData.initStatus = false
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
707
|
+
const actionList = [
|
|
708
|
+
$xeTable.clearSort(),
|
|
709
|
+
$xeTable.clearCurrentRow(),
|
|
710
|
+
$xeTable.clearCurrentColumn(),
|
|
711
|
+
$xeTable.clearRadioRow(),
|
|
712
|
+
$xeTable.clearRadioReserve(),
|
|
713
|
+
$xeTable.clearCheckboxRow(),
|
|
714
|
+
$xeTable.clearCheckboxReserve(),
|
|
715
|
+
$xeTable.clearRowExpand(),
|
|
716
|
+
$xeTable.clearTreeExpand(),
|
|
717
|
+
$xeTable.clearTreeExpandReserve(),
|
|
718
|
+
$xeTable.clearPendingRow()
|
|
719
|
+
]
|
|
717
720
|
if ($xeTable.clearFilter) {
|
|
718
|
-
|
|
721
|
+
actionList.push(
|
|
722
|
+
$xeTable.clearFilter()
|
|
723
|
+
)
|
|
719
724
|
}
|
|
720
725
|
if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
|
|
721
|
-
|
|
726
|
+
actionList.push(
|
|
727
|
+
$xeTable.clearSelected()
|
|
728
|
+
)
|
|
722
729
|
}
|
|
723
730
|
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
724
|
-
|
|
725
|
-
|
|
731
|
+
actionList.push(
|
|
732
|
+
$xeTable.clearCellAreas(),
|
|
733
|
+
$xeTable.clearCopyCellArea()
|
|
734
|
+
)
|
|
726
735
|
}
|
|
727
|
-
return
|
|
736
|
+
return Promise.all(actionList).then(() => {
|
|
737
|
+
return $xeTable.clearScroll()
|
|
738
|
+
})
|
|
728
739
|
}
|
|
729
740
|
|
|
730
741
|
export function clearTableAllStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|