vxe-table 3.14.0-beta.20 → 3.14.0-beta.21
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/style.css +1 -1
- package/es/table/module/edit/mixin.js +14 -9
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/src/body.js +10 -10
- package/es/table/src/cell.js +15 -11
- package/es/table/src/methods.js +509 -458
- package/es/table/src/table.js +46 -26
- package/es/table/src/util.js +2 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +761 -670
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +16 -11
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/body.js +16 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +22 -13
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +623 -559
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +51 -25
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +2 -2
- package/lib/table/src/util.min.js +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/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +17 -12
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/src/body.ts +10 -10
- package/packages/table/src/cell.ts +15 -11
- package/packages/table/src/methods.ts +559 -481
- package/packages/table/src/table.ts +53 -31
- package/packages/table/src/util.ts +2 -2
- /package/es/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/es/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
- /package/es/{iconfont.1742353673989.woff2 → iconfont.1742437924038.woff2} +0 -0
- /package/lib/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/lib/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
- /package/lib/{iconfont.1742353673989.woff2 → iconfont.1742437924038.woff2} +0 -0
|
@@ -2,7 +2,7 @@ import { CreateElement } from 'vue'
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { getFuncText, isEnableConf } from '../../ui/src/utils'
|
|
4
4
|
import { initTpImg } from '../../ui/src/dom'
|
|
5
|
-
import {
|
|
5
|
+
import { createHandleGetRowId } from './util'
|
|
6
6
|
import { VxeUI } from '../../ui'
|
|
7
7
|
import methods from './methods'
|
|
8
8
|
import TableBodyComponent from './body'
|
|
@@ -209,6 +209,7 @@ function renderRowExpandedVNs (h: CreateElement, $xeTable: VxeTableConstructor &
|
|
|
209
209
|
]
|
|
210
210
|
|
|
211
211
|
if (expandColumn) {
|
|
212
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
212
213
|
tableRowExpandedList.forEach((row) => {
|
|
213
214
|
const expandOpts = $xeTable.computeExpandOpts
|
|
214
215
|
const { height: expandHeight, padding } = expandOpts
|
|
@@ -216,7 +217,7 @@ function renderRowExpandedVNs (h: CreateElement, $xeTable: VxeTableConstructor &
|
|
|
216
217
|
const treeOpts = $xeTable.computeTreeOpts
|
|
217
218
|
const { transform, seqMode } = treeOpts
|
|
218
219
|
const cellStyle: Record<string, string> = {}
|
|
219
|
-
const rowid =
|
|
220
|
+
const rowid = handleGetRowId(row)
|
|
220
221
|
const rest = fullAllDataRowIdData[rowid]
|
|
221
222
|
let rowLevel = 0
|
|
222
223
|
let seq: string | number = -1
|
|
@@ -471,8 +472,6 @@ export default {
|
|
|
471
472
|
isAllSelected: false,
|
|
472
473
|
// 复选框属性,有选中且非全选状态
|
|
473
474
|
isIndeterminate: false,
|
|
474
|
-
// 复选框属性,已选中的行集合
|
|
475
|
-
selectCheckboxMaps: {},
|
|
476
475
|
// 当前行
|
|
477
476
|
currentRow: null,
|
|
478
477
|
// 单选框属性,选中列
|
|
@@ -486,16 +485,6 @@ export default {
|
|
|
486
485
|
hasFixedColumn: false,
|
|
487
486
|
// 树节点列信息
|
|
488
487
|
treeNodeColumn: null,
|
|
489
|
-
// 已展开的行集合
|
|
490
|
-
rowExpandedMaps: {},
|
|
491
|
-
// 懒加载中的展开行的集合
|
|
492
|
-
rowExpandLazyLoadedMaps: {},
|
|
493
|
-
// 已展开树节点集合
|
|
494
|
-
treeExpandedMaps: {},
|
|
495
|
-
// 懒加载中的树节点的集合
|
|
496
|
-
treeExpandLazyLoadedMaps: {},
|
|
497
|
-
// 树节点不确定状态的集合
|
|
498
|
-
treeIndeterminateMaps: {},
|
|
499
488
|
// 合并单元格的对象集
|
|
500
489
|
mergeList: [],
|
|
501
490
|
// 合并表尾数据的对象集
|
|
@@ -512,8 +501,6 @@ export default {
|
|
|
512
501
|
upDataFlag: 0,
|
|
513
502
|
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
514
503
|
reColumnFlag: 0,
|
|
515
|
-
// 已标记的对象集
|
|
516
|
-
pendingRowMaps: {},
|
|
517
504
|
// 自定义列相关的信息
|
|
518
505
|
customStore: {
|
|
519
506
|
btnEl: null,
|
|
@@ -649,6 +636,11 @@ export default {
|
|
|
649
636
|
isFooter: false
|
|
650
637
|
},
|
|
651
638
|
|
|
639
|
+
rowExpandedFlag: 1,
|
|
640
|
+
treeExpandedFlag: 1,
|
|
641
|
+
updateCheckboxFlag: 1,
|
|
642
|
+
pendingRowFlag: 1,
|
|
643
|
+
|
|
652
644
|
rowHeightStore: {
|
|
653
645
|
default: 48,
|
|
654
646
|
medium: 44,
|
|
@@ -774,13 +766,13 @@ export default {
|
|
|
774
766
|
return this.computeRowHeightMaps
|
|
775
767
|
},
|
|
776
768
|
computeRowHeightMaps () {
|
|
777
|
-
const $xeTable = this
|
|
778
|
-
const reactData = $xeTable as TableReactData
|
|
769
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
770
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
779
771
|
|
|
780
772
|
return reactData.rowHeightStore
|
|
781
773
|
},
|
|
782
774
|
computeDefaultRowHeight () {
|
|
783
|
-
const $xeTable = this
|
|
775
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
784
776
|
|
|
785
777
|
const vSize = $xeTable.computeSize
|
|
786
778
|
const rowHeightMaps = $xeTable.computeRowHeightMaps
|
|
@@ -790,13 +782,13 @@ export default {
|
|
|
790
782
|
return this.computeColumnOpts
|
|
791
783
|
},
|
|
792
784
|
computeColumnOpts () {
|
|
793
|
-
const $xeTable = this
|
|
785
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
794
786
|
const props = $xeTable
|
|
795
787
|
|
|
796
788
|
return Object.assign({}, getConfig().table.columnConfig, props.columnConfig)
|
|
797
789
|
},
|
|
798
790
|
computeCurrentColumnOpts () {
|
|
799
|
-
const $xeTable = this
|
|
791
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
800
792
|
const props = $xeTable
|
|
801
793
|
|
|
802
794
|
return Object.assign({}, getConfig().table.currentColumnConfig, props.currentColumnConfig)
|
|
@@ -805,19 +797,31 @@ export default {
|
|
|
805
797
|
const $xeTable = this
|
|
806
798
|
const props = $xeTable
|
|
807
799
|
|
|
808
|
-
|
|
800
|
+
const cellOpts = Object.assign({}, getConfig().table.cellConfig, props.cellConfig)
|
|
801
|
+
if (cellOpts.height) {
|
|
802
|
+
cellOpts.height = XEUtils.toNumber(cellOpts.height)
|
|
803
|
+
}
|
|
804
|
+
return cellOpts
|
|
809
805
|
},
|
|
810
806
|
computeHeaderCellOpts () {
|
|
811
807
|
const $xeTable = this
|
|
812
808
|
const props = $xeTable
|
|
813
809
|
|
|
814
|
-
|
|
810
|
+
const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig)
|
|
811
|
+
if (headerCellOpts.height) {
|
|
812
|
+
headerCellOpts.height = XEUtils.toNumber(headerCellOpts.height)
|
|
813
|
+
}
|
|
814
|
+
return headerCellOpts
|
|
815
815
|
},
|
|
816
816
|
computeFooterCellOpts () {
|
|
817
817
|
const $xeTable = this
|
|
818
818
|
const props = $xeTable
|
|
819
819
|
|
|
820
|
-
|
|
820
|
+
const footerCellOpts = Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig)
|
|
821
|
+
if (footerCellOpts.height) {
|
|
822
|
+
footerCellOpts.height = XEUtils.toNumber(footerCellOpts.height)
|
|
823
|
+
}
|
|
824
|
+
return footerCellOpts
|
|
821
825
|
},
|
|
822
826
|
rowOpts () {
|
|
823
827
|
return this.computeRowOpts
|
|
@@ -1101,13 +1105,16 @@ export default {
|
|
|
1101
1105
|
computeTableRowExpandedList () {
|
|
1102
1106
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1103
1107
|
const reactData = $xeTable as unknown as TableReactData
|
|
1108
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1104
1109
|
|
|
1105
|
-
const {
|
|
1110
|
+
const { rowExpandedFlag, tableData, expandColumn } = reactData
|
|
1111
|
+
const { rowExpandedMaps } = internalData
|
|
1112
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
1106
1113
|
const expandList: any[] = []
|
|
1107
|
-
if (expandColumn) {
|
|
1114
|
+
if (expandColumn && rowExpandedFlag) {
|
|
1108
1115
|
const rowKeys: Record<string, boolean> = {}
|
|
1109
1116
|
tableData.forEach(row => {
|
|
1110
|
-
rowKeys[
|
|
1117
|
+
rowKeys[handleGetRowId(row)] = true
|
|
1111
1118
|
})
|
|
1112
1119
|
XEUtils.each(rowExpandedMaps, (row, rowid) => {
|
|
1113
1120
|
if (rowKeys[rowid]) {
|
|
@@ -1360,13 +1367,15 @@ export default {
|
|
|
1360
1367
|
lastScrollTop: 0,
|
|
1361
1368
|
// 单选框属性,已选中保留的行
|
|
1362
1369
|
radioReserveRow: null,
|
|
1363
|
-
//
|
|
1370
|
+
// 复选框属性,已选中保留的行集合
|
|
1364
1371
|
checkboxReserveRowMap: {},
|
|
1365
|
-
//
|
|
1372
|
+
// 行数据,已展开保留的行集合
|
|
1366
1373
|
rowExpandedReserveRowMap: {},
|
|
1367
|
-
//
|
|
1374
|
+
// 树结构数据,已展开保留的行集合
|
|
1368
1375
|
treeExpandedReserveRowMap: {},
|
|
1369
|
-
//
|
|
1376
|
+
// 树结构数据,不确定状态的集合
|
|
1377
|
+
treeIndeterminateRowMaps: {},
|
|
1378
|
+
// 列表完整数据、条件处理后
|
|
1370
1379
|
tableFullData: [],
|
|
1371
1380
|
afterFullData: [],
|
|
1372
1381
|
// 列表条件处理后数据集合
|
|
@@ -1385,6 +1394,19 @@ export default {
|
|
|
1385
1394
|
fullColumnIdData: {},
|
|
1386
1395
|
fullColumnFieldData: {},
|
|
1387
1396
|
|
|
1397
|
+
// 已展开的行集合
|
|
1398
|
+
rowExpandedMaps: {},
|
|
1399
|
+
// 懒加载中的展开行的集合
|
|
1400
|
+
rowExpandLazyLoadedMaps: {},
|
|
1401
|
+
// 已展开树节点集合
|
|
1402
|
+
treeExpandedMaps: {},
|
|
1403
|
+
// 懒加载中的树节点的集合
|
|
1404
|
+
treeExpandLazyLoadedMaps: {},
|
|
1405
|
+
// 复选框属性,已选中的行集合
|
|
1406
|
+
selectCheckboxMaps: {},
|
|
1407
|
+
// 已标记的对象集
|
|
1408
|
+
pendingRowMaps: {},
|
|
1409
|
+
|
|
1388
1410
|
swYSize: 0,
|
|
1389
1411
|
swYInterval: 0,
|
|
1390
1412
|
swYTotal: 0
|
|
@@ -122,7 +122,7 @@ export function createHandleUpdateRowId ($xeTable: VxeTableConstructor) {
|
|
|
122
122
|
return {
|
|
123
123
|
rowKey,
|
|
124
124
|
handleUpdateRowId (row: any) {
|
|
125
|
-
return updateRId(row, rowKey)
|
|
125
|
+
return row ? updateRId(row, rowKey) : null
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -134,7 +134,7 @@ export function createHandleGetRowId ($xeTable: VxeTableConstructor) {
|
|
|
134
134
|
return {
|
|
135
135
|
rowKey,
|
|
136
136
|
handleGetRowId (row: any) {
|
|
137
|
-
return getRId(row, rowKey)
|
|
137
|
+
return row ? getRId(row, rowKey) : null
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|