vxe-table 3.13.0-beta.11 → 3.13.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/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/mixin.js +8 -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/methods.js +21 -50
- package/es/table/src/table.js +3 -13
- 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 -102
- 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/mixin.js +10 -1
- package/lib/table/module/edit/mixin.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/methods.js +21 -55
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +3 -17
- 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/mixin.ts +8 -1
- package/packages/table/render/index.ts +0 -10
- package/packages/table/src/body.ts +2 -5
- package/packages/table/src/cell.ts +1 -4
- package/packages/table/src/footer.ts +2 -5
- package/packages/table/src/header.ts +4 -7
- package/packages/table/src/methods.ts +23 -59
- package/packages/table/src/table.ts +3 -14
- 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.1739840910920.ttf → iconfont.1739506361723.ttf} +0 -0
- /package/es/{iconfont.1739840910920.woff → iconfont.1739506361723.woff} +0 -0
- /package/es/{iconfont.1739840910920.woff2 → iconfont.1739506361723.woff2} +0 -0
- /package/lib/{iconfont.1739840910920.ttf → iconfont.1739506361723.ttf} +0 -0
- /package/lib/{iconfont.1739840910920.woff → iconfont.1739506361723.woff} +0 -0
- /package/lib/{iconfont.1739840910920.woff2 → iconfont.1739506361723.woff2} +0 -0
|
@@ -309,7 +309,7 @@ export default {
|
|
|
309
309
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
310
310
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
311
311
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
312
|
-
const { isGroup,
|
|
312
|
+
const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
313
313
|
|
|
314
314
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
315
315
|
let isOptimizeMode = false
|
|
@@ -322,11 +322,8 @@ export default {
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
if (fixedType || !overflowX) {
|
|
326
|
-
renderColumnList = visibleColumn
|
|
327
|
-
}
|
|
328
|
-
|
|
329
325
|
if (fixedType) {
|
|
326
|
+
renderColumnList = visibleColumn
|
|
330
327
|
if (isOptimizeMode) {
|
|
331
328
|
renderColumnList = fixedColumn || []
|
|
332
329
|
}
|
|
@@ -116,8 +116,8 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
|
|
|
116
116
|
'is--sortable': column.sortable,
|
|
117
117
|
'col--filter': !!filters,
|
|
118
118
|
'is--filter-active': hasFilter,
|
|
119
|
-
'is--drag-active':
|
|
120
|
-
'is--drag-disabled':
|
|
119
|
+
'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
120
|
+
'is--drag-disabled': isDisabledDrag,
|
|
121
121
|
'col--current': currentColumn === column
|
|
122
122
|
}, getClass(headerClassName, cellParams), getClass(headerCellClassName, cellParams)],
|
|
123
123
|
attrs: thAttrs,
|
|
@@ -272,7 +272,7 @@ export default {
|
|
|
272
272
|
const { headerColumn } = this
|
|
273
273
|
|
|
274
274
|
const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
|
|
275
|
-
const { isGroup,
|
|
275
|
+
const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
276
276
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
277
277
|
|
|
278
278
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
@@ -292,11 +292,8 @@ export default {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
if (fixedType || !overflowX) {
|
|
296
|
-
renderColumnList = visibleColumn
|
|
297
|
-
}
|
|
298
|
-
|
|
299
295
|
if (fixedType) {
|
|
296
|
+
renderColumnList = visibleColumn
|
|
300
297
|
// 如果是使用优化模式
|
|
301
298
|
if (isOptimizeMode) {
|
|
302
299
|
renderColumnList = fixedColumn || []
|
|
@@ -190,7 +190,6 @@ function cacheColumnMap ($xeTable: VxeTableConstructor) {
|
|
|
190
190
|
const fullColumnIdData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnIdData = {}
|
|
191
191
|
const fullColumnFieldData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnFieldData = {}
|
|
192
192
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
193
|
-
const expandOpts = $xeTable.computeExpandOpts
|
|
194
193
|
const columnOpts = $xeTable.computeColumnOpts
|
|
195
194
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
196
195
|
const { isCrossDrag, isSelfToChildDrag } = columnDragOpts
|
|
@@ -278,8 +277,10 @@ function cacheColumnMap ($xeTable: VxeTableConstructor) {
|
|
|
278
277
|
tableFullColumn.forEach(handleFunc)
|
|
279
278
|
}
|
|
280
279
|
|
|
281
|
-
if (
|
|
282
|
-
|
|
280
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
281
|
+
if (expandColumn && mouseOpts.area) {
|
|
282
|
+
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
|
|
283
|
+
}
|
|
283
284
|
}
|
|
284
285
|
|
|
285
286
|
if (process.env.VUE_APP_VXE_ENV === 'developmeznt') {
|
|
@@ -316,10 +317,8 @@ const updateScrollYStatus = ($xeTable: VxeTableConstructor, fullData?: any[]) =>
|
|
|
316
317
|
}
|
|
317
318
|
|
|
318
319
|
function updateAfterListIndex ($xeTable: VxeTableConstructor) {
|
|
319
|
-
const props = $xeTable
|
|
320
320
|
const internalData = $xeTable as unknown as TableInternalData
|
|
321
321
|
|
|
322
|
-
const { treeConfig } = props
|
|
323
322
|
const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData
|
|
324
323
|
const fullMaps: Record<string, any> = {}
|
|
325
324
|
afterFullData.forEach((row, index) => {
|
|
@@ -327,9 +326,7 @@ function updateAfterListIndex ($xeTable: VxeTableConstructor) {
|
|
|
327
326
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
328
327
|
const seq = index + 1
|
|
329
328
|
if (rowRest) {
|
|
330
|
-
|
|
331
|
-
rowRest.seq = seq
|
|
332
|
-
}
|
|
329
|
+
rowRest.seq = seq
|
|
333
330
|
rowRest._index = index
|
|
334
331
|
} else {
|
|
335
332
|
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
@@ -1715,7 +1712,6 @@ function handleColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
|
|
|
1715
1712
|
const reactData = $xeTable as unknown as TableReactData
|
|
1716
1713
|
const internalData = $xeTable as unknown as TableInternalData
|
|
1717
1714
|
|
|
1718
|
-
const expandOpts = $xeTable.computeExpandOpts
|
|
1719
1715
|
internalData.collectColumn = collectColumn
|
|
1720
1716
|
const tableFullColumn = getColumnList(collectColumn)
|
|
1721
1717
|
internalData.tableFullColumn = tableFullColumn
|
|
@@ -1725,7 +1721,6 @@ function handleColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
|
|
|
1725
1721
|
return Promise.resolve(
|
|
1726
1722
|
restoreCustomStorage($xeTable)
|
|
1727
1723
|
).then(() => {
|
|
1728
|
-
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
1729
1724
|
cacheColumnMap($xeTable)
|
|
1730
1725
|
parseColumns($xeTable, true).then(() => {
|
|
1731
1726
|
if (reactData.scrollXLoad) {
|
|
@@ -1735,11 +1730,11 @@ function handleColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
|
|
|
1735
1730
|
$xeTable.clearMergeCells()
|
|
1736
1731
|
$xeTable.clearMergeFooterItems()
|
|
1737
1732
|
$xeTable.handleTableData(true)
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1733
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1734
|
+
if ((reactData.scrollXLoad || reactData.scrollYLoad) && reactData.expandColumn) {
|
|
1735
|
+
warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
1736
|
+
}
|
|
1741
1737
|
}
|
|
1742
|
-
|
|
1743
1738
|
return $xeTable.$nextTick().then(() => {
|
|
1744
1739
|
if ($xeToolbar) {
|
|
1745
1740
|
$xeToolbar.syncUpdate({
|
|
@@ -2025,17 +2020,6 @@ function updateRowExpandStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMe
|
|
|
2025
2020
|
}
|
|
2026
2021
|
}
|
|
2027
2022
|
|
|
2028
|
-
function handleRowExpandScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
2029
|
-
const internalData = $xeTable as unknown as TableInternalData
|
|
2030
|
-
|
|
2031
|
-
const { elemStore } = internalData
|
|
2032
|
-
const rowExpandEl = $xeTable.$refs.refRowExpandElem as HTMLDivElement
|
|
2033
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
2034
|
-
if (rowExpandEl && bodyScrollElem) {
|
|
2035
|
-
rowExpandEl.scrollTop = bodyScrollElem.scrollTop
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
2023
|
const Methods = {
|
|
2040
2024
|
callSlot (slotFunc: any, params: any, h: any, vNodes: any) {
|
|
2041
2025
|
if (slotFunc) {
|
|
@@ -5548,7 +5532,7 @@ const Methods = {
|
|
|
5548
5532
|
const isSelected = sLen >= vLen
|
|
5549
5533
|
const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
|
|
5550
5534
|
if (checkField) {
|
|
5551
|
-
XEUtils.
|
|
5535
|
+
XEUtils.get(row, checkField, isSelected)
|
|
5552
5536
|
}
|
|
5553
5537
|
if (isSelected) {
|
|
5554
5538
|
if (!checkField) {
|
|
@@ -5623,7 +5607,7 @@ const Methods = {
|
|
|
5623
5607
|
vLen++
|
|
5624
5608
|
})
|
|
5625
5609
|
|
|
5626
|
-
const isSelected =
|
|
5610
|
+
const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length
|
|
5627
5611
|
const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
|
|
5628
5612
|
|
|
5629
5613
|
reactData.isAllSelected = isSelected
|
|
@@ -7428,10 +7412,7 @@ const Methods = {
|
|
|
7428
7412
|
delete rExpandLazyLoadedMaps[rowid]
|
|
7429
7413
|
}
|
|
7430
7414
|
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
7431
|
-
$xeTable.$nextTick()
|
|
7432
|
-
.then(() => $xeTable.recalculate())
|
|
7433
|
-
.then(() => $xeTable.updateCellAreas())
|
|
7434
|
-
.then(() => resolve())
|
|
7415
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve())
|
|
7435
7416
|
})
|
|
7436
7417
|
} else {
|
|
7437
7418
|
resolve()
|
|
@@ -7446,14 +7427,12 @@ const Methods = {
|
|
|
7446
7427
|
* @param {Boolean} expanded 是否展开
|
|
7447
7428
|
*/
|
|
7448
7429
|
setRowExpand (rows: any, expanded: any) {
|
|
7449
|
-
const
|
|
7450
|
-
|
|
7451
|
-
const { rowExpandedMaps, fullAllDataRowIdData, rowExpandLazyLoadedMaps, expandOpts, expandColumn } = this
|
|
7430
|
+
const { rowExpandedMaps, fullAllDataRowIdData, rowExpandLazyLoadedMaps, expandOpts, expandColumn: column } = this
|
|
7452
7431
|
let rExpandedMaps = { ...rowExpandedMaps }
|
|
7453
7432
|
const { reserve, lazy, accordion, toggleMethod } = expandOpts
|
|
7454
7433
|
const lazyRests: any[] = []
|
|
7455
|
-
const columnIndex =
|
|
7456
|
-
const $columnIndex =
|
|
7434
|
+
const columnIndex = this.getColumnIndex(column)
|
|
7435
|
+
const $columnIndex = this.getVMColumnIndex(column)
|
|
7457
7436
|
if (rows) {
|
|
7458
7437
|
if (!XEUtils.isArray(rows)) {
|
|
7459
7438
|
rows = [rows]
|
|
@@ -7463,7 +7442,7 @@ const Methods = {
|
|
|
7463
7442
|
rExpandedMaps = {}
|
|
7464
7443
|
rows = rows.slice(rows.length - 1, rows.length)
|
|
7465
7444
|
}
|
|
7466
|
-
const validRows
|
|
7445
|
+
const validRows = toggleMethod ? rows.filter((row: any) => toggleMethod({ expanded, column, columnIndex, $columnIndex, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) })) : rows
|
|
7467
7446
|
if (expanded) {
|
|
7468
7447
|
validRows.forEach((row: any) => {
|
|
7469
7448
|
const rowid = getRowid(this, row)
|
|
@@ -7478,7 +7457,7 @@ const Methods = {
|
|
|
7478
7457
|
}
|
|
7479
7458
|
})
|
|
7480
7459
|
} else {
|
|
7481
|
-
validRows.forEach((item) => {
|
|
7460
|
+
validRows.forEach((item: any) => {
|
|
7482
7461
|
const rowid = getRowid(this, item)
|
|
7483
7462
|
if (rExpandedMaps[rowid]) {
|
|
7484
7463
|
delete rExpandedMaps[rowid]
|
|
@@ -7486,19 +7465,11 @@ const Methods = {
|
|
|
7486
7465
|
})
|
|
7487
7466
|
}
|
|
7488
7467
|
if (reserve) {
|
|
7489
|
-
validRows.forEach((row) => this.handleRowExpandReserve(row, expanded))
|
|
7468
|
+
validRows.forEach((row: any) => this.handleRowExpandReserve(row, expanded))
|
|
7490
7469
|
}
|
|
7491
7470
|
}
|
|
7492
7471
|
this.rowExpandedMaps = rExpandedMaps
|
|
7493
|
-
return Promise.all(lazyRests)
|
|
7494
|
-
.then(() => $xeTable.recalculate())
|
|
7495
|
-
.then(() => {
|
|
7496
|
-
if (expandColumn) {
|
|
7497
|
-
updateRowExpandStyle($xeTable)
|
|
7498
|
-
handleRowExpandScroll($xeTable)
|
|
7499
|
-
}
|
|
7500
|
-
return $xeTable.updateCellAreas()
|
|
7501
|
-
})
|
|
7472
|
+
return Promise.all(lazyRests).then(this.recalculate)
|
|
7502
7473
|
},
|
|
7503
7474
|
/**
|
|
7504
7475
|
* 判断行是否为展开状态
|
|
@@ -7520,8 +7491,6 @@ const Methods = {
|
|
|
7520
7491
|
* 手动清空展开行状态,数据会恢复成未展开的状态
|
|
7521
7492
|
*/
|
|
7522
7493
|
clearRowExpand () {
|
|
7523
|
-
const $xeTable = this
|
|
7524
|
-
|
|
7525
7494
|
const { expandOpts, tableFullData } = this
|
|
7526
7495
|
const { reserve } = expandOpts
|
|
7527
7496
|
const expList = this.getRowExpandRecords()
|
|
@@ -7533,7 +7502,7 @@ const Methods = {
|
|
|
7533
7502
|
if (expList.length) {
|
|
7534
7503
|
this.recalculate()
|
|
7535
7504
|
}
|
|
7536
|
-
})
|
|
7505
|
+
})
|
|
7537
7506
|
},
|
|
7538
7507
|
clearRowExpandReserve () {
|
|
7539
7508
|
this.rowExpandedReserveRowMap = {}
|
|
@@ -8841,15 +8810,10 @@ const Methods = {
|
|
|
8841
8810
|
}
|
|
8842
8811
|
},
|
|
8843
8812
|
updateCellAreas () {
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
const { mouseConfig } = props
|
|
8848
|
-
const mouseOpts = $xeTable.computeMouseOpts
|
|
8849
|
-
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
|
|
8850
|
-
return $xeTable.handleRecalculateCellAreaEvent()
|
|
8813
|
+
if (this.mouseConfig && this.mouseOpts.area && this.handleRecalculateCellAreas) {
|
|
8814
|
+
return this.handleRecalculateCellAreas()
|
|
8851
8815
|
}
|
|
8852
|
-
return
|
|
8816
|
+
return this.$nextTick()
|
|
8853
8817
|
},
|
|
8854
8818
|
dispatchEvent (type: ValueOf<VxeTableEmits>, params: Record<string, any>, evnt: Event | null) {
|
|
8855
8819
|
const $xeTable = this
|
|
@@ -1180,16 +1180,11 @@ export default {
|
|
|
1180
1180
|
} as any,
|
|
1181
1181
|
watch: {
|
|
1182
1182
|
data (value: any) {
|
|
1183
|
-
const $xeTable = this
|
|
1184
|
-
const reactData = $xeTable
|
|
1185
|
-
|
|
1186
1183
|
const { initStatus } = this
|
|
1187
1184
|
if (value && value.length >= 50000) {
|
|
1188
1185
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
|
|
1189
1186
|
}
|
|
1190
1187
|
this.loadTableData(value || [], true).then(() => {
|
|
1191
|
-
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
1192
|
-
const expandOpts = $xeTable.computeExpandOpts
|
|
1193
1188
|
this.inited = true
|
|
1194
1189
|
this.initStatus = true
|
|
1195
1190
|
if (!initStatus) {
|
|
@@ -1199,9 +1194,9 @@ export default {
|
|
|
1199
1194
|
// if (checkboxColumn && this.tableFullData.length > 300 && !this.checkboxOpts.checkField) {
|
|
1200
1195
|
// warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
|
|
1201
1196
|
// }
|
|
1202
|
-
if ((scrollXLoad || scrollYLoad) &&
|
|
1203
|
-
|
|
1204
|
-
}
|
|
1197
|
+
// if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
|
|
1198
|
+
// warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
1199
|
+
// }
|
|
1205
1200
|
this.recalculate()
|
|
1206
1201
|
})
|
|
1207
1202
|
},
|
|
@@ -1227,12 +1222,6 @@ export default {
|
|
|
1227
1222
|
showFooter () {
|
|
1228
1223
|
this.reScrollFlag++
|
|
1229
1224
|
},
|
|
1230
|
-
overflowX () {
|
|
1231
|
-
this.reScrollFlag++
|
|
1232
|
-
},
|
|
1233
|
-
overflowY () {
|
|
1234
|
-
this.reScrollFlag++
|
|
1235
|
-
},
|
|
1236
1225
|
reScrollFlag () {
|
|
1237
1226
|
const $xeTable = this
|
|
1238
1227
|
|