vxe-table 4.17.0-beta.8 → 4.17.0-beta.9
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/keyboard/hook.js +4 -26
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +6 -5
- package/lib/index.umd.js +16 -38
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/keyboard/hook.js +3 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- 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/lib/ui/src/utils.js +8 -5
- package/lib/ui/src/utils.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/module/keyboard/hook.ts +4 -28
- package/packages/ui/src/utils.ts +7 -5
- /package/es/{iconfont.1760580064178.ttf → iconfont.1760602279303.ttf} +0 -0
- /package/es/{iconfont.1760580064178.woff → iconfont.1760602279303.woff} +0 -0
- /package/es/{iconfont.1760580064178.woff2 → iconfont.1760602279303.woff2} +0 -0
- /package/lib/{iconfont.1760580064178.ttf → iconfont.1760602279303.ttf} +0 -0
- /package/lib/{iconfont.1760580064178.woff → iconfont.1760602279303.woff} +0 -0
- /package/lib/{iconfont.1760580064178.woff2 → iconfont.1760602279303.woff2} +0 -0
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { getRefElem } from '../../src/util';
|
|
4
|
-
import {
|
|
4
|
+
import { getAbsolutePos, addClass, removeClass, hasControlKey } from '../../../ui/src/dom';
|
|
5
5
|
const { hooks } = VxeUI;
|
|
6
|
-
const browseObj = XEUtils.browse();
|
|
7
|
-
function getTargetOffset(target, container) {
|
|
8
|
-
let offsetTop = 0;
|
|
9
|
-
let offsetLeft = 0;
|
|
10
|
-
const triggerCheckboxLabel = !browseObj.firefox && hasClass(target, 'vxe-checkbox--label');
|
|
11
|
-
if (triggerCheckboxLabel) {
|
|
12
|
-
const checkboxLabelStyle = getComputedStyle(target);
|
|
13
|
-
offsetTop -= XEUtils.toNumber(checkboxLabelStyle.paddingTop);
|
|
14
|
-
offsetLeft -= XEUtils.toNumber(checkboxLabelStyle.paddingLeft);
|
|
15
|
-
}
|
|
16
|
-
while (target && target !== container) {
|
|
17
|
-
offsetTop += target.offsetTop;
|
|
18
|
-
offsetLeft += target.offsetLeft;
|
|
19
|
-
target = target.offsetParent;
|
|
20
|
-
if (triggerCheckboxLabel) {
|
|
21
|
-
const checkboxStyle = getComputedStyle(target);
|
|
22
|
-
offsetTop -= XEUtils.toNumber(checkboxStyle.paddingTop);
|
|
23
|
-
offsetLeft -= XEUtils.toNumber(checkboxStyle.paddingLeft);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return { offsetTop, offsetLeft };
|
|
27
|
-
}
|
|
28
6
|
hooks.add('tableKeyboardModule', {
|
|
29
7
|
setupTable($xeTable) {
|
|
30
8
|
const { props, reactData, internalData } = $xeTable;
|
|
@@ -117,6 +95,7 @@ hooks.add('tableKeyboardModule', {
|
|
|
117
95
|
if (!bodyWrapperElem) {
|
|
118
96
|
return;
|
|
119
97
|
}
|
|
98
|
+
const bodyRect = bodyWrapperElem.getBoundingClientRect();
|
|
120
99
|
const el = refElem.value;
|
|
121
100
|
const disX = evnt.clientX;
|
|
122
101
|
const disY = evnt.clientY;
|
|
@@ -125,9 +104,8 @@ hooks.add('tableKeyboardModule', {
|
|
|
125
104
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
126
105
|
let lastRangeRows = [];
|
|
127
106
|
const marginSize = 1;
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
const startLeft = offsetRest.offsetLeft + evnt.offsetX;
|
|
107
|
+
const startTop = evnt.clientY - bodyRect.y + bodyWrapperElem.scrollTop;
|
|
108
|
+
const startLeft = evnt.clientX - bodyRect.x + bodyWrapperElem.scrollLeft;
|
|
131
109
|
const startScrollTop = bodyWrapperElem.scrollTop;
|
|
132
110
|
const rowHeight = trElem.offsetHeight;
|
|
133
111
|
const trRect = trElem.getBoundingClientRect();
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/es/ui/src/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '@vxe-ui/core';
|
|
3
3
|
import DomZIndex from 'dom-zindex';
|
|
4
|
+
const { getConfig } = VxeUI;
|
|
4
5
|
export function isEnableConf(conf) {
|
|
5
6
|
return conf && conf.enabled !== false;
|
|
6
7
|
}
|
|
@@ -24,14 +25,14 @@ export function hasChildrenList(item) {
|
|
|
24
25
|
return item && item.children && item.children.length > 0;
|
|
25
26
|
}
|
|
26
27
|
export function getFuncText(content, args) {
|
|
27
|
-
if (content) {
|
|
28
|
-
|
|
29
|
-
return XEUtils.toValueString(translate ? translate('' + content, args) : content);
|
|
28
|
+
if (XEUtils.eqNull(content)) {
|
|
29
|
+
return '';
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
const translate = getConfig().translate;
|
|
32
|
+
return `${translate ? translate('' + content, args) : content}`;
|
|
32
33
|
}
|
|
33
34
|
export function formatText(value, placeholder) {
|
|
34
|
-
return '' + (isEmptyValue(value) ? (placeholder ?
|
|
35
|
+
return '' + (isEmptyValue(value) ? (placeholder ? getConfig().emptyCell : '') : value);
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* 判断值为:'' | null | undefined 时都属于空值
|
package/lib/index.umd.js
CHANGED
|
@@ -2830,7 +2830,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
2830
2830
|
config: function() { return /* reexport */ config; },
|
|
2831
2831
|
"default": function() { return /* binding */ entry_lib; },
|
|
2832
2832
|
formats: function() { return /* reexport */ formats; },
|
|
2833
|
-
getConfig: function() { return /* reexport */
|
|
2833
|
+
getConfig: function() { return /* reexport */ ui_getConfig; },
|
|
2834
2834
|
getI18n: function() { return /* reexport */ getI18n; },
|
|
2835
2835
|
getIcon: function() { return /* reexport */ getIcon; },
|
|
2836
2836
|
getTheme: function() { return /* reexport */ getTheme; },
|
|
@@ -2879,7 +2879,7 @@ __webpack_require__.d(components_namespaceObject, {
|
|
|
2879
2879
|
commands: function() { return commands; },
|
|
2880
2880
|
config: function() { return config; },
|
|
2881
2881
|
formats: function() { return formats; },
|
|
2882
|
-
getConfig: function() { return
|
|
2882
|
+
getConfig: function() { return ui_getConfig; },
|
|
2883
2883
|
getI18n: function() { return getI18n; },
|
|
2884
2884
|
getIcon: function() { return getIcon; },
|
|
2885
2885
|
getTheme: function() { return getTheme; },
|
|
@@ -3094,6 +3094,9 @@ updateVar();
|
|
|
3094
3094
|
|
|
3095
3095
|
|
|
3096
3096
|
|
|
3097
|
+
const {
|
|
3098
|
+
getConfig
|
|
3099
|
+
} = core_.VxeUI;
|
|
3097
3100
|
function isEnableConf(conf) {
|
|
3098
3101
|
return conf && conf.enabled !== false;
|
|
3099
3102
|
}
|
|
@@ -3120,14 +3123,14 @@ function hasChildrenList(item) {
|
|
|
3120
3123
|
return item && item.children && item.children.length > 0;
|
|
3121
3124
|
}
|
|
3122
3125
|
function getFuncText(content, args) {
|
|
3123
|
-
if (content) {
|
|
3124
|
-
|
|
3125
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(translate ? translate('' + content, args) : content);
|
|
3126
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(content)) {
|
|
3127
|
+
return '';
|
|
3126
3128
|
}
|
|
3127
|
-
|
|
3129
|
+
const translate = getConfig().translate;
|
|
3130
|
+
return `${translate ? translate('' + content, args) : content}`;
|
|
3128
3131
|
}
|
|
3129
3132
|
function formatText(value, placeholder) {
|
|
3130
|
-
return '' + (isEmptyValue(value) ? placeholder ?
|
|
3133
|
+
return '' + (isEmptyValue(value) ? placeholder ? getConfig().emptyCell : '' : value);
|
|
3131
3134
|
}
|
|
3132
3135
|
/**
|
|
3133
3136
|
* 判断值为:'' | null | undefined 时都属于空值
|
|
@@ -3138,7 +3141,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3141
|
;// ./packages/ui/index.ts
|
|
3139
3142
|
|
|
3140
3143
|
|
|
3141
|
-
const version = "4.17.0-beta.
|
|
3144
|
+
const version = "4.17.0-beta.9";
|
|
3142
3145
|
core_.VxeUI.version = version;
|
|
3143
3146
|
core_.VxeUI.tableVersion = version;
|
|
3144
3147
|
core_.VxeUI.setConfig({
|
|
@@ -3499,7 +3502,7 @@ core_.VxeUI.setIcon({
|
|
|
3499
3502
|
const setTheme = core_.VxeUI.setTheme;
|
|
3500
3503
|
const getTheme = core_.VxeUI.getTheme;
|
|
3501
3504
|
const setConfig = core_.VxeUI.setConfig;
|
|
3502
|
-
const
|
|
3505
|
+
const ui_getConfig = core_.VxeUI.getConfig;
|
|
3503
3506
|
const setIcon = core_.VxeUI.setIcon;
|
|
3504
3507
|
const getIcon = core_.VxeUI.getIcon;
|
|
3505
3508
|
const setLanguage = core_.VxeUI.setLanguage;
|
|
@@ -3650,7 +3653,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3650
3653
|
const {
|
|
3651
3654
|
log: log_log
|
|
3652
3655
|
} = core_.VxeUI;
|
|
3653
|
-
const log_version = `table v${"4.17.0-beta.
|
|
3656
|
+
const log_version = `table v${"4.17.0-beta.9"}`;
|
|
3654
3657
|
const warnLog = log_log.create('warn', log_version);
|
|
3655
3658
|
const errLog = log_log.create('error', log_version);
|
|
3656
3659
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -15784,31 +15787,6 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
15784
15787
|
const {
|
|
15785
15788
|
hooks: keyboard_hook_hooks
|
|
15786
15789
|
} = core_.VxeUI;
|
|
15787
|
-
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
15788
|
-
function getTargetOffset(target, container) {
|
|
15789
|
-
let offsetTop = 0;
|
|
15790
|
-
let offsetLeft = 0;
|
|
15791
|
-
const triggerCheckboxLabel = !browseObj.firefox && hasClass(target, 'vxe-checkbox--label');
|
|
15792
|
-
if (triggerCheckboxLabel) {
|
|
15793
|
-
const checkboxLabelStyle = getComputedStyle(target);
|
|
15794
|
-
offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(checkboxLabelStyle.paddingTop);
|
|
15795
|
-
offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(checkboxLabelStyle.paddingLeft);
|
|
15796
|
-
}
|
|
15797
|
-
while (target && target !== container) {
|
|
15798
|
-
offsetTop += target.offsetTop;
|
|
15799
|
-
offsetLeft += target.offsetLeft;
|
|
15800
|
-
target = target.offsetParent;
|
|
15801
|
-
if (triggerCheckboxLabel) {
|
|
15802
|
-
const checkboxStyle = getComputedStyle(target);
|
|
15803
|
-
offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(checkboxStyle.paddingTop);
|
|
15804
|
-
offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(checkboxStyle.paddingLeft);
|
|
15805
|
-
}
|
|
15806
|
-
}
|
|
15807
|
-
return {
|
|
15808
|
-
offsetTop,
|
|
15809
|
-
offsetLeft
|
|
15810
|
-
};
|
|
15811
|
-
}
|
|
15812
15790
|
keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
15813
15791
|
setupTable($xeTable) {
|
|
15814
15792
|
const {
|
|
@@ -15928,6 +15906,7 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
15928
15906
|
if (!bodyWrapperElem) {
|
|
15929
15907
|
return;
|
|
15930
15908
|
}
|
|
15909
|
+
const bodyRect = bodyWrapperElem.getBoundingClientRect();
|
|
15931
15910
|
const el = refElem.value;
|
|
15932
15911
|
const disX = evnt.clientX;
|
|
15933
15912
|
const disY = evnt.clientY;
|
|
@@ -15936,9 +15915,8 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
15936
15915
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
15937
15916
|
let lastRangeRows = [];
|
|
15938
15917
|
const marginSize = 1;
|
|
15939
|
-
const
|
|
15940
|
-
const
|
|
15941
|
-
const startLeft = offsetRest.offsetLeft + evnt.offsetX;
|
|
15918
|
+
const startTop = evnt.clientY - bodyRect.y + bodyWrapperElem.scrollTop;
|
|
15919
|
+
const startLeft = evnt.clientX - bodyRect.x + bodyWrapperElem.scrollLeft;
|
|
15942
15920
|
const startScrollTop = bodyWrapperElem.scrollTop;
|
|
15943
15921
|
const rowHeight = trElem.offsetHeight;
|
|
15944
15922
|
const trRect = trElem.getBoundingClientRect();
|