vxe-table 3.14.1 → 3.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/module/edit/mixin.js +3 -2
- package/es/table/module/keyboard/mixin.js +3 -2
- package/es/table/module/menu/mixin.js +8 -7
- package/es/table/src/methods.js +114 -65
- package/es/table/src/table.js +6 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +0 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +136 -88
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +2 -1
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -1
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +10 -7
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/src/methods.js +114 -76
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +6 -0
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +0 -2
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +4 -2
- package/packages/table/module/keyboard/mixin.ts +4 -2
- package/packages/table/module/menu/mixin.ts +9 -7
- package/packages/table/src/methods.ts +115 -65
- package/packages/table/src/table.ts +6 -0
- package/packages/ui/src/dom.ts +0 -2
- /package/es/{iconfont.1743045564244.ttf → iconfont.1743389110592.ttf} +0 -0
- /package/es/{iconfont.1743045564244.woff → iconfont.1743389110592.woff} +0 -0
- /package/es/{iconfont.1743045564244.woff2 → iconfont.1743389110592.woff2} +0 -0
- /package/lib/{iconfont.1743045564244.ttf → iconfont.1743389110592.ttf} +0 -0
- /package/lib/{iconfont.1743045564244.woff → iconfont.1743389110592.woff} +0 -0
- /package/lib/{iconfont.1743045564244.woff2 → iconfont.1743389110592.woff2} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
-
import {
|
|
2
|
+
import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, getOffsetPos, setScrollTop, setScrollLeft, toCssUnit } from '../../ui/src/dom'
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
5
|
import Cell from './cell'
|
|
@@ -11,6 +11,8 @@ import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, Table
|
|
|
11
11
|
|
|
12
12
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI
|
|
13
13
|
|
|
14
|
+
const browseObj = XEUtils.browse()
|
|
15
|
+
|
|
14
16
|
const supportMaxRow = 5e6
|
|
15
17
|
const customStorageKey = 'VXE_CUSTOM_STORE'
|
|
16
18
|
const maxYHeight = 5e6
|
|
@@ -498,11 +500,11 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
498
500
|
}
|
|
499
501
|
if (xLeftCornerEl) {
|
|
500
502
|
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : ''
|
|
501
|
-
xLeftCornerEl.style.display = scrollbarXToTop ? (
|
|
503
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? (overflowX && osbHeight ? 'block' : '') : ''
|
|
502
504
|
}
|
|
503
505
|
if (xRightCornerEl) {
|
|
504
506
|
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`
|
|
505
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' : (
|
|
507
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : (overflowX && osbHeight ? 'block' : '')
|
|
506
508
|
}
|
|
507
509
|
|
|
508
510
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem as HTMLDivElement
|
|
@@ -514,7 +516,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
514
516
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem as HTMLDivElement
|
|
515
517
|
if (yTopCornerEl) {
|
|
516
518
|
yTopCornerEl.style.height = `${headerHeight}px`
|
|
517
|
-
yTopCornerEl.style.display = headerHeight ? 'block' : ''
|
|
519
|
+
yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : ''
|
|
518
520
|
}
|
|
519
521
|
const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem as HTMLDivElement
|
|
520
522
|
if (yWrapperEl) {
|
|
@@ -525,7 +527,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
525
527
|
if (yBottomCornerEl) {
|
|
526
528
|
yBottomCornerEl.style.height = `${footerHeight}px`
|
|
527
529
|
yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`
|
|
528
|
-
yBottomCornerEl.style.display = footerHeight ? 'block' : ''
|
|
530
|
+
yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : ''
|
|
529
531
|
}
|
|
530
532
|
|
|
531
533
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem as HTMLDivElement
|
|
@@ -654,7 +656,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
654
656
|
if (tableElem) {
|
|
655
657
|
tableElem.style.width = tWidth ? `${tWidth}px` : ''
|
|
656
658
|
// 兼容性处理
|
|
657
|
-
tableElem.style.paddingRight = osbWidth && fixedType && (
|
|
659
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browseObj['-moz'] || browseObj.safari) ? `${osbWidth}px` : ''
|
|
658
660
|
}
|
|
659
661
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`])
|
|
660
662
|
if (emptyBlockElem) {
|
|
@@ -1848,7 +1850,7 @@ function hideDropTip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1848
1850
|
* @param {Event} evnt 事件
|
|
1849
1851
|
* @param {Row} row 行对象
|
|
1850
1852
|
*/
|
|
1851
|
-
function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: MouseEvent, tdEl: HTMLTableCellElement, overflowElem: HTMLElement | null, params: any) {
|
|
1853
|
+
function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: MouseEvent, tdEl: HTMLTableCellElement, overflowElem: HTMLElement | null, tipElem: HTMLElement | null, params: any) {
|
|
1852
1854
|
const reactData = $xeTable as unknown as TableReactData
|
|
1853
1855
|
|
|
1854
1856
|
const tipOverEl = overflowElem || tdEl
|
|
@@ -1863,7 +1865,8 @@ function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
|
|
|
1863
1865
|
const customContent = contentMethod ? contentMethod(params) : null
|
|
1864
1866
|
const useCustom = contentMethod && !XEUtils.eqNull(customContent)
|
|
1865
1867
|
const content = useCustom ? customContent : XEUtils.toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim()
|
|
1866
|
-
|
|
1868
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth
|
|
1869
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
1867
1870
|
Object.assign(tooltipStore, {
|
|
1868
1871
|
row,
|
|
1869
1872
|
column,
|
|
@@ -1873,7 +1876,7 @@ function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
|
|
|
1873
1876
|
$xeTable.$nextTick(() => {
|
|
1874
1877
|
const $tooltip = $xeTable.$refs.refTooltip as VxeTooltipInstance
|
|
1875
1878
|
if ($tooltip && $tooltip.open) {
|
|
1876
|
-
$tooltip.open(tipOverEl, formatText(content))
|
|
1879
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, formatText(content))
|
|
1877
1880
|
}
|
|
1878
1881
|
})
|
|
1879
1882
|
}
|
|
@@ -5346,14 +5349,26 @@ const Methods = {
|
|
|
5346
5349
|
*/
|
|
5347
5350
|
handleGlobalKeydownEvent (evnt: any) {
|
|
5348
5351
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5352
|
+
const props = $xeTable
|
|
5349
5353
|
const internalData = $xeTable as unknown as TableInternalData
|
|
5354
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
5350
5355
|
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
|
|
5351
5356
|
|
|
5352
5357
|
// 该行为只对当前激活的表格有效
|
|
5353
|
-
if (
|
|
5354
|
-
|
|
5358
|
+
if (internalData.isActivated) {
|
|
5359
|
+
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
5360
|
+
const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props
|
|
5361
|
+
const { ctxMenuStore, editStore, currentRow } = reactData
|
|
5355
5362
|
const { afterFullData } = internalData
|
|
5356
|
-
const
|
|
5363
|
+
const isMenu = $xeTable.computeIsMenu
|
|
5364
|
+
const bodyMenu = $xeTable.computeBodyMenu
|
|
5365
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts
|
|
5366
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
5367
|
+
const editOpts = $xeTable.computeEditOpts
|
|
5368
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
5369
|
+
const menuList = $xeTable.computeMenuList
|
|
5370
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
5371
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
5357
5372
|
const { selected, actived } = editStore
|
|
5358
5373
|
const { keyCode } = evnt
|
|
5359
5374
|
const hasBackspaceKey = keyCode === 8
|
|
@@ -5373,33 +5388,44 @@ const Methods = {
|
|
|
5373
5388
|
const hasShiftKey = evnt.shiftKey
|
|
5374
5389
|
const hasAltKey = evnt.altKey
|
|
5375
5390
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow
|
|
5376
|
-
const operCtxMenu =
|
|
5391
|
+
const operCtxMenu = isMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow)
|
|
5377
5392
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row
|
|
5378
5393
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
5379
5394
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
5380
|
-
if (filterStore.visible) {
|
|
5381
|
-
if (isEsc) {
|
|
5382
|
-
this.closeFilter()
|
|
5383
|
-
}
|
|
5384
|
-
return
|
|
5385
|
-
}
|
|
5386
5395
|
if (operCtxMenu) {
|
|
5387
5396
|
// 如果配置了右键菜单; 支持方向键操作、回车
|
|
5388
5397
|
evnt.preventDefault()
|
|
5389
5398
|
if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
|
|
5390
|
-
|
|
5399
|
+
$xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selectChild', isLeftArrow, false, ctxMenuStore.selected.children)
|
|
5391
5400
|
} else {
|
|
5392
|
-
|
|
5401
|
+
$xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selected', isRightArrow, true, menuList)
|
|
5402
|
+
}
|
|
5403
|
+
} else if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardCellAreaEvent) {
|
|
5404
|
+
$xeTable.handleKeyboardCellAreaEvent(evnt)
|
|
5405
|
+
} else if (isEsc) {
|
|
5406
|
+
// 如果按下了 Esc 键,关闭快捷菜单、筛选
|
|
5407
|
+
if ($xeTable.closeMenu) {
|
|
5408
|
+
$xeTable.closeMenu()
|
|
5409
|
+
}
|
|
5410
|
+
$xeTable.closeFilter()
|
|
5411
|
+
if (keyboardConfig && keyboardOpts.isEsc) {
|
|
5412
|
+
// 如果是激活编辑状态,则取消编辑
|
|
5413
|
+
if (actived.row) {
|
|
5414
|
+
const params = actived.args
|
|
5415
|
+
$xeTable.handleClearEdit(evnt)
|
|
5416
|
+
// 如果配置了选中功能,则为选中状态
|
|
5417
|
+
if (mouseOpts.selected) {
|
|
5418
|
+
$xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt))
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5393
5421
|
}
|
|
5394
|
-
} else if (keyboardConfig && mouseConfig && mouseOpts.area && this.handleKeyboardCellAreaEvent) {
|
|
5395
|
-
this.handleKeyboardCellAreaEvent(evnt)
|
|
5396
5422
|
} else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
|
|
5397
5423
|
// 空格键支持选中复选框
|
|
5398
5424
|
evnt.preventDefault()
|
|
5399
5425
|
if (selected.column.type === 'checkbox') {
|
|
5400
|
-
|
|
5426
|
+
$xeTable.handleToggleCheckRowEvent(evnt, selected.args)
|
|
5401
5427
|
} else {
|
|
5402
|
-
|
|
5428
|
+
$xeTable.triggerRadioRowEvent(evnt, selected.args)
|
|
5403
5429
|
}
|
|
5404
5430
|
} else if (isF2 && isEnableConf(editConfig)) {
|
|
5405
5431
|
if (!isEditStatus) {
|
|
@@ -5407,12 +5433,12 @@ const Methods = {
|
|
|
5407
5433
|
if (selected.row && selected.column) {
|
|
5408
5434
|
evnt.stopPropagation()
|
|
5409
5435
|
evnt.preventDefault()
|
|
5410
|
-
|
|
5436
|
+
$xeTable.handleEdit(selected.args, evnt)
|
|
5411
5437
|
}
|
|
5412
5438
|
}
|
|
5413
5439
|
} else if (isContextMenu) {
|
|
5414
5440
|
// 如果按下上下文键
|
|
5415
|
-
internalData._keyCtx = selected.row && selected.column &&
|
|
5441
|
+
internalData._keyCtx = selected.row && selected.column && bodyMenu.length
|
|
5416
5442
|
clearTimeout(internalData.keyCtxTimeout)
|
|
5417
5443
|
internalData.keyCtxTimeout = setTimeout(() => {
|
|
5418
5444
|
internalData._keyCtx = false
|
|
@@ -5424,10 +5450,10 @@ const Methods = {
|
|
|
5424
5450
|
// 如果是激活编辑状态,则取消编辑
|
|
5425
5451
|
if (actived.row) {
|
|
5426
5452
|
const params = actived.args
|
|
5427
|
-
|
|
5453
|
+
$xeTable.handleClearEdit(evnt)
|
|
5428
5454
|
// 如果配置了选中功能,则为选中状态
|
|
5429
5455
|
if (mouseConfig && mouseOpts.selected) {
|
|
5430
|
-
|
|
5456
|
+
$xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt))
|
|
5431
5457
|
}
|
|
5432
5458
|
}
|
|
5433
5459
|
} else {
|
|
@@ -5436,13 +5462,13 @@ const Methods = {
|
|
|
5436
5462
|
const activeParams = selected.row ? selected.args : actived.args
|
|
5437
5463
|
if (hasShiftKey) {
|
|
5438
5464
|
if (keyboardOpts.enterToTab) {
|
|
5439
|
-
|
|
5465
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt)
|
|
5440
5466
|
} else {
|
|
5441
|
-
|
|
5467
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt)
|
|
5442
5468
|
}
|
|
5443
5469
|
} else {
|
|
5444
5470
|
if (keyboardOpts.enterToTab) {
|
|
5445
|
-
|
|
5471
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt)
|
|
5446
5472
|
} else {
|
|
5447
5473
|
const activeRow = selected.row || actived.row
|
|
5448
5474
|
const activeColumn = selected.column || actived.column
|
|
@@ -5470,7 +5496,7 @@ const Methods = {
|
|
|
5470
5496
|
return
|
|
5471
5497
|
}
|
|
5472
5498
|
}
|
|
5473
|
-
|
|
5499
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt)
|
|
5474
5500
|
if (enterMethod) {
|
|
5475
5501
|
enterMethod(etrParams)
|
|
5476
5502
|
}
|
|
@@ -5483,26 +5509,40 @@ const Methods = {
|
|
|
5483
5509
|
if (childrens && childrens.length) {
|
|
5484
5510
|
evnt.preventDefault()
|
|
5485
5511
|
const targetRow = childrens[0]
|
|
5486
|
-
const params = {
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
.
|
|
5512
|
+
const params = {
|
|
5513
|
+
$table: $xeTable,
|
|
5514
|
+
row: targetRow,
|
|
5515
|
+
rowIndex: $xeTable.getRowIndex(targetRow),
|
|
5516
|
+
$rowIndex: $xeTable.getVMRowIndex(targetRow)
|
|
5517
|
+
}
|
|
5518
|
+
$xeTable.setTreeExpand(currentRow, true)
|
|
5519
|
+
.then(() => $xeTable.scrollToRow(targetRow))
|
|
5520
|
+
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params))
|
|
5490
5521
|
}
|
|
5491
5522
|
}
|
|
5492
5523
|
}
|
|
5493
5524
|
} else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
|
|
5494
5525
|
if (!isEditStatus) {
|
|
5495
5526
|
// 如果按下了方向键
|
|
5496
|
-
if (selected.row && selected.column) {
|
|
5527
|
+
if (mouseOpts.selected && selected.row && selected.column) {
|
|
5497
5528
|
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt)
|
|
5529
|
+
} else {
|
|
5530
|
+
// 当前行按键上下移动
|
|
5531
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
5532
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt)
|
|
5533
|
+
}
|
|
5534
|
+
// 当前行按键左右移动
|
|
5535
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
5536
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt)
|
|
5537
|
+
}
|
|
5498
5538
|
}
|
|
5499
5539
|
}
|
|
5500
5540
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
5501
5541
|
// 如果按下了 Tab 键切换
|
|
5502
5542
|
if (selected.row || selected.column) {
|
|
5503
|
-
|
|
5543
|
+
$xeTable.moveTabSelected(selected.args, hasShiftKey, evnt)
|
|
5504
5544
|
} else if (actived.row || actived.column) {
|
|
5505
|
-
|
|
5545
|
+
$xeTable.moveTabSelected(actived.args, hasShiftKey, evnt)
|
|
5506
5546
|
}
|
|
5507
5547
|
} else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
5508
5548
|
// 如果是删除键
|
|
@@ -5510,10 +5550,10 @@ const Methods = {
|
|
|
5510
5550
|
const { delMethod } = keyboardOpts
|
|
5511
5551
|
const params = {
|
|
5512
5552
|
row: selected.row,
|
|
5513
|
-
rowIndex:
|
|
5553
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
5514
5554
|
column: selected.column,
|
|
5515
|
-
columnIndex:
|
|
5516
|
-
$table:
|
|
5555
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
5556
|
+
$table: $xeTable,
|
|
5517
5557
|
$grid: $xeGrid
|
|
5518
5558
|
}
|
|
5519
5559
|
// 是否被禁用
|
|
@@ -5524,8 +5564,8 @@ const Methods = {
|
|
|
5524
5564
|
setCellValue(selected.row, selected.column, null)
|
|
5525
5565
|
}
|
|
5526
5566
|
// 如果按下 del 键,更新表尾数据
|
|
5527
|
-
|
|
5528
|
-
|
|
5567
|
+
$xeTable.updateFooter()
|
|
5568
|
+
$xeTable.dispatchEvent('cell-delete-value', params, evnt)
|
|
5529
5569
|
}
|
|
5530
5570
|
}
|
|
5531
5571
|
} else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
@@ -5535,10 +5575,10 @@ const Methods = {
|
|
|
5535
5575
|
if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
5536
5576
|
const params = {
|
|
5537
5577
|
row: selected.row,
|
|
5538
|
-
rowIndex:
|
|
5578
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
5539
5579
|
column: selected.column,
|
|
5540
|
-
columnIndex:
|
|
5541
|
-
$table:
|
|
5580
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
5581
|
+
$table: $xeTable,
|
|
5542
5582
|
$grid: $xeGrid
|
|
5543
5583
|
}
|
|
5544
5584
|
// 是否被禁用
|
|
@@ -5550,27 +5590,27 @@ const Methods = {
|
|
|
5550
5590
|
if (editMode !== 'insert') {
|
|
5551
5591
|
setCellValue(selected.row, selected.column, null)
|
|
5552
5592
|
}
|
|
5553
|
-
|
|
5593
|
+
$xeTable.handleEdit(selected.args, evnt)
|
|
5554
5594
|
}
|
|
5555
|
-
|
|
5595
|
+
$xeTable.dispatchEvent('cell-backspace-value', params, evnt)
|
|
5556
5596
|
}
|
|
5557
5597
|
}
|
|
5558
5598
|
}
|
|
5559
5599
|
} else if (hasBackspaceKey && keyboardConfig && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
|
|
5560
5600
|
// 如果树形表格回退键关闭当前行返回父节点
|
|
5561
|
-
const { parent: parentRow } = XEUtils.findTree(
|
|
5601
|
+
const { parent: parentRow } = XEUtils.findTree(internalData.afterTreeFullData, item => item === currentRow, { children: childrenField })
|
|
5562
5602
|
if (parentRow) {
|
|
5563
5603
|
evnt.preventDefault()
|
|
5564
5604
|
const params = {
|
|
5565
5605
|
row: parentRow,
|
|
5566
|
-
rowIndex:
|
|
5567
|
-
$rowIndex:
|
|
5568
|
-
$table:
|
|
5606
|
+
rowIndex: $xeTable.getRowIndex(parentRow),
|
|
5607
|
+
$rowIndex: $xeTable.getVMRowIndex(parentRow),
|
|
5608
|
+
$table: $xeTable,
|
|
5569
5609
|
$grid: $xeGrid
|
|
5570
5610
|
}
|
|
5571
|
-
|
|
5572
|
-
.then(() =>
|
|
5573
|
-
.then(() =>
|
|
5611
|
+
$xeTable.setTreeExpand(parentRow, false)
|
|
5612
|
+
.then(() => $xeTable.scrollToRow(parentRow))
|
|
5613
|
+
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params))
|
|
5574
5614
|
}
|
|
5575
5615
|
} else if (keyboardConfig && keyboardOpts.isEdit && !hasCtrlKey && !hasMetaKey && (isSpacebar || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
|
|
5576
5616
|
const { editMethod } = keyboardOpts
|
|
@@ -5583,10 +5623,10 @@ const Methods = {
|
|
|
5583
5623
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
5584
5624
|
const params = {
|
|
5585
5625
|
row: selected.row,
|
|
5586
|
-
rowIndex:
|
|
5626
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
5587
5627
|
column: selected.column,
|
|
5588
|
-
columnIndex:
|
|
5589
|
-
$table:
|
|
5628
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
5629
|
+
$table: $xeTable,
|
|
5590
5630
|
$grid: $xeGrid
|
|
5591
5631
|
}
|
|
5592
5632
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
@@ -5594,12 +5634,12 @@ const Methods = {
|
|
|
5594
5634
|
editMethod(params)
|
|
5595
5635
|
} else {
|
|
5596
5636
|
setCellValue(selected.row, selected.column, null)
|
|
5597
|
-
|
|
5637
|
+
$xeTable.handleEdit(selected.args, evnt)
|
|
5598
5638
|
}
|
|
5599
5639
|
}
|
|
5600
5640
|
}
|
|
5601
5641
|
}
|
|
5602
|
-
|
|
5642
|
+
$xeTable.dispatchEvent('keydown', {}, evnt)
|
|
5603
5643
|
})
|
|
5604
5644
|
}
|
|
5605
5645
|
},
|
|
@@ -5709,7 +5749,7 @@ const Methods = {
|
|
|
5709
5749
|
return
|
|
5710
5750
|
}
|
|
5711
5751
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
5712
|
-
handleTooltip($xeTable, evnt, thEl, thEl.querySelector<HTMLElement>('.vxe-cell--title') || cellEl, params)
|
|
5752
|
+
handleTooltip($xeTable, evnt, thEl, thEl.querySelector<HTMLElement>('.vxe-cell--wrapper'), thEl.querySelector<HTMLElement>('.vxe-cell--title') || cellEl, params)
|
|
5713
5753
|
}
|
|
5714
5754
|
},
|
|
5715
5755
|
/**
|
|
@@ -5740,7 +5780,7 @@ const Methods = {
|
|
|
5740
5780
|
}
|
|
5741
5781
|
}
|
|
5742
5782
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
5743
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector<HTMLElement>('.vxe-cell--label') || tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper'), params)
|
|
5783
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper'), tdEl.querySelector<HTMLElement>('.vxe-cell--label') || tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper'), params)
|
|
5744
5784
|
}
|
|
5745
5785
|
},
|
|
5746
5786
|
/**
|
|
@@ -5755,7 +5795,7 @@ const Methods = {
|
|
|
5755
5795
|
const tdEl = evnt.currentTarget as HTMLTableCellElement
|
|
5756
5796
|
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row)
|
|
5757
5797
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
5758
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector<HTMLElement>('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper') as HTMLElement, params)
|
|
5798
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector<HTMLElement>('.vxe-cell--wrapper'), tdEl.querySelector<HTMLElement>('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper') as HTMLElement, params)
|
|
5759
5799
|
}
|
|
5760
5800
|
},
|
|
5761
5801
|
openTooltip (target: any, content: any) {
|
|
@@ -8958,6 +8998,7 @@ const Methods = {
|
|
|
8958
8998
|
|
|
8959
8999
|
const { isGroup, scrollXLoad, overflowX, scrollXWidth } = reactData
|
|
8960
9000
|
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData
|
|
9001
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
8961
9002
|
const tableBody = $xeTable.$refs.refTableBody
|
|
8962
9003
|
const tableBodyElem = tableBody ? (tableBody as any).$el as HTMLDivElement : null
|
|
8963
9004
|
if (tableBodyElem) {
|
|
@@ -9021,6 +9062,10 @@ const Methods = {
|
|
|
9021
9062
|
if (scrollXSpaceEl) {
|
|
9022
9063
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`
|
|
9023
9064
|
}
|
|
9065
|
+
|
|
9066
|
+
if (isScrollXBig && mouseOpts.area) {
|
|
9067
|
+
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
9068
|
+
}
|
|
9024
9069
|
$xeTable.$nextTick(() => {
|
|
9025
9070
|
updateStyle($xeTable)
|
|
9026
9071
|
})
|
|
@@ -9045,6 +9090,7 @@ const Methods = {
|
|
|
9045
9090
|
const { isAllOverflow, scrollYLoad, expandColumn } = reactData
|
|
9046
9091
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
|
|
9047
9092
|
const { startIndex } = scrollYStore
|
|
9093
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
9048
9094
|
const expandOpts = $xeTable.computeExpandOpts
|
|
9049
9095
|
const rowOpts = $xeTable.computeRowOpts
|
|
9050
9096
|
const cellOpts = $xeTable.computeCellOpts
|
|
@@ -9126,6 +9172,10 @@ const Methods = {
|
|
|
9126
9172
|
reactData.scrollYTop = scrollYTop
|
|
9127
9173
|
reactData.scrollYHeight = scrollYHeight
|
|
9128
9174
|
reactData.isScrollYBig = isScrollYBig
|
|
9175
|
+
|
|
9176
|
+
if (isScrollYBig && mouseOpts.area) {
|
|
9177
|
+
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
9178
|
+
}
|
|
9129
9179
|
return $xeTable.$nextTick().then(() => {
|
|
9130
9180
|
updateStyle($xeTable)
|
|
9131
9181
|
})
|
|
@@ -1204,6 +1204,9 @@ export default {
|
|
|
1204
1204
|
const $xeTabs = $xeTable.$xeTabs
|
|
1205
1205
|
|
|
1206
1206
|
return $xeTabs ? $xeTabs.reactData.resizeFlag : null
|
|
1207
|
+
},
|
|
1208
|
+
computeVxeLanguage () {
|
|
1209
|
+
return VxeUI.getLanguage()
|
|
1207
1210
|
}
|
|
1208
1211
|
} as any,
|
|
1209
1212
|
watch: {
|
|
@@ -1281,6 +1284,9 @@ export default {
|
|
|
1281
1284
|
computeScrollbarYToLeft () {
|
|
1282
1285
|
this.reLayoutFlag++
|
|
1283
1286
|
},
|
|
1287
|
+
computeVxeLanguage () {
|
|
1288
|
+
this.reLayoutFlag++
|
|
1289
|
+
},
|
|
1284
1290
|
reLayoutFlag () {
|
|
1285
1291
|
const $xeTable = this
|
|
1286
1292
|
|
package/packages/ui/src/dom.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|