vxe-table 4.12.1 → 4.12.3
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/hook.js +3 -2
- package/es/table/module/keyboard/hook.js +3 -2
- package/es/table/module/menu/hook.js +1 -1
- package/es/table/src/table.js +54 -30
- 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 +56 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +2 -1
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -1
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/module/menu/hook.js +1 -1
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/src/table.js +49 -25
- 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/hook.ts +4 -2
- package/packages/table/module/keyboard/hook.ts +4 -2
- package/packages/table/module/menu/hook.ts +1 -1
- package/packages/table/src/table.ts +56 -30
- package/packages/ui/src/dom.ts +0 -2
- /package/es/{iconfont.1743045589885.ttf → iconfont.1743389164894.ttf} +0 -0
- /package/es/{iconfont.1743045589885.woff → iconfont.1743389164894.woff} +0 -0
- /package/es/{iconfont.1743045589885.woff2 → iconfont.1743389164894.woff2} +0 -0
- /package/lib/{iconfont.1743045589885.ttf → iconfont.1743389164894.ttf} +0 -0
- /package/lib/{iconfont.1743045589885.woff → iconfont.1743389164894.woff} +0 -0
- /package/lib/{iconfont.1743045589885.woff2 → iconfont.1743389164894.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, reactive, ref, provide, inject, nextTick, onActivated, onDeactivated, onBeforeUnmount, onUnmounted, watch, computed, onMounted } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, getOffsetPos, setScrollTop, setScrollLeft, toCssUnit } from '../../ui/src/dom';
|
|
4
4
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
5
5
|
import { VxeUI } from '../../ui';
|
|
6
6
|
import Cell from './cell';
|
|
@@ -29,6 +29,7 @@ export default defineComponent({
|
|
|
29
29
|
setup(props, context) {
|
|
30
30
|
const { slots, emit } = context;
|
|
31
31
|
const xID = XEUtils.uniqueId();
|
|
32
|
+
const browseObj = XEUtils.browse();
|
|
32
33
|
// 使用已安装的组件,如果未安装则不渲染
|
|
33
34
|
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
|
|
34
35
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
@@ -1833,11 +1834,11 @@ export default defineComponent({
|
|
|
1833
1834
|
}
|
|
1834
1835
|
if (xLeftCornerEl) {
|
|
1835
1836
|
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
1836
|
-
xLeftCornerEl.style.display = scrollbarXToTop ? (
|
|
1837
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? (overflowX && osbHeight ? 'block' : '') : '';
|
|
1837
1838
|
}
|
|
1838
1839
|
if (xRightCornerEl) {
|
|
1839
1840
|
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
1840
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' : (
|
|
1841
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : (overflowX && osbHeight ? 'block' : '');
|
|
1841
1842
|
}
|
|
1842
1843
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
1843
1844
|
if (scrollYVirtualEl) {
|
|
@@ -1848,7 +1849,7 @@ export default defineComponent({
|
|
|
1848
1849
|
const yTopCornerEl = refScrollYTopCornerElem.value;
|
|
1849
1850
|
if (yTopCornerEl) {
|
|
1850
1851
|
yTopCornerEl.style.height = `${headerHeight}px`;
|
|
1851
|
-
yTopCornerEl.style.display = headerHeight ? 'block' : '';
|
|
1852
|
+
yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : '';
|
|
1852
1853
|
}
|
|
1853
1854
|
const yWrapperEl = refScrollYWrapperElem.value;
|
|
1854
1855
|
if (yWrapperEl) {
|
|
@@ -1859,7 +1860,7 @@ export default defineComponent({
|
|
|
1859
1860
|
if (yBottomCornerEl) {
|
|
1860
1861
|
yBottomCornerEl.style.height = `${footerHeight}px`;
|
|
1861
1862
|
yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
|
|
1862
|
-
yBottomCornerEl.style.display = footerHeight ? 'block' : '';
|
|
1863
|
+
yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : '';
|
|
1863
1864
|
}
|
|
1864
1865
|
const rowExpandEl = refRowExpandElem.value;
|
|
1865
1866
|
if (rowExpandEl) {
|
|
@@ -1980,7 +1981,7 @@ export default defineComponent({
|
|
|
1980
1981
|
if (tableElem) {
|
|
1981
1982
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
1982
1983
|
// 兼容性处理
|
|
1983
|
-
tableElem.style.paddingRight = osbWidth && fixedType && (
|
|
1984
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browseObj['-moz'] || browseObj.safari) ? `${osbWidth}px` : '';
|
|
1984
1985
|
}
|
|
1985
1986
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
1986
1987
|
if (emptyBlockElem) {
|
|
@@ -6094,8 +6095,8 @@ export default defineComponent({
|
|
|
6094
6095
|
const handleGlobalKeydownEvent = (evnt) => {
|
|
6095
6096
|
// 该行为只对当前激活的表格有效
|
|
6096
6097
|
if (internalData.isActivated) {
|
|
6097
|
-
|
|
6098
|
-
const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow } = props;
|
|
6098
|
+
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
6099
|
+
const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props;
|
|
6099
6100
|
const { ctxMenuStore, editStore, currentRow } = reactData;
|
|
6100
6101
|
const { afterFullData } = internalData;
|
|
6101
6102
|
const isMenu = computeIsMenu.value;
|
|
@@ -6106,6 +6107,7 @@ export default defineComponent({
|
|
|
6106
6107
|
const treeOpts = computeTreeOpts.value;
|
|
6107
6108
|
const menuList = computeMenuList.value;
|
|
6108
6109
|
const rowOpts = computeRowOpts.value;
|
|
6110
|
+
const columnOpts = computeColumnOpts.value;
|
|
6109
6111
|
const { selected, actived } = editStore;
|
|
6110
6112
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6111
6113
|
const keyCode = evnt.keyCode;
|
|
@@ -6147,7 +6149,7 @@ export default defineComponent({
|
|
|
6147
6149
|
if ($xeTable.closeMenu) {
|
|
6148
6150
|
$xeTable.closeMenu();
|
|
6149
6151
|
}
|
|
6150
|
-
|
|
6152
|
+
$xeTable.closeFilter();
|
|
6151
6153
|
if (keyboardConfig && keyboardOpts.isEsc) {
|
|
6152
6154
|
// 如果是激活编辑状态,则取消编辑
|
|
6153
6155
|
if (actived.row) {
|
|
@@ -6263,12 +6265,12 @@ export default defineComponent({
|
|
|
6263
6265
|
const params = {
|
|
6264
6266
|
$table: $xeTable,
|
|
6265
6267
|
row: targetRow,
|
|
6266
|
-
rowIndex:
|
|
6267
|
-
$rowIndex:
|
|
6268
|
+
rowIndex: $xeTable.getRowIndex(targetRow),
|
|
6269
|
+
$rowIndex: $xeTable.getVMRowIndex(targetRow)
|
|
6268
6270
|
};
|
|
6269
|
-
|
|
6270
|
-
.then(() =>
|
|
6271
|
-
.then(() =>
|
|
6271
|
+
$xeTable.setTreeExpand(currentRow, true)
|
|
6272
|
+
.then(() => $xeTable.scrollToRow(targetRow))
|
|
6273
|
+
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
6272
6274
|
}
|
|
6273
6275
|
}
|
|
6274
6276
|
}
|
|
@@ -6276,9 +6278,19 @@ export default defineComponent({
|
|
|
6276
6278
|
else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
|
|
6277
6279
|
if (!isEditStatus) {
|
|
6278
6280
|
// 如果按下了方向键
|
|
6279
|
-
if (selected.row && selected.column) {
|
|
6281
|
+
if (mouseOpts.selected && selected.row && selected.column) {
|
|
6280
6282
|
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
6281
6283
|
}
|
|
6284
|
+
else {
|
|
6285
|
+
// 当前行按键上下移动
|
|
6286
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
6287
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
6288
|
+
}
|
|
6289
|
+
// 当前行按键左右移动
|
|
6290
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
6291
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
6292
|
+
}
|
|
6293
|
+
}
|
|
6282
6294
|
}
|
|
6283
6295
|
}
|
|
6284
6296
|
else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
@@ -6323,9 +6335,9 @@ export default defineComponent({
|
|
|
6323
6335
|
if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
6324
6336
|
const params = {
|
|
6325
6337
|
row: selected.row,
|
|
6326
|
-
rowIndex:
|
|
6338
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
6327
6339
|
column: selected.column,
|
|
6328
|
-
columnIndex:
|
|
6340
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6329
6341
|
$table: $xeTable,
|
|
6330
6342
|
$grid: $xeGrid
|
|
6331
6343
|
};
|
|
@@ -6350,14 +6362,14 @@ export default defineComponent({
|
|
|
6350
6362
|
evnt.preventDefault();
|
|
6351
6363
|
const params = {
|
|
6352
6364
|
row: parentRow,
|
|
6353
|
-
rowIndex:
|
|
6354
|
-
$rowIndex:
|
|
6365
|
+
rowIndex: $xeTable.getRowIndex(parentRow),
|
|
6366
|
+
$rowIndex: $xeTable.getVMRowIndex(parentRow),
|
|
6355
6367
|
$table: $xeTable,
|
|
6356
6368
|
$grid: $xeGrid
|
|
6357
6369
|
};
|
|
6358
|
-
|
|
6359
|
-
.then(() =>
|
|
6360
|
-
.then(() =>
|
|
6370
|
+
$xeTable.setTreeExpand(parentRow, false)
|
|
6371
|
+
.then(() => $xeTable.scrollToRow(parentRow))
|
|
6372
|
+
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
6361
6373
|
}
|
|
6362
6374
|
}
|
|
6363
6375
|
else if (keyboardConfig && isEnableConf(editConfig) && keyboardOpts.isEdit && !hasCtrlKey && !hasMetaKey && (isSpacebar || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
|
|
@@ -6371,9 +6383,9 @@ export default defineComponent({
|
|
|
6371
6383
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
6372
6384
|
const params = {
|
|
6373
6385
|
row: selected.row,
|
|
6374
|
-
rowIndex:
|
|
6386
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
6375
6387
|
column: selected.column,
|
|
6376
|
-
columnIndex:
|
|
6388
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6377
6389
|
$table: $xeTable,
|
|
6378
6390
|
$grid: $xeGrid
|
|
6379
6391
|
};
|
|
@@ -6656,7 +6668,7 @@ export default defineComponent({
|
|
|
6656
6668
|
* @param {Event} evnt 事件
|
|
6657
6669
|
* @param {Row} row 行对象
|
|
6658
6670
|
*/
|
|
6659
|
-
const handleTooltip = (evnt, tdEl, overflowElem, params) => {
|
|
6671
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
6660
6672
|
const tipOverEl = overflowElem || tdEl;
|
|
6661
6673
|
if (!tipOverEl) {
|
|
6662
6674
|
return nextTick();
|
|
@@ -6669,7 +6681,8 @@ export default defineComponent({
|
|
|
6669
6681
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
6670
6682
|
const useCustom = contentMethod && !XEUtils.eqNull(customContent);
|
|
6671
6683
|
const content = useCustom ? customContent : XEUtils.toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
6672
|
-
|
|
6684
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
6685
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
6673
6686
|
Object.assign(tooltipStore, {
|
|
6674
6687
|
row,
|
|
6675
6688
|
column,
|
|
@@ -6679,7 +6692,7 @@ export default defineComponent({
|
|
|
6679
6692
|
nextTick(() => {
|
|
6680
6693
|
const $tooltip = refTooltip.value;
|
|
6681
6694
|
if ($tooltip && $tooltip.open) {
|
|
6682
|
-
$tooltip.open(tipOverEl, formatText(content));
|
|
6695
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, formatText(content));
|
|
6683
6696
|
}
|
|
6684
6697
|
});
|
|
6685
6698
|
}
|
|
@@ -7646,7 +7659,7 @@ export default defineComponent({
|
|
|
7646
7659
|
return;
|
|
7647
7660
|
}
|
|
7648
7661
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
7649
|
-
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
7662
|
+
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--wrapper'), thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
7650
7663
|
}
|
|
7651
7664
|
},
|
|
7652
7665
|
/**
|
|
@@ -7673,7 +7686,7 @@ export default defineComponent({
|
|
|
7673
7686
|
}
|
|
7674
7687
|
}
|
|
7675
7688
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
7676
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7689
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7677
7690
|
}
|
|
7678
7691
|
},
|
|
7679
7692
|
/**
|
|
@@ -7685,7 +7698,7 @@ export default defineComponent({
|
|
|
7685
7698
|
const tdEl = evnt.currentTarget;
|
|
7686
7699
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
7687
7700
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
7688
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7701
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7689
7702
|
}
|
|
7690
7703
|
},
|
|
7691
7704
|
handleTargetLeaveEvent() {
|
|
@@ -9222,6 +9235,7 @@ export default defineComponent({
|
|
|
9222
9235
|
updateScrollXSpace() {
|
|
9223
9236
|
const { isGroup, scrollXLoad, overflowX, scrollXWidth } = reactData;
|
|
9224
9237
|
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
|
|
9238
|
+
const mouseOpts = computeMouseOpts.value;
|
|
9225
9239
|
const tableBody = refTableBody.value;
|
|
9226
9240
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
9227
9241
|
if (tableBodyElem) {
|
|
@@ -9281,6 +9295,9 @@ export default defineComponent({
|
|
|
9281
9295
|
if (scrollXSpaceEl) {
|
|
9282
9296
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
9283
9297
|
}
|
|
9298
|
+
if (isScrollXBig && mouseOpts.area) {
|
|
9299
|
+
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
9300
|
+
}
|
|
9284
9301
|
nextTick(() => {
|
|
9285
9302
|
updateStyle();
|
|
9286
9303
|
});
|
|
@@ -9291,6 +9308,7 @@ export default defineComponent({
|
|
|
9291
9308
|
const { isAllOverflow, scrollYLoad, expandColumn } = reactData;
|
|
9292
9309
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
|
|
9293
9310
|
const { startIndex } = scrollYStore;
|
|
9311
|
+
const mouseOpts = computeMouseOpts.value;
|
|
9294
9312
|
const expandOpts = computeExpandOpts.value;
|
|
9295
9313
|
const rowOpts = computeRowOpts.value;
|
|
9296
9314
|
const cellOpts = computeCellOpts.value;
|
|
@@ -9374,6 +9392,9 @@ export default defineComponent({
|
|
|
9374
9392
|
reactData.scrollYTop = scrollYTop;
|
|
9375
9393
|
reactData.scrollYHeight = scrollYHeight;
|
|
9376
9394
|
reactData.isScrollYBig = isScrollYBig;
|
|
9395
|
+
if (isScrollYBig && mouseOpts.area) {
|
|
9396
|
+
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
9397
|
+
}
|
|
9377
9398
|
return nextTick().then(() => {
|
|
9378
9399
|
updateStyle();
|
|
9379
9400
|
});
|
|
@@ -10164,6 +10185,9 @@ export default defineComponent({
|
|
|
10164
10185
|
watch(computeScrollbarYToLeft, () => {
|
|
10165
10186
|
reLayoutFlag.value++;
|
|
10166
10187
|
});
|
|
10188
|
+
watch(() => VxeUI.getLanguage(), () => {
|
|
10189
|
+
reLayoutFlag.value++;
|
|
10190
|
+
});
|
|
10167
10191
|
watch(reLayoutFlag, () => {
|
|
10168
10192
|
nextTick(() => tableMethods.recalculate(true));
|
|
10169
10193
|
});
|
package/es/ui/index.js
CHANGED
package/es/ui/src/dom.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.12.
|
|
3141
|
+
const version = "4.12.3";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3587,7 +3587,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3587
3587
|
const {
|
|
3588
3588
|
log: log_log
|
|
3589
3589
|
} = core_.VxeUI;
|
|
3590
|
-
const log_version = `table v${"4.12.
|
|
3590
|
+
const log_version = `table v${"4.12.3"}`;
|
|
3591
3591
|
const warnLog = log_log.create('warn', log_version);
|
|
3592
3592
|
const errLog = log_log.create('error', log_version);
|
|
3593
3593
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -3771,7 +3771,6 @@ class ColumnInfo {
|
|
|
3771
3771
|
;// ./packages/ui/src/dom.ts
|
|
3772
3772
|
|
|
3773
3773
|
const reClsMap = {};
|
|
3774
|
-
const browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
3775
3774
|
let tpImgEl;
|
|
3776
3775
|
function initTpImg() {
|
|
3777
3776
|
if (!tpImgEl) {
|
|
@@ -10495,6 +10494,7 @@ const maxXWidth = 5e6;
|
|
|
10495
10494
|
emit
|
|
10496
10495
|
} = context;
|
|
10497
10496
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
10497
|
+
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
10498
10498
|
// 使用已安装的组件,如果未安装则不渲染
|
|
10499
10499
|
const VxeUILoadingComponent = core_.VxeUI.getComponent('VxeLoading');
|
|
10500
10500
|
const VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
|
|
@@ -12637,11 +12637,11 @@ const maxXWidth = 5e6;
|
|
|
12637
12637
|
}
|
|
12638
12638
|
if (xLeftCornerEl) {
|
|
12639
12639
|
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
12640
|
-
xLeftCornerEl.style.display = scrollbarXToTop ?
|
|
12640
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? overflowX && osbHeight ? 'block' : '' : '';
|
|
12641
12641
|
}
|
|
12642
12642
|
if (xRightCornerEl) {
|
|
12643
12643
|
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
12644
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
12644
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : overflowX && osbHeight ? 'block' : '';
|
|
12645
12645
|
}
|
|
12646
12646
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
12647
12647
|
if (scrollYVirtualEl) {
|
|
@@ -12652,7 +12652,7 @@ const maxXWidth = 5e6;
|
|
|
12652
12652
|
const yTopCornerEl = refScrollYTopCornerElem.value;
|
|
12653
12653
|
if (yTopCornerEl) {
|
|
12654
12654
|
yTopCornerEl.style.height = `${headerHeight}px`;
|
|
12655
|
-
yTopCornerEl.style.display = headerHeight ? 'block' : '';
|
|
12655
|
+
yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : '';
|
|
12656
12656
|
}
|
|
12657
12657
|
const yWrapperEl = refScrollYWrapperElem.value;
|
|
12658
12658
|
if (yWrapperEl) {
|
|
@@ -12663,7 +12663,7 @@ const maxXWidth = 5e6;
|
|
|
12663
12663
|
if (yBottomCornerEl) {
|
|
12664
12664
|
yBottomCornerEl.style.height = `${footerHeight}px`;
|
|
12665
12665
|
yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
|
|
12666
|
-
yBottomCornerEl.style.display = footerHeight ? 'block' : '';
|
|
12666
|
+
yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : '';
|
|
12667
12667
|
}
|
|
12668
12668
|
const rowExpandEl = refRowExpandElem.value;
|
|
12669
12669
|
if (rowExpandEl) {
|
|
@@ -12777,7 +12777,7 @@ const maxXWidth = 5e6;
|
|
|
12777
12777
|
if (tableElem) {
|
|
12778
12778
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
12779
12779
|
// 兼容性处理
|
|
12780
|
-
tableElem.style.paddingRight = osbWidth && fixedType && (
|
|
12780
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browseObj['-moz'] || browseObj.safari) ? `${osbWidth}px` : '';
|
|
12781
12781
|
}
|
|
12782
12782
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
12783
12783
|
if (emptyBlockElem) {
|
|
@@ -17520,13 +17520,14 @@ const maxXWidth = 5e6;
|
|
|
17520
17520
|
const handleGlobalKeydownEvent = evnt => {
|
|
17521
17521
|
// 该行为只对当前激活的表格有效
|
|
17522
17522
|
if (internalData.isActivated) {
|
|
17523
|
-
|
|
17523
|
+
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
17524
17524
|
const {
|
|
17525
17525
|
mouseConfig,
|
|
17526
17526
|
keyboardConfig,
|
|
17527
17527
|
treeConfig,
|
|
17528
17528
|
editConfig,
|
|
17529
|
-
highlightCurrentRow
|
|
17529
|
+
highlightCurrentRow,
|
|
17530
|
+
highlightCurrentColumn
|
|
17530
17531
|
} = props;
|
|
17531
17532
|
const {
|
|
17532
17533
|
ctxMenuStore,
|
|
@@ -17544,6 +17545,7 @@ const maxXWidth = 5e6;
|
|
|
17544
17545
|
const treeOpts = computeTreeOpts.value;
|
|
17545
17546
|
const menuList = computeMenuList.value;
|
|
17546
17547
|
const rowOpts = computeRowOpts.value;
|
|
17548
|
+
const columnOpts = computeColumnOpts.value;
|
|
17547
17549
|
const {
|
|
17548
17550
|
selected,
|
|
17549
17551
|
actived
|
|
@@ -17585,7 +17587,7 @@ const maxXWidth = 5e6;
|
|
|
17585
17587
|
if ($xeTable.closeMenu) {
|
|
17586
17588
|
$xeTable.closeMenu();
|
|
17587
17589
|
}
|
|
17588
|
-
|
|
17590
|
+
$xeTable.closeFilter();
|
|
17589
17591
|
if (keyboardConfig && keyboardOpts.isEsc) {
|
|
17590
17592
|
// 如果是激活编辑状态,则取消编辑
|
|
17591
17593
|
if (actived.row) {
|
|
@@ -17700,18 +17702,27 @@ const maxXWidth = 5e6;
|
|
|
17700
17702
|
const params = {
|
|
17701
17703
|
$table: $xeTable,
|
|
17702
17704
|
row: targetRow,
|
|
17703
|
-
rowIndex:
|
|
17704
|
-
$rowIndex:
|
|
17705
|
+
rowIndex: $xeTable.getRowIndex(targetRow),
|
|
17706
|
+
$rowIndex: $xeTable.getVMRowIndex(targetRow)
|
|
17705
17707
|
};
|
|
17706
|
-
|
|
17708
|
+
$xeTable.setTreeExpand(currentRow, true).then(() => $xeTable.scrollToRow(targetRow)).then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
17707
17709
|
}
|
|
17708
17710
|
}
|
|
17709
17711
|
}
|
|
17710
17712
|
} else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
|
|
17711
17713
|
if (!isEditStatus) {
|
|
17712
17714
|
// 如果按下了方向键
|
|
17713
|
-
if (selected.row && selected.column) {
|
|
17715
|
+
if (mouseOpts.selected && selected.row && selected.column) {
|
|
17714
17716
|
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
17717
|
+
} else {
|
|
17718
|
+
// 当前行按键上下移动
|
|
17719
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
17720
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
17721
|
+
}
|
|
17722
|
+
// 当前行按键左右移动
|
|
17723
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
17724
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
17725
|
+
}
|
|
17715
17726
|
}
|
|
17716
17727
|
}
|
|
17717
17728
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
@@ -17756,9 +17767,9 @@ const maxXWidth = 5e6;
|
|
|
17756
17767
|
if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
17757
17768
|
const params = {
|
|
17758
17769
|
row: selected.row,
|
|
17759
|
-
rowIndex:
|
|
17770
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
17760
17771
|
column: selected.column,
|
|
17761
|
-
columnIndex:
|
|
17772
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
17762
17773
|
$table: $xeTable,
|
|
17763
17774
|
$grid: $xeGrid
|
|
17764
17775
|
};
|
|
@@ -17785,12 +17796,12 @@ const maxXWidth = 5e6;
|
|
|
17785
17796
|
evnt.preventDefault();
|
|
17786
17797
|
const params = {
|
|
17787
17798
|
row: parentRow,
|
|
17788
|
-
rowIndex:
|
|
17789
|
-
$rowIndex:
|
|
17799
|
+
rowIndex: $xeTable.getRowIndex(parentRow),
|
|
17800
|
+
$rowIndex: $xeTable.getVMRowIndex(parentRow),
|
|
17790
17801
|
$table: $xeTable,
|
|
17791
17802
|
$grid: $xeGrid
|
|
17792
17803
|
};
|
|
17793
|
-
|
|
17804
|
+
$xeTable.setTreeExpand(parentRow, false).then(() => $xeTable.scrollToRow(parentRow)).then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
17794
17805
|
}
|
|
17795
17806
|
} else if (keyboardConfig && isEnableConf(editConfig) && keyboardOpts.isEdit && !hasCtrlKey && !hasMetaKey && (isSpacebar || keyCode >= 48 && keyCode <= 57 || keyCode >= 65 && keyCode <= 90 || keyCode >= 96 && keyCode <= 111 || keyCode >= 186 && keyCode <= 192 || keyCode >= 219 && keyCode <= 222)) {
|
|
17796
17807
|
const {
|
|
@@ -17806,9 +17817,9 @@ const maxXWidth = 5e6;
|
|
|
17806
17817
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
17807
17818
|
const params = {
|
|
17808
17819
|
row: selected.row,
|
|
17809
|
-
rowIndex:
|
|
17820
|
+
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
17810
17821
|
column: selected.column,
|
|
17811
|
-
columnIndex:
|
|
17822
|
+
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
17812
17823
|
$table: $xeTable,
|
|
17813
17824
|
$grid: $xeGrid
|
|
17814
17825
|
};
|
|
@@ -18137,7 +18148,7 @@ const maxXWidth = 5e6;
|
|
|
18137
18148
|
* @param {Event} evnt 事件
|
|
18138
18149
|
* @param {Row} row 行对象
|
|
18139
18150
|
*/
|
|
18140
|
-
const handleTooltip = (evnt, tdEl, overflowElem, params) => {
|
|
18151
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
18141
18152
|
const tipOverEl = overflowElem || tdEl;
|
|
18142
18153
|
if (!tipOverEl) {
|
|
18143
18154
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -18158,7 +18169,8 @@ const maxXWidth = 5e6;
|
|
|
18158
18169
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
18159
18170
|
const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
|
|
18160
18171
|
const content = useCustom ? customContent : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
18161
|
-
|
|
18172
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
18173
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
18162
18174
|
Object.assign(tooltipStore, {
|
|
18163
18175
|
row,
|
|
18164
18176
|
column,
|
|
@@ -18168,7 +18180,7 @@ const maxXWidth = 5e6;
|
|
|
18168
18180
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
18169
18181
|
const $tooltip = refTooltip.value;
|
|
18170
18182
|
if ($tooltip && $tooltip.open) {
|
|
18171
|
-
$tooltip.open(tipOverEl, formatText(content));
|
|
18183
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, formatText(content));
|
|
18172
18184
|
}
|
|
18173
18185
|
});
|
|
18174
18186
|
}
|
|
@@ -19300,7 +19312,7 @@ const maxXWidth = 5e6;
|
|
|
19300
19312
|
return;
|
|
19301
19313
|
}
|
|
19302
19314
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
19303
|
-
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
19315
|
+
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--wrapper'), thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
19304
19316
|
}
|
|
19305
19317
|
},
|
|
19306
19318
|
/**
|
|
@@ -19338,7 +19350,7 @@ const maxXWidth = 5e6;
|
|
|
19338
19350
|
}
|
|
19339
19351
|
}
|
|
19340
19352
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
19341
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19353
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19342
19354
|
}
|
|
19343
19355
|
},
|
|
19344
19356
|
/**
|
|
@@ -19354,7 +19366,7 @@ const maxXWidth = 5e6;
|
|
|
19354
19366
|
const tdEl = evnt.currentTarget;
|
|
19355
19367
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
19356
19368
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
19357
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19369
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19358
19370
|
}
|
|
19359
19371
|
},
|
|
19360
19372
|
handleTargetLeaveEvent() {
|
|
@@ -21213,6 +21225,7 @@ const maxXWidth = 5e6;
|
|
|
21213
21225
|
elemStore,
|
|
21214
21226
|
fullColumnIdData
|
|
21215
21227
|
} = internalData;
|
|
21228
|
+
const mouseOpts = computeMouseOpts.value;
|
|
21216
21229
|
const tableBody = refTableBody.value;
|
|
21217
21230
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
21218
21231
|
if (tableBodyElem) {
|
|
@@ -21271,6 +21284,9 @@ const maxXWidth = 5e6;
|
|
|
21271
21284
|
if (scrollXSpaceEl) {
|
|
21272
21285
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
21273
21286
|
}
|
|
21287
|
+
if (isScrollXBig && mouseOpts.area) {
|
|
21288
|
+
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
21289
|
+
}
|
|
21274
21290
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
21275
21291
|
updateStyle();
|
|
21276
21292
|
});
|
|
@@ -21294,6 +21310,7 @@ const maxXWidth = 5e6;
|
|
|
21294
21310
|
const {
|
|
21295
21311
|
startIndex
|
|
21296
21312
|
} = scrollYStore;
|
|
21313
|
+
const mouseOpts = computeMouseOpts.value;
|
|
21297
21314
|
const expandOpts = computeExpandOpts.value;
|
|
21298
21315
|
const rowOpts = computeRowOpts.value;
|
|
21299
21316
|
const cellOpts = computeCellOpts.value;
|
|
@@ -21374,6 +21391,9 @@ const maxXWidth = 5e6;
|
|
|
21374
21391
|
reactData.scrollYTop = scrollYTop;
|
|
21375
21392
|
reactData.scrollYHeight = scrollYHeight;
|
|
21376
21393
|
reactData.isScrollYBig = isScrollYBig;
|
|
21394
|
+
if (isScrollYBig && mouseOpts.area) {
|
|
21395
|
+
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
21396
|
+
}
|
|
21377
21397
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
21378
21398
|
updateStyle();
|
|
21379
21399
|
});
|
|
@@ -22162,6 +22182,9 @@ const maxXWidth = 5e6;
|
|
|
22162
22182
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarYToLeft, () => {
|
|
22163
22183
|
reLayoutFlag.value++;
|
|
22164
22184
|
});
|
|
22185
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => core_.VxeUI.getLanguage(), () => {
|
|
22186
|
+
reLayoutFlag.value++;
|
|
22187
|
+
});
|
|
22165
22188
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reLayoutFlag, () => {
|
|
22166
22189
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => tableMethods.recalculate(true));
|
|
22167
22190
|
});
|
|
@@ -23172,7 +23195,7 @@ menu_hook_hooks.add('tableMenuModule', {
|
|
|
23172
23195
|
}
|
|
23173
23196
|
ctxMenuStore[property] = selectItem || menuList[0];
|
|
23174
23197
|
} else if (ctxMenuStore[property] && (hook_globalEvents.hasKey(evnt, hook_GLOBAL_EVENT_KEYS.ENTER) || hook_globalEvents.hasKey(evnt, hook_GLOBAL_EVENT_KEYS.SPACEBAR))) {
|
|
23175
|
-
|
|
23198
|
+
$xeTable.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
|
|
23176
23199
|
}
|
|
23177
23200
|
},
|
|
23178
23201
|
handleOpenMenuEvent,
|
|
@@ -23412,6 +23435,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23412
23435
|
computeTreeOpts,
|
|
23413
23436
|
computeValidOpts
|
|
23414
23437
|
} = $xeTable.getComputeMaps();
|
|
23438
|
+
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
23415
23439
|
let editMethods = {};
|
|
23416
23440
|
let editPrivateMethods = {};
|
|
23417
23441
|
const getEditColumnModel = (row, column) => {
|
|
@@ -24509,7 +24533,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
24509
24533
|
inputElem.select();
|
|
24510
24534
|
} else {
|
|
24511
24535
|
// 保持一致行为,光标移到末端
|
|
24512
|
-
if (
|
|
24536
|
+
if (browseObj.msie) {
|
|
24513
24537
|
const textRange = inputElem.createTextRange();
|
|
24514
24538
|
textRange.collapse(false);
|
|
24515
24539
|
textRange.select();
|
|
@@ -26449,10 +26473,11 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
26449
26473
|
const {
|
|
26450
26474
|
hooks: keyboard_hook_hooks
|
|
26451
26475
|
} = core_.VxeUI;
|
|
26476
|
+
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
26452
26477
|
function getTargetOffset(target, container) {
|
|
26453
26478
|
let offsetTop = 0;
|
|
26454
26479
|
let offsetLeft = 0;
|
|
26455
|
-
const triggerCheckboxLabel = !
|
|
26480
|
+
const triggerCheckboxLabel = !browseObj.firefox && hasClass(target, 'vxe-checkbox--label');
|
|
26456
26481
|
if (triggerCheckboxLabel) {
|
|
26457
26482
|
const checkboxLabelStyle = getComputedStyle(target);
|
|
26458
26483
|
offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(checkboxLabelStyle.paddingTop);
|