vxe-table 4.11.0-beta.10 → 4.11.0-beta.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 +13 -18
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/hook.js +7 -1
- package/es/table/render/index.js +0 -10
- package/es/table/src/body.js +2 -4
- package/es/table/src/cell.js +0 -3
- package/es/table/src/footer.js +2 -4
- package/es/table/src/header.js +4 -6
- package/es/table/src/table.js +25 -50
- package/es/table/style.css +1 -1
- 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 +1 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +41 -86
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +9 -1
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/render/index.js +0 -10
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +1 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +0 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +1 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +3 -6
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +25 -56
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- 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 +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/hook.ts +7 -1
- package/packages/table/render/index.ts +0 -10
- package/packages/table/src/body.ts +2 -5
- package/packages/table/src/cell.ts +0 -3
- package/packages/table/src/footer.ts +2 -5
- package/packages/table/src/header.ts +4 -7
- package/packages/table/src/table.ts +26 -54
- package/styles/components/table.scss +1 -1
- package/es/locale/lang/id-ID.js +0 -695
- package/lib/locale/lang/id-ID.js +0 -701
- package/lib/locale/lang/id-ID.min.js +0 -1
- package/packages/locale/lang/id-ID.ts +0 -695
- /package/es/{iconfont.1739790215610.ttf → iconfont.1739506388714.ttf} +0 -0
- /package/es/{iconfont.1739790215610.woff → iconfont.1739506388714.woff} +0 -0
- /package/es/{iconfont.1739790215610.woff2 → iconfont.1739506388714.woff2} +0 -0
- /package/lib/{iconfont.1739790215610.ttf → iconfont.1739506388714.ttf} +0 -0
- /package/lib/{iconfont.1739790215610.woff → iconfont.1739506388714.woff} +0 -0
- /package/lib/{iconfont.1739790215610.woff2 → iconfont.1739506388714.woff2} +0 -0
|
@@ -267,7 +267,7 @@ export default defineComponent({
|
|
|
267
267
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
268
268
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
269
269
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
270
|
-
const { isGroup,
|
|
270
|
+
const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
271
271
|
|
|
272
272
|
let renderColumnList = tableColumn
|
|
273
273
|
let isOptimizeMode = false
|
|
@@ -280,11 +280,8 @@ export default defineComponent({
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
if (fixedType || !overflowX) {
|
|
284
|
-
renderColumnList = visibleColumn
|
|
285
|
-
}
|
|
286
|
-
|
|
287
283
|
if (fixedType) {
|
|
284
|
+
renderColumnList = visibleColumn
|
|
288
285
|
if (isOptimizeMode) {
|
|
289
286
|
renderColumnList = fixedColumn || []
|
|
290
287
|
}
|
|
@@ -142,8 +142,8 @@ export default defineComponent({
|
|
|
142
142
|
'is--sortable': column.sortable,
|
|
143
143
|
'col--filter': !!filters,
|
|
144
144
|
'is--filter-active': hasFilter,
|
|
145
|
-
'is--drag-active':
|
|
146
|
-
'is--drag-disabled':
|
|
145
|
+
'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
146
|
+
'is--drag-disabled': isDisabledDrag,
|
|
147
147
|
'col--current': currentColumn === column
|
|
148
148
|
},
|
|
149
149
|
headerClassName ? (XEUtils.isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName) : '',
|
|
@@ -223,7 +223,7 @@ export default defineComponent({
|
|
|
223
223
|
const renderVN = () => {
|
|
224
224
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
225
225
|
const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
|
|
226
|
-
const { isGroup,
|
|
226
|
+
const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
227
227
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
228
228
|
|
|
229
229
|
const mouseOpts = computeMouseOpts.value
|
|
@@ -243,11 +243,8 @@ export default defineComponent({
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
if (fixedType || !overflowX) {
|
|
247
|
-
renderColumnList = visibleColumn
|
|
248
|
-
}
|
|
249
|
-
|
|
250
246
|
if (fixedType) {
|
|
247
|
+
renderColumnList = visibleColumn
|
|
251
248
|
// 如果是使用优化模式
|
|
252
249
|
if (isOptimizeMode) {
|
|
253
250
|
renderColumnList = fixedColumn || []
|
|
@@ -1247,7 +1247,6 @@ export default defineComponent({
|
|
|
1247
1247
|
const fullColumnIdData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnIdData = {}
|
|
1248
1248
|
const fullColumnFieldData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnFieldData = {}
|
|
1249
1249
|
const mouseOpts = computeMouseOpts.value
|
|
1250
|
-
const expandOpts = computeExpandOpts.value
|
|
1251
1250
|
const columnOpts = computeColumnOpts.value
|
|
1252
1251
|
const columnDragOpts = computeColumnDragOpts.value
|
|
1253
1252
|
const { isCrossDrag, isSelfToChildDrag } = columnDragOpts
|
|
@@ -1334,8 +1333,10 @@ export default defineComponent({
|
|
|
1334
1333
|
tableFullColumn.forEach(handleFunc)
|
|
1335
1334
|
}
|
|
1336
1335
|
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1336
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1337
|
+
if (expandColumn && mouseOpts.area) {
|
|
1338
|
+
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
|
|
1339
|
+
}
|
|
1339
1340
|
}
|
|
1340
1341
|
|
|
1341
1342
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
@@ -2606,10 +2607,7 @@ export default defineComponent({
|
|
|
2606
2607
|
delete rExpandLazyLoadedMaps[rowid]
|
|
2607
2608
|
}
|
|
2608
2609
|
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
2609
|
-
nextTick()
|
|
2610
|
-
.then(() => $xeTable.recalculate())
|
|
2611
|
-
.then(() => $xeTable.updateCellAreas())
|
|
2612
|
-
.then(() => resolve())
|
|
2610
|
+
nextTick().then(() => tableMethods.recalculate()).then(() => resolve())
|
|
2613
2611
|
})
|
|
2614
2612
|
} else {
|
|
2615
2613
|
resolve()
|
|
@@ -3091,7 +3089,6 @@ export default defineComponent({
|
|
|
3091
3089
|
}
|
|
3092
3090
|
|
|
3093
3091
|
const handleColumn = (collectColumn: VxeTableDefines.ColumnInfo[]) => {
|
|
3094
|
-
const expandOpts = computeExpandOpts.value
|
|
3095
3092
|
internalData.collectColumn = collectColumn
|
|
3096
3093
|
const tableFullColumn = getColumnList(collectColumn)
|
|
3097
3094
|
internalData.tableFullColumn = tableFullColumn
|
|
@@ -3101,7 +3098,6 @@ export default defineComponent({
|
|
|
3101
3098
|
return Promise.resolve(
|
|
3102
3099
|
restoreCustomStorage()
|
|
3103
3100
|
).then(() => {
|
|
3104
|
-
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
3105
3101
|
cacheColumnMap()
|
|
3106
3102
|
parseColumns(true).then(() => {
|
|
3107
3103
|
if (reactData.scrollXLoad) {
|
|
@@ -3111,11 +3107,11 @@ export default defineComponent({
|
|
|
3111
3107
|
$xeTable.clearMergeCells()
|
|
3112
3108
|
$xeTable.clearMergeFooterItems()
|
|
3113
3109
|
$xeTable.handleTableData(true)
|
|
3114
|
-
|
|
3115
|
-
if ((scrollXLoad || scrollYLoad) &&
|
|
3116
|
-
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3110
|
+
// if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
3111
|
+
// if ((reactData.scrollXLoad || reactData.scrollYLoad) && reactData.expandColumn) {
|
|
3112
|
+
// warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
3113
|
+
// }
|
|
3114
|
+
// }
|
|
3119
3115
|
return nextTick().then(() => {
|
|
3120
3116
|
if ($xeToolbar) {
|
|
3121
3117
|
$xeToolbar.syncUpdate({
|
|
@@ -3499,15 +3495,6 @@ export default defineComponent({
|
|
|
3499
3495
|
}
|
|
3500
3496
|
}
|
|
3501
3497
|
|
|
3502
|
-
const handleRowExpandScroll = () => {
|
|
3503
|
-
const { elemStore } = internalData
|
|
3504
|
-
const rowExpandEl = refRowExpandElem.value
|
|
3505
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
3506
|
-
if (rowExpandEl && bodyScrollElem) {
|
|
3507
|
-
rowExpandEl.scrollTop = bodyScrollElem.scrollTop
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
|
|
3511
3498
|
tableMethods = {
|
|
3512
3499
|
dispatchEvent,
|
|
3513
3500
|
/**
|
|
@@ -5224,14 +5211,14 @@ export default defineComponent({
|
|
|
5224
5211
|
* @param {Boolean} expanded 是否展开
|
|
5225
5212
|
*/
|
|
5226
5213
|
setRowExpand (rows, expanded) {
|
|
5227
|
-
const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn } = reactData
|
|
5214
|
+
const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn: column } = reactData
|
|
5228
5215
|
const { fullAllDataRowIdData } = internalData
|
|
5229
5216
|
let rExpandedMaps = { ...rowExpandedMaps }
|
|
5230
5217
|
const expandOpts = computeExpandOpts.value
|
|
5231
5218
|
const { reserve, lazy, accordion, toggleMethod } = expandOpts
|
|
5232
5219
|
const lazyRests: any[] = []
|
|
5233
|
-
const columnIndex =
|
|
5234
|
-
const $columnIndex =
|
|
5220
|
+
const columnIndex = tableMethods.getColumnIndex(column)
|
|
5221
|
+
const $columnIndex = tableMethods.getVMColumnIndex(column)
|
|
5235
5222
|
if (rows) {
|
|
5236
5223
|
if (!XEUtils.isArray(rows)) {
|
|
5237
5224
|
rows = [rows]
|
|
@@ -5241,7 +5228,7 @@ export default defineComponent({
|
|
|
5241
5228
|
rExpandedMaps = {}
|
|
5242
5229
|
rows = rows.slice(rows.length - 1, rows.length)
|
|
5243
5230
|
}
|
|
5244
|
-
const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column
|
|
5231
|
+
const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column, columnIndex, $columnIndex, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) })) : rows
|
|
5245
5232
|
if (expanded) {
|
|
5246
5233
|
validRows.forEach((row: any) => {
|
|
5247
5234
|
const rowid = getRowid($xeTable, row)
|
|
@@ -5264,19 +5251,11 @@ export default defineComponent({
|
|
|
5264
5251
|
})
|
|
5265
5252
|
}
|
|
5266
5253
|
if (reserve) {
|
|
5267
|
-
validRows.forEach((row) => handleRowExpandReserve(row, expanded))
|
|
5254
|
+
validRows.forEach((row: any) => handleRowExpandReserve(row, expanded))
|
|
5268
5255
|
}
|
|
5269
5256
|
}
|
|
5270
5257
|
reactData.rowExpandedMaps = rExpandedMaps
|
|
5271
|
-
return Promise.all(lazyRests)
|
|
5272
|
-
.then(() => $xeTable.recalculate())
|
|
5273
|
-
.then(() => {
|
|
5274
|
-
if (expandColumn) {
|
|
5275
|
-
updateRowExpandStyle()
|
|
5276
|
-
handleRowExpandScroll()
|
|
5277
|
-
}
|
|
5278
|
-
return $xeTable.updateCellAreas()
|
|
5279
|
-
})
|
|
5258
|
+
return Promise.all(lazyRests).then(() => tableMethods.recalculate())
|
|
5280
5259
|
},
|
|
5281
5260
|
/**
|
|
5282
5261
|
* 判断行是否为展开状态
|
|
@@ -5310,7 +5289,7 @@ export default defineComponent({
|
|
|
5310
5289
|
if (expList.length) {
|
|
5311
5290
|
tableMethods.recalculate()
|
|
5312
5291
|
}
|
|
5313
|
-
})
|
|
5292
|
+
})
|
|
5314
5293
|
},
|
|
5315
5294
|
clearRowExpandReserve () {
|
|
5316
5295
|
internalData.rowExpandedReserveRowMap = {}
|
|
@@ -5733,8 +5712,8 @@ export default defineComponent({
|
|
|
5733
5712
|
updateCellAreas () {
|
|
5734
5713
|
const { mouseConfig } = props
|
|
5735
5714
|
const mouseOpts = computeMouseOpts.value
|
|
5736
|
-
if (mouseConfig && mouseOpts.area && $xeTable.
|
|
5737
|
-
return $xeTable.
|
|
5715
|
+
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
5716
|
+
return $xeTable.handleRecalculateCellAreas()
|
|
5738
5717
|
}
|
|
5739
5718
|
return nextTick()
|
|
5740
5719
|
},
|
|
@@ -7405,7 +7384,7 @@ export default defineComponent({
|
|
|
7405
7384
|
vLen++
|
|
7406
7385
|
})
|
|
7407
7386
|
|
|
7408
|
-
const isSelected =
|
|
7387
|
+
const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length
|
|
7409
7388
|
const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
|
|
7410
7389
|
|
|
7411
7390
|
reactData.isAllSelected = isSelected
|
|
@@ -9067,7 +9046,7 @@ export default defineComponent({
|
|
|
9067
9046
|
updateScrollYStatus,
|
|
9068
9047
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
9069
9048
|
updateScrollXSpace () {
|
|
9070
|
-
const { isGroup, scrollXLoad
|
|
9049
|
+
const { isGroup, scrollXLoad } = reactData
|
|
9071
9050
|
const { visibleColumn, scrollXStore, elemStore, tableWidth } = internalData
|
|
9072
9051
|
const tableHeader = refTableHeader.value
|
|
9073
9052
|
const tableBody = refTableBody.value
|
|
@@ -9081,7 +9060,7 @@ export default defineComponent({
|
|
|
9081
9060
|
const footerElem = tableFooterElem ? tableFooterElem.querySelector('.vxe-table--footer') as HTMLTableElement : null
|
|
9082
9061
|
const leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce((previous, column) => previous + column.renderWidth, 0)
|
|
9083
9062
|
let marginLeft = ''
|
|
9084
|
-
if (scrollXLoad
|
|
9063
|
+
if (scrollXLoad) {
|
|
9085
9064
|
marginLeft = `${leftSpaceWidth}px`
|
|
9086
9065
|
}
|
|
9087
9066
|
if (headerElem) {
|
|
@@ -9909,8 +9888,7 @@ export default defineComponent({
|
|
|
9909
9888
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
|
|
9910
9889
|
}
|
|
9911
9890
|
loadTableData(value, true).then(() => {
|
|
9912
|
-
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
9913
|
-
const expandOpts = computeExpandOpts.value
|
|
9891
|
+
// const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
9914
9892
|
internalData.inited = true
|
|
9915
9893
|
internalData.initStatus = true
|
|
9916
9894
|
if (!initStatus) {
|
|
@@ -9921,9 +9899,9 @@ export default defineComponent({
|
|
|
9921
9899
|
// if (checkboxColumn && internalData.tableFullData.length > 300 && !checkboxOpts.checkField) {
|
|
9922
9900
|
// warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
|
|
9923
9901
|
// }
|
|
9924
|
-
if ((scrollXLoad || scrollYLoad) &&
|
|
9925
|
-
|
|
9926
|
-
}
|
|
9902
|
+
// if ((scrollXLoad || scrollYLoad) && expandColumn) {
|
|
9903
|
+
// warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
9904
|
+
// }
|
|
9927
9905
|
return tableMethods.recalculate()
|
|
9928
9906
|
})
|
|
9929
9907
|
})
|
|
@@ -9972,12 +9950,6 @@ export default defineComponent({
|
|
|
9972
9950
|
watch(() => props.showFooter, () => {
|
|
9973
9951
|
reScrollFlag.value++
|
|
9974
9952
|
})
|
|
9975
|
-
watch(() => reactData.overflowX, () => {
|
|
9976
|
-
reScrollFlag.value++
|
|
9977
|
-
})
|
|
9978
|
-
watch(() => reactData.overflowY, () => {
|
|
9979
|
-
reScrollFlag.value++
|
|
9980
|
-
})
|
|
9981
9953
|
watch(reScrollFlag, () => {
|
|
9982
9954
|
nextTick(() => {
|
|
9983
9955
|
tableMethods.recalculate(true).then(() => tableMethods.refreshScroll())
|