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.
Files changed (46) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/src/cell.js +25 -11
  6. package/es/table/src/util.js +16 -21
  7. package/es/table/style.css +15 -6
  8. package/es/table/style.min.css +1 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/dom.js +6 -0
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +15 -6
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/helper/vetur/attributes.json +1 -1
  15. package/helper/vetur/tags.json +1 -1
  16. package/lib/index.css +1 -1
  17. package/lib/index.min.css +1 -1
  18. package/lib/index.umd.js +41 -32
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/style.css +1 -1
  21. package/lib/style.min.css +1 -1
  22. package/lib/table/src/cell.js +16 -10
  23. package/lib/table/src/cell.min.js +1 -1
  24. package/lib/table/src/util.js +17 -20
  25. package/lib/table/src/util.min.js +1 -1
  26. package/lib/table/style/style.css +15 -6
  27. package/lib/table/style/style.min.css +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/dom.js +7 -0
  31. package/lib/ui/src/dom.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-table/style/style.css +15 -6
  35. package/lib/vxe-table/style/style.min.css +1 -1
  36. package/package.json +1 -1
  37. package/packages/table/src/cell.ts +25 -11
  38. package/packages/table/src/util.ts +16 -22
  39. package/packages/ui/src/dom.ts +7 -0
  40. package/styles/components/table.scss +23 -15
  41. /package/es/{iconfont.1746836522499.ttf → iconfont.1747008151774.ttf} +0 -0
  42. /package/es/{iconfont.1746836522499.woff → iconfont.1747008151774.woff} +0 -0
  43. /package/es/{iconfont.1746836522499.woff2 → iconfont.1747008151774.woff2} +0 -0
  44. /package/lib/{iconfont.1746836522499.ttf → iconfont.1747008151774.ttf} +0 -0
  45. /package/lib/{iconfont.1746836522499.woff → iconfont.1747008151774.woff} +0 -0
  46. /package/lib/{iconfont.1746836522499.woff2 → iconfont.1747008151774.woff2} +0 -0
@@ -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('i', {
14
- class: ['vxe-cell-title-prefix-icon', titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : '', titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX],
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('i', {
30
- class: ['vxe-cell-title-suffix-icon', titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : '', titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX],
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('i', {
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('i', {
1018
- class: ['vxe-cell--edit-icon', editOpts.icon || getIcon().TABLE_EDIT]
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
  }
@@ -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 getElementMarginWidth(elem) {
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.6);
259
- const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryCellElement(cell, ''));
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 = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--drag-handle'));
264
- const checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--checkbox'));
265
- const requiredIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'));
266
- const editIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'));
267
- const prefixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-prefix-icon'));
268
- const suffixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-suffix-icon'));
269
- const sortIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'));
270
- const filterIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'));
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 trOffsetParent = trElem.offsetParent;
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 tdOffsetParent = tdElem.offsetParent;
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)) {
@@ -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;