vxe-table 4.13.22 → 4.13.24
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/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/src/cell.js +25 -11
- package/es/table/src/util.js +16 -21
- package/es/table/style.css +15 -6
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +6 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +15 -6
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +41 -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/src/cell.js +16 -10
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/util.js +17 -20
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +15 -6
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +7 -0
- 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/lib/vxe-table/style/style.css +15 -6
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/src/cell.ts +25 -11
- package/packages/table/src/util.ts +16 -22
- package/packages/ui/src/dom.ts +7 -0
- package/styles/components/table.scss +23 -15
- /package/es/{iconfont.1746836522499.ttf → iconfont.1747008151774.ttf} +0 -0
- /package/es/{iconfont.1746836522499.woff → iconfont.1747008151774.woff} +0 -0
- /package/es/{iconfont.1746836522499.woff2 → iconfont.1747008151774.woff2} +0 -0
- /package/lib/{iconfont.1746836522499.ttf → iconfont.1747008151774.ttf} +0 -0
- /package/lib/{iconfont.1746836522499.woff → iconfont.1747008151774.woff} +0 -0
- /package/lib/{iconfont.1746836522499.woff2 → iconfont.1747008151774.woff2} +0 -0
package/es/table/src/cell.js
CHANGED
|
@@ -10,15 +10,19 @@ function renderTitlePrefixIcon(params) {
|
|
|
10
10
|
const { $table, column } = params;
|
|
11
11
|
const titlePrefix = column.titlePrefix || column.titleHelp;
|
|
12
12
|
if (titlePrefix) {
|
|
13
|
-
return h('
|
|
14
|
-
class: ['vxe-cell-title-prefix-icon', titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ''
|
|
13
|
+
return h('span', {
|
|
14
|
+
class: ['vxe-cell-title-prefix-icon', titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ''],
|
|
15
15
|
onMouseenter(evnt) {
|
|
16
16
|
$table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
|
|
17
17
|
},
|
|
18
18
|
onMouseleave(evnt) {
|
|
19
19
|
$table.handleTargetLeaveEvent(evnt);
|
|
20
20
|
}
|
|
21
|
-
}
|
|
21
|
+
}, [
|
|
22
|
+
h('i', {
|
|
23
|
+
class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
|
|
24
|
+
})
|
|
25
|
+
]);
|
|
22
26
|
}
|
|
23
27
|
return renderEmptyElement($table);
|
|
24
28
|
}
|
|
@@ -26,15 +30,19 @@ function renderTitleSuffixIcon(params) {
|
|
|
26
30
|
const { $table, column } = params;
|
|
27
31
|
const titleSuffix = column.titleSuffix;
|
|
28
32
|
if (titleSuffix) {
|
|
29
|
-
return h('
|
|
30
|
-
class: ['vxe-cell-title-suffix-icon', titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ''
|
|
33
|
+
return h('span', {
|
|
34
|
+
class: ['vxe-cell-title-suffix-icon', titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ''],
|
|
31
35
|
onMouseenter(evnt) {
|
|
32
36
|
$table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
|
|
33
37
|
},
|
|
34
38
|
onMouseleave(evnt) {
|
|
35
39
|
$table.handleTargetLeaveEvent(evnt);
|
|
36
40
|
}
|
|
37
|
-
}
|
|
41
|
+
}, [
|
|
42
|
+
h('i', {
|
|
43
|
+
class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
|
|
44
|
+
})
|
|
45
|
+
]);
|
|
38
46
|
}
|
|
39
47
|
return renderEmptyElement($table);
|
|
40
48
|
}
|
|
@@ -1009,14 +1017,20 @@ export const Cell = {
|
|
|
1009
1017
|
if (isEnableConf(editConfig)) {
|
|
1010
1018
|
editIconVNs = [
|
|
1011
1019
|
isRequired && editOpts.showAsterisk
|
|
1012
|
-
? h('
|
|
1020
|
+
? h('span', {
|
|
1013
1021
|
class: 'vxe-cell--required-icon'
|
|
1014
|
-
}
|
|
1022
|
+
}, [
|
|
1023
|
+
h('i')
|
|
1024
|
+
])
|
|
1015
1025
|
: renderEmptyElement($table),
|
|
1016
1026
|
isEnableConf(editRender) && editOpts.showIcon
|
|
1017
|
-
? h('
|
|
1018
|
-
class:
|
|
1019
|
-
}
|
|
1027
|
+
? h('span', {
|
|
1028
|
+
class: 'vxe-cell--edit-icon'
|
|
1029
|
+
}, [
|
|
1030
|
+
h('i', {
|
|
1031
|
+
class: editOpts.icon || getIcon().TABLE_EDIT
|
|
1032
|
+
})
|
|
1033
|
+
])
|
|
1020
1034
|
: renderEmptyElement($table)
|
|
1021
1035
|
];
|
|
1022
1036
|
}
|
package/es/table/src/util.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { watch, reactive, nextTick } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { ColumnInfo } from './columnInfo';
|
|
4
|
-
import { isPx, isScale } from '../../ui/src/dom';
|
|
4
|
+
import { isPx, isScale, queryElement } from '../../ui/src/dom';
|
|
5
5
|
import { eqEmptyValue } from '../../ui/src/utils';
|
|
6
6
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
7
7
|
const result = [];
|
|
@@ -165,7 +165,7 @@ function getPaddingLeftRightSize(elem) {
|
|
|
165
165
|
}
|
|
166
166
|
return 0;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function getElementMarginAndWidth(elem) {
|
|
169
169
|
if (elem) {
|
|
170
170
|
const computedStyle = getComputedStyle(elem);
|
|
171
171
|
const marginLeft = XEUtils.toNumber(computedStyle.marginLeft);
|
|
@@ -174,9 +174,6 @@ function getElementMarginWidth(elem) {
|
|
|
174
174
|
}
|
|
175
175
|
return 0;
|
|
176
176
|
}
|
|
177
|
-
function queryCellElement(cell, selector) {
|
|
178
|
-
return cell.querySelector('.vxe-cell' + selector);
|
|
179
|
-
}
|
|
180
177
|
export function toFilters(filters) {
|
|
181
178
|
if (filters && XEUtils.isArray(filters)) {
|
|
182
179
|
return filters.map(({ label, value, data, resetValue, checked }) => {
|
|
@@ -255,19 +252,19 @@ export function getColReMinWidth(params) {
|
|
|
255
252
|
const showTitle = headOverflow === 'title';
|
|
256
253
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip';
|
|
257
254
|
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
258
|
-
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.
|
|
259
|
-
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(
|
|
255
|
+
const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8);
|
|
256
|
+
const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, '.vxe-cell'));
|
|
260
257
|
let mWidth = minTitleWidth + paddingLeftRight;
|
|
261
258
|
// 默认最小宽处理
|
|
262
259
|
if (hasEllipsis) {
|
|
263
|
-
const dragIconWidth =
|
|
264
|
-
const checkboxIconWidth =
|
|
265
|
-
const requiredIconWidth =
|
|
266
|
-
const editIconWidth =
|
|
267
|
-
const prefixIconWidth =
|
|
268
|
-
const suffixIconWidth =
|
|
269
|
-
const sortIconWidth =
|
|
270
|
-
const filterIconWidth =
|
|
260
|
+
const dragIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--drag-handle'));
|
|
261
|
+
const checkboxIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--checkbox'));
|
|
262
|
+
const requiredIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--required-icon'));
|
|
263
|
+
const editIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--edit-icon'));
|
|
264
|
+
const prefixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-prefix-icon'));
|
|
265
|
+
const suffixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-suffix-icon'));
|
|
266
|
+
const sortIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--sort'));
|
|
267
|
+
const filterIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--filter'));
|
|
271
268
|
mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth;
|
|
272
269
|
}
|
|
273
270
|
// 如果设置最小宽
|
|
@@ -442,7 +439,7 @@ export function rowToVisible($xeTable, row) {
|
|
|
442
439
|
const internalData = $xeTable.internalData;
|
|
443
440
|
const { computeLeftFixedWidth, computeRightFixedWidth, computeRowOpts, computeCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps();
|
|
444
441
|
const { showOverflow } = tableProps;
|
|
445
|
-
const { scrollYLoad } = reactData;
|
|
442
|
+
const { scrollYLoad, scrollYTop } = reactData;
|
|
446
443
|
const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData;
|
|
447
444
|
const rowOpts = computeRowOpts.value;
|
|
448
445
|
const cellOpts = computeCellOpts.value;
|
|
@@ -456,8 +453,7 @@ export function rowToVisible($xeTable, row) {
|
|
|
456
453
|
const bodyScrollTop = bodyScrollElem.scrollTop;
|
|
457
454
|
const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
|
|
458
455
|
if (trElem) {
|
|
459
|
-
const
|
|
460
|
-
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
|
|
456
|
+
const trOffsetTop = trElem.offsetTop + (scrollYLoad ? scrollYTop : 0);
|
|
461
457
|
const trHeight = trElem.clientHeight;
|
|
462
458
|
// 检测行是否在可视区中
|
|
463
459
|
if (trOffsetTop < bodyScrollTop || trOffsetTop > bodyScrollTop + bodyHeight) {
|
|
@@ -499,7 +495,7 @@ export function colToVisible($xeTable, column, row) {
|
|
|
499
495
|
const reactData = $xeTable.reactData;
|
|
500
496
|
const internalData = $xeTable.internalData;
|
|
501
497
|
const { computeLeftFixedWidth, computeRightFixedWidth } = $xeTable.getComputeMaps();
|
|
502
|
-
const { scrollXLoad } = reactData;
|
|
498
|
+
const { scrollXLoad, scrollXLeft } = reactData;
|
|
503
499
|
const { elemStore, visibleColumn } = internalData;
|
|
504
500
|
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
505
501
|
const rightFixedWidth = computeRightFixedWidth.value;
|
|
@@ -519,8 +515,7 @@ export function colToVisible($xeTable, column, row) {
|
|
|
519
515
|
tdElem = bodyScrollElem.querySelector(`.${column.id}`);
|
|
520
516
|
}
|
|
521
517
|
if (tdElem) {
|
|
522
|
-
const
|
|
523
|
-
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
|
|
518
|
+
const tdOffsetLeft = tdElem.offsetLeft + (scrollXLoad ? scrollXLeft : 0);
|
|
524
519
|
const cellWidth = tdElem.clientWidth;
|
|
525
520
|
// 检测是否在可视区中
|
|
526
521
|
if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
|
package/es/table/style.css
CHANGED
|
@@ -2291,29 +2291,38 @@
|
|
|
2291
2291
|
position: relative;
|
|
2292
2292
|
font-weight: var(--vxe-ui-table-header-font-weight);
|
|
2293
2293
|
}
|
|
2294
|
-
.vxe-header--column.col--ellipsis > .vxe-cell {
|
|
2294
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper {
|
|
2295
2295
|
display: flex;
|
|
2296
2296
|
align-items: center;
|
|
2297
2297
|
}
|
|
2298
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell--drag-handle,
|
|
2299
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell--sort,
|
|
2300
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell--filter,
|
|
2301
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell-title-prefix-icon,
|
|
2302
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell-title-suffix-icon,
|
|
2303
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell--checkbox,
|
|
2304
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell-title-suffix-icon,
|
|
2305
|
+
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--wrapper .vxe-cell--required-icon {
|
|
2306
|
+
flex-shrink: 0;
|
|
2307
|
+
}
|
|
2298
2308
|
.vxe-header--column.col--ellipsis > .vxe-cell .vxe-cell--title {
|
|
2299
2309
|
overflow: hidden;
|
|
2300
2310
|
text-overflow: ellipsis;
|
|
2301
2311
|
white-space: nowrap;
|
|
2302
2312
|
}
|
|
2303
|
-
.vxe-header--column.col--ellipsis > .vxe-cell > i:not(.vxe-cell--title), .vxe-header--column.col--ellipsis > .vxe-cell > span:not(.vxe-cell--title) {
|
|
2304
|
-
flex-shrink: 0;
|
|
2305
|
-
}
|
|
2306
2313
|
.vxe-header--column .vxe-cell--required-icon {
|
|
2307
2314
|
display: inline-block;
|
|
2308
2315
|
color: var(--vxe-ui-table-validate-error-color);
|
|
2309
2316
|
width: 0.8em;
|
|
2310
2317
|
height: 1em;
|
|
2311
2318
|
line-height: 1em;
|
|
2319
|
+
position: relative;
|
|
2320
|
+
}
|
|
2321
|
+
.vxe-header--column .vxe-cell--required-icon > i {
|
|
2312
2322
|
font-family: Verdana, Arial, Tahoma;
|
|
2313
2323
|
font-weight: normal;
|
|
2314
|
-
position: relative;
|
|
2315
2324
|
}
|
|
2316
|
-
.vxe-header--column .vxe-cell--required-icon:before {
|
|
2325
|
+
.vxe-header--column .vxe-cell--required-icon > i:before {
|
|
2317
2326
|
content: "*";
|
|
2318
2327
|
position: absolute;
|
|
2319
2328
|
left: 0;
|