vxe-table 4.10.6-beta.26 → 4.10.6-beta.28
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/en-US.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +14 -11
- package/es/table/src/cell.js +25 -39
- package/es/table/src/column.js +10 -0
- package/es/table/src/columnInfo.js +2 -0
- package/es/table/src/footer.js +2 -1
- package/es/table/src/header.js +2 -2
- package/es/table/src/table.js +75 -40
- package/es/table/src/util.js +9 -3
- package/es/table/style.css +51 -26
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +51 -26
- 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 +144 -93
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +13 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +24 -33
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +2 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +1 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +81 -42
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +51 -26
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +51 -26
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +2 -2
- package/packages/table/src/body.ts +14 -11
- package/packages/table/src/cell.ts +25 -47
- package/packages/table/src/column.ts +10 -0
- package/packages/table/src/columnInfo.ts +2 -0
- package/packages/table/src/footer.ts +2 -1
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/table.ts +77 -41
- package/packages/table/src/util.ts +10 -3
- package/styles/components/table.scss +63 -31
- /package/es/{iconfont.1737366161311.ttf → iconfont.1737448409773.ttf} +0 -0
- /package/es/{iconfont.1737366161311.woff → iconfont.1737448409773.woff} +0 -0
- /package/es/{iconfont.1737366161311.woff2 → iconfont.1737448409773.woff2} +0 -0
- /package/lib/{iconfont.1737366161311.ttf → iconfont.1737448409773.ttf} +0 -0
- /package/lib/{iconfont.1737366161311.woff → iconfont.1737448409773.woff} +0 -0
- /package/lib/{iconfont.1737366161311.woff2 → iconfont.1737448409773.woff2} +0 -0
|
@@ -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 { VxeTableConstructor, VxeTableDefines,
|
|
9
|
+
import type { VxeTableConstructor, VxeTableDefines, VxeTablePrivateMethods, VxeComponentSlotType } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
@@ -207,25 +207,6 @@ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & {
|
|
|
207
207
|
]
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
function formatFooterLabel (footerFormatter: VxeColumnPropTypes.FooterFormatter, params: {
|
|
211
|
-
itemValue: any
|
|
212
|
-
column: VxeTableDefines.ColumnInfo
|
|
213
|
-
row: any
|
|
214
|
-
items: any[]
|
|
215
|
-
_columnIndex: number
|
|
216
|
-
}) {
|
|
217
|
-
if (XEUtils.isFunction(footerFormatter)) {
|
|
218
|
-
return `${footerFormatter(params)}`
|
|
219
|
-
}
|
|
220
|
-
const isArr = XEUtils.isArray(footerFormatter)
|
|
221
|
-
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
|
|
222
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
|
|
223
|
-
if (footerFormatMethod) {
|
|
224
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`
|
|
225
|
-
}
|
|
226
|
-
return ''
|
|
227
|
-
}
|
|
228
|
-
|
|
229
210
|
function getFooterContent (params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
230
211
|
const { $table, column, _columnIndex, items, row } = params
|
|
231
212
|
const { slots, editRender, cellRender, footerFormatter } = column
|
|
@@ -234,42 +215,39 @@ function getFooterContent (params: VxeTableDefines.CellRenderFooterParams & { $t
|
|
|
234
215
|
if (footerSlot) {
|
|
235
216
|
return $table.callSlot(footerSlot, params)
|
|
236
217
|
}
|
|
218
|
+
let itemValue = ''
|
|
219
|
+
// 兼容老模式
|
|
220
|
+
if (XEUtils.isArray(items)) {
|
|
221
|
+
itemValue = items[_columnIndex]
|
|
222
|
+
} else {
|
|
223
|
+
itemValue = XEUtils.get(row, column.field)
|
|
224
|
+
}
|
|
225
|
+
const footParams = Object.assign(params, {
|
|
226
|
+
itemValue
|
|
227
|
+
})
|
|
228
|
+
if (footerFormatter) {
|
|
229
|
+
if (XEUtils.isFunction(footerFormatter)) {
|
|
230
|
+
return `${footerFormatter(footParams)}`
|
|
231
|
+
}
|
|
232
|
+
const isArr = XEUtils.isArray(footerFormatter)
|
|
233
|
+
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
|
|
234
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
|
|
235
|
+
if (footerFormatMethod) {
|
|
236
|
+
return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`
|
|
237
|
+
}
|
|
238
|
+
return ''
|
|
239
|
+
}
|
|
237
240
|
if (renderOpts) {
|
|
238
241
|
const compConf = renderer.get(renderOpts.name)
|
|
239
242
|
if (compConf) {
|
|
240
243
|
const rtFooter = compConf.renderTableFooter || compConf.renderFooter
|
|
241
244
|
if (rtFooter) {
|
|
242
|
-
return getSlotVNs(rtFooter(renderOpts,
|
|
245
|
+
return getSlotVNs(rtFooter(renderOpts, footParams))
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
248
|
}
|
|
246
|
-
let itemValue = ''
|
|
247
|
-
// 兼容老模式
|
|
248
|
-
if (XEUtils.isArray(items)) {
|
|
249
|
-
itemValue = items[_columnIndex]
|
|
250
|
-
return [
|
|
251
|
-
footerFormatter
|
|
252
|
-
? formatFooterLabel(footerFormatter, {
|
|
253
|
-
itemValue,
|
|
254
|
-
column,
|
|
255
|
-
row,
|
|
256
|
-
items,
|
|
257
|
-
_columnIndex
|
|
258
|
-
})
|
|
259
|
-
: formatText(itemValue, 1)
|
|
260
|
-
]
|
|
261
|
-
}
|
|
262
|
-
itemValue = XEUtils.get(row, column.field)
|
|
263
249
|
return [
|
|
264
|
-
|
|
265
|
-
? formatFooterLabel(footerFormatter, {
|
|
266
|
-
itemValue,
|
|
267
|
-
column,
|
|
268
|
-
row,
|
|
269
|
-
items,
|
|
270
|
-
_columnIndex
|
|
271
|
-
})
|
|
272
|
-
: formatText(itemValue, 1)
|
|
250
|
+
formatText(itemValue, 1)
|
|
273
251
|
]
|
|
274
252
|
}
|
|
275
253
|
|
|
@@ -57,6 +57,16 @@ export const columnProps = {
|
|
|
57
57
|
formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter<any>>,
|
|
58
58
|
// 格式化表尾显示内容
|
|
59
59
|
footerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.FooterFormatter>,
|
|
60
|
+
// 是否显示间距
|
|
61
|
+
padding: {
|
|
62
|
+
type: Boolean as PropType<VxeColumnPropTypes.Padding>,
|
|
63
|
+
default: null
|
|
64
|
+
},
|
|
65
|
+
// 垂直对齐方式
|
|
66
|
+
verticalAlign: {
|
|
67
|
+
type: String as PropType<VxeColumnPropTypes.VerticalAlign>,
|
|
68
|
+
default: null
|
|
69
|
+
},
|
|
60
70
|
// 是否允许排序
|
|
61
71
|
sortable: Boolean as PropType<VxeColumnPropTypes.Sortable>,
|
|
62
72
|
// 自定义排序的属性
|
|
@@ -74,6 +74,8 @@ export class ColumnInfo {
|
|
|
74
74
|
footerClassName: _vm.footerClassName,
|
|
75
75
|
formatter: formatter,
|
|
76
76
|
footerFormatter: _vm.footerFormatter,
|
|
77
|
+
padding: _vm.padding,
|
|
78
|
+
verticalAlign: _vm.verticalAlign,
|
|
77
79
|
sortable: _vm.sortable,
|
|
78
80
|
sortBy: _vm.sortBy,
|
|
79
81
|
sortType: _vm.sortType,
|
|
@@ -2,6 +2,7 @@ import { defineComponent, TransitionGroup, h, ref, Ref, PropType, inject, nextTi
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
4
|
import { updateCellTitle, getPropClass } from '../../ui/src/dom'
|
|
5
|
+
import { getCellHeight } from './util'
|
|
5
6
|
|
|
6
7
|
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines } from '../../../types'
|
|
7
8
|
|
|
@@ -66,7 +67,7 @@ export default defineComponent({
|
|
|
66
67
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
67
68
|
const cellOpts = computeCellOpts.value
|
|
68
69
|
const footerCellOpts = computeFooterCellOpts.value
|
|
69
|
-
const currCellHeight = footerCellOpts.height || cellOpts.height || defaultRowHeight
|
|
70
|
+
const currCellHeight = getCellHeight(footerCellOpts.height || cellOpts.height) || defaultRowHeight
|
|
70
71
|
|
|
71
72
|
return tableColumn.map((column, $columnIndex) => {
|
|
72
73
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, TransitionGroup, h, ref, Ref, PropType, inject, nextTick, watch, onMounted, onUnmounted } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
|
-
import { convertHeaderColumnToRows } from './util'
|
|
4
|
+
import { getCellHeight, convertHeaderColumnToRows } from './util'
|
|
5
5
|
|
|
6
6
|
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines, VxeColumnPropTypes } from '../../../types'
|
|
7
7
|
|
|
@@ -52,7 +52,7 @@ export default defineComponent({
|
|
|
52
52
|
const cellOpts = computeCellOpts.value
|
|
53
53
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
54
54
|
const headerCellOpts = computeHeaderCellOpts.value
|
|
55
|
-
const currCellHeight = headerCellOpts.height || cellOpts.height || defaultRowHeight
|
|
55
|
+
const currCellHeight = getCellHeight(headerCellOpts.height || cellOpts.height) || defaultRowHeight
|
|
56
56
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts
|
|
57
57
|
return cols.map((column, $columnIndex) => {
|
|
58
58
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column
|
|
@@ -987,8 +987,8 @@ export default defineComponent({
|
|
|
987
987
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
988
988
|
const row = afterFullData[rIndex]
|
|
989
989
|
const rowid = getRowid($xeTable, row)
|
|
990
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
991
|
-
offsetTop += rowRest
|
|
990
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
991
|
+
offsetTop += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
992
992
|
if (toVisibleIndex === -1 && scrollTop < offsetTop) {
|
|
993
993
|
toVisibleIndex = rIndex
|
|
994
994
|
}
|
|
@@ -1495,19 +1495,15 @@ export default defineComponent({
|
|
|
1495
1495
|
|
|
1496
1496
|
const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
|
|
1497
1497
|
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`)
|
|
1498
|
-
let
|
|
1499
|
-
const firstCellEl = cellElemList[0]
|
|
1500
|
-
if (firstCellEl && firstCellEl.parentElement) {
|
|
1501
|
-
const cellStyle = getComputedStyle(firstCellEl.parentElement)
|
|
1502
|
-
topBottomPadding = Math.ceil(XEUtils.toNumber(cellStyle.paddingTop) + XEUtils.toNumber(cellStyle.paddingBottom))
|
|
1503
|
-
}
|
|
1504
|
-
let colHeight = rowRest.height - topBottomPadding
|
|
1498
|
+
let colHeight = rowRest.height
|
|
1505
1499
|
for (let i = 0; i < cellElemList.length; i++) {
|
|
1506
1500
|
const cellElem = cellElemList[i] as HTMLElement
|
|
1501
|
+
const tdEl = cellElem.parentElement as HTMLTableCellElement
|
|
1502
|
+
const topBottomPadding = Math.ceil(XEUtils.toNumber(tdEl.style.paddingTop) + XEUtils.toNumber(tdEl.style.paddingBottom))
|
|
1507
1503
|
const cellHeight = cellElem ? cellElem.clientHeight : 0
|
|
1508
|
-
colHeight = Math.max(colHeight, Math.ceil(cellHeight))
|
|
1504
|
+
colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight))
|
|
1509
1505
|
}
|
|
1510
|
-
return colHeight
|
|
1506
|
+
return colHeight
|
|
1511
1507
|
}
|
|
1512
1508
|
|
|
1513
1509
|
const calcCellHeight = () => {
|
|
@@ -1516,13 +1512,15 @@ export default defineComponent({
|
|
|
1516
1512
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
1517
1513
|
const el = refElem.value
|
|
1518
1514
|
if (!isAllOverflow && scrollYLoad && el) {
|
|
1515
|
+
el.setAttribute('data-calc-row', 'Y')
|
|
1519
1516
|
tableData.forEach(row => {
|
|
1520
1517
|
const rowid = getRowid($xeTable, row)
|
|
1521
1518
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
1522
1519
|
if (rowRest) {
|
|
1523
|
-
const
|
|
1524
|
-
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height,
|
|
1520
|
+
const reHeight = calcCellAutoHeight(rowRest, el)
|
|
1521
|
+
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, reHeight) : reHeight)
|
|
1525
1522
|
}
|
|
1523
|
+
el.removeAttribute('data-calc-row')
|
|
1526
1524
|
})
|
|
1527
1525
|
reactData.calcCellHeightFlag++
|
|
1528
1526
|
}
|
|
@@ -4282,7 +4280,7 @@ export default defineComponent({
|
|
|
4282
4280
|
if (rowRest) {
|
|
4283
4281
|
const resizeHeight = rowRest.resizeHeight
|
|
4284
4282
|
if (resizeHeight || isFull) {
|
|
4285
|
-
const currCellHeight = resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
4283
|
+
const currCellHeight = resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
4286
4284
|
rest[rowid] = currCellHeight
|
|
4287
4285
|
}
|
|
4288
4286
|
}
|
|
@@ -4327,8 +4325,10 @@ export default defineComponent({
|
|
|
4327
4325
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
4328
4326
|
const rowid = XEUtils.isString(rowOrId) || XEUtils.isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId)
|
|
4329
4327
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
4330
|
-
|
|
4331
|
-
|
|
4328
|
+
if (rowRest) {
|
|
4329
|
+
return rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
4330
|
+
}
|
|
4331
|
+
return 0
|
|
4332
4332
|
},
|
|
4333
4333
|
/**
|
|
4334
4334
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
@@ -6836,6 +6836,7 @@ export default defineComponent({
|
|
|
6836
6836
|
resizeTipElem.style.left = `${resizeTipLeft}px`
|
|
6837
6837
|
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`
|
|
6838
6838
|
}
|
|
6839
|
+
reactData.isDragResize = true
|
|
6839
6840
|
}
|
|
6840
6841
|
|
|
6841
6842
|
reactData.isDragResize = true
|
|
@@ -6846,9 +6847,12 @@ export default defineComponent({
|
|
|
6846
6847
|
document.onmousemove = null
|
|
6847
6848
|
document.onmouseup = null
|
|
6848
6849
|
resizeBarElem.style.display = 'none'
|
|
6849
|
-
reactData.isDragResize = false
|
|
6850
6850
|
internalData._lastResizeTime = Date.now()
|
|
6851
6851
|
|
|
6852
|
+
setTimeout(() => {
|
|
6853
|
+
reactData.isDragResize = false
|
|
6854
|
+
}, 50)
|
|
6855
|
+
|
|
6852
6856
|
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)
|
|
6853
6857
|
const resizeParams = { ...params, resizeWidth, resizeColumn }
|
|
6854
6858
|
if (resizableOpts.dragMode === 'fixed') {
|
|
@@ -6879,6 +6883,8 @@ export default defineComponent({
|
|
|
6879
6883
|
const { isDblclickAutoWidth } = resizableOpts
|
|
6880
6884
|
const el = refElem.value
|
|
6881
6885
|
if (isDblclickAutoWidth && el) {
|
|
6886
|
+
evnt.stopPropagation()
|
|
6887
|
+
evnt.preventDefault()
|
|
6882
6888
|
const { fullColumnIdData } = internalData
|
|
6883
6889
|
const { column } = params
|
|
6884
6890
|
let resizeColumn = column
|
|
@@ -6945,7 +6951,7 @@ export default defineComponent({
|
|
|
6945
6951
|
return
|
|
6946
6952
|
}
|
|
6947
6953
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
6948
|
-
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
6954
|
+
const currCellHeight = rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
6949
6955
|
const tableRect = tableEl.getBoundingClientRect()
|
|
6950
6956
|
const trRect = trEl.getBoundingClientRect()
|
|
6951
6957
|
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight
|
|
@@ -6987,6 +6993,7 @@ export default defineComponent({
|
|
|
6987
6993
|
resizeTipElem.style.left = `${resizeBarLeft}px`
|
|
6988
6994
|
resizeTipElem.style.top = `${resizeBarTop}px`
|
|
6989
6995
|
}
|
|
6996
|
+
reactData.isDragResize = true
|
|
6990
6997
|
}
|
|
6991
6998
|
|
|
6992
6999
|
reactData.isDragResize = true
|
|
@@ -6997,8 +7004,12 @@ export default defineComponent({
|
|
|
6997
7004
|
document.onmousemove = null
|
|
6998
7005
|
document.onmouseup = null
|
|
6999
7006
|
resizeBarElem.style.display = 'none'
|
|
7000
|
-
reactData.isDragResize = false
|
|
7001
7007
|
internalData._lastResizeTime = Date.now()
|
|
7008
|
+
|
|
7009
|
+
setTimeout(() => {
|
|
7010
|
+
reactData.isDragResize = false
|
|
7011
|
+
}, 50)
|
|
7012
|
+
|
|
7002
7013
|
if (resizeHeight !== currCellHeight) {
|
|
7003
7014
|
const resizeParams = { ...params, resizeHeight, resizeRow: row }
|
|
7004
7015
|
internalData.isResizeCellHeight = true
|
|
@@ -7018,22 +7029,35 @@ export default defineComponent({
|
|
|
7018
7029
|
const { isDblclickAutoHeight } = resizableOpts
|
|
7019
7030
|
const el = refElem.value
|
|
7020
7031
|
if (isDblclickAutoHeight && el) {
|
|
7032
|
+
evnt.stopPropagation()
|
|
7033
|
+
evnt.preventDefault()
|
|
7034
|
+
const { editStore } = reactData
|
|
7021
7035
|
const { fullAllDataRowIdData } = internalData
|
|
7036
|
+
const { actived } = editStore
|
|
7022
7037
|
const { row } = params
|
|
7023
7038
|
const rowid = getRowid($xeTable, row)
|
|
7024
7039
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
7025
7040
|
if (!rowRest) {
|
|
7026
7041
|
return
|
|
7027
7042
|
}
|
|
7028
|
-
const
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7043
|
+
const handleRsHeight = () => {
|
|
7044
|
+
el.setAttribute('data-calc-row', 'Y')
|
|
7045
|
+
const resizeHeight = calcCellAutoHeight(rowRest, el)
|
|
7046
|
+
el.removeAttribute('data-calc-row')
|
|
7047
|
+
const resizeParams = { ...params, resizeHeight, resizeRow: row }
|
|
7048
|
+
reactData.isDragResize = false
|
|
7049
|
+
internalData._lastResizeTime = Date.now()
|
|
7050
|
+
if ($xeTable.handleRowResizeDblclickCellAreaEvent) {
|
|
7051
|
+
$xeTable.handleRowResizeDblclickCellAreaEvent(evnt, resizeParams)
|
|
7052
|
+
} else {
|
|
7053
|
+
rowRest.resizeHeight = resizeHeight
|
|
7054
|
+
handleUpdateRowResize(evnt, resizeParams)
|
|
7055
|
+
}
|
|
7056
|
+
}
|
|
7057
|
+
if (actived.row || actived.column) {
|
|
7058
|
+
$xeTable.clearEdit().then(handleRsHeight)
|
|
7034
7059
|
} else {
|
|
7035
|
-
|
|
7036
|
-
handleUpdateRowResize(evnt, resizeParams)
|
|
7060
|
+
handleRsHeight()
|
|
7037
7061
|
}
|
|
7038
7062
|
}
|
|
7039
7063
|
},
|
|
@@ -7447,11 +7471,11 @@ export default defineComponent({
|
|
|
7447
7471
|
internalData.tooltipTimeout = setTimeout(() => {
|
|
7448
7472
|
$tooltip = refTooltip.value
|
|
7449
7473
|
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
7450
|
-
|
|
7474
|
+
$xeTable.closeTooltip()
|
|
7451
7475
|
}
|
|
7452
7476
|
}, tooltipOpts.leaveDelay)
|
|
7453
7477
|
} else {
|
|
7454
|
-
|
|
7478
|
+
$xeTable.closeTooltip()
|
|
7455
7479
|
}
|
|
7456
7480
|
},
|
|
7457
7481
|
triggerHeaderCellClickEvent (evnt, params) {
|
|
@@ -7481,7 +7505,10 @@ export default defineComponent({
|
|
|
7481
7505
|
*/
|
|
7482
7506
|
triggerCellClickEvent (evnt, params) {
|
|
7483
7507
|
const { highlightCurrentRow, editConfig } = props
|
|
7484
|
-
const { editStore } = reactData
|
|
7508
|
+
const { editStore, isDragResize } = reactData
|
|
7509
|
+
if (isDragResize) {
|
|
7510
|
+
return
|
|
7511
|
+
}
|
|
7485
7512
|
const expandOpts = computeExpandOpts.value
|
|
7486
7513
|
const editOpts = computeEditOpts.value
|
|
7487
7514
|
const treeOpts = computeTreeOpts.value
|
|
@@ -7573,7 +7600,10 @@ export default defineComponent({
|
|
|
7573
7600
|
*/
|
|
7574
7601
|
triggerCellDblclickEvent (evnt, params) {
|
|
7575
7602
|
const { editConfig } = props
|
|
7576
|
-
const { editStore } = reactData
|
|
7603
|
+
const { editStore, isDragResize } = reactData
|
|
7604
|
+
if (isDragResize) {
|
|
7605
|
+
return
|
|
7606
|
+
}
|
|
7577
7607
|
const editOpts = computeEditOpts.value
|
|
7578
7608
|
const { actived } = editStore
|
|
7579
7609
|
const cell = evnt.currentTarget as HTMLDivElement
|
|
@@ -7975,7 +8005,11 @@ export default defineComponent({
|
|
|
7975
8005
|
// 根到根
|
|
7976
8006
|
}
|
|
7977
8007
|
|
|
7978
|
-
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
8008
|
+
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
8009
|
+
key: rowField,
|
|
8010
|
+
parentKey: parentField,
|
|
8011
|
+
children: mapChildrenField
|
|
8012
|
+
})
|
|
7979
8013
|
|
|
7980
8014
|
// 移出
|
|
7981
8015
|
const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow)
|
|
@@ -7995,10 +8029,10 @@ export default defineComponent({
|
|
|
7995
8029
|
dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField]
|
|
7996
8030
|
|
|
7997
8031
|
internalData.tableFullTreeData = XEUtils.toArrayTree(fullList, {
|
|
7998
|
-
key:
|
|
7999
|
-
parentKey:
|
|
8032
|
+
key: rowField,
|
|
8033
|
+
parentKey: parentField,
|
|
8000
8034
|
children: childrenField,
|
|
8001
|
-
mapChildren:
|
|
8035
|
+
mapChildren: mapChildrenField
|
|
8002
8036
|
})
|
|
8003
8037
|
}
|
|
8004
8038
|
}
|
|
@@ -8704,7 +8738,10 @@ export default defineComponent({
|
|
|
8704
8738
|
})
|
|
8705
8739
|
},
|
|
8706
8740
|
triggerBodyWheelEvent (evnt) {
|
|
8707
|
-
const { deltaY, deltaX } = evnt
|
|
8741
|
+
const { target, deltaY, deltaX } = evnt
|
|
8742
|
+
if (target && /^textarea$/i.test((target as HTMLElement).tagName)) {
|
|
8743
|
+
return
|
|
8744
|
+
}
|
|
8708
8745
|
const { highlightHoverRow } = tableProps
|
|
8709
8746
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
8710
8747
|
const rowOpts = computeRowOpts.value
|
|
@@ -8723,7 +8760,6 @@ export default defineComponent({
|
|
|
8723
8760
|
if (!bodyScrollElem) {
|
|
8724
8761
|
return
|
|
8725
8762
|
}
|
|
8726
|
-
|
|
8727
8763
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime)
|
|
8728
8764
|
const deltaTop = deltaY * wheelSpeed
|
|
8729
8765
|
const deltaLeft = deltaX * wheelSpeed
|
|
@@ -8930,14 +8966,14 @@ export default defineComponent({
|
|
|
8930
8966
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
8931
8967
|
const row = afterFullData[i]
|
|
8932
8968
|
const rowid = getRowid($xeTable, row)
|
|
8933
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
8934
|
-
ySpaceHeight += rowRest
|
|
8969
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
8970
|
+
ySpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
8935
8971
|
}
|
|
8936
8972
|
for (let i = 0; i < startIndex; i++) {
|
|
8937
8973
|
const row = afterFullData[i]
|
|
8938
8974
|
const rowid = getRowid($xeTable, row)
|
|
8939
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
8940
|
-
topSpaceHeight += rowRest
|
|
8975
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
8976
|
+
topSpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
8941
8977
|
}
|
|
8942
8978
|
}
|
|
8943
8979
|
} else {
|
|
@@ -178,6 +178,13 @@ export function getRefElem (refEl: any) {
|
|
|
178
178
|
return null
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
export function getCellHeight (height: number | 'unset' | undefined | null) {
|
|
182
|
+
if (height === 'unset') {
|
|
183
|
+
return 0
|
|
184
|
+
}
|
|
185
|
+
return height || 0
|
|
186
|
+
}
|
|
187
|
+
|
|
181
188
|
/**
|
|
182
189
|
* 列宽拖动最大宽度
|
|
183
190
|
* @param params
|
|
@@ -483,7 +490,7 @@ export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
483
490
|
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight)
|
|
484
491
|
}
|
|
485
492
|
let scrollTop = 0
|
|
486
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
493
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
487
494
|
const rHeight = rowRest ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight) : defaultRowHeight
|
|
488
495
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
489
496
|
const currRow = afterFullData[i]
|
|
@@ -491,8 +498,8 @@ export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
491
498
|
if (currRow === row || currRowid === rowid) {
|
|
492
499
|
break
|
|
493
500
|
}
|
|
494
|
-
const
|
|
495
|
-
scrollTop +=
|
|
501
|
+
const currRowRest = fullAllDataRowIdData[currRowid] || {}
|
|
502
|
+
scrollTop += currRowRest.resizeHeight || currRowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
496
503
|
}
|
|
497
504
|
if (scrollTop < bodyScrollTop) {
|
|
498
505
|
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1)
|
|
@@ -155,8 +155,8 @@
|
|
|
155
155
|
.vxe-default-input,
|
|
156
156
|
.vxe-default-textarea,
|
|
157
157
|
.vxe-default-select {
|
|
158
|
+
font-family: var(--vxe-ui-font-family);
|
|
158
159
|
outline: 0;
|
|
159
|
-
padding: 0 2px;
|
|
160
160
|
color: var(--vxe-ui-font-color);
|
|
161
161
|
border-radius: var(--vxe-ui-border-radius);
|
|
162
162
|
border: 1px solid var(--vxe-ui-input-border-color);
|
|
@@ -186,11 +186,9 @@
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
.vxe-default-textarea {
|
|
189
|
+
font-size: 1em;
|
|
189
190
|
resize: none;
|
|
190
191
|
vertical-align: middle;
|
|
191
|
-
&:not([rows]) {
|
|
192
|
-
height: var(--vxe-ui-input-height-default);
|
|
193
|
-
}
|
|
194
192
|
}
|
|
195
193
|
& > .vxe-input > .vxe-input--inner,
|
|
196
194
|
& > .vxe-textarea > .vxe-textarea--inner {
|
|
@@ -213,9 +211,30 @@
|
|
|
213
211
|
}
|
|
214
212
|
.vxe-body--column {
|
|
215
213
|
&.col--vertical-top {
|
|
216
|
-
|
|
217
|
-
& > .vxe-cell
|
|
218
|
-
|
|
214
|
+
&.col--active {
|
|
215
|
+
& > .vxe-cell {
|
|
216
|
+
& > .vxe-cell--wrapper {
|
|
217
|
+
height: 100%;
|
|
218
|
+
& > .vxe-default-textarea {
|
|
219
|
+
height: 100%;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/*行高*/
|
|
227
|
+
.vxe-table {
|
|
228
|
+
&:not([data-calc-row]) {
|
|
229
|
+
.vxe-body--column {
|
|
230
|
+
&.col--vertical-top {
|
|
231
|
+
&:not(.col--active) {
|
|
232
|
+
& > .vxe-cell {
|
|
233
|
+
& > .vxe-cell--wrapper {
|
|
234
|
+
min-height: 100%;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
219
238
|
}
|
|
220
239
|
}
|
|
221
240
|
}
|
|
@@ -1198,6 +1217,9 @@
|
|
|
1198
1217
|
&.is--padding {
|
|
1199
1218
|
.vxe-cell {
|
|
1200
1219
|
padding: var(--vxe-ui-table-cell-padding-medium);
|
|
1220
|
+
.vxe-default-textarea {
|
|
1221
|
+
padding: var(--vxe-ui-table-cell-padding-medium);
|
|
1222
|
+
}
|
|
1201
1223
|
}
|
|
1202
1224
|
}
|
|
1203
1225
|
}
|
|
@@ -1226,6 +1248,9 @@
|
|
|
1226
1248
|
&.is--padding {
|
|
1227
1249
|
.vxe-cell {
|
|
1228
1250
|
padding: var(--vxe-ui-table-cell-padding-small);
|
|
1251
|
+
.vxe-default-textarea {
|
|
1252
|
+
padding: var(--vxe-ui-table-cell-padding-small);
|
|
1253
|
+
}
|
|
1229
1254
|
}
|
|
1230
1255
|
}
|
|
1231
1256
|
}
|
|
@@ -1254,6 +1279,9 @@
|
|
|
1254
1279
|
&.is--padding {
|
|
1255
1280
|
.vxe-cell {
|
|
1256
1281
|
padding: var(--vxe-ui-table-cell-padding-mini);
|
|
1282
|
+
.vxe-default-textarea {
|
|
1283
|
+
padding: var(--vxe-ui-table-cell-padding-mini);
|
|
1284
|
+
}
|
|
1257
1285
|
}
|
|
1258
1286
|
}
|
|
1259
1287
|
}
|
|
@@ -1277,6 +1305,9 @@
|
|
|
1277
1305
|
&.is--padding {
|
|
1278
1306
|
.vxe-cell {
|
|
1279
1307
|
padding: var(--vxe-ui-table-cell-padding-default);
|
|
1308
|
+
.vxe-default-textarea {
|
|
1309
|
+
padding: var(--vxe-ui-table-cell-padding-default);
|
|
1310
|
+
}
|
|
1280
1311
|
}
|
|
1281
1312
|
}
|
|
1282
1313
|
}
|
|
@@ -1523,6 +1554,31 @@
|
|
|
1523
1554
|
align-items: center;
|
|
1524
1555
|
}
|
|
1525
1556
|
}
|
|
1557
|
+
/*溢出列*/
|
|
1558
|
+
.vxe-header--column,
|
|
1559
|
+
.vxe-body--column,
|
|
1560
|
+
.vxe-footer--column {
|
|
1561
|
+
&:not(.col--active) {
|
|
1562
|
+
&.col--ellipsis {
|
|
1563
|
+
& > .vxe-cell {
|
|
1564
|
+
overflow: hidden;
|
|
1565
|
+
& > .vxe-cell--wrapper {
|
|
1566
|
+
overflow: hidden;
|
|
1567
|
+
text-overflow: ellipsis;
|
|
1568
|
+
white-space: nowrap;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
&.vxe-tree-cell,
|
|
1573
|
+
&.col--vertical-top {
|
|
1574
|
+
& > .vxe-cell {
|
|
1575
|
+
& > .vxe-cell--wrapper {
|
|
1576
|
+
white-space: pre-line;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1526
1582
|
.vxe-header--column,
|
|
1527
1583
|
.vxe-footer--column {
|
|
1528
1584
|
&.col--ellipsis {
|
|
@@ -1760,30 +1816,6 @@
|
|
|
1760
1816
|
white-space: nowrap;
|
|
1761
1817
|
}
|
|
1762
1818
|
|
|
1763
|
-
/*溢出列*/
|
|
1764
|
-
.vxe-header--column,
|
|
1765
|
-
.vxe-body--column,
|
|
1766
|
-
.vxe-footer--column {
|
|
1767
|
-
&.col--ellipsis {
|
|
1768
|
-
&:not(.col--active) {
|
|
1769
|
-
& > .vxe-cell {
|
|
1770
|
-
overflow: hidden;
|
|
1771
|
-
text-overflow: ellipsis;
|
|
1772
|
-
white-space: nowrap;
|
|
1773
|
-
& > .vxe-cell--wrapper {
|
|
1774
|
-
overflow: hidden;
|
|
1775
|
-
text-overflow: ellipsis;
|
|
1776
|
-
white-space: nowrap;
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
&.col--vertical-top {
|
|
1780
|
-
& > .vxe-cell {
|
|
1781
|
-
white-space: pre-line;
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
1819
|
&.size--medium {
|
|
1788
1820
|
.vxe-cell--checkbox {
|
|
1789
1821
|
font-size: var(--vxe-checkbox-font-size-medium);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|