vxe-table 3.20.0-beta.11 → 3.20.0-beta.13
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/export/mixin.js +15 -1
- package/es/table/src/body.js +4 -4
- package/es/table/src/methods.js +14 -10
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +54 -2
- package/es/table/src/util.js +2 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +100 -17
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +18 -6
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/body.js +5 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +14 -10
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +66 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +2 -0
- 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 +1 -1
- package/packages/table/module/export/mixin.ts +13 -1
- package/packages/table/src/body.ts +4 -4
- package/packages/table/src/methods.ts +14 -10
- package/packages/table/src/props.ts +2 -0
- package/packages/table/src/table.ts +59 -1
- package/packages/table/src/util.ts +3 -0
- /package/es/{iconfont.1769072409708.ttf → iconfont.1769154717466.ttf} +0 -0
- /package/es/{iconfont.1769072409708.woff → iconfont.1769154717466.woff} +0 -0
- /package/es/{iconfont.1769072409708.woff2 → iconfont.1769154717466.woff2} +0 -0
- /package/lib/{iconfont.1769072409708.ttf → iconfont.1769154717466.ttf} +0 -0
- /package/lib/{iconfont.1769072409708.woff → iconfont.1769154717466.woff} +0 -0
- /package/lib/{iconfont.1769072409708.woff2 → iconfont.1769154717466.woff2} +0 -0
|
@@ -230,6 +230,7 @@ function handleCustomRestore ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
230
230
|
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' })
|
|
231
231
|
internalData.collectColumn = newCollectCols
|
|
232
232
|
internalData.tableFullColumn = getColumnList(newCollectCols)
|
|
233
|
+
reactData.updateColFlag++
|
|
233
234
|
}
|
|
234
235
|
reactData.isCustomStatus = true
|
|
235
236
|
} else {
|
|
@@ -3633,12 +3634,14 @@ function handleTableColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMetho
|
|
|
3633
3634
|
}
|
|
3634
3635
|
|
|
3635
3636
|
function handleUpdateColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
3637
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
3636
3638
|
const internalData = $xeTable as unknown as TableInternalData
|
|
3637
3639
|
|
|
3638
3640
|
const columnList = XEUtils.orderBy(internalData.collectColumn, 'renderSortNumber')
|
|
3639
3641
|
internalData.collectColumn = columnList
|
|
3640
|
-
const
|
|
3641
|
-
internalData.tableFullColumn =
|
|
3642
|
+
const tFullColumn = getColumnList(columnList)
|
|
3643
|
+
internalData.tableFullColumn = tFullColumn
|
|
3644
|
+
reactData.updateColFlag++
|
|
3642
3645
|
cacheColumnMap($xeTable)
|
|
3643
3646
|
}
|
|
3644
3647
|
|
|
@@ -3830,8 +3833,9 @@ function handleInitColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
|
|
|
3830
3833
|
|
|
3831
3834
|
const expandOpts = $xeTable.computeExpandOpts
|
|
3832
3835
|
internalData.collectColumn = collectColumn
|
|
3833
|
-
const
|
|
3834
|
-
internalData.tableFullColumn =
|
|
3836
|
+
const tFullColumn = getColumnList(collectColumn)
|
|
3837
|
+
internalData.tableFullColumn = tFullColumn
|
|
3838
|
+
reactData.updateColFlag++
|
|
3835
3839
|
reactData.isColLoading = true
|
|
3836
3840
|
initColumnHierarchy($xeTable)
|
|
3837
3841
|
return Promise.resolve(
|
|
@@ -5407,9 +5411,10 @@ const tableMethods: any = {
|
|
|
5407
5411
|
const props = $xeTable
|
|
5408
5412
|
const internalData = $xeTable as unknown as TableInternalData
|
|
5409
5413
|
|
|
5410
|
-
const { keepSource } = props
|
|
5411
|
-
const {
|
|
5412
|
-
|
|
5414
|
+
const { keepSource, editConfig } = props
|
|
5415
|
+
const { fullDataRowIdData, sourceDataRowIdData } = internalData
|
|
5416
|
+
const keepFields = $xeTable.computeKeepFields
|
|
5417
|
+
if (keepSource && editConfig) {
|
|
5413
5418
|
const rowid = XEUtils.isString(rowOrId) || XEUtils.isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId)
|
|
5414
5419
|
const rowRest = fullDataRowIdData[rowid]
|
|
5415
5420
|
// 新增的数据不需要检测
|
|
@@ -5422,9 +5427,8 @@ const tableMethods: any = {
|
|
|
5422
5427
|
if (arguments.length > 1) {
|
|
5423
5428
|
return !eqCellValue(oRow, row, field as string)
|
|
5424
5429
|
}
|
|
5425
|
-
for (let
|
|
5426
|
-
|
|
5427
|
-
if (property && !eqCellValue(oRow, row, property)) {
|
|
5430
|
+
for (let i = 0; i < keepFields.length; i++) {
|
|
5431
|
+
if (!eqCellValue(oRow, row, keepFields[i])) {
|
|
5428
5432
|
return true
|
|
5429
5433
|
}
|
|
5430
5434
|
}
|
|
@@ -270,6 +270,8 @@ export const tableProps = {
|
|
|
270
270
|
fnrConfig: Object,
|
|
271
271
|
// 编辑配置项
|
|
272
272
|
editConfig: [Boolean, Object] as PropType<VxeTablePropTypes.EditConfig>,
|
|
273
|
+
// 数据状态监听配置项
|
|
274
|
+
editDirtyConfig: Object as PropType<VxeTablePropTypes.EditDirtyConfig>,
|
|
273
275
|
// 校验配置项
|
|
274
276
|
validConfig: Object as PropType<VxeTablePropTypes.ValidConfig>,
|
|
275
277
|
// 校验规则配置项
|
|
@@ -557,6 +557,7 @@ export default {
|
|
|
557
557
|
reScrollFlag: 0,
|
|
558
558
|
reLayoutFlag: 0,
|
|
559
559
|
footFlag: 0,
|
|
560
|
+
kfFlag: 0,
|
|
560
561
|
mergeFooteCellFlag: 0,
|
|
561
562
|
crossTableDragRowInfo: crossTableDragRowGlobal
|
|
562
563
|
}
|
|
@@ -905,7 +906,16 @@ export default {
|
|
|
905
906
|
return this.computeEditOpts
|
|
906
907
|
},
|
|
907
908
|
computeEditOpts () {
|
|
908
|
-
|
|
909
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
910
|
+
const props = $xeTable
|
|
911
|
+
|
|
912
|
+
return Object.assign({}, getConfig().table.editConfig, props.editConfig)
|
|
913
|
+
},
|
|
914
|
+
computeEditDirtyOpts () {
|
|
915
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
916
|
+
const props = $xeTable
|
|
917
|
+
|
|
918
|
+
return Object.assign({}, getConfig().table.editDirtyConfig, props.editDirtyConfig)
|
|
909
919
|
},
|
|
910
920
|
sortOpts () {
|
|
911
921
|
return this.computeSortOpts
|
|
@@ -1267,6 +1277,36 @@ export default {
|
|
|
1267
1277
|
}
|
|
1268
1278
|
return false
|
|
1269
1279
|
},
|
|
1280
|
+
computeKeepFields () {
|
|
1281
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1282
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1283
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1284
|
+
|
|
1285
|
+
const { tableFullColumn } = internalData
|
|
1286
|
+
const { updateColFlag } = reactData
|
|
1287
|
+
const editDirtyOpts = $xeTable.computeEditDirtyOpts
|
|
1288
|
+
const { includeFields, excludeFields } = editDirtyOpts
|
|
1289
|
+
const kpFields: string[] = []
|
|
1290
|
+
if (updateColFlag) {
|
|
1291
|
+
if (includeFields && includeFields.length) {
|
|
1292
|
+
return includeFields
|
|
1293
|
+
}
|
|
1294
|
+
const exfMaps: Record<string, number> = {}
|
|
1295
|
+
if (excludeFields && excludeFields.length) {
|
|
1296
|
+
excludeFields.forEach(field => {
|
|
1297
|
+
exfMaps[field] = 1
|
|
1298
|
+
})
|
|
1299
|
+
}
|
|
1300
|
+
for (let i = 0; i < tableFullColumn.length; i++) {
|
|
1301
|
+
const column = tableFullColumn[i]
|
|
1302
|
+
const { field, type, editRender, cellRender } = column
|
|
1303
|
+
if (field && !type && (editRender || cellRender) && !exfMaps[field]) {
|
|
1304
|
+
kpFields.push(field)
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return kpFields
|
|
1309
|
+
},
|
|
1270
1310
|
computeTableBorder () {
|
|
1271
1311
|
const $xeTable = this
|
|
1272
1312
|
const props = $xeTable
|
|
@@ -1467,6 +1507,24 @@ export default {
|
|
|
1467
1507
|
$xeTable.updateFooter()
|
|
1468
1508
|
},
|
|
1469
1509
|
|
|
1510
|
+
updateColFlag () {
|
|
1511
|
+
this.kfFlag++
|
|
1512
|
+
},
|
|
1513
|
+
computeKeepFields () {
|
|
1514
|
+
this.kfFlag++
|
|
1515
|
+
},
|
|
1516
|
+
kfFlag () {
|
|
1517
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1518
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1519
|
+
|
|
1520
|
+
const keepFields = $xeTable.computeKeepFields
|
|
1521
|
+
const kpfMaps: Record<string, number> = {}
|
|
1522
|
+
keepFields.forEach(field => {
|
|
1523
|
+
kpfMaps[field] = 1
|
|
1524
|
+
})
|
|
1525
|
+
internalData.keepUpdateFieldMaps = kpfMaps
|
|
1526
|
+
},
|
|
1527
|
+
|
|
1470
1528
|
syncResize (value: any) {
|
|
1471
1529
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1472
1530
|
|
|
@@ -81,6 +81,8 @@ export function createInternalData (): TableInternalData {
|
|
|
81
81
|
// 数据集(仅可视)
|
|
82
82
|
visibleDataRowIdData: {},
|
|
83
83
|
|
|
84
|
+
keepUpdateFieldMaps: {},
|
|
85
|
+
|
|
84
86
|
footerFullDataRowData: {},
|
|
85
87
|
|
|
86
88
|
// 渲染中缓存数据
|
|
@@ -144,6 +146,7 @@ export function createInternalData (): TableInternalData {
|
|
|
144
146
|
|
|
145
147
|
export function createReactData (): TableReactData {
|
|
146
148
|
return {
|
|
149
|
+
updateColFlag: 0,
|
|
147
150
|
// 低性能的静态列
|
|
148
151
|
staticColumns: [],
|
|
149
152
|
// 渲染的列分组
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|