vxe-table 3.12.10-beta.8 → 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 +135 -83
- 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 +50 -9
- package/es/table/src/header.js +70 -168
- package/es/table/src/methods.js +985 -502
- 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 +253 -189
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +26 -10
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +253 -189
- 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 +1782 -1056
- 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 +132 -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 +46 -7
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +52 -175
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1096 -560
- 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 +253 -189
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +26 -10
- 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 +253 -189
- 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 +148 -86
- 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 +53 -10
- package/packages/table/src/header.ts +70 -169
- package/packages/table/src/methods.ts +1031 -515
- 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 +25 -9
- package/styles/components/table.scss +319 -271
- 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.1736840896964.ttf → iconfont.1738985837413.ttf} +0 -0
- /package/es/{iconfont.1736840896964.woff → iconfont.1738985837413.woff} +0 -0
- /package/es/{iconfont.1736840896964.woff2 → iconfont.1738985837413.woff2} +0 -0
- /package/lib/{iconfont.1736840896964.ttf → iconfont.1738985837413.ttf} +0 -0
- /package/lib/{iconfont.1736840896964.woff → iconfont.1738985837413.woff} +0 -0
- /package/lib/{iconfont.1736840896964.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
|
}
|
|
@@ -245,44 +256,84 @@ function renderTdColumn (
|
|
|
245
256
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
246
257
|
isDirty = $xeTable.isUpdateByRow(row, column.field)
|
|
247
258
|
}
|
|
259
|
+
|
|
260
|
+
const isVNAutoHeight = scrollYLoad && !hasEllipsis
|
|
261
|
+
let cellHeight = currCellHeight
|
|
262
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0
|
|
263
|
+
if (resizeHeight) {
|
|
264
|
+
cellHeight = resizeHeight
|
|
265
|
+
} else {
|
|
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
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const tcStyle: Record<string, string> = {}
|
|
284
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
285
|
+
tcStyle.height = `${cellHeight}px`
|
|
286
|
+
} else {
|
|
287
|
+
tcStyle.minHeight = `${cellHeight}px`
|
|
288
|
+
}
|
|
289
|
+
|
|
248
290
|
const tdVNs = []
|
|
249
|
-
if (fixedHiddenColumn &&
|
|
291
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
250
292
|
tdVNs.push(
|
|
251
293
|
h('div', {
|
|
294
|
+
key: 'tc',
|
|
252
295
|
class: ['vxe-cell', {
|
|
253
296
|
'c--title': showTitle,
|
|
254
297
|
'c--tooltip': showTooltip,
|
|
255
298
|
'c--ellipsis': showEllipsis
|
|
256
299
|
}],
|
|
257
|
-
style:
|
|
258
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
259
|
-
}
|
|
300
|
+
style: tcStyle
|
|
260
301
|
})
|
|
261
302
|
)
|
|
262
303
|
} else {
|
|
263
304
|
// 渲染单元格
|
|
264
305
|
tdVNs.push(
|
|
265
|
-
...renderLine(h, _vm,
|
|
306
|
+
...renderLine(h, _vm, cellParams, cellHeight),
|
|
266
307
|
h('div', {
|
|
308
|
+
key: 'tc',
|
|
267
309
|
class: ['vxe-cell', {
|
|
268
310
|
'c--title': showTitle,
|
|
269
311
|
'c--tooltip': showTooltip,
|
|
270
312
|
'c--ellipsis': showEllipsis
|
|
271
313
|
}],
|
|
272
|
-
style:
|
|
273
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
274
|
-
},
|
|
314
|
+
style: tcStyle,
|
|
275
315
|
attrs: {
|
|
276
316
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
277
317
|
}
|
|
278
|
-
},
|
|
318
|
+
}, isVNPreEmptyStatus
|
|
319
|
+
? []
|
|
320
|
+
: [
|
|
321
|
+
h('div', {
|
|
322
|
+
attrs: {
|
|
323
|
+
colid,
|
|
324
|
+
rowid
|
|
325
|
+
},
|
|
326
|
+
class: 'vxe-cell--wrapper'
|
|
327
|
+
}, column.renderCell(h, cellParams))
|
|
328
|
+
])
|
|
279
329
|
)
|
|
280
330
|
if (showValidTip && errorValidItem) {
|
|
281
331
|
const errRule = errorValidItem.rule
|
|
282
332
|
const validSlot = slots ? slots.valid : null
|
|
283
|
-
const validParams = { ...
|
|
333
|
+
const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem }
|
|
284
334
|
tdVNs.push(
|
|
285
335
|
h('div', {
|
|
336
|
+
key: 'tcv',
|
|
286
337
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
287
338
|
style: errRule && errRule.maxWidth
|
|
288
339
|
? {
|
|
@@ -305,54 +356,64 @@ function renderTdColumn (
|
|
|
305
356
|
)
|
|
306
357
|
}
|
|
307
358
|
}
|
|
308
|
-
let cellHeight = ''
|
|
309
|
-
const vnHeight = isCalcCellHeight ? rest.height : 0
|
|
310
|
-
if (hasEllipsis) {
|
|
311
|
-
if (customRHeight) {
|
|
312
|
-
cellHeight = `${customRHeight}px`
|
|
313
|
-
} else if (!isAllOverflow) {
|
|
314
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`
|
|
315
|
-
}
|
|
316
|
-
} else {
|
|
317
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`
|
|
318
|
-
}
|
|
319
359
|
|
|
360
|
+
let showAreaRowStatus = false
|
|
320
361
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
321
362
|
if (
|
|
322
|
-
(
|
|
363
|
+
(!_columnIndex && selectCellToRow === true) ||
|
|
323
364
|
(selectCellToRow === column.field)
|
|
324
365
|
) {
|
|
325
|
-
|
|
326
|
-
h('div', {
|
|
327
|
-
class: 'vxe-cell--area-status'
|
|
328
|
-
})
|
|
329
|
-
)
|
|
366
|
+
showAreaRowStatus = true
|
|
330
367
|
}
|
|
331
368
|
}
|
|
332
|
-
const isLastColumn = $columnIndex === columns.length - 1
|
|
333
|
-
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
334
369
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
+
)
|
|
340
396
|
}
|
|
341
397
|
|
|
342
398
|
return h('td', {
|
|
343
399
|
class: [
|
|
344
400
|
'vxe-body--column',
|
|
345
|
-
|
|
401
|
+
colid,
|
|
402
|
+
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
403
|
+
cellAlign ? `col--${cellAlign}` : '',
|
|
404
|
+
type ? `col--${type}` : '',
|
|
346
405
|
{
|
|
347
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
348
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
349
|
-
[`col--${type}`]: type,
|
|
350
406
|
'col--last': isLastColumn,
|
|
351
407
|
'col--tree-node': treeNode,
|
|
352
408
|
'col--edit': isEdit,
|
|
353
409
|
'col--ellipsis': hasEllipsis,
|
|
410
|
+
'col--cs-height': isCsHeight,
|
|
411
|
+
'col--rs-height': isRsHeight,
|
|
412
|
+
'col--to-row': showAreaRowStatus,
|
|
413
|
+
'col--auto-height': isVNAutoHeight,
|
|
354
414
|
'fixed--width': !isAutoCellWidth,
|
|
355
415
|
'fixed--hidden': fixedHiddenColumn,
|
|
416
|
+
'is--padding': isCellPadding,
|
|
356
417
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
357
418
|
'is--drag-disabled': isDisabledDrag,
|
|
358
419
|
'col--dirty': isDirty,
|
|
@@ -360,27 +421,25 @@ function renderTdColumn (
|
|
|
360
421
|
'col--valid-error': !!errorValidItem,
|
|
361
422
|
'col--current': currentColumn === column
|
|
362
423
|
},
|
|
363
|
-
getClass(compCellClassName,
|
|
364
|
-
getClass(className,
|
|
365
|
-
getClass(allCellClassName,
|
|
424
|
+
getClass(compCellClassName, cellParams),
|
|
425
|
+
getClass(className, cellParams),
|
|
426
|
+
getClass(allCellClassName, cellParams)
|
|
366
427
|
],
|
|
367
428
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
368
|
-
attrs,
|
|
369
|
-
style: Object.assign({
|
|
370
|
-
height: cellHeight
|
|
371
|
-
}, 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),
|
|
372
431
|
on: tdOns
|
|
373
|
-
},
|
|
432
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs)
|
|
374
433
|
}
|
|
375
434
|
|
|
376
|
-
function renderRows (h: CreateElement, _vm: any, fixedType:
|
|
435
|
+
function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '', isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) {
|
|
377
436
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
378
437
|
const tableProps = $xeTable
|
|
379
438
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
380
439
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
381
440
|
|
|
382
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle,
|
|
383
|
-
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
|
|
384
443
|
const { fullAllDataRowIdData } = tableInternalData
|
|
385
444
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
386
445
|
const radioOpts = $xeTable.computeRadioOpts
|
|
@@ -466,7 +525,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.F
|
|
|
466
525
|
return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
467
526
|
})
|
|
468
527
|
rows.push(
|
|
469
|
-
columnOpts.drag && columnDragOpts.animation
|
|
528
|
+
!isColLoading && (columnOpts.drag && columnDragOpts.animation)
|
|
470
529
|
? h('transition-group', {
|
|
471
530
|
props: {
|
|
472
531
|
tag: 'tr',
|
|
@@ -502,7 +561,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: VxeColumnPropTypes.F
|
|
|
502
561
|
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
|
|
503
562
|
}
|
|
504
563
|
const { showOverflow } = expandColumn
|
|
505
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ?
|
|
564
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow
|
|
506
565
|
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
507
566
|
rows.push(
|
|
508
567
|
h('tr', {
|
|
@@ -600,8 +659,8 @@ export default {
|
|
|
600
659
|
const { xID, $scopedSlots } = $xeTable
|
|
601
660
|
const { fixedColumn, fixedType, tableColumn } = props
|
|
602
661
|
|
|
603
|
-
const {
|
|
604
|
-
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
|
|
605
664
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
|
|
606
665
|
const rowOpts = $xeTable.computeRowOpts
|
|
607
666
|
const emptyOpts = $xeTable.computeEmptyOpts
|
|
@@ -614,7 +673,7 @@ export default {
|
|
|
614
673
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
615
674
|
let isOptimizeMode = false
|
|
616
675
|
// 如果是使用优化模式
|
|
617
|
-
if (scrollXLoad || scrollYLoad ||
|
|
676
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
618
677
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
619
678
|
// 如果不支持优化模式
|
|
620
679
|
} else {
|
|
@@ -745,9 +804,9 @@ export default {
|
|
|
745
804
|
})
|
|
746
805
|
})),
|
|
747
806
|
/**
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
rowOpts.drag && rowDragOpts.animation
|
|
807
|
+
* 内容
|
|
808
|
+
*/
|
|
809
|
+
!(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
|
|
751
810
|
? h('transition-group', {
|
|
752
811
|
ref: 'refBodyTBody',
|
|
753
812
|
props: {
|
|
@@ -793,6 +852,9 @@ export default {
|
|
|
793
852
|
}),
|
|
794
853
|
h('span', {
|
|
795
854
|
class: 'vxe-table--cell-active-area'
|
|
855
|
+
}),
|
|
856
|
+
h('span', {
|
|
857
|
+
class: 'vxe-table--cell-row-status-area'
|
|
796
858
|
})
|
|
797
859
|
])
|
|
798
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
|
]
|