vxe-table 4.12.1 → 4.12.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/hook.js +3 -2
- package/es/table/module/keyboard/hook.js +3 -2
- package/es/table/src/table.js +13 -8
- 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 +18 -12
- 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/src/table.js +12 -7
- 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/src/table.ts +14 -8
- package/packages/ui/src/dom.ts +0 -2
- /package/es/{iconfont.1743045589885.ttf → iconfont.1743125693758.ttf} +0 -0
- /package/es/{iconfont.1743045589885.woff → iconfont.1743125693758.woff} +0 -0
- /package/es/{iconfont.1743045589885.woff2 → iconfont.1743125693758.woff2} +0 -0
- /package/lib/{iconfont.1743045589885.ttf → iconfont.1743125693758.ttf} +0 -0
- /package/lib/{iconfont.1743045589885.woff → iconfont.1743125693758.woff} +0 -0
- /package/lib/{iconfont.1743045589885.woff2 → iconfont.1743125693758.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');
|
|
@@ -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) {
|
|
@@ -6656,7 +6657,7 @@ export default defineComponent({
|
|
|
6656
6657
|
* @param {Event} evnt 事件
|
|
6657
6658
|
* @param {Row} row 行对象
|
|
6658
6659
|
*/
|
|
6659
|
-
const handleTooltip = (evnt, tdEl, overflowElem, params) => {
|
|
6660
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
6660
6661
|
const tipOverEl = overflowElem || tdEl;
|
|
6661
6662
|
if (!tipOverEl) {
|
|
6662
6663
|
return nextTick();
|
|
@@ -6669,7 +6670,8 @@ export default defineComponent({
|
|
|
6669
6670
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
6670
6671
|
const useCustom = contentMethod && !XEUtils.eqNull(customContent);
|
|
6671
6672
|
const content = useCustom ? customContent : XEUtils.toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
6672
|
-
|
|
6673
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
6674
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
6673
6675
|
Object.assign(tooltipStore, {
|
|
6674
6676
|
row,
|
|
6675
6677
|
column,
|
|
@@ -6679,7 +6681,7 @@ export default defineComponent({
|
|
|
6679
6681
|
nextTick(() => {
|
|
6680
6682
|
const $tooltip = refTooltip.value;
|
|
6681
6683
|
if ($tooltip && $tooltip.open) {
|
|
6682
|
-
$tooltip.open(tipOverEl, formatText(content));
|
|
6684
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, formatText(content));
|
|
6683
6685
|
}
|
|
6684
6686
|
});
|
|
6685
6687
|
}
|
|
@@ -7646,7 +7648,7 @@ export default defineComponent({
|
|
|
7646
7648
|
return;
|
|
7647
7649
|
}
|
|
7648
7650
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
7649
|
-
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
7651
|
+
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--wrapper'), thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
7650
7652
|
}
|
|
7651
7653
|
},
|
|
7652
7654
|
/**
|
|
@@ -7673,7 +7675,7 @@ export default defineComponent({
|
|
|
7673
7675
|
}
|
|
7674
7676
|
}
|
|
7675
7677
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
7676
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7678
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7677
7679
|
}
|
|
7678
7680
|
},
|
|
7679
7681
|
/**
|
|
@@ -7685,7 +7687,7 @@ export default defineComponent({
|
|
|
7685
7687
|
const tdEl = evnt.currentTarget;
|
|
7686
7688
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
7687
7689
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
7688
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7690
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
7689
7691
|
}
|
|
7690
7692
|
},
|
|
7691
7693
|
handleTargetLeaveEvent() {
|
|
@@ -10164,6 +10166,9 @@ export default defineComponent({
|
|
|
10164
10166
|
watch(computeScrollbarYToLeft, () => {
|
|
10165
10167
|
reLayoutFlag.value++;
|
|
10166
10168
|
});
|
|
10169
|
+
watch(() => VxeUI.getLanguage(), () => {
|
|
10170
|
+
reLayoutFlag.value++;
|
|
10171
|
+
});
|
|
10167
10172
|
watch(reLayoutFlag, () => {
|
|
10168
10173
|
nextTick(() => tableMethods.recalculate(true));
|
|
10169
10174
|
});
|
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.2";
|
|
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.2"}`;
|
|
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');
|
|
@@ -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) {
|
|
@@ -18137,7 +18137,7 @@ const maxXWidth = 5e6;
|
|
|
18137
18137
|
* @param {Event} evnt 事件
|
|
18138
18138
|
* @param {Row} row 行对象
|
|
18139
18139
|
*/
|
|
18140
|
-
const handleTooltip = (evnt, tdEl, overflowElem, params) => {
|
|
18140
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
18141
18141
|
const tipOverEl = overflowElem || tdEl;
|
|
18142
18142
|
if (!tipOverEl) {
|
|
18143
18143
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -18158,7 +18158,8 @@ const maxXWidth = 5e6;
|
|
|
18158
18158
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
18159
18159
|
const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
|
|
18160
18160
|
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
|
-
|
|
18161
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
18162
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
18162
18163
|
Object.assign(tooltipStore, {
|
|
18163
18164
|
row,
|
|
18164
18165
|
column,
|
|
@@ -18168,7 +18169,7 @@ const maxXWidth = 5e6;
|
|
|
18168
18169
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
18169
18170
|
const $tooltip = refTooltip.value;
|
|
18170
18171
|
if ($tooltip && $tooltip.open) {
|
|
18171
|
-
$tooltip.open(tipOverEl, formatText(content));
|
|
18172
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, formatText(content));
|
|
18172
18173
|
}
|
|
18173
18174
|
});
|
|
18174
18175
|
}
|
|
@@ -19300,7 +19301,7 @@ const maxXWidth = 5e6;
|
|
|
19300
19301
|
return;
|
|
19301
19302
|
}
|
|
19302
19303
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
19303
|
-
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
19304
|
+
handleTooltip(evnt, thEl, thEl.querySelector('.vxe-cell--wrapper'), thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
19304
19305
|
}
|
|
19305
19306
|
},
|
|
19306
19307
|
/**
|
|
@@ -19338,7 +19339,7 @@ const maxXWidth = 5e6;
|
|
|
19338
19339
|
}
|
|
19339
19340
|
}
|
|
19340
19341
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
19341
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19342
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19342
19343
|
}
|
|
19343
19344
|
},
|
|
19344
19345
|
/**
|
|
@@ -19354,7 +19355,7 @@ const maxXWidth = 5e6;
|
|
|
19354
19355
|
const tdEl = evnt.currentTarget;
|
|
19355
19356
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
19356
19357
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
19357
|
-
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19358
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
19358
19359
|
}
|
|
19359
19360
|
},
|
|
19360
19361
|
handleTargetLeaveEvent() {
|
|
@@ -22162,6 +22163,9 @@ const maxXWidth = 5e6;
|
|
|
22162
22163
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarYToLeft, () => {
|
|
22163
22164
|
reLayoutFlag.value++;
|
|
22164
22165
|
});
|
|
22166
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => core_.VxeUI.getLanguage(), () => {
|
|
22167
|
+
reLayoutFlag.value++;
|
|
22168
|
+
});
|
|
22165
22169
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reLayoutFlag, () => {
|
|
22166
22170
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => tableMethods.recalculate(true));
|
|
22167
22171
|
});
|
|
@@ -23412,6 +23416,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23412
23416
|
computeTreeOpts,
|
|
23413
23417
|
computeValidOpts
|
|
23414
23418
|
} = $xeTable.getComputeMaps();
|
|
23419
|
+
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
23415
23420
|
let editMethods = {};
|
|
23416
23421
|
let editPrivateMethods = {};
|
|
23417
23422
|
const getEditColumnModel = (row, column) => {
|
|
@@ -24509,7 +24514,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
24509
24514
|
inputElem.select();
|
|
24510
24515
|
} else {
|
|
24511
24516
|
// 保持一致行为,光标移到末端
|
|
24512
|
-
if (
|
|
24517
|
+
if (browseObj.msie) {
|
|
24513
24518
|
const textRange = inputElem.createTextRange();
|
|
24514
24519
|
textRange.collapse(false);
|
|
24515
24520
|
textRange.select();
|
|
@@ -26449,10 +26454,11 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
26449
26454
|
const {
|
|
26450
26455
|
hooks: keyboard_hook_hooks
|
|
26451
26456
|
} = core_.VxeUI;
|
|
26457
|
+
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
26452
26458
|
function getTargetOffset(target, container) {
|
|
26453
26459
|
let offsetTop = 0;
|
|
26454
26460
|
let offsetLeft = 0;
|
|
26455
|
-
const triggerCheckboxLabel = !
|
|
26461
|
+
const triggerCheckboxLabel = !browseObj.firefox && hasClass(target, 'vxe-checkbox--label');
|
|
26456
26462
|
if (triggerCheckboxLabel) {
|
|
26457
26463
|
const checkboxLabelStyle = getComputedStyle(target);
|
|
26458
26464
|
offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(checkboxLabelStyle.paddingTop);
|