vxe-table 3.15.22 → 3.15.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 +21 -7
  6. package/es/table/src/util.js +12 -15
  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 +32 -23
  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 +13 -7
  23. package/lib/table/src/cell.min.js +1 -1
  24. package/lib/table/src/util.js +11 -14
  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 +21 -7
  38. package/packages/table/src/util.ts +12 -16
  39. package/packages/ui/src/dom.ts +7 -0
  40. package/styles/components/table.scss +23 -15
  41. /package/es/{iconfont.1746836465256.ttf → iconfont.1746864347026.ttf} +0 -0
  42. /package/es/{iconfont.1746836465256.woff → iconfont.1746864347026.woff} +0 -0
  43. /package/es/{iconfont.1746836465256.woff2 → iconfont.1746864347026.woff2} +0 -0
  44. /package/lib/{iconfont.1746836465256.ttf → iconfont.1746864347026.ttf} +0 -0
  45. /package/lib/{iconfont.1746836465256.woff → iconfont.1746864347026.woff} +0 -0
  46. /package/lib/{iconfont.1746836465256.woff2 → iconfont.1746864347026.woff2} +0 -0
@@ -10,7 +10,7 @@ function renderTitlePrefixIcon(h, params) {
10
10
  const titlePrefix = column.titlePrefix || column.titleHelp;
11
11
  if (titlePrefix) {
12
12
  return h('i', {
13
- class: ['vxe-cell-title-prefix-icon', titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : '', titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX],
13
+ class: ['vxe-cell-title-prefix-icon', titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ''],
14
14
  on: {
15
15
  mouseenter(evnt) {
16
16
  $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
@@ -19,7 +19,11 @@ function renderTitlePrefixIcon(h, params) {
19
19
  $table.handleTargetLeaveEvent(evnt);
20
20
  }
21
21
  }
22
- });
22
+ }, [
23
+ h('i', {
24
+ class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
25
+ })
26
+ ]);
23
27
  }
24
28
  return renderEmptyElement($table);
25
29
  }
@@ -28,7 +32,7 @@ function renderTitleSuffixIcon(h, params) {
28
32
  const titleSuffix = column.titleSuffix;
29
33
  if (titleSuffix) {
30
34
  return h('i', {
31
- class: ['vxe-cell-title-suffix-icon', titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : '', titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX],
35
+ class: ['vxe-cell-title-suffix-icon', titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ''],
32
36
  on: {
33
37
  mouseenter(evnt) {
34
38
  $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
@@ -37,7 +41,11 @@ function renderTitleSuffixIcon(h, params) {
37
41
  $table.handleTargetLeaveEvent(evnt);
38
42
  }
39
43
  }
40
- });
44
+ }, [
45
+ h('i', {
46
+ class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
47
+ })
48
+ ]);
41
49
  }
42
50
  return renderEmptyElement($table);
43
51
  }
@@ -1019,12 +1027,18 @@ export const Cell = {
1019
1027
  isRequired && editOpts.showAsterisk
1020
1028
  ? h('i', {
1021
1029
  class: 'vxe-cell--required-icon'
1022
- })
1030
+ }, [
1031
+ h('i', {
1032
+ class: 'vxe-cell--required-icon'
1033
+ })
1034
+ ])
1023
1035
  : renderEmptyElement($table),
1024
1036
  isEnableConf(editRender) && editOpts.showIcon
1025
1037
  ? h('i', {
1026
- class: ['vxe-cell--edit-icon', editOpts.icon || getIcon().TABLE_EDIT]
1027
- })
1038
+ class: 'vxe-cell--edit-icon'
1039
+ }, [
1040
+ h('i')
1041
+ ])
1028
1042
  : renderEmptyElement($table)
1029
1043
  ];
1030
1044
  }
@@ -1,6 +1,6 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import { ColumnInfo } from './columnInfo';
3
- import { isScale, isPx } from '../../ui/src/dom';
3
+ import { isScale, isPx, queryElement } from '../../ui/src/dom';
4
4
  import { warnLog, errLog } from '../../ui/src/log';
5
5
  import { eqEmptyValue } from '../../ui/src/utils';
6
6
  const getAllConvertColumns = (columns, parentColumn) => {
@@ -154,7 +154,7 @@ function getPaddingLeftRightSize(elem) {
154
154
  }
155
155
  return 0;
156
156
  }
157
- function getElementMarginWidth(elem) {
157
+ function getElementMarginAndWidth(elem) {
158
158
  if (elem) {
159
159
  const computedStyle = getComputedStyle(elem);
160
160
  const marginLeft = XEUtils.toNumber(computedStyle.marginLeft);
@@ -232,9 +232,6 @@ export function getRootColumn($xeTable, column) {
232
232
  }
233
233
  return column;
234
234
  }
235
- function queryCellElement(cell, selector) {
236
- return cell.querySelector('.vxe-cell' + selector);
237
- }
238
235
  export function toFilters(filters) {
239
236
  if (filters && XEUtils.isArray(filters)) {
240
237
  return filters.map(({ label, value, data, resetValue, checked }) => {
@@ -262,19 +259,19 @@ export function getColReMinWidth(params) {
262
259
  const showTitle = headOverflow === 'title';
263
260
  const showTooltip = headOverflow === true || headOverflow === 'tooltip';
264
261
  const hasEllipsis = showTitle || showTooltip || showEllipsis;
265
- const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.6);
266
- const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryCellElement(cell, ''));
262
+ const minTitleWidth = XEUtils.floor((XEUtils.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.8);
263
+ const paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryElement(cell, '.vxe-cell'));
267
264
  let mWidth = minTitleWidth + paddingLeftRight;
268
265
  // 默认最小宽处理
269
266
  if (hasEllipsis) {
270
- const dragIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--drag-handle'));
271
- const checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '>.vxe-cell--checkbox'));
272
- const requiredIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'));
273
- const editIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'));
274
- const prefixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-prefix-icon'));
275
- const suffixIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell-title-suffix-icon'));
276
- const sortIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'));
277
- const filterIconWidth = getElementMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'));
267
+ const dragIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--drag-handle'));
268
+ const checkboxIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--checkbox'));
269
+ const requiredIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--required-icon'));
270
+ const editIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--edit-icon'));
271
+ const prefixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-prefix-icon'));
272
+ const suffixIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell-title-suffix-icon'));
273
+ const sortIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--sort'));
274
+ const filterIconWidth = getElementMarginAndWidth(queryElement(cell, '.vxe-cell--filter'));
278
275
  mWidth += dragIconWidth + checkboxIconWidth + requiredIconWidth + editIconWidth + prefixIconWidth + suffixIconWidth + filterIconWidth + sortIconWidth;
279
276
  }
280
277
  // 如果设置最小宽
@@ -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;