vxe-table 4.9.20 → 4.9.22
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/grid/src/grid.js +1 -1
- package/es/{iconfont.1733815980030.ttf → iconfont.1733885894979.ttf} +0 -0
- package/es/iconfont.1733885894979.woff +0 -0
- package/es/iconfont.1733885894979.woff2 +0 -0
- 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/filter/hook.js +17 -10
- package/es/table/src/table.js +73 -12
- package/es/table/style.css +15 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +15 -2
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/{iconfont.1733815980030.ttf → iconfont.1733885894979.ttf} +0 -0
- package/lib/iconfont.1733885894979.woff +0 -0
- package/lib/iconfont.1733885894979.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +118 -32
- 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/filter/hook.js +20 -12
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/src/table.js +94 -17
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +15 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -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/lib/vxe-table/style/style.css +15 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/table/module/filter/hook.ts +19 -12
- package/packages/table/src/table.ts +73 -12
- package/packages/ui/index.ts +1 -0
- package/styles/components/icon.scss +5 -1
- package/styles/components/table.scss +12 -1
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/es/iconfont.1733815980030.woff +0 -0
- package/es/iconfont.1733815980030.woff2 +0 -0
- package/lib/iconfont.1733815980030.woff +0 -0
- package/lib/iconfont.1733815980030.woff2 +0 -0
package/lib/table/src/table.js
CHANGED
|
@@ -5180,6 +5180,57 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
5180
5180
|
}
|
|
5181
5181
|
return (0, _vue.nextTick)();
|
|
5182
5182
|
},
|
|
5183
|
+
setSort(sortConfs, isUpdate) {
|
|
5184
|
+
const sortOpts = computeSortOpts.value;
|
|
5185
|
+
const {
|
|
5186
|
+
multiple,
|
|
5187
|
+
remote,
|
|
5188
|
+
orders
|
|
5189
|
+
} = sortOpts;
|
|
5190
|
+
if (!_xeUtils.default.isArray(sortConfs)) {
|
|
5191
|
+
sortConfs = [sortConfs];
|
|
5192
|
+
}
|
|
5193
|
+
if (sortConfs && sortConfs.length) {
|
|
5194
|
+
if (!multiple) {
|
|
5195
|
+
sortConfs = [sortConfs[0]];
|
|
5196
|
+
clearAllSort();
|
|
5197
|
+
}
|
|
5198
|
+
let firstColumn = null;
|
|
5199
|
+
sortConfs.forEach((confs, index) => {
|
|
5200
|
+
let {
|
|
5201
|
+
field,
|
|
5202
|
+
order
|
|
5203
|
+
} = confs;
|
|
5204
|
+
let column = field;
|
|
5205
|
+
if (_xeUtils.default.isString(field)) {
|
|
5206
|
+
column = tableMethods.getColumnByField(field);
|
|
5207
|
+
}
|
|
5208
|
+
if (!firstColumn) {
|
|
5209
|
+
firstColumn = column;
|
|
5210
|
+
}
|
|
5211
|
+
if (column && column.sortable) {
|
|
5212
|
+
if (orders.indexOf(order) === -1) {
|
|
5213
|
+
order = getNextSortOrder(column);
|
|
5214
|
+
}
|
|
5215
|
+
if (column.order !== order) {
|
|
5216
|
+
column.order = order;
|
|
5217
|
+
}
|
|
5218
|
+
column.sortTime = Date.now() + index;
|
|
5219
|
+
}
|
|
5220
|
+
});
|
|
5221
|
+
if (isUpdate) {
|
|
5222
|
+
if (!remote) {
|
|
5223
|
+
tablePrivateMethods.handleTableData(true);
|
|
5224
|
+
}
|
|
5225
|
+
$xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
|
|
5226
|
+
}
|
|
5227
|
+
return (0, _vue.nextTick)().then(() => {
|
|
5228
|
+
tableMethods.updateCellAreas();
|
|
5229
|
+
return updateStyle();
|
|
5230
|
+
});
|
|
5231
|
+
}
|
|
5232
|
+
return (0, _vue.nextTick)();
|
|
5233
|
+
},
|
|
5183
5234
|
/**
|
|
5184
5235
|
* 清空指定列的排序条件
|
|
5185
5236
|
* 如果为空则清空所有列的排序条件
|
|
@@ -6822,6 +6873,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
6822
6873
|
scrollbarWidth,
|
|
6823
6874
|
scrollbarHeight
|
|
6824
6875
|
} = reactData;
|
|
6876
|
+
const {
|
|
6877
|
+
prevDragToChild
|
|
6878
|
+
} = internalData;
|
|
6825
6879
|
const wrapperRect = el.getBoundingClientRect();
|
|
6826
6880
|
if (trEl) {
|
|
6827
6881
|
const rdLineEl = refDragRowLineElem.value;
|
|
@@ -6833,6 +6887,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
6833
6887
|
rdLineEl.style.height = `${trRect.height}px`;
|
|
6834
6888
|
rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
|
|
6835
6889
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
6890
|
+
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
6836
6891
|
} else {
|
|
6837
6892
|
rdLineEl.style.display = '';
|
|
6838
6893
|
}
|
|
@@ -6857,7 +6912,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
6857
6912
|
rdTipEl.style.display = 'block';
|
|
6858
6913
|
rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
|
|
6859
6914
|
rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
|
|
6860
|
-
rdTipEl.setAttribute('drag-status', showLine ? 'normal' : 'disabled');
|
|
6915
|
+
rdTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
|
|
6861
6916
|
}
|
|
6862
6917
|
};
|
|
6863
6918
|
const hideDropTip = () => {
|
|
@@ -8163,28 +8218,16 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8163
8218
|
}, evnt);
|
|
8164
8219
|
}
|
|
8165
8220
|
},
|
|
8166
|
-
|
|
8167
|
-
* 点击排序事件
|
|
8168
|
-
*/
|
|
8169
|
-
triggerSortEvent(evnt, column, order) {
|
|
8221
|
+
handleColumnSortEvent(evnt, column) {
|
|
8170
8222
|
const {
|
|
8171
8223
|
mouseConfig
|
|
8172
8224
|
} = props;
|
|
8173
|
-
const sortOpts = computeSortOpts.value;
|
|
8174
8225
|
const mouseOpts = computeMouseOpts.value;
|
|
8175
8226
|
const {
|
|
8176
8227
|
field,
|
|
8177
8228
|
sortable
|
|
8178
8229
|
} = column;
|
|
8179
8230
|
if (sortable) {
|
|
8180
|
-
if (!order || column.order === order) {
|
|
8181
|
-
tableMethods.clearSort(sortOpts.multiple ? column : null);
|
|
8182
|
-
} else {
|
|
8183
|
-
tableMethods.sort({
|
|
8184
|
-
field,
|
|
8185
|
-
order
|
|
8186
|
-
});
|
|
8187
|
-
}
|
|
8188
8231
|
const params = {
|
|
8189
8232
|
$table: $xeTable,
|
|
8190
8233
|
$event: evnt,
|
|
@@ -8201,6 +8244,27 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8201
8244
|
dispatchEvent('sort-change', params, evnt);
|
|
8202
8245
|
}
|
|
8203
8246
|
},
|
|
8247
|
+
/**
|
|
8248
|
+
* 点击排序事件
|
|
8249
|
+
*/
|
|
8250
|
+
triggerSortEvent(evnt, column, order) {
|
|
8251
|
+
const sortOpts = computeSortOpts.value;
|
|
8252
|
+
const {
|
|
8253
|
+
field,
|
|
8254
|
+
sortable
|
|
8255
|
+
} = column;
|
|
8256
|
+
if (sortable) {
|
|
8257
|
+
if (!order || column.order === order) {
|
|
8258
|
+
tableMethods.clearSort(sortOpts.multiple ? column : null);
|
|
8259
|
+
} else {
|
|
8260
|
+
tableMethods.sort({
|
|
8261
|
+
field,
|
|
8262
|
+
order
|
|
8263
|
+
});
|
|
8264
|
+
}
|
|
8265
|
+
$xeTable.handleColumnSortEvent(evnt, column);
|
|
8266
|
+
}
|
|
8267
|
+
},
|
|
8204
8268
|
/**
|
|
8205
8269
|
* 行拖拽
|
|
8206
8270
|
*/
|
|
@@ -8217,7 +8281,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8217
8281
|
} = props;
|
|
8218
8282
|
const rowDragOpts = computeRowDragOpts.value;
|
|
8219
8283
|
const {
|
|
8220
|
-
fullAllDataRowIdData
|
|
8284
|
+
fullAllDataRowIdData,
|
|
8285
|
+
prevDragToChild
|
|
8221
8286
|
} = internalData;
|
|
8222
8287
|
const {
|
|
8223
8288
|
isCrossDrag,
|
|
@@ -8227,6 +8292,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8227
8292
|
const treeOpts = computeTreeOpts.value;
|
|
8228
8293
|
const {
|
|
8229
8294
|
transform,
|
|
8295
|
+
rowField,
|
|
8230
8296
|
mapChildrenField,
|
|
8231
8297
|
parentField
|
|
8232
8298
|
} = treeOpts;
|
|
@@ -8242,6 +8308,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8242
8308
|
} = internalData;
|
|
8243
8309
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
8244
8310
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
8311
|
+
console.log(evnt.ctrlKey);
|
|
8245
8312
|
if (prevDragRow && dragRow) {
|
|
8246
8313
|
// 判断是否有拖动
|
|
8247
8314
|
if (prevDragRow !== dragRow) {
|
|
@@ -8336,7 +8403,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8336
8403
|
childRow[parentField] = dragRow[parentField];
|
|
8337
8404
|
});
|
|
8338
8405
|
}
|
|
8339
|
-
dragRow[parentField] = prevDragRow[parentField];
|
|
8406
|
+
dragRow[parentField] = prevDragToChild ? prevDragRow[rowField] : prevDragRow[parentField];
|
|
8340
8407
|
internalData.tableFullTreeData = _xeUtils.default.toArrayTree(fullList, {
|
|
8341
8408
|
key: treeOpts.rowField,
|
|
8342
8409
|
parentKey: treeOpts.parentField,
|
|
@@ -8405,14 +8472,20 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8405
8472
|
const {
|
|
8406
8473
|
dragRow
|
|
8407
8474
|
} = reactData;
|
|
8475
|
+
const treeOpts = computeTreeOpts.value;
|
|
8476
|
+
const {
|
|
8477
|
+
transform
|
|
8478
|
+
} = treeOpts;
|
|
8408
8479
|
const rowDragOpts = computeRowDragOpts.value;
|
|
8409
8480
|
const {
|
|
8410
|
-
isCrossDrag
|
|
8481
|
+
isCrossDrag,
|
|
8482
|
+
isToChildDrag
|
|
8411
8483
|
} = rowDragOpts;
|
|
8412
8484
|
if (!dragRow) {
|
|
8413
8485
|
evnt.preventDefault();
|
|
8414
8486
|
return;
|
|
8415
8487
|
}
|
|
8488
|
+
const hasCtrlKey = evnt.ctrlKey;
|
|
8416
8489
|
const trEl = evnt.currentTarget;
|
|
8417
8490
|
const rowid = trEl.getAttribute('rowid') || '';
|
|
8418
8491
|
const rest = fullAllDataRowIdData[rowid];
|
|
@@ -8428,6 +8501,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8428
8501
|
showDropTip(evnt, trEl, null, false, dragPos);
|
|
8429
8502
|
return;
|
|
8430
8503
|
}
|
|
8504
|
+
internalData.prevDragToChild = !!(treeConfig && transform && isToChildDrag && hasCtrlKey);
|
|
8431
8505
|
internalData.prevDragRow = row;
|
|
8432
8506
|
internalData.prevDragPos = dragPos;
|
|
8433
8507
|
showDropTip(evnt, trEl, null, true, dragPos);
|
|
@@ -8592,6 +8666,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8592
8666
|
showDropTip(evnt, null, thEl, false, dragPos);
|
|
8593
8667
|
return;
|
|
8594
8668
|
}
|
|
8669
|
+
internalData.prevDragToChild = false;
|
|
8595
8670
|
internalData.prevDragCol = column;
|
|
8596
8671
|
internalData.prevDragPos = dragPos;
|
|
8597
8672
|
showDropTip(evnt, null, thEl, true, dragPos);
|
|
@@ -9137,6 +9212,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9137
9212
|
class: 'vxe-table--drag-sort-tip-status'
|
|
9138
9213
|
}, [(0, _vue.h)('span', {
|
|
9139
9214
|
class: ['vxe-table--drag-sort-tip-normal-status', dragRow ? getIcon().TABLE_DRAG_STATUS_ROW : getIcon().TABLE_DRAG_STATUS_COLUMN]
|
|
9215
|
+
}), (0, _vue.h)('span', {
|
|
9216
|
+
class: ['vxe-table--drag-sort-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
|
|
9140
9217
|
}), (0, _vue.h)('span', {
|
|
9141
9218
|
class: ['vxe-table--drag-sort-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
|
|
9142
9219
|
})]), (0, _vue.h)('div', {
|