vxe-table 3.14.0 → 3.14.2
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 +95 -65
- package/es/table/module/keyboard/mixin.js +3 -2
- package/es/table/module/validator/mixin.js +2 -5
- package/es/table/src/body.js +6 -7
- package/es/table/src/methods.js +301 -286
- package/es/table/src/table.js +21 -15
- 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 +501 -498
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +108 -99
- 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/validator/mixin.js +3 -9
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/body.js +6 -7
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +352 -355
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +21 -15
- 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 +129 -89
- package/packages/table/module/keyboard/mixin.ts +4 -2
- package/packages/table/module/validator/mixin.ts +3 -6
- package/packages/table/src/body.ts +6 -7
- package/packages/table/src/methods.ts +345 -301
- package/packages/table/src/table.ts +24 -18
- package/packages/table/src/util.ts +2 -2
- package/packages/ui/src/dom.ts +0 -2
- /package/es/{iconfont.1742955973002.ttf → iconfont.1743125678150.ttf} +0 -0
- /package/es/{iconfont.1742955973002.woff → iconfont.1743125678150.woff} +0 -0
- /package/es/{iconfont.1742955973002.woff2 → iconfont.1743125678150.woff2} +0 -0
- /package/lib/{iconfont.1742955973002.ttf → iconfont.1743125678150.ttf} +0 -0
- /package/lib/{iconfont.1742955973002.woff → iconfont.1743125678150.woff} +0 -0
- /package/lib/{iconfont.1742955973002.woff2 → iconfont.1743125678150.woff2} +0 -0
|
@@ -2,9 +2,10 @@ import XEUtils from 'xe-utils';
|
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { isEnableConf } from '../../../ui/src/utils';
|
|
4
4
|
import { getCellValue, setCellValue, getRowid } from '../../src/util';
|
|
5
|
-
import {
|
|
5
|
+
import { removeClass, addClass } from '../../../ui/src/dom';
|
|
6
6
|
import { warnLog, errLog } from '../../../ui/src/log';
|
|
7
7
|
const { getConfig, renderer, getI18n } = VxeUI;
|
|
8
|
+
const browseObj = XEUtils.browse();
|
|
8
9
|
function getEditColumnModel(row, column) {
|
|
9
10
|
const { model, editRender } = column;
|
|
10
11
|
if (editRender) {
|
|
@@ -44,18 +45,20 @@ function syncActivedCell($xeTable) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
function insertTreeRow(
|
|
48
|
-
const
|
|
48
|
+
function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
49
|
+
const internalData = $xeTable;
|
|
50
|
+
const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
|
|
51
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
49
52
|
const { rowField, parentField, mapChildrenField } = treeOpts;
|
|
50
53
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
51
54
|
const funcName = isAppend ? 'push' : 'unshift';
|
|
52
55
|
newRecords.forEach((item) => {
|
|
53
56
|
const parentRowId = item[parentField];
|
|
54
|
-
const rowid = getRowid(
|
|
57
|
+
const rowid = getRowid($xeTable, item);
|
|
55
58
|
const matchObj = parentRowId ? XEUtils.findTree(tableFullTreeData, (item) => parentRowId === item[rowField], { children: mapChildrenField }) : null;
|
|
56
59
|
if (matchObj) {
|
|
57
60
|
const { item: parentRow } = matchObj;
|
|
58
|
-
const parentRest = fullAllDataRowIdData[getRowid(
|
|
61
|
+
const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
|
|
59
62
|
const parentLevel = parentRest ? parentRest.level : 0;
|
|
60
63
|
let parentChilds = parentRow[childrenField];
|
|
61
64
|
let mapChilds = parentRow[mapChildrenField];
|
|
@@ -90,8 +93,8 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
90
93
|
const reactData = $xeTable;
|
|
91
94
|
const internalData = $xeTable;
|
|
92
95
|
const { treeConfig } = props;
|
|
93
|
-
const { mergeList
|
|
94
|
-
const { tableFullTreeData, afterFullData, tableFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
|
|
96
|
+
const { mergeList } = reactData;
|
|
97
|
+
const { tableFullTreeData, afterFullData, tableFullData, fullDataRowIdData, fullAllDataRowIdData, insertRowMaps } = internalData;
|
|
95
98
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
96
99
|
const { transform, rowField, mapChildrenField } = treeOpts;
|
|
97
100
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -238,11 +241,11 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
238
241
|
}
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
|
-
const { insertMaps } = editStore;
|
|
242
244
|
newRecords.forEach(newRow => {
|
|
243
245
|
const rowid = getRowid($xeTable, newRow);
|
|
244
|
-
|
|
246
|
+
insertRowMaps[rowid] = newRow;
|
|
245
247
|
});
|
|
248
|
+
reactData.insertRowFlag++;
|
|
246
249
|
$xeTable.cacheRowMap(false);
|
|
247
250
|
$xeTable.updateScrollYStatus();
|
|
248
251
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -251,7 +254,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
251
254
|
}
|
|
252
255
|
$xeTable.updateFooter();
|
|
253
256
|
$xeTable.checkSelectionStatus();
|
|
254
|
-
if (
|
|
257
|
+
if (reactData.scrollYLoad) {
|
|
255
258
|
$xeTable.updateScrollYSpace();
|
|
256
259
|
}
|
|
257
260
|
return $xeTable.$nextTick().then(() => {
|
|
@@ -493,13 +496,12 @@ export default {
|
|
|
493
496
|
const internalData = $xeTable;
|
|
494
497
|
const { treeConfig } = props;
|
|
495
498
|
const { mergeList, editStore } = reactData;
|
|
496
|
-
const { tableFullTreeData, selectCheckboxMaps, afterFullData, tableFullData, pendingRowMaps } = internalData;
|
|
499
|
+
const { tableFullTreeData, selectCheckboxMaps, afterFullData, tableFullData, pendingRowMaps, insertRowMaps, removeRowMaps } = internalData;
|
|
497
500
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
498
501
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
499
502
|
const { transform, mapChildrenField } = treeOpts;
|
|
500
503
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
501
|
-
const { actived
|
|
502
|
-
const insertDataRowMaps = Object.assign({}, editStore.insertMaps);
|
|
504
|
+
const { actived } = editStore;
|
|
503
505
|
const { checkField } = checkboxOpts;
|
|
504
506
|
let delList = [];
|
|
505
507
|
if (!rows) {
|
|
@@ -512,7 +514,7 @@ export default {
|
|
|
512
514
|
rows.forEach(row => {
|
|
513
515
|
if (!$xeTable.isInsertByRow(row)) {
|
|
514
516
|
const rowid = getRowid($xeTable, row);
|
|
515
|
-
|
|
517
|
+
removeRowMaps[rowid] = row;
|
|
516
518
|
}
|
|
517
519
|
});
|
|
518
520
|
// 如果绑定了多选属性,则更新状态
|
|
@@ -583,14 +585,15 @@ export default {
|
|
|
583
585
|
// 从新增中移除已删除的数据
|
|
584
586
|
rows.forEach((row) => {
|
|
585
587
|
const rowid = getRowid($xeTable, row);
|
|
586
|
-
if (
|
|
587
|
-
delete
|
|
588
|
+
if (insertRowMaps[rowid]) {
|
|
589
|
+
delete insertRowMaps[rowid];
|
|
588
590
|
}
|
|
589
591
|
if (pendingRowMaps[rowid]) {
|
|
590
592
|
delete pendingRowMaps[rowid];
|
|
591
593
|
}
|
|
592
594
|
});
|
|
593
|
-
|
|
595
|
+
reactData.removeRowFlag++;
|
|
596
|
+
reactData.insertRowFlag++;
|
|
594
597
|
reactData.pendingRowFlag++;
|
|
595
598
|
$xeTable.updateFooter();
|
|
596
599
|
$xeTable.cacheRowMap(false);
|
|
@@ -661,13 +664,10 @@ export default {
|
|
|
661
664
|
*/
|
|
662
665
|
_getInsertRecords() {
|
|
663
666
|
const $xeTable = this;
|
|
664
|
-
const reactData = $xeTable;
|
|
665
667
|
const internalData = $xeTable;
|
|
666
|
-
const {
|
|
667
|
-
const { fullAllDataRowIdData } = internalData;
|
|
668
|
-
const { insertMaps } = editStore;
|
|
668
|
+
const { fullAllDataRowIdData, insertRowMaps } = internalData;
|
|
669
669
|
const insertRecords = [];
|
|
670
|
-
XEUtils.each(
|
|
670
|
+
XEUtils.each(insertRowMaps, (row, rowid) => {
|
|
671
671
|
if (fullAllDataRowIdData[rowid]) {
|
|
672
672
|
insertRecords.push(row);
|
|
673
673
|
}
|
|
@@ -679,11 +679,10 @@ export default {
|
|
|
679
679
|
*/
|
|
680
680
|
_getRemoveRecords() {
|
|
681
681
|
const $xeTable = this;
|
|
682
|
-
const
|
|
683
|
-
const {
|
|
684
|
-
const { removeMaps } = editStore;
|
|
682
|
+
const internalData = $xeTable;
|
|
683
|
+
const { removeRowMaps } = internalData;
|
|
685
684
|
const removeRecords = [];
|
|
686
|
-
XEUtils.each(
|
|
685
|
+
XEUtils.each(removeRowMaps, (row) => {
|
|
687
686
|
removeRecords.push(row);
|
|
688
687
|
});
|
|
689
688
|
return removeRecords;
|
|
@@ -695,17 +694,17 @@ export default {
|
|
|
695
694
|
*/
|
|
696
695
|
_getUpdateRecords() {
|
|
697
696
|
const $xeTable = this;
|
|
698
|
-
const
|
|
697
|
+
const props = $xeTable;
|
|
698
|
+
const internalData = $xeTable;
|
|
699
|
+
const { keepSource, treeConfig } = props;
|
|
700
|
+
const { tableFullData } = internalData;
|
|
701
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
699
702
|
if (keepSource) {
|
|
700
|
-
|
|
701
|
-
const { row, column } = actived;
|
|
702
|
-
if (row || column) {
|
|
703
|
-
syncActivedCell($xeTable);
|
|
704
|
-
}
|
|
703
|
+
syncActivedCell($xeTable);
|
|
705
704
|
if (treeConfig) {
|
|
706
|
-
return XEUtils.filterTree(tableFullData, row => isUpdateByRow(row), treeOpts);
|
|
705
|
+
return XEUtils.filterTree(tableFullData, row => $xeTable.isUpdateByRow(row), treeOpts);
|
|
707
706
|
}
|
|
708
|
-
return tableFullData.filter((row) => isUpdateByRow(row));
|
|
707
|
+
return tableFullData.filter((row) => $xeTable.isUpdateByRow(row));
|
|
709
708
|
}
|
|
710
709
|
return [];
|
|
711
710
|
},
|
|
@@ -754,42 +753,52 @@ export default {
|
|
|
754
753
|
return handleClearEdit($xeTable, evnt, targetRow);
|
|
755
754
|
},
|
|
756
755
|
_getActiveRecord() {
|
|
756
|
+
const $xeTable = this;
|
|
757
757
|
if (process.env.NODE_ENV === 'development') {
|
|
758
758
|
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
|
|
759
759
|
}
|
|
760
760
|
// 即将废弃
|
|
761
|
-
return
|
|
761
|
+
return $xeTable.getEditRecord();
|
|
762
762
|
},
|
|
763
763
|
_getEditRecord() {
|
|
764
|
-
const
|
|
765
|
-
const
|
|
766
|
-
const
|
|
767
|
-
|
|
764
|
+
const $xeTable = this;
|
|
765
|
+
const reactData = $xeTable;
|
|
766
|
+
const internalData = $xeTable;
|
|
767
|
+
const { editStore } = reactData;
|
|
768
|
+
const { afterFullData } = internalData;
|
|
769
|
+
const el = $xeTable.$refs.refElem;
|
|
770
|
+
const { args, row } = editStore.actived;
|
|
771
|
+
if (args && $xeTable.findRowIndexOf(afterFullData, row) > -1 && el.querySelectorAll('.vxe-body--column.col--active').length) {
|
|
768
772
|
return Object.assign({}, args);
|
|
769
773
|
}
|
|
770
774
|
return null;
|
|
771
775
|
},
|
|
772
776
|
_isActiveByRow(row) {
|
|
777
|
+
const $xeTable = this;
|
|
773
778
|
if (process.env.NODE_ENV === 'development') {
|
|
774
779
|
warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
|
|
775
780
|
}
|
|
776
781
|
// 即将废弃
|
|
777
|
-
return
|
|
782
|
+
return $xeTable.isEditByRow(row);
|
|
778
783
|
},
|
|
779
784
|
/**
|
|
780
785
|
* 判断行是否为激活编辑状态
|
|
781
786
|
* @param {Row} row 行对象
|
|
782
787
|
*/
|
|
783
788
|
_isEditByRow(row) {
|
|
784
|
-
|
|
789
|
+
const $xeTable = this;
|
|
790
|
+
const reactData = $xeTable;
|
|
791
|
+
const { editStore } = reactData;
|
|
792
|
+
return editStore.actived.row === row;
|
|
785
793
|
},
|
|
786
794
|
/**
|
|
787
795
|
* 处理聚焦
|
|
788
796
|
*/
|
|
789
797
|
handleFocus(params) {
|
|
790
|
-
const
|
|
798
|
+
const $xeTable = this;
|
|
791
799
|
const { row, column, cell } = params;
|
|
792
800
|
const { editRender } = column;
|
|
801
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
793
802
|
if (isEnableConf(editRender)) {
|
|
794
803
|
const compRender = renderer.get(editRender.name);
|
|
795
804
|
let autoFocus = editRender.autofocus || editRender.autoFocus;
|
|
@@ -805,7 +814,7 @@ export default {
|
|
|
805
814
|
}
|
|
806
815
|
// 如果指定了聚焦 class
|
|
807
816
|
if (XEUtils.isFunction(autoFocus)) {
|
|
808
|
-
inputElem = autoFocus.call(
|
|
817
|
+
inputElem = autoFocus.call($xeTable, params);
|
|
809
818
|
}
|
|
810
819
|
else if (autoFocus) {
|
|
811
820
|
if (autoFocus === true) {
|
|
@@ -826,7 +835,7 @@ export default {
|
|
|
826
835
|
}
|
|
827
836
|
else {
|
|
828
837
|
// 保持一致行为,光标移到末端
|
|
829
|
-
if (
|
|
838
|
+
if (browseObj.msie) {
|
|
830
839
|
const textRange = inputElem.createTextRange();
|
|
831
840
|
textRange.collapse(false);
|
|
832
841
|
textRange.select();
|
|
@@ -838,18 +847,19 @@ export default {
|
|
|
838
847
|
if (editOpts.autoPos) {
|
|
839
848
|
if (!column.fixed) {
|
|
840
849
|
// 显示到可视区中
|
|
841
|
-
|
|
850
|
+
$xeTable.scrollToRow(row, column);
|
|
842
851
|
}
|
|
843
852
|
}
|
|
844
853
|
}
|
|
845
854
|
}
|
|
846
855
|
},
|
|
847
856
|
_setActiveRow(row) {
|
|
857
|
+
const $xeTable = this;
|
|
848
858
|
if (process.env.NODE_ENV === 'development') {
|
|
849
859
|
warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
|
|
850
860
|
}
|
|
851
861
|
// 即将废弃
|
|
852
|
-
return
|
|
862
|
+
return $xeTable.setEditRow(row);
|
|
853
863
|
},
|
|
854
864
|
/**
|
|
855
865
|
* 激活行编辑
|
|
@@ -861,7 +871,7 @@ export default {
|
|
|
861
871
|
if (fieldOrColumn) {
|
|
862
872
|
isPos = true;
|
|
863
873
|
if (fieldOrColumn !== true) {
|
|
864
|
-
column = XEUtils.isString(fieldOrColumn) ?
|
|
874
|
+
column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
865
875
|
}
|
|
866
876
|
}
|
|
867
877
|
return handleEditCell($xeTable, row, column, isPos);
|
|
@@ -884,24 +894,38 @@ export default {
|
|
|
884
894
|
* 只对 trigger=dblclick 有效,选中单元格
|
|
885
895
|
*/
|
|
886
896
|
_setSelectCell(row, fieldOrColumn) {
|
|
887
|
-
const
|
|
888
|
-
const
|
|
897
|
+
const $xeTable = this;
|
|
898
|
+
const reactData = $xeTable;
|
|
899
|
+
const { tableData } = reactData;
|
|
900
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
901
|
+
const column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
889
902
|
if (row && column && editOpts.trigger !== 'manual') {
|
|
890
|
-
const rowIndex =
|
|
903
|
+
const rowIndex = $xeTable.findRowIndexOf(tableData, row);
|
|
891
904
|
if (rowIndex > -1) {
|
|
892
|
-
const cell =
|
|
893
|
-
const params = {
|
|
894
|
-
|
|
905
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
906
|
+
const params = {
|
|
907
|
+
row,
|
|
908
|
+
rowIndex,
|
|
909
|
+
column,
|
|
910
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
911
|
+
cell
|
|
912
|
+
};
|
|
913
|
+
$xeTable.handleSelected(params, {});
|
|
895
914
|
}
|
|
896
915
|
}
|
|
897
|
-
return
|
|
916
|
+
return $xeTable.$nextTick();
|
|
898
917
|
},
|
|
899
918
|
/**
|
|
900
919
|
* 处理选中源
|
|
901
920
|
*/
|
|
902
921
|
handleSelected(params, evnt) {
|
|
903
922
|
const $xeTable = this;
|
|
904
|
-
const
|
|
923
|
+
const props = $xeTable;
|
|
924
|
+
const reactData = $xeTable;
|
|
925
|
+
const { mouseConfig } = props;
|
|
926
|
+
const { editStore } = reactData;
|
|
927
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
928
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
905
929
|
const { actived, selected } = editStore;
|
|
906
930
|
const { row, column } = params;
|
|
907
931
|
const isMouseSelected = mouseConfig && mouseOpts.selected;
|
|
@@ -909,22 +933,24 @@ export default {
|
|
|
909
933
|
if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
|
|
910
934
|
if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
|
|
911
935
|
handleClearEdit($xeTable, evnt);
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
936
|
+
$xeTable.clearSelected();
|
|
937
|
+
if ($xeTable.clearCellAreas) {
|
|
938
|
+
$xeTable.clearCellAreas();
|
|
939
|
+
$xeTable.clearCopyCellArea();
|
|
940
|
+
}
|
|
915
941
|
selected.args = params;
|
|
916
942
|
selected.row = row;
|
|
917
943
|
selected.column = column;
|
|
918
944
|
if (isMouseSelected) {
|
|
919
945
|
this.addCellSelectedClass();
|
|
920
946
|
}
|
|
921
|
-
|
|
947
|
+
$xeTable.focus();
|
|
922
948
|
if (evnt) {
|
|
923
|
-
|
|
949
|
+
$xeTable.dispatchEvent('cell-selected', params, evnt);
|
|
924
950
|
}
|
|
925
951
|
}
|
|
926
952
|
}
|
|
927
|
-
return
|
|
953
|
+
return $xeTable.$nextTick();
|
|
928
954
|
};
|
|
929
955
|
return selectMethod();
|
|
930
956
|
},
|
|
@@ -932,7 +958,10 @@ export default {
|
|
|
932
958
|
* 获取选中的单元格
|
|
933
959
|
*/
|
|
934
960
|
_getSelectedCell() {
|
|
935
|
-
const
|
|
961
|
+
const $xeTable = this;
|
|
962
|
+
const reactData = $xeTable;
|
|
963
|
+
const { editStore } = reactData;
|
|
964
|
+
const { args, column } = editStore.selected;
|
|
936
965
|
if (args && column) {
|
|
937
966
|
return Object.assign({}, args);
|
|
938
967
|
}
|
|
@@ -943,12 +972,13 @@ export default {
|
|
|
943
972
|
*/
|
|
944
973
|
_clearSelected() {
|
|
945
974
|
const $xeTable = this;
|
|
946
|
-
const
|
|
975
|
+
const reactData = $xeTable;
|
|
976
|
+
const { editStore } = reactData;
|
|
977
|
+
const { selected } = editStore;
|
|
947
978
|
selected.row = null;
|
|
948
979
|
selected.column = null;
|
|
949
|
-
this.reColTitleSdCls();
|
|
950
980
|
removeCellSelectedClass($xeTable);
|
|
951
|
-
return
|
|
981
|
+
return $xeTable.$nextTick();
|
|
952
982
|
},
|
|
953
983
|
reColTitleSdCls() {
|
|
954
984
|
const headerElem = this.elemStore['main-header-list'];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { getRefElem } from '../../src/util';
|
|
3
|
-
import {
|
|
3
|
+
import { hasClass, getAbsolutePos, addClass, removeClass } from '../../../ui/src/dom';
|
|
4
|
+
const browseObj = XEUtils.browse();
|
|
4
5
|
function getTargetOffset(target, container) {
|
|
5
6
|
let offsetTop = 0;
|
|
6
7
|
let offsetLeft = 0;
|
|
7
|
-
const triggerCheckboxLabel = !
|
|
8
|
+
const triggerCheckboxLabel = !browseObj.firefox && hasClass(target, 'vxe-checkbox--label');
|
|
8
9
|
if (triggerCheckboxLabel) {
|
|
9
10
|
const checkboxLabelStyle = getComputedStyle(target);
|
|
10
11
|
offsetTop -= XEUtils.toNumber(checkboxLabelStyle.paddingTop);
|
|
@@ -149,13 +149,10 @@ export default {
|
|
|
149
149
|
beginValidate(rows, cols, cb, isFull) {
|
|
150
150
|
const $xeTable = this;
|
|
151
151
|
const props = $xeTable;
|
|
152
|
-
const reactData = $xeTable;
|
|
153
152
|
const internalData = $xeTable;
|
|
154
153
|
const validRest = {};
|
|
155
154
|
const { editRules, treeConfig } = props;
|
|
156
|
-
const {
|
|
157
|
-
const { afterFullData, pendingRowMaps } = internalData;
|
|
158
|
-
const { removeMaps } = editStore;
|
|
155
|
+
const { afterFullData, pendingRowMaps, removeRowMaps } = internalData;
|
|
159
156
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
160
157
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
161
158
|
let validList;
|
|
@@ -183,7 +180,7 @@ export default {
|
|
|
183
180
|
const handleVaild = (row) => {
|
|
184
181
|
const rowid = getRowid($xeTable, row);
|
|
185
182
|
// 是否删除
|
|
186
|
-
if (
|
|
183
|
+
if (removeRowMaps[rowid]) {
|
|
187
184
|
return;
|
|
188
185
|
}
|
|
189
186
|
// 是否标记删除
|
package/es/table/src/body.js
CHANGED
|
@@ -417,9 +417,12 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
417
417
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
418
418
|
tableData.forEach((row, $rowIndex) => {
|
|
419
419
|
const trOn = {};
|
|
420
|
+
const rowid = handleGetRowId(row);
|
|
421
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
420
422
|
let rowIndex = $rowIndex;
|
|
421
|
-
|
|
422
|
-
|
|
423
|
+
let rowLevel = 0;
|
|
424
|
+
let seq = -1;
|
|
425
|
+
let _rowIndex = -1;
|
|
423
426
|
// 当前行事件
|
|
424
427
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
425
428
|
trOn.mouseenter = (evnt) => {
|
|
@@ -435,11 +438,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
435
438
|
$xeTable.clearHoverRow();
|
|
436
439
|
};
|
|
437
440
|
}
|
|
438
|
-
const rowid = handleGetRowId(row);
|
|
439
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
440
|
-
let rowLevel = 0;
|
|
441
|
-
let seq = -1;
|
|
442
|
-
let _rowIndex = 0;
|
|
443
441
|
if (rowRest) {
|
|
444
442
|
rowLevel = rowRest.level;
|
|
445
443
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
@@ -448,6 +446,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
448
446
|
else {
|
|
449
447
|
seq = rowRest.seq;
|
|
450
448
|
}
|
|
449
|
+
rowIndex = rowRest.index;
|
|
451
450
|
_rowIndex = rowRest._index;
|
|
452
451
|
}
|
|
453
452
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|