vxe-table 4.23.17 → 4.23.19
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/dist/all.esm.js +163 -123
- package/dist/all.esm.min.js +3 -3
- package/es/grid/src/grid.js +0 -8
- package/es/table/module/edit/hook.js +85 -85
- package/es/table/module/export/export-panel.js +5 -5
- package/es/table/module/export/hook.js +8 -10
- package/es/table/module/export/import-panel.js +5 -5
- package/es/table/src/table.js +58 -8
- package/es/ui/index.d.ts +1 -0
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +0 -8
- package/lib/index.umd.js +163 -123
- package/lib/index.umd.min.js +3 -3
- package/lib/table/module/edit/hook.js +85 -85
- package/lib/table/module/export/export-panel.js +5 -5
- package/lib/table/module/export/hook.js +8 -10
- package/lib/table/module/export/import-panel.js +5 -5
- package/lib/table/src/table.js +58 -8
- package/lib/ui/index.d.ts +1 -0
- package/lib/ui/index.js +2 -1
- package/lib/ui/src/log.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +0 -9
- package/packages/table/module/edit/hook.ts +97 -89
- package/packages/table/module/export/export-panel.ts +5 -5
- package/packages/table/module/export/hook.ts +8 -10
- package/packages/table/module/export/import-panel.ts +5 -5
- package/packages/table/src/table.ts +64 -11
- package/packages/ui/index.ts +4 -0
- /package/dist/{iconfont.1794294436168.ttf → iconfont.1794474448348.ttf} +0 -0
- /package/dist/{iconfont.1794294436168.woff → iconfont.1794474448348.woff} +0 -0
- /package/dist/{iconfont.1794294436168.woff2 → iconfont.1794474448348.woff2} +0 -0
- /package/es/{iconfont.1794294436168.ttf → iconfont.1794474448348.ttf} +0 -0
- /package/es/{iconfont.1794294436168.woff → iconfont.1794474448348.woff} +0 -0
- /package/es/{iconfont.1794294436168.woff2 → iconfont.1794474448348.woff2} +0 -0
- /package/lib/{iconfont.1794294436168.ttf → iconfont.1794474448348.ttf} +0 -0
- /package/lib/{iconfont.1794294436168.woff → iconfont.1794474448348.woff} +0 -0
- /package/lib/{iconfont.1794294436168.woff2 → iconfont.1794474448348.woff2} +0 -0
|
@@ -51,9 +51,6 @@ hooks.add('tableEditModule', {
|
|
|
51
51
|
|
|
52
52
|
const browseObj = XEUtils.browse()
|
|
53
53
|
|
|
54
|
-
let editMethods = {} as TableEditMethods
|
|
55
|
-
let editPrivateMethods = {} as TableEditPrivateMethods
|
|
56
|
-
|
|
57
54
|
const getEditColumnModel = (row: any, column: VxeTableDefines.ColumnInfo) => {
|
|
58
55
|
const { model, editRender } = column
|
|
59
56
|
if (editRender) {
|
|
@@ -464,80 +461,30 @@ hooks.add('tableEditModule', {
|
|
|
464
461
|
const { editRender } = column
|
|
465
462
|
const { isFocus, isPos, isClear } = options
|
|
466
463
|
const cell = (params.cell || $xeTable.getCellElement(row, column)) as HTMLElement
|
|
467
|
-
const
|
|
464
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
465
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod
|
|
468
466
|
const editParams = { ...params, cell }
|
|
469
|
-
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
470
|
-
// 激活编辑
|
|
471
|
-
if (!$xeTable.isPendingByRow(row) && !$xeTable.isAggregateRecord(row)) {
|
|
472
|
-
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
473
|
-
// 判断是否禁用编辑
|
|
474
|
-
let type: 'edit-disabled' | 'edit-activated' = 'edit-disabled'
|
|
475
|
-
if (!beforeEditMethod || beforeEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })) {
|
|
476
|
-
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
477
|
-
$xeTable.clearSelected()
|
|
478
|
-
if ($xeTable.clearCellAreas) {
|
|
479
|
-
$xeTable.clearCellAreas()
|
|
480
|
-
$xeTable.clearCopyCellArea()
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
$xeTable.closeTooltip()
|
|
484
|
-
if (actived.column) {
|
|
485
|
-
handleClearEdit(evnt)
|
|
486
|
-
}
|
|
487
|
-
type = 'edit-activated'
|
|
488
|
-
column.renderHeight = cell.offsetHeight
|
|
489
|
-
actived.args = editParams
|
|
490
|
-
actived.row = row
|
|
491
|
-
actived.column = column
|
|
492
|
-
$xeTable.handlePushStack()
|
|
493
|
-
if (isClear) {
|
|
494
|
-
setCellValue(row, column, null)
|
|
495
|
-
}
|
|
496
|
-
if (mode === 'row') {
|
|
497
|
-
tableColumn.forEach((column: any) => getEditColumnModel(row, column))
|
|
498
|
-
} else {
|
|
499
|
-
getEditColumnModel(row, column)
|
|
500
|
-
}
|
|
501
|
-
const afterEditMethod = editOpts.afterEditMethod
|
|
502
|
-
nextTick(() => {
|
|
503
|
-
if (isFocus) {
|
|
504
|
-
$xeTable.handleFocus(editParams, evnt)
|
|
505
|
-
}
|
|
506
|
-
if (afterEditMethod) {
|
|
507
|
-
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
508
|
-
}
|
|
509
|
-
})
|
|
510
|
-
}
|
|
511
|
-
$xeTable.dispatchEvent(
|
|
512
|
-
type,
|
|
513
|
-
{
|
|
514
|
-
row,
|
|
515
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
516
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
517
|
-
column,
|
|
518
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
519
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
520
|
-
},
|
|
521
|
-
evnt
|
|
522
|
-
)
|
|
523
467
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
468
|
+
if (!cell || !isEnableConf(editConfig) || !isEnableConf(editRender)) {
|
|
469
|
+
return nextTick()
|
|
470
|
+
}
|
|
471
|
+
if ($xeTable.isPendingByRow(row) || $xeTable.isAggregateRecord(row)) {
|
|
472
|
+
return nextTick()
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// 激活编辑
|
|
476
|
+
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
477
|
+
const evntParams = {
|
|
478
|
+
row,
|
|
479
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
480
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
481
|
+
column,
|
|
482
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
483
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const handleCellEdit = (status: boolean) => {
|
|
487
|
+
if (status) {
|
|
541
488
|
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
542
489
|
$xeTable.clearSelected()
|
|
543
490
|
if ($xeTable.clearCellAreas) {
|
|
@@ -545,29 +492,90 @@ hooks.add('tableEditModule', {
|
|
|
545
492
|
$xeTable.clearCopyCellArea()
|
|
546
493
|
}
|
|
547
494
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
setCellValue(row, oldColumn, oldModel.value)
|
|
552
|
-
}
|
|
553
|
-
if ($xeTable.clearValidate) {
|
|
554
|
-
$xeTable.clearValidate(row, column)
|
|
555
|
-
}
|
|
495
|
+
$xeTable.closeTooltip()
|
|
496
|
+
if (actived.column) {
|
|
497
|
+
handleClearEdit(evnt)
|
|
556
498
|
}
|
|
557
499
|
column.renderHeight = cell.offsetHeight
|
|
558
500
|
actived.args = editParams
|
|
501
|
+
actived.row = row
|
|
559
502
|
actived.column = column
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
503
|
+
$xeTable.handlePushStack()
|
|
504
|
+
if (isClear) {
|
|
505
|
+
setCellValue(row, column, null)
|
|
506
|
+
}
|
|
507
|
+
if (mode === 'row') {
|
|
508
|
+
tableColumn.forEach((column) => getEditColumnModel(row, column))
|
|
509
|
+
} else {
|
|
510
|
+
getEditColumnModel(row, column)
|
|
564
511
|
}
|
|
512
|
+
const afterEditMethod = editOpts.afterEditMethod
|
|
513
|
+
nextTick(() => {
|
|
514
|
+
if (isFocus) {
|
|
515
|
+
$xeTable.handleFocus(editParams, evnt)
|
|
516
|
+
}
|
|
517
|
+
if (afterEditMethod) {
|
|
518
|
+
afterEditMethod({ ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
519
|
+
}
|
|
520
|
+
})
|
|
521
|
+
|
|
522
|
+
$xeTable.dispatchEvent('edit-activated', evntParams, evnt)
|
|
523
|
+
// v4已废弃
|
|
524
|
+
$xeTable.dispatchEvent('edit-actived', evntParams, evnt)
|
|
525
|
+
} else {
|
|
526
|
+
$xeTable.dispatchEvent('edit-disabled', evntParams, evnt)
|
|
565
527
|
}
|
|
566
528
|
focused.column = null
|
|
567
529
|
focused.row = null
|
|
568
530
|
$xeTable.focus()
|
|
569
531
|
}
|
|
532
|
+
|
|
533
|
+
const eFnParams = { ...editParams, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }
|
|
534
|
+
|
|
535
|
+
// 是否被禁用
|
|
536
|
+
if (beforeEditFn) {
|
|
537
|
+
handleCellEdit(!!beforeEditFn(eFnParams))
|
|
538
|
+
} else if (beforeEditAsyncFn) {
|
|
539
|
+
return Promise.resolve()
|
|
540
|
+
.then(() => beforeEditAsyncFn(eFnParams))
|
|
541
|
+
.catch(() => false)
|
|
542
|
+
.then((status) => {
|
|
543
|
+
handleCellEdit(!!status)
|
|
544
|
+
})
|
|
545
|
+
} else {
|
|
546
|
+
handleCellEdit(true)
|
|
547
|
+
}
|
|
548
|
+
return nextTick()
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
const { column: oldColumn } = actived
|
|
552
|
+
if (hasEnableConf(mouseConfig, mouseOpts)) {
|
|
553
|
+
$xeTable.clearSelected()
|
|
554
|
+
if ($xeTable.clearCellAreas) {
|
|
555
|
+
$xeTable.clearCellAreas()
|
|
556
|
+
$xeTable.clearCopyCellArea()
|
|
557
|
+
}
|
|
570
558
|
}
|
|
559
|
+
if (oldColumn && oldColumn !== column) {
|
|
560
|
+
const { model: oldModel } = oldColumn
|
|
561
|
+
if (oldModel.update) {
|
|
562
|
+
setCellValue(row, oldColumn, oldModel.value)
|
|
563
|
+
}
|
|
564
|
+
if ($xeTable.clearValidate) {
|
|
565
|
+
$xeTable.clearValidate(row, column)
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
column.renderHeight = cell.offsetHeight
|
|
569
|
+
actived.args = editParams
|
|
570
|
+
actived.column = column
|
|
571
|
+
if (isPos) {
|
|
572
|
+
setTimeout(() => {
|
|
573
|
+
$xeTable.handleFocus(editParams, evnt)
|
|
574
|
+
})
|
|
575
|
+
}
|
|
576
|
+
focused.column = null
|
|
577
|
+
focused.row = null
|
|
578
|
+
$xeTable.focus()
|
|
571
579
|
return nextTick()
|
|
572
580
|
}
|
|
573
581
|
|
|
@@ -614,7 +622,7 @@ hooks.add('tableEditModule', {
|
|
|
614
622
|
return nextTick()
|
|
615
623
|
}
|
|
616
624
|
|
|
617
|
-
editMethods = {
|
|
625
|
+
const editMethods: TableEditMethods = {
|
|
618
626
|
/**
|
|
619
627
|
* 往表格中插入临时数据
|
|
620
628
|
*
|
|
@@ -1089,7 +1097,7 @@ hooks.add('tableEditModule', {
|
|
|
1089
1097
|
return null
|
|
1090
1098
|
}
|
|
1091
1099
|
|
|
1092
|
-
editPrivateMethods = {
|
|
1100
|
+
const editPrivateMethods: TableEditPrivateMethods = {
|
|
1093
1101
|
/**
|
|
1094
1102
|
* 处理激活编辑
|
|
1095
1103
|
*/
|
|
@@ -263,17 +263,17 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
263
263
|
{
|
|
264
264
|
id: 'VXE_EXPORT_MODAL',
|
|
265
265
|
modelValue: storeData.visible,
|
|
266
|
-
title: modelOptions.title
|
|
267
|
-
className: 'vxe-table-export-popup-wrapper',
|
|
266
|
+
title: getDefaultConfig(modelOptions.title, getI18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle')),
|
|
267
|
+
className: 'vxe-table-export-popup-wrapper' + (modelOptions.className ? ` ${modelOptions.className}` : ''),
|
|
268
268
|
width: modelOptions.width || 660,
|
|
269
269
|
height: modelOptions.height,
|
|
270
270
|
minWidth: modelOptions.minWidth || 500,
|
|
271
271
|
minHeight: modelOptions.minHeight || 400,
|
|
272
272
|
mask: getDefaultConfig(modelOptions.mask, true),
|
|
273
273
|
lockView: getDefaultConfig(modelOptions.lockView, true),
|
|
274
|
-
showFooter: true,
|
|
275
|
-
escClosable: true,
|
|
276
|
-
maskClosable: true,
|
|
274
|
+
showFooter: getDefaultConfig(modelOptions.showFooter, true),
|
|
275
|
+
escClosable: getDefaultConfig(modelOptions.escClosable, true),
|
|
276
|
+
maskClosable: getDefaultConfig(modelOptions.maskClosable, true),
|
|
277
277
|
position: modelOptions.position,
|
|
278
278
|
fullscreen: modelOptions.fullscreen,
|
|
279
279
|
remember: modelOptions.remember,
|
|
@@ -1194,9 +1194,11 @@ hooks.add('tableExportModule', {
|
|
|
1194
1194
|
}
|
|
1195
1195
|
})
|
|
1196
1196
|
})
|
|
1197
|
-
} else
|
|
1198
|
-
if (
|
|
1199
|
-
VxeUI.modal
|
|
1197
|
+
} else {
|
|
1198
|
+
if (opts.message !== false) {
|
|
1199
|
+
if (VxeUI.modal) {
|
|
1200
|
+
VxeUI.modal.message({ content: getI18n('vxe.error.impFields'), status: 'error' })
|
|
1201
|
+
}
|
|
1200
1202
|
}
|
|
1201
1203
|
if (_importReject) {
|
|
1202
1204
|
_importReject({ status: false, msg: 'field mismatching' })
|
|
@@ -1437,13 +1439,9 @@ hooks.add('tableExportModule', {
|
|
|
1437
1439
|
exportStore.hasColgroup = isGroup
|
|
1438
1440
|
exportStore.visible = true
|
|
1439
1441
|
// 默认参数
|
|
1440
|
-
Object.assign(
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
mode: selectRecords.length ? 'selected' : 'current'
|
|
1444
|
-
},
|
|
1445
|
-
defOpts
|
|
1446
|
-
)
|
|
1442
|
+
Object.assign(exportParams, {
|
|
1443
|
+
mode: selectRecords.length ? 'selected' : 'current'
|
|
1444
|
+
}, defOpts)
|
|
1447
1445
|
const { filename, sheetName, mode, type } = exportParams
|
|
1448
1446
|
if (filename) {
|
|
1449
1447
|
if (XEUtils.isFunction(filename)) {
|
|
@@ -128,17 +128,17 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
128
128
|
{
|
|
129
129
|
id: 'VXE_IMPORT_MODAL',
|
|
130
130
|
modelValue: storeData.visible,
|
|
131
|
-
title: modelOptions.title
|
|
132
|
-
className: 'vxe-table-
|
|
131
|
+
title: getDefaultConfig(modelOptions.title, getI18n('vxe.import.impTitle')),
|
|
132
|
+
className: 'vxe-table-import-popup-wrapper' + (modelOptions.className ? ` ${modelOptions.className}` : ''),
|
|
133
133
|
width: modelOptions.width || 540,
|
|
134
134
|
height: modelOptions.height,
|
|
135
135
|
minWidth: modelOptions.minWidth || 360,
|
|
136
136
|
minHeight: modelOptions.minHeight || 240,
|
|
137
137
|
mask: getDefaultConfig(modelOptions.mask, true),
|
|
138
138
|
lockView: getDefaultConfig(modelOptions.lockView, true),
|
|
139
|
-
showFooter: true,
|
|
140
|
-
escClosable: true,
|
|
141
|
-
maskClosable: true,
|
|
139
|
+
showFooter: getDefaultConfig(modelOptions.showFooter, true),
|
|
140
|
+
escClosable: getDefaultConfig(modelOptions.escClosable, true),
|
|
141
|
+
maskClosable: getDefaultConfig(modelOptions.maskClosable, true),
|
|
142
142
|
position: modelOptions.position,
|
|
143
143
|
fullscreen: modelOptions.fullscreen,
|
|
144
144
|
remember: modelOptions.remember,
|
|
@@ -9104,7 +9104,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9104
9104
|
const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow
|
|
9105
9105
|
const operCtxMenu = isContentMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow)
|
|
9106
9106
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row
|
|
9107
|
-
const
|
|
9107
|
+
const beforeEditFn = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
9108
|
+
const beforeEditAsyncFn = editOpts.beforeEditAsyncMethod
|
|
9108
9109
|
const selectRow = selected.row
|
|
9109
9110
|
const selectColumn = selected.column
|
|
9110
9111
|
if (operCtxMenu) {
|
|
@@ -9355,8 +9356,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9355
9356
|
$grid: $xeGrid,
|
|
9356
9357
|
$gantt: $xeGantt
|
|
9357
9358
|
}
|
|
9358
|
-
|
|
9359
|
-
|
|
9359
|
+
|
|
9360
|
+
const handleEdit = () => {
|
|
9360
9361
|
if (delMethod) {
|
|
9361
9362
|
delMethod(params)
|
|
9362
9363
|
} else {
|
|
@@ -9370,6 +9371,21 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9370
9371
|
$xeTable.updateFooter()
|
|
9371
9372
|
dispatchEvent('cell-delete-value', params, evnt)
|
|
9372
9373
|
}
|
|
9374
|
+
|
|
9375
|
+
// 是否被禁用
|
|
9376
|
+
if (beforeEditFn) {
|
|
9377
|
+
if (beforeEditFn(params)) {
|
|
9378
|
+
handleEdit()
|
|
9379
|
+
}
|
|
9380
|
+
} else if (beforeEditAsyncFn) {
|
|
9381
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
9382
|
+
if (status) {
|
|
9383
|
+
handleEdit()
|
|
9384
|
+
}
|
|
9385
|
+
}).catch(() => {})
|
|
9386
|
+
} else {
|
|
9387
|
+
handleEdit()
|
|
9388
|
+
}
|
|
9373
9389
|
}
|
|
9374
9390
|
} else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
|
|
9375
9391
|
if (!isEditStatus) {
|
|
@@ -9389,8 +9405,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9389
9405
|
$grid: $xeGrid,
|
|
9390
9406
|
$gantt: $xeGantt
|
|
9391
9407
|
}
|
|
9392
|
-
|
|
9393
|
-
|
|
9408
|
+
|
|
9409
|
+
const handleEdit = () => {
|
|
9394
9410
|
if (backMethod) {
|
|
9395
9411
|
backMethod(params)
|
|
9396
9412
|
} else {
|
|
@@ -9400,6 +9416,21 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9400
9416
|
}
|
|
9401
9417
|
dispatchEvent('cell-backspace-value', params, evnt)
|
|
9402
9418
|
}
|
|
9419
|
+
|
|
9420
|
+
// 是否被禁用
|
|
9421
|
+
if (beforeEditFn) {
|
|
9422
|
+
if (beforeEditFn(params)) {
|
|
9423
|
+
handleEdit()
|
|
9424
|
+
}
|
|
9425
|
+
} else if (beforeEditAsyncFn) {
|
|
9426
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
9427
|
+
if (status) {
|
|
9428
|
+
handleEdit()
|
|
9429
|
+
}
|
|
9430
|
+
}).catch(() => {})
|
|
9431
|
+
} else {
|
|
9432
|
+
handleEdit()
|
|
9433
|
+
}
|
|
9403
9434
|
}
|
|
9404
9435
|
}
|
|
9405
9436
|
} else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
|
|
@@ -9446,7 +9477,6 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9446
9477
|
// }
|
|
9447
9478
|
// 如果是按下非功能键之外允许直接编辑
|
|
9448
9479
|
if (selectColumn && selectRow && isEnableConf(selectColumn.editRender)) {
|
|
9449
|
-
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
9450
9480
|
const params = {
|
|
9451
9481
|
row: selectRow,
|
|
9452
9482
|
rowIndex: $xeTable.getRowIndex(selectRow),
|
|
@@ -9460,7 +9490,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9460
9490
|
$grid: $xeGrid,
|
|
9461
9491
|
$gantt: $xeGantt
|
|
9462
9492
|
}
|
|
9463
|
-
|
|
9493
|
+
|
|
9494
|
+
const handleEdit = () => {
|
|
9464
9495
|
if (editMethod) {
|
|
9465
9496
|
editMethod(params)
|
|
9466
9497
|
} else {
|
|
@@ -9474,6 +9505,21 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
9474
9505
|
})
|
|
9475
9506
|
}
|
|
9476
9507
|
}
|
|
9508
|
+
|
|
9509
|
+
// 是否被禁用
|
|
9510
|
+
if (beforeEditFn) {
|
|
9511
|
+
if (beforeEditFn(params)) {
|
|
9512
|
+
handleEdit()
|
|
9513
|
+
}
|
|
9514
|
+
} else if (beforeEditAsyncFn) {
|
|
9515
|
+
Promise.resolve(beforeEditAsyncFn(params)).then((status) => {
|
|
9516
|
+
if (status) {
|
|
9517
|
+
handleEdit()
|
|
9518
|
+
}
|
|
9519
|
+
}).catch(() => {})
|
|
9520
|
+
} else {
|
|
9521
|
+
handleEdit()
|
|
9522
|
+
}
|
|
9477
9523
|
}
|
|
9478
9524
|
}
|
|
9479
9525
|
dispatchEvent('keydown', {}, evnt)
|
|
@@ -10239,7 +10285,6 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
10239
10285
|
rowExpandedMaps[rowid] = row
|
|
10240
10286
|
}
|
|
10241
10287
|
|
|
10242
|
-
rowNum++
|
|
10243
10288
|
idMaps[rowid] = true
|
|
10244
10289
|
fullDataRowIdMaps[rowid] = rowRest
|
|
10245
10290
|
fullAllDataRowIdMaps[rowid] = rowRest
|
|
@@ -15659,7 +15704,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
15659
15704
|
const importOpts = computeImportOpts.value
|
|
15660
15705
|
// const currentRowOpts = computeCurrentRowOpts.value
|
|
15661
15706
|
// const currentColumnOpts = computeCurrentColumnOpts.value
|
|
15662
|
-
|
|
15707
|
+
const keyboardOpts = computeKeyboardOpts.value
|
|
15663
15708
|
const rowDragOpts = computeRowDragOpts.value
|
|
15664
15709
|
const areaOpts = computeAreaOpts.value
|
|
15665
15710
|
const sortOpts = computeSortOpts.value
|
|
@@ -15845,8 +15890,16 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
15845
15890
|
if (mouseOpts.area && props.treeConfig && !treeOpts.transform) {
|
|
15846
15891
|
errLog('vxe.error.notSupportProp', ['mouse-config.area', 'tree-config.transform=false', 'tree-config.transform=true'])
|
|
15847
15892
|
}
|
|
15848
|
-
if (props.editConfig
|
|
15849
|
-
|
|
15893
|
+
if (props.editConfig) {
|
|
15894
|
+
if (editOpts.activeMethod) {
|
|
15895
|
+
warnLog('vxe.error.delProp', ['edit-config.activeMethod', 'edit-config.beforeEditMethod'])
|
|
15896
|
+
}
|
|
15897
|
+
if (editOpts.beforeEditMethod && editOpts.beforeEditAsyncMethod) {
|
|
15898
|
+
errLog('vxe.error.errConflicts', ['edit-config.beforeEditMethod', 'edit-config.beforeEditAsyncMethod'])
|
|
15899
|
+
}
|
|
15900
|
+
if (keyboardOpts.isEdit && editOpts.beforeEditAsyncMethod) {
|
|
15901
|
+
warnLog('vxe.error.errConflicts', ['keyboard-config.isEdit', 'edit-config.beforeEditAsyncMethod'])
|
|
15902
|
+
}
|
|
15850
15903
|
}
|
|
15851
15904
|
if (checkboxOpts.halfField) {
|
|
15852
15905
|
warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField'])
|
package/packages/ui/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|