vxe-table 3.10.16 → 3.11.1
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/README.md +1 -1
- package/es/locale/lang/en-US.js +1 -0
- package/es/locale/lang/es-ES.js +1 -0
- package/es/locale/lang/hu-HU.js +1 -0
- package/es/locale/lang/ja-JP.js +1 -0
- package/es/locale/lang/ko-KR.js +1 -0
- package/es/locale/lang/pt-BR.js +1 -0
- package/es/locale/lang/ru-RU.js +1 -0
- package/es/locale/lang/uk-UA.js +1 -0
- package/es/locale/lang/vi-VN.js +1 -0
- package/es/locale/lang/zh-CHT.js +1 -0
- package/es/locale/lang/zh-CN.js +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +5 -1
- package/es/table/module/edit/mixin.js +32 -15
- package/es/table/src/body.js +40 -24
- package/es/table/src/cell.js +75 -32
- package/es/table/src/footer.js +159 -131
- package/es/table/src/header.js +128 -90
- package/es/table/src/methods.js +284 -65
- package/es/table/src/props.js +5 -1
- package/es/table/src/table.js +64 -20
- package/es/table/style.css +33 -20
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +9 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +33 -20
- 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 +917 -449
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +1 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +1 -0
- package/lib/locale/lang/es-ES.js +1 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +1 -0
- package/lib/locale/lang/hu-HU.js +1 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -0
- package/lib/locale/lang/ja-JP.js +1 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +1 -0
- package/lib/locale/lang/ko-KR.js +1 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -0
- package/lib/locale/lang/pt-BR.js +1 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +1 -0
- package/lib/locale/lang/ru-RU.js +1 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +1 -0
- package/lib/locale/lang/uk-UA.js +1 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -0
- package/lib/locale/lang/vi-VN.js +1 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +1 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +1 -0
- package/lib/locale/lang/zh-CN.js +1 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -1
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/edit/mixin.js +34 -15
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +31 -15
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +82 -35
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +198 -161
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +169 -128
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +313 -68
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +5 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +70 -20
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +33 -20
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +9 -4
- 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 +33 -20
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +3 -3
- package/packages/locale/lang/en-US.ts +1 -0
- package/packages/locale/lang/es-ES.ts +1 -0
- package/packages/locale/lang/hu-HU.ts +1 -0
- package/packages/locale/lang/ja-JP.ts +1 -0
- package/packages/locale/lang/ko-KR.ts +1 -0
- package/packages/locale/lang/pt-BR.ts +1 -0
- package/packages/locale/lang/ru-RU.ts +1 -0
- package/packages/locale/lang/uk-UA.ts +1 -0
- package/packages/locale/lang/vi-VN.ts +1 -0
- package/packages/locale/lang/zh-CHT.ts +1 -0
- package/packages/locale/lang/zh-CN.ts +1 -0
- package/packages/table/module/custom/mixin.ts +5 -1
- package/packages/table/module/edit/mixin.ts +32 -15
- package/packages/table/src/body.ts +43 -25
- package/packages/table/src/cell.ts +120 -67
- package/packages/table/src/footer.ts +164 -150
- package/packages/table/src/header.ts +136 -90
- package/packages/table/src/methods.ts +296 -67
- package/packages/table/src/props.ts +5 -1
- package/packages/table/src/table.ts +71 -19
- package/packages/ui/index.ts +8 -3
- package/styles/components/table.scss +42 -35
- /package/es/{iconfont.1731633464058.ttf → iconfont.1731937243466.ttf} +0 -0
- /package/es/{iconfont.1731633464058.woff → iconfont.1731937243466.woff} +0 -0
- /package/es/{iconfont.1731633464058.woff2 → iconfont.1731937243466.woff2} +0 -0
- /package/lib/{iconfont.1731633464058.ttf → iconfont.1731937243466.ttf} +0 -0
- /package/lib/{iconfont.1731633464058.woff → iconfont.1731937243466.woff} +0 -0
- /package/lib/{iconfont.1731633464058.woff2 → iconfont.1731937243466.woff2} +0 -0
|
@@ -449,7 +449,7 @@ export default {
|
|
|
449
449
|
}
|
|
450
450
|
this.closeTooltip()
|
|
451
451
|
if (actived.column) {
|
|
452
|
-
this.
|
|
452
|
+
this.handleClearEdit(evnt)
|
|
453
453
|
}
|
|
454
454
|
type = 'edit-activated'
|
|
455
455
|
column.renderHeight = cell.offsetHeight
|
|
@@ -536,49 +536,66 @@ export default {
|
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
},
|
|
539
|
-
_clearActived (
|
|
539
|
+
_clearActived (row: any) {
|
|
540
540
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
541
541
|
warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit'])
|
|
542
542
|
}
|
|
543
543
|
// 即将废弃
|
|
544
|
-
return this.clearEdit(
|
|
544
|
+
return this.clearEdit(row)
|
|
545
545
|
},
|
|
546
546
|
/**
|
|
547
547
|
* 清除激活的编辑
|
|
548
548
|
*/
|
|
549
|
-
_clearEdit (
|
|
549
|
+
_clearEdit (row: any) {
|
|
550
|
+
return this.handleClearEdit(null, row)
|
|
551
|
+
},
|
|
552
|
+
/**
|
|
553
|
+
* 取消编辑
|
|
554
|
+
*/
|
|
555
|
+
handleClearEdit (evnt: Event | null, targetRow?: any) {
|
|
550
556
|
const $xeTable = this
|
|
557
|
+
const props = $xeTable
|
|
551
558
|
const reactData = $xeTable
|
|
552
559
|
|
|
560
|
+
const { mouseConfig } = props
|
|
553
561
|
const { editStore } = reactData
|
|
554
562
|
const { actived, focused } = editStore
|
|
555
563
|
const { row, column } = actived
|
|
556
564
|
const validOpts = $xeTable.validOpts
|
|
565
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
557
566
|
if (row || column) {
|
|
558
|
-
|
|
567
|
+
if (targetRow && getRowid($xeTable, targetRow) !== getRowid($xeTable, row)) {
|
|
568
|
+
return $xeTable.$nextTick()
|
|
569
|
+
}
|
|
570
|
+
$xeTable._syncActivedCell()
|
|
559
571
|
actived.args = null
|
|
560
572
|
actived.row = null
|
|
561
573
|
actived.column = null
|
|
562
|
-
|
|
563
|
-
|
|
574
|
+
$xeTable.updateFooter()
|
|
575
|
+
$xeTable.emitEvent('edit-closed', {
|
|
564
576
|
row,
|
|
565
|
-
rowIndex:
|
|
566
|
-
$rowIndex:
|
|
577
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
578
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
567
579
|
column,
|
|
568
|
-
columnIndex:
|
|
569
|
-
$columnIndex:
|
|
580
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
581
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
570
582
|
}, evnt)
|
|
571
583
|
}
|
|
572
584
|
focused.row = null
|
|
573
585
|
focused.column = null
|
|
586
|
+
$xeTable.$nextTick(() => {
|
|
587
|
+
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
588
|
+
return $xeTable.handleRecalculateCellAreas()
|
|
589
|
+
}
|
|
590
|
+
})
|
|
574
591
|
if (validOpts.autoClear) {
|
|
575
592
|
if (validOpts.msgMode !== 'full' || getConfig().cellVaildMode === 'obsolete') {
|
|
576
|
-
if (
|
|
577
|
-
return
|
|
593
|
+
if ($xeTable.clearValidate) {
|
|
594
|
+
return $xeTable.clearValidate()
|
|
578
595
|
}
|
|
579
596
|
}
|
|
580
597
|
}
|
|
581
|
-
return
|
|
598
|
+
return $xeTable.$nextTick()
|
|
582
599
|
},
|
|
583
600
|
_getActiveRecord () {
|
|
584
601
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
@@ -735,7 +752,7 @@ export default {
|
|
|
735
752
|
const selectMethod = () => {
|
|
736
753
|
if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
|
|
737
754
|
if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
|
|
738
|
-
this.
|
|
755
|
+
this.handleClearEdit(evnt)
|
|
739
756
|
this.clearSelected(evnt)
|
|
740
757
|
this.clearCellAreas(evnt)
|
|
741
758
|
this.clearCopyCellArea(evnt)
|
|
@@ -337,7 +337,9 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any,
|
|
|
337
337
|
fullAllDataRowIdData,
|
|
338
338
|
rowOpts,
|
|
339
339
|
pendingRowList,
|
|
340
|
-
pendingRowMaps
|
|
340
|
+
pendingRowMaps,
|
|
341
|
+
columnOpts,
|
|
342
|
+
isDragColMove
|
|
341
343
|
} = $xeTable
|
|
342
344
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
343
345
|
const rows: any[] = []
|
|
@@ -393,32 +395,48 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any,
|
|
|
393
395
|
rowChildren = row[childrenField]
|
|
394
396
|
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid]
|
|
395
397
|
}
|
|
398
|
+
const trClass = [
|
|
399
|
+
'vxe-body--row',
|
|
400
|
+
treeConfig ? `row--level-${rowLevel}` : '',
|
|
401
|
+
{
|
|
402
|
+
'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
403
|
+
'is--new': isNewRow,
|
|
404
|
+
'is--expand-row': isExpandRow,
|
|
405
|
+
'is--expand-tree': isExpandTree,
|
|
406
|
+
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
407
|
+
'row--radio': radioOpts.highlight && $xeTable.selectRadioRow === row,
|
|
408
|
+
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
409
|
+
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
410
|
+
},
|
|
411
|
+
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
412
|
+
]
|
|
413
|
+
const tdVNs = tableColumn.map((column: any, $columnIndex: any) => {
|
|
414
|
+
return renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
415
|
+
})
|
|
396
416
|
rows.push(
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
403
|
-
'is--new': isNewRow,
|
|
404
|
-
'is--expand-row': isExpandRow,
|
|
405
|
-
'is--expand-tree': isExpandTree,
|
|
406
|
-
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
407
|
-
'row--radio': radioOpts.highlight && $xeTable.selectRadioRow === row,
|
|
408
|
-
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
409
|
-
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
417
|
+
columnOpts.drag
|
|
418
|
+
? h('transition-group', {
|
|
419
|
+
props: {
|
|
420
|
+
tag: 'tr',
|
|
421
|
+
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`
|
|
410
422
|
},
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
423
|
+
class: trClass,
|
|
424
|
+
attrs: {
|
|
425
|
+
rowid
|
|
426
|
+
},
|
|
427
|
+
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
428
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
429
|
+
nativeOn: trOn
|
|
430
|
+
}, tdVNs)
|
|
431
|
+
: h('tr', {
|
|
432
|
+
class: trClass,
|
|
433
|
+
attrs: {
|
|
434
|
+
rowid
|
|
435
|
+
},
|
|
436
|
+
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
437
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
438
|
+
on: trOn
|
|
439
|
+
}, tdVNs)
|
|
422
440
|
)
|
|
423
441
|
// 如果行被展开了
|
|
424
442
|
if (isExpandRow) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateElement } from 'vue'
|
|
1
|
+
import { CreateElement, VNode } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
4
|
import { getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
|
|
@@ -6,6 +6,8 @@ import { updateCellTitle } from '../../ui/src/dom'
|
|
|
6
6
|
import { createColumn, getRowid } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
9
|
+
import type { VxeTableDefines } from '../../../types'
|
|
10
|
+
|
|
9
11
|
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
|
|
10
12
|
|
|
11
13
|
function renderTitlePrefixIcon (h: CreateElement, params: any) {
|
|
@@ -50,9 +52,12 @@ function renderTitleSuffixIcon (h: CreateElement, params: any) {
|
|
|
50
52
|
|
|
51
53
|
function renderCellDragIcon (h: CreateElement, params: any) {
|
|
52
54
|
const { $table } = params
|
|
53
|
-
const
|
|
54
|
-
const {
|
|
55
|
-
const
|
|
55
|
+
const tableProps = $table
|
|
56
|
+
const { dragConfig } = tableProps
|
|
57
|
+
const rowDragOpts = $table.computeRowDragOpts
|
|
58
|
+
const { icon, disabledMethod } = rowDragOpts
|
|
59
|
+
const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null)
|
|
60
|
+
const isDisabled = rDisabledMethod && rDisabledMethod(params)
|
|
56
61
|
return h('span', {
|
|
57
62
|
key: 'dg',
|
|
58
63
|
class: ['vxe-cell--drag-handle', {
|
|
@@ -68,21 +73,22 @@ function renderCellDragIcon (h: CreateElement, params: any) {
|
|
|
68
73
|
}
|
|
69
74
|
}, [
|
|
70
75
|
h('i', {
|
|
71
|
-
class: rowIcon || getIcon().TABLE_DRAG_ROW
|
|
76
|
+
class: icon || (dragConfig ? dragConfig.rowIcon : '') || getIcon().TABLE_DRAG_ROW
|
|
72
77
|
})
|
|
73
78
|
])
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
|
|
77
|
-
const { $table, column,
|
|
82
|
+
const { $table, column, level } = params
|
|
78
83
|
const { dragSort } = column
|
|
79
84
|
const tableProps = $table
|
|
80
|
-
const { treeConfig } = tableProps
|
|
85
|
+
const { treeConfig, dragConfig } = tableProps
|
|
81
86
|
const rowOpts = $table.computeRowOpts
|
|
82
|
-
const
|
|
83
|
-
const {
|
|
87
|
+
const rowDragOpts = $table.computeRowDragOpts
|
|
88
|
+
const { showIcon, visibleMethod } = rowDragOpts
|
|
89
|
+
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null)
|
|
84
90
|
const vns: any[] = XEUtils.isArray(content) ? content : [content]
|
|
85
|
-
if (dragSort && rowOpts.drag && (showRowIcon && (!
|
|
91
|
+
if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
|
|
86
92
|
if (!treeConfig || !level) {
|
|
87
93
|
vns.unshift(
|
|
88
94
|
renderCellDragIcon(h, params)
|
|
@@ -92,6 +98,47 @@ function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
|
|
|
92
98
|
return vns
|
|
93
99
|
}
|
|
94
100
|
|
|
101
|
+
function renderHeaderCellDragIcon (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams) {
|
|
102
|
+
const { $table, column } = params
|
|
103
|
+
const columnOpts = $table.computeColumnOpts
|
|
104
|
+
const columnDragOpts = $table.computeColumnDragOpts
|
|
105
|
+
const { showIcon, icon, visibleMethod, disabledMethod } = columnDragOpts
|
|
106
|
+
const isDisabled = disabledMethod && disabledMethod(params)
|
|
107
|
+
if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
|
|
108
|
+
if (!(column.fixed || column.parentId)) {
|
|
109
|
+
return h('span', {
|
|
110
|
+
key: 'dg',
|
|
111
|
+
class: ['vxe-cell--drag-handle', {
|
|
112
|
+
'is--disabled': isDisabled
|
|
113
|
+
}],
|
|
114
|
+
on: {
|
|
115
|
+
mousedown (evnt: MouseEvent) {
|
|
116
|
+
if (!isDisabled) {
|
|
117
|
+
$table.handleHeaderCellDragMousedownEvent(evnt, params)
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
mouseup: $table.handleHeaderCellDragMouseupEvent
|
|
121
|
+
}
|
|
122
|
+
}, [
|
|
123
|
+
h('i', {
|
|
124
|
+
class: icon || getIcon().TABLE_DRAG_COLUMN
|
|
125
|
+
})
|
|
126
|
+
])
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return renderEmptyElement($table)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function renderHeaderCellBaseVNs (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams, content: VNode | VNode[]) {
|
|
133
|
+
const vns = [
|
|
134
|
+
renderTitlePrefixIcon(h, params),
|
|
135
|
+
renderHeaderCellDragIcon(h, params),
|
|
136
|
+
...(XEUtils.isArray(content) ? content : [content]),
|
|
137
|
+
renderTitleSuffixIcon(h, params)
|
|
138
|
+
]
|
|
139
|
+
return vns
|
|
140
|
+
}
|
|
141
|
+
|
|
95
142
|
function renderTitleContent (h: CreateElement, params: any, content: any) {
|
|
96
143
|
const { $table, column } = params
|
|
97
144
|
const { type, showHeaderOverflow } = column
|
|
@@ -252,7 +299,7 @@ export const Cell = {
|
|
|
252
299
|
return createColumn($xetable, _vm, renMaps)
|
|
253
300
|
},
|
|
254
301
|
/**
|
|
255
|
-
*
|
|
302
|
+
* 列头标题
|
|
256
303
|
*/
|
|
257
304
|
renderHeaderTitle (h: any, params: any) {
|
|
258
305
|
const { $table, column } = params
|
|
@@ -271,7 +318,7 @@ export const Cell = {
|
|
|
271
318
|
return renderTitleContent(h, params, formatText(column.getTitle(), 1))
|
|
272
319
|
},
|
|
273
320
|
renderDefaultHeader (h: CreateElement, params: any) {
|
|
274
|
-
return
|
|
321
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params))
|
|
275
322
|
},
|
|
276
323
|
renderDefaultCell (h: CreateElement, params: any) {
|
|
277
324
|
const { $table, row, column } = params
|
|
@@ -380,12 +427,12 @@ export const Cell = {
|
|
|
380
427
|
},
|
|
381
428
|
|
|
382
429
|
/**
|
|
383
|
-
*
|
|
430
|
+
* 序号
|
|
384
431
|
*/
|
|
385
432
|
renderSeqHeader (h: CreateElement, params: any) {
|
|
386
433
|
const { $table, column } = params
|
|
387
434
|
const { slots } = column
|
|
388
|
-
return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : formatText(column.getTitle(), 1))
|
|
435
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : formatText(column.getTitle(), 1)))
|
|
389
436
|
},
|
|
390
437
|
renderSeqCell (h: CreateElement, params: any) {
|
|
391
438
|
const { $table, column } = params
|
|
@@ -412,13 +459,15 @@ export const Cell = {
|
|
|
412
459
|
const { slots } = column
|
|
413
460
|
const headerSlot = slots ? slots.header : null
|
|
414
461
|
const titleSlot = slots ? slots.title : null
|
|
415
|
-
return
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
462
|
+
return renderHeaderCellBaseVNs(h, params,
|
|
463
|
+
renderTitleContent(h, params, headerSlot
|
|
464
|
+
? $table.callSlot(headerSlot, params, h)
|
|
465
|
+
: [
|
|
466
|
+
h('span', {
|
|
467
|
+
class: 'vxe-radio--label'
|
|
468
|
+
}, titleSlot ? $table.callSlot(titleSlot, params, h) : formatText(column.getTitle(), 1))
|
|
469
|
+
])
|
|
470
|
+
)
|
|
422
471
|
},
|
|
423
472
|
renderRadioCell (h: CreateElement, params: any) {
|
|
424
473
|
const { $table, column, isHidden } = params
|
|
@@ -500,38 +549,40 @@ export const Cell = {
|
|
|
500
549
|
}
|
|
501
550
|
const checkboxParams = { ...params, checked: isAllCheckboxSelected, disabled: isAllCheckboxDisabled, indeterminate: isAllCheckboxIndeterminate }
|
|
502
551
|
if (headerSlot) {
|
|
503
|
-
return renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h))
|
|
552
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)))
|
|
504
553
|
}
|
|
505
554
|
if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
|
|
506
|
-
return renderTitleContent(h, checkboxParams, [
|
|
555
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
|
|
507
556
|
h('span', {
|
|
508
557
|
class: 'vxe-checkbox--label'
|
|
509
558
|
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)
|
|
510
|
-
])
|
|
559
|
+
]))
|
|
511
560
|
}
|
|
512
|
-
return
|
|
513
|
-
h
|
|
514
|
-
class: ['vxe-cell--checkbox', {
|
|
515
|
-
'is--checked': isAllCheckboxSelected,
|
|
516
|
-
'is--disabled': isAllCheckboxDisabled,
|
|
517
|
-
'is--indeterminate': isAllCheckboxIndeterminate
|
|
518
|
-
}],
|
|
519
|
-
attrs: {
|
|
520
|
-
title: getI18n('vxe.table.allTitle')
|
|
521
|
-
},
|
|
522
|
-
on
|
|
523
|
-
}, [
|
|
561
|
+
return renderHeaderCellBaseVNs(h, params,
|
|
562
|
+
renderTitleContent(h, checkboxParams, [
|
|
524
563
|
h('span', {
|
|
525
|
-
class: ['vxe-checkbox
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
564
|
+
class: ['vxe-cell--checkbox', {
|
|
565
|
+
'is--checked': isAllCheckboxSelected,
|
|
566
|
+
'is--disabled': isAllCheckboxDisabled,
|
|
567
|
+
'is--indeterminate': isAllCheckboxIndeterminate
|
|
568
|
+
}],
|
|
569
|
+
attrs: {
|
|
570
|
+
title: getI18n('vxe.table.allTitle')
|
|
571
|
+
},
|
|
572
|
+
on
|
|
573
|
+
}, [
|
|
574
|
+
h('span', {
|
|
575
|
+
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
576
|
+
})
|
|
577
|
+
].concat(titleSlot || headerTitle
|
|
578
|
+
? [
|
|
579
|
+
h('span', {
|
|
580
|
+
class: 'vxe-checkbox--label'
|
|
581
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)
|
|
582
|
+
]
|
|
583
|
+
: []))
|
|
584
|
+
])
|
|
585
|
+
)
|
|
535
586
|
},
|
|
536
587
|
renderCheckboxCell (h: CreateElement, params: any) {
|
|
537
588
|
const { $table, row, column, isHidden } = params
|
|
@@ -748,16 +799,14 @@ export const Cell = {
|
|
|
748
799
|
* 排序和筛选
|
|
749
800
|
*/
|
|
750
801
|
renderSortAndFilterHeader (h: CreateElement, params: any) {
|
|
751
|
-
return Cell.
|
|
752
|
-
.concat(Cell.renderSortIcon(h, params))
|
|
753
|
-
.concat(Cell.renderFilterIcon(h, params))
|
|
802
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params).concat(Cell.renderSortIcon(h, params)))
|
|
754
803
|
},
|
|
755
804
|
|
|
756
805
|
/**
|
|
757
806
|
* 排序
|
|
758
807
|
*/
|
|
759
808
|
renderSortHeader (h: CreateElement, params: any) {
|
|
760
|
-
return Cell.
|
|
809
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params).concat(Cell.renderSortIcon(h, params)))
|
|
761
810
|
},
|
|
762
811
|
renderSortIcon (h: CreateElement, params: any) {
|
|
763
812
|
const { $table, column } = params
|
|
@@ -804,7 +853,7 @@ export const Cell = {
|
|
|
804
853
|
* 筛选
|
|
805
854
|
*/
|
|
806
855
|
renderFilterHeader (h: CreateElement, params: any) {
|
|
807
|
-
return Cell.
|
|
856
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params).concat(Cell.renderFilterIcon(h, params)))
|
|
808
857
|
},
|
|
809
858
|
renderFilterIcon (h: CreateElement, params: any) {
|
|
810
859
|
const { $table, column, hasFilter } = params
|
|
@@ -849,22 +898,26 @@ export const Cell = {
|
|
|
849
898
|
isRequired = columnRules.some((rule: any) => rule.required)
|
|
850
899
|
}
|
|
851
900
|
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
901
|
+
let editIconVNs: VNode[] = []
|
|
902
|
+
if (isEnableConf(editConfig)) {
|
|
903
|
+
editIconVNs = [
|
|
904
|
+
isRequired && editOpts.showAsterisk
|
|
905
|
+
? h('i', {
|
|
906
|
+
class: 'vxe-cell--required-icon'
|
|
907
|
+
})
|
|
908
|
+
: renderEmptyElement($table),
|
|
909
|
+
isEnableConf(editRender) && editOpts.showIcon
|
|
910
|
+
? h('i', {
|
|
911
|
+
class: ['vxe-cell--edit-icon', editOpts.icon || getIcon().TABLE_EDIT]
|
|
912
|
+
})
|
|
913
|
+
: renderEmptyElement($table)
|
|
914
|
+
]
|
|
915
|
+
}
|
|
916
|
+
return renderHeaderCellBaseVNs(h, params,
|
|
917
|
+
editIconVNs.concat(Cell.renderHeaderTitle(h, params))
|
|
918
|
+
.concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : [])
|
|
919
|
+
.concat(filters ? Cell.renderFilterIcon(h, params) : [])
|
|
920
|
+
)
|
|
868
921
|
},
|
|
869
922
|
// 行格编辑模式
|
|
870
923
|
renderRowEdit (h: CreateElement, params: any) {
|