vxe-table 3.12.10-beta.9 → 3.12.10
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +4 -3
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +4 -3
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +518 -517
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +7 -7
- package/es/table/module/export/mixin.js +105 -69
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +125 -86
- package/es/table/src/cell.js +43 -57
- package/es/table/src/column.js +43 -8
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/footer.js +47 -6
- package/es/table/src/header.js +67 -165
- package/es/table/src/methods.js +962 -480
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +114 -33
- package/es/table/src/util.js +73 -57
- package/es/table/style.css +246 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +246 -191
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1734 -1020
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +7 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +105 -64
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +73 -27
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +3 -1
- package/lib/table/src/body.js +124 -79
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +12 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +43 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +49 -172
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1072 -538
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +113 -36
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +87 -70
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +246 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -6
- 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 +246 -191
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +4 -3
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +4 -3
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +518 -517
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/mixin.ts +7 -7
- package/packages/table/module/export/mixin.ts +138 -80
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +136 -89
- package/packages/table/src/cell.ts +45 -67
- package/packages/table/src/column.ts +48 -10
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/footer.ts +50 -7
- package/packages/table/src/header.ts +67 -166
- package/packages/table/src/methods.ts +1007 -492
- package/packages/table/src/props.ts +16 -6
- package/packages/table/src/table.ts +124 -33
- package/packages/table/src/util.ts +82 -62
- package/packages/ui/index.ts +19 -5
- package/styles/components/table.scss +313 -274
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- /package/es/{iconfont.1736854649055.ttf → iconfont.1738985837413.ttf} +0 -0
- /package/es/{iconfont.1736854649055.woff → iconfont.1738985837413.woff} +0 -0
- /package/es/{iconfont.1736854649055.woff2 → iconfont.1738985837413.woff2} +0 -0
- /package/lib/{iconfont.1736854649055.ttf → iconfont.1738985837413.ttf} +0 -0
- /package/lib/{iconfont.1736854649055.woff → iconfont.1738985837413.woff} +0 -0
- /package/lib/{iconfont.1736854649055.woff2 → iconfont.1738985837413.woff2} +0 -0
|
@@ -6,7 +6,7 @@ import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid } from './util'
|
|
|
6
6
|
import { updateCellTitle } from '../../ui/src/dom'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
9
|
-
import type { VxeTableConstructor, VxeTableDefines, TableInternalData, VxeTablePrivateMethods, TableReactData,
|
|
9
|
+
import type { VxeTableConstructor, VxeTableDefines, TableInternalData, VxeTablePrivateMethods, TableReactData, VxeComponentStyleType } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { getI18n, renderer, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
@@ -18,11 +18,11 @@ const isVMScrollProcess = ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
|
|
|
18
18
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
19
19
|
|
|
20
20
|
const { delayHover } = tableProps
|
|
21
|
-
const { lastScrollTime,
|
|
22
|
-
return !!(
|
|
21
|
+
const { lastScrollTime, isDragResize } = tableReactData
|
|
22
|
+
return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + (delayHover as number)))
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRenderBodyParams) {
|
|
25
|
+
function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number) {
|
|
26
26
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
27
27
|
const tableProps = $xeTable
|
|
28
28
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
@@ -48,12 +48,14 @@ function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRen
|
|
|
48
48
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
49
49
|
return [
|
|
50
50
|
h('div', {
|
|
51
|
+
key: 'tl',
|
|
51
52
|
class: 'vxe-tree--line-wrapper'
|
|
52
53
|
}, [
|
|
53
54
|
h('div', {
|
|
54
55
|
class: 'vxe-tree--line',
|
|
55
56
|
style: {
|
|
56
57
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
58
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
57
59
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
58
60
|
}
|
|
59
61
|
})
|
|
@@ -71,7 +73,7 @@ function renderTdColumn (
|
|
|
71
73
|
_vm: any,
|
|
72
74
|
seq: number | string,
|
|
73
75
|
rowid: string,
|
|
74
|
-
fixedType:
|
|
76
|
+
fixedType: 'left' | 'right' | '',
|
|
75
77
|
isOptimizeMode: boolean,
|
|
76
78
|
rowLevel: number,
|
|
77
79
|
row: any,
|
|
@@ -89,26 +91,29 @@ function renderTdColumn (
|
|
|
89
91
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
90
92
|
|
|
91
93
|
const { fullAllDataRowIdData } = tableInternalData
|
|
92
|
-
const { columnKey,
|
|
93
|
-
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad,
|
|
94
|
+
const { columnKey, resizable: allResizable, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
95
|
+
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
94
96
|
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData
|
|
95
97
|
const cellOpts = $xeTable.computeCellOpts
|
|
96
98
|
const validOpts = $xeTable.computeValidOpts
|
|
97
99
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
98
100
|
const editOpts = $xeTable.computeEditOpts
|
|
99
101
|
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
102
|
+
const { isAllColumnDrag, isAllRowDrag } = $xeTable.resizableOpts
|
|
100
103
|
const rowOpts = $xeTable.computeRowOpts
|
|
101
104
|
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
102
105
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
106
|
+
const customCellHeight = cellOpts.height || rowOpts.height
|
|
107
|
+
const currCellHeight = customCellHeight || defaultRowHeight
|
|
103
108
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts
|
|
104
109
|
const columnOpts = $xeTable.computeColumnOpts
|
|
105
110
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
106
111
|
const areaOpts = $xeTable.computeAreaOpts
|
|
107
112
|
const { selectCellToRow } = areaOpts
|
|
108
|
-
const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column
|
|
109
|
-
const { verticalAlign } = cellOpts
|
|
113
|
+
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column
|
|
114
|
+
const { verticalAlign: allVerticalAlign } = cellOpts
|
|
110
115
|
const { actived } = editStore
|
|
111
|
-
const
|
|
116
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
112
117
|
const colid = column.id
|
|
113
118
|
const renderOpts = editRender || cellRender
|
|
114
119
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
@@ -118,21 +123,27 @@ function renderTdColumn (
|
|
|
118
123
|
const columnIndex = $xeTable.getColumnIndex(column)
|
|
119
124
|
const _columnIndex = $xeTable.getVTColumnIndex(column)
|
|
120
125
|
const isEdit = isEnableConf(editRender)
|
|
126
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
|
|
121
127
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX
|
|
122
|
-
const
|
|
128
|
+
const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
|
|
129
|
+
const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow
|
|
123
130
|
const showEllipsis = cellOverflow === 'ellipsis'
|
|
124
131
|
const showTitle = cellOverflow === 'title'
|
|
125
132
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
|
|
126
|
-
|
|
127
|
-
const
|
|
133
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis
|
|
134
|
+
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
|
|
135
|
+
const isCsHeight = !!customCellHeight
|
|
136
|
+
const isRsHeight = resizeHeight > 0
|
|
128
137
|
let isDirty
|
|
129
138
|
const tdOns: any = {}
|
|
130
|
-
const rest = fullAllDataRowIdData[rowid]
|
|
131
139
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign
|
|
140
|
+
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign
|
|
132
141
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`]
|
|
133
142
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline')
|
|
134
|
-
const
|
|
135
|
-
const
|
|
143
|
+
const tdAttrs: any = { colid }
|
|
144
|
+
const cellParams: VxeTableDefines.CellRenderBodyParams & {
|
|
145
|
+
$table: VxeTableConstructor<any> & VxeTablePrivateMethods
|
|
146
|
+
} = {
|
|
136
147
|
$table: $xeTable,
|
|
137
148
|
$grid: $xeTable.xegrid,
|
|
138
149
|
isEdit: false,
|
|
@@ -160,7 +171,7 @@ function renderTdColumn (
|
|
|
160
171
|
isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell')
|
|
161
172
|
}
|
|
162
173
|
if (isRowDragCell) {
|
|
163
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
174
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams))
|
|
164
175
|
}
|
|
165
176
|
// hover 进入事件
|
|
166
177
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -172,9 +183,9 @@ function renderTdColumn (
|
|
|
172
183
|
updateCellTitle(evnt.currentTarget, column)
|
|
173
184
|
} else if (showTooltip || showAllTip) {
|
|
174
185
|
// 如果配置了显示 tooltip
|
|
175
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
186
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams)
|
|
176
187
|
}
|
|
177
|
-
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget },
|
|
188
|
+
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
178
189
|
}
|
|
179
190
|
}
|
|
180
191
|
// hover 退出事件
|
|
@@ -186,13 +197,13 @@ function renderTdColumn (
|
|
|
186
197
|
if (showTooltip || showAllTip) {
|
|
187
198
|
$xeTable.handleTargetLeaveEvent(evnt)
|
|
188
199
|
}
|
|
189
|
-
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget },
|
|
200
|
+
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
190
201
|
}
|
|
191
202
|
}
|
|
192
203
|
// 按下事件处理
|
|
193
204
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
194
205
|
tdOns.mousedown = (evnt: MouseEvent) => {
|
|
195
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
206
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams)
|
|
196
207
|
}
|
|
197
208
|
}
|
|
198
209
|
// 拖拽列事件
|
|
@@ -201,11 +212,11 @@ function renderTdColumn (
|
|
|
201
212
|
}
|
|
202
213
|
// 点击事件处理
|
|
203
214
|
tdOns.click = (evnt: MouseEvent) => {
|
|
204
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
215
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams)
|
|
205
216
|
}
|
|
206
217
|
// 双击事件处理
|
|
207
218
|
tdOns.dblclick = (evnt: MouseEvent) => {
|
|
208
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
219
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams)
|
|
209
220
|
}
|
|
210
221
|
// 合并行或列
|
|
211
222
|
if (mergeList.length) {
|
|
@@ -216,28 +227,28 @@ function renderTdColumn (
|
|
|
216
227
|
return null
|
|
217
228
|
}
|
|
218
229
|
if (rowspan > 1) {
|
|
219
|
-
|
|
230
|
+
tdAttrs.rowspan = rowspan
|
|
220
231
|
}
|
|
221
232
|
if (colspan > 1) {
|
|
222
|
-
|
|
233
|
+
tdAttrs.colspan = colspan
|
|
223
234
|
}
|
|
224
235
|
}
|
|
225
236
|
} else if (spanMethod) {
|
|
226
237
|
// 自定义合并行或列的方法
|
|
227
|
-
const { rowspan = 1, colspan = 1 } = spanMethod(
|
|
238
|
+
const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {}
|
|
228
239
|
if (!rowspan || !colspan) {
|
|
229
240
|
return null
|
|
230
241
|
}
|
|
231
242
|
if (rowspan > 1) {
|
|
232
|
-
|
|
243
|
+
tdAttrs.rowspan = rowspan
|
|
233
244
|
}
|
|
234
245
|
if (colspan > 1) {
|
|
235
|
-
|
|
246
|
+
tdAttrs.colspan = colspan
|
|
236
247
|
}
|
|
237
248
|
}
|
|
238
249
|
// 如果被合并不可隐藏
|
|
239
250
|
if (fixedHiddenColumn && mergeList) {
|
|
240
|
-
if (
|
|
251
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
241
252
|
fixedHiddenColumn = false
|
|
242
253
|
}
|
|
243
254
|
}
|
|
@@ -247,31 +258,40 @@ function renderTdColumn (
|
|
|
247
258
|
}
|
|
248
259
|
|
|
249
260
|
const isVNAutoHeight = scrollYLoad && !hasEllipsis
|
|
250
|
-
let cellHeight =
|
|
251
|
-
const vnHeight =
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
cellHeight = customRHeight
|
|
255
|
-
} else if (!isAllOverflow) {
|
|
256
|
-
cellHeight = vnHeight || defaultRowHeight || 18
|
|
257
|
-
}
|
|
261
|
+
let cellHeight = currCellHeight
|
|
262
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0
|
|
263
|
+
if (resizeHeight) {
|
|
264
|
+
cellHeight = resizeHeight
|
|
258
265
|
} else {
|
|
259
|
-
|
|
266
|
+
if (scrollYLoad) {
|
|
267
|
+
if (!hasEllipsis) {
|
|
268
|
+
cellHeight = vnHeight || currCellHeight
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const isLastColumn = $columnIndex === columns.length - 1
|
|
274
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
275
|
+
|
|
276
|
+
let isVNPreEmptyStatus = false
|
|
277
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
278
|
+
isVNPreEmptyStatus = true
|
|
279
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
280
|
+
isVNPreEmptyStatus = true
|
|
260
281
|
}
|
|
261
282
|
|
|
262
283
|
const tcStyle: Record<string, string> = {}
|
|
263
|
-
if (
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
tcStyle.height = `${cellHeight}px`
|
|
268
|
-
}
|
|
284
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
285
|
+
tcStyle.height = `${cellHeight}px`
|
|
286
|
+
} else {
|
|
287
|
+
tcStyle.minHeight = `${cellHeight}px`
|
|
269
288
|
}
|
|
270
289
|
|
|
271
290
|
const tdVNs = []
|
|
272
|
-
if (fixedHiddenColumn &&
|
|
291
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
273
292
|
tdVNs.push(
|
|
274
293
|
h('div', {
|
|
294
|
+
key: 'tc',
|
|
275
295
|
class: ['vxe-cell', {
|
|
276
296
|
'c--title': showTitle,
|
|
277
297
|
'c--tooltip': showTooltip,
|
|
@@ -283,8 +303,9 @@ function renderTdColumn (
|
|
|
283
303
|
} else {
|
|
284
304
|
// 渲染单元格
|
|
285
305
|
tdVNs.push(
|
|
286
|
-
...renderLine(h, _vm,
|
|
306
|
+
...renderLine(h, _vm, cellParams, cellHeight),
|
|
287
307
|
h('div', {
|
|
308
|
+
key: 'tc',
|
|
288
309
|
class: ['vxe-cell', {
|
|
289
310
|
'c--title': showTitle,
|
|
290
311
|
'c--tooltip': showTooltip,
|
|
@@ -294,20 +315,25 @@ function renderTdColumn (
|
|
|
294
315
|
attrs: {
|
|
295
316
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
296
317
|
}
|
|
297
|
-
},
|
|
298
|
-
? [
|
|
318
|
+
}, isVNPreEmptyStatus
|
|
319
|
+
? []
|
|
320
|
+
: [
|
|
299
321
|
h('div', {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
322
|
+
attrs: {
|
|
323
|
+
colid,
|
|
324
|
+
rowid
|
|
325
|
+
},
|
|
326
|
+
class: 'vxe-cell--wrapper'
|
|
327
|
+
}, column.renderCell(h, cellParams))
|
|
328
|
+
])
|
|
304
329
|
)
|
|
305
330
|
if (showValidTip && errorValidItem) {
|
|
306
331
|
const errRule = errorValidItem.rule
|
|
307
332
|
const validSlot = slots ? slots.valid : null
|
|
308
|
-
const validParams = { ...
|
|
333
|
+
const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem }
|
|
309
334
|
tdVNs.push(
|
|
310
335
|
h('div', {
|
|
336
|
+
key: 'tcv',
|
|
311
337
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
312
338
|
style: errRule && errRule.maxWidth
|
|
313
339
|
? {
|
|
@@ -331,43 +357,63 @@ function renderTdColumn (
|
|
|
331
357
|
}
|
|
332
358
|
}
|
|
333
359
|
|
|
360
|
+
let showAreaRowStatus = false
|
|
334
361
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
335
362
|
if (
|
|
336
|
-
(
|
|
363
|
+
(!_columnIndex && selectCellToRow === true) ||
|
|
337
364
|
(selectCellToRow === column.field)
|
|
338
365
|
) {
|
|
339
|
-
|
|
340
|
-
h('div', {
|
|
341
|
-
class: 'vxe-cell--area-status'
|
|
342
|
-
})
|
|
343
|
-
)
|
|
366
|
+
showAreaRowStatus = true
|
|
344
367
|
}
|
|
345
368
|
}
|
|
346
|
-
const isLastColumn = $columnIndex === columns.length - 1
|
|
347
|
-
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
348
369
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
370
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
371
|
+
tdVNs.push(
|
|
372
|
+
h('div', {
|
|
373
|
+
key: 'tcc',
|
|
374
|
+
class: ['vxe-cell--col-resizable', {
|
|
375
|
+
'is--line': !border || border === 'none'
|
|
376
|
+
}],
|
|
377
|
+
on: {
|
|
378
|
+
mousedown: (evnt: MouseEvent) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
379
|
+
dblclick: (evnt: MouseEvent) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
380
|
+
}
|
|
381
|
+
})
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
386
|
+
tdVNs.push(
|
|
387
|
+
h('div', {
|
|
388
|
+
key: 'tcr',
|
|
389
|
+
class: 'vxe-cell--row-resizable',
|
|
390
|
+
on: {
|
|
391
|
+
mousedown: (evnt: MouseEvent) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
392
|
+
dblclick: (evnt: MouseEvent) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
393
|
+
}
|
|
394
|
+
})
|
|
395
|
+
)
|
|
354
396
|
}
|
|
355
397
|
|
|
356
398
|
return h('td', {
|
|
357
399
|
class: [
|
|
358
400
|
'vxe-body--column',
|
|
359
|
-
|
|
401
|
+
colid,
|
|
402
|
+
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
403
|
+
cellAlign ? `col--${cellAlign}` : '',
|
|
404
|
+
type ? `col--${type}` : '',
|
|
360
405
|
{
|
|
361
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
362
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
363
|
-
[`col--${type}`]: type,
|
|
364
406
|
'col--last': isLastColumn,
|
|
365
407
|
'col--tree-node': treeNode,
|
|
366
408
|
'col--edit': isEdit,
|
|
367
409
|
'col--ellipsis': hasEllipsis,
|
|
410
|
+
'col--cs-height': isCsHeight,
|
|
411
|
+
'col--rs-height': isRsHeight,
|
|
412
|
+
'col--to-row': showAreaRowStatus,
|
|
368
413
|
'col--auto-height': isVNAutoHeight,
|
|
369
414
|
'fixed--width': !isAutoCellWidth,
|
|
370
415
|
'fixed--hidden': fixedHiddenColumn,
|
|
416
|
+
'is--padding': isCellPadding,
|
|
371
417
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
372
418
|
'is--drag-disabled': isDisabledDrag,
|
|
373
419
|
'col--dirty': isDirty,
|
|
@@ -375,27 +421,25 @@ function renderTdColumn (
|
|
|
375
421
|
'col--valid-error': !!errorValidItem,
|
|
376
422
|
'col--current': currentColumn === column
|
|
377
423
|
},
|
|
378
|
-
getClass(compCellClassName,
|
|
379
|
-
getClass(className,
|
|
380
|
-
getClass(allCellClassName,
|
|
424
|
+
getClass(compCellClassName, cellParams),
|
|
425
|
+
getClass(className, cellParams),
|
|
426
|
+
getClass(allCellClassName, cellParams)
|
|
381
427
|
],
|
|
382
428
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
383
|
-
attrs,
|
|
384
|
-
style: Object.assign({
|
|
385
|
-
height: cellHeight ? `${cellHeight}px` : ''
|
|
386
|
-
}, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
|
|
429
|
+
attrs: tdAttrs,
|
|
430
|
+
style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
|
|
387
431
|
on: tdOns
|
|
388
|
-
},
|
|
432
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs)
|
|
389
433
|
}
|
|
390
434
|
|
|
391
|
-
function renderRows (h: CreateElement, _vm: any, fixedType:
|
|
435
|
+
function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '', isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) {
|
|
392
436
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
393
437
|
const tableProps = $xeTable
|
|
394
438
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
395
439
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
396
440
|
|
|
397
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle,
|
|
398
|
-
const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData
|
|
441
|
+
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
442
|
+
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData
|
|
399
443
|
const { fullAllDataRowIdData } = tableInternalData
|
|
400
444
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
401
445
|
const radioOpts = $xeTable.computeRadioOpts
|
|
@@ -481,7 +525,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.F
|
|
|
481
525
|
return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
482
526
|
})
|
|
483
527
|
rows.push(
|
|
484
|
-
columnOpts.drag && columnDragOpts.animation
|
|
528
|
+
!isColLoading && (columnOpts.drag && columnDragOpts.animation)
|
|
485
529
|
? h('transition-group', {
|
|
486
530
|
props: {
|
|
487
531
|
tag: 'tr',
|
|
@@ -517,7 +561,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.F
|
|
|
517
561
|
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
|
|
518
562
|
}
|
|
519
563
|
const { showOverflow } = expandColumn
|
|
520
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ?
|
|
564
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow
|
|
521
565
|
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
522
566
|
rows.push(
|
|
523
567
|
h('tr', {
|
|
@@ -615,8 +659,8 @@ export default {
|
|
|
615
659
|
const { xID, $scopedSlots } = $xeTable
|
|
616
660
|
const { fixedColumn, fixedType, tableColumn } = props
|
|
617
661
|
|
|
618
|
-
const {
|
|
619
|
-
const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
|
|
662
|
+
const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
|
|
663
|
+
const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
|
|
620
664
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
|
|
621
665
|
const rowOpts = $xeTable.computeRowOpts
|
|
622
666
|
const emptyOpts = $xeTable.computeEmptyOpts
|
|
@@ -629,7 +673,7 @@ export default {
|
|
|
629
673
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
630
674
|
let isOptimizeMode = false
|
|
631
675
|
// 如果是使用优化模式
|
|
632
|
-
if (scrollXLoad || scrollYLoad ||
|
|
676
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
633
677
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
634
678
|
// 如果不支持优化模式
|
|
635
679
|
} else {
|
|
@@ -760,9 +804,9 @@ export default {
|
|
|
760
804
|
})
|
|
761
805
|
})),
|
|
762
806
|
/**
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
rowOpts.drag && rowDragOpts.animation
|
|
807
|
+
* 内容
|
|
808
|
+
*/
|
|
809
|
+
!(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
|
|
766
810
|
? h('transition-group', {
|
|
767
811
|
ref: 'refBodyTBody',
|
|
768
812
|
props: {
|
|
@@ -808,6 +852,9 @@ export default {
|
|
|
808
852
|
}),
|
|
809
853
|
h('span', {
|
|
810
854
|
class: 'vxe-table--cell-active-area'
|
|
855
|
+
}),
|
|
856
|
+
h('span', {
|
|
857
|
+
class: 'vxe-table--cell-row-status-area'
|
|
811
858
|
})
|
|
812
859
|
])
|
|
813
860
|
: renderEmptyElement($xeTable),
|
|
@@ -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
|
-
import type { VxeTableDefines,
|
|
9
|
+
import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, VxeComponentSlotType, TableReactData, TableInternalData } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
@@ -170,7 +170,7 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
170
170
|
const ons: Record<string, any> = {}
|
|
171
171
|
if (showTitle || showTooltip || showAllTip) {
|
|
172
172
|
ons.mouseenter = (evnt: MouseEvent) => {
|
|
173
|
-
if (tableReactData.
|
|
173
|
+
if (tableReactData.isDragResize) {
|
|
174
174
|
return
|
|
175
175
|
}
|
|
176
176
|
if (showTitle) {
|
|
@@ -182,7 +182,7 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
182
182
|
}
|
|
183
183
|
if (showTooltip || showAllTip) {
|
|
184
184
|
ons.mouseleave = (evnt: any) => {
|
|
185
|
-
if (tableReactData.
|
|
185
|
+
if (tableReactData.isDragResize) {
|
|
186
186
|
return
|
|
187
187
|
}
|
|
188
188
|
if (showTooltip || showAllTip) {
|
|
@@ -206,25 +206,6 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
206
206
|
]
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
function formatFooterLabel (footerFormatter: VxeColumnPropTypes.FooterFormatter, params: {
|
|
210
|
-
itemValue: any
|
|
211
|
-
column: VxeTableDefines.ColumnInfo
|
|
212
|
-
row: any
|
|
213
|
-
items: any[]
|
|
214
|
-
_columnIndex: number
|
|
215
|
-
}) {
|
|
216
|
-
if (XEUtils.isFunction(footerFormatter)) {
|
|
217
|
-
return `${footerFormatter(params)}`
|
|
218
|
-
}
|
|
219
|
-
const isArr = XEUtils.isArray(footerFormatter)
|
|
220
|
-
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
|
|
221
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
|
|
222
|
-
if (footerFormatMethod) {
|
|
223
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`
|
|
224
|
-
}
|
|
225
|
-
return ''
|
|
226
|
-
}
|
|
227
|
-
|
|
228
209
|
function getFooterContent (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
229
210
|
const { $table, column, _columnIndex, row, items } = params
|
|
230
211
|
const { slots, editRender, cellRender, footerFormatter } = column
|
|
@@ -232,40 +213,37 @@ function getFooterContent (h: CreateElement, params: VxeTableDefines.CellRenderF
|
|
|
232
213
|
if (slots && slots.footer) {
|
|
233
214
|
return $table.callSlot(slots.footer, params, h)
|
|
234
215
|
}
|
|
216
|
+
let itemValue = ''
|
|
217
|
+
// 兼容老模式
|
|
218
|
+
if (XEUtils.isArray(items)) {
|
|
219
|
+
itemValue = items[_columnIndex]
|
|
220
|
+
} else {
|
|
221
|
+
itemValue = XEUtils.get(row, column.field)
|
|
222
|
+
}
|
|
223
|
+
const footParams = Object.assign(params, {
|
|
224
|
+
itemValue
|
|
225
|
+
})
|
|
226
|
+
if (footerFormatter) {
|
|
227
|
+
if (XEUtils.isFunction(footerFormatter)) {
|
|
228
|
+
return `${footerFormatter(footParams)}`
|
|
229
|
+
}
|
|
230
|
+
const isArr = XEUtils.isArray(footerFormatter)
|
|
231
|
+
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
|
|
232
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
|
|
233
|
+
if (footerFormatMethod) {
|
|
234
|
+
return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`
|
|
235
|
+
}
|
|
236
|
+
return ''
|
|
237
|
+
}
|
|
235
238
|
if (renderOpts) {
|
|
236
239
|
const compConf = renderer.get(renderOpts.name)
|
|
237
240
|
const rtFooter = compConf ? (compConf.renderTableFooter || compConf.renderFooter) : null
|
|
238
241
|
if (rtFooter) {
|
|
239
|
-
return getSlotVNs(rtFooter.call($table, h, renderOpts,
|
|
242
|
+
return getSlotVNs(rtFooter.call($table, h, renderOpts, footParams))
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
|
-
let itemValue = ''
|
|
243
|
-
// 兼容老模式
|
|
244
|
-
if (XEUtils.isArray(items)) {
|
|
245
|
-
itemValue = items[_columnIndex]
|
|
246
|
-
return [
|
|
247
|
-
footerFormatter
|
|
248
|
-
? formatFooterLabel(footerFormatter, {
|
|
249
|
-
itemValue,
|
|
250
|
-
column,
|
|
251
|
-
row,
|
|
252
|
-
items,
|
|
253
|
-
_columnIndex
|
|
254
|
-
})
|
|
255
|
-
: formatText(itemValue, 1)
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
itemValue = XEUtils.get(row, column.field)
|
|
259
245
|
return [
|
|
260
|
-
|
|
261
|
-
? formatFooterLabel(footerFormatter, {
|
|
262
|
-
itemValue,
|
|
263
|
-
column,
|
|
264
|
-
row,
|
|
265
|
-
items,
|
|
266
|
-
_columnIndex
|
|
267
|
-
})
|
|
268
|
-
: formatText(itemValue, 1)
|
|
246
|
+
formatText(itemValue, 1)
|
|
269
247
|
]
|
|
270
248
|
}
|
|
271
249
|
|
|
@@ -413,11 +391,7 @@ export const Cell = {
|
|
|
413
391
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params))
|
|
414
392
|
},
|
|
415
393
|
renderDefaultFooter (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
416
|
-
return
|
|
417
|
-
h('span', {
|
|
418
|
-
class: 'vxe-cell--item'
|
|
419
|
-
}, getFooterContent(h, params))
|
|
420
|
-
]
|
|
394
|
+
return getFooterContent(h, params)
|
|
421
395
|
},
|
|
422
396
|
|
|
423
397
|
/**
|
|
@@ -893,7 +867,7 @@ export const Cell = {
|
|
|
893
867
|
renderSortIcon (h: CreateElement, params: (VxeTableDefines.CellRenderHeaderParams | VxeTableDefines.CellRenderHeaderParams) & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
894
868
|
const { $table, column } = params
|
|
895
869
|
const sortOpts = $table.computeSortOpts
|
|
896
|
-
const { showIcon, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
870
|
+
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
897
871
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
898
872
|
return [
|
|
899
873
|
h('span', {
|
|
@@ -906,12 +880,14 @@ export const Cell = {
|
|
|
906
880
|
attrs: {
|
|
907
881
|
title: getI18n('vxe.table.sortAsc')
|
|
908
882
|
},
|
|
909
|
-
on:
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
883
|
+
on: allowBtn
|
|
884
|
+
? {
|
|
885
|
+
click (evnt: any) {
|
|
886
|
+
evnt.stopPropagation()
|
|
887
|
+
$table.triggerSortEvent(evnt, column, 'asc')
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
: undefined
|
|
915
891
|
}),
|
|
916
892
|
h('i', {
|
|
917
893
|
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
@@ -920,12 +896,14 @@ export const Cell = {
|
|
|
920
896
|
attrs: {
|
|
921
897
|
title: getI18n('vxe.table.sortDesc')
|
|
922
898
|
},
|
|
923
|
-
on:
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
899
|
+
on: allowBtn
|
|
900
|
+
? {
|
|
901
|
+
click (evnt: any) {
|
|
902
|
+
evnt.stopPropagation()
|
|
903
|
+
$table.triggerSortEvent(evnt, column, 'desc')
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
: undefined
|
|
929
907
|
})
|
|
930
908
|
])
|
|
931
909
|
]
|