vxe-table 3.22.12 → 3.23.0-beta.1
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/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +57 -20
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/render/index.js +130 -23
- package/es/table/src/cell.js +12 -20
- package/es/table/src/methods.js +43 -28
- package/es/table/src/table.js +1 -1
- package/es/table/style.css +9 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +4 -2
- package/es/ui/src/dom.js +7 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +9 -0
- 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 +376 -163
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +72 -24
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/render/index.js +171 -26
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/cell.js +8 -16
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +17 -17
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +1 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +9 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +7 -1
- 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/lib/vxe-table/style/style.css +9 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +83 -25
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/render/index.ts +144 -25
- package/packages/table/src/cell.ts +12 -20
- package/packages/table/src/methods.ts +43 -28
- package/packages/table/src/table.ts +1 -1
- package/packages/ui/index.ts +3 -1
- package/packages/ui/src/dom.ts +7 -1
- package/styles/components/table.scss +18 -0
- /package/es/{iconfont.1786589170707.ttf → iconfont.1787020799795.ttf} +0 -0
- /package/es/{iconfont.1786589170707.woff → iconfont.1787020799795.woff} +0 -0
- /package/es/{iconfont.1786589170707.woff2 → iconfont.1787020799795.woff2} +0 -0
- /package/lib/{iconfont.1786589170707.ttf → iconfont.1787020799795.ttf} +0 -0
- /package/lib/{iconfont.1786589170707.woff → iconfont.1787020799795.woff} +0 -0
- /package/lib/{iconfont.1786589170707.woff2 → iconfont.1787020799795.woff2} +0 -0
|
@@ -387,6 +387,7 @@ function handleEditActive($xeTable, params, evnt, options) {
|
|
|
387
387
|
const props = $xeTable;
|
|
388
388
|
const reactData = $xeTable;
|
|
389
389
|
const $xeGrid = $xeTable.$xeGrid;
|
|
390
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
390
391
|
const { editConfig, mouseConfig } = props;
|
|
391
392
|
const { editStore, tableColumn } = reactData;
|
|
392
393
|
const editOpts = $xeTable.computeEditOpts;
|
|
@@ -397,14 +398,14 @@ function handleEditActive($xeTable, params, evnt, options) {
|
|
|
397
398
|
const { isFocus, isPos, isClear } = options;
|
|
398
399
|
const cell = (params.cell || $xeTable.getCellElement(row, column));
|
|
399
400
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
400
|
-
|
|
401
|
+
const editParams = Object.assign(Object.assign({}, params), { cell });
|
|
401
402
|
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
402
403
|
// 激活编辑
|
|
403
404
|
if (!$xeTable.isPendingByRow(row) && !$xeTable.isAggregateRecord(row)) {
|
|
404
405
|
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
405
406
|
// 判断是否禁用编辑
|
|
406
407
|
let type = 'edit-disabled';
|
|
407
|
-
if (!beforeEditMethod || beforeEditMethod(Object.assign(Object.assign({},
|
|
408
|
+
if (!beforeEditMethod || beforeEditMethod(Object.assign(Object.assign({}, editParams), { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }))) {
|
|
408
409
|
if (mouseConfig) {
|
|
409
410
|
$xeTable.clearSelected();
|
|
410
411
|
if ($xeTable.clearCellAreas) {
|
|
@@ -418,7 +419,7 @@ function handleEditActive($xeTable, params, evnt, options) {
|
|
|
418
419
|
}
|
|
419
420
|
type = 'edit-activated';
|
|
420
421
|
column.renderHeight = cell.offsetHeight;
|
|
421
|
-
actived.args =
|
|
422
|
+
actived.args = editParams;
|
|
422
423
|
actived.row = row;
|
|
423
424
|
actived.column = column;
|
|
424
425
|
$xeTable.handlePushStack();
|
|
@@ -434,10 +435,10 @@ function handleEditActive($xeTable, params, evnt, options) {
|
|
|
434
435
|
const afterEditMethod = editOpts.afterEditMethod;
|
|
435
436
|
$xeTable.$nextTick(() => {
|
|
436
437
|
if (isFocus) {
|
|
437
|
-
$xeTable.handleFocus(
|
|
438
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
438
439
|
}
|
|
439
440
|
if (afterEditMethod) {
|
|
440
|
-
afterEditMethod(Object.assign(Object.assign({},
|
|
441
|
+
afterEditMethod(Object.assign(Object.assign({}, editParams), { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }));
|
|
441
442
|
}
|
|
442
443
|
});
|
|
443
444
|
}
|
|
@@ -480,11 +481,11 @@ function handleEditActive($xeTable, params, evnt, options) {
|
|
|
480
481
|
}
|
|
481
482
|
}
|
|
482
483
|
column.renderHeight = cell.offsetHeight;
|
|
483
|
-
actived.args =
|
|
484
|
+
actived.args = editParams;
|
|
484
485
|
actived.column = column;
|
|
485
486
|
if (isPos) {
|
|
486
487
|
setTimeout(() => {
|
|
487
|
-
$xeTable.handleFocus(
|
|
488
|
+
$xeTable.handleFocus(editParams, evnt);
|
|
488
489
|
});
|
|
489
490
|
}
|
|
490
491
|
}
|
|
@@ -508,8 +509,12 @@ function handleEditCell($xeTable, row, fieldOrColumn, options) {
|
|
|
508
509
|
handleEditActive($xeTable, {
|
|
509
510
|
row,
|
|
510
511
|
rowIndex: $xeTable.getRowIndex(row),
|
|
512
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
513
|
+
_rowIndex: $xeTable.getVTRowIndex(row),
|
|
511
514
|
column,
|
|
512
515
|
columnIndex: $xeTable.getColumnIndex(column),
|
|
516
|
+
$columnIndex: $xeTable.getVMColumnIndex(column),
|
|
517
|
+
_columnIndex: $xeTable.getVTColumnIndex(column),
|
|
513
518
|
cell,
|
|
514
519
|
$table: $xeTable
|
|
515
520
|
}, null, options);
|
|
@@ -912,31 +917,29 @@ export default {
|
|
|
912
917
|
const { editStore } = reactData;
|
|
913
918
|
return editStore.actived.row === row;
|
|
914
919
|
},
|
|
915
|
-
|
|
916
|
-
* 处理聚焦
|
|
917
|
-
*/
|
|
918
|
-
handleFocus(params) {
|
|
920
|
+
handleCellFocus(cell, params) {
|
|
919
921
|
const $xeTable = this;
|
|
920
|
-
const
|
|
922
|
+
const props = $xeTable;
|
|
923
|
+
const { editConfig } = props;
|
|
924
|
+
const { column } = params;
|
|
921
925
|
const { editRender } = column;
|
|
922
926
|
const editOpts = $xeTable.computeEditOpts;
|
|
923
|
-
if (isEnableConf(editRender)) {
|
|
924
|
-
const browseObj = XEUtils.browse();
|
|
927
|
+
if (editConfig && isEnableConf(editRender)) {
|
|
925
928
|
const compRender = renderer.get(editRender.name);
|
|
926
929
|
let autoFocus = editRender.autofocus || editRender.autoFocus;
|
|
927
930
|
let autoSelect = editRender.autoSelect || editRender.autoselect;
|
|
928
|
-
let inputElem;
|
|
931
|
+
let inputElem = null;
|
|
929
932
|
// 是否启用聚焦
|
|
930
933
|
if (editOpts.autoFocus) {
|
|
931
934
|
if (!autoFocus && compRender) {
|
|
932
|
-
autoFocus = compRender.tableAutoFocus || compRender.tableAutofocus || compRender.
|
|
935
|
+
autoFocus = compRender.tableAutoFocus || compRender.tableAutofocus || compRender.autofocus;
|
|
933
936
|
}
|
|
934
937
|
if (!autoSelect && compRender) {
|
|
935
|
-
autoSelect = compRender.tableAutoSelect || compRender.
|
|
938
|
+
autoSelect = compRender.tableAutoSelect || compRender.autoselect;
|
|
936
939
|
}
|
|
937
940
|
// 如果指定了聚焦 class
|
|
938
941
|
if (XEUtils.isFunction(autoFocus)) {
|
|
939
|
-
inputElem = autoFocus
|
|
942
|
+
inputElem = autoFocus(params);
|
|
940
943
|
}
|
|
941
944
|
else if (autoFocus) {
|
|
942
945
|
if (autoFocus === true) {
|
|
@@ -951,6 +954,22 @@ export default {
|
|
|
951
954
|
}
|
|
952
955
|
}
|
|
953
956
|
}
|
|
957
|
+
return inputElem;
|
|
958
|
+
}
|
|
959
|
+
return null;
|
|
960
|
+
},
|
|
961
|
+
/**
|
|
962
|
+
* 处理聚焦
|
|
963
|
+
*/
|
|
964
|
+
handleFocus(params) {
|
|
965
|
+
const $xeTable = this;
|
|
966
|
+
const { row, column, cell } = params;
|
|
967
|
+
const { editRender } = column;
|
|
968
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
969
|
+
if (isEnableConf(editRender)) {
|
|
970
|
+
const browseObj = XEUtils.browse();
|
|
971
|
+
const autoSelect = editRender.autoSelect || editRender.autoselect;
|
|
972
|
+
const inputElem = $xeTable.handleCellFocus(cell, params);
|
|
954
973
|
if (inputElem) {
|
|
955
974
|
if (autoSelect) {
|
|
956
975
|
inputElem.select();
|
|
@@ -1031,13 +1050,18 @@ export default {
|
|
|
1031
1050
|
if (rowIndex > -1) {
|
|
1032
1051
|
const cell = $xeTable.getCellElement(row, column);
|
|
1033
1052
|
const params = {
|
|
1053
|
+
$table: $xeTable,
|
|
1034
1054
|
row,
|
|
1035
1055
|
rowIndex,
|
|
1056
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
1057
|
+
_rowIndex: $xeTable.getVTRowIndex(row),
|
|
1036
1058
|
column,
|
|
1037
1059
|
columnIndex: $xeTable.getColumnIndex(column),
|
|
1060
|
+
$columnIndex: $xeTable.getVMColumnIndex(column),
|
|
1061
|
+
_columnIndex: $xeTable.getVTColumnIndex(column),
|
|
1038
1062
|
cell
|
|
1039
1063
|
};
|
|
1040
|
-
$xeTable.handleSelected(params,
|
|
1064
|
+
$xeTable.handleSelected(params, null);
|
|
1041
1065
|
}
|
|
1042
1066
|
}
|
|
1043
1067
|
return $xeTable.$nextTick();
|
|
@@ -1049,7 +1073,7 @@ export default {
|
|
|
1049
1073
|
const $xeTable = this;
|
|
1050
1074
|
const props = $xeTable;
|
|
1051
1075
|
const reactData = $xeTable;
|
|
1052
|
-
const { mouseConfig } = props;
|
|
1076
|
+
const { mouseConfig, editConfig } = props;
|
|
1053
1077
|
const { editStore } = reactData;
|
|
1054
1078
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
1055
1079
|
const editOpts = $xeTable.computeEditOpts;
|
|
@@ -1072,6 +1096,19 @@ export default {
|
|
|
1072
1096
|
$xeTable.addCellSelectedClass();
|
|
1073
1097
|
}
|
|
1074
1098
|
$xeTable.focus();
|
|
1099
|
+
// 如果是支持可复用控件
|
|
1100
|
+
if (editConfig && editOpts.isReuseKeep && isEnableConf(editOpts) && isEnableConf(column.editRender)) {
|
|
1101
|
+
setTimeout(() => {
|
|
1102
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
1103
|
+
if (cell) {
|
|
1104
|
+
const hasReusekeep = cell.querySelector('.vxe-reusekeep-control');
|
|
1105
|
+
if (hasReusekeep) {
|
|
1106
|
+
params.cell = cell;
|
|
1107
|
+
$xeTable.handleCellFocus(cell, params);
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}, 0);
|
|
1111
|
+
}
|
|
1075
1112
|
if (evnt) {
|
|
1076
1113
|
$xeTable.dispatchEvent('cell-selected', params, evnt);
|
|
1077
1114
|
}
|
|
@@ -510,8 +510,8 @@ export default {
|
|
|
510
510
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
511
511
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
512
512
|
const editOpts = $xeTable.computeEditOpts;
|
|
513
|
-
if (mouseConfig && mouseOpts.area && $xeTable.
|
|
514
|
-
return $xeTable.
|
|
513
|
+
if (mouseConfig && mouseOpts.area && $xeTable.triggerClAreaMnEvent) {
|
|
514
|
+
return $xeTable.triggerClAreaMnEvent(evnt, params);
|
|
515
515
|
}
|
|
516
516
|
else {
|
|
517
517
|
if (checkboxConfig && checkboxOpts.range) {
|
package/es/table/render/index.js
CHANGED
|
@@ -80,6 +80,7 @@ function getCellLabelVNs(h, renderOpts, params, cellLabel, opts) {
|
|
|
80
80
|
const { placeholder } = renderOpts;
|
|
81
81
|
return [
|
|
82
82
|
h('span', {
|
|
83
|
+
key: 1,
|
|
83
84
|
class: ['vxe-cell--label', opts ? opts.class : '']
|
|
84
85
|
}, placeholder && isEmptyValue(cellLabel)
|
|
85
86
|
? [
|
|
@@ -345,22 +346,33 @@ function getNativeFilterOns(renderOpts, params, option) {
|
|
|
345
346
|
}
|
|
346
347
|
});
|
|
347
348
|
}
|
|
349
|
+
function nativeInputCellRender(h, renderOpts, renderParams) {
|
|
350
|
+
const { row, column } = renderParams;
|
|
351
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
352
|
+
const cellVNs = [
|
|
353
|
+
h('span', {
|
|
354
|
+
key: 1
|
|
355
|
+
}, cellValue)
|
|
356
|
+
];
|
|
357
|
+
return getNativeInputRenderCellVNs(h, cellValue, cellVNs, renderOpts, renderParams);
|
|
358
|
+
}
|
|
348
359
|
/**
|
|
349
360
|
* 单元格可编辑渲染-原生的标签
|
|
350
|
-
* input、textarea
|
|
361
|
+
* input、textarea
|
|
351
362
|
*/
|
|
352
|
-
function
|
|
353
|
-
const { row, column } =
|
|
363
|
+
function nativeInputEditRender(h, renderOpts, renderParams) {
|
|
364
|
+
const { row, column } = renderParams;
|
|
354
365
|
const { name } = renderOpts;
|
|
355
|
-
const cellValue = isImmediateCell(renderOpts,
|
|
366
|
+
const cellValue = isImmediateCell(renderOpts, renderParams) ? getCellValue(row, column) : column.model.value;
|
|
356
367
|
return [
|
|
357
|
-
h(
|
|
368
|
+
h('' + name, {
|
|
369
|
+
key: 2,
|
|
358
370
|
class: `vxe-default-${name}`,
|
|
359
371
|
attrs: getNativeAttrs(renderOpts),
|
|
360
372
|
domProps: {
|
|
361
373
|
value: cellValue
|
|
362
374
|
},
|
|
363
|
-
on: getNativeEditOns(renderOpts,
|
|
375
|
+
on: getNativeEditOns(renderOpts, renderParams)
|
|
364
376
|
})
|
|
365
377
|
];
|
|
366
378
|
}
|
|
@@ -372,6 +384,17 @@ function buttonCellRender(h, renderOpts, params) {
|
|
|
372
384
|
})
|
|
373
385
|
];
|
|
374
386
|
}
|
|
387
|
+
function defaultInputEditRender(h, renderOpts, params) {
|
|
388
|
+
const { row, column } = params;
|
|
389
|
+
const cellValue = getCellValue(row, column);
|
|
390
|
+
return [
|
|
391
|
+
h(getDefaultComponent(renderOpts), {
|
|
392
|
+
key: 2,
|
|
393
|
+
props: getCellEditProps(renderOpts, params, cellValue),
|
|
394
|
+
on: getEditOns(renderOpts, params)
|
|
395
|
+
})
|
|
396
|
+
];
|
|
397
|
+
}
|
|
375
398
|
function defaultEditRender(h, renderOpts, params) {
|
|
376
399
|
const { row, column } = params;
|
|
377
400
|
const cellValue = getCellValue(row, column);
|
|
@@ -666,11 +689,9 @@ function handleExportTreeSelectMethod(params) {
|
|
|
666
689
|
const { row, column, options } = params;
|
|
667
690
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
668
691
|
}
|
|
669
|
-
function handleNumberCell(h, renderOpts, params) {
|
|
692
|
+
function handleNumberCell(h, cellValue, renderOpts, params) {
|
|
670
693
|
const { props = {}, showNegativeStatus } = renderOpts;
|
|
671
|
-
const { row, column } = params;
|
|
672
694
|
const { type } = props;
|
|
673
|
-
let cellValue = XEUtils.get(row, column.field);
|
|
674
695
|
let isNegative = false;
|
|
675
696
|
if (!isEmptyValue(cellValue)) {
|
|
676
697
|
const numberInputConfig = getConfig().numberInput || {};
|
|
@@ -821,20 +842,90 @@ function handleSetTreeSelectValue(renderOpts, params) {
|
|
|
821
842
|
XEUtils.set(row, field, cellValue);
|
|
822
843
|
}
|
|
823
844
|
}
|
|
845
|
+
function getNativeInputRenderCellVNs(h, cellValue, labelVNs, renderOpts, renderParams) {
|
|
846
|
+
const { $table, row, column } = renderParams;
|
|
847
|
+
const { name } = renderOpts;
|
|
848
|
+
const tableProps = $table;
|
|
849
|
+
const { editConfig, mouseConfig } = tableProps;
|
|
850
|
+
let isColSelected = false;
|
|
851
|
+
let isActiveCellArea = false;
|
|
852
|
+
if (editConfig && mouseConfig) {
|
|
853
|
+
const tableReactData = $table;
|
|
854
|
+
const { editStore } = tableReactData;
|
|
855
|
+
const { selected } = editStore;
|
|
856
|
+
isColSelected = row === selected.row && column === selected.column;
|
|
857
|
+
if ($table.getActiveCellArea) {
|
|
858
|
+
const activeCellArea = $table.getActiveCellArea();
|
|
859
|
+
if (activeCellArea) {
|
|
860
|
+
isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
const cellVNs = labelVNs;
|
|
865
|
+
if (isActiveCellArea || isColSelected) {
|
|
866
|
+
cellVNs.push(h('' + name, {
|
|
867
|
+
key: 2,
|
|
868
|
+
class: `vxe-default-${name} vxe-reusekeep-control`,
|
|
869
|
+
attrs: getNativeAttrs(renderOpts),
|
|
870
|
+
domProps: {
|
|
871
|
+
value: cellValue
|
|
872
|
+
},
|
|
873
|
+
on: getNativeEditOns(renderOpts, renderParams)
|
|
874
|
+
}));
|
|
875
|
+
}
|
|
876
|
+
return cellVNs;
|
|
877
|
+
}
|
|
878
|
+
function getInputRenderCellVNs(h, cellValue, labelVNs, renderOpts, renderParams) {
|
|
879
|
+
const { $table, row, column } = renderParams;
|
|
880
|
+
const tableProps = $table;
|
|
881
|
+
const { editConfig, mouseConfig } = tableProps;
|
|
882
|
+
let isColSelected = false;
|
|
883
|
+
let isActiveCellArea = false;
|
|
884
|
+
if (editConfig && mouseConfig) {
|
|
885
|
+
const tableReactData = $table;
|
|
886
|
+
const { editStore } = tableReactData;
|
|
887
|
+
const editOpts = $table.computeEditOpts;
|
|
888
|
+
if (editOpts.isReuseKeep) {
|
|
889
|
+
const { selected } = editStore;
|
|
890
|
+
isColSelected = row === selected.row && column === selected.column;
|
|
891
|
+
if ($table.getActiveCellArea) {
|
|
892
|
+
const activeCellArea = $table.getActiveCellArea();
|
|
893
|
+
if (activeCellArea) {
|
|
894
|
+
isActiveCellArea = row === activeCellArea.row && column === activeCellArea.column;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
const cellVNs = labelVNs;
|
|
900
|
+
if (isActiveCellArea || isColSelected) {
|
|
901
|
+
const compProps = getCellEditProps(renderOpts, renderParams, cellValue);
|
|
902
|
+
const { className, inputClassName } = compProps;
|
|
903
|
+
cellVNs.push(h(getDefaultComponent(renderOpts), {
|
|
904
|
+
key: 2,
|
|
905
|
+
props: Object.assign(Object.assign({}, compProps), { className: 'vxe-reusekeep-control' + (className ? (' ' + className) : ''), inputClassName: 'vxe-reusekeep-control' + (inputClassName ? (' ' + inputClassName) : '') }),
|
|
906
|
+
on: getEditOns(renderOpts, renderParams)
|
|
907
|
+
}));
|
|
908
|
+
}
|
|
909
|
+
return cellVNs;
|
|
910
|
+
}
|
|
824
911
|
/**
|
|
825
912
|
* 表格 - 渲染器
|
|
826
913
|
*/
|
|
827
914
|
renderer.mixin({
|
|
828
915
|
input: {
|
|
829
916
|
tableAutoFocus: true,
|
|
830
|
-
renderTableEdit:
|
|
831
|
-
|
|
917
|
+
renderTableEdit: nativeInputEditRender,
|
|
918
|
+
renderTableCell: nativeInputCellRender,
|
|
919
|
+
renderTableDefault: nativeInputEditRender,
|
|
920
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
832
921
|
renderTableFilter: nativeFilterRender,
|
|
833
922
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
834
923
|
},
|
|
835
924
|
textarea: {
|
|
836
925
|
tableAutoFocus: true,
|
|
837
|
-
renderTableEdit:
|
|
926
|
+
renderTableEdit: nativeInputEditRender,
|
|
927
|
+
renderTableCell: nativeInputCellRender,
|
|
928
|
+
renderTableDefault: nativeInputEditRender
|
|
838
929
|
},
|
|
839
930
|
select: {
|
|
840
931
|
renderTableEdit: nativeSelectEditRender,
|
|
@@ -878,10 +969,10 @@ renderer.mixin({
|
|
|
878
969
|
},
|
|
879
970
|
VxeInput: {
|
|
880
971
|
tableAutoFocus: true,
|
|
881
|
-
renderTableEdit:
|
|
882
|
-
renderTableCell(h, renderOpts,
|
|
972
|
+
renderTableEdit: defaultInputEditRender,
|
|
973
|
+
renderTableCell(h, renderOpts, renderParams) {
|
|
883
974
|
const { props = {} } = renderOpts;
|
|
884
|
-
const { row, column } =
|
|
975
|
+
const { row, column } = renderParams;
|
|
885
976
|
const inputConfig = getConfig().input || {};
|
|
886
977
|
const digits = props.digits || inputConfig.digits || 2;
|
|
887
978
|
let cellValue = XEUtils.get(row, column.field);
|
|
@@ -899,16 +990,21 @@ renderer.mixin({
|
|
|
899
990
|
break;
|
|
900
991
|
}
|
|
901
992
|
}
|
|
902
|
-
|
|
993
|
+
const cellVNs = getCellLabelVNs(h, renderOpts, renderParams, cellValue);
|
|
994
|
+
return getInputRenderCellVNs(h, cellValue, cellVNs, renderOpts, renderParams);
|
|
903
995
|
},
|
|
904
|
-
renderTableDefault:
|
|
996
|
+
renderTableDefault: defaultInputEditRender,
|
|
905
997
|
createTableFilterOptions: defaultFilterOptions,
|
|
906
998
|
renderTableFilter: defaultFilterRender,
|
|
907
999
|
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
908
1000
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
909
1001
|
},
|
|
910
1002
|
FormatNumberInput: {
|
|
911
|
-
renderTableDefault
|
|
1003
|
+
renderTableDefault(h, renderOpts, renderParams) {
|
|
1004
|
+
const { row, column } = renderParams;
|
|
1005
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1006
|
+
return handleNumberCell(h, cellValue, renderOpts, renderParams);
|
|
1007
|
+
},
|
|
912
1008
|
tableFilterDefaultMethod({ option, row, column }) {
|
|
913
1009
|
const { data } = option;
|
|
914
1010
|
const cellValue = XEUtils.get(row, column.field);
|
|
@@ -923,8 +1019,13 @@ renderer.mixin({
|
|
|
923
1019
|
},
|
|
924
1020
|
VxeNumberInput: {
|
|
925
1021
|
tableAutoFocus: true,
|
|
926
|
-
renderTableEdit:
|
|
927
|
-
renderTableCell
|
|
1022
|
+
renderTableEdit: defaultInputEditRender,
|
|
1023
|
+
renderTableCell(h, renderOpts, renderParams) {
|
|
1024
|
+
const { row, column } = renderParams;
|
|
1025
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1026
|
+
const cellVNs = handleNumberCell(h, cellValue, renderOpts, renderParams);
|
|
1027
|
+
return getInputRenderCellVNs(h, cellValue, cellVNs, renderOpts, renderParams);
|
|
1028
|
+
},
|
|
928
1029
|
renderTableFooter(h, renderOpts, params) {
|
|
929
1030
|
const { props = {} } = renderOpts;
|
|
930
1031
|
const { row, column, _columnIndex } = params;
|
|
@@ -962,7 +1063,7 @@ renderer.mixin({
|
|
|
962
1063
|
}
|
|
963
1064
|
return getFuncText(itemValue, 1);
|
|
964
1065
|
},
|
|
965
|
-
renderTableDefault:
|
|
1066
|
+
renderTableDefault: defaultInputEditRender,
|
|
966
1067
|
createTableFilterOptions: defaultFilterOptions,
|
|
967
1068
|
renderTableFilter: defaultFilterRender,
|
|
968
1069
|
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
@@ -1112,8 +1213,14 @@ renderer.mixin({
|
|
|
1112
1213
|
},
|
|
1113
1214
|
VxeTextarea: {
|
|
1114
1215
|
tableAutoFocus: true,
|
|
1115
|
-
renderTableDefault:
|
|
1116
|
-
|
|
1216
|
+
renderTableDefault: defaultInputEditRender,
|
|
1217
|
+
renderTableCell(h, renderOpts, renderParams) {
|
|
1218
|
+
const { row, column } = renderParams;
|
|
1219
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1220
|
+
const cellVNs = getCellLabelVNs(h, renderOpts, renderParams, cellValue);
|
|
1221
|
+
return getInputRenderCellVNs(h, cellValue, cellVNs, renderOpts, renderParams);
|
|
1222
|
+
},
|
|
1223
|
+
renderTableEdit: defaultInputEditRender
|
|
1117
1224
|
},
|
|
1118
1225
|
VxeButton: {
|
|
1119
1226
|
renderTableDefault: buttonCellRender
|
package/es/table/src/cell.js
CHANGED
|
@@ -283,7 +283,11 @@ function renderHeaderHandle(h, params) {
|
|
|
283
283
|
const { column, $table } = params;
|
|
284
284
|
const tableProps = $table;
|
|
285
285
|
const { editConfig } = tableProps;
|
|
286
|
-
const { type, filters, sortable, editRender } = column;
|
|
286
|
+
const { type, filters, sortable, editRender, slots } = column;
|
|
287
|
+
const headerSlot = slots ? slots.header : null;
|
|
288
|
+
if (headerSlot) {
|
|
289
|
+
return renderTitleContent(h, params, $table.callSlot(headerSlot, params, h));
|
|
290
|
+
}
|
|
287
291
|
switch (type) {
|
|
288
292
|
case 'seq':
|
|
289
293
|
return Cell.renderSeqHeader(h, params);
|
|
@@ -342,11 +346,7 @@ export const Cell = {
|
|
|
342
346
|
const { $table, column } = params;
|
|
343
347
|
const tableProps = $table;
|
|
344
348
|
const { editConfig } = tableProps;
|
|
345
|
-
const {
|
|
346
|
-
const headerSlot = slots ? slots.header : null;
|
|
347
|
-
if (headerSlot) {
|
|
348
|
-
return renderTitleContent(h, params, $table.callSlot(headerSlot, params, h));
|
|
349
|
-
}
|
|
349
|
+
const { editRender, cellRender } = column;
|
|
350
350
|
const isEnableEdit = editConfig && isEnableConf(editConfig);
|
|
351
351
|
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
|
|
352
352
|
const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
|
|
@@ -620,8 +620,7 @@ export const Cell = {
|
|
|
620
620
|
*/
|
|
621
621
|
renderSeqHeader(h, params) {
|
|
622
622
|
const { $table, column } = params;
|
|
623
|
-
|
|
624
|
-
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : $table.getHeaderCellLabel(column)));
|
|
623
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params, $table.getHeaderCellLabel(column)));
|
|
625
624
|
},
|
|
626
625
|
renderSeqCell(h, params) {
|
|
627
626
|
const { $table, column } = params;
|
|
@@ -647,15 +646,12 @@ export const Cell = {
|
|
|
647
646
|
renderRadioHeader(h, params) {
|
|
648
647
|
const { $table, column } = params;
|
|
649
648
|
const { slots } = column;
|
|
650
|
-
const headerSlot = slots ? slots.header : null;
|
|
651
649
|
const titleSlot = slots ? slots.title : null;
|
|
652
|
-
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params,
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, titleSlot ? $table.callSlot(titleSlot, params, h) : $table.getHeaderCellLabel(column))
|
|
658
|
-
]));
|
|
650
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params, [
|
|
651
|
+
h('span', {
|
|
652
|
+
class: 'vxe-radio--label'
|
|
653
|
+
}, titleSlot ? $table.callSlot(titleSlot, params, h) : $table.getHeaderCellLabel(column))
|
|
654
|
+
]));
|
|
659
655
|
},
|
|
660
656
|
renderRadioCell(h, params) {
|
|
661
657
|
const { $table, column, isHidden } = params;
|
|
@@ -720,7 +716,6 @@ export const Cell = {
|
|
|
720
716
|
const { isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate } = tableReactData;
|
|
721
717
|
const isAllCheckboxDisabled = $table.computeIsAllCheckboxDisabled;
|
|
722
718
|
const { slots } = column;
|
|
723
|
-
const headerSlot = slots ? slots.header : null;
|
|
724
719
|
const titleSlot = slots ? slots.title : null;
|
|
725
720
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
726
721
|
const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
|
|
@@ -734,9 +729,6 @@ export const Cell = {
|
|
|
734
729
|
};
|
|
735
730
|
}
|
|
736
731
|
const checkboxParams = Object.assign(Object.assign({}, params), { checked: isAllCheckboxSelected, disabled: isAllCheckboxDisabled, indeterminate: isAllCheckboxIndeterminate });
|
|
737
|
-
if (headerSlot) {
|
|
738
|
-
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)));
|
|
739
|
-
}
|
|
740
732
|
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
741
733
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
|
|
742
734
|
h('span', {
|