vxe-table 3.10.1 → 3.10.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/es/locale/lang/en-US.js +3 -2
- package/es/locale/lang/es-ES.js +3 -2
- package/es/locale/lang/hu-HU.js +3 -2
- package/es/locale/lang/ja-JP.js +3 -2
- package/es/locale/lang/ko-KR.js +3 -2
- package/es/locale/lang/pt-BR.js +3 -2
- package/es/locale/lang/ru-RU.js +3 -2
- package/es/locale/lang/uk-UA.js +3 -2
- package/es/locale/lang/vi-VN.js +3 -2
- package/es/locale/lang/zh-CHT.js +3 -2
- package/es/locale/lang/zh-CN.js +3 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +9 -4
- package/es/table/src/body.js +43 -24
- package/es/table/src/cell.js +65 -27
- package/es/table/src/column.js +3 -1
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/methods.js +211 -14
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +16 -1
- package/es/table/style.css +77 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +77 -2
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.umd.js +387 -78
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +3 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -2
- package/lib/locale/lang/es-ES.js +3 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +3 -2
- package/lib/locale/lang/hu-HU.js +3 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +3 -2
- package/lib/locale/lang/ja-JP.js +3 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +3 -2
- package/lib/locale/lang/ko-KR.js +3 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +3 -2
- package/lib/locale/lang/pt-BR.js +3 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +3 -2
- package/lib/locale/lang/ru-RU.js +3 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +3 -2
- package/lib/locale/lang/uk-UA.js +3 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +3 -2
- package/lib/locale/lang/vi-VN.js +3 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +3 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +3 -2
- package/lib/locale/lang/zh-CN.js +3 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +3 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +9 -4
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +41 -22
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +78 -27
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +227 -14
- 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 +15 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +77 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -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 +77 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +3 -2
- package/packages/locale/lang/es-ES.ts +3 -2
- package/packages/locale/lang/hu-HU.ts +3 -2
- package/packages/locale/lang/ja-JP.ts +3 -2
- package/packages/locale/lang/ko-KR.ts +3 -2
- package/packages/locale/lang/pt-BR.ts +3 -2
- package/packages/locale/lang/ru-RU.ts +3 -2
- package/packages/locale/lang/uk-UA.ts +3 -2
- package/packages/locale/lang/vi-VN.ts +3 -2
- package/packages/locale/lang/zh-CHT.ts +3 -2
- package/packages/locale/lang/zh-CN.ts +3 -2
- package/packages/table/module/custom/panel.ts +8 -8
- package/packages/table/module/edit/mixin.ts +10 -4
- package/packages/table/src/body.ts +43 -24
- package/packages/table/src/cell.ts +69 -27
- package/packages/table/src/column.ts +3 -1
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/methods.ts +227 -14
- package/packages/table/src/props.ts +2 -0
- package/packages/table/src/table.ts +16 -1
- package/packages/ui/index.ts +3 -0
- package/styles/components/table-module/custom.scss +14 -3
- package/styles/components/table.scss +80 -0
- /package/es/{iconfont.1730710763407.ttf → iconfont.1730898131844.ttf} +0 -0
- /package/es/{iconfont.1730710763407.woff → iconfont.1730898131844.woff} +0 -0
- /package/es/{iconfont.1730710763407.woff2 → iconfont.1730898131844.woff2} +0 -0
- /package/lib/{iconfont.1730710763407.ttf → iconfont.1730898131844.ttf} +0 -0
- /package/lib/{iconfont.1730710763407.woff → iconfont.1730898131844.woff} +0 -0
- /package/lib/{iconfont.1730710763407.woff2 → iconfont.1730898131844.woff2} +0 -0
|
@@ -71,7 +71,8 @@ export default {
|
|
|
71
71
|
customClose: '关闭',
|
|
72
72
|
customCancel: '取消',
|
|
73
73
|
customRestore: '恢复默认',
|
|
74
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
75
76
|
},
|
|
76
77
|
grid: {
|
|
77
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -122,7 +123,7 @@ export default {
|
|
|
122
123
|
cstmCancel: '取消',
|
|
123
124
|
cstmConfirm: '确定',
|
|
124
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
125
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
126
127
|
setting: {
|
|
127
128
|
colSort: '排序',
|
|
128
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -901,21 +901,21 @@ export default {
|
|
|
901
901
|
}
|
|
902
902
|
$xetable.checkCustomStatus()
|
|
903
903
|
},
|
|
904
|
-
sortMousedownEvent (evnt:
|
|
904
|
+
sortMousedownEvent (evnt: MouseEvent) {
|
|
905
905
|
const { $xetable } = this
|
|
906
|
-
const btnEl = evnt.currentTarget
|
|
907
|
-
const tdEl = btnEl.parentNode
|
|
908
|
-
const trEl = tdEl.parentNode
|
|
906
|
+
const btnEl = evnt.currentTarget as HTMLElement
|
|
907
|
+
const tdEl = btnEl.parentNode as HTMLElement
|
|
908
|
+
const trEl = tdEl.parentNode as HTMLElement
|
|
909
909
|
const colid = trEl.getAttribute('colid')
|
|
910
910
|
const column = $xetable.getColumnById(colid)
|
|
911
911
|
trEl.draggable = true
|
|
912
912
|
this.dragColumn = column
|
|
913
913
|
addClass(trEl, 'active--drag-origin')
|
|
914
914
|
},
|
|
915
|
-
sortMouseupEvent (evnt:
|
|
916
|
-
const btnEl = evnt.currentTarget
|
|
917
|
-
const tdEl = btnEl.parentNode
|
|
918
|
-
const trEl = tdEl.parentNode
|
|
915
|
+
sortMouseupEvent (evnt: MouseEvent) {
|
|
916
|
+
const btnEl = evnt.currentTarget as HTMLElement
|
|
917
|
+
const tdEl = btnEl.parentNode as HTMLElement
|
|
918
|
+
const trEl = tdEl.parentNode as HTMLElement
|
|
919
919
|
const dragHintEl = this.$refs.dragHintElemRef
|
|
920
920
|
trEl.draggable = false
|
|
921
921
|
this.dragColumn = null
|
|
@@ -547,9 +547,13 @@ export default {
|
|
|
547
547
|
* 清除激活的编辑
|
|
548
548
|
*/
|
|
549
549
|
_clearEdit (evnt: any) {
|
|
550
|
-
const
|
|
550
|
+
const $xeTable = this
|
|
551
|
+
const reactData = $xeTable
|
|
552
|
+
|
|
553
|
+
const { editStore } = reactData
|
|
551
554
|
const { actived, focused } = editStore
|
|
552
555
|
const { row, column } = actived
|
|
556
|
+
const validOpts = $xeTable.validOpts
|
|
553
557
|
if (row || column) {
|
|
554
558
|
this._syncActivedCell()
|
|
555
559
|
actived.args = null
|
|
@@ -567,9 +571,11 @@ export default {
|
|
|
567
571
|
}
|
|
568
572
|
focused.row = null
|
|
569
573
|
focused.column = null
|
|
570
|
-
if (
|
|
571
|
-
if (
|
|
572
|
-
|
|
574
|
+
if (validOpts.autoClear) {
|
|
575
|
+
if (validOpts.msgMode !== 'full' || getConfig().cellVaildMode === 'obsolete') {
|
|
576
|
+
if (this.clearValidate) {
|
|
577
|
+
return this.clearValidate()
|
|
578
|
+
}
|
|
573
579
|
}
|
|
574
580
|
}
|
|
575
581
|
return this.$nextTick()
|
|
@@ -299,7 +299,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
|
|
|
299
299
|
getClass(className, params),
|
|
300
300
|
getClass(allCellClassName, params)
|
|
301
301
|
],
|
|
302
|
-
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
302
|
+
key: columnKey || columnOpts.useKey || rowOpts.useKey ? column.id : $columnIndex,
|
|
303
303
|
attrs,
|
|
304
304
|
style: Object.assign({
|
|
305
305
|
height: cellHeight
|
|
@@ -308,7 +308,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
|
|
|
308
308
|
}, tdVNs)
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
function renderRows (h: CreateElement, _vm: any, $
|
|
311
|
+
function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any, tableData: any, tableColumn: any) {
|
|
312
312
|
const {
|
|
313
313
|
stripe,
|
|
314
314
|
rowKey,
|
|
@@ -332,35 +332,47 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
332
332
|
rowOpts,
|
|
333
333
|
pendingRowList,
|
|
334
334
|
pendingRowMaps
|
|
335
|
-
} = $
|
|
335
|
+
} = $xeTable
|
|
336
336
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
337
337
|
const rows: any[] = []
|
|
338
338
|
tableData.forEach((row: any, $rowIndex: any) => {
|
|
339
339
|
const trOn: any = {}
|
|
340
340
|
let rowIndex = $rowIndex
|
|
341
|
-
const _rowIndex = $
|
|
341
|
+
const _rowIndex = $xeTable.getVTRowIndex(row)
|
|
342
342
|
// 确保任何情况下 rowIndex 都精准指向真实 data 索引
|
|
343
|
-
rowIndex = $
|
|
344
|
-
//
|
|
343
|
+
rowIndex = $xeTable.getRowIndex(row)
|
|
344
|
+
// 当前行事件
|
|
345
345
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
346
346
|
trOn.mouseenter = (evnt: any) => {
|
|
347
|
-
if (isVMScrollProcess($
|
|
347
|
+
if (isVMScrollProcess($xeTable)) {
|
|
348
348
|
return
|
|
349
349
|
}
|
|
350
|
-
$
|
|
350
|
+
$xeTable.triggerHoverEvent(evnt, { row, rowIndex })
|
|
351
351
|
}
|
|
352
352
|
trOn.mouseleave = () => {
|
|
353
|
-
if (isVMScrollProcess($
|
|
353
|
+
if (isVMScrollProcess($xeTable)) {
|
|
354
354
|
return
|
|
355
355
|
}
|
|
356
|
-
$
|
|
356
|
+
$xeTable.clearHoverRow()
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
// 拖拽行事件
|
|
360
|
+
if (rowOpts.drag) {
|
|
361
|
+
trOn.dragstart = (evnt: DragEvent) => {
|
|
362
|
+
$xeTable.handleRowDragDragstartEvent(evnt)
|
|
363
|
+
}
|
|
364
|
+
trOn.dragover = (evnt: DragEvent) => {
|
|
365
|
+
$xeTable.handleRowDragDragoverEvent(evnt)
|
|
366
|
+
}
|
|
367
|
+
trOn.dragend = (evnt: DragEvent) => {
|
|
368
|
+
$xeTable.handleRowDragDragendEvent(evnt)
|
|
357
369
|
}
|
|
358
370
|
}
|
|
359
|
-
const rowid = getRowid($
|
|
371
|
+
const rowid = getRowid($xeTable, row)
|
|
360
372
|
const rest = fullAllDataRowIdData[rowid]
|
|
361
373
|
const rowLevel = rest ? rest.level : 0
|
|
362
374
|
const seq = rest ? rest.seq : -1
|
|
363
|
-
const params = { $table: $
|
|
375
|
+
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
|
|
364
376
|
// 行是否被展开
|
|
365
377
|
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
|
|
366
378
|
// 树节点是否被展开
|
|
@@ -369,7 +381,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
369
381
|
// 是否新增行
|
|
370
382
|
let isNewRow = false
|
|
371
383
|
if (editConfig) {
|
|
372
|
-
isNewRow = $
|
|
384
|
+
isNewRow = $xeTable.isInsertByRow(row)
|
|
373
385
|
}
|
|
374
386
|
if (treeConfig && !scrollYLoad && !treeOpts.transform) {
|
|
375
387
|
rowChildren = row[childrenField]
|
|
@@ -381,13 +393,13 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
381
393
|
'vxe-body--row',
|
|
382
394
|
treeConfig ? `row--level-${rowLevel}` : '',
|
|
383
395
|
{
|
|
384
|
-
'row--stripe': stripe && ($
|
|
396
|
+
'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
385
397
|
'is--new': isNewRow,
|
|
386
398
|
'is--expand-row': isExpandRow,
|
|
387
399
|
'is--expand-tree': isExpandTree,
|
|
388
400
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
389
|
-
'row--radio': radioOpts.highlight && $
|
|
390
|
-
'row--checked': checkboxOpts.highlight && $
|
|
401
|
+
'row--radio': radioOpts.highlight && $xeTable.selectRadioRow === row,
|
|
402
|
+
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
391
403
|
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
392
404
|
},
|
|
393
405
|
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
@@ -396,10 +408,10 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
396
408
|
rowid
|
|
397
409
|
},
|
|
398
410
|
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
399
|
-
key:
|
|
411
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
400
412
|
on: trOn
|
|
401
413
|
}, tableColumn.map((column: any, $columnIndex: any) => {
|
|
402
|
-
return renderColumn(h, _vm, $
|
|
414
|
+
return renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
403
415
|
}))
|
|
404
416
|
)
|
|
405
417
|
// 如果行被展开了
|
|
@@ -414,7 +426,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
414
426
|
}
|
|
415
427
|
const { showOverflow } = expandColumn
|
|
416
428
|
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
|
|
417
|
-
const expandParams = { $table: $
|
|
429
|
+
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
|
|
418
430
|
rows.push(
|
|
419
431
|
h('tr', {
|
|
420
432
|
class: ['vxe-body--expanded-row', {
|
|
@@ -449,7 +461,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
449
461
|
}
|
|
450
462
|
// 如果是树形表格
|
|
451
463
|
if (isExpandTree) {
|
|
452
|
-
rows.push(...renderRows(h, _vm, $
|
|
464
|
+
rows.push(...renderRows(h, _vm, $xeTable, fixedType, rowChildren, tableColumn))
|
|
453
465
|
}
|
|
454
466
|
})
|
|
455
467
|
return rows
|
|
@@ -501,7 +513,7 @@ export default {
|
|
|
501
513
|
},
|
|
502
514
|
render (this: any, h: CreateElement) {
|
|
503
515
|
const { _e, $parent: $xetable, fixedColumn, fixedType } = this
|
|
504
|
-
let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, expandColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts } = $xetable
|
|
516
|
+
let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, expandColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts, rowOpts, isDragRowMove } = $xetable
|
|
505
517
|
// 如果是使用优化模式
|
|
506
518
|
if (fixedType) {
|
|
507
519
|
// 如果存在展开行使用全量渲染
|
|
@@ -580,9 +592,16 @@ export default {
|
|
|
580
592
|
/**
|
|
581
593
|
* 内容
|
|
582
594
|
*/
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
595
|
+
rowOpts.drag
|
|
596
|
+
? h('transition-group', {
|
|
597
|
+
props: {
|
|
598
|
+
tag: 'tbody',
|
|
599
|
+
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
|
|
600
|
+
}
|
|
601
|
+
}, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
|
|
602
|
+
: h('tbody', {
|
|
603
|
+
ref: 'tbody'
|
|
604
|
+
}, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
|
|
586
605
|
]),
|
|
587
606
|
h('div', {
|
|
588
607
|
class: 'vxe-table--checkbox-range'
|
|
@@ -6,7 +6,7 @@ import { updateCellTitle } from '../../ui/src/dom'
|
|
|
6
6
|
import { createColumn, getRowid } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
9
|
-
const { getI18n, getIcon, renderer, formats } = VxeUI
|
|
9
|
+
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
|
|
10
10
|
|
|
11
11
|
function renderTitlePrefixIcon (h: CreateElement, params: any) {
|
|
12
12
|
const { $table, column } = params
|
|
@@ -48,6 +48,46 @@ function renderTitleSuffixIcon (h: CreateElement, params: any) {
|
|
|
48
48
|
: []
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
function renderCellDragIcon (h: CreateElement, params: any) {
|
|
52
|
+
const { $table } = params
|
|
53
|
+
const dragOpts = $table.computeDragOpts
|
|
54
|
+
const { rowDisabledMethod } = dragOpts
|
|
55
|
+
const isDisabled = rowDisabledMethod && rowDisabledMethod(params)
|
|
56
|
+
return h('span', {
|
|
57
|
+
key: 'dg',
|
|
58
|
+
class: ['vxe-cell--drag-handle', {
|
|
59
|
+
'is--disabled': isDisabled
|
|
60
|
+
}],
|
|
61
|
+
on: {
|
|
62
|
+
mousedown (evnt: DragEvent) {
|
|
63
|
+
if (!isDisabled) {
|
|
64
|
+
$table.handleCellDragMousedownEvent(evnt, params)
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
mouseup: $table.handleCellDragMouseupEvent
|
|
68
|
+
}
|
|
69
|
+
}, [
|
|
70
|
+
h('i', {
|
|
71
|
+
class: 'vxe-table-icon-drag-handle'
|
|
72
|
+
})
|
|
73
|
+
])
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
|
|
77
|
+
const { $table, column, row } = params
|
|
78
|
+
const { dragSort } = column
|
|
79
|
+
const vns: any[] = XEUtils.isArray(content) ? content : [content]
|
|
80
|
+
const rowOpts = $table.computeRowOpts
|
|
81
|
+
const dragOpts = $table.computeDragOpts
|
|
82
|
+
const { showRowIcon, rowVisibleMethod } = dragOpts
|
|
83
|
+
if (dragSort && rowOpts.drag && (showRowIcon && (!rowVisibleMethod || rowVisibleMethod({ row, column })))) {
|
|
84
|
+
vns.unshift(
|
|
85
|
+
renderCellDragIcon(h, params)
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
return vns
|
|
89
|
+
}
|
|
90
|
+
|
|
51
91
|
function renderTitleContent (h: CreateElement, params: any, content: any) {
|
|
52
92
|
const { $table, column } = params
|
|
53
93
|
const { type, showHeaderOverflow } = column
|
|
@@ -234,7 +274,7 @@ export const Cell = {
|
|
|
234
274
|
const { slots, editRender, cellRender } = column
|
|
235
275
|
const renderOpts = editRender || cellRender
|
|
236
276
|
if (slots && slots.default) {
|
|
237
|
-
return $table.callSlot(slots.default, params, h)
|
|
277
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
|
|
238
278
|
}
|
|
239
279
|
if (renderOpts) {
|
|
240
280
|
const compConf = renderer.get(renderOpts.name)
|
|
@@ -242,12 +282,12 @@ export const Cell = {
|
|
|
242
282
|
const rtCell = compConf ? (compConf.renderTableCell || compConf.renderCell) : null
|
|
243
283
|
const renderFn = editRender ? rtCell : rtDefault
|
|
244
284
|
if (renderFn) {
|
|
245
|
-
return getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)))
|
|
285
|
+
return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))))
|
|
246
286
|
}
|
|
247
287
|
}
|
|
248
288
|
const cellValue = $table.getCellLabel(row, column)
|
|
249
289
|
const cellPlaceholder = editRender ? editRender.placeholder : ''
|
|
250
|
-
return [
|
|
290
|
+
return renderCellBaseVNs(h, params, [
|
|
251
291
|
h('span', {
|
|
252
292
|
class: 'vxe-cell--label'
|
|
253
293
|
}, [
|
|
@@ -258,7 +298,7 @@ export const Cell = {
|
|
|
258
298
|
}, formatText(getFuncText(cellPlaceholder), 1))
|
|
259
299
|
: h('span', formatText(cellValue, 1))
|
|
260
300
|
])
|
|
261
|
-
]
|
|
301
|
+
])
|
|
262
302
|
},
|
|
263
303
|
renderTreeCell (h: CreateElement, params: any) {
|
|
264
304
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params))
|
|
@@ -348,11 +388,13 @@ export const Cell = {
|
|
|
348
388
|
const { treeConfig, seqOpts } = $table
|
|
349
389
|
const { slots } = column
|
|
350
390
|
if (slots && slots.default) {
|
|
351
|
-
return $table.callSlot(slots.default, params, h)
|
|
391
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
|
|
352
392
|
}
|
|
353
393
|
const { seq } = params
|
|
354
394
|
const seqMethod = seqOpts.seqMethod
|
|
355
|
-
return
|
|
395
|
+
return renderCellBaseVNs(h, params, [
|
|
396
|
+
h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
|
|
397
|
+
])
|
|
356
398
|
},
|
|
357
399
|
renderTreeIndexCell (h: CreateElement, params: any) {
|
|
358
400
|
return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params))
|
|
@@ -400,7 +442,7 @@ export const Cell = {
|
|
|
400
442
|
}
|
|
401
443
|
const radioParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible }
|
|
402
444
|
if (radioSlot) {
|
|
403
|
-
return $table.callSlot(radioSlot, radioParams, h)
|
|
445
|
+
return renderCellBaseVNs(h, params, $table.callSlot(radioSlot, radioParams, h))
|
|
404
446
|
}
|
|
405
447
|
const radioVNs = []
|
|
406
448
|
if (isVisible) {
|
|
@@ -417,7 +459,7 @@ export const Cell = {
|
|
|
417
459
|
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams, h) : XEUtils.get(row, labelField))
|
|
418
460
|
)
|
|
419
461
|
}
|
|
420
|
-
return [
|
|
462
|
+
return renderCellBaseVNs(h, params, [
|
|
421
463
|
h('span', {
|
|
422
464
|
class: ['vxe-cell--radio', {
|
|
423
465
|
'is--checked': isChecked,
|
|
@@ -425,7 +467,7 @@ export const Cell = {
|
|
|
425
467
|
}],
|
|
426
468
|
on
|
|
427
469
|
}, radioVNs)
|
|
428
|
-
]
|
|
470
|
+
])
|
|
429
471
|
},
|
|
430
472
|
renderTreeRadioCell (h: CreateElement, params: any) {
|
|
431
473
|
return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params))
|
|
@@ -518,7 +560,7 @@ export const Cell = {
|
|
|
518
560
|
}
|
|
519
561
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
520
562
|
if (checkboxSlot) {
|
|
521
|
-
return $table.callSlot(checkboxSlot, checkboxParams, h)
|
|
563
|
+
return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h))
|
|
522
564
|
}
|
|
523
565
|
const checkVNs = []
|
|
524
566
|
if (isVisible) {
|
|
@@ -535,7 +577,7 @@ export const Cell = {
|
|
|
535
577
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : XEUtils.get(row, labelField))
|
|
536
578
|
)
|
|
537
579
|
}
|
|
538
|
-
return [
|
|
580
|
+
return renderCellBaseVNs(h, params, [
|
|
539
581
|
h('span', {
|
|
540
582
|
class: ['vxe-cell--checkbox', {
|
|
541
583
|
'is--checked': isChecked,
|
|
@@ -545,7 +587,7 @@ export const Cell = {
|
|
|
545
587
|
}],
|
|
546
588
|
on
|
|
547
589
|
}, checkVNs)
|
|
548
|
-
]
|
|
590
|
+
])
|
|
549
591
|
},
|
|
550
592
|
renderTreeSelectionCell (h: CreateElement, params: any) {
|
|
551
593
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params))
|
|
@@ -582,7 +624,7 @@ export const Cell = {
|
|
|
582
624
|
}
|
|
583
625
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
|
|
584
626
|
if (checkboxSlot) {
|
|
585
|
-
return $table.callSlot(checkboxSlot, checkboxParams, h)
|
|
627
|
+
return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h))
|
|
586
628
|
}
|
|
587
629
|
const checkVNs = []
|
|
588
630
|
if (isVisible) {
|
|
@@ -599,7 +641,7 @@ export const Cell = {
|
|
|
599
641
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : XEUtils.get(row, labelField))
|
|
600
642
|
)
|
|
601
643
|
}
|
|
602
|
-
return [
|
|
644
|
+
return renderCellBaseVNs(h, params, [
|
|
603
645
|
h('span', {
|
|
604
646
|
class: ['vxe-cell--checkbox', {
|
|
605
647
|
'is--checked': isChecked,
|
|
@@ -609,7 +651,7 @@ export const Cell = {
|
|
|
609
651
|
}],
|
|
610
652
|
on
|
|
611
653
|
}, checkVNs)
|
|
612
|
-
]
|
|
654
|
+
])
|
|
613
655
|
},
|
|
614
656
|
renderTreeSelectionCellByProp (h: CreateElement, params: any) {
|
|
615
657
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params))
|
|
@@ -627,7 +669,7 @@ export const Cell = {
|
|
|
627
669
|
let isAceived = false
|
|
628
670
|
let isLazyLoading = false
|
|
629
671
|
if (slots && slots.icon) {
|
|
630
|
-
return $table.callSlot(slots.icon, params, h)
|
|
672
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.icon, params, h))
|
|
631
673
|
}
|
|
632
674
|
if (!isHidden) {
|
|
633
675
|
const rowid = getRowid($table, row)
|
|
@@ -636,7 +678,7 @@ export const Cell = {
|
|
|
636
678
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid]
|
|
637
679
|
}
|
|
638
680
|
}
|
|
639
|
-
return [
|
|
681
|
+
return renderCellBaseVNs(h, params, [
|
|
640
682
|
showIcon && (!visibleMethod || visibleMethod(params))
|
|
641
683
|
? h('span', {
|
|
642
684
|
class: ['vxe-table--expanded', {
|
|
@@ -652,13 +694,13 @@ export const Cell = {
|
|
|
652
694
|
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
|
|
653
695
|
})
|
|
654
696
|
])
|
|
655
|
-
:
|
|
697
|
+
: renderEmptyElement($table),
|
|
656
698
|
defaultSlot || labelField
|
|
657
699
|
? h('span', {
|
|
658
700
|
class: 'vxe-table--expand-label'
|
|
659
701
|
}, defaultSlot ? $table.callSlot(defaultSlot, params, h) : XEUtils.get(row, labelField))
|
|
660
|
-
:
|
|
661
|
-
]
|
|
702
|
+
: renderEmptyElement($table)
|
|
703
|
+
])
|
|
662
704
|
},
|
|
663
705
|
renderExpandData (h: CreateElement, params: any) {
|
|
664
706
|
const { $table, column } = params
|
|
@@ -683,16 +725,16 @@ export const Cell = {
|
|
|
683
725
|
const { $table, column } = params
|
|
684
726
|
const { slots } = column
|
|
685
727
|
if (slots && slots.default) {
|
|
686
|
-
return $table.callSlot(slots.default, params, h)
|
|
728
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
|
|
687
729
|
}
|
|
688
|
-
return [
|
|
730
|
+
return renderCellBaseVNs(h, params, [
|
|
689
731
|
h('span', {
|
|
690
732
|
class: 'vxe-cell--html',
|
|
691
733
|
domProps: {
|
|
692
734
|
innerHTML: getDefaultCellLabel(params)
|
|
693
735
|
}
|
|
694
736
|
})
|
|
695
|
-
]
|
|
737
|
+
])
|
|
696
738
|
},
|
|
697
739
|
renderTreeHTMLCell (h: CreateElement, params: any) {
|
|
698
740
|
return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params))
|
|
@@ -856,14 +898,14 @@ export const Cell = {
|
|
|
856
898
|
return []
|
|
857
899
|
}
|
|
858
900
|
if (slots && slots.default) {
|
|
859
|
-
return $table.callSlot(slots.default, cellParams, h)
|
|
901
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, cellParams, h))
|
|
860
902
|
}
|
|
861
903
|
if (formatter) {
|
|
862
|
-
return [
|
|
904
|
+
return renderCellBaseVNs(h, params, [
|
|
863
905
|
h('span', {
|
|
864
906
|
class: 'vxe-cell--label'
|
|
865
907
|
}, [getDefaultCellLabel(cellParams)])
|
|
866
|
-
]
|
|
908
|
+
])
|
|
867
909
|
}
|
|
868
910
|
return Cell.renderDefaultCell.call(_vm, h, cellParams)
|
|
869
911
|
}
|