vxe-table 3.7.0-beta.0 → 3.7.0-beta.3
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/helper/vetur/attributes.json +61 -17
- package/helper/vetur/tags.json +12 -1
- package/lib/export/src/mixin.js +22 -12
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +47 -17
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +23 -3
- package/lib/table/src/methods.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/export/src/mixin.js +20 -12
- package/packages/table/src/methods.js +22 -3
- package/types/export.d.ts +1 -0
- package/types/table.d.ts +1 -0
- /package/lib/icon/style/{iconfont.1688918886373.ttf → iconfont.1689121415913.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1688918886373.woff → iconfont.1689121415913.woff} +0 -0
- /package/lib/icon/style/{iconfont.1688918886373.woff2 → iconfont.1689121415913.woff2} +0 -0
- /package/lib/{iconfont.1688918886373.ttf → iconfont.1689121415913.ttf} +0 -0
- /package/lib/{iconfont.1688918886373.woff → iconfont.1689121415913.woff} +0 -0
- /package/lib/{iconfont.1688918886373.woff2 → iconfont.1689121415913.woff2} +0 -0
|
@@ -77,7 +77,7 @@ function toBooleanValue (cellValue) {
|
|
|
77
77
|
|
|
78
78
|
function getLabelData ($xetable, opts, columns, datas) {
|
|
79
79
|
const { isAllExpand, mode } = opts
|
|
80
|
-
const { treeConfig, treeOpts, radioOpts, checkboxOpts } = $xetable
|
|
80
|
+
const { treeConfig, treeOpts, radioOpts, checkboxOpts, columnOpts } = $xetable
|
|
81
81
|
if (!htmlCellElem) {
|
|
82
82
|
htmlCellElem = document.createElement('div')
|
|
83
83
|
}
|
|
@@ -99,15 +99,18 @@ function getLabelData ($xetable, opts, columns, datas) {
|
|
|
99
99
|
columns.forEach((column, $columnIndex) => {
|
|
100
100
|
let cellValue = ''
|
|
101
101
|
const renderOpts = column.editRender || column.cellRender
|
|
102
|
-
let
|
|
103
|
-
if (!
|
|
102
|
+
let bodyExportMethod = column.exportMethod
|
|
103
|
+
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
104
104
|
const compConf = VXETable.renderer.get(renderOpts.name)
|
|
105
105
|
if (compConf) {
|
|
106
|
-
|
|
106
|
+
bodyExportMethod = compConf.exportMethod || compConf.cellExportMethod
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
109
|
+
if (!bodyExportMethod) {
|
|
110
|
+
bodyExportMethod = columnOpts.exportMethod
|
|
111
|
+
}
|
|
112
|
+
if (bodyExportMethod) {
|
|
113
|
+
cellValue = bodyExportMethod({ $table: $xetable, row, column, options: opts })
|
|
111
114
|
} else {
|
|
112
115
|
switch (column.type) {
|
|
113
116
|
case 'seq':
|
|
@@ -216,21 +219,26 @@ function getBooleanValue (cellValue) {
|
|
|
216
219
|
}
|
|
217
220
|
|
|
218
221
|
function getHeaderTitle ($xetable, opts, column) {
|
|
219
|
-
const {
|
|
220
|
-
|
|
222
|
+
const { columnOpts } = $xetable
|
|
223
|
+
const headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod
|
|
224
|
+
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xetable }) : ((opts.original ? column.property : column.getTitle()) || '')
|
|
221
225
|
}
|
|
222
226
|
|
|
223
227
|
function getFooterCellValue ($xetable, opts, items, column) {
|
|
228
|
+
const { columnOpts } = $xetable
|
|
224
229
|
const renderOpts = column.editRender || column.cellRender
|
|
225
|
-
let
|
|
226
|
-
if (!
|
|
230
|
+
let footLabelMethod = column.footerExportMethod
|
|
231
|
+
if (!footLabelMethod && renderOpts && renderOpts.name) {
|
|
227
232
|
const compConf = VXETable.renderer.get(renderOpts.name)
|
|
228
233
|
if (compConf) {
|
|
229
|
-
|
|
234
|
+
footLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod
|
|
230
235
|
}
|
|
231
236
|
}
|
|
237
|
+
if (!footLabelMethod) {
|
|
238
|
+
footLabelMethod = columnOpts.footerExportMethod
|
|
239
|
+
}
|
|
232
240
|
const _columnIndex = $xetable.getVTColumnIndex(column)
|
|
233
|
-
const cellValue =
|
|
241
|
+
const cellValue = footLabelMethod ? footLabelMethod({ $table: $xetable, items, itemIndex: _columnIndex, _columnIndex, column, options: opts }) : XEUtils.toValueString(items[_columnIndex])
|
|
234
242
|
return cellValue
|
|
235
243
|
}
|
|
236
244
|
|
|
@@ -590,8 +590,8 @@ const Methods = {
|
|
|
590
590
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
591
591
|
*/
|
|
592
592
|
cacheRowMap (source) {
|
|
593
|
-
const { treeConfig, treeOpts, tableFullData, fullDataRowMap, fullAllDataRowMap, tableFullTreeData } = this
|
|
594
|
-
let { fullDataRowIdData, fullAllDataRowIdData } = this
|
|
593
|
+
const { treeConfig, treeOpts, tableFullData, fullDataRowMap, fullAllDataRowMap, tableFullTreeData, tableSourceData } = this
|
|
594
|
+
let { fullDataRowIdData, fullAllDataRowIdData, sourceDataRowIdData } = this
|
|
595
595
|
const rowkey = getRowkey(this)
|
|
596
596
|
const isLazy = treeConfig && treeOpts.lazy
|
|
597
597
|
const handleCache = (row, index, items, path, parent, nodes) => {
|
|
@@ -618,12 +618,31 @@ const Methods = {
|
|
|
618
618
|
fullDataRowMap.clear()
|
|
619
619
|
}
|
|
620
620
|
fullAllDataRowIdData = this.fullAllDataRowIdData = {}
|
|
621
|
+
sourceDataRowIdData = this.sourceDataRowIdData = {}
|
|
621
622
|
fullAllDataRowMap.clear()
|
|
622
623
|
if (treeConfig) {
|
|
623
624
|
XEUtils.eachTree(tableFullTreeData, handleCache, treeOpts)
|
|
624
625
|
} else {
|
|
625
626
|
tableFullData.forEach(handleCache)
|
|
626
627
|
}
|
|
628
|
+
|
|
629
|
+
const handleSourceRow = (row) => {
|
|
630
|
+
let rowid = getRowid(this, row)
|
|
631
|
+
if (eqEmptyValue(rowid)) {
|
|
632
|
+
rowid = getRowUniqueId()
|
|
633
|
+
XEUtils.set(row, rowkey, rowid)
|
|
634
|
+
}
|
|
635
|
+
sourceDataRowIdData[rowid] = {
|
|
636
|
+
row,
|
|
637
|
+
rowid
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
// 源数据缓存
|
|
641
|
+
if (treeConfig && !treeOpts.transform) {
|
|
642
|
+
XEUtils.eachTree(tableSourceData, handleSourceRow, treeOpts)
|
|
643
|
+
} else {
|
|
644
|
+
tableSourceData.forEach(handleSourceRow)
|
|
645
|
+
}
|
|
627
646
|
},
|
|
628
647
|
loadTreeChildren (row, childRecords) {
|
|
629
648
|
const { keepSource, tableSourceData, treeOpts, fullDataRowIdData, fullDataRowMap, fullAllDataRowMap, fullAllDataRowIdData } = this
|
|
@@ -1460,7 +1479,7 @@ const Methods = {
|
|
|
1460
1479
|
*/
|
|
1461
1480
|
showColumn (fieldOrColumn) {
|
|
1462
1481
|
const column = handleFieldOrColumn(this, fieldOrColumn)
|
|
1463
|
-
if (column
|
|
1482
|
+
if (column && column.visible) {
|
|
1464
1483
|
column.visible = true
|
|
1465
1484
|
return this.handleCustom()
|
|
1466
1485
|
}
|
package/types/export.d.ts
CHANGED
|
@@ -231,6 +231,7 @@ export interface ColumnExportCellRenderParams extends GridRenderParams {
|
|
|
231
231
|
|
|
232
232
|
export interface ColumnExportHeaderRenderParams extends GridRenderParams {
|
|
233
233
|
column: ColumnInfo;
|
|
234
|
+
options: ExportParams;
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
export interface ColumnExportFooterRenderParams extends GridRenderParams {
|
package/types/table.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|