vxe-table 3.13.14 → 3.13.16
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/locale/lang/ar-EG.js +1 -0
- package/es/locale/lang/de-DE.js +1 -0
- package/es/locale/lang/en-US.js +3 -2
- package/es/locale/lang/es-ES.js +1 -0
- package/es/locale/lang/fr-FR.js +1 -0
- package/es/locale/lang/hu-HU.js +1 -0
- package/es/locale/lang/hy-AM.js +1 -0
- package/es/locale/lang/id-ID.js +1 -0
- package/es/locale/lang/it-IT.js +1 -0
- package/es/locale/lang/ja-JP.js +1 -0
- package/es/locale/lang/ko-KR.js +1 -0
- package/es/locale/lang/nb-NO.js +1 -0
- package/es/locale/lang/pt-BR.js +1 -0
- package/es/locale/lang/ru-RU.js +1 -0
- package/es/locale/lang/th-TH.js +1 -0
- package/es/locale/lang/ug-CN.js +1 -0
- package/es/locale/lang/uk-UA.js +1 -0
- package/es/locale/lang/vi-VN.js +1 -0
- package/es/locale/lang/zh-CHT.js +1 -0
- package/es/locale/lang/zh-CN.js +1 -0
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +18 -16
- package/es/table/module/edit/mixin.js +4 -2
- package/es/table/src/cell.js +2 -1
- package/es/table/src/column.js +2 -2
- package/es/table/src/group.js +2 -2
- package/es/table/src/methods.js +22 -18
- package/es/table/src/table.js +151 -147
- package/es/toolbar/src/toolbar.js +2 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +216 -207
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +1 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +1 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +3 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -2
- package/lib/locale/lang/es-ES.js +1 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +1 -0
- package/lib/locale/lang/fr-FR.js +1 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +1 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -0
- package/lib/locale/lang/hy-AM.js +1 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +1 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +1 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +1 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +1 -0
- package/lib/locale/lang/ko-KR.js +1 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -0
- package/lib/locale/lang/nb-NO.js +1 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +1 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +1 -0
- package/lib/locale/lang/ru-RU.js +1 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +1 -0
- package/lib/locale/lang/th-TH.js +1 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +1 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +1 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -0
- package/lib/locale/lang/vi-VN.js +1 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +1 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +1 -0
- package/lib/locale/lang/zh-CN.js +1 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +1 -0
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +18 -16
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +4 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/cell.js +2 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -2
- package/lib/table/src/group.js +3 -2
- package/lib/table/src/methods.js +23 -18
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +160 -162
- package/lib/table/src/table.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +3 -2
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +1 -0
- package/packages/locale/lang/de-DE.ts +1 -0
- package/packages/locale/lang/en-US.ts +3 -2
- package/packages/locale/lang/es-ES.ts +1 -0
- package/packages/locale/lang/fr-FR.ts +1 -0
- package/packages/locale/lang/hu-HU.ts +1 -0
- package/packages/locale/lang/hy-AM.ts +1 -0
- package/packages/locale/lang/id-ID.ts +1 -0
- package/packages/locale/lang/it-IT.ts +1 -0
- package/packages/locale/lang/ja-JP.ts +1 -0
- package/packages/locale/lang/ko-KR.ts +1 -0
- package/packages/locale/lang/nb-NO.ts +1 -0
- package/packages/locale/lang/pt-BR.ts +1 -0
- package/packages/locale/lang/ru-RU.ts +1 -0
- package/packages/locale/lang/th-TH.ts +1 -0
- package/packages/locale/lang/ug-CN.ts +1 -0
- package/packages/locale/lang/uk-UA.ts +1 -0
- package/packages/locale/lang/vi-VN.ts +1 -0
- package/packages/locale/lang/zh-CHT.ts +1 -0
- package/packages/locale/lang/zh-CN.ts +1 -0
- package/packages/table/module/custom/panel.ts +22 -20
- package/packages/table/module/edit/mixin.ts +4 -2
- package/packages/table/src/cell.ts +2 -1
- package/packages/table/src/column.ts +2 -2
- package/packages/table/src/group.ts +2 -2
- package/packages/table/src/methods.ts +22 -18
- package/packages/table/src/table.ts +152 -147
- package/packages/toolbar/src/toolbar.ts +2 -2
- /package/es/{iconfont.1740640529071.ttf → iconfont.1740799948632.ttf} +0 -0
- /package/es/{iconfont.1740640529071.woff → iconfont.1740799948632.woff} +0 -0
- /package/es/{iconfont.1740640529071.woff2 → iconfont.1740799948632.woff2} +0 -0
- /package/lib/{iconfont.1740640529071.ttf → iconfont.1740799948632.ttf} +0 -0
- /package/lib/{iconfont.1740640529071.woff → iconfont.1740799948632.woff} +0 -0
- /package/lib/{iconfont.1740640529071.woff2 → iconfont.1740799948632.woff2} +0 -0
|
@@ -1067,12 +1067,13 @@ export default {
|
|
|
1067
1067
|
if (prevDragCol && dragCol) {
|
|
1068
1068
|
// 判断是否有拖动
|
|
1069
1069
|
if (prevDragCol !== dragCol) {
|
|
1070
|
-
const
|
|
1070
|
+
const dragColumn = dragCol;
|
|
1071
1071
|
const newColumn = prevDragCol;
|
|
1072
1072
|
Promise.resolve(dragEndMethod
|
|
1073
1073
|
? dragEndMethod({
|
|
1074
|
-
oldColumn,
|
|
1074
|
+
oldColumn: dragColumn,
|
|
1075
1075
|
newColumn,
|
|
1076
|
+
dragColumn,
|
|
1076
1077
|
dragPos: prevDragPos,
|
|
1077
1078
|
dragToChild: !!prevDragToChild,
|
|
1078
1079
|
offsetIndex: dragOffsetIndex
|
|
@@ -1084,13 +1085,13 @@ export default {
|
|
|
1084
1085
|
let oafIndex = -1;
|
|
1085
1086
|
let nafIndex = -1;
|
|
1086
1087
|
const oldAllMaps = {};
|
|
1087
|
-
XEUtils.eachTree([
|
|
1088
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
1088
1089
|
oldAllMaps[column.id] = column;
|
|
1089
1090
|
});
|
|
1090
1091
|
let isSelfToChildStatus = false;
|
|
1091
1092
|
// 只有实时拖拽支持跨层级
|
|
1092
1093
|
if (immediate) {
|
|
1093
|
-
if (
|
|
1094
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
1094
1095
|
// 子到子
|
|
1095
1096
|
if (!isCrossDrag) {
|
|
1096
1097
|
return;
|
|
@@ -1108,7 +1109,7 @@ export default {
|
|
|
1108
1109
|
}
|
|
1109
1110
|
}
|
|
1110
1111
|
}
|
|
1111
|
-
else if (
|
|
1112
|
+
else if (dragColumn.parentId) {
|
|
1112
1113
|
// 子到根
|
|
1113
1114
|
if (!isCrossDrag) {
|
|
1114
1115
|
return;
|
|
@@ -1135,17 +1136,17 @@ export default {
|
|
|
1135
1136
|
else {
|
|
1136
1137
|
// 根到根
|
|
1137
1138
|
}
|
|
1138
|
-
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id ===
|
|
1139
|
+
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id);
|
|
1139
1140
|
// 改变层级
|
|
1140
1141
|
if (isSelfToChildStatus && (isCrossDrag && isSelfToChildDrag)) {
|
|
1141
1142
|
if (oldewMatchRest) {
|
|
1142
1143
|
const { items: oCols, index: oIndex } = oldewMatchRest;
|
|
1143
|
-
const childList =
|
|
1144
|
+
const childList = dragColumn.children || [];
|
|
1144
1145
|
childList.forEach(column => {
|
|
1145
|
-
column.parentId =
|
|
1146
|
+
column.parentId = dragColumn.parentId;
|
|
1146
1147
|
});
|
|
1147
1148
|
oCols.splice(oIndex, 1, ...childList);
|
|
1148
|
-
|
|
1149
|
+
dragColumn.children = [];
|
|
1149
1150
|
}
|
|
1150
1151
|
}
|
|
1151
1152
|
else {
|
|
@@ -1162,12 +1163,12 @@ export default {
|
|
|
1162
1163
|
const { items: nCols, index: nIndex, parent: nParent } = newMatchRest;
|
|
1163
1164
|
// 转子级
|
|
1164
1165
|
if ((isCrossDrag && isToChildDrag) && prevDragToChild) {
|
|
1165
|
-
|
|
1166
|
-
newColumn.children = (newColumn.children || []).concat([
|
|
1166
|
+
dragColumn.parentId = newColumn.id;
|
|
1167
|
+
newColumn.children = (newColumn.children || []).concat([dragColumn]);
|
|
1167
1168
|
}
|
|
1168
1169
|
else {
|
|
1169
|
-
|
|
1170
|
-
nCols.splice(nIndex + dragOffsetIndex, 0,
|
|
1170
|
+
dragColumn.parentId = newColumn.parentId;
|
|
1171
|
+
nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn);
|
|
1171
1172
|
}
|
|
1172
1173
|
if (!nParent) {
|
|
1173
1174
|
nafIndex = nIndex;
|
|
@@ -1181,10 +1182,10 @@ export default {
|
|
|
1181
1182
|
});
|
|
1182
1183
|
}
|
|
1183
1184
|
else {
|
|
1184
|
-
oafIndex = XEUtils.findIndexOf(customColumnList, item => item.id ===
|
|
1185
|
+
oafIndex = XEUtils.findIndexOf(customColumnList, item => item.id === dragColumn.id);
|
|
1185
1186
|
customColumnList.splice(oafIndex, 1);
|
|
1186
1187
|
nafIndex = XEUtils.findIndexOf(customColumnList, item => item.id === newColumn.id);
|
|
1187
|
-
customColumnList.splice(nafIndex + dragOffsetIndex, 0,
|
|
1188
|
+
customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn);
|
|
1188
1189
|
}
|
|
1189
1190
|
reactData.isDragColMove = true;
|
|
1190
1191
|
if (mouseConfig) {
|
|
@@ -1197,8 +1198,9 @@ export default {
|
|
|
1197
1198
|
}
|
|
1198
1199
|
}
|
|
1199
1200
|
$xeTable.dispatchEvent('column-dragend', {
|
|
1200
|
-
oldColumn,
|
|
1201
|
+
oldColumn: dragColumn,
|
|
1201
1202
|
newColumn,
|
|
1203
|
+
dragColumn,
|
|
1202
1204
|
dragPos: prevDragPos,
|
|
1203
1205
|
offsetIndex: dragOffsetIndex,
|
|
1204
1206
|
_index: {
|
|
@@ -276,7 +276,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
276
276
|
return handleInsertRowAt($xeTable, records.map((item) => Object.assign({}, item, { [parentField]: parentRow[rowField] })), targetRow, isInsertNextRow);
|
|
277
277
|
}
|
|
278
278
|
else {
|
|
279
|
-
errLog('vxe.error.errProp', ['tree-config.
|
|
279
|
+
errLog('vxe.error.errProp', ['tree-config.transform=false', 'tree-config.transform=true']);
|
|
280
280
|
}
|
|
281
281
|
return Promise.resolve({ row: null, rows: [] });
|
|
282
282
|
}
|
|
@@ -854,7 +854,9 @@ export default {
|
|
|
854
854
|
let isPos = false;
|
|
855
855
|
if (fieldOrColumn) {
|
|
856
856
|
isPos = true;
|
|
857
|
-
|
|
857
|
+
if (fieldOrColumn !== true) {
|
|
858
|
+
column = XEUtils.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
859
|
+
}
|
|
858
860
|
}
|
|
859
861
|
return handleEditCell($xeTable, row, column, isPos);
|
|
860
862
|
},
|
package/es/table/src/cell.js
CHANGED
|
@@ -81,12 +81,13 @@ function renderCellBaseVNs(h, params, content) {
|
|
|
81
81
|
const { treeConfig, dragConfig } = tableProps;
|
|
82
82
|
const rowOpts = $table.computeRowOpts;
|
|
83
83
|
const rowDragOpts = $table.computeRowDragOpts;
|
|
84
|
+
const treeOpts = $table.computeTreeOpts;
|
|
84
85
|
const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts;
|
|
85
86
|
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
|
|
86
87
|
const vns = XEUtils.isArray(content) ? content : [content];
|
|
87
88
|
if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
|
|
88
89
|
if (treeConfig) {
|
|
89
|
-
if (isPeerDrag || isCrossDrag || !level) {
|
|
90
|
+
if (treeOpts.transform && (isPeerDrag || isCrossDrag || !level)) {
|
|
90
91
|
vns.unshift(renderCellDragIcon(h, params));
|
|
91
92
|
}
|
|
92
93
|
}
|
package/es/table/src/column.js
CHANGED
|
@@ -143,7 +143,7 @@ Object.keys(columnProps).forEach(name => {
|
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
});
|
|
146
|
-
export default
|
|
146
|
+
export default {
|
|
147
147
|
name: 'VxeColumn',
|
|
148
148
|
props: columnProps,
|
|
149
149
|
provide() {
|
|
@@ -175,4 +175,4 @@ export default defineVxeComponent({
|
|
|
175
175
|
return h('div', this.$slots.default);
|
|
176
176
|
},
|
|
177
177
|
methods: Cell
|
|
178
|
-
}
|
|
178
|
+
};
|
package/es/table/src/group.js
CHANGED
|
@@ -2,7 +2,7 @@ import Cell from './cell';
|
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import { assembleColumn, destroyColumn } from './util';
|
|
4
4
|
import { columnProps, columnWatch } from './column';
|
|
5
|
-
export default
|
|
5
|
+
export default {
|
|
6
6
|
name: 'VxeColgroup',
|
|
7
7
|
props: columnProps,
|
|
8
8
|
provide() {
|
|
@@ -39,4 +39,4 @@ export default defineVxeComponent({
|
|
|
39
39
|
return h('div', this.$slots.default);
|
|
40
40
|
},
|
|
41
41
|
methods: Cell
|
|
42
|
-
}
|
|
42
|
+
};
|
package/es/table/src/methods.js
CHANGED
|
@@ -6378,6 +6378,7 @@ const Methods = {
|
|
|
6378
6378
|
const dragParams = {
|
|
6379
6379
|
oldRow: dragRow,
|
|
6380
6380
|
newRow: prevDragRow,
|
|
6381
|
+
dragRow,
|
|
6381
6382
|
dragPos: prevDragPos,
|
|
6382
6383
|
dragToChild: !!prevDragToChild,
|
|
6383
6384
|
offsetIndex: dragOffsetIndex
|
|
@@ -6518,6 +6519,7 @@ const Methods = {
|
|
|
6518
6519
|
$xeTable.dispatchEvent('row-dragend', {
|
|
6519
6520
|
oldRow: dragRow,
|
|
6520
6521
|
newRow: prevDragRow,
|
|
6522
|
+
dragRow,
|
|
6521
6523
|
dragPos: prevDragPos,
|
|
6522
6524
|
dragToChild: isDragToChildFlag,
|
|
6523
6525
|
offsetIndex: dragOffsetIndex,
|
|
@@ -6678,11 +6680,12 @@ const Methods = {
|
|
|
6678
6680
|
if (prevDragCol && dragCol) {
|
|
6679
6681
|
// 判断是否有拖动
|
|
6680
6682
|
if (prevDragCol !== dragCol) {
|
|
6681
|
-
const
|
|
6683
|
+
const dragColumn = dragCol;
|
|
6682
6684
|
const newColumn = prevDragCol;
|
|
6683
6685
|
const dragParams = {
|
|
6684
|
-
oldColumn,
|
|
6686
|
+
oldColumn: dragColumn,
|
|
6685
6687
|
newColumn,
|
|
6688
|
+
dragColumn,
|
|
6686
6689
|
dragPos: prevDragPos,
|
|
6687
6690
|
dragToChild: !!prevDragToChild,
|
|
6688
6691
|
offsetIndex: dragOffsetIndex
|
|
@@ -6695,14 +6698,14 @@ const Methods = {
|
|
|
6695
6698
|
let oafIndex = -1;
|
|
6696
6699
|
let nafIndex = -1;
|
|
6697
6700
|
const oldAllMaps = {};
|
|
6698
|
-
XEUtils.eachTree([
|
|
6701
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
6699
6702
|
oldAllMaps[column.id] = column;
|
|
6700
6703
|
});
|
|
6701
6704
|
let isSelfToChildStatus = false;
|
|
6702
|
-
if (
|
|
6705
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
6703
6706
|
// 子到子
|
|
6704
6707
|
if (isPeerDrag && !isCrossDrag) {
|
|
6705
|
-
if (
|
|
6708
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
6706
6709
|
// 非同级
|
|
6707
6710
|
return;
|
|
6708
6711
|
}
|
|
@@ -6725,7 +6728,7 @@ const Methods = {
|
|
|
6725
6728
|
}
|
|
6726
6729
|
}
|
|
6727
6730
|
}
|
|
6728
|
-
else if (
|
|
6731
|
+
else if (dragColumn.parentId) {
|
|
6729
6732
|
// 子到根
|
|
6730
6733
|
if (!isCrossDrag) {
|
|
6731
6734
|
return;
|
|
@@ -6752,17 +6755,17 @@ const Methods = {
|
|
|
6752
6755
|
else {
|
|
6753
6756
|
// 根到根
|
|
6754
6757
|
}
|
|
6755
|
-
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id ===
|
|
6758
|
+
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id);
|
|
6756
6759
|
// 改变层级
|
|
6757
6760
|
if (isSelfToChildStatus && (isCrossDrag && isSelfToChildDrag)) {
|
|
6758
6761
|
if (oldewMatchRest) {
|
|
6759
6762
|
const { items: oCols, index: oIndex } = oldewMatchRest;
|
|
6760
|
-
const childList =
|
|
6763
|
+
const childList = dragColumn.children || [];
|
|
6761
6764
|
childList.forEach(column => {
|
|
6762
|
-
column.parentId =
|
|
6765
|
+
column.parentId = dragColumn.parentId;
|
|
6763
6766
|
});
|
|
6764
6767
|
oCols.splice(oIndex, 1, ...childList);
|
|
6765
|
-
|
|
6768
|
+
dragColumn.children = [];
|
|
6766
6769
|
}
|
|
6767
6770
|
}
|
|
6768
6771
|
else {
|
|
@@ -6779,12 +6782,12 @@ const Methods = {
|
|
|
6779
6782
|
const { items: nCols, index: nIndex, parent: nParent } = newMatchRest;
|
|
6780
6783
|
// 转子级
|
|
6781
6784
|
if ((isCrossDrag && isToChildDrag) && isDragToChildFlag) {
|
|
6782
|
-
|
|
6783
|
-
newColumn.children = (newColumn.children || []).concat([
|
|
6785
|
+
dragColumn.parentId = newColumn.id;
|
|
6786
|
+
newColumn.children = (newColumn.children || []).concat([dragColumn]);
|
|
6784
6787
|
}
|
|
6785
6788
|
else {
|
|
6786
|
-
|
|
6787
|
-
nCols.splice(nIndex + dragOffsetIndex, 0,
|
|
6789
|
+
dragColumn.parentId = newColumn.parentId;
|
|
6790
|
+
nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn);
|
|
6788
6791
|
}
|
|
6789
6792
|
if (!nParent) {
|
|
6790
6793
|
nafIndex = nIndex;
|
|
@@ -6807,8 +6810,9 @@ const Methods = {
|
|
|
6807
6810
|
}
|
|
6808
6811
|
}
|
|
6809
6812
|
$xeTable.dispatchEvent('column-dragend', {
|
|
6810
|
-
oldColumn,
|
|
6813
|
+
oldColumn: dragColumn,
|
|
6811
6814
|
newColumn,
|
|
6815
|
+
dragColumn,
|
|
6812
6816
|
dragPos: prevDragPos,
|
|
6813
6817
|
dragToChild: isDragToChildFlag,
|
|
6814
6818
|
offsetIndex: dragOffsetIndex,
|
|
@@ -8168,7 +8172,7 @@ const Methods = {
|
|
|
8168
8172
|
const tableProps = $xeTable;
|
|
8169
8173
|
const reactData = $xeTable;
|
|
8170
8174
|
const internalData = $xeTable;
|
|
8171
|
-
const { target, deltaY, deltaX } = evnt;
|
|
8175
|
+
const { target, deltaY, deltaX, shiftKey } = evnt;
|
|
8172
8176
|
if (target && /^textarea$/i.test(target.tagName)) {
|
|
8173
8177
|
return;
|
|
8174
8178
|
}
|
|
@@ -8199,8 +8203,8 @@ const Methods = {
|
|
|
8199
8203
|
return;
|
|
8200
8204
|
}
|
|
8201
8205
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
8202
|
-
const deltaTop = Math.ceil(deltaY * wheelSpeed);
|
|
8203
|
-
const deltaLeft = Math.ceil(deltaX * wheelSpeed);
|
|
8206
|
+
const deltaTop = Math.ceil((shiftKey ? deltaX : deltaY) * wheelSpeed);
|
|
8207
|
+
const deltaLeft = Math.ceil((shiftKey ? deltaY : deltaX) * wheelSpeed);
|
|
8204
8208
|
const isTopWheel = deltaTop < 0;
|
|
8205
8209
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
8206
8210
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
package/es/table/src/table.js
CHANGED
|
@@ -1216,7 +1216,9 @@ export default {
|
|
|
1216
1216
|
},
|
|
1217
1217
|
created() {
|
|
1218
1218
|
const $xeTable = this;
|
|
1219
|
-
const
|
|
1219
|
+
const props = $xeTable;
|
|
1220
|
+
const internalData = $xeTable;
|
|
1221
|
+
Object.assign($xeTable, {
|
|
1220
1222
|
tZindex: 0,
|
|
1221
1223
|
elemStore: {},
|
|
1222
1224
|
// 存放横向 X 虚拟滚动相关的信息
|
|
@@ -1282,162 +1284,164 @@ export default {
|
|
|
1282
1284
|
swYInterval: 0,
|
|
1283
1285
|
swYTotal: 0
|
|
1284
1286
|
});
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
}
|
|
1301
|
-
if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
1302
|
-
warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
|
|
1303
|
-
}
|
|
1304
|
-
if (treeConfig && !treeOpts.transform && this.stripe) {
|
|
1305
|
-
warnLog('vxe.error.noTree', ['stripe']);
|
|
1306
|
-
}
|
|
1307
|
-
if (this.showFooter && !(this.footerMethod || this.footerData)) {
|
|
1308
|
-
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
1309
|
-
}
|
|
1310
|
-
if (rowOpts.height) {
|
|
1311
|
-
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
1312
|
-
}
|
|
1313
|
-
if (this.tooltipOpts.enabled) {
|
|
1314
|
-
warnLog('vxe.error.delProp', ['tooltip-config.enabled', 'tooltip-config.showAll']);
|
|
1315
|
-
}
|
|
1316
|
-
// if (this.highlightCurrentRow) {
|
|
1317
|
-
// warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
|
|
1318
|
-
// }
|
|
1319
|
-
// if (this.highlightHoverRow) {
|
|
1320
|
-
// warnLog('vxe.error.delProp', ['highlight-hover-row', 'row-config.isHover'])
|
|
1321
|
-
// }
|
|
1322
|
-
// if (this.highlightCurrentColumn) {
|
|
1323
|
-
// warnLog('vxe.error.delProp', ['highlight-current-column', 'column-config.isCurrent'])
|
|
1324
|
-
// }
|
|
1325
|
-
// if (this.highlightHoverColumn) {
|
|
1326
|
-
// warnLog('vxe.error.delProp', ['highlight-hover-column', 'column-config.isHover'])
|
|
1327
|
-
// }
|
|
1328
|
-
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
1329
|
-
const { exportConfig, exportOpts, importConfig, importOpts } = this;
|
|
1330
|
-
if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
|
|
1331
|
-
warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')]);
|
|
1332
|
-
}
|
|
1333
|
-
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
1334
|
-
warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')]);
|
|
1335
|
-
}
|
|
1287
|
+
const { data, exportConfig, importConfig, treeConfig, showOverflow } = props;
|
|
1288
|
+
const { scrollXStore, scrollYStore } = internalData;
|
|
1289
|
+
const sYOpts = $xeTable.computeSYOpts;
|
|
1290
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
1291
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
1292
|
+
const radioOpts = $xeTable.computeRadioOpts;
|
|
1293
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
1294
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
1295
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
1296
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
1297
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
1298
|
+
const exportOpts = $xeTable.computeExportOpts;
|
|
1299
|
+
const importOpts = $xeTable.computeImportOpts;
|
|
1300
|
+
if (this.rowId) {
|
|
1301
|
+
warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField']);
|
|
1336
1302
|
}
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1339
|
-
if (!this.id) {
|
|
1340
|
-
if ((this.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
1341
|
-
errLog('vxe.error.reqProp', ['id']);
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
if (this.treeConfig && this.checkboxOpts.range) {
|
|
1345
|
-
errLog('vxe.error.noTree', ['checkbox-config.range']);
|
|
1346
|
-
}
|
|
1347
|
-
if (this.rowOpts.height && !this.showOverflow) {
|
|
1348
|
-
warnLog('vxe.error.notProp', ['table.show-overflow']);
|
|
1349
|
-
}
|
|
1350
|
-
if (!this.handleMousedownCellAreaEvent) {
|
|
1351
|
-
if (this.areaConfig) {
|
|
1352
|
-
warnLog('vxe.error.notProp', ['area-config']);
|
|
1353
|
-
}
|
|
1354
|
-
if (this.clipConfig) {
|
|
1355
|
-
warnLog('vxe.error.notProp', ['clip-config']);
|
|
1356
|
-
}
|
|
1357
|
-
if (this.fnrConfig) {
|
|
1358
|
-
warnLog('vxe.error.notProp', ['fnr-config']);
|
|
1359
|
-
}
|
|
1360
|
-
if (this.mouseOpts.area) {
|
|
1361
|
-
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
1362
|
-
return;
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
if (this.dragConfig) {
|
|
1366
|
-
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
|
|
1367
|
-
}
|
|
1368
|
-
if (this.treeConfig && treeOpts.children) {
|
|
1369
|
-
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
|
|
1370
|
-
}
|
|
1371
|
-
if (this.treeConfig && treeOpts.line) {
|
|
1372
|
-
warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine']);
|
|
1373
|
-
}
|
|
1374
|
-
if (this.mouseOpts.area && this.mouseOpts.selected) {
|
|
1375
|
-
warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
|
|
1376
|
-
}
|
|
1377
|
-
// if (this.mouseOpts.area && this.checkboxOpts.range) {
|
|
1378
|
-
// warnLog('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range'])
|
|
1379
|
-
// }
|
|
1380
|
-
if (this.mouseOpts.area && (this.treeConfig && !treeOpts.transform)) {
|
|
1381
|
-
errLog('vxe.error.noTree', ['mouse-config.area']);
|
|
1382
|
-
}
|
|
1303
|
+
if (this.rowKey) {
|
|
1304
|
+
warnLog('vxe.error.delProp', ['row-key', 'row-config.useKey']);
|
|
1383
1305
|
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1306
|
+
if (this.columnKey) {
|
|
1307
|
+
warnLog('vxe.error.delProp', ['column-id', 'column-config.useKey']);
|
|
1308
|
+
}
|
|
1309
|
+
if (!(this.rowId || rowOpts.keyField) && (checkboxOpts.reserve || checkboxOpts.checkRowKeys || radioOpts.reserve || radioOpts.checkRowKey || expandOpts.expandRowKeys || this.treeOpts.expandRowKeys)) {
|
|
1310
|
+
warnLog('vxe.error.reqProp', ['row-config.keyField']);
|
|
1311
|
+
}
|
|
1312
|
+
if (this.editConfig && editOpts.showStatus && !this.keepSource) {
|
|
1313
|
+
warnLog('vxe.error.reqProp', ['keep-source']);
|
|
1314
|
+
}
|
|
1315
|
+
if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
1316
|
+
warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
|
|
1317
|
+
}
|
|
1318
|
+
if (treeConfig && !treeOpts.transform && this.stripe) {
|
|
1319
|
+
warnLog('vxe.error.noTree', ['stripe']);
|
|
1320
|
+
}
|
|
1321
|
+
if (this.showFooter && !(this.footerMethod || this.footerData)) {
|
|
1322
|
+
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
1323
|
+
}
|
|
1324
|
+
if (rowOpts.height) {
|
|
1325
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
1326
|
+
}
|
|
1327
|
+
if (this.tooltipOpts.enabled) {
|
|
1328
|
+
warnLog('vxe.error.delProp', ['tooltip-config.enabled', 'tooltip-config.showAll']);
|
|
1329
|
+
}
|
|
1330
|
+
if (this.highlightCurrentRow) {
|
|
1331
|
+
warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent']);
|
|
1332
|
+
}
|
|
1333
|
+
if (this.highlightHoverRow) {
|
|
1334
|
+
warnLog('vxe.error.delProp', ['highlight-hover-row', 'row-config.isHover']);
|
|
1335
|
+
}
|
|
1336
|
+
if (this.highlightCurrentColumn) {
|
|
1337
|
+
warnLog('vxe.error.delProp', ['highlight-current-column', 'column-config.isCurrent']);
|
|
1338
|
+
}
|
|
1339
|
+
if (this.highlightHoverColumn) {
|
|
1340
|
+
warnLog('vxe.error.delProp', ['highlight-hover-column', 'column-config.isHover']);
|
|
1341
|
+
}
|
|
1342
|
+
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
1343
|
+
if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
|
|
1344
|
+
warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')]);
|
|
1345
|
+
}
|
|
1346
|
+
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
1347
|
+
warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')]);
|
|
1348
|
+
}
|
|
1349
|
+
if (!this.id) {
|
|
1350
|
+
if ((this.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
1351
|
+
errLog('vxe.error.reqProp', ['id']);
|
|
1410
1352
|
}
|
|
1411
|
-
|
|
1412
|
-
|
|
1353
|
+
}
|
|
1354
|
+
if (this.treeConfig && this.checkboxOpts.range) {
|
|
1355
|
+
errLog('vxe.error.noTree', ['checkbox-config.range']);
|
|
1356
|
+
}
|
|
1357
|
+
if (this.rowOpts.height && !this.showOverflow) {
|
|
1358
|
+
warnLog('vxe.error.notProp', ['table.show-overflow']);
|
|
1359
|
+
}
|
|
1360
|
+
if (!this.handleMousedownCellAreaEvent) {
|
|
1361
|
+
if (this.areaConfig) {
|
|
1362
|
+
warnLog('vxe.error.notProp', ['area-config']);
|
|
1413
1363
|
}
|
|
1414
|
-
if (this.
|
|
1415
|
-
warnLog('vxe.error.
|
|
1364
|
+
if (this.clipConfig) {
|
|
1365
|
+
warnLog('vxe.error.notProp', ['clip-config']);
|
|
1416
1366
|
}
|
|
1417
|
-
if (this.
|
|
1418
|
-
warnLog('vxe.error.
|
|
1367
|
+
if (this.fnrConfig) {
|
|
1368
|
+
warnLog('vxe.error.notProp', ['fnr-config']);
|
|
1419
1369
|
}
|
|
1420
|
-
if (
|
|
1421
|
-
errLog('vxe.error.
|
|
1370
|
+
if (mouseOpts.area) {
|
|
1371
|
+
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
1372
|
+
return;
|
|
1422
1373
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1374
|
+
}
|
|
1375
|
+
if (treeConfig && rowOpts.drag && !treeOpts.transform) {
|
|
1376
|
+
warnLog('vxe.error.notSupportProp', ['column-config.drag', 'tree-config.transform=false', 'tree-config.transform=true']);
|
|
1377
|
+
}
|
|
1378
|
+
if (this.dragConfig) {
|
|
1379
|
+
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
|
|
1380
|
+
}
|
|
1381
|
+
if (this.treeConfig && treeOpts.children) {
|
|
1382
|
+
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
|
|
1383
|
+
}
|
|
1384
|
+
if (this.treeConfig && treeOpts.line) {
|
|
1385
|
+
warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine']);
|
|
1386
|
+
}
|
|
1387
|
+
if (mouseOpts.area && mouseOpts.selected) {
|
|
1388
|
+
warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
|
|
1389
|
+
}
|
|
1390
|
+
if (mouseOpts.area && (this.treeConfig && !treeOpts.transform)) {
|
|
1391
|
+
errLog('vxe.error.noTree', ['mouse-config.area']);
|
|
1392
|
+
}
|
|
1393
|
+
// 在 v3.0 中废弃 context-menu
|
|
1394
|
+
if (this.contextMenu) {
|
|
1395
|
+
warnLog('vxe.error.delProp', ['context-menu', 'menu-config']);
|
|
1396
|
+
if (!XEUtils.isObject(this.contextMenu)) {
|
|
1397
|
+
warnLog('vxe.error.errProp', [`table.context-menu=${this.contextMenu}`, 'table.context-menu={}']);
|
|
1425
1398
|
}
|
|
1426
1399
|
}
|
|
1400
|
+
if (this.menuConfig && !XEUtils.isObject(this.menuConfig)) {
|
|
1401
|
+
warnLog('vxe.error.errProp', [`table.menu-config=${this.menuConfig}`, 'table.menu-config={}']);
|
|
1402
|
+
}
|
|
1403
|
+
if (this.exportConfig && !XEUtils.isObject(this.exportConfig)) {
|
|
1404
|
+
warnLog('vxe.error.errProp', [`table.export-config=${this.exportConfig}`, 'table.export-config={}']);
|
|
1405
|
+
}
|
|
1406
|
+
if (this.importConfig && !XEUtils.isObject(this.importConfig)) {
|
|
1407
|
+
warnLog('vxe.error.errProp', [`table.import-config=${this.importConfig}`, 'table.import-config={}']);
|
|
1408
|
+
}
|
|
1409
|
+
if (this.printConfig && !XEUtils.isObject(this.printConfig)) {
|
|
1410
|
+
warnLog('vxe.error.errProp', [`table.print-config=${this.printConfig}`, 'table.print-config={}']);
|
|
1411
|
+
}
|
|
1412
|
+
if (this.treeConfig && !XEUtils.isObject(this.treeConfig)) {
|
|
1413
|
+
warnLog('vxe.error.errProp', [`table.tree-config=${this.treeConfig}`, 'table.tree-config={}']);
|
|
1414
|
+
}
|
|
1415
|
+
if (this.customConfig && !XEUtils.isObject(this.customConfig)) {
|
|
1416
|
+
warnLog('vxe.error.errProp', [`table.custom-config=${this.customConfig}`, 'table.custom-config={}']);
|
|
1417
|
+
}
|
|
1418
|
+
if (this.editConfig && !XEUtils.isObject(this.editConfig)) {
|
|
1419
|
+
warnLog('vxe.error.errProp', [`table.edit-config=${this.editConfig}`, 'table.edit-config={}']);
|
|
1420
|
+
}
|
|
1421
|
+
if (this.emptyRender && !XEUtils.isObject(this.emptyRender)) {
|
|
1422
|
+
warnLog('vxe.error.errProp', [`table.empty-render=${this.emptyRender}`, 'table.empty-render={}']);
|
|
1423
|
+
}
|
|
1424
|
+
if (this.editConfig && this.editOpts.activeMethod) {
|
|
1425
|
+
warnLog('vxe.error.delProp', ['table.edit-config.activeMethod', 'table.edit-config.beforeEditMethod']);
|
|
1426
|
+
}
|
|
1427
|
+
if (this.treeConfig && this.checkboxOpts.isShiftKey) {
|
|
1428
|
+
errLog('vxe.error.errConflicts', ['tree-config', 'checkbox-config.isShiftKey']);
|
|
1429
|
+
}
|
|
1430
|
+
if (this.checkboxOpts.halfField) {
|
|
1431
|
+
warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
|
|
1432
|
+
}
|
|
1427
1433
|
// 检查是否有安装需要的模块
|
|
1428
|
-
if (
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
errLog('vxe.error.reqModule', ['Export']);
|
|
1440
|
-
}
|
|
1434
|
+
if (this.editConfig && !this._insert) {
|
|
1435
|
+
errLog('vxe.error.reqModule', ['Edit']);
|
|
1436
|
+
}
|
|
1437
|
+
if (this.editRules && !this._validate) {
|
|
1438
|
+
errLog('vxe.error.reqModule', ['Validator']);
|
|
1439
|
+
}
|
|
1440
|
+
if ((this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig) && !this.handleCellMousedownEvent) {
|
|
1441
|
+
errLog('vxe.error.reqModule', ['Keyboard']);
|
|
1442
|
+
}
|
|
1443
|
+
if ((this.printConfig || this.importConfig || this.exportConfig) && !this._exportData) {
|
|
1444
|
+
errLog('vxe.error.reqModule', ['Export']);
|
|
1441
1445
|
}
|
|
1442
1446
|
Object.assign(scrollYStore, {
|
|
1443
1447
|
startIndex: 0,
|
|
@@ -4,7 +4,7 @@ import { VxeUI } from '../../ui';
|
|
|
4
4
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
5
5
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
6
6
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, globalMixins, renderEmptyElement } = VxeUI;
|
|
7
|
-
export default
|
|
7
|
+
export default {
|
|
8
8
|
name: 'VxeToolbar',
|
|
9
9
|
mixins: [
|
|
10
10
|
globalMixins.sizeMixin
|
|
@@ -704,4 +704,4 @@ export default defineVxeComponent({
|
|
|
704
704
|
render(h) {
|
|
705
705
|
return this.renderVN(h);
|
|
706
706
|
}
|
|
707
|
-
}
|
|
707
|
+
};
|